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
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef meshWave_H
00049 #define meshWave_H
00050
00051 #include "boolList.H"
00052 #include "labelList.H"
00053 #include "primitiveFieldsFwd.H"
00054
00055
00056
00057 namespace Foam
00058 {
00059
00060
00061 class polyMesh;
00062 class polyPatch;
00063
00064
00065
00066
00067
00068 TemplateName(meshWave);
00069
00070
00071
00072
00073
00074
00075 template <class Type>
00076 class meshWave
00077 :
00078 public meshWaveName
00079 {
00080
00081
00082
00083 const polyMesh& mesh_;
00084
00085
00086 List<Type> allCellInfo_;
00087
00088
00089 List<Type> allFaceInfo_;
00090
00091
00092 boolList changedFace_;
00093
00094
00095 labelList changedFaces_;
00096
00097
00098 label nChangedFaces_;
00099
00100
00101 boolList changedCell_;
00102 labelList changedCells_;
00103 label nChangedCells_;
00104
00105
00106 bool hasCyclicPatches_;
00107
00108
00109 bool hasProcPatches_;
00110
00111
00112 label nEvals_;
00113
00114
00115 label nUnvisitedCells_;
00116 label nUnvisitedFaces_;
00117
00118
00119 label iter_;
00120
00121
00122 const string procLabel_;
00123
00124
00125
00126
00127 static Ostream& writeFaces
00128 (
00129 const label nFaces,
00130 const labelList& faceLabels,
00131 const List<Type>& faceInfo,
00132 Ostream& os
00133 );
00134
00135
00136 static Istream& readFaces
00137 (
00138 label& nFaces,
00139 labelList& faceLabels,
00140 List<Type>& faceInfo,
00141 Istream& is
00142 );
00143
00144
00145
00146
00147
00148 meshWave(const meshWave&);
00149
00150
00151 void operator=(const meshWave&);
00152
00153
00154
00155
00156 bool updateCell
00157 (
00158 const label cellI,
00159 const label neighbourFaceI,
00160 const Type& neighbourInfo,
00161 const scalar tol,
00162 Type& cellInfo
00163 );
00164
00165
00166
00167 bool updateFace
00168 (
00169 const label faceI,
00170 const label neighbourCellI,
00171 const Type& neighbourInfo,
00172 const scalar tol,
00173 Type& faceInfo
00174 );
00175
00176
00177
00178 bool updateFace
00179 (
00180 const label faceI,
00181 const Type& neighbourInfo,
00182 const scalar tol,
00183 Type& faceInfo
00184 );
00185
00186
00187 void setFaceInfo
00188 (
00189 const labelList& changedFaces,
00190 const List<Type>& changedFacesInfo
00191 );
00192
00193
00194
00195
00196
00197 void checkCyclic(const polyPatch& pPatch) const;
00198
00199
00200 bool hasPatchType(const word& nameOfType);
00201
00202
00203 void mergeFaceInfo
00204 (
00205 const polyPatch& patch,
00206 const label nFaces,
00207 const labelList&,
00208 const List<Type>&,
00209 const bool isParallel
00210 );
00211
00212
00213 label getChangedPatchFaces
00214 (
00215 const polyPatch& patch,
00216 const label startFaceI,
00217 const label nFaces,
00218 labelList& changedPatchFaces,
00219 List<Type>& changedPatchFacesInfo
00220 ) const;
00221
00222
00223 void leaveDomain
00224 (
00225 const polyPatch& patch,
00226 const label nFaces,
00227 const labelList& faceLabels,
00228 List<Type>& faceInfo
00229 ) const;
00230
00231
00232 void enterDomain
00233 (
00234 const polyPatch& patch,
00235 const label nFaces,
00236 const labelList& faceLabels,
00237 List<Type>& faceInfo
00238 ) const;
00239
00240
00241 void sendPatchInfo
00242 (
00243 const label neighbour,
00244 const label nFaces,
00245 const labelList&,
00246 const List<Type>&
00247 ) const;
00248
00249
00250 label receivePatchInfo
00251 (
00252 const label neighbour,
00253 labelList&,
00254 List<Type>&
00255 ) const;
00256
00257
00258 static void offset
00259 (
00260 const polyPatch& patch,
00261 const label off,
00262 const label nFaces,
00263 labelList& faces
00264 );
00265
00266
00267 static void transform
00268 (
00269 const tensorField& rotTensor,
00270 const label nFaces,
00271 List<Type>& faceInfo
00272 );
00273
00274
00275 void handleProcPatches();
00276
00277
00278 void handleCyclicPatches();
00279
00280
00281
00282
00283 static const scalar geomTol_;
00284 static const scalar propagationTol_;
00285
00286 public:
00287
00288
00289
00290
00291
00292
00293 meshWave
00294 (
00295 const polyMesh& mesh,
00296 const labelList& initialChangedFaces,
00297 const List<Type>& changedFacesInfo,
00298 const label maxIter
00299 );
00300
00301
00302
00303
00304
00305 meshWave
00306 (
00307 const polyMesh& mesh,
00308 const labelList& initialChangedFaces,
00309 const List<Type>& changedFacesInfo,
00310 const List<Type>& allCellInfo,
00311 const label maxIter
00312 );
00313
00314
00315
00316
00317 ~meshWave();
00318
00319
00320
00321
00322
00323 const List<Type>& allFaceInfo() const
00324 {
00325 return allFaceInfo_;
00326 }
00327
00328
00329 const List<Type>& allCellInfo() const
00330 {
00331 return allCellInfo_;
00332 }
00333
00334
00335
00336
00337
00338
00339 label getUnsetCells() const;
00340
00341 label getUnsetFaces() const;
00342
00343
00344
00345 label faceToCell();
00346
00347
00348
00349
00350 label cellToFace();
00351
00352
00353 label iterate(const label maxIter);
00354 };
00355
00356
00357
00358
00359 }
00360
00361
00362
00363
00364 #ifdef NoRepository
00365 # include "meshWave.C"
00366 #endif
00367
00368
00369
00370 #endif
00371
00372