OpenFOAM logo
Open Source CFD Toolkit

laplacianScheme.H

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-2005 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 Class
00026     laplacianScheme
00027 
00028 Description
00029     Abstract base class for laplacian schemes.
00030 
00031 SourceFiles
00032     laplacianScheme.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef laplacianScheme_H
00037 #define laplacianScheme_H
00038 
00039 #include "tmp.H"
00040 #include "volFieldsFwd.H"
00041 #include "surfaceFieldsFwd.H"
00042 #include "linear.H"
00043 #include "correctedSnGrad.H"
00044 #include "typeInfo.H"
00045 #include "runTimeSelectionTables.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 template<class Type>
00053 class fvMatrix;
00054 
00055 class fvMesh;
00056 
00057 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00058 
00059 namespace fv
00060 {
00061 
00062 /*---------------------------------------------------------------------------*\
00063                            Class laplacianScheme Declaration
00064 \*---------------------------------------------------------------------------*/
00065 
00066 template<class Type>
00067 class laplacianScheme
00068 :
00069     public refCount
00070 {
00071 
00072 protected:
00073 
00074     // Protected data
00075 
00076         const fvMesh& mesh_;
00077         tmp<surfaceInterpolationScheme<scalar> > tinterpGammaScheme_;
00078         tmp<surfaceInterpolationScheme<tensor> > tinterpTensorGammaScheme_;
00079         tmp<snGradScheme<Type> > tsnGradScheme_;
00080 
00081 
00082     // Private Member Functions
00083 
00084         //- Disallow copy construct
00085         laplacianScheme(const laplacianScheme&);
00086 
00087         //- Disallow default bitwise assignment
00088         void operator=(const laplacianScheme&);
00089 
00090 
00091 public:
00092 
00093     //- Runtime type information
00094     virtual const word& type() const = 0;
00095 
00096 
00097     // Declare run-time constructor selection tables
00098 
00099         declareRunTimeSelectionTable
00100         (
00101             tmp,
00102             laplacianScheme,
00103             Istream,
00104             (const fvMesh& mesh, Istream& schemeData),
00105             (mesh, schemeData)
00106         );
00107 
00108 
00109     // Constructors
00110 
00111         //- Construct from mesh
00112         laplacianScheme(const fvMesh& mesh)
00113         :
00114             mesh_(mesh),
00115             tinterpGammaScheme_(new linear<scalar>(mesh)),
00116             tinterpTensorGammaScheme_(new linear<tensor>(mesh)),
00117             tsnGradScheme_(new correctedSnGrad<Type>(mesh))
00118         {}
00119 
00120         //- Construct from mesh and Istream
00121         laplacianScheme(const fvMesh& mesh, Istream& is)
00122         :
00123             mesh_(mesh),
00124             tinterpGammaScheme_(NULL),
00125             tinterpTensorGammaScheme_(new linear<tensor>(mesh)),
00126             tsnGradScheme_(NULL)
00127         {
00128             tinterpGammaScheme_ = tmp<surfaceInterpolationScheme<scalar> >
00129             (
00130                 surfaceInterpolationScheme<scalar>::New(mesh, is)
00131             );
00132 
00133             tsnGradScheme_ = tmp<snGradScheme<Type> >
00134             (
00135                 snGradScheme<Type>::New(mesh, is)
00136             );
00137         }
00138 
00139 
00140     // Selectors
00141 
00142         //- Return a pointer to a new laplacianScheme created on freestore
00143         static tmp<laplacianScheme<Type> > New
00144         (
00145             const fvMesh& mesh,
00146             Istream& schemeData
00147         );
00148 
00149 
00150     // Destructor
00151 
00152         virtual ~laplacianScheme();
00153 
00154 
00155     // Member Functions
00156 
00157         //- Return mesh reference
00158         const fvMesh& mesh() const
00159         {
00160             return mesh_;
00161         }
00162 
00163         virtual tmp<fvMatrix<Type> > fvmLaplacian
00164         (
00165             const surfaceScalarField&,
00166             GeometricField<Type, fvPatchField, volMesh>&
00167         ) = 0;
00168 
00169         virtual tmp<fvMatrix<Type> > fvmLaplacian
00170         (
00171             const volScalarField&,
00172             GeometricField<Type, fvPatchField, volMesh>&
00173         );
00174 
00175         virtual tmp<fvMatrix<Type> > fvmLaplacian
00176         (
00177             const surfaceTensorField&,
00178             GeometricField<Type, fvPatchField, volMesh>&
00179         ) = 0;
00180 
00181         virtual tmp<fvMatrix<Type> > fvmLaplacian
00182         (
00183             const volTensorField&,
00184             GeometricField<Type, fvPatchField, volMesh>&
00185         );
00186 
00187         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00188         (
00189             const GeometricField<Type, fvPatchField, volMesh>&
00190         ) = 0;
00191 
00192         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00193         (
00194             const surfaceScalarField&,
00195             const GeometricField<Type, fvPatchField, volMesh>&
00196         ) = 0;
00197 
00198         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00199         (
00200             const volScalarField&,
00201             const GeometricField<Type, fvPatchField, volMesh>&
00202         );
00203 
00204         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00205         (
00206             const surfaceTensorField&,
00207             const GeometricField<Type, fvPatchField, volMesh>&
00208         ) = 0;
00209 
00210         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00211         (
00212             const volTensorField&,
00213             const GeometricField<Type, fvPatchField, volMesh>&
00214         );
00215 };
00216 
00217 
00218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00219 
00220 } // End namespace fv
00221 
00222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00223 
00224 } // End namespace Foam
00225 
00226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00227 
00228 // Add the patch constructor functions to the hash tables
00229 
00230 #define makeFvLaplacianTypeScheme(SS, Type)                                    \
00231                                                                                \
00232 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00233                                                                                \
00234 laplacianScheme<Type>::addIstreamConstructorToTable<SS<Type> >                 \
00235     add##SS##Type##IstreamConstructorToTable_;
00236 
00237 
00238 #define makeFvLaplacianScheme(SS)                                              \
00239                                                                                \
00240 makeFvLaplacianTypeScheme(SS, scalar)                                          \
00241 makeFvLaplacianTypeScheme(SS, vector)                                          \
00242 makeFvLaplacianTypeScheme(SS, tensor)                                          \
00243 makeFvLaplacianTypeScheme(SS, sphericalTensor)
00244 
00245 
00246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00247 
00248 #ifdef NoRepository
00249 #   include "laplacianScheme.C"
00250 #endif
00251 
00252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00253 
00254 #endif
00255 
00256 // ************************************************************************* //
For further information go to www.openfoam.org