Public Member Functions | List of all members
polyTopoChange Class Reference

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

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

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 ( 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 2207 of file polyTopoChange.C.

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

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

Definition at line 2239 of file polyTopoChange.C.

References polyTopoChange::addMesh(), polyMesh::boundaryMesh(), polyMesh::cellZones(), polyMesh::faceZones(), Foam::identity(), polyMesh::pointZones(), and PtrList< T >::size().

Here is the call graph for this function:

Member Function Documentation

ClassName ( "polyTopoChange"  )

Runtime type information.

const DynamicList<point>& points ( ) const
inline

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

Definition at line 421 of file polyTopoChange.H.

Referenced by hexRef8::getAnchorLevel(), duplicatePoints::setRefinement(), and addPatchCellLayer::setRefinement().

Here is the caller graph for this function:

const DynamicList<face>& faces ( ) const
inline

Definition at line 426 of file polyTopoChange.H.

Referenced by polyTopoChange::addMesh().

Here is the caller graph for this function:

const DynamicList<label>& region ( ) const
inline

Definition at line 431 of file polyTopoChange.H.

const DynamicList<label>& faceOwner ( ) const
inline

Definition at line 436 of file polyTopoChange.H.

Referenced by polyTopoChange::addMesh().

Here is the caller graph for this function:

const DynamicList<label>& faceNeighbour ( ) const
inline
bool pointRemoved ( const label  pointI) const
inline

Is point removed?

Definition at line 30 of file polyTopoChangeI.H.

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

Referenced by polyTopoChange::faceNeighbour(), polyTopoChange::modifyPoint(), and polyTopoChange::removePoint().

Here is the call graph for this function:

Here is the caller graph for this function:

bool faceRemoved ( const label  faceI) const
inline

Is face removed?

Definition at line 41 of file polyTopoChangeI.H.

Referenced by polyTopoChange::faceNeighbour(), and polyTopoChange::removeFace().

Here is the caller graph for this function:

bool cellRemoved ( const label  cellI) const
inline

Is cell removed?

Definition at line 47 of file polyTopoChangeI.H.

Referenced by polyTopoChange::faceNeighbour().

Here is the caller graph for this function:

void clear ( )

Clear all storage.

Definition at line 2283 of file polyTopoChange.C.

References polyTopoChange::addMesh(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clearStorage(), HashTable< T, Key, Hash >::clearStorage(), and PackedList< nBits >::clearStorage().

Referenced by polyTopoChange::faceNeighbour().

Here is the call graph for this function:

Here is the caller graph for this function:

void addMesh ( const polyMesh mesh,
const labelList patchMap,
const labelList pointZoneMap,
const labelList faceZoneMap,
const labelList cellZoneMap 
)
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 2529 of file polyTopoChange.C.

References HashTable< T, Key, Hash >::resize(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::setCapacity(), PackedList< nBits >::setCapacity(), and HashTable< T, Key, Hash >::size().

Referenced by polyTopoChange::addMesh(), and polyTopoChange::faceNeighbour().

Here is the call graph for this function:

Here is the caller graph for this function:

void movePoints ( const pointField newPoints)

Move all points. Incompatible with other topology changes.

Definition at line 2775 of file polyTopoChange.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, polyTopoChange::removePoint(), and List< T >::size().

Referenced by polyTopoChange::faceNeighbour().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::label setAction ( const topoAction action)

For compatibility with polyTopoChange: set topological action.

Definition at line 2561 of file polyTopoChange.C.

References Foam::abort(), polyTopoChange::addCell(), polyTopoChange::addFace(), polyTopoChange::addPoint(), polyRemoveCell::cellID(), polyModifyCell::cellID(), polyRemoveFace::faceID(), polyModifyFace::faceID(), Foam::FatalError, FatalErrorIn, 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(), polyTopoChange::modifyCell(), polyTopoChange::modifyFace(), polyTopoChange::modifyPoint(), polyModifyFace::neighbour(), polyAddFace::neighbour(), polyModifyFace::newFace(), polyAddFace::newFace(), polyModifyPoint::newPoint(), polyAddPoint::newPoint(), polyModifyFace::owner(), polyAddFace::owner(), polyModifyFace::patchID(), polyAddFace::patchID(), polyRemovePoint::pointID(), polyModifyPoint::pointID(), polyTopoChange::removeCell(), polyTopoChange::removeFace(), polyModifyCell::removeFromZone(), polyTopoChange::removePoint(), polyModifyFace::zoneFlip(), polyAddFace::zoneFlip(), polyModifyCell::zoneID(), polyModifyPoint::zoneID(), polyAddPoint::zoneID(), polyAddCell::zoneID(), polyModifyFace::zoneID(), and polyAddFace::zoneID().

Referenced by repatchPolyTopoChanger::changeAnchorPoint(), repatchPolyTopoChanger::changePatchID(), polyTopoChange::faceNeighbour(), meshRefinement::mergeBaffles(), polyMeshAdder::mergePoints(), faceEqOp< T, CombineOp >::operator()(), ifEqEqOp< value >::operator()(), fvMeshDistribute::printCoupleInfo(), repatchPolyTopoChanger::setFaceZone(), removeCells::setRefinement(), perfectInterface::setRefinement(), faceCollapser::setRefinement(), removePoints::setRefinement(), boundaryCutter::setRefinement(), combineFaces::setRefinement(), removeFaces::setRefinement(), meshCutAndRemove::setRefinement(), meshCutter::setRefinement(), addPatchCellLayer::setRefinement(), hexRef8::setRefinement(), removePoints::setUnrefinement(), combineFaces::setUnrefinement(), and meshRefinement::zonify().

Here is the caller graph for this function:

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 2692 of file polyTopoChange.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), HashSet< Key, Hash >::insert(), HashTable< T, Key, Hash >::insert(), and polyTopoChange::modifyPoint().

Referenced by polyTopoChange::addMesh(), polyTopoChange::faceNeighbour(), polyTopoChange::setAction(), duplicatePoints::setRefinement(), createShellMesh::setRefinement(), and tetDecomposer::setRefinement().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2720 of file polyTopoChange.C.

References Foam::abort(), HashTableCore::end(), Foam::endl(), HashTable< T, Key, Hash >::erase(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), HashSet< Key, Hash >::insert(), HashTable< T, Key, Hash >::insert(), and polyTopoChange::pointRemoved().

Referenced by polyTopoChange::addPoint(), polyTopoChange::faceNeighbour(), polyTopoChange::setAction(), and edgeCollapser::setRefinement().

Here is the call graph for this function:

Here is the caller graph for this function:

void removePoint ( const label  pointI,
const label  mergePointI 
)
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 2842 of file polyTopoChange.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), HashTable< T, Key, Hash >::insert(), and polyTopoChange::modifyFace().

Referenced by polyTopoChange::addMesh(), polyTopoChange::faceNeighbour(), NamedEnum< Enum, nEnum >::names(), polyTopoChange::removePoint(), polyTopoChange::setAction(), createShellMesh::setRefinement(), and meshRefinement::splitFaces().

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)
void removeFace ( const label  faceI,
const label  mergeFaceI 
)

Remove/merge face.

Definition at line 2951 of file polyTopoChange.C.

References Foam::abort(), polyTopoChange::addCell(), Foam::endl(), HashTable< T, Key, Hash >::erase(), polyTopoChange::faceRemoved(), Foam::FatalError, and FatalErrorIn.

Referenced by polyTopoChange::faceNeighbour(), polyTopoChange::setAction(), and edgeCollapser::setRefinement().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Modify zone of cell.

Definition at line 3032 of file polyTopoChange.C.

Referenced by polyTopoChange::addCell(), polyTopoChange::faceNeighbour(), and polyTopoChange::setAction().

Here is the caller graph for this function:

void removeCell ( const label  cellI,
const label  mergeCellI 
)

Remove/merge cell.

Definition at line 3041 of file polyTopoChange.C.

References Foam::abort(), polyTopoChange::changeMesh(), Foam::endl(), HashTable< T, Key, Hash >::erase(), Foam::FatalError, FatalErrorIn, and List< T >::size().

Referenced by polyTopoChange::faceNeighbour(), polyTopoChange::setAction(), and edgeCollapser::setRefinement().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Referenced by polyTopoChange::faceNeighbour().

Here is the caller graph for this function:

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 3076 of file polyTopoChange.C.

References polyMesh::boundaryMesh(), primitiveMesh::cellVolumes(), polyMesh::cellZones(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clearStorage(), HashTable< T, Key, Hash >::clearStorage(), PackedList< nBits >::clearStorage(), Foam::endl(), polyMesh::faceZones(), forAll, polyTopoChange::makeMesh(), primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), polyMesh::pointZones(), Foam::Pout, polyMesh::resetPrimitives(), List< T >::size(), PtrList< T >::size(), polyMesh::topoChanging(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::xfer(), Foam::xferMove(), and Vector< Cmpt >::zero.

Referenced by polyMeshFilter::copyMesh(), meshRefinement::createBaffles(), meshRefinement::doRemovePoints(), meshRefinement::doRestorePoints(), meshRefinement::dupNonManifoldPoints(), polyTopoChange::faceNeighbour(), meshRefinement::mergeBaffles(), meshRefinement::mergePatchFacesUndo(), fvMeshDistribute::printCoupleInfo(), dynamicRefineFvMesh::refine(), meshRefinement::refine(), polyTopoChange::removeCell(), repatchPolyTopoChanger::repatch(), meshRefinement::setInstance(), refinementIterator::setRefinement(), meshRefinement::splitFaces(), dynamicRefineFvMesh::unrefine(), and meshRefinement::zonify().

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

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