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 #ifndef hexRef8_H
00037 #define hexRef8_H
00038
00039 #include "labelIOList.H"
00040 #include "face.H"
00041 #include "HashSet.H"
00042 #include "DynamicList.H"
00043 #include "primitivePatch.H"
00044 #include "removeFaces.H"
00045 #include "refinementHistory.H"
00046 #include "PackedBoolList.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053
00054 class polyMesh;
00055 class polyPatch;
00056 class polyTopoChange;
00057 class mapPolyMesh;
00058 class mapDistributePolyMesh;
00059
00060
00061
00062
00063
00064 class hexRef8
00065 {
00066
00067
00068
00069 const polyMesh& mesh_;
00070
00071
00072 labelIOList cellLevel_;
00073
00074
00075 labelIOList pointLevel_;
00076
00077
00078 const scalar level0Edge_;
00079
00080
00081 refinementHistory history_;
00082
00083
00084 removeFaces faceRemover_;
00085
00086
00087 Map<label> savedPointLevel_;
00088
00089
00090 Map<label> savedCellLevel_;
00091
00092
00093
00094
00095
00096 static void reorder
00097 (
00098 const labelList& map,
00099 const label len,
00100 const label null,
00101 labelList& elems
00102 );
00103
00104
00105 void getFaceInfo
00106 (
00107 const label faceI,
00108 label& patchID,
00109 label& zoneID,
00110 label& zoneFlip
00111 ) const;
00112
00113
00114 label addFace
00115 (
00116 polyTopoChange& meshMod,
00117 const label faceI,
00118 const face& newFace,
00119 const label own,
00120 const label nei
00121 ) const;
00122
00123
00124 label addInternalFace
00125 (
00126 polyTopoChange& meshMod,
00127 const label meshFaceI,
00128 const label meshPointI,
00129 const face& newFace,
00130 const label own,
00131 const label nei
00132 ) const;
00133
00134
00135
00136 void modFace
00137 (
00138 polyTopoChange& meshMod,
00139 const label faceI,
00140 const face& newFace,
00141 const label own,
00142 const label nei
00143 ) const;
00144
00145 scalar getLevel0EdgeLength() const;
00146
00147
00148 label getAnchorCell
00149 (
00150 const labelListList& cellAnchorPoints,
00151 const labelListList& cellAddedCells,
00152 const label cellI,
00153 const label faceI,
00154 const label pointI
00155 ) const;
00156
00157
00158
00159 void getFaceNeighbours
00160 (
00161 const labelListList& cellAnchorPoints,
00162 const labelListList& cellAddedCells,
00163 const label faceI,
00164 const label pointI,
00165
00166 label& own,
00167 label& nei
00168 ) const;
00169
00170
00171
00172 label findMinLevel(const labelList& f) const;
00173
00174 label findMaxLevel(const labelList& f) const;
00175
00176 label countAnchors(const labelList&, const label) const;
00177
00178 void dumpCell(const label cellI) const;
00179
00180 label findLevel
00181 (
00182 const label faceI,
00183 const face& f,
00184 const label startFp,
00185 const bool searchForward,
00186 const label wantedLevel
00187 ) const;
00188
00190
00191
00192
00193 static void checkInternalOrientation
00194 (
00195 polyTopoChange& meshMod,
00196 const label cellI,
00197 const label faceI,
00198 const point& ownPt,
00199 const point& neiPt,
00200 const face& newFace
00201 );
00202
00203
00204 static void checkBoundaryOrientation
00205 (
00206 polyTopoChange& meshMod,
00207 const label cellI,
00208 const label faceI,
00209 const point& ownPt,
00210 const point& boundaryPt,
00211 const face& newFace
00212 );
00213
00214
00215
00216 void insertEdgeSplit
00217 (
00218 const labelList& edgeMidPoint,
00219 const label p0,
00220 const label p1,
00221 DynamicList<label>& verts
00222 ) const;
00223
00224
00225 label storeMidPointInfo
00226 (
00227 const labelListList& cellAnchorPoints,
00228 const labelListList& cellAddedCells,
00229 const labelList& cellMidPoint,
00230 const labelList& edgeMidPoint,
00231 const label cellI,
00232 const label faceI,
00233 const bool faceOrder,
00234 const label midPointI,
00235 const label anchorPointI,
00236 const label faceMidPointI,
00237
00238 Map<edge>& midPointToAnchors,
00239 Map<edge>& midPointToFaceMids,
00240 polyTopoChange& meshMod
00241 ) const;
00242
00243
00244 void createInternalFromSplitFace
00245 (
00246 const labelListList& cellAnchorPoints,
00247 const labelListList& cellAddedCells,
00248 const labelList& cellMidPoint,
00249 const labelList& faceMidPoint,
00250 const labelList& edgeMidPoint,
00251 const label cellI,
00252 const label faceI,
00253
00254 Map<edge>& midPointToAnchors,
00255 Map<edge>& midPointToFaceMids,
00256 polyTopoChange& meshMod,
00257 label& nFacesAdded
00258 ) const;
00259
00260
00261 void createInternalFaces
00262 (
00263 const labelListList& cellAnchorPoints,
00264 const labelListList& cellAddedCells,
00265 const labelList& cellMidPoint,
00266 const labelList& faceMidPoint,
00267 const labelList& faceAnchorLevel,
00268 const labelList& edgeMidPoint,
00269 const label cellI,
00270 polyTopoChange& meshMod
00271 ) const;
00272
00273
00274
00275 void walkFaceToMid
00276 (
00277 const labelList& edgeMidPoint,
00278 const label cLevel,
00279 const label faceI,
00280 const label startFp,
00281 DynamicList<label>& faceVerts
00282 ) const;
00283
00284
00285 void walkFaceFromMid
00286 (
00287 const labelList& edgeMidPoint,
00288 const label cLevel,
00289 const label faceI,
00290 const label startFp,
00291 DynamicList<label>& faceVerts
00292 ) const;
00293
00294
00295
00296 label faceConsistentRefinement
00297 (
00298 const bool maxSet,
00299 PackedBoolList& refineCell
00300 ) const;
00301
00302
00303 void checkWantedRefinementLevels(const labelList&) const;
00304
00305
00306
00307
00308 hexRef8(const hexRef8&);
00309
00310
00311 void operator=(const hexRef8&);
00312
00313
00314 public:
00315
00316
00317 ClassName("hexRef8");
00318
00319
00320
00321
00322
00323
00324 hexRef8(const polyMesh& mesh);
00325
00326
00327 hexRef8
00328 (
00329 const polyMesh& mesh,
00330 const labelList& cellLevel,
00331 const labelList& pointLevel,
00332 const refinementHistory& history
00333 );
00334
00335
00336 hexRef8
00337 (
00338 const polyMesh& mesh,
00339 const labelList& cellLevel,
00340 const labelList& pointLevel
00341 );
00342
00343
00344
00345
00346
00347
00348 const labelIOList& cellLevel() const
00349 {
00350 return cellLevel_;
00351 }
00352
00353 const labelIOList& pointLevel() const
00354 {
00355 return pointLevel_;
00356 }
00357
00358 const refinementHistory& history() const
00359 {
00360 return history_;
00361 }
00362
00363
00364 scalar level0EdgeLength() const
00365 {
00366 return level0Edge_;
00367 }
00368
00369
00370
00371
00372 label getAnchorLevel(const label faceI) const;
00373
00374
00375
00376
00377
00378
00379 labelList consistentRefinement
00380 (
00381 const labelList& cellsToRefine,
00382 const bool maxSet
00383 ) const;
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398 labelList consistentSlowRefinement
00399 (
00400 const label maxFaceDiff,
00401 const labelList& cellsToRefine,
00402 const labelList& facesToCheck,
00403 const label maxPointDiff,
00404 const labelList& pointsToCheck
00405 ) const;
00406
00407
00408
00409
00410 labelList consistentSlowRefinement2
00411 (
00412 const label maxFaceDiff,
00413 const labelList& cellsToRefine,
00414 const labelList& facesToCheck
00415 ) const;
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430 labelListList setRefinement
00431 (
00432 const labelList& cells,
00433 polyTopoChange&
00434 );
00435
00436
00437 void updateMesh(const mapPolyMesh&);
00438
00439
00440
00441
00442
00443
00444
00445
00446 void storeData
00447 (
00448 const labelList& pointsToStore,
00449 const labelList& facesToStore,
00450 const labelList& cellsToStore
00451 );
00452
00453
00454
00455
00456 void updateMesh
00457 (
00458 const mapPolyMesh&,
00459 const Map<label>& pointsToRestore,
00460 const Map<label>& facesToRestore,
00461 const Map<label>& cellsToRestore
00462 );
00463
00464
00465
00466
00467 void subset
00468 (
00469 const labelList& pointMap,
00470 const labelList& faceMap,
00471 const labelList& cellMap
00472 );
00473
00474
00475 void distribute(const mapDistributePolyMesh&);
00476
00477
00478 void checkMesh() const;
00479
00480
00481
00482
00483 void checkRefinementLevels
00484 (
00485 const label maxPointDiff,
00486 const labelList& pointsToCheck
00487 ) const;
00488
00489
00490
00491
00492
00493 labelList getSplitPoints() const;
00494
00495
00496
00497
00498
00499
00500 labelList consistentUnrefinement
00501 (
00502 const labelList& pointsToUnrefine,
00503 const bool maxSet
00504 ) const;
00505
00506
00507
00508
00509
00510 void setUnrefinement
00511 (
00512 const labelList& splitPointLabels,
00513 polyTopoChange&
00514 );
00515
00516
00517
00518
00519 void setInstance(const fileName& inst);
00520
00521
00522 bool write() const;
00523
00524 };
00525
00526
00527
00528
00529 }
00530
00531
00532
00533 #endif
00534
00535