OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

cellCuts Class Reference

Description of cuts across cells. More...

Inheritance diagram for cellCuts:
Collaboration diagram for cellCuts:

List of all members.


Public Member Functions

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

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

  1. list of cell circumference walks. Will filter them so they don't overlap.

  1. 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 104 of file cellCuts.H.


Constructor & Destructor Documentation

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 2690 of file cellCuts.C.

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 2736 of file cellCuts.C.

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 2780 of file cellCuts.C.

References Foam::Pout.

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 2825 of file cellCuts.C.

References Foam::Pout.

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 2869 of file cellCuts.C.

References Foam::Pout.

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 2916 of file cellCuts.C.

References Foam::Pout.

~cellCuts (  ) 

Definition at line 2947 of file cellCuts.C.

References Foam::Pout.


Member Function Documentation

ClassName ( "cellCuts"   ) 

Runtime type information.

void clearOut (  ) 

Clear out demand driven storage.

Definition at line 2953 of file cellCuts.C.

const boolList& pointIsCut (  )  const [inline]

Is mesh point cut.

Definition at line 571 of file cellCuts.H.

const boolList& edgeIsCut (  )  const [inline]

Is edge cut.

Definition at line 577 of file cellCuts.H.

const scalarField& edgeWeight (  )  const [inline]

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

Definition at line 583 of file cellCuts.H.

const labelListList& faceCuts (  )  const [inline]

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

Cuts in no particular order

Definition at line 592 of file cellCuts.H.

const Map<edge>& faceSplitCut (  )  const [inline]

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

Definition at line 602 of file cellCuts.H.

const labelListList& cellLoops (  )  const [inline]

For each cut cell the cut along the circumference.

Definition at line 608 of file cellCuts.H.

label nLoops (  )  const [inline]

Number of valid cell loops.

Definition at line 614 of file cellCuts.H.

const labelListList& cellAnchorPoints (  )  const [inline]

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

Definition at line 620 of file cellCuts.H.

Foam::pointField loopPoints ( const label  cellI  )  const

Returns coordinates of points on loop for given cell.

Uses cellLoops_ and edgeWeight_

Definition at line 2961 of file cellCuts.C.

References Foam::deleteDemandDrivenData().

Here is the call graph for this function:

Foam::labelList nonAnchorPoints ( const labelList &  cellPoints,
const labelList &  anchorPoints,
const labelList &  loop 
) const

Invert anchor point selection.

Definition at line 1180 of file cellCuts.C.

void flip ( const label  cellI  ) 

Flip loop for cellI. Updates anchor points as well.

Definition at line 2987 of file cellCuts.C.

References edgeVertex::coord().

Here is the call graph for this function:

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 3005 of file cellCuts.C.

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

debugging:Write list of cuts to stream in OBJ format

Definition at line 3014 of file cellCuts.C.

References Foam::reverse().

Here is the call graph for this function:

void writeOBJ ( Ostream &  os  )  const

debugging:Write all of cuts to stream in OBJ format

Definition at line 3040 of file cellCuts.C.

void writeCellOBJ ( const fileName &  dir,
const label  cellI 
) const

debugging:Write edges of cell and loop

Definition at line 3051 of file cellCuts.C.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd