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
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 #ifndef mapPolyMesh_H
00140 #define mapPolyMesh_H
00141
00142 #include <OpenFOAM/labelList.H>
00143 #include <OpenFOAM/objectMap.H>
00144 #include <OpenFOAM/pointField.H>
00145 #include <OpenFOAM/HashSet.H>
00146 #include <OpenFOAM/Map.H>
00147
00148
00149
00150 namespace Foam
00151 {
00152
00153 class polyMesh;
00154
00155
00156
00157
00158
00159 class mapPolyMesh
00160 :
00161 public refCount
00162 {
00163
00164
00165
00166 const polyMesh& mesh_;
00167
00168
00169 const label nOldPoints_;
00170
00171
00172 const label nOldFaces_;
00173
00174
00175 const label nOldCells_;
00176
00177
00178
00179
00180
00181
00182
00183 const labelList pointMap_;
00184
00185
00186 const List<objectMap> pointsFromPointsMap_;
00187
00188
00189
00190
00191
00192
00193
00194
00195 const labelList faceMap_;
00196
00197
00198 const List<objectMap> facesFromPointsMap_;
00199
00200
00201 const List<objectMap> facesFromEdgesMap_;
00202
00203
00204 const List<objectMap> facesFromFacesMap_;
00205
00206
00207
00208
00209 const labelList cellMap_;
00210
00211
00212 const List<objectMap> cellsFromPointsMap_;
00213
00214
00215 const List<objectMap> cellsFromEdgesMap_;
00216
00217
00218 const List<objectMap> cellsFromFacesMap_;
00219
00220
00221 const List<objectMap> cellsFromCellsMap_;
00222
00223
00224 const labelList reversePointMap_;
00225
00226
00227 const labelList reverseFaceMap_;
00228
00229
00230 const labelList reverseCellMap_;
00231
00232
00233 const labelHashSet flipFaceFlux_;
00234
00235
00236 const labelListList patchPointMap_;
00237
00238
00239
00240
00241 const labelListList pointZoneMap_;
00242
00243
00244
00245
00246 const labelListList faceZonePointMap_;
00247
00248
00249
00250
00251 const labelListList faceZoneFaceMap_;
00252
00253
00254
00255
00256 const labelListList cellZoneMap_;
00257
00258
00259
00260 const pointField preMotionPoints_;
00261
00262
00263 labelList oldPatchSizes_;
00264
00265
00266 const labelList oldPatchStarts_;
00267
00268
00269 const labelList oldPatchNMeshPoints_;
00270
00271
00272
00273
00274
00275 mapPolyMesh(const mapPolyMesh&);
00276
00277
00278 void operator=(const mapPolyMesh&);
00279
00280
00281 public:
00282
00283
00284
00285
00286 mapPolyMesh
00287 (
00288 const polyMesh& mesh,
00289 const label nOldPoints,
00290 const label nOldFaces,
00291 const label nOldCells,
00292 const labelList& pointMap,
00293 const List<objectMap>& pointsFromPoints,
00294 const labelList& faceMap,
00295 const List<objectMap>& facesFromPoints,
00296 const List<objectMap>& facesFromEdges,
00297 const List<objectMap>& facesFromFaces,
00298 const labelList& cellMap,
00299 const List<objectMap>& cellsFromPoints,
00300 const List<objectMap>& cellsFromEdges,
00301 const List<objectMap>& cellsFromFaces,
00302 const List<objectMap>& cellsFromCells,
00303 const labelList& reversePointMap,
00304 const labelList& reverseFaceMap,
00305 const labelList& reverseCellMap,
00306 const labelHashSet& flipFaceFlux,
00307 const labelListList& patchPointMap,
00308 const labelListList& pointZoneMap,
00309 const labelListList& faceZonePointMap,
00310 const labelListList& faceZoneFaceMap,
00311 const labelListList& cellZoneMap,
00312 const pointField& preMotionPoints,
00313 const labelList& oldPatchStarts,
00314 const labelList& oldPatchNMeshPoints
00315 );
00316
00317
00318 mapPolyMesh
00319 (
00320 const polyMesh& mesh,
00321 const label nOldPoints,
00322 const label nOldFaces,
00323 const label nOldCells,
00324 labelList& pointMap,
00325 List<objectMap>& pointsFromPoints,
00326 labelList& faceMap,
00327 List<objectMap>& facesFromPoints,
00328 List<objectMap>& facesFromEdges,
00329 List<objectMap>& facesFromFaces,
00330 labelList& cellMap,
00331 List<objectMap>& cellsFromPoints,
00332 List<objectMap>& cellsFromEdges,
00333 List<objectMap>& cellsFromFaces,
00334 List<objectMap>& cellsFromCells,
00335 labelList& reversePointMap,
00336 labelList& reverseFaceMap,
00337 labelList& reverseCellMap,
00338 labelHashSet& flipFaceFlux,
00339 labelListList& patchPointMap,
00340 labelListList& pointZoneMap,
00341 labelListList& faceZonePointMap,
00342 labelListList& faceZoneFaceMap,
00343 labelListList& cellZoneMap,
00344 pointField& preMotionPoints,
00345 labelList& oldPatchStarts,
00346 labelList& oldPatchNMeshPoints,
00347 const bool reUse
00348 );
00349
00350
00351
00352
00353
00354
00355 const polyMesh& mesh() const
00356 {
00357 return mesh_;
00358 }
00359
00360
00361 label nOldPoints() const
00362 {
00363 return nOldPoints_;
00364 }
00365
00366
00367 label nOldInternalFaces() const
00368 {
00369 return oldPatchStarts_[0];
00370 }
00371
00372
00373 label nOldFaces() const
00374 {
00375 return nOldFaces_;
00376 }
00377
00378
00379 label nOldCells() const
00380 {
00381 return nOldCells_;
00382 }
00383
00384
00385
00386
00387
00388 const labelList& pointMap() const
00389 {
00390 return pointMap_;
00391 }
00392
00393
00394 const List<objectMap>& pointsFromPointsMap() const
00395 {
00396 return pointsFromPointsMap_;
00397 }
00398
00399
00400
00401
00402 const labelList& faceMap() const
00403 {
00404 return faceMap_;
00405 }
00406
00407
00408 const List<objectMap>& facesFromPointsMap() const
00409 {
00410 return facesFromPointsMap_;
00411 }
00412
00413
00414 const List<objectMap>& facesFromEdgesMap() const
00415 {
00416 return facesFromEdgesMap_;
00417 }
00418
00419
00420 const List<objectMap>& facesFromFacesMap() const
00421 {
00422 return facesFromFacesMap_;
00423 }
00424
00425
00426
00427 const labelList& cellMap() const
00428 {
00429 return cellMap_;
00430 }
00431
00432
00433 const List<objectMap>& cellsFromPointsMap() const
00434 {
00435 return cellsFromPointsMap_;
00436 }
00437
00438
00439 const List<objectMap>& cellsFromEdgesMap() const
00440 {
00441 return cellsFromEdgesMap_;
00442 }
00443
00444
00445 const List<objectMap>& cellsFromFacesMap() const
00446 {
00447 return cellsFromFacesMap_;
00448 }
00449
00450
00451 const List<objectMap>& cellsFromCellsMap() const
00452 {
00453 return cellsFromCellsMap_;
00454 }
00455
00456
00457
00458
00459
00460
00461 const labelList& reversePointMap() const
00462 {
00463 return reversePointMap_;
00464 }
00465
00466
00467
00468 label mergedPoint(const label oldPointI) const
00469 {
00470 label i = reversePointMap_[oldPointI];
00471
00472 if (i == -1)
00473 {
00474 return i;
00475 }
00476 else if (i < -1)
00477 {
00478 return -i-2;
00479 }
00480 else
00481 {
00482 FatalErrorIn("mergedPoint(const label) const")
00483 << "old point label " << oldPointI
00484 << " has reverseMap " << i << endl
00485 << "Only call mergedPoint for removed points."
00486 << abort(FatalError);
00487 return -1;
00488 }
00489 }
00490
00491
00492
00493 const labelList& reverseFaceMap() const
00494 {
00495 return reverseFaceMap_;
00496 }
00497
00498
00499 label mergedFace(const label oldFaceI) const
00500 {
00501 label i = reverseFaceMap_[oldFaceI];
00502
00503 if (i == -1)
00504 {
00505 return i;
00506 }
00507 else if (i < -1)
00508 {
00509 return -i-2;
00510 }
00511 else
00512 {
00513 FatalErrorIn("mergedFace(const label) const")
00514 << "old face label " << oldFaceI
00515 << " has reverseMap " << i << endl
00516 << "Only call mergedFace for removed faces."
00517 << abort(FatalError);
00518 return -1;
00519 }
00520 }
00521
00522
00523
00524 const labelList& reverseCellMap() const
00525 {
00526 return reverseCellMap_;
00527 }
00528
00529
00530 label mergedCell(const label oldCellI) const
00531 {
00532 label i = reverseCellMap_[oldCellI];
00533
00534 if (i == -1)
00535 {
00536 return i;
00537 }
00538 else if (i < -1)
00539 {
00540 return -i-2;
00541 }
00542 else
00543 {
00544 FatalErrorIn("mergedCell(const label) const")
00545 << "old cell label " << oldCellI
00546 << " has reverseMap " << i << endl
00547 << "Only call mergedCell for removed cells."
00548 << abort(FatalError);
00549 return -1;
00550 }
00551 }
00552
00553
00554 const labelHashSet& flipFaceFlux() const
00555 {
00556 return flipFaceFlux_;
00557 }
00558
00559
00560
00561
00562 const labelListList& patchPointMap() const
00563 {
00564 return patchPointMap_;
00565 }
00566
00567
00568
00569
00570
00571
00572
00573 const labelListList& pointZoneMap() const
00574 {
00575 return pointZoneMap_;
00576 }
00577
00578
00579
00580
00581 const labelListList& faceZonePointMap() const
00582 {
00583 return faceZonePointMap_;
00584 }
00585
00586
00587
00588
00589 const labelListList& faceZoneFaceMap() const
00590 {
00591 return faceZoneFaceMap_;
00592 }
00593
00594
00595
00596
00597 const labelListList& cellZoneMap() const
00598 {
00599 return cellZoneMap_;
00600 }
00601
00602
00603
00604
00605 const pointField& preMotionPoints() const
00606 {
00607 return preMotionPoints_;
00608 }
00609
00610
00611 bool hasMotionPoints() const
00612 {
00613 return preMotionPoints_.size() > 0;
00614 }
00615
00616
00617
00618 const labelList& oldPatchSizes() const
00619 {
00620 return oldPatchSizes_;
00621 }
00622
00623
00624 const labelList& oldPatchStarts() const
00625 {
00626 return oldPatchStarts_;
00627 }
00628
00629
00630 const labelList& oldPatchNMeshPoints() const
00631 {
00632 return oldPatchNMeshPoints_;
00633 }
00634 };
00635
00636
00637
00638
00639 }
00640
00641
00642
00643 #endif
00644
00645