OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

fvcLaplacian.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "fvcLaplacian.H"
00028 #include "fvMesh.H"
00029 #include "laplacianScheme.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00037 
00038 namespace fvc
00039 {
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 template<class Type>
00044 tmp<GeometricField<Type, fvPatchField, volMesh> >
00045 laplacian
00046 (
00047     const GeometricField<Type, fvPatchField, volMesh>& vf,
00048     const word& name
00049 )
00050 {
00051     return fv::laplacianScheme<Type, scalar>::New
00052     (
00053         vf.mesh(),
00054         vf.mesh().laplacianScheme(name)
00055     )().fvcLaplacian(vf);
00056 }
00057 
00058 
00059 template<class Type>
00060 tmp<GeometricField<Type, fvPatchField, volMesh> >
00061 laplacian
00062 (
00063     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00064     const word& name
00065 )
00066 {
00067     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00068     (
00069         fvc::laplacian(tvf(), name)
00070     );
00071     tvf.clear();
00072     return Laplacian;
00073 }
00074 
00075 
00076 template<class Type>
00077 tmp<GeometricField<Type, fvPatchField, volMesh> >
00078 laplacian
00079 (
00080     const GeometricField<Type, fvPatchField, volMesh>& vf
00081 )
00082 {
00083     return fvc::laplacian(vf, "laplacian(" + vf.name() + ')');
00084 }
00085 
00086 
00087 template<class Type>
00088 tmp<GeometricField<Type, fvPatchField, volMesh> >
00089 laplacian
00090 (
00091     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00092 )
00093 {
00094     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00095     (
00096         fvc::laplacian(tvf())
00097     );
00098     tvf.clear();
00099     return Laplacian;
00100 }
00101 
00102 
00103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00104 
00105 template<class Type, class GType>
00106 tmp<GeometricField<Type, fvPatchField, volMesh> >
00107 laplacian
00108 (
00109     const dimensioned<GType>& gamma,
00110     const GeometricField<Type, fvPatchField, volMesh>& vf,
00111     const word& name
00112 )
00113 {
00114     return gamma*fvc::laplacian(vf, name);
00115 }
00116 
00117 
00118 template<class Type, class GType>
00119 tmp<GeometricField<Type, fvPatchField, volMesh> >
00120 laplacian
00121 (
00122     const dimensioned<GType>& gamma,
00123     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00124     const word& name
00125 )
00126 {
00127     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00128     (
00129         fvc::laplacian(gamma, tvf(), name)
00130     );
00131     tvf.clear();
00132     return Laplacian;
00133 }
00134 
00135 
00136 template<class Type, class GType>
00137 tmp<GeometricField<Type, fvPatchField, volMesh> >
00138 laplacian
00139 (
00140     const dimensioned<GType>& gamma,
00141     const GeometricField<Type, fvPatchField, volMesh>& vf
00142 )
00143 {
00144     return gamma*fvc::laplacian
00145     (
00146         vf, "laplacian(" + gamma.name() + ',' + vf.name() + ')'
00147     );
00148 }
00149 
00150 
00151 template<class Type, class GType>
00152 tmp<GeometricField<Type, fvPatchField, volMesh> >
00153 laplacian
00154 (
00155     const dimensioned<GType>& gamma,
00156     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00157 )
00158 {
00159     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00160     (
00161         fvc::laplacian(gamma, tvf())
00162     );
00163     tvf.clear();
00164     return Laplacian;
00165 }
00166 
00167 
00168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00169 
00170 template<class Type, class GType>
00171 tmp<GeometricField<Type, fvPatchField, volMesh> >
00172 laplacian
00173 (
00174     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00175     const GeometricField<Type, fvPatchField, volMesh>& vf,
00176     const word& name
00177 )
00178 {
00179     return fv::laplacianScheme<Type, GType>::New
00180     (
00181         vf.mesh(),
00182         vf.mesh().laplacianScheme(name)
00183     )().fvcLaplacian(gamma, vf);
00184 }
00185 
00186 
00187 template<class Type, class GType>
00188 tmp<GeometricField<Type, fvPatchField, volMesh> >
00189 laplacian
00190 (
00191     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00192     const GeometricField<Type, fvPatchField, volMesh>& vf,
00193     const word& name
00194 )
00195 {
00196     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00197     (
00198         fvc::laplacian(tgamma(), vf, name)
00199     );
00200     tgamma.clear();
00201     return Laplacian;
00202 }
00203 
00204 
00205 template<class Type, class GType>
00206 tmp<GeometricField<Type, fvPatchField, volMesh> >
00207 laplacian
00208 (
00209     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00210     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00211     const word& name
00212 )
00213 {
00214     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00215     (
00216         fvc::laplacian(gamma, tvf(), name)
00217     );
00218     tvf.clear();
00219     return Laplacian;
00220 }
00221 
00222 
00223 template<class Type, class GType>
00224 tmp<GeometricField<Type, fvPatchField, volMesh> >
00225 laplacian
00226 (
00227     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00228     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00229     const word& name
00230 )
00231 {
00232     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00233     (
00234         fvc::laplacian(tgamma(), tvf(), name)
00235     );
00236     tgamma.clear();
00237     tvf.clear();
00238     return Laplacian;
00239 }
00240 
00241 
00242 template<class Type, class GType>
00243 tmp<GeometricField<Type, fvPatchField, volMesh> >
00244 laplacian
00245 (
00246     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00247     const GeometricField<Type, fvPatchField, volMesh>& vf
00248 )
00249 {
00250     return fvc::laplacian
00251     (
00252         gamma,
00253         vf,
00254         "laplacian(" + gamma.name() + ',' + vf.name() + ')'
00255     );
00256 }
00257 
00258 
00259 template<class Type, class GType>
00260 tmp<GeometricField<Type, fvPatchField, volMesh> >
00261 laplacian
00262 (
00263     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00264     const GeometricField<Type, fvPatchField, volMesh>& vf
00265 )
00266 {
00267     return fvc::laplacian
00268     (
00269         tgamma,
00270         vf,
00271         "laplacian(" + tgamma().name() + ',' + vf.name() + ')'
00272     );
00273 }
00274 
00275 
00276 template<class Type, class GType>
00277 tmp<GeometricField<Type, fvPatchField, volMesh> >
00278 laplacian
00279 (
00280     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00281     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00282 )
00283 {
00284     return fvc::laplacian
00285     (
00286         gamma,
00287         tvf,
00288         "laplacian(" + gamma.name() + ',' + tvf().name() + ')'
00289     );
00290 }
00291 
00292 
00293 template<class Type, class GType>
00294 tmp<GeometricField<Type, fvPatchField, volMesh> >
00295 laplacian
00296 (
00297     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00298     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00299 )
00300 {
00301     return fvc::laplacian
00302     (
00303         tgamma,
00304         tvf,
00305         "laplacian(" + tgamma().name() + ',' + tvf().name() + ')'
00306     );
00307 }
00308 
00309 
00310 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00311 
00312 template<class Type, class GType>
00313 tmp<GeometricField<Type, fvPatchField, volMesh> >
00314 laplacian
00315 (
00316     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00317     const GeometricField<Type, fvPatchField, volMesh>& vf,
00318     const word& name
00319 )
00320 {
00321     return fv::laplacianScheme<Type, GType>::New
00322     (
00323         vf.mesh(),
00324         vf.mesh().laplacianScheme(name)
00325     )().fvcLaplacian(gamma, vf);
00326 }
00327 
00328 
00329 template<class Type, class GType>
00330 tmp<GeometricField<Type, fvPatchField, volMesh> >
00331 laplacian
00332 (
00333     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00334     const GeometricField<Type, fvPatchField, volMesh>& vf,
00335     const word& name
00336 )
00337 {
00338     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00339     (
00340         fvc::laplacian(tgamma(), vf, name)
00341     );
00342     tgamma.clear();
00343     return Laplacian;
00344 }
00345 
00346 
00347 template<class Type, class GType>
00348 tmp<GeometricField<Type, fvPatchField, volMesh> >
00349 laplacian
00350 (
00351     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00352     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00353     const word& name
00354 )
00355 {
00356     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00357     (
00358         fvc::laplacian(gamma, tvf(), name)
00359     );
00360     tvf.clear();
00361     return Laplacian;
00362 }
00363 
00364 
00365 template<class Type, class GType>
00366 tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian
00367 (
00368     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00369     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00370     const word& name
00371 )
00372 {
00373     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00374     (
00375         fvc::laplacian(tgamma(), tvf(), name)
00376     );
00377     tgamma.clear();
00378     tvf.clear();
00379     return Laplacian;
00380 }
00381 
00382 
00383 template<class Type, class GType>
00384 tmp<GeometricField<Type, fvPatchField, volMesh> >
00385 laplacian
00386 (
00387     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00388     const GeometricField<Type, fvPatchField, volMesh>& vf
00389 )
00390 {
00391     return fvc::laplacian
00392     (
00393         gamma,
00394         vf,
00395         "laplacian(" + gamma.name() + ',' + vf.name() + ')'
00396     );
00397 }
00398 
00399 
00400 template<class Type, class GType>
00401 tmp<GeometricField<Type, fvPatchField, volMesh> >
00402 laplacian
00403 (
00404     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00405     const GeometricField<Type, fvPatchField, volMesh>& vf
00406 )
00407 {
00408     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00409     (
00410         fvc::laplacian(tgamma(), vf)
00411     );
00412     tgamma.clear();
00413     return Laplacian;
00414 }
00415 
00416 
00417 template<class Type, class GType>
00418 tmp<GeometricField<Type, fvPatchField, volMesh> >
00419 laplacian
00420 (
00421     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00422     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00423 )
00424 {
00425     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00426     (
00427         fvc::laplacian(gamma, tvf())
00428     );
00429     tvf.clear();
00430     return Laplacian;
00431 }
00432 
00433 
00434 template<class Type, class GType>
00435 tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian
00436 (
00437     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00438     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00439 )
00440 {
00441     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00442     (
00443         fvc::laplacian(tgamma(), tvf())
00444     );
00445     tgamma.clear();
00446     tvf.clear();
00447     return Laplacian;
00448 }
00449 
00450 
00451 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00452 
00453 } // End namespace fvc
00454 
00455 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00456 
00457 } // End namespace Foam
00458 
00459 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd