FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2011 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "fvcLaplacian.H"
00027 #include <finiteVolume/fvMesh.H>
00028 #include <finiteVolume/laplacianScheme.H>
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00036 
00037 namespace fvc
00038 {
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 template<class Type>
00043 tmp<GeometricField<Type, fvPatchField, volMesh> >
00044 laplacian
00045 (
00046     const GeometricField<Type, fvPatchField, volMesh>& vf,
00047     const word& name
00048 )
00049 {
00050     return fv::laplacianScheme<Type, scalar>::New
00051     (
00052         vf.mesh(),
00053         vf.mesh().laplacianScheme(name)
00054     )().fvcLaplacian(vf);
00055 }
00056 
00057 
00058 template<class Type>
00059 tmp<GeometricField<Type, fvPatchField, volMesh> >
00060 laplacian
00061 (
00062     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00063     const word& name
00064 )
00065 {
00066     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00067     (
00068         fvc::laplacian(tvf(), name)
00069     );
00070     tvf.clear();
00071     return Laplacian;
00072 }
00073 
00074 
00075 template<class Type>
00076 tmp<GeometricField<Type, fvPatchField, volMesh> >
00077 laplacian
00078 (
00079     const GeometricField<Type, fvPatchField, volMesh>& vf
00080 )
00081 {
00082     return fvc::laplacian(vf, "laplacian(" + vf.name() + ')');
00083 }
00084 
00085 
00086 template<class Type>
00087 tmp<GeometricField<Type, fvPatchField, volMesh> >
00088 laplacian
00089 (
00090     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00091 )
00092 {
00093     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00094     (
00095         fvc::laplacian(tvf())
00096     );
00097     tvf.clear();
00098     return Laplacian;
00099 }
00100 
00101 
00102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00103 
00104 template<class Type, class GType>
00105 tmp<GeometricField<Type, fvPatchField, volMesh> >
00106 laplacian
00107 (
00108     const dimensioned<GType>& gamma,
00109     const GeometricField<Type, fvPatchField, volMesh>& vf,
00110     const word& name
00111 )
00112 {
00113     GeometricField<GType, fvsPatchField, surfaceMesh> Gamma
00114     (
00115         IOobject
00116         (
00117             gamma.name(),
00118             vf.instance(),
00119             vf.mesh(),
00120             IOobject::NO_READ
00121         ),
00122         vf.mesh(),
00123         gamma
00124     );
00125 
00126     return fvc::laplacian(Gamma, vf, name);
00127 }
00128 
00129 
00130 template<class Type, class GType>
00131 tmp<GeometricField<Type, fvPatchField, volMesh> >
00132 laplacian
00133 (
00134     const dimensioned<GType>& gamma,
00135     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00136     const word& name
00137 )
00138 {
00139     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00140     (
00141         fvc::laplacian(gamma, tvf(), name)
00142     );
00143     tvf.clear();
00144     return Laplacian;
00145 }
00146 
00147 
00148 template<class Type, class GType>
00149 tmp<GeometricField<Type, fvPatchField, volMesh> >
00150 laplacian
00151 (
00152     const dimensioned<GType>& gamma,
00153     const GeometricField<Type, fvPatchField, volMesh>& vf
00154 )
00155 {
00156     GeometricField<GType, fvsPatchField, surfaceMesh> Gamma
00157     (
00158         IOobject
00159         (
00160             gamma.name(),
00161             vf.instance(),
00162             vf.mesh(),
00163             IOobject::NO_READ
00164         ),
00165         vf.mesh(),
00166         gamma
00167     );
00168 
00169     return fvc::laplacian(Gamma, vf);
00170 }
00171 
00172 
00173 template<class Type, class GType>
00174 tmp<GeometricField<Type, fvPatchField, volMesh> >
00175 laplacian
00176 (
00177     const dimensioned<GType>& gamma,
00178     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00179 )
00180 {
00181     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00182     (
00183         fvc::laplacian(gamma, tvf())
00184     );
00185     tvf.clear();
00186     return Laplacian;
00187 }
00188 
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 template<class Type, class GType>
00193 tmp<GeometricField<Type, fvPatchField, volMesh> >
00194 laplacian
00195 (
00196     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00197     const GeometricField<Type, fvPatchField, volMesh>& vf,
00198     const word& name
00199 )
00200 {
00201     return fv::laplacianScheme<Type, GType>::New
00202     (
00203         vf.mesh(),
00204         vf.mesh().laplacianScheme(name)
00205     )().fvcLaplacian(gamma, vf);
00206 }
00207 
00208 
00209 template<class Type, class GType>
00210 tmp<GeometricField<Type, fvPatchField, volMesh> >
00211 laplacian
00212 (
00213     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00214     const GeometricField<Type, fvPatchField, volMesh>& vf,
00215     const word& name
00216 )
00217 {
00218     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00219     (
00220         fvc::laplacian(tgamma(), vf, name)
00221     );
00222     tgamma.clear();
00223     return Laplacian;
00224 }
00225 
00226 
00227 template<class Type, class GType>
00228 tmp<GeometricField<Type, fvPatchField, volMesh> >
00229 laplacian
00230 (
00231     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00232     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00233     const word& name
00234 )
00235 {
00236     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00237     (
00238         fvc::laplacian(gamma, tvf(), name)
00239     );
00240     tvf.clear();
00241     return Laplacian;
00242 }
00243 
00244 
00245 template<class Type, class GType>
00246 tmp<GeometricField<Type, fvPatchField, volMesh> >
00247 laplacian
00248 (
00249     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00250     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00251     const word& name
00252 )
00253 {
00254     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00255     (
00256         fvc::laplacian(tgamma(), tvf(), name)
00257     );
00258     tgamma.clear();
00259     tvf.clear();
00260     return Laplacian;
00261 }
00262 
00263 
00264 template<class Type, class GType>
00265 tmp<GeometricField<Type, fvPatchField, volMesh> >
00266 laplacian
00267 (
00268     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00269     const GeometricField<Type, fvPatchField, volMesh>& vf
00270 )
00271 {
00272     return fvc::laplacian
00273     (
00274         gamma,
00275         vf,
00276         "laplacian(" + gamma.name() + ',' + vf.name() + ')'
00277     );
00278 }
00279 
00280 
00281 template<class Type, class GType>
00282 tmp<GeometricField<Type, fvPatchField, volMesh> >
00283 laplacian
00284 (
00285     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00286     const GeometricField<Type, fvPatchField, volMesh>& vf
00287 )
00288 {
00289     return fvc::laplacian
00290     (
00291         tgamma,
00292         vf,
00293         "laplacian(" + tgamma().name() + ',' + vf.name() + ')'
00294     );
00295 }
00296 
00297 
00298 template<class Type, class GType>
00299 tmp<GeometricField<Type, fvPatchField, volMesh> >
00300 laplacian
00301 (
00302     const GeometricField<GType, fvPatchField, volMesh>& gamma,
00303     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00304 )
00305 {
00306     return fvc::laplacian
00307     (
00308         gamma,
00309         tvf,
00310         "laplacian(" + gamma.name() + ',' + tvf().name() + ')'
00311     );
00312 }
00313 
00314 
00315 template<class Type, class GType>
00316 tmp<GeometricField<Type, fvPatchField, volMesh> >
00317 laplacian
00318 (
00319     const tmp<GeometricField<GType, fvPatchField, volMesh> >& tgamma,
00320     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00321 )
00322 {
00323     return fvc::laplacian
00324     (
00325         tgamma,
00326         tvf,
00327         "laplacian(" + tgamma().name() + ',' + tvf().name() + ')'
00328     );
00329 }
00330 
00331 
00332 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00333 
00334 template<class Type, class GType>
00335 tmp<GeometricField<Type, fvPatchField, volMesh> >
00336 laplacian
00337 (
00338     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00339     const GeometricField<Type, fvPatchField, volMesh>& vf,
00340     const word& name
00341 )
00342 {
00343     return fv::laplacianScheme<Type, GType>::New
00344     (
00345         vf.mesh(),
00346         vf.mesh().laplacianScheme(name)
00347     )().fvcLaplacian(gamma, vf);
00348 }
00349 
00350 
00351 template<class Type, class GType>
00352 tmp<GeometricField<Type, fvPatchField, volMesh> >
00353 laplacian
00354 (
00355     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00356     const GeometricField<Type, fvPatchField, volMesh>& vf,
00357     const word& name
00358 )
00359 {
00360     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00361     (
00362         fvc::laplacian(tgamma(), vf, name)
00363     );
00364     tgamma.clear();
00365     return Laplacian;
00366 }
00367 
00368 
00369 template<class Type, class GType>
00370 tmp<GeometricField<Type, fvPatchField, volMesh> >
00371 laplacian
00372 (
00373     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00374     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00375     const word& name
00376 )
00377 {
00378     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00379     (
00380         fvc::laplacian(gamma, tvf(), name)
00381     );
00382     tvf.clear();
00383     return Laplacian;
00384 }
00385 
00386 
00387 template<class Type, class GType>
00388 tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian
00389 (
00390     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00391     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
00392     const word& name
00393 )
00394 {
00395     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00396     (
00397         fvc::laplacian(tgamma(), tvf(), name)
00398     );
00399     tgamma.clear();
00400     tvf.clear();
00401     return Laplacian;
00402 }
00403 
00404 
00405 template<class Type, class GType>
00406 tmp<GeometricField<Type, fvPatchField, volMesh> >
00407 laplacian
00408 (
00409     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00410     const GeometricField<Type, fvPatchField, volMesh>& vf
00411 )
00412 {
00413     return fvc::laplacian
00414     (
00415         gamma,
00416         vf,
00417         "laplacian(" + gamma.name() + ',' + vf.name() + ')'
00418     );
00419 }
00420 
00421 
00422 template<class Type, class GType>
00423 tmp<GeometricField<Type, fvPatchField, volMesh> >
00424 laplacian
00425 (
00426     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00427     const GeometricField<Type, fvPatchField, volMesh>& vf
00428 )
00429 {
00430     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00431     (
00432         fvc::laplacian(tgamma(), vf)
00433     );
00434     tgamma.clear();
00435     return Laplacian;
00436 }
00437 
00438 
00439 template<class Type, class GType>
00440 tmp<GeometricField<Type, fvPatchField, volMesh> >
00441 laplacian
00442 (
00443     const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
00444     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00445 )
00446 {
00447     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00448     (
00449         fvc::laplacian(gamma, tvf())
00450     );
00451     tvf.clear();
00452     return Laplacian;
00453 }
00454 
00455 
00456 template<class Type, class GType>
00457 tmp<GeometricField<Type, fvPatchField, volMesh> > laplacian
00458 (
00459     const tmp<GeometricField<GType, fvsPatchField, surfaceMesh> >& tgamma,
00460     const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
00461 )
00462 {
00463     tmp<GeometricField<Type, fvPatchField, volMesh> > Laplacian
00464     (
00465         fvc::laplacian(tgamma(), tvf())
00466     );
00467     tgamma.clear();
00468     tvf.clear();
00469     return Laplacian;
00470 }
00471 
00472 
00473 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00474 
00475 } // End namespace fvc
00476 
00477 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00478 
00479 } // End namespace Foam
00480 
00481 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines