meshCutter Class Reference

Cuts (splits) cells. More...

Inheritance diagram for meshCutter:
[legend]
Collaboration diagram for meshCutter:
[legend]

Public Member Functions

 ClassName ("meshCutter")
 Runtime type information. More...
 
 meshCutter (const polyMesh &mesh)
 Construct from mesh. More...
 
 ~meshCutter ()=default
 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 EdgeMap< label > & 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...
 

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

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).

  1. Start: cell with anchor points at bottom
    +-------+
    |       +
    |       +
    |       +
    |       +
    |       +
    |       +
    |       +
    +-------+
    anchor  anchor
    
  2. Topo change: splitface introduced at bottom of cell, introducing a new cell and splitting the side faces into two.
    +-------+
    |       +
    |       +
    |       + <- addedCell
    |       +
    |       +
    |       +
    +-------+ <- splitFace
    +-------+ <- original cell
    anchor  anchor
    
  3. Inflation: splitface shifted up to middle of cell (or wherever cut was)
    +-------+
    |       +
    |       + <- 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:

  • the master cell is the one without the anchor points. The added cell (on top of the splitFace) is the with.
  • the splitFace is owned by the master cell (since it has the lower number)
  • the side faces get split and get either the original cell as neighbour or the added cell (if the faces contain the cell anchor points)
Source files

Definition at line 138 of file meshCutter.H.

Constructor & Destructor Documentation

◆ meshCutter()

meshCutter ( const polyMesh mesh)
explicit

Construct from mesh.

Definition at line 509 of file meshCutter.C.

◆ ~meshCutter()

~meshCutter ( )
default

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "meshCutter"  )

Runtime type information.

◆ setRefinement()

void setRefinement ( const cellCuts cuts,
polyTopoChange meshMod 
)

Do actual cutting with cut description. Inserts mesh changes.

into meshMod.

Definition at line 521 of file meshCutter.C.

References Foam::abort(), cellCuts::cellAnchorPoints(), primitiveMesh::cellEdges(), cellCuts::cellLoops(), primitiveMesh::cells(), e, primitiveMesh::edgeFaces(), cellCuts::edgeIsCut(), primitiveMesh::edges(), cellCuts::edgeWeight(), UList< T >::end(), Foam::endl(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), cellCuts::faceSplitCut(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIters, mesh, nEdges(), nFaces(), Foam::nl, cellCuts::nLoops(), points, polyMesh::points(), Foam::Pout, Foam::returnReduce(), polyTopoChange::setAction(), UList< T >::size(), syncTools::syncEdgeList(), and WarningInFunction.

Referenced by meshRefinement::directionalRefine(), and undoableMeshCutter::setRefinement().

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

◆ updateMesh()

void updateMesh ( const mapPolyMesh morphMap)

Force recalculation of locally stored data on topological change.

Definition at line 995 of file meshCutter.C.

References e, UList< T >::end(), Foam::endl(), forAllConstIters, HashTable< T, Key, Hash >::insert(), Foam::Pout, mapPolyMesh::reverseCellMap(), mapPolyMesh::reverseFaceMap(), and mapPolyMesh::reversePointMap().

Referenced by meshRefinement::directionalRefine().

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

◆ addedCells()

const Map< label > & addedCells ( ) const
inline

Cells added. Per split cell label of added cell.

Definition at line 301 of file meshCutter.H.

◆ addedFaces()

const Map< label > & addedFaces ( ) const
inline

Faces added. Per split cell label of added face.

Definition at line 307 of file meshCutter.H.

◆ addedPoints()

const EdgeMap< label > & addedPoints ( ) const
inline

Points added. Per split edge label of added point.

Definition at line 313 of file meshCutter.H.


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