OpenFOAM logo
Open Source CFD Toolkit

d2dt2Scheme.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     d2dt2Scheme
00027 
00028 Description
00029     Abstract base class for d2dt2 schemes.
00030 
00031 SourceFiles
00032     d2dt2Scheme.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef d2dt2Scheme_H
00037 #define d2dt2Scheme_H
00038 
00039 #include "tmp.H"
00040 #include "dimensionedType.H"
00041 #include "volFieldsFwd.H"
00042 #include "surfaceFieldsFwd.H"
00043 #include "typeInfo.H"
00044 #include "runTimeSelectionTables.H"
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 template<class Type>
00052 class fvMatrix;
00053 
00054 class fvMesh;
00055 
00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00057 
00058 namespace fv
00059 {
00060 
00061 /*---------------------------------------------------------------------------*\
00062                            Class d2dt2Scheme Declaration
00063 \*---------------------------------------------------------------------------*/
00064 
00065 template<class Type>
00066 class d2dt2Scheme
00067 :
00068     public refCount
00069 {
00070 
00071 protected:
00072 
00073     // Protected data
00074 
00075         const fvMesh& mesh_;
00076 
00077 
00078     // Private Member Functions
00079 
00080         //- Disallow copy construct
00081         d2dt2Scheme(const d2dt2Scheme&);
00082 
00083         //- Disallow default bitwise assignment
00084         void operator=(const d2dt2Scheme&);
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             d2dt2Scheme,
00099             Istream,
00100             (const fvMesh& mesh, Istream& schemeData),
00101             (mesh, schemeData)
00102         );
00103 
00104 
00105     // Constructors
00106 
00107         //- Construct from mesh
00108         d2dt2Scheme(const fvMesh& mesh)
00109         :
00110             mesh_(mesh)
00111         {}
00112 
00113         //- Construct from mesh and Istream
00114         d2dt2Scheme(const fvMesh& mesh, Istream&)
00115         :
00116             mesh_(mesh)
00117         {}
00118 
00119 
00120     // Selectors
00121 
00122         //- Return a pointer to a new d2dt2Scheme created on freestore
00123         static tmp<d2dt2Scheme<Type> > New
00124         (
00125             const fvMesh& mesh,
00126             Istream& schemeData
00127         );
00128 
00129 
00130     // Destructor
00131 
00132         virtual ~d2dt2Scheme();
00133 
00134 
00135     // Member Functions
00136 
00137         //- Return mesh reference
00138         const fvMesh& mesh() const
00139         {
00140             return mesh_;
00141         }
00142 
00143         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcD2dt2
00144         (
00145             const GeometricField<Type, fvPatchField, volMesh>&
00146         ) = 0;
00147 
00148         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcD2dt2
00149         (
00150             const volScalarField&,
00151             const GeometricField<Type, fvPatchField, volMesh>&
00152         ) = 0;
00153 
00154         virtual tmp<fvMatrix<Type> > fvmD2dt2
00155         (
00156             GeometricField<Type, fvPatchField, volMesh>&
00157         ) = 0;
00158 
00159         virtual tmp<fvMatrix<Type> > fvmD2dt2
00160         (
00161             const dimensionedScalar&,
00162             GeometricField<Type, fvPatchField, volMesh>&
00163         ) = 0;
00164 
00165         virtual tmp<fvMatrix<Type> > fvmD2dt2
00166         (
00167             const volScalarField&,
00168             GeometricField<Type, fvPatchField, volMesh>&
00169         ) = 0;
00170 };
00171 
00172 
00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00174 
00175 } // End namespace fv
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 } // End namespace Foam
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 // Add the patch constructor functions to the hash tables
00184 
00185 #define makeFvD2dt2TypeScheme(SS, Type)                                        \
00186                                                                                \
00187 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00188                                                                                \
00189 d2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type> >                     \
00190     add##SS##Type##IstreamConstructorToTable_;
00191 
00192 
00193 #define makeFvD2dt2Scheme(SS)                                                  \
00194                                                                                \
00195 makeFvD2dt2TypeScheme(SS, scalar)                                              \
00196 makeFvD2dt2TypeScheme(SS, vector)                                              \
00197 makeFvD2dt2TypeScheme(SS, tensor)                                              \
00198 makeFvD2dt2TypeScheme(SS, sphericalTensor)
00199 
00200 
00201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00202 
00203 #ifdef NoRepository
00204 #   include "d2dt2Scheme.C"
00205 #endif
00206 
00207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00208 
00209 #endif
00210 
00211 // ************************************************************************* //
For further information go to www.openfoam.org