Cuts (splits) cells. More...
Public Member Functions | |
ClassName ("meshCutter") | |
Runtime type information. More... | |
meshCutter (const polyMesh &mesh) | |
Construct from mesh. More... | |
~meshCutter () | |
Destructor. More... | |
void | setRefinement (const cellCuts &cuts, polyTopoChange &meshMod) |
Do actual cutting with cut description. Inserts mesh changes. More... | |
void | updateMesh (const mapPolyMesh &) |
Force recalculation of locally stored data on topological change. More... | |
const Map< label > & | addedCells () const |
Cells added. Per split cell label of added cell. More... | |
const Map< label > & | addedFaces () const |
Faces added. Per split cell label of added face. More... | |
const HashTable< label, edge, Hash< edge > > & | addedPoints () const |
Points added. Per split edge label of added point. More... | |
![]() | |
edgeVertex (const polyMesh &mesh) | |
Construct from mesh. More... | |
const polyMesh & | mesh () const |
bool | isEdge (const label eVert) const |
label | getEdge (const label eVert) const |
label | getVertex (const label eVert) const |
label | vertToEVert (const label vertI) const |
label | edgeToEVert (const label edgeI) const |
point | coord (const label cut, const scalar weight) const |
label | cutPairToEdge (const label cut0, const label cut1) const |
Ostream & | writeCut (Ostream &os, const label cut, const scalar) const |
Write cut description to Ostream. More... | |
Ostream & | writeCuts (Ostream &os, const labelList &, const scalarField &) const |
Write cut descriptions to Ostream. More... | |
Private Member Functions | |
label | findCutCell (const cellCuts &, const labelList &) const |
Returns -1 or the cell in cellLabels that is cut. More... | |
label | findInternalFacePoint (const labelList &pointLabels) const |
Returns first pointI in pointLabels that uses an internal. More... | |
void | faceCells (const cellCuts &cuts, const label faceI, label &own, label &nei) const |
Get new owner and neighbour of face. Checks anchor points to see if. More... | |
void | getFaceInfo (const label faceI, label &patchID, label &zoneID, label &zoneFlip) const |
Get patch information for face. More... | |
void | addFace (polyTopoChange &meshMod, const label faceI, const face &newFace, const label owner, const label neighbour) |
Adds a face on top of existing faceI. Flips face. More... | |
void | modFace (polyTopoChange &meshMod, const label faceI, const face &newFace, const label owner, const label neighbour) |
Modifies existing faceI for either new owner/neighbour or. More... | |
void | copyFace (const face &f, const label startFp, const label endFp, face &newFace) const |
void | splitFace (const face &f, const label v0, const label v1, face &f0, face &f1) const |
Split face along cut into two faces. Faces are in same point. More... | |
face | addEdgeCutsToFace (const label faceI) const |
Add cuts of edges to face. More... | |
face | loopToFace (const label cellI, const labelList &loop) const |
Convert loop of cuts into face. More... | |
void | getFacesEdgesPoints (const label cellI, labelHashSet &faces, labelHashSet &edges, labelHashSet &points) const |
Get elements of cell. More... | |
meshCutter (const meshCutter &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const meshCutter &) |
Disallow default bitwise assignment. More... | |
Static Private Member Functions | |
static bool | uses (const labelList &elems1, const labelList &elems2) |
Do list 1 and 2 share elements? More... | |
static bool | isIn (const edge &, const labelList &) |
Do the elements of edge appear in consecutive order in the list. More... | |
Private Attributes | |
Map< label > | addedCells_ |
Cells added in last setRefinement. Per splitcell label of added. More... | |
Map< label > | addedFaces_ |
Faces added in last setRefinement. Per split cell label of added. More... | |
HashTable< label, edge, Hash< edge > > | addedPoints_ |
Points added in last setRefinement. Per split edge label of added. More... | |
Additional Inherited Members | |
![]() | |
static void | updateLabels (const labelList &map, List< refineCell > &) |
Update refine list from map. Used to update cell/face labels. More... | |
static void | updateLabels (const labelList &map, Map< label > &) |
Update map from map. Used to update cell/face labels. More... | |
static void | updateLabels (const labelList &map, labelHashSet &) |
Update map from map. Used to update cell/face labels. More... | |
static bool | isEdge (const primitiveMesh &mesh, const label eVert) |
Is eVert an edge? More... | |
static label | getEdge (const primitiveMesh &mesh, const label eVert) |
Convert eVert to edge label. More... | |
static label | getVertex (const primitiveMesh &mesh, const label eVert) |
Convert eVert to vertex label. More... | |
static label | vertToEVert (const primitiveMesh &mesh, const label vertI) |
Convert pointI to eVert. More... | |
static label | edgeToEVert (const primitiveMesh &mesh, const label edgeI) |
Convert edgeI to eVert. More... | |
static point | coord (const primitiveMesh &, const label cut, const scalar weight) |
Return coordinate of cut (uses weight if edgeCut) More... | |
static label | cutPairToEdge (const primitiveMesh &, const label cut0, const label cut1) |
Find mesh edge (or -1) between two cuts. More... | |
Cuts (splits) cells.
Description of cut is given as a loop of 'cuts' per cell (see cellCuts). setRefinement() takes this cut description and inserts the necessary topoActions (add points/faces/cells) into the polyTopoChange.
Stores added cells/faces/points.
Cut description gives orientation to cut by calculating 'anchorPoints'. The side of the cell that contains the anchorPoints is the master cell. Likewise the cells' edges will have the split added as a duplicate of the master (anchor) point. Think of it as the cell with the anchor points at the bottom. Add a face at the bottom to split the cell and then sweep this face up to be through the middle of the cell (inflation).
+-------+ | + | + | + | + | + | + | + +-------+ anchor anchor
+-------+ | + | + | + <- addedCell | + | + | + +-------+ <- splitFace +-------+ <- original cell anchor anchor
+-------+ | + | + <- addedCell | + +-------+ <- splitFace | + | + <- original cell | + +-------+ anchor anchor
Anyway this was the original idea. Inflation was meant to handle conservative properties distribution without interpolation. (just face sweeping through space). But problem was that only if the introduced splitface was exactly the same shape as bottom face (so same 2D topo or perfectly flat) the volume between them was 0.
This meshCutting still uses anchorPoints though:
Definition at line 134 of file meshCutter.H.
|
private |
Disallow default bitwise copy construct.
meshCutter | ( | const polyMesh & | mesh | ) |
Construct from mesh.
Definition at line 505 of file meshCutter.C.
~meshCutter | ( | ) |
Destructor.
Definition at line 517 of file meshCutter.C.
Do list 1 and 2 share elements?
Definition at line 47 of file meshCutter.C.
References Foam::findIndex(), and forAll.
Do the elements of edge appear in consecutive order in the list.
Definition at line 61 of file meshCutter.C.
References Foam::findIndex().
|
private |
Returns -1 or the cell in cellLabels that is cut.
Definition at line 84 of file meshCutter.C.
References cellCuts::cellLoops(), forAll, Foam::labelI, and List::size().
|
private |
Returns first pointI in pointLabels that uses an internal.
face. Used to find point to inflate cell/face from (has to be connected to internal face)
Definition at line 103 of file meshCutter.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::labelI, mesh, pFaces, primitiveMesh::pointFaces(), and pointLabels().
Get new owner and neighbour of face. Checks anchor points to see if.
need to get original or added cell.
Definition at line 135 of file meshCutter.C.
References cellCuts::cellAnchorPoints(), cellCuts::cellLoops(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), and mesh.
|
private |
Get patch information for face.
Definition at line 169 of file meshCutter.C.
References polyMesh::boundaryMesh(), polyMesh::faceZones(), faceZone::flipMap(), mesh, faceZone::whichFace(), polyBoundaryMesh::whichPatch(), and ZoneMesh::whichZone().
|
private |
Adds a face on top of existing faceI. Flips face.
if owner>neighbour
Definition at line 197 of file meshCutter.C.
References Foam::endl(), Foam::Pout, face::reverseFace(), and polyTopoChange::setAction().
|
private |
Modifies existing faceI for either new owner/neighbour or.
new face points. Checks if anything changed and flips face if owner>neighbour
Definition at line 275 of file meshCutter.C.
References Foam::endl(), polyMesh::faces(), mesh, Foam::Pout, face::reverseFace(), and polyTopoChange::setAction().
|
private |
Definition at line 350 of file meshCutter.C.
References f(), and List::size().
|
private |
Split face along cut into two faces. Faces are in same point.
order as original face (i.e. maintain normal direction)
Definition at line 372 of file meshCutter.C.
References Foam::abort(), f(), f1, Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), List::setSize(), and List::size().
|
private |
Add cuts of edges to face.
Definition at line 411 of file meshCutter.C.
References f(), polyMesh::faces(), HashTable::find(), forAll, mesh, List::setSize(), and List::size().
|
private |
Convert loop of cuts into face.
Definition at line 444 of file meshCutter.C.
References Foam::e, primitiveMesh::edges(), HashTable::find(), Foam::meshTools::findEdge(), forAll, mesh, List::setSize(), and List::size().
|
private |
Get elements of cell.
|
private |
Disallow default bitwise assignment.
ClassName | ( | "meshCutter" | ) |
Runtime type information.
void setRefinement | ( | const cellCuts & | cuts, |
polyTopoChange & | meshMod | ||
) |
Do actual cutting with cut description. Inserts mesh changes.
into meshMod.
Definition at line 524 of file meshCutter.C.
References Foam::abort(), cellCuts::cellAnchorPoints(), cellCuts::cellLoops(), primitiveMesh::cells(), Foam::e, primitiveMesh::edgeFaces(), cellCuts::edgeIsCut(), primitiveMesh::edges(), cellCuts::edgeWeight(), Foam::endl(), f(), f1, polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), cellCuts::faceSplitCut(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIter(), mesh, Foam::nl, cellCuts::nLoops(), polyMesh::points(), Foam::Pout, polyTopoChange::setAction(), and List::size().
Referenced by main(), and undoableMeshCutter::setRefinement().
void updateMesh | ( | const mapPolyMesh & | morphMap | ) |
Force recalculation of locally stored data on topological change.
Definition at line 972 of file meshCutter.C.
References Foam::e, Foam::endl(), forAllConstIter(), HashTable::insert(), Foam::Pout, mapPolyMesh::reverseCellMap(), mapPolyMesh::reverseFaceMap(), and mapPolyMesh::reversePointMap().
Referenced by main(), and undoableMeshCutter::updateMesh().
Cells added. Per split cell label of added cell.
Definition at line 297 of file meshCutter.H.
References meshCutter::addedCells_.
Faces added. Per split cell label of added face.
Definition at line 303 of file meshCutter.H.
References meshCutter::addedFaces_.
Points added. Per split edge label of added point.
Definition at line 309 of file meshCutter.H.
References meshCutter::addedPoints_.
Cells added in last setRefinement. Per splitcell label of added.
cell
Definition at line 142 of file meshCutter.H.
Referenced by meshCutter::addedCells().
Faces added in last setRefinement. Per split cell label of added.
face
Definition at line 146 of file meshCutter.H.
Referenced by meshCutter::addedFaces().
Points added in last setRefinement. Per split edge label of added.
point
Definition at line 150 of file meshCutter.H.
Referenced by meshCutter::addedPoints().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.