All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cellCuts Class Reference

Description of cuts across cells. More...

Inheritance diagram for cellCuts:
Collaboration diagram for cellCuts:

Public Member Functions

 ClassName ("cellCuts")
 Runtime type information. More...
 
 cellCuts (const polyMesh &mesh, const labelList &cutCells, const labelList &meshVerts, const labelList &meshEdges, const scalarField &meshEdgeWeights)
 Construct from cells to cut and pattern of cuts. More...
 
 cellCuts (const polyMesh &mesh, const labelList &meshVerts, const labelList &meshEdges, const scalarField &meshEdgeWeights)
 Construct from pattern of cuts. Detect cells to cut. More...
 
 cellCuts (const polyMesh &mesh, const labelList &cellLabels, const labelListList &cellLoops, const List< scalarField > &cellEdgeWeights)
 Construct from complete cellLoops through specified cells. More...
 
 cellCuts (const polyMesh &mesh, const cellLooper &cellCutter, const List< refineCell > &refCells)
 Construct from list of cells to cut and direction to cut in. More...
 
 cellCuts (const polyMesh &mesh, const cellLooper &cellCutter, const labelList &cellLabels, const List< plane > &cutPlanes)
 Construct from list of cells to cut and plane to cut with and. More...
 
 cellCuts (const polyMesh &mesh, const boolList &pointIsCut, const boolList &edgeIsCut, const scalarField &edgeWeight, const Map< edge > &faceSplitCut, const labelListList &cellLoops, const label nLoops, const labelListList &cellAnchorPoints)
 Construct from components. More...
 
 cellCuts (const cellCuts &)=delete
 Disallow default bitwise copy construction. More...
 
 ~cellCuts ()
 Destructor. More...
 
void clearOut ()
 Clear out demand driven storage. More...
 
const boolListpointIsCut () const
 Is mesh point cut. More...
 
const boolListedgeIsCut () const
 Is edge cut. More...
 
const scalarFieldedgeWeight () const
 If edge is cut gives weight (ratio between start() and end()) More...
 
const labelListListfaceCuts () const
 Cuts per existing face (includes those along edge of face) More...
 
const Map< edge > & faceSplitCut () const
 Gives for split face the two cuts that split the face into two. More...
 
const labelListListcellLoops () const
 For each cut cell the cut along the circumference. More...
 
label nLoops () const
 Number of valid cell loops. More...
 
const labelListListcellAnchorPoints () const
 For each cut cell the points on the 'anchor' side of the cell. More...
 
pointField loopPoints (const label celli) const
 Returns coordinates of points on loop for given cell. More...
 
labelList nonAnchorPoints (const labelList &cellPoints, const labelList &anchorPoints, const labelList &loop) const
 Invert anchor point selection. More...
 
void flip (const label celli)
 Flip loop for celli. Updates anchor points as well. More...
 
void flipLoopOnly (const label celli)
 Flip loop for celli. Does not update anchors. Use with care. More...
 
void writeOBJ (Ostream &os, const pointField &loopPoints, label &vertI) const
 debugging:Write list of cuts to stream in OBJ format More...
 
void writeOBJ (Ostream &os) const
 debugging:Write all of cuts to stream in OBJ format More...
 
void writeCellOBJ (const fileName &dir, const label celli) const
 debugging:Write edges of cell and loop More...
 
void operator= (const cellCuts &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from edgeVertex
 edgeVertex (const polyMesh &mesh)
 Construct from mesh. More...
 
 edgeVertex (const edgeVertex &)=delete
 Disallow default bitwise copy construction. 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...
 
void operator= (const edgeVertex &)=delete
 Disallow default bitwise assignment. 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

Description of cuts across cells.

Description of cut is given as list of vertices and list of edges to be cut (and position on edge).

Does some checking of correctness/non-overlapping of cuts. 2x2x2 refinement has to be done in three passes since cuts can not overlap (would make addressing too complicated)

Introduces concept of 'cut' which is either an existing vertex or a edge.

Input can either be

  1. list of cut vertices and list of cut edges. Constructs cell circumference walks ('cellLoops').
  2. list of cell circumference walks. Will filter them so they don't overlap.
  3. cellWalker and list of cells to refine (refineCell). Constructs cellLoops and does B. cellWalker is class which can cut a single cell using a plane through the cell centre and in a certain normal direction

CellCuts constructed from cellLoops (B, C) can have multiple cut-edges and/or cut-point as long as there is per face only one (or none) cut across a face, i.e. a face can only be split into two faces.

The information available after construction:

  • pointIsCut, edgeIsCut.
  • faceSplitCut : the cross-cut of a face.
  • cellLoops : the loop which cuts across a cell
  • cellAnchorPoints : per cell the vertices on one side which are considered the anchor points.

AnchorPoints: connected loops have to be oriented in the same way to be able to grow new internal faces out of the same bottom faces. (limitation of the mapping procedure). The loop is cellLoop is oriented such that the normal of it points towards the anchorPoints. This is the only routine which uses geometric information.

Limitations:

  • cut description is very precise. Hard to get right.
  • do anchor points need to be unique per cell? Very inefficient.
  • is orientation guaranteed to be correct? Uses geometric info so can go wrong on highly distorted meshes.
  • is memory inefficient. Probably need to use Maps instead of labelLists.
Source files

Definition at line 108 of file cellCuts.H.

Constructor & Destructor Documentation

◆ cellCuts() [1/7]

cellCuts ( const polyMesh mesh,
const labelList cutCells,
const labelList meshVerts,
const labelList meshEdges,
const scalarField meshEdgeWeights 
)

Construct from cells to cut and pattern of cuts.

Definition at line 2830 of file cellCuts.C.

References Foam::endl(), and Foam::Pout.

Referenced by cellCuts::cellCuts(), and cellCuts::nonAnchorPoints().

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

◆ cellCuts() [2/7]

cellCuts ( const polyMesh mesh,
const labelList meshVerts,
const labelList meshEdges,
const scalarField meshEdgeWeights 
)

Construct from pattern of cuts. Detect cells to cut.

Definition at line 2873 of file cellCuts.C.

References cellCuts::cellCuts(), Foam::endl(), Foam::identity(), primitiveMesh::nCells(), and Foam::Pout.

Here is the call graph for this function:

◆ cellCuts() [3/7]

cellCuts ( const polyMesh mesh,
const labelList cellLabels,
const labelListList cellLoops,
const List< scalarField > &  cellEdgeWeights 
)

Construct from complete cellLoops through specified cells.

Checks for consistency. Constructs cut-cut addressing and cellAnchorPoints.

Definition at line 2920 of file cellCuts.C.

References cellCuts::cellCuts(), Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ cellCuts() [4/7]

cellCuts ( const polyMesh mesh,
const cellLooper cellCutter,
const List< refineCell > &  refCells 
)

Construct from list of cells to cut and direction to cut in.

(always through cell centre) and celllooper.

Definition at line 2966 of file cellCuts.C.

References cellCuts::cellCuts(), Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ cellCuts() [5/7]

cellCuts ( const polyMesh mesh,
const cellLooper cellCutter,
const labelList cellLabels,
const List< plane > &  cutPlanes 
)

Construct from list of cells to cut and plane to cut with and.

celllooper. (constructor above always cuts through cell centre)

Definition at line 3011 of file cellCuts.C.

References cellCuts::cellCuts(), Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ cellCuts() [6/7]

cellCuts ( const polyMesh mesh,
const boolList pointIsCut,
const boolList edgeIsCut,
const scalarField edgeWeight,
const Map< edge > &  faceSplitCut,
const labelListList cellLoops,
const label  nLoops,
const labelListList cellAnchorPoints 
)

Construct from components.

Definition at line 3059 of file cellCuts.C.

References Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ cellCuts() [7/7]

cellCuts ( const cellCuts )
delete

Disallow default bitwise copy construction.

◆ ~cellCuts()

~cellCuts ( )

Destructor.

Definition at line 3089 of file cellCuts.C.

Member Function Documentation

◆ ClassName()

ClassName ( "cellCuts"  )

Runtime type information.

◆ clearOut()

void clearOut ( )

Clear out demand driven storage.

Definition at line 3095 of file cellCuts.C.

◆ pointIsCut()

const boolList& pointIsCut ( ) const
inline

Is mesh point cut.

Definition at line 538 of file cellCuts.H.

Referenced by meshCutAndRemove::setRefinement().

Here is the caller graph for this function:

◆ edgeIsCut()

const boolList& edgeIsCut ( ) const
inline

Is edge cut.

Definition at line 544 of file cellCuts.H.

Referenced by meshCutAndRemove::setRefinement(), and meshCutter::setRefinement().

Here is the caller graph for this function:

◆ edgeWeight()

const scalarField& edgeWeight ( ) const
inline

If edge is cut gives weight (ratio between start() and end())

Definition at line 550 of file cellCuts.H.

References cellCuts::faceCuts(), and autoPtr< T >::valid().

Referenced by meshCutAndRemove::setRefinement(), and meshCutter::setRefinement().

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

◆ faceCuts()

const labelListList& faceCuts ( ) const
inline

Cuts per existing face (includes those along edge of face)

Cuts in no particular order

Definition at line 557 of file cellCuts.H.

Referenced by cellCuts::edgeWeight().

Here is the caller graph for this function:

◆ faceSplitCut()

const Map<edge>& faceSplitCut ( ) const
inline

Gives for split face the two cuts that split the face into two.

Definition at line 567 of file cellCuts.H.

Referenced by meshCutAndRemove::setRefinement(), and meshCutter::setRefinement().

Here is the caller graph for this function:

◆ cellLoops()

const labelListList& cellLoops ( ) const
inline

For each cut cell the cut along the circumference.

Definition at line 573 of file cellCuts.H.

Referenced by meshCutAndRemove::setRefinement(), and meshCutter::setRefinement().

Here is the caller graph for this function:

◆ nLoops()

label nLoops ( ) const
inline

Number of valid cell loops.

Definition at line 579 of file cellCuts.H.

Referenced by refinementIterator::setRefinement(), meshCutAndRemove::setRefinement(), and meshCutter::setRefinement().

Here is the caller graph for this function:

◆ cellAnchorPoints()

const labelListList& cellAnchorPoints ( ) const
inline

For each cut cell the points on the 'anchor' side of the cell.

Definition at line 585 of file cellCuts.H.

References cellCuts::flip(), cellCuts::flipLoopOnly(), cellCuts::nonAnchorPoints(), cellCuts::operator=(), and cellCuts::writeCellOBJ().

Referenced by meshCutAndRemove::setRefinement(), and meshCutter::setRefinement().

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

◆ loopPoints()

Foam::pointField loopPoints ( const label  celli) const

Returns coordinates of points on loop for given cell.

Uses cellLoops_ and edgeWeight_

Definition at line 3103 of file cellCuts.C.

References forAll, and List< T >::size().

Here is the call graph for this function:

◆ nonAnchorPoints()

◆ flip()

void flip ( const label  celli)

Flip loop for celli. Updates anchor points as well.

Definition at line 3128 of file cellCuts.C.

References mesh, and Foam::reverse().

Referenced by cellCuts::cellAnchorPoints().

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

◆ flipLoopOnly()

void flipLoopOnly ( const label  celli)

Flip loop for celli. Does not update anchors. Use with care.

(only if you're sure loop orientation is wrong)

Definition at line 3145 of file cellCuts.C.

References Foam::reverse().

Referenced by cellCuts::cellAnchorPoints().

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

◆ writeOBJ() [1/2]

void writeOBJ ( Ostream os,
const pointField loopPoints,
label vertI 
) const

debugging:Write list of cuts to stream in OBJ format

Definition at line 3154 of file cellCuts.C.

References Foam::endl(), forAll, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ writeOBJ() [2/2]

void writeOBJ ( Ostream os) const

debugging:Write all of cuts to stream in OBJ format

Definition at line 3180 of file cellCuts.C.

References forAll, and Foam::meshTools::writeOBJ().

Here is the call graph for this function:

◆ writeCellOBJ()

void writeCellOBJ ( const fileName dir,
const label  celli 
) const

debugging:Write edges of cell and loop

Definition at line 3191 of file cellCuts.C.

References Foam::meshTools::writeOBJ().

Referenced by cellCuts::cellAnchorPoints().

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

◆ operator=()

void operator= ( const cellCuts )
delete

Disallow default bitwise assignment.

Referenced by cellCuts::cellAnchorPoints().

Here is the caller graph for this function:

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