OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

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-2007 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         //- Construct from mesh, interpolation and snGradScheme schemes
00140         laplacianScheme
00141         (
00142             const fvMesh& mesh,
00143             const tmp<surfaceInterpolationScheme<scalar> >& igs,
00144             const tmp<snGradScheme<Type> >& sngs
00145         )
00146         :
00147             mesh_(mesh),
00148             tinterpGammaScheme_(igs),
00149             tinterpTensorGammaScheme_(new linear<tensor>(mesh)),
00150             tsnGradScheme_(sngs)
00151         {}
00152 
00153 
00154     // Selectors
00155 
00156         //- Return a pointer to a new laplacianScheme created on freestore
00157         static tmp<laplacianScheme<Type> > New
00158         (
00159             const fvMesh& mesh,
00160             Istream& schemeData
00161         );
00162 
00163 
00164     // Destructor
00165 
00166         virtual ~laplacianScheme();
00167 
00168 
00169     // Member Functions
00170 
00171         //- Return mesh reference
00172         const fvMesh& mesh() const
00173         {
00174             return mesh_;
00175         }
00176 
00177         virtual tmp<fvMatrix<Type> > fvmLaplacian
00178         (
00179             const surfaceScalarField&,
00180             GeometricField<Type, fvPatchField, volMesh>&
00181         ) = 0;
00182 
00183         virtual tmp<fvMatrix<Type> > fvmLaplacian
00184         (
00185             const volScalarField&,
00186             GeometricField<Type, fvPatchField, volMesh>&
00187         );
00188 
00189         virtual tmp<fvMatrix<Type> > fvmLaplacian
00190         (
00191             const surfaceTensorField&,
00192             GeometricField<Type, fvPatchField, volMesh>&
00193         ) = 0;
00194 
00195         virtual tmp<fvMatrix<Type> > fvmLaplacian
00196         (
00197             const volTensorField&,
00198             GeometricField<Type, fvPatchField, volMesh>&
00199         );
00200 
00201         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00202         (
00203             const GeometricField<Type, fvPatchField, volMesh>&
00204         ) = 0;
00205 
00206         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00207         (
00208             const surfaceScalarField&,
00209             const GeometricField<Type, fvPatchField, volMesh>&
00210         ) = 0;
00211 
00212         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00213         (
00214             const volScalarField&,
00215             const GeometricField<Type, fvPatchField, volMesh>&
00216         );
00217 
00218         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00219         (
00220             const surfaceTensorField&,
00221             const GeometricField<Type, fvPatchField, volMesh>&
00222         ) = 0;
00223 
00224         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcLaplacian
00225         (
00226             const volTensorField&,
00227             const GeometricField<Type, fvPatchField, volMesh>&
00228         );
00229 };
00230 
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 } // End namespace fv
00235 
00236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00237 
00238 } // End namespace Foam
00239 
00240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00241 
00242 // Add the patch constructor functions to the hash tables
00243 
00244 #define makeFvLaplacianTypeScheme(SS, Type)                                    \
00245                                                                                \
00246 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00247                                                                                \
00248 laplacianScheme<Type>::addIstreamConstructorToTable<SS<Type> >                 \
00249     add##SS##Type##IstreamConstructorToTable_;
00250 
00251 
00252 #define makeFvLaplacianScheme(SS)                                              \
00253                                                                                \
00254 makeFvLaplacianTypeScheme(SS, scalar)                                          \
00255 makeFvLaplacianTypeScheme(SS, vector)                                          \
00256 makeFvLaplacianTypeScheme(SS, sphericalTensor)                                 \
00257 makeFvLaplacianTypeScheme(SS, symmTensor)                                      \
00258 makeFvLaplacianTypeScheme(SS, tensor)                                          \
00259 
00260 
00261 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00262 
00263 #ifdef NoRepository
00264 #   include "laplacianScheme.C"
00265 #endif
00266 
00267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00268 
00269 #endif
00270 
00271 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd