Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
polyTopoChange Class Reference

Direct mesh changes based on v1.3 polyTopoChange syntax. More...

Collaboration diagram for polyTopoChange:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("polyTopoChange")
 Runtime type information. More...
 
 polyTopoChange (const label nPatches, const bool strict=true)
 Construct without mesh. Either specify nPatches or use. More...
 
 polyTopoChange (const polyMesh &mesh, const bool strict=true)
 Construct from mesh. Adds all points/face/cells from mesh. More...
 
const DynamicList< point > & points () const
 Points. Shrunk after constructing mesh (or calling of compact()) More...
 
const DynamicList< face > & faces () const
 
const DynamicList< label > & region () const
 
const DynamicList< label > & faceOwner () const
 
const DynamicList< label > & faceNeighbour () const
 
bool pointRemoved (const label pointI) const
 Is point removed? More...
 
bool faceRemoved (const label faceI) const
 Is face removed? More...
 
bool cellRemoved (const label cellI) const
 Is cell removed? More...
 
void clear ()
 Clear all storage. More...
 
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. More...
 
void setCapacity (const label nPoints, const label nFaces, const label nCells)
 Explicitly pre-size the dynamic storage for expected mesh. More...
 
void movePoints (const pointField &newPoints)
 Move all points. Incompatible with other topology changes. More...
 
label setAction (const topoAction &action)
 For compatibility with polyTopoChange: set topological action. More...
 
label addPoint (const point &, const label masterPointID, const label zoneID, const bool inCell)
 Add point. Return new point label. More...
 
void modifyPoint (const label, const point &, const label newZoneID, const bool inCell)
 Modify coordinate. More...
 
void removePoint (const label, const label)
 Remove/merge point. More...
 
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. More...
 
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. More...
 
void removeFace (const label, const label)
 Remove/merge face. More...
 
label addCell (const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID)
 Add cell. Return new cell label. More...
 
void modifyCell (const label, const label zoneID)
 Modify zone of cell. More...
 
void removeCell (const label, const label)
 Remove/merge cell. More...
 
void setNumPatches (const label nPatches)
 Explicitly set the number of patches if construct-without-mesh. More...
 
autoPtr< mapPolyMeshchangeMesh (polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
 Inplace changes mesh without change of patches. More...
 
autoPtr< mapPolyMeshmakeMesh (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. More...
 

Private Member Functions

bool hasValidPoints (const face &) const
 Are all face vertices valid. More...
 
pointField facePoints (const face &f) const
 Return face points. More...
 
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. More...
 
void makeCells (const label nActiveFaces, labelList &cellFaces, labelList &cellFaceOffsets) const
 Construct cells (in packed storage) More...
 
void makeCellCells (const label nActiveFaces, CompactListList< label, labelList > &cellCells) const
 Construct cellCells (in packed storage) More...
 
label getCellOrder (const CompactListList< label, labelList > &, labelList &) const
 Cell ordering (bandCompression). Returns number of remaining cells. More...
 
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. More...
 
void reorderCompactFaces (const label newSize, const labelList &oldToNew)
 Compact and reorder faces according to map. More...
 
void compact (const bool orderCells, const bool orderPoints, label &nInternalPoints, labelList &patchSizes, labelList &patchStarts)
 Remove all unused/removed points/faces/cells and update. More...
 
void calcPatchPointMap (const List< Map< label > > &, const polyBoundaryMesh &, labelListList &) const
 Calculate mapping for patchpoints only. More...
 
void calcFaceInflationMaps (const polyMesh &, List< objectMap > &, List< objectMap > &, List< objectMap > &) const
 
void calcCellInflationMaps (const polyMesh &, List< objectMap > &, List< objectMap > &, List< objectMap > &, List< objectMap > &) const
 
void resetZones (const polyMesh &, polyMesh &, labelListList &, labelListList &, labelListList &) const
 
void calcFaceZonePointMap (const polyMesh &, const List< Map< label > > &, labelListList &) const
 
void reorderCoupledFaces (const bool syncParallel, const polyBoundaryMesh &, const labelList &patchStarts, const labelList &patchSizes, const pointField &points)
 Do all coupled patch face reordering. More...
 
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)
 

Static Private Member Functions

template<class T >
static void reorder (const labelList &map, DynamicList< T > &)
 Reorder contents of container according to map. More...
 
template<class T >
static void reorder (const labelList &map, List< DynamicList< T > > &)
 
template<class T >
static void renumberKey (const labelList &map, Map< T > &)
 
static void renumber (const labelList &, labelHashSet &)
 Renumber elements of container according to map. More...
 
static void renumberReverseMap (const labelList &, DynamicList< label > &)
 Special handling of reverse maps which have <-1 in them. More...
 
static void renumberCompact (const labelList &, labelList &)
 Renumber & compact elements of list according to map. More...
 
static labelHashSet getSetIndices (const PackedBoolList &)
 Get all set elements as a labelHashSet. More...
 
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. More...
 
static void writeMeshStats (const polyMesh &mesh, Ostream &)
 Print some stats about mesh. More...
 
static void getMergeSets (const labelList &reverseCellMap, const labelList &cellMap, List< objectMap > &cellsFromCells)
 Calculate object maps. Requires reverseMap to have destination. More...
 
static labelList selectFaces (const primitiveMesh &, const labelList &faceLabels, const bool internalFacesOnly)
 Select either internal or external faces out of faceLabels. More...
 

Private Attributes

bool strict_
 Whether to allow referencing illegal points/cells/faces. More...
 
label nPatches_
 Number of patches. More...
 
DynamicList< pointpoints_
 Current point set. More...
 
DynamicList< labelpointMap_
 Original point label (or masterpoint for added points) More...
 
DynamicList< labelreversePointMap_
 For all original and added points contains new point label. More...
 
Map< labelpointZone_
 Zone of point. More...
 
labelHashSet retiredPoints_
 Retired points. More...
 
DynamicList< facefaces_
 Current faceList. More...
 
DynamicList< labelregion_
 Patch for every external face (-1 for internal faces) More...
 
DynamicList< labelfaceOwner_
 Owner for all faces. More...
 
DynamicList< labelfaceNeighbour_
 Neighbour for internal faces (-1 for external faces) More...
 
DynamicList< labelfaceMap_
 Original face label. Or master face for added-from-faces;. More...
 
DynamicList< labelreverseFaceMap_
 For all original and added faces contains new face label. More...
 
Map< labelfaceFromPoint_
 Faces added from point (corresponding faceMap_ will. More...
 
Map< labelfaceFromEdge_
 Faces added from edge (corresponding faceMap_ will. More...
 
PackedBoolList flipFaceFlux_
 In mapping whether to reverse the flux. More...
 
Map< labelfaceZone_
 Zone of face. More...
 
PackedBoolList faceZoneFlip_
 Orientation of face in zone. More...
 
label nActiveFaces_
 Active faces. More...
 
DynamicList< labelcellMap_
 Original cell label or master cell for added-from-cell;. More...
 
DynamicList< labelreverseCellMap_
 For all original and added cells contains new cell label. More...
 
Map< labelcellFromPoint_
 Cells added from point. More...
 
Map< labelcellFromEdge_
 Cells added from edge. More...
 
Map< labelcellFromFace_
 Cells added from face. More...
 
DynamicList< labelcellZone_
 Zone of cell. More...
 

Detailed Description

Direct mesh changes based on v1.3 polyTopoChange syntax.

Instead of recording changes and executing them all in one go (as did v1.3 polyTopoChange) this class actually holds the current points/faces/cells and does the change immediately. It can be asked to compress out all unused points/faces/cells and renumber everything to be consistent.

Note:

Source files

Definition at line 97 of file polyTopoChange.H.

Constructor & Destructor Documentation

◆ polyTopoChange() [1/2]

polyTopoChange ( const label  nPatches,
const bool  strict = true 
)

Construct without mesh. Either specify nPatches or use.

setNumPatches before trying to make a mesh (makeMesh, changeMesh)

Definition at line 2184 of file polyTopoChange.C.

◆ polyTopoChange() [2/2]

polyTopoChange ( const polyMesh mesh,
const bool  strict = true 
)

Construct from mesh. Adds all points/face/cells from mesh.

Definition at line 2216 of file polyTopoChange.C.

References polyMesh::boundaryMesh(), polyMesh::cellZones(), polyMesh::faceZones(), Foam::identity(), mesh, polyMesh::pointZones(), and PtrList::size().

Here is the call graph for this function:

Member Function Documentation

◆ reorder() [1/2]

void reorder ( const labelList map,
DynamicList< T > &  lst 
)
staticprivate

Reorder contents of container according to map.

Definition at line 32 of file polyTopoChangeTemplates.C.

References forAll.

◆ reorder() [2/2]

void reorder ( const labelList map,
List< DynamicList< T > > &  lst 
)
staticprivate

Definition at line 54 of file polyTopoChangeTemplates.C.

References forAll, and DynamicList::transfer().

Here is the call graph for this function:

◆ renumberKey()

void renumberKey ( const labelList map,
Map< T > &  elems 
)
staticprivate

Definition at line 76 of file polyTopoChangeTemplates.C.

References forAllConstIter().

Here is the call graph for this function:

◆ renumber()

void renumber ( const labelList map,
labelHashSet elems 
)
staticprivate

Renumber elements of container according to map.

Definition at line 79 of file polyTopoChange.C.

References forAllConstIter(), HashSet< Key, Hash >::insert(), HashTable::size(), and HashTable::transfer().

Here is the call graph for this function:

◆ renumberReverseMap()

void renumberReverseMap ( const labelList map,
DynamicList< label > &  elems 
)
staticprivate

Special handling of reverse maps which have <-1 in them.

Definition at line 56 of file polyTopoChange.C.

References forAll.

◆ renumberCompact()

void renumberCompact ( const labelList map,
labelList elems 
)
staticprivate

Renumber & compact elements of list according to map.

Definition at line 102 of file polyTopoChange.C.

References forAll, and List::setSize().

Here is the call graph for this function:

◆ getSetIndices()

Foam::labelHashSet getSetIndices ( const PackedBoolList lst)
staticprivate

Get all set elements as a labelHashSet.

Definition at line 188 of file polyTopoChange.C.

References PackedList::count(), forAll, and HashSet< Key, Hash >::insert().

Here is the call graph for this function:

◆ countMap()

void countMap ( const labelList map,
const labelList reverseMap,
label nAdd,
label nInflate,
label nMerge,
label nRemove 
)
staticprivate

Count number of added and removed quantities from maps.

Definition at line 123 of file polyTopoChange.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and forAll.

Here is the call graph for this function:

◆ writeMeshStats()

void writeMeshStats ( const polyMesh mesh,
Ostream os 
)
staticprivate

Print some stats about mesh.

Definition at line 204 of file polyTopoChange.C.

References Foam::endl(), forAll, mesh, Foam::nl, and patches.

Here is the call graph for this function:

◆ getMergeSets()

void getMergeSets ( const labelList reverseCellMap,
const labelList cellMap,
List< objectMap > &  cellsFromCells 
)
staticprivate

Calculate object maps. Requires reverseMap to have destination.

to be marked with <-1.

Definition at line 226 of file polyTopoChange.C.

References forAll, objectMap::index(), objectMap::masterObjects(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ hasValidPoints()

bool hasValidPoints ( const face f) const
private

Are all face vertices valid.

Definition at line 306 of file polyTopoChange.C.

References f(), forAll, and List::size().

Here is the call graph for this function:

◆ facePoints()

Foam::pointField facePoints ( const face f) const
private

Return face points.

Definition at line 319 of file polyTopoChange.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, forAll, points, and List::size().

Here is the call graph for this function:

◆ checkFace()

void checkFace ( const face f,
const label  faceI,
const label  own,
const label  nei,
const label  patchI,
const label  zoneI 
) const
private

Check inputs to modFace or addFace.

Definition at line 336 of file polyTopoChange.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, Vector< scalar >::max, Foam::nl, and List::size().

Here is the call graph for this function:

◆ makeCells()

void makeCells ( const label  nActiveFaces,
labelList cellFaces,
labelList cellFaceOffsets 
) const
private

Construct cells (in packed storage)

Definition at line 465 of file polyTopoChange.C.

References Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Vector< scalar >::max, List::setSize(), and List::size().

Here is the call graph for this function:

◆ makeCellCells()

void makeCellCells ( const label  nActiveFaces,
CompactListList< label, labelList > &  cellCells 
) const
private

Construct cellCells (in packed storage)

Definition at line 552 of file polyTopoChange.C.

References CompactListList::index(), CompactListList::m(), and CompactListList::setSize().

Here is the call graph for this function:

◆ getCellOrder()

Foam::label getCellOrder ( const CompactListList< label, labelList > &  ,
labelList  
) const
private

Cell ordering (bandCompression). Returns number of remaining cells.

Definition at line 597 of file polyTopoChange.C.

References LList::append(), DynamicList::append(), DynamicList::clear(), forAll, Foam::invert(), Foam::labelMax, LList::removeHead(), List::setSize(), CompactListList::size(), and Foam::sortedOrder().

Here is the call graph for this function:

◆ getFaceOrder()

void getFaceOrder ( const label  nActiveFaces,
const labelList cellFaces,
const labelList cellFaceOffsets,
labelList oldToNew,
labelList patchSizes,
labelList patchStarts 
) const
private

Do upper-triangular ordering and patch ordering.

Definition at line 717 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Vector< scalar >::max, Foam::nl, List::setSize(), List::size(), and Foam::sortedOrder().

Here is the call graph for this function:

◆ reorderCompactFaces()

void reorderCompactFaces ( const label  newSize,
const labelList oldToNew 
)
private

Compact and reorder faces according to map.

Definition at line 883 of file polyTopoChange.C.

References Foam::inplaceReorder(), and Foam::reorder().

Here is the call graph for this function:

◆ compact()

void compact ( const bool  orderCells,
const bool  orderPoints,
label nInternalPoints,
labelList patchSizes,
labelList patchStarts 
)
private

Remove all unused/removed points/faces/cells and update.

face ordering (always), cell ordering (bandcompression, orderCells=true), point ordering (sorted into internal and boundary points, orderPoints=true)

Definition at line 921 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIter(), getFaceOrder(), Foam::Pout, Foam::renumber(), Foam::reorder(), List::setSize(), List::size(), and Foam::Swap().

Here is the call graph for this function:

◆ selectFaces()

Foam::labelList selectFaces ( const primitiveMesh mesh,
const labelList faceLabels,
const bool  internalFacesOnly 
)
staticprivate

Select either internal or external faces out of faceLabels.

Definition at line 1283 of file polyTopoChange.C.

References forAll, primitiveMesh::isInternalFace(), mesh, and List::setSize().

Here is the call graph for this function:

◆ calcPatchPointMap()

void calcPatchPointMap ( const List< Map< label > > &  oldPatchMeshPointMaps,
const polyBoundaryMesh boundary,
labelListList patchPointMap 
) const
private

Calculate mapping for patchpoints only.

Definition at line 1333 of file polyTopoChange.C.

References boundary(), forAll, List::setSize(), and List::size().

Here is the call graph for this function:

◆ calcFaceInflationMaps()

void calcFaceInflationMaps ( const polyMesh mesh,
List< objectMap > &  facesFromPoints,
List< objectMap > &  facesFromEdges,
List< objectMap > &  facesFromFaces 
) const
private

Definition at line 1380 of file polyTopoChange.C.

References primitiveMesh::edgeFaces(), forAllConstIter(), mesh, primitiveMesh::pointFaces(), and List::setSize().

Here is the call graph for this function:

◆ calcCellInflationMaps()

void calcCellInflationMaps ( const polyMesh mesh,
List< objectMap > &  cellsFromPoints,
List< objectMap > &  cellsFromEdges,
List< objectMap > &  cellsFromFaces,
List< objectMap > &  cellsFromCells 
) const
private

◆ resetZones()

void resetZones ( const polyMesh mesh,
polyMesh newMesh,
labelListList pointZoneMap,
labelListList faceZoneFaceMap,
labelListList cellZoneMap 
) const
private

◆ calcFaceZonePointMap()

void calcFaceZonePointMap ( const polyMesh mesh,
const List< Map< label > > &  oldFaceZoneMeshPointMaps,
labelListList faceZonePointMap 
) const
private

Definition at line 1883 of file polyTopoChange.C.

References polyMesh::faceZones(), forAll, mesh, List::setSize(), and List::size().

Here is the call graph for this function:

◆ reorderCoupledFaces()

void reorderCoupledFaces ( const bool  syncParallel,
const polyBoundaryMesh boundary,
const labelList patchStarts,
const labelList patchSizes,
const pointField points 
)
private

Do all coupled patch face reordering.

Definition at line 1934 of file polyTopoChange.C.

References boundary(), PstreamBuffers::finishedSends(), forAll, Foam::identity(), UPstream::nonBlocking, points, Foam::reduce(), and List::size().

Here is the call graph for this function:

◆ compactAndReorder()

void compactAndReorder ( const polyMesh mesh,
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 
)
private

◆ ClassName()

ClassName ( "polyTopoChange"  )

Runtime type information.

◆ points()

const DynamicList<point>& points ( ) const
inline

Points. Shrunk after constructing mesh (or calling of compact())

Definition at line 421 of file polyTopoChange.H.

References polyTopoChange::points_.

Referenced by hexRef8::checkBoundaryOrientation(), hexRef8::checkInternalOrientation(), duplicatePoints::setRefinement(), addPatchCellLayer::setRefinement(), and meshRefinement::splitFacesUndo().

Here is the caller graph for this function:

◆ faces()

const DynamicList<face>& faces ( ) const
inline

Definition at line 426 of file polyTopoChange.H.

References polyTopoChange::faces_.

Referenced by meshRefinement::splitFacesUndo().

Here is the caller graph for this function:

◆ region()

const DynamicList<label>& region ( ) const
inline

Definition at line 431 of file polyTopoChange.H.

References polyTopoChange::region_.

◆ faceOwner()

const DynamicList<label>& faceOwner ( ) const
inline

Definition at line 436 of file polyTopoChange.H.

References polyTopoChange::faceOwner_.

◆ faceNeighbour()

const DynamicList<label>& faceNeighbour ( ) const
inline

Definition at line 441 of file polyTopoChange.H.

References polyTopoChange::faceNeighbour_.

◆ pointRemoved()

bool pointRemoved ( const label  pointI) const
inline

Is point removed?

Definition at line 30 of file polyTopoChangeI.H.

References Vector< scalar >::max, polyTopoChange::points_, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by slidingInterface::coupleInterface(), and slidingInterface::decoupleInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ faceRemoved()

bool faceRemoved ( const label  faceI) const
inline

Is face removed?

Definition at line 41 of file polyTopoChangeI.H.

Referenced by attachDetach::attachInterface(), and slidingInterface::decoupleInterface().

Here is the caller graph for this function:

◆ cellRemoved()

bool cellRemoved ( const label  cellI) const
inline

Is cell removed?

Definition at line 47 of file polyTopoChangeI.H.

◆ clear()

void clear ( )

Clear all storage.

Definition at line 2260 of file polyTopoChange.C.

◆ addMesh()

void addMesh ( const polyMesh mesh,
const labelList patchMap,
const labelList pointZoneMap,
const labelList faceZoneMap,
const labelList cellZoneMap 
)

◆ setCapacity()

void setCapacity ( const label  nPoints,
const label  nFaces,
const label  nCells 
)

Explicitly pre-size the dynamic storage for expected mesh.

size for if construct-without-mesh

Definition at line 2498 of file polyTopoChange.C.

References nPoints.

Referenced by meshRefinement::splitFacesUndo().

Here is the caller graph for this function:

◆ movePoints()

void movePoints ( const pointField newPoints)

Move all points. Incompatible with other topology changes.

Definition at line 2738 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, and forAll.

Here is the call graph for this function:

◆ setAction()

Foam::label setAction ( const topoAction action)

For compatibility with polyTopoChange: set topological action.

Definition at line 2530 of file polyTopoChange.C.

References Foam::abort(), polyRemoveCell::cellID(), polyModifyCell::cellID(), polyRemoveFace::faceID(), polyModifyFace::faceID(), Foam::FatalError, FatalErrorInFunction, polyModifyFace::flipFaceFlux(), polyAddFace::flipFaceFlux(), polyModifyPoint::inCell(), polyAddPoint::inCell(), polyAddCell::masterCellID(), polyAddCell::masterEdgeID(), polyAddFace::masterEdgeID(), polyAddCell::masterFaceID(), polyAddFace::masterFaceID(), polyAddPoint::masterPointID(), polyAddCell::masterPointID(), polyAddFace::masterPointID(), polyRemoveCell::mergeCellID(), polyRemoveFace::mergeFaceID(), polyRemovePoint::mergePointID(), polyModifyFace::neighbour(), polyAddFace::neighbour(), polyModifyFace::newFace(), polyAddFace::newFace(), polyAddPoint::newPoint(), polyModifyPoint::newPoint(), polyModifyFace::owner(), polyAddFace::owner(), polyModifyFace::patchID(), polyAddFace::patchID(), polyRemovePoint::pointID(), polyModifyPoint::pointID(), polyModifyCell::removeFromZone(), polyModifyFace::zoneFlip(), polyAddFace::zoneFlip(), polyModifyCell::zoneID(), polyModifyPoint::zoneID(), polyAddPoint::zoneID(), polyAddCell::zoneID(), polyModifyFace::zoneID(), and polyAddFace::zoneID().

Referenced by layerAdditionRemoval::addCellLayer(), boundaryCutter::addFace(), hexRef8::addFace(), meshCutAndRemove::addFace(), meshCutter::addFace(), hexRef8::addInternalFace(), addPatchCellLayer::addSideFace(), attachDetach::attachInterface(), changePatchID(), slidingInterface::clearCouple(), slidingInterface::coupleInterface(), meshRefinement::createBaffle(), slidingInterface::decoupleInterface(), attachDetach::detachInterface(), faceCollapser::filterFace(), insertDuplicateMerge(), meshRefinement::mergeBaffles(), removeFaces::mergeFaces(), polyMeshAdder::mergePoints(), meshCutAndRemove::modFace(), hexRef8::modFace(), removeFaces::modFace(), meshCutter::modFace(), removePoints::modifyFace(), layerAdditionRemoval::removeCellLayer(), fvMeshDistribute::repatch(), removeCells::setRefinement(), perfectInterface::setRefinement(), faceCollapser::setRefinement(), boundaryCutter::setRefinement(), removePoints::setRefinement(), combineFaces::setRefinement(), removeFaces::setRefinement(), meshCutAndRemove::setRefinement(), meshCutter::setRefinement(), addPatchCellLayer::setRefinement(), hexRef8::setRefinement(), removePoints::setUnrefinement(), combineFaces::setUnrefinement(), and meshRefinement::zonify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPoint()

Foam::label addPoint ( const point pt,
const label  masterPointID,
const label  zoneID,
const bool  inCell 
)

Add point. Return new point label.

Notes:

  • masterPointID can be < 0 (appended points)
  • inCell = false: add retired point (to end of point list)

Definition at line 2659 of file polyTopoChange.C.

Referenced by duplicatePoints::setRefinement(), createShellMesh::setRefinement(), and tetDecomposer::setRefinement().

Here is the caller graph for this function:

◆ modifyPoint()

void modifyPoint ( const label  pointI,
const point pt,
const label  newZoneID,
const bool  inCell 
)

Modify coordinate.

Notes:

  • inCell = false: add retired point (to end of point list)

Definition at line 2687 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by edgeCollapser::setRefinement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removePoint()

void removePoint ( const label  pointI,
const label  mergePointI 
)

Remove/merge point.

Definition at line 2757 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Vector< scalar >::max, and Foam::nl.

Referenced by polyMeshAdder::mergePoints(), and edgeCollapser::setRefinement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFace()

Foam::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.

own,nei<0, zoneID>=0 : add inactive face (to end of face list)

Definition at line 2805 of file polyTopoChange.C.

References f().

Referenced by tetDecomposer::addFace(), meshRefinement::doSplitFaces(), and createShellMesh::setRefinement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ modifyFace()

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.

Definition at line 2869 of file polyTopoChange.C.

References f().

Referenced by meshRefinement::doSplitFaces(), main(), tetDecomposer::modifyFace(), duplicatePoints::setRefinement(), edgeCollapser::setRefinement(), and meshRefinement::splitFacesUndo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeFace()

void removeFace ( const label  faceI,
const label  mergeFaceI 
)

Remove/merge face.

Definition at line 2914 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by edgeCollapser::setRefinement(), and meshRefinement::splitFacesUndo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCell()

Foam::label addCell ( const label  masterPointID,
const label  masterEdgeID,
const label  masterFaceID,
const label  masterCellID,
const label  zoneID 
)

Add cell. Return new cell label.

Definition at line 2958 of file polyTopoChange.C.

Referenced by createShellMesh::setRefinement(), and tetDecomposer::setRefinement().

Here is the caller graph for this function:

◆ modifyCell()

void modifyCell ( const label  cellI,
const label  zoneID 
)

Modify zone of cell.

Definition at line 2995 of file polyTopoChange.C.

◆ removeCell()

void removeCell ( const label  cellI,
const label  mergeCellI 
)

Remove/merge cell.

Definition at line 3004 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by edgeCollapser::setRefinement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNumPatches()

void setNumPatches ( const label  nPatches)
inline

Explicitly set the number of patches if construct-without-mesh.

used.

Definition at line 53 of file polyTopoChangeI.H.

References nPatches.

◆ changeMesh()

Foam::autoPtr< Foam::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.

Adapts patch start/end and by default does parallel matching. Clears all data. Returns map. inflate = true : keep old mesh points. Put new points into the returned map (preMotionPoints) so we can use inflation. Any points out of nothing (appended points) are vector::zero. inflate = false: set mesh points directly. Empty preMotionPoints in the map. orderCells : whether to order the cells (see bandCompression.H) orderPoints : whether to order the points into internal first followed by boundary points. This is not fully consistent with upper-triangular ordering of points and edges so is only done when explicitly asked for.

Definition at line 3039 of file polyTopoChange.C.

References polyMesh::boundaryMesh(), primitiveMesh::cellVolumes(), polyMesh::cellZones(), Foam::endl(), polyMesh::faceZones(), forAll, mesh, primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), polyMesh::pointZones(), Foam::Pout, polyMesh::resetPrimitives(), PtrList::size(), polyMesh::topoChanging(), Foam::xferMove(), and Vector< scalar >::zero.

Referenced by autoLayerDriver::addLayers(), meshRefinement::createBaffles(), fvMeshDistribute::doRemoveCells(), meshRefinement::doRemoveCells(), meshRefinement::doRemovePoints(), meshRefinement::doRestorePoints(), meshRefinement::dupNonManifoldPoints(), extrudePatchMesh::extrudeMesh(), polyMeshFilter::filterEdges(), polyMeshFilter::filterFaces(), main(), meshRefinement::mergeBaffles(), meshRefinement::mergePatchFaces(), meshRefinement::mergePatchFacesUndo(), meshRefinement::mergePoints(), fvMeshDistribute::mergeSharedPoints(), mergeSharedPoints(), dynamicRefineFvMesh::refine(), meshRefinement::refine(), multiDirRefinement::refineHex8(), fvMeshDistribute::repatch(), refinementIterator::setRefinement(), meshRefinement::splitFacesUndo(), dynamicRefineFvMesh::unrefine(), and meshRefinement::zonify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeMesh()

Foam::autoPtr< Foam::mapPolyMesh > makeMesh ( autoPtr< fvMesh > &  newMesh,
const IOobject io,
const polyMesh mesh,
const bool  syncParallel = true,
const bool  orderCells = false,
const bool  orderPoints = false 
)

Field Documentation

◆ strict_

bool strict_
private

Whether to allow referencing illegal points/cells/faces.

when adding/removing data.

Definition at line 103 of file polyTopoChange.H.

◆ nPatches_

label nPatches_
private

Number of patches.

Definition at line 109 of file polyTopoChange.H.

◆ points_

DynamicList<point> points_
private

Current point set.

Definition at line 115 of file polyTopoChange.H.

Referenced by polyTopoChange::pointRemoved(), and polyTopoChange::points().

◆ pointMap_

DynamicList<label> pointMap_
private

Original point label (or masterpoint for added points)

Definition at line 118 of file polyTopoChange.H.

◆ reversePointMap_

DynamicList<label> reversePointMap_
private

For all original and added points contains new point label.

(used to map return value of addPoint to new mesh point)

Definition at line 122 of file polyTopoChange.H.

◆ pointZone_

Map<label> pointZone_
private

Zone of point.

Definition at line 125 of file polyTopoChange.H.

◆ retiredPoints_

labelHashSet retiredPoints_
private

Retired points.

Definition at line 128 of file polyTopoChange.H.

◆ faces_

DynamicList<face> faces_
private

Current faceList.

Definition at line 134 of file polyTopoChange.H.

Referenced by polyTopoChange::faces().

◆ region_

DynamicList<label> region_
private

Patch for every external face (-1 for internal faces)

Definition at line 137 of file polyTopoChange.H.

Referenced by polyTopoChange::region().

◆ faceOwner_

DynamicList<label> faceOwner_
private

Owner for all faces.

Definition at line 140 of file polyTopoChange.H.

Referenced by polyTopoChange::faceOwner().

◆ faceNeighbour_

DynamicList<label> faceNeighbour_
private

Neighbour for internal faces (-1 for external faces)

Definition at line 143 of file polyTopoChange.H.

Referenced by polyTopoChange::faceNeighbour().

◆ faceMap_

DynamicList<label> faceMap_
private

Original face label. Or master face for added-from-faces;.

-1 for faces added-from-edge or added-from-point)

Definition at line 147 of file polyTopoChange.H.

◆ reverseFaceMap_

DynamicList<label> reverseFaceMap_
private

For all original and added faces contains new face label.

(used to map return value of addFace to new mesh face)

Definition at line 151 of file polyTopoChange.H.

◆ faceFromPoint_

Map<label> faceFromPoint_
private

Faces added from point (corresponding faceMap_ will.

be -1)

Definition at line 155 of file polyTopoChange.H.

◆ faceFromEdge_

Map<label> faceFromEdge_
private

Faces added from edge (corresponding faceMap_ will.

be -1)

Definition at line 159 of file polyTopoChange.H.

◆ flipFaceFlux_

PackedBoolList flipFaceFlux_
private

In mapping whether to reverse the flux.

Definition at line 162 of file polyTopoChange.H.

◆ faceZone_

Map<label> faceZone_
private

Zone of face.

Definition at line 165 of file polyTopoChange.H.

◆ faceZoneFlip_

PackedBoolList faceZoneFlip_
private

Orientation of face in zone.

Definition at line 168 of file polyTopoChange.H.

◆ nActiveFaces_

label nActiveFaces_
private

Active faces.

Definition at line 171 of file polyTopoChange.H.

◆ cellMap_

DynamicList<label> cellMap_
private

Original cell label or master cell for added-from-cell;.

-1 for cells added from face or edge.

Definition at line 178 of file polyTopoChange.H.

◆ reverseCellMap_

DynamicList<label> reverseCellMap_
private

For all original and added cells contains new cell label.

(used to map return value of addCell to new mesh cell)

Definition at line 182 of file polyTopoChange.H.

◆ cellFromPoint_

Map<label> cellFromPoint_
private

Cells added from point.

Definition at line 185 of file polyTopoChange.H.

◆ cellFromEdge_

Map<label> cellFromEdge_
private

Cells added from edge.

Definition at line 188 of file polyTopoChange.H.

◆ cellFromFace_

Map<label> cellFromFace_
private

Cells added from face.

Definition at line 191 of file polyTopoChange.H.

◆ cellZone_

DynamicList<label> cellZone_
private

Zone of cell.

Definition at line 194 of file polyTopoChange.H.


The documentation for this class was generated from the following files: