initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / finiteVolume / finiteVolume / fvc / fvcLaplacian.C
blobcea55ad695a0e856755d9bcfcc427cbec3c14e11
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "fvcLaplacian.H"
28 #include "fvMesh.H"
29 #include "laplacianScheme.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace Foam
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 namespace fvc
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 template<class Type>
44 tmp<GeometricField<Type, fvPatchField, volMesh> >
45 laplacian
47     const GeometricField<Type, fvPatchField, volMesh>& vf,
48     const word& name
51     return fv::laplacianScheme<Type, scalar>::New
52     (
53         vf.mesh(),
54         vf.mesh().laplacianScheme(name)
55     )().fvcLaplacian(vf);
59 template<class Type>
60 tmp<GeometricField<Type, fvPatchField, volMesh> >
61 laplacian
63     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
64     const word& name
67     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
68     (
69         fvc::laplacian(tvf(), name)
70     );
71     tvf.clear();
72     return Laplacian;
76 template<class Type>
77 tmp<GeometricField<Type, fvPatchField, volMesh> >
78 laplacian
80     const GeometricField<Type, fvPatchField, volMesh>& vf
83     return fvc::laplacian(vf, "laplacian(" + vf.name() + ')');
87 template<class Type>
88 tmp<GeometricField<Type, fvPatchField, volMesh> >
89 laplacian
91     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
94     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
95     (
96         fvc::laplacian(tvf())
97     );
98     tvf.clear();
99     return Laplacian;
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 template<class Type, class GType>
106 tmp<GeometricField<Type, fvPatchField, volMesh> >
107 laplacian
109     const dimensioned<GType>& gamma,
110     const GeometricField<Type, fvPatchField, volMesh>& vf,
111     const word& name
114     return gamma*fvc::laplacian(vf, name);
118 template<class Type, class GType>
119 tmp<GeometricField<Type, fvPatchField, volMesh> >
120 laplacian
122     const dimensioned<GType>& gamma,
123     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
124     const word& name
127     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
128     (
129         fvc::laplacian(gamma, tvf(), name)
130     );
131     tvf.clear();
132     return Laplacian;
136 template<class Type, class GType>
137 tmp<GeometricField<Type, fvPatchField, volMesh> >
138 laplacian
140     const dimensioned<GType>& gamma,
141     const GeometricField<Type, fvPatchField, volMesh>& vf
144     return gamma*fvc::laplacian
145     (
146         vf, "laplacian(" + gamma.name() + ',' + vf.name() + ')'
147     );
151 template<class Type, class GType>
152 tmp<GeometricField<Type, fvPatchField, volMesh> >
153 laplacian
155     const dimensioned<GType>& gamma,
156     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
159     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
160     (
161         fvc::laplacian(gamma, tvf())
162     );
163     tvf.clear();
164     return Laplacian;
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 template<class Type, class GType>
171 tmp<GeometricField<Type, fvPatchField, volMesh> >
172 laplacian
174     const GeometricField<GType, fvPatchField, volMesh>& gamma,
175     const GeometricField<Type, fvPatchField, volMesh>& vf,
176     const word& name
179     return fv::laplacianScheme<Type, GType>::New
180     (
181         vf.mesh(),
182         vf.mesh().laplacianScheme(name)
183     )().fvcLaplacian(gamma, vf);
187 template<class Type, class GType>
188 tmp<GeometricField<Type, fvPatchField, volMesh> >
189 laplacian
191     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
192     const GeometricField<Type, fvPatchField, volMesh>& vf,
193     const word& name
196     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
197     (
198         fvc::laplacian(tgamma(), vf, name)
199     );
200     tgamma.clear();
201     return Laplacian;
205 template<class Type, class GType>
206 tmp<GeometricField<Type, fvPatchField, volMesh> >
207 laplacian
209     const GeometricField<GType, fvPatchField, volMesh>& gamma,
210     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
211     const word& name
214     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
215     (
216         fvc::laplacian(gamma, tvf(), name)
217     );
218     tvf.clear();
219     return Laplacian;
223 template<class Type, class GType>
224 tmp<GeometricField<Type, fvPatchField, volMesh> >
225 laplacian
227     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
228     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
229     const word& name
232     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
233     (
234         fvc::laplacian(tgamma(), tvf(), name)
235     );
236     tgamma.clear();
237     tvf.clear();
238     return Laplacian;
242 template<class Type, class GType>
243 tmp<GeometricField<Type, fvPatchField, volMesh> >
244 laplacian
246     const GeometricField<GType, fvPatchField, volMesh>& gamma,
247     const GeometricField<Type, fvPatchField, volMesh>& vf
250     return fvc::laplacian
251     (
252         gamma,
253         vf,
254         "laplacian(" + gamma.name() + ',' + vf.name() + ')'
255     );
259 template<class Type, class GType>
260 tmp<GeometricField<Type, fvPatchField, volMesh> >
261 laplacian
263     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
264     const GeometricField<Type, fvPatchField, volMesh>& vf
267     return fvc::laplacian
268     (
269         tgamma,
270         vf,
271         "laplacian(" + tgamma().name() + ',' + vf.name() + ')'
272     );
276 template<class Type, class GType>
277 tmp<GeometricField<Type, fvPatchField, volMesh> >
278 laplacian
280     const GeometricField<GType, fvPatchField, volMesh>& gamma,
281     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
284     return fvc::laplacian
285     (
286         gamma,
287         tvf,
288         "laplacian(" + gamma.name() + ',' + tvf().name() + ')'
289     );
293 template<class Type, class GType>
294 tmp<GeometricField<Type, fvPatchField, volMesh> >
295 laplacian
297     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
298     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
301     return fvc::laplacian
302     (
303         tgamma,
304         tvf,
305         "laplacian(" + tgamma().name() + ',' + tvf().name() + ')'
306     );
310 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
312 template<class Type, class GType>
313 tmp<GeometricField<Type, fvPatchField, volMesh> >
314 laplacian
316     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
317     const GeometricField<Type, fvPatchField, volMesh>& vf,
318     const word& name
321     return fv::laplacianScheme<Type, GType>::New
322     (
323         vf.mesh(),
324         vf.mesh().laplacianScheme(name)
325     )().fvcLaplacian(gamma, vf);
329 template<class Type, class GType>
330 tmp<GeometricField<Type, fvPatchField, volMesh> >
331 laplacian
333     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
334     const GeometricField<Type, fvPatchField, volMesh>& vf,
335     const word& name
338     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
339     (
340         fvc::laplacian(tgamma(), vf, name)
341     );
342     tgamma.clear();
343     return Laplacian;
347 template<class Type, class GType>
348 tmp<GeometricField<Type, fvPatchField, volMesh> >
349 laplacian
351     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
352     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
353     const word& name
356     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
357     (
358         fvc::laplacian(gamma, tvf(), name)
359     );
360     tvf.clear();
361     return Laplacian;
365 template<class Type, class GType>
366 tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian
368     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
369     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
370     const word& name
373     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
374     (
375         fvc::laplacian(tgamma(), tvf(), name)
376     );
377     tgamma.clear();
378     tvf.clear();
379     return Laplacian;
383 template<class Type, class GType>
384 tmp<GeometricField<Type, fvPatchField, volMesh> >
385 laplacian
387     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
388     const GeometricField<Type, fvPatchField, volMesh>& vf
391     return fvc::laplacian
392     (
393         gamma,
394         vf,
395         "laplacian(" + gamma.name() + ',' + vf.name() + ')'
396     );
400 template<class Type, class GType>
401 tmp<GeometricField<Type, fvPatchField, volMesh> >
402 laplacian
404     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
405     const GeometricField<Type, fvPatchField, volMesh>& vf
408     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
409     (
410         fvc::laplacian(tgamma(), vf)
411     );
412     tgamma.clear();
413     return Laplacian;
417 template<class Type, class GType>
418 tmp<GeometricField<Type, fvPatchField, volMesh> >
419 laplacian
421     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
422     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
425     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
426     (
427         fvc::laplacian(gamma, tvf())
428     );
429     tvf.clear();
430     return Laplacian;
434 template<class Type, class GType>
435 tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian
437     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
438     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
441     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
442     (
443         fvc::laplacian(tgamma(), tvf())
444     );
445     tgamma.clear();
446     tvf.clear();
447     return Laplacian;
451 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
453 } // End namespace fvc
455 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
457 } // End namespace Foam
459 // ************************************************************************* //