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