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
00034
00035
00036
00037
00038
00039 #ifndef meshtoMesh_H
00040 #define meshtoMesh_H
00041
00042 #include "fvMesh.H"
00043 #include "HashTable.H"
00044 #include "fvPatchMapper.H"
00045 #include "scalarList.H"
00046 #include "className.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053 template<class Type>
00054 class octree;
00055
00056 class octreeDataCell;
00057
00058
00059
00060
00061
00062 class meshToMesh
00063 {
00064
00065
00066
00067
00068 const fvMesh& fromMesh_;
00069 const fvMesh& toMesh_;
00070
00071
00072 HashTable<label> fromMeshPatches_;
00073
00074
00075 HashTable<label> toMeshPatches_;
00076
00077
00078 HashTable<word> patchMap_;
00079
00080
00081 HashTable<label> cuttingPatches_;
00082
00083
00084 labelList cellAddressing_;
00085
00086
00087 labelListList boundaryAddressing_;
00088
00089
00090 mutable scalarListList* inverseDistanceWeightsPtr_;
00091
00092
00093
00094
00095 void calcAddressing();
00096
00097 void cellAddresses
00098 (
00099 labelList& cells,
00100 const pointField& points,
00101 const fvMesh& fromMesh,
00102 const List<bool>& boundaryCell,
00103 const octree<octreeDataCell>& oc
00104 ) const;
00105
00106 void calculateInverseDistanceWeights() const;
00107
00108 const scalarListList& inverseDistanceWeights() const;
00109
00110
00111
00112
00113
00114 static const scalar directHitTol;
00115
00116
00117 public:
00118
00119
00120 ClassName("meshToMesh");
00121
00122
00123
00124 enum order
00125 {
00126 MAP,
00127 INTERPOLATE,
00128 CELL_POINT_INTERPOLATE
00129 };
00130
00131
00132
00133
00134
00135
00136
00137 meshToMesh
00138 (
00139 const fvMesh& fromMesh,
00140 const fvMesh& toMesh,
00141 const HashTable<word>& patchMap,
00142 const wordList& cuttingPatchNames
00143 );
00144
00145
00146
00147 meshToMesh
00148 (
00149 const fvMesh& fromMesh,
00150 const fvMesh& toMesh
00151 );
00152
00153
00154
00155
00156 ~meshToMesh();
00157
00158
00159
00160 class patchFieldInterpolator
00161 :
00162 public fvPatchFieldMapper
00163 {
00164 const labelList& directAddressing_;
00165
00166 public:
00167
00168
00169
00170
00171 patchFieldInterpolator(const labelList& addr)
00172 :
00173 directAddressing_(addr)
00174 {}
00175
00176
00177
00178
00179 virtual ~patchFieldInterpolator()
00180 {}
00181
00182
00183
00184
00185 label size() const
00186 {
00187 return directAddressing_.size();
00188 }
00189
00190 bool direct() const
00191 {
00192 return true;
00193 }
00194
00195 const labelList& directAddressing() const
00196 {
00197 return directAddressing_;
00198 }
00199 };
00200
00201
00202
00203
00204
00205
00206 const fvMesh& fromMesh() const
00207 {
00208 return fromMesh_;
00209 }
00210
00211 const fvMesh& toMesh() const
00212 {
00213 return toMesh_;
00214 }
00215
00216
00217 const labelList& cellAddressing() const
00218 {
00219 return cellAddressing_;
00220 }
00221
00222
00223
00224
00225 template<class Type>
00226 void mapField
00227 (
00228 Field<Type>&,
00229 const Field<Type>&,
00230 const labelList& adr
00231 ) const;
00232
00233
00234 template<class Type>
00235 void interpolateField
00236 (
00237 Field<Type>&,
00238 const GeometricField<Type, fvPatchField, volMesh>&,
00239 const labelList& adr,
00240 const scalarListList& weights
00241 ) const;
00242
00243
00244 template<class Type>
00245 void interpolateField
00246 (
00247 Field<Type>&,
00248 const GeometricField<Type, fvPatchField, volMesh>&,
00249 const labelList& adr,
00250 const vectorField& centres
00251 ) const;
00252
00253
00254
00255 template<class Type>
00256 void interpolateInternalField
00257 (
00258 Field<Type>&,
00259 const GeometricField<Type, fvPatchField, volMesh>&,
00260 order=INTERPOLATE
00261 ) const;
00262
00263 template<class Type>
00264 void interpolateInternalField
00265 (
00266 Field<Type>&,
00267 const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00268 order=INTERPOLATE
00269 ) const;
00270
00271
00272
00273 template<class Type>
00274 void interpolate
00275 (
00276 GeometricField<Type, fvPatchField, volMesh>&,
00277 const GeometricField<Type, fvPatchField, volMesh>&,
00278 order=INTERPOLATE
00279 ) const;
00280
00281 template<class Type>
00282 void interpolate
00283 (
00284 GeometricField<Type, fvPatchField, volMesh>&,
00285 const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00286 order=INTERPOLATE
00287 ) const;
00288
00289
00290
00291 template<class Type>
00292 tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
00293 (
00294 const GeometricField<Type, fvPatchField, volMesh>&,
00295 order=INTERPOLATE
00296 ) const;
00297
00298 template<class Type>
00299 tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
00300 (
00301 const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00302 order=INTERPOLATE
00303 ) const;
00304 };
00305
00306
00307
00308
00309 }
00310
00311
00312
00313 #ifdef NoRepository
00314 # include "meshToMeshInterpolate.C"
00315 #endif
00316
00317
00318
00319 #endif
00320
00321