Go to the documentation of this file.
63 #ifndef polyTopoChange_H
64 #define polyTopoChange_H
86 class polyBoundaryMesh;
262 const label nActiveFaces,
270 const label nActiveFaces,
284 const label nActiveFaces,
307 const bool orderCells,
308 const bool orderPoints,
309 label& nInternalPoints,
319 const bool internalFacesOnly
369 const bool syncParallel,
379 const bool syncParallel,
380 const bool orderCells,
381 const bool orderPoints,
382 label& nInternalPoints,
495 const label masterPointID,
507 const label newZoneID,
521 const label masterPointID,
522 const label masterEdgeID,
523 const label masterFaceID,
524 const bool flipFaceFlux,
537 const bool flipFaceFlux,
549 const label masterPointID,
550 const label masterEdgeID,
551 const label masterFaceID,
552 const label masterCellID,
585 const bool syncParallel =
true,
586 const bool orderCells =
false,
587 const bool orderPoints =
false
596 const bool syncParallel =
true,
597 const bool orderCells =
false,
598 const bool orderPoints =
false
label addCell(const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID)
Add cell. Return new cell label.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label getCellOrder(const CompactListList< label, labelList > &, labelList &) const
Cell ordering (bandCompression). Returns number of remaining cells.
void reorderCompactFaces(const label newSize, const labelList &oldToNew)
Compact and reorder faces according to map.
labelHashSet retiredPoints_
Retired points.
void clear()
Clear all storage.
Map< label > cellFromEdge_
Cells added from edge.
PackedBoolList faceZoneFlip_
Orientation of face in zone.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
const DynamicList< point > & points() const
Points. Shrunk after constructing mesh (or calling of compact())
void modifyCell(const label, const label zoneID)
Modify zone of cell.
void modifyPoint(const label, const point &, const label newZoneID, const bool inCell)
Modify coordinate.
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
label addFace(const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Add face to cells. Return new face label.
void modifyFace(const face &f, const label faceI, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Modify vertices or cell of face.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void removeCell(const label, const label)
Remove/merge cell.
static void writeMeshStats(const polyMesh &mesh, Ostream &)
Print some stats about mesh.
void addMesh(const polyMesh &, const labelList &patchMap, const labelList &pointZoneMap, const labelList &faceZoneMap, const labelList &cellZoneMap)
Add all points/faces/cells of mesh. Additional offset for patch.
bool strict_
Whether to allow referencing illegal points/cells/faces.
void calcPatchPointMap(const List< Map< label > > &, const polyBoundaryMesh &, labelListList &) const
Calculate mapping for patchpoints only.
const DynamicList< label > & faceOwner() const
DynamicList< label > pointMap_
Original point label (or masterpoint for added points)
void calcFaceInflationMaps(const polyMesh &, List< objectMap > &, List< objectMap > &, List< objectMap > &) const
label addPoint(const point &, const label masterPointID, const label zoneID, const bool inCell)
Add point. Return new point label.
Mesh consisting of general polyhedral cells.
const DynamicList< label > & faceNeighbour() const
void setCapacity(const label nPoints, const label nFaces, const label nCells)
Explicitly pre-size the dynamic storage for expected mesh.
static void getMergeSets(const labelList &reverseCellMap, const labelList &cellMap, List< objectMap > &cellsFromCells)
Calculate object maps. Requires reverseMap to have destination.
DynamicList< label > region_
Patch for every external face (-1 for internal faces)
Map< label > faceZone_
Zone of face.
static void renumberCompact(const labelList &, labelList &)
Renumber & compact elements of list according to map.
polyTopoChange(const label nPatches, const bool strict=true)
Construct without mesh. Either specify nPatches or use.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const DynamicList< face > & faces() const
void checkFace(const face &, const label faceI, const label own, const label nei, const label patchI, const label zoneI) const
Check inputs to modFace or addFace.
static labelList selectFaces(const primitiveMesh &, const labelList &faceLabels, const bool internalFacesOnly)
Select either internal or external faces out of faceLabels.
void getFaceOrder(const label nActiveFaces, const labelList &cellFaces, const labelList &cellFaceOffsets, labelList &oldToNew, labelList &patchSizes, labelList &patchStarts) const
Do upper-triangular ordering and patch ordering.
autoPtr< mapPolyMesh > makeMesh(autoPtr< fvMesh > &newMesh, const IOobject &io, const polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches.
void makeCells(const label nActiveFaces, labelList &cellFaces, labelList &cellFaceOffsets) const
Construct cells (in packed storage)
static void reorder(const labelList &map, DynamicList< T > &)
Reorder contents of container according to map.
DynamicList< label > reversePointMap_
For all original and added points contains new point label.
void removePoint(const label, const label)
Remove/merge point.
void removeFace(const label, const label)
Remove/merge face.
bool pointRemoved(const label pointI) const
Is point removed?
Map< label > faceFromPoint_
Faces added from point (corresponding faceMap_ will.
bool faceRemoved(const label faceI) const
Is face removed?
void resetZones(const polyMesh &, polyMesh &, labelListList &, labelListList &, labelListList &) const
static labelHashSet getSetIndices(const PackedBoolList &)
Get all set elements as a labelHashSet.
void makeCellCells(const label nActiveFaces, CompactListList< label, labelList > &cellCells) const
Construct cellCells (in packed storage)
label nPatches_
Number of patches.
ClassName("polyTopoChange")
Runtime type information.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
DynamicList< label > reverseCellMap_
For all original and added cells contains new cell label.
void reorderCoupledFaces(const bool syncParallel, const polyBoundaryMesh &, const labelList &patchStarts, const labelList &patchSizes, const pointField &points)
Do all coupled patch face reordering.
DynamicList< label > faceNeighbour_
Neighbour for internal faces (-1 for external faces)
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
DynamicList< label > cellZone_
Zone of cell.
void compactAndReorder(const polyMesh &, const bool syncParallel, const bool orderCells, const bool orderPoints, label &nInternalPoints, pointField &newPoints, labelList &patchSizes, labelList &patchStarts, List< objectMap > &pointsFromPoints, List< objectMap > &facesFromPoints, List< objectMap > &facesFromEdges, List< objectMap > &facesFromFaces, List< objectMap > &cellsFromPoints, List< objectMap > &cellsFromEdges, List< objectMap > &cellsFromFaces, List< objectMap > &cellsFromCells, List< Map< label > > &oldPatchMeshPointMaps, labelList &oldPatchNMeshPoints, labelList &oldPatchStarts, List< Map< label > > &oldFaceZoneMeshPointMaps)
pointField facePoints(const face &f) const
Return face points.
PackedBoolList flipFaceFlux_
In mapping whether to reverse the flux.
static void renumber(const labelList &, labelHashSet &)
Renumber elements of container according to map.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void renumberReverseMap(const labelList &, DynamicList< label > &)
Special handling of reverse maps which have <-1 in them.
void calcFaceZonePointMap(const polyMesh &, const List< Map< label > > &, labelListList &) const
bool cellRemoved(const label cellI) const
Is cell removed?
void setNumPatches(const label nPatches)
Explicitly set the number of patches if construct-without-mesh.
DynamicList< label > faceOwner_
Owner for all faces.
Map< label > cellFromPoint_
Cells added from point.
DynamicList< label > reverseFaceMap_
For all original and added faces contains new face label.
static void renumberKey(const labelList &map, Map< T > &)
A virtual base class for topological actions.
A face is a list of labels corresponding to mesh vertices.
const DynamicList< label > & region() const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Map< label > cellFromFace_
Cells added from face.
void compact(const bool orderCells, const bool orderPoints, label &nInternalPoints, labelList &patchSizes, labelList &patchStarts)
Remove all unused/removed points/faces/cells and update.
DynamicList< label > faceMap_
Original face label. Or master face for added-from-faces;.
void calcCellInflationMaps(const polyMesh &, List< objectMap > &, List< objectMap > &, List< objectMap > &, List< objectMap > &) const
label nActiveFaces_
Active faces.
Map< label > pointZone_
Zone of point.
DynamicList< face > faces_
Current faceList.
DynamicList< label > cellMap_
Original cell label or master cell for added-from-cell;.
void movePoints(const pointField &newPoints)
Move all points. Incompatible with other topology changes.
DynamicList< point > points_
Current point set.
bool hasValidPoints(const face &) const
Are all face vertices valid.
Map< label > faceFromEdge_
Faces added from edge (corresponding faceMap_ will.
static void countMap(const labelList &map, const labelList &reverseMap, label &nAdd, label &nInflate, label &nMerge, label &nRemove)
Count number of added and removed quantities from maps.
Cell-face mesh analysis engine.