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

The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cut and in what way. Maintains an undo list (if told so during construction). Apart from undo list is just wrapper around meshCutter. More...

Inheritance diagram for undoableMeshCutter:
Inheritance graph
[legend]
Collaboration diagram for undoableMeshCutter:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("undoableMeshCutter")
 Runtime type information. More...
 
 undoableMeshCutter (const polyMesh &mesh, const bool undoable=true)
 Construct from mesh and flag whether refinement pattern needs. More...
 
 ~undoableMeshCutter ()
 Destructor. More...
 
const Map< splitCell * > & liveSplitCells () const
 All current live split cells. Warning: cell labels will change. More...
 
const removeFacesfaceRemover () const
 
void setRefinement (const cellCuts &cuts, polyTopoChange &)
 Refine cells acc. to cellCuts. Plays topology changes. More...
 
void updateMesh (const mapPolyMesh &morphMap)
 Update stored refinement pattern for changes to mesh. Only. More...
 
labelList getSplitFaces () const
 Calculate split faces from current liveCells. Only. More...
 
Map< labelgetAddedCells () const
 Like getSplitFaces but returns map from original to added cell. More...
 
labelList removeSplitFaces (const labelList &splitFaces, polyTopoChange &)
 Remove some refinement. Needs to be supplied subset of. More...
 
- Public Member Functions inherited from meshCutter
 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...
 
- Public Member Functions inherited from edgeVertex
 edgeVertex (const polyMesh &mesh)
 Construct from mesh. More...
 
const polyMeshmesh () 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
 
OstreamwriteCut (Ostream &os, const label cut, const scalar) const
 Write cut description to Ostream. More...
 
OstreamwriteCuts (Ostream &os, const labelList &, const scalarField &) const
 Write cut descriptions to Ostream. More...
 

Private Member Functions

void printCellRefTree (Ostream &os, const word &, const splitCell *) const
 Debug print. More...
 
void printRefTree (Ostream &os) const
 Debug print. More...
 
label sharedFace (const label cell0I, const label cell1I) const
 Find shared face between two cells. More...
 
 undoableMeshCutter (const undoableMeshCutter &)
 Disallow default bitwise copy construct. More...
 
void operator= (const undoableMeshCutter &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static void updateLabels (const labelList &map, Map< splitCell * > &)
 Update labels on splitCell structure after morphing. More...
 

Private Attributes

const bool undoable_
 Whether or not to store actions for unplaying. More...
 
Map< splitCell * > liveSplitCells_
 Current split cells which are 'visible'. Only set if undoable. More...
 
removeFaces faceRemover_
 Face remover engine. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from edgeVertex
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...
 

Detailed Description

The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cut and in what way. Maintains an undo list (if told so during construction). Apart from undo list is just wrapper around meshCutter.

Undo list: contains a refinement tree (of type splitCell; cell labels are of no consequence) and a list of visible splitCells, i.e. the top of the tree (where the cell labels are valid). Now every cell added gets put on the tree and every updateMesh action updates the labels of visible splitcells.

We can now ask this structure for a list of visible split cells or the list of faces between these. These can be passed to removeFaces for actual deletion and we delete the top splitCell and update the now newly visible underlying cells for the new cell number (passed back from removeFaces).

NOTE: Undoing note properly tested. Expect it to fail if the faces to be removed cause other faces to be additionally removed (i.e. removeFaces adds additional faces to remove).

splitCell:

Source files

Definition at line 93 of file undoableMeshCutter.H.

Constructor & Destructor Documentation

◆ undoableMeshCutter() [1/2]

undoableMeshCutter ( const undoableMeshCutter )
private

Disallow default bitwise copy construct.

◆ undoableMeshCutter() [2/2]

undoableMeshCutter ( const polyMesh mesh,
const bool  undoable = true 
)

Construct from mesh and flag whether refinement pattern needs.

to be stored.

Definition at line 176 of file undoableMeshCutter.C.

◆ ~undoableMeshCutter()

Destructor.

Definition at line 194 of file undoableMeshCutter.C.

References forAllIter, splitCell::getOther(), and splitCell::parent().

Here is the call graph for this function:

Member Function Documentation

◆ printCellRefTree()

void printCellRefTree ( Ostream os,
const word indent,
const splitCell splitCellPtr 
) const
private

Debug print.

Definition at line 49 of file undoableMeshCutter.C.

References splitCell::cellLabel(), Foam::endl(), Foam::indent(), splitCell::master(), and splitCell::slave().

Referenced by undoableMeshCutter::printRefTree().

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

◆ printRefTree()

void printRefTree ( Ostream os) const
private

Debug print.

Definition at line 69 of file undoableMeshCutter.C.

References forAllConstIter(), splitCell::isMaster(), undoableMeshCutter::liveSplitCells_, splitCell::parent(), and undoableMeshCutter::printCellRefTree().

Here is the call graph for this function:

◆ sharedFace()

label sharedFace ( const label  cell0I,
const label  cell1I 
) const
private

Find shared face between two cells.

◆ updateLabels()

void updateLabels ( const labelList map,
Map< splitCell * > &  liveSplitCells 
)
staticprivate

Update labels on splitCell structure after morphing.

Definition at line 103 of file undoableMeshCutter.C.

References Foam::abort(), splitCell::cellLabel(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAllConstIter(), forAllIter, and Foam::Pout.

Here is the call graph for this function:

◆ operator=()

void operator= ( const undoableMeshCutter )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "undoableMeshCutter"  )

Runtime type information.

◆ liveSplitCells()

const Map<splitCell*>& liveSplitCells ( ) const
inline

All current live split cells. Warning: cell labels will change.

during morphing. Only this map is guaranteed to hold uptodate info.

Definition at line 162 of file undoableMeshCutter.H.

◆ faceRemover()

const removeFaces& faceRemover ( ) const
inline

Definition at line 167 of file undoableMeshCutter.H.

References undoableMeshCutter::faceRemover_.

◆ setRefinement()

void setRefinement ( const cellCuts cuts,
polyTopoChange meshMod 
)

Refine cells acc. to cellCuts. Plays topology changes.

into polyTopoChange.

Definition at line 229 of file undoableMeshCutter.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAllConstIter(), splitCell::master(), Foam::Pout, meshCutter::setRefinement(), and splitCell::slave().

Here is the call graph for this function:

◆ updateMesh()

void updateMesh ( const mapPolyMesh morphMap)

Update stored refinement pattern for changes to mesh. Only.

call if undoable set.

Definition at line 324 of file undoableMeshCutter.C.

References mapPolyMesh::reverseCellMap(), and meshCutter::updateMesh().

Here is the call graph for this function:

◆ getSplitFaces()

Foam::labelList getSplitFaces ( ) const

◆ getAddedCells()

Foam::Map< Foam::label > getAddedCells ( ) const

Like getSplitFaces but returns map from original to added cell.

Only call if undoable set.

Definition at line 401 of file undoableMeshCutter.C.

References Foam::abort(), splitCell::cellLabel(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAllConstIter(), splitCell::getOther(), splitCell::isMaster(), splitCell::isUnrefined(), and splitCell::parent().

Here is the call graph for this function:

◆ removeSplitFaces()

Foam::labelList removeSplitFaces ( const labelList splitFaces,
polyTopoChange meshMod 
)

Remove some refinement. Needs to be supplied subset of.

getSplitFaces() output. Returns list of faces removed (can be more or equal but never less than splitFaces - since removeFaces might decide to take down unnecessary faces) Only call if undoable set.

important: Redo search since ownFind entry deleted.

Definition at line 448 of file undoableMeshCutter.C.

References Foam::abort(), splitCell::cellLabel(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorInFunction, forAll, splitCell::isUnrefined(), mesh, splitCell::parent(), Foam::Pout, and List::size().

Here is the call graph for this function:

Field Documentation

◆ undoable_

const bool undoable_
private

Whether or not to store actions for unplaying.

Definition at line 100 of file undoableMeshCutter.H.

◆ liveSplitCells_

Map<splitCell*> liveSplitCells_
private

Current split cells which are 'visible'. Only set if undoable.

Definition at line 103 of file undoableMeshCutter.H.

Referenced by undoableMeshCutter::printRefTree().

◆ faceRemover_

removeFaces faceRemover_
private

Face remover engine.

Definition at line 106 of file undoableMeshCutter.H.

Referenced by undoableMeshCutter::faceRemover().


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