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