1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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::surfaceInterpolationScheme
29 Abstract base class for surface interpolation schemes.
32 surfaceInterpolationScheme.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef surfaceInterpolationScheme_H
37 #define surfaceInterpolationScheme_H
40 #include "volFieldsFwd.H"
41 #include "surfaceFieldsFwd.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class surfaceInterpolationScheme Declaration
54 \*---------------------------------------------------------------------------*/
57 class surfaceInterpolationScheme
63 //- Hold reference to mesh
67 // Private Member Functions
69 //- Disallow copy construct
70 surfaceInterpolationScheme(const surfaceInterpolationScheme&);
72 //- Disallow default bitwise assignment
73 void operator=(const surfaceInterpolationScheme&);
78 //- Runtime type information
79 TypeName("surfaceInterpolationScheme");
82 // Declare run-time constructor selection tables
84 declareRunTimeSelectionTable
87 surfaceInterpolationScheme,
96 declareRunTimeSelectionTable
99 surfaceInterpolationScheme,
103 const surfaceScalarField& faceFlux,
106 (mesh, faceFlux, schemeData)
112 //- Construct from mesh
113 surfaceInterpolationScheme(const fvMesh& mesh)
121 //- Return new tmp interpolation scheme
122 static tmp<surfaceInterpolationScheme<Type> > New
128 //- Return new tmp interpolation scheme
129 static tmp<surfaceInterpolationScheme<Type> > New
132 const surfaceScalarField& faceFlux,
139 virtual ~surfaceInterpolationScheme();
144 //- Return mesh reference
145 const fvMesh& mesh() const
151 //- Return the face-interpolate of the given cell field
152 // with the given owner and neighbour weigting factors
153 static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
156 const GeometricField<Type, fvPatchField, volMesh>&,
157 const tmp<surfaceScalarField>&,
158 const tmp<surfaceScalarField>&
161 //- Return the face-interpolate of the given cell field
162 // with the given weighting factors
163 static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
166 const GeometricField<Type, fvPatchField, volMesh>&,
167 const tmp<surfaceScalarField>&
171 //- Return the interpolation weighting factors for the given field
172 virtual tmp<surfaceScalarField> weights
174 const GeometricField<Type, fvPatchField, volMesh>&
177 //- Return true if this scheme uses an explicit correction
178 virtual bool corrected() const
183 //- Return the explicit correction to the face-interpolate
184 // for the given field
185 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
186 correction(const GeometricField<Type, fvPatchField, volMesh>&) const
188 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >(NULL);
191 //- Return the face-interpolate of the given cell field
192 // with explicit correction
193 virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
194 interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const;
196 //- Return the face-interpolate of the given tmp cell field
197 // with explicit correction
198 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
201 const tmp<GeometricField<Type, fvPatchField, volMesh> >&
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 } // End namespace Foam
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // Add the patch constructor functions to the hash tables
214 #define makeSurfaceInterpolationTypeScheme(SS, Type) \
216 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
218 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> > \
219 add##SS##Type##MeshConstructorToTable_; \
221 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> > \
222 add##SS##Type##MeshFluxConstructorToTable_;
224 #define makeSurfaceInterpolationScheme(SS) \
226 makeSurfaceInterpolationTypeScheme(SS, scalar) \
227 makeSurfaceInterpolationTypeScheme(SS, vector) \
228 makeSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
229 makeSurfaceInterpolationTypeScheme(SS, symmTensor) \
230 makeSurfaceInterpolationTypeScheme(SS, tensor)
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 # include "surfaceInterpolationScheme.C"
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 // ************************************************************************* //