initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / finiteVolume / d2dt2Schemes / d2dt2Scheme / d2dt2Scheme.H
blob9e5668ecf3d817fa3eb39e7a13e07c03a62bfebc
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::fv::d2dt2Scheme
28 Description
29     Abstract base class for d2dt2 schemes.
31 SourceFiles
32     d2dt2Scheme.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef d2dt2Scheme_H
37 #define d2dt2Scheme_H
39 #include "tmp.H"
40 #include "dimensionedType.H"
41 #include "volFieldsFwd.H"
42 #include "surfaceFieldsFwd.H"
43 #include "typeInfo.H"
44 #include "runTimeSelectionTables.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 template<class Type>
52 class fvMatrix;
54 class fvMesh;
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 namespace fv
61 /*---------------------------------------------------------------------------*\
62                            Class d2dt2Scheme Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class Type>
66 class d2dt2Scheme
68     public refCount
71 protected:
73     // Protected data
75         const fvMesh& mesh_;
78     // Private Member Functions
80         //- Disallow copy construct
81         d2dt2Scheme(const d2dt2Scheme&);
83         //- Disallow default bitwise assignment
84         void operator=(const d2dt2Scheme&);
87 public:
89     //- Runtime type information
90     virtual const word& type() const = 0;
93     // Declare run-time constructor selection tables
95         declareRunTimeSelectionTable
96         (
97             tmp,
98             d2dt2Scheme,
99             Istream,
100             (const fvMesh& mesh, Istream& schemeData),
101             (mesh, schemeData)
102         );
105     // Constructors
107         //- Construct from mesh
108         d2dt2Scheme(const fvMesh& mesh)
109         :
110             mesh_(mesh)
111         {}
113         //- Construct from mesh and Istream
114         d2dt2Scheme(const fvMesh& mesh, Istream&)
115         :
116             mesh_(mesh)
117         {}
120     // Selectors
122         //- Return a pointer to a new d2dt2Scheme created on freestore
123         static tmp<d2dt2Scheme<Type> > New
124         (
125             const fvMesh& mesh,
126             Istream& schemeData
127         );
130     // Destructor
132         virtual ~d2dt2Scheme();
135     // Member Functions
137         //- Return mesh reference
138         const fvMesh& mesh() const
139         {
140             return mesh_;
141         }
143         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcD2dt2
144         (
145             const GeometricField<Type, fvPatchField, volMesh>&
146         ) = 0;
148         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcD2dt2
149         (
150             const volScalarField&,
151             const GeometricField<Type, fvPatchField, volMesh>&
152         ) = 0;
154         virtual tmp<fvMatrix<Type> > fvmD2dt2
155         (
156             GeometricField<Type, fvPatchField, volMesh>&
157         ) = 0;
159         virtual tmp<fvMatrix<Type> > fvmD2dt2
160         (
161             const dimensionedScalar&,
162             GeometricField<Type, fvPatchField, volMesh>&
163         ) = 0;
165         virtual tmp<fvMatrix<Type> > fvmD2dt2
166         (
167             const volScalarField&,
168             GeometricField<Type, fvPatchField, volMesh>&
169         ) = 0;
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace fv
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 } // End namespace Foam
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // Add the patch constructor functions to the hash tables
185 #define makeFvD2dt2TypeScheme(SS, Type)                                        \
186                                                                                \
187 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
188                                                                                \
189 d2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type> >                     \
190     add##SS##Type##IstreamConstructorToTable_;
193 #define makeFvD2dt2Scheme(SS)                                                  \
194                                                                                \
195 makeFvD2dt2TypeScheme(SS, scalar)                                              \
196 makeFvD2dt2TypeScheme(SS, vector)                                              \
197 makeFvD2dt2TypeScheme(SS, sphericalTensor)                                     \
198 makeFvD2dt2TypeScheme(SS, symmTensor)                                          \
199 makeFvD2dt2TypeScheme(SS, tensor)
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #ifdef NoRepository
205 #   include "d2dt2Scheme.C"
206 #endif
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 #endif
212 // ************************************************************************* //