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 interpolation
31 \*---------------------------------------------------------------------------*/
33 #ifndef interpolation_H
34 #define interpolation_H
37 #include "volFieldsFwd.H"
38 #include "pointFields.H"
41 #include "runTimeSelectionTables.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class interpolation Declaration
52 \*---------------------------------------------------------------------------*/
62 const GeometricField<Type, fvPatchField, volMesh>& psi_;
64 const polyMesh& pMesh_;
65 const vectorField& pMeshPoints_;
66 const faceList& pMeshFaces_;
67 const vectorField& pMeshFaceCentres_;
68 const vectorField& pMeshFaceAreas_;
73 //- Runtime type information
74 virtual const word& type() const = 0;
77 // Declare run-time constructor selection table
79 declareRunTimeSelectionTable
85 const GeometricField<Type, fvPatchField, volMesh>& psi
93 //- Return a reference to the specified interpolation scheme
94 static autoPtr<interpolation<Type> > New
96 const word& interpolationType,
97 const GeometricField<Type, fvPatchField, volMesh>& psi
100 //- Return a reference to the selected interpolation scheme
101 static autoPtr<interpolation<Type> > New
103 const dictionary& interpolationSchemes,
104 const GeometricField<Type, fvPatchField, volMesh>& psi
110 //- Construct from components
113 const GeometricField<Type, fvPatchField, volMesh>& psi
119 virtual ~interpolation()
125 //- Return the field to be interpolated
126 const GeometricField<Type, fvPatchField, volMesh>& psi() const
131 //- Interpolate field to the given point in the given cell
132 virtual Type interpolate
134 const vector& position,
136 const label facei = -1
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 } // End namespace Foam
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 #define makeInterpolationType(SS, Type) \
149 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
151 interpolation<Type>::adddictionaryConstructorToTable<SS<Type> > \
152 add##SS##Type##ConstructorToTable_;
155 #define makeInterpolation(SS) \
157 makeInterpolationType(SS, scalar) \
158 makeInterpolationType(SS, vector) \
159 makeInterpolationType(SS, sphericalTensor) \
160 makeInterpolationType(SS, symmTensor) \
161 makeInterpolationType(SS, tensor)
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 # include "interpolation.C"
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 // ************************************************************************* //