1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 Abstract base class for gradient schemes.
34 \*---------------------------------------------------------------------------*/
40 #include "volFieldsFwd.H"
41 #include "surfaceFieldsFwd.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 /*---------------------------------------------------------------------------*\
58 Class gradScheme Declaration
59 \*---------------------------------------------------------------------------*/
71 // Private Member Functions
73 //- Disallow copy construct
74 gradScheme(const gradScheme&);
76 //- Disallow default bitwise assignment
77 void operator=(const gradScheme&);
82 //- Runtime type information
83 virtual const word& type() const = 0;
86 // Declare run-time constructor selection tables
88 declareRunTimeSelectionTable
93 (const fvMesh& mesh, Istream& schemeData),
100 //- Construct from mesh
101 gradScheme(const fvMesh& mesh)
109 //- Return a pointer to a new gradScheme created on freestore
110 static tmp<gradScheme<Type> > New
119 virtual ~gradScheme();
124 //- Return mesh reference
125 const fvMesh& mesh() const
130 //- Calculate and return the grad of the given field
134 <typename outerProduct<vector, Type>::type, fvPatchField, volMesh>
137 const GeometricField<Type, fvPatchField, volMesh>&
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 } // End namespace fv
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 // Add the patch constructor functions to the hash tables
154 #define makeFvGradTypeScheme(SS, Type) \
156 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
158 gradScheme<Type>::addIstreamConstructorToTable<SS<Type> > \
159 add##SS##Type##IstreamConstructorToTable_;
162 #define makeFvGradScheme(SS) \
164 makeFvGradTypeScheme(SS, scalar) \
165 makeFvGradTypeScheme(SS, vector)
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 # include "gradScheme.C"
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 // ************************************************************************* //