1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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 "volFields.H"
28 #include "surfaceFields.H"
30 #include "laplacianScheme.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 GeometricField<Type, fvPatchField, volMesh>& vf,
52 surfaceScalarField Gamma
62 dimensionedScalar("1", dimless, 1.0)
65 return fvm::laplacian(Gamma, vf, name);
73 GeometricField<Type, fvPatchField, volMesh>& vf
76 surfaceScalarField Gamma
86 dimensionedScalar("1", dimless, 1.0)
93 "laplacian(" + vf.name() + ')'
103 GeometricField<Type, fvPatchField, volMesh>& vf,
107 return tmp<fvMatrix<Type> >
109 new fvMatrix<Type>(vf, dimensionSet(0, 0, -2, 0, 0))
119 GeometricField<Type, fvPatchField, volMesh>& vf
122 return tmp<fvMatrix<Type> >
124 new fvMatrix<Type>(vf, dimensionSet(0, 0, -2, 0, 0))
134 GeometricField<Type, fvPatchField, volMesh>& vf,
138 return fvm::laplacian(vf, name);
147 GeometricField<Type, fvPatchField, volMesh>& vf
150 return fvm::laplacian(vf);
154 template<class Type, class GType>
158 const dimensioned<GType>& gamma,
159 GeometricField<Type, fvPatchField, volMesh>& vf,
163 GeometricField<GType, fvsPatchField, surfaceMesh> Gamma
176 return fvm::laplacian(Gamma, vf, name);
180 template<class Type, class GType>
184 const dimensioned<GType>& gamma,
185 GeometricField<Type, fvPatchField, volMesh>& vf
188 GeometricField<GType, fvsPatchField, surfaceMesh> Gamma
201 return fvm::laplacian(Gamma, vf);
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 template<class Type, class GType>
211 const GeometricField<GType, fvPatchField, volMesh>& gamma,
212 GeometricField<Type, fvPatchField, volMesh>& vf,
216 return fv::laplacianScheme<Type, GType>::New
219 vf.mesh().laplacianScheme(name)
220 )().fvmLaplacian(gamma, vf);
224 template<class Type, class GType>
228 const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
229 GeometricField<Type, fvPatchField, volMesh>& vf,
233 tmp<fvMatrix<Type> > Laplacian(fvm::laplacian(tgamma(), vf, name));
239 template<class Type, class GType>
243 const GeometricField<GType, fvPatchField, volMesh>& gamma,
244 GeometricField<Type, fvPatchField, volMesh>& vf
247 return fvm::laplacian
251 "laplacian(" + gamma.name() + ',' + vf.name() + ')'
256 template<class Type, class GType>
260 const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
261 GeometricField<Type, fvPatchField, volMesh>& vf
264 tmp<fvMatrix<Type> > Laplacian(fvm::laplacian(tgamma(), vf));
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
272 template<class Type, class GType>
276 const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
277 GeometricField<Type, fvPatchField, volMesh>& vf,
281 return fv::laplacianScheme<Type, GType>::New
284 vf.mesh().laplacianScheme(name)
285 )().fvmLaplacian(gamma, vf);
289 template<class Type, class GType>
293 const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
294 GeometricField<Type, fvPatchField, volMesh>& vf,
298 tmp<fvMatrix<Type> > tLaplacian = fvm::laplacian(tgamma(), vf, name);
304 template<class Type, class GType>
308 const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
309 GeometricField<Type, fvPatchField, volMesh>& vf
312 return fvm::laplacian
316 "laplacian(" + gamma.name() + ',' + vf.name() + ')'
321 template<class Type, class GType>
325 const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tGamma,
326 GeometricField<Type, fvPatchField, volMesh>& vf
329 tmp<fvMatrix<Type> > tfvm(fvm::laplacian(tGamma(), vf));
335 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
337 } // End namespace fvm
339 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
341 } // End namespace Foam
343 // ************************************************************************* //