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