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
26 Foam::fv::snGradScheme
29 Abstract base class for snGrad schemes.
34 \*---------------------------------------------------------------------------*/
36 #ifndef snGradScheme_H
37 #define snGradScheme_H
40 #include "volFieldsFwd.H"
41 #include "surfaceFieldsFwd.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 /*---------------------------------------------------------------------------*\
58 Class snGradScheme Declaration
59 \*---------------------------------------------------------------------------*/
68 //- Hold reference to mesh
72 // Private Member Functions
74 //- Disallow default bitwise assignment
75 void operator=(const snGradScheme&);
80 //- Runtime type information
81 virtual const word& type() const = 0;
84 // Declare run-time constructor selection tables
86 declareRunTimeSelectionTable
91 (const fvMesh& mesh, Istream& schemeData),
98 //- Construct from mesh
99 snGradScheme(const fvMesh& mesh)
107 //- Return new tmp interpolation scheme
108 static tmp<snGradScheme<Type> > New
117 virtual ~snGradScheme();
122 //- Return mesh reference
123 const fvMesh& mesh() const
129 //- Return the snGrad of the given cell field with the given deltaCoeffs
130 static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
133 const GeometricField<Type, fvPatchField, volMesh>&,
134 const tmp<surfaceScalarField>&,
135 const word& snGradName = "snGrad"
138 //- Return the interpolation weighting factors for the given field
139 virtual tmp<surfaceScalarField> deltaCoeffs
141 const GeometricField<Type, fvPatchField, volMesh>&
144 //- Return true if this scheme uses an explicit correction
145 virtual bool corrected() const
150 //- Return the explicit correction to the snGrad
151 // for the given field
152 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
153 correction(const GeometricField<Type, fvPatchField, volMesh>&) const
155 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >(NULL);
158 //- Return the snGrad of the given cell field
159 // with explicit correction
160 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
161 snGrad(const GeometricField<Type, fvPatchField, volMesh>&) const;
163 //- Return the snGrad of the given tmp cell field
164 // with explicit correction
165 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
168 const tmp<GeometricField<Type, fvPatchField, volMesh> >&
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace fv
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 } // End namespace Foam
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // Add the patch constructor functions to the hash tables
185 #define makeSnGradTypeScheme(SS, Type) \
187 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
189 snGradScheme<Type>::addMeshConstructorToTable<SS<Type> > \
190 add##SS##Type##MeshConstructorToTable_;
192 #define makeSnGradScheme(SS) \
194 makeSnGradTypeScheme(SS, scalar) \
195 makeSnGradTypeScheme(SS, vector) \
196 makeSnGradTypeScheme(SS, sphericalTensor) \
197 makeSnGradTypeScheme(SS, symmTensor) \
198 makeSnGradTypeScheme(SS, tensor)
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 # include "snGradScheme.C"
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 // ************************************************************************* //