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 word& interpolationType,
00098 const volPointInterpolation& pInterp,
00099 const GeometricField<Type, fvPatchField, volMesh>& psi
00100 );
00101
00102
00103 static autoPtr<interpolation<Type> > New
00104 (
00105 const dictionary& interpolationSchemes,
00106 const volPointInterpolation& pInterp,
00107 const GeometricField<Type, fvPatchField, volMesh>& psi
00108 );
00109
00110
00111
00112
00113
00114 interpolation
00115 (
00116 const GeometricField<Type, fvPatchField, volMesh>& psi
00117 );
00118
00119
00120
00121
00122 virtual ~interpolation()
00123 {}
00124
00125
00126
00127
00128
00129 const GeometricField<Type, fvPatchField, volMesh>& psi() const
00130 {
00131 return psi_;
00132 }
00133
00134
00135 virtual Type interpolate
00136 (
00137 const vector& position,
00138 const label nCell,
00139 const label facei = -1
00140 ) const = 0;
00141 };
00142
00143
00144
00145
00146 }
00147
00148
00149
00150 #define makeInterpolationType(SS, Type) \
00151 \
00152 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
00153 \
00154 interpolation<Type>::adddictionaryConstructorToTable<SS<Type> > \
00155 add##SS##Type##ConstructorToTable_;
00156
00157
00158 #define makeInterpolation(SS) \
00159 \
00160 makeInterpolationType(SS, scalar) \
00161 makeInterpolationType(SS, vector) \
00162 makeInterpolationType(SS, tensor)
00163
00164
00165
00166
00167 #ifdef NoRepository
00168 # include "interpolation.C"
00169 #endif
00170
00171
00172
00173 #endif
00174
00175
Copyright © 2000-2007 OpenCFD Ltd