interpolation.H
Go to the documentation of this file.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
00033 #ifndef interpolation_H
00034 #define interpolation_H
00035
00036 #include "faceList.H"
00037 #include "volFieldsFwd.H"
00038 #include "pointFields.H"
00039 #include "typeInfo.H"
00040 #include "autoPtr.H"
00041 #include "runTimeSelectionTables.H"
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048 class polyMesh;
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 GeometricField<Type, fvPatchField, volMesh>& psi
00086 ),
00087 (psi)
00088 );
00089
00090
00091
00092
00093
00094 static autoPtr<interpolation<Type> > New
00095 (
00096 const word& interpolationType,
00097 const GeometricField<Type, fvPatchField, volMesh>& psi
00098 );
00099
00100
00101 static autoPtr<interpolation<Type> > New
00102 (
00103 const dictionary& interpolationSchemes,
00104 const GeometricField<Type, fvPatchField, volMesh>& psi
00105 );
00106
00107
00108
00109
00110
00111 interpolation
00112 (
00113 const GeometricField<Type, fvPatchField, volMesh>& psi
00114 );
00115
00116
00117
00118
00119 virtual ~interpolation()
00120 {}
00121
00122
00123
00124
00125
00126 const GeometricField<Type, fvPatchField, volMesh>& psi() const
00127 {
00128 return psi_;
00129 }
00130
00131
00132 virtual Type interpolate
00133 (
00134 const vector& position,
00135 const label nCell,
00136 const label facei = -1
00137 ) const = 0;
00138 };
00139
00140
00141
00142
00143 }
00144
00145
00146
00147 #define makeInterpolationType(SS, Type) \
00148 \
00149 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
00150 \
00151 interpolation<Type>::adddictionaryConstructorToTable<SS<Type> > \
00152 add##SS##Type##ConstructorToTable_;
00153
00154
00155 #define makeInterpolation(SS) \
00156 \
00157 makeInterpolationType(SS, scalar) \
00158 makeInterpolationType(SS, vector) \
00159 makeInterpolationType(SS, sphericalTensor) \
00160 makeInterpolationType(SS, symmTensor) \
00161 makeInterpolationType(SS, tensor)
00162
00163
00164
00165
00166 #ifdef NoRepository
00167 # include "interpolation.C"
00168 #endif
00169
00170
00171
00172 #endif
00173
00174
Copyright © 2000-2009 OpenCFD Ltd