OpenFOAM logo
Open Source CFD Toolkit

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