00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef interpolation_H
00033 #define interpolation_H
00034
00035 #include "faceList.H"
00036 #include "volFieldsFwd.H"
00037 #include "pointFields.H"
00038 #include "typeInfo.H"
00039 #include "autoPtr.H"
00040 #include "runTimeSelectionTables.H"
00041
00042
00043
00044 namespace Foam
00045 {
00046
00047 class polyMesh;
00048 class volPointInterpolation;
00049
00050
00051
00052
00053
00054 template<class Type>
00055 class interpolation
00056 {
00057
00058 protected:
00059
00060
00061
00062 const GeometricField<Type, fvPatchField, volMesh>& psi_;
00063
00064 const polyMesh& pMesh_;
00065 const vectorField& pMeshPoints_;
00066 const faceList& pMeshFaces_;
00067 const vectorField& pMeshFaceCentres_;
00068 const vectorField& pMeshFaceAreas_;
00069
00070
00071 public:
00072
00073
00074 virtual const word& type() const = 0;
00075
00076
00077
00078
00079 declareRunTimeSelectionTable
00080 (
00081 autoPtr,
00082 interpolation,
00083 dictionary,
00084 (
00085 const volPointInterpolation& pInterp,
00086 const GeometricField<Type, fvPatchField, volMesh>& psi
00087 ),
00088 (pInterp, psi)
00089 );
00090
00091
00092
00093
00094
00095 static autoPtr<interpolation<Type> > New
00096 (
00097 const dictionary& interpolationSchemes,
00098 const volPointInterpolation& pInterp,
00099 const GeometricField<Type, fvPatchField, volMesh>& psi
00100 );
00101
00102
00103
00104
00105
00106 interpolation
00107 (
00108 const GeometricField<Type, fvPatchField, volMesh>& psi
00109 );
00110
00111
00112
00113
00114 virtual ~interpolation()
00115 {}
00116
00117
00118
00119
00120
00121 virtual Type interpolate
00122 (
00123 const vector& position,
00124 const label nCell,
00125 const label facei = -1
00126 ) const = 0;
00127 };
00128
00129
00130
00131
00132 }
00133
00134
00135
00136 #define makeInterpolationType(SS, Type) \
00137 \
00138 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
00139 \
00140 interpolation<Type>::adddictionaryConstructorToTable<SS<Type> > \
00141 add##SS##Type##ConstructorToTable_;
00142
00143
00144 #define makeInterpolation(SS) \
00145 \
00146 makeInterpolationType(SS, scalar) \
00147 makeInterpolationType(SS, vector) \
00148 makeInterpolationType(SS, tensor)
00149
00150
00151
00152
00153 #ifdef NoRepository
00154 # include "interpolation.C"
00155 #endif
00156
00157
00158
00159 #endif
00160
00161