FreeFOAM The Cross-Platform CFD Toolkit
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...

#include <dynamicMesh/undoableMeshCutter.H>


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:

  • original cell number.
  • pointer to parent (null for first level splitCell)
  • two pointers to splitCell children. Both null (unrefined=visible cell) or both non-null.
  • live are: (-all unrefined cells (original cell without any splitCells)) -all splitCells with null children
  • liveSplitCells contains pointers to splitCells with null children.
Source files

Definition at line 94 of file undoableMeshCutter.H.

+ Inheritance diagram for undoableMeshCutter:
+ Collaboration diagram for undoableMeshCutter:

List of all members.

Public Member Functions

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

Constructor & Destructor Documentation

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

Construct from mesh and flag whether refinement pattern needs.

to be stored.

Definition at line 185 of file undoableMeshCutter.C.


Member Function Documentation

ClassName ( "undoableMeshCutter"  )

Runtime type information.

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 164 of file undoableMeshCutter.H.

const removeFaces& faceRemover ( ) const
inline

Definition at line 169 of file undoableMeshCutter.H.

void setRefinement ( const cellCuts cuts,
polyTopoChange meshMod 
)
void updateMesh ( const mapPolyMesh morphMap)

Update stored refinement pattern for changes to mesh. Only.

call if undoable set.

Reimplemented from meshCutter.

Definition at line 333 of file undoableMeshCutter.C.

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

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

Like getSplitFaces but returns map from original to added cell.

Only call if undoable set.

Definition at line 410 of file undoableMeshCutter.C.

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

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 unnessecary faces) Only call if undoable set.

important: Redo search since ownFind entry deleted.

Definition at line 457 of file undoableMeshCutter.C.

References Foam::abort(), splitCell::cellLabel(), HashTable< T, label, Hash< label > >::end(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), forAll, splitCell::isUnrefined(), mesh, splitCell::parent(), Foam::Pout, and List< T >::size().


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