Direct mesh changes based on v1.3 polyTopoChange syntax. More...
#include <dynamicMesh/polyTopoChange.H>
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:
Definition at line 102 of file polyTopoChange.H.
Public Member Functions | |
ClassName ("polyTopoChange") | |
Runtime type information.
| |
polyTopoChange (const label nPatches, const bool strict=true) | |
Construct without mesh. Either specify nPatches or use.
| |
polyTopoChange (const polyMesh &mesh, const bool strict=true) | |
Construct from mesh. Adds all points/face/cells from mesh.
| |
const DynamicList< point > & | points () const |
Points. Shrunk after constructing mesh (or calling of compact())
| |
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?
| |
bool | faceRemoved (const label faceI) const |
Is face removed?
| |
bool | cellRemoved (const label cellI) const |
Is cell removed?
| |
void | clear () |
Clear all storage.
| |
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.
| |
void | setCapacity (const label nPoints, const label nFaces, const label nCells) |
Explicitly pre-size the dynamic storage for expected mesh.
| |
void | movePoints (const pointField &newPoints) |
Move all points. Incompatible with other topology changes.
| |
label | setAction (const topoAction &action) |
For compatibility with polyTopoChange: set topological action.
| |
label | addPoint (const point &, const label masterPointID, const label zoneID, const bool inCell) |
Add point. Return new point label.
| |
void | modifyPoint (const label, const point &, const label newZoneID, const bool inCell) |
Modify coordinate.
| |
void | removePoint (const label, const label) |
Remove/merge point.
| |
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.
| |
void | removeFace (const label, const label) |
Remove/merge face.
| |
label | addCell (const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID) |
Add cell. Return new cell label.
| |
void | modifyCell (const label, const label zoneID) |
Modify zone of cell.
| |
void | removeCell (const label, const label) |
Remove/merge cell.
| |
void | setNumPatches (const label nPatches) |
Explicitly set the number of patches if construct-without-mesh.
| |
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.
| |
autoPtr< mapPolyMesh > | makeMesh (autoPtr< fvMesh > &newMesh, const IOobject &io, const fvMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false) |
Create new mesh with old mesh patches.
|
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 2100 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 2132 of file polyTopoChange.C.
References polyMesh::boundaryMesh(), polyMesh::cellZones(), polyMesh::faceZones(), Foam::identity(), polyMesh::pointZones(), and PtrList< T >::size().
ClassName | ( | "polyTopoChange" | ) |
Runtime type information.
const DynamicList<point>& points | ( | ) | const [inline]
|
Points. Shrunk after constructing mesh (or calling of compact())
Definition at line 425 of file polyTopoChange.H.
Referenced by duplicatePoints::setRefinement().
const DynamicList<face>& faces | ( | ) | const [inline]
|
Definition at line 430 of file polyTopoChange.H.
const DynamicList<label>& region | ( | ) | const [inline]
|
Definition at line 435 of file polyTopoChange.H.
const DynamicList<label>& faceOwner | ( | ) | const [inline]
|
Definition at line 440 of file polyTopoChange.H.
const DynamicList<label>& faceNeighbour | ( | ) | const [inline]
|
Definition at line 445 of file polyTopoChange.H.
bool pointRemoved | ( | const label | pointI ) | const [inline]
|
Is point removed?
Definition at line 29 of file polyTopoChangeI.H.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
bool faceRemoved | ( | const label | faceI ) | const [inline]
|
Is face removed?
Definition at line 40 of file polyTopoChangeI.H.
bool cellRemoved | ( | const label | cellI ) | const [inline]
|
Is cell removed?
Definition at line 46 of file polyTopoChangeI.H.
void clear | ( | ) |
Clear all storage.
Definition at line 2176 of file polyTopoChange.C.
void addMesh | ( | const polyMesh & | mesh, |
const labelList & | patchMap, | ||
const labelList & | pointZoneMap, | ||
const labelList & | faceZoneMap, | ||
const labelList & | cellZoneMap | ||
) |
Add all points/faces/cells of mesh. Additional offset for patch.
or zone ids.
Definition at line 2207 of file polyTopoChange.C.
References Foam::abort(), polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), polyMesh::cellZones(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), polyMesh::faceZones(), Foam::FatalError, FatalErrorIn, forAll, Foam::max(), patchIdentifier::name(), IOobject::name(), primitiveMesh::nCells(), primitiveMesh::nInternalFaces(), primitiveMesh::nPoints(), pointLabels(), polyMesh::points(), polyMesh::pointZones(), List< T >::size(), polyPatch::start(), and WarningIn.
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 2422 of file polyTopoChange.C.
void movePoints | ( | const pointField & | newPoints ) |
Move all points. Incompatible with other topology changes.
Definition at line 2647 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, and List< T >::size().
Foam::label setAction | ( | const topoAction & | action ) |
For compatibility with polyTopoChange: set topological action.
Definition at line 2454 of file polyTopoChange.C.
References Foam::abort(), 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(), polyAddCell::masterPointID(), polyAddFace::masterPointID(), polyAddPoint::masterPointID(), polyRemoveCell::mergeCellID(), polyRemoveFace::mergeFaceID(), polyRemovePoint::mergePointID(), polyModifyFace::neighbour(), polyAddFace::neighbour(), polyModifyFace::newFace(), polyAddFace::newFace(), polyModifyPoint::newPoint(), polyAddPoint::newPoint(), polyModifyFace::owner(), polyAddFace::owner(), polyModifyFace::patchID(), polyAddFace::patchID(), polyRemovePoint::pointID(), polyModifyPoint::pointID(), polyModifyCell::removeFromZone(), polyModifyFace::zoneFlip(), polyAddFace::zoneFlip(), polyModifyCell::zoneID(), polyAddCell::zoneID(), polyModifyFace::zoneID(), polyAddFace::zoneID(), polyModifyPoint::zoneID(), and polyAddPoint::zoneID().
Referenced by meshRefinement::mergeBaffles(), polyMeshAdder::mergePoints(), removePoints::setRefinement(), removeFaces::setRefinement(), removeCells::setRefinement(), hexRef8::setRefinement(), faceCollapser::setRefinement(), combineFaces::setRefinement(), addPatchCellLayer::setRefinement(), perfectInterface::setRefinement(), meshCutter::setRefinement(), meshCutAndRemove::setRefinement(), boundaryCutter::setRefinement(), removePoints::setUnrefinement(), combineFaces::setUnrefinement(), and meshRefinement::zonify().
Foam::label addPoint | ( | const point & | pt, |
const label | masterPointID, | ||
const label | zoneID, | ||
const bool | inCell | ||
) |
Add point. Return new point label.
Notes:
Definition at line 2585 of file polyTopoChange.C.
Referenced by duplicatePoints::setRefinement().
void modifyPoint | ( | const label | pointI, |
const point & | pt, | ||
const label | newZoneID, | ||
const bool | inCell | ||
) |
Modify coordinate.
Notes:
Definition at line 2609 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorIn.
void removePoint | ( | const label | pointI, |
const label | mergePointI | ||
) |
Remove/merge point.
Definition at line 2666 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, and Foam::nl.
Referenced by polyMeshAdder::mergePoints(), and edgeCollapser::setRefinement().
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 2714 of file polyTopoChange.C.
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 2774 of file polyTopoChange.C.
References f().
Referenced by edgeCollapser::setRefinement(), and duplicatePoints::setRefinement().
void removeFace | ( | const label | faceI, |
const label | mergeFaceI | ||
) |
Remove/merge face.
Definition at line 2802 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorIn.
Referenced by edgeCollapser::setRefinement().
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 2846 of file polyTopoChange.C.
void modifyCell | ( | const label | cellI, |
const label | zoneID | ||
) |
Modify zone of cell.
Definition at line 2883 of file polyTopoChange.C.
void removeCell | ( | const label | cellI, |
const label | mergeCellI | ||
) |
Remove/merge cell.
Definition at line 2892 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorIn.
Referenced by edgeCollapser::setRefinement().
void setNumPatches | ( | const label | nPatches ) | [inline]
|
Explicitly set the number of patches if construct-without-mesh.
used.
Definition at line 52 of file polyTopoChangeI.H.
References nPatches.
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 2927 of file polyTopoChange.C.
References polyMesh::boundaryMesh(), polyMesh::cellZones(), polyMesh::changing(), Foam::endl(), polyMesh::faceZones(), forAll, primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), polyMesh::pointZones(), Foam::Pout, polyMesh::resetPrimitives(), PtrList< T >::size(), List< T >::size(), Foam::xferMove(), and Vector< Cmpt >::zero.
Referenced by meshRefinement::createBaffles(), meshRefinement::dupNonManifoldPoints(), meshRefinement::mergeBaffles(), meshRefinement::mergeEdges(), meshRefinement::mergePatchFaces(), dynamicRefineFvMesh::refine(), meshRefinement::refine(), refinementIterator::setRefinement(), dynamicRefineFvMesh::unrefine(), and meshRefinement::zonify().
Foam::autoPtr< Foam::mapPolyMesh > makeMesh | ( | autoPtr< fvMesh > & | newMesh, |
const IOobject & | io, | ||
const fvMesh & | mesh, | ||
const bool | syncParallel = true ,
|
||
const bool | orderCells = false ,
|
||
const bool | orderPoints = false
|
||
) |
Create new mesh with old mesh patches.
Definition at line 3187 of file polyTopoChange.C.
References fvMesh::addFvPatches(), polyMesh::addZones(), polyMesh::boundaryMesh(), polyMesh::cellZones(), IOobject::clone(), Foam::endl(), polyMesh::faceZones(), forAll, Foam::name(), primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, primitiveMesh::nPoints(), polyMesh::pointZones(), Foam::Pout, autoPtr< T >::reset(), PtrList< T >::size(), and Foam::xferMove().
Referenced by autoLayerDriver::addLayers().