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