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... | |
label | addPoint (const point &newPosition, const point &oldPosition, const label masterPointID, const label zoneID) |
Add point with original position. Return new point label. More... | |
void | modifyPoint (const label pointi, const point &newPosition, const point &oldPosition, const label newZoneID) |
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< polyTopoChangeMap > | 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. More... | |
autoPtr< polyTopoChangeMap > | 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. More... | |
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 97 of file polyTopoChange.H.
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 2147 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 2178 of file polyTopoChange.C.
References polyTopoChange::addMesh(), polyMesh::boundaryMesh(), polyMesh::cellZones(), polyMesh::faceZones(), Foam::identityMap(), polyMesh::pointZones(), and UPtrList< T >::size().
ClassName | ( | "polyTopoChange" | ) |
Runtime type information.
|
inline |
Points. Shrunk after constructing mesh (or calling of compact())
Definition at line 438 of file polyTopoChange.H.
Referenced by addPatchCellLayer::setRefinement(), and duplicatePoints::setRefinement().
|
inline |
Definition at line 443 of file polyTopoChange.H.
|
inline |
Definition at line 448 of file polyTopoChange.H.
|
inline |
Definition at line 453 of file polyTopoChange.H.
|
inline |
Definition at line 458 of file polyTopoChange.H.
|
inline |
Is point removed?
Definition at line 30 of file polyTopoChangeI.H.
References VectorSpace< Form, Cmpt, Ncmpts >::max, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
inline |
Is face removed?
Definition at line 41 of file polyTopoChangeI.H.
|
inline |
Is cell removed?
Definition at line 47 of file polyTopoChangeI.H.
void clear | ( | ) |
Clear all storage.
Definition at line 2224 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 2255 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, FatalErrorInFunction, forAll, Foam::max(), IOobject::name(), patchIdentifier::name(), primitiveMesh::nCells(), primitiveMesh::nInternalFaces(), primitiveMesh::nPoints(), patches, patchi, pointLabels(), points, polyMesh::points(), polyMesh::pointZones(), PtrList< T >::resize(), List< T >::size(), polyPatch::start(), and WarningInFunction.
Referenced by polyTopoChange::polyTopoChange().
Explicitly pre-size the dynamic storage for expected mesh.
size for if construct-without-mesh
Definition at line 2463 of file polyTopoChange.C.
References nPoints.
void movePoints | ( | const pointField & | newPoints | ) |
Move all points. Incompatible with other topology changes.
Definition at line 2780 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, and List< T >::size().
Foam::label setAction | ( | const topoAction & | action | ) |
For compatibility with polyTopoChange: set topological action.
Definition at line 2496 of file polyTopoChange.C.
References Foam::abort(), polyModifyCell::cellID(), polyRemoveCell::cellID(), polyModifyFace::faceID(), polyRemoveFace::faceID(), Foam::FatalError, FatalErrorInFunction, polyAddFace::flipFaceFlux(), polyModifyFace::flipFaceFlux(), polyAddPoint::inCell(), polyModifyPoint::inCell(), polyAddCell::masterCellID(), polyAddCell::masterEdgeID(), polyAddFace::masterEdgeID(), polyAddCell::masterFaceID(), polyAddFace::masterFaceID(), polyAddCell::masterPointID(), polyAddFace::masterPointID(), polyAddPoint::masterPointID(), polyRemoveCell::mergeCellID(), polyRemoveFace::mergeFaceID(), polyRemovePoint::mergePointID(), polyAddFace::neighbour(), polyModifyFace::neighbour(), polyAddFace::newFace(), polyModifyFace::newFace(), polyAddPoint::newPoint(), polyModifyPoint::newPoint(), polyAddFace::owner(), polyModifyFace::owner(), polyAddFace::patchID(), polyModifyFace::patchID(), polyModifyPoint::pointID(), polyRemovePoint::pointID(), polyModifyCell::removeFromZone(), polyAddFace::zoneFlip(), polyModifyFace::zoneFlip(), polyAddCell::zoneID(), polyAddFace::zoneID(), polyAddPoint::zoneID(), polyModifyCell::zoneID(), polyModifyFace::zoneID(), and polyModifyPoint::zoneID().
Referenced by meshRefinement::mergeBaffles(), removePoints::setRefinement(), meshCutter::setRefinement(), addPatchCellLayer::setRefinement(), meshCutAndRemove::setRefinement(), hexRef8::setRefinement(), removeCells::setRefinement(), faceCollapser::setRefinement(), combineFaces::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 2624 of file polyTopoChange.C.
Referenced by tetDecomposer::setRefinement(), duplicatePoints::setRefinement(), and createShellMesh::setRefinement().
Modify coordinate.
Notes:
Definition at line 2652 of file polyTopoChange.C.
References Foam::abort(), HashTableCore::end(), Foam::endl(), HashTable< T, Key, Hash >::erase(), Foam::FatalError, FatalErrorInFunction, and HashTable< T, Key, Hash >::find().
Referenced by edgeCollapser::setRefinement().
Foam::label addPoint | ( | const point & | newPosition, |
const point & | oldPosition, | ||
const label | masterPointID, | ||
const label | zoneID | ||
) |
Add point with original position. Return new point label.
Notes:
Definition at line 2706 of file polyTopoChange.C.
void modifyPoint | ( | const label | pointi, |
const point & | newPosition, | ||
const point & | oldPosition, | ||
const label | newZoneID | ||
) |
Modify coordinate.
Notes:
Definition at line 2731 of file polyTopoChange.C.
References Foam::abort(), HashTableCore::end(), Foam::endl(), HashTable< T, Key, Hash >::erase(), Foam::FatalError, FatalErrorInFunction, and HashTable< T, Key, Hash >::find().
Remove/merge point.
Definition at line 2798 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, VectorSpace< Form, Cmpt, Ncmpts >::max, and Foam::nl.
Referenced by 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 2847 of file polyTopoChange.C.
References f().
Referenced by createShellMesh::setRefinement(), and meshRefinement::splitFaces().
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 2911 of file polyTopoChange.C.
References HashTableCore::end(), HashTable< T, Key, Hash >::erase(), f(), and HashTable< T, Key, Hash >::find().
Referenced by Foam::polyMeshUnMergeCyclics(), edgeCollapser::setRefinement(), duplicatePoints::setRefinement(), and meshRefinement::splitFaces().
Remove/merge face.
Definition at line 2957 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.
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 3000 of file polyTopoChange.C.
Referenced by tetDecomposer::setRefinement(), and createShellMesh::setRefinement().
Modify zone of cell.
Definition at line 3037 of file polyTopoChange.C.
Remove/merge cell.
Definition at line 3047 of file polyTopoChange.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.
Referenced by edgeCollapser::setRefinement().
|
inline |
Explicitly set the number of patches if construct-without-mesh.
used.
Definition at line 53 of file polyTopoChangeI.H.
References nPatches.
Foam::autoPtr< Foam::polyTopoChangeMap > 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 3081 of file polyTopoChange.C.
References polyMesh::boundaryMesh(), primitiveMesh::cellVolumes(), polyMesh::cellZones(), Foam::endl(), polyMesh::faceZones(), forAll, primitiveMesh::nCells(), newPointi, primitiveMesh::nFaces(), Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), polyMesh::pointZones(), Foam::Pout, polyMesh::resetPrimitives(), UPtrList< T >::size(), List< T >::size(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.
Referenced by snappyLayerDriver::addLayers(), meshRefinement::createBaffles(), meshRefinement::doRemovePoints(), meshRefinement::doRestorePoints(), meshRefinement::dupNonManifoldPoints(), meshRefinement::mergeBaffles(), meshRefinement::mergePatchFacesUndo(), Foam::polyMeshUnMergeCyclics(), meshRefinement::refine(), refinementIterator::setRefinement(), meshRefinement::splitFaces(), and meshRefinement::zonify().
Foam::autoPtr< Foam::polyTopoChangeMap > 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.
Definition at line 3352 of file polyTopoChange.C.
References fvMesh::addFvPatches(), polyMesh::addZones(), polyMesh::boundaryMesh(), primitiveMesh::cellVolumes(), polyMesh::cellZones(), IOobject::clone(), Foam::endl(), polyMesh::faceZones(), forAll, Foam::name(), primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, IOobject::NO_READ, primitiveMesh::nPoints(), patchi, polyMesh::pointZones(), Foam::Pout, IOobject::readOpt(), autoPtr< T >::reset(), and UPtrList< T >::size().
Referenced by snappyLayerDriver::addLayers(), polyMeshFilter::copyMesh(), and fvMeshSubset::setLargeCellSubset().