1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::multivariateSurfaceInterpolationScheme
28 Abstract base class for multi-variate surface interpolation schemes.
31 multivariateSurfaceInterpolationScheme.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef multivariateSurfaceInterpolationScheme_H
36 #define multivariateSurfaceInterpolationScheme_H
38 #include "surfaceInterpolationScheme.H"
39 #include "HashTable.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class multivariateSurfaceInterpolationScheme Declaration
48 \*---------------------------------------------------------------------------*/
51 class multivariateSurfaceInterpolationScheme
61 public HashTable<const GeometricField<Type, fvPatchField, volMesh>*>
68 void add(const GeometricField<Type, fvPatchField, volMesh>& f)
70 this->insert(f.name(), &f);
79 //- Hold reference to mesh
82 //- HashTable of pointers to the field set
83 const fieldTable& fields_;
86 // Private Member Functions
88 //- Disallow default bitwise copy construct
89 multivariateSurfaceInterpolationScheme
91 const multivariateSurfaceInterpolationScheme&
94 //- Disallow default bitwise assignment
95 void operator=(const multivariateSurfaceInterpolationScheme&);
100 //- Runtime type information
101 virtual const word& type() const = 0;
104 // Declare run-time constructor selection tables
106 declareRunTimeSelectionTable
109 multivariateSurfaceInterpolationScheme,
113 const fieldTable& fields,
114 const surfaceScalarField& faceFlux,
117 (mesh, fields, faceFlux, is)
123 //- Construct for interpolating given field
124 multivariateSurfaceInterpolationScheme
127 const fieldTable& fields,
128 const surfaceScalarField& faceFlux,
135 //- Return a pointer to a new gradScheme created on freestore
136 static tmp<multivariateSurfaceInterpolationScheme<Type> > New
139 const fieldTable& fields,
140 const surfaceScalarField& faceFlux,
146 virtual ~multivariateSurfaceInterpolationScheme();
151 //- Return mesh reference
152 const fvMesh& mesh() const
157 //- Return fields to be interpolated
158 const fieldTable& fields() const
166 //- surfaceInterpolationScheme sub-class returned by operator(field)
167 // which is used as the interpolation scheme for the field
170 public surfaceInterpolationScheme<Type>
179 const GeometricField<Type, fvPatchField, volMesh>& field
182 surfaceInterpolationScheme<Type>(field.mesh())
188 //- Return the interpolation weighting factors
189 virtual tmp<surfaceScalarField> weights
191 const GeometricField<Type, fvPatchField, volMesh>& field
195 virtual tmp<surfaceInterpolationScheme<Type> > operator()
197 const GeometricField<Type, fvPatchField, volMesh>& field
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 // Add the patch constructor functions to the hash tables
210 #define makeMultivariateSurfaceInterpolationTypeScheme(SS, Type) \
212 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
214 multivariateSurfaceInterpolationScheme<Type>:: \
215 addIstreamConstructorToTable<SS<Type> > \
216 add##SS##Type##ConstructorToTable_;
219 #define makeMultivariateSurfaceInterpolationScheme(SS) \
221 makeMultivariateSurfaceInterpolationTypeScheme(SS, scalar) \
222 makeMultivariateSurfaceInterpolationTypeScheme(SS, vector) \
223 makeMultivariateSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
224 makeMultivariateSurfaceInterpolationTypeScheme(SS, symmTensor) \
225 makeMultivariateSurfaceInterpolationTypeScheme(SS, tensor)
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 # include "multivariateSurfaceInterpolationScheme.C"
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 // ************************************************************************* //