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

Given list of faces to remove insert all the topology changes. Contains helper function to get consistent set of faces to remove. More...

Collaboration diagram for removeFaces:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("removeFaces")
 Runtime type information. More...
 
 removeFaces (const polyMesh &, const scalar minCos)
 Construct from mesh and min cos of angle for boundary faces. More...
 
label compatibleRemoves (const labelList &inPiercedFaces, labelList &cellRegion, labelList &cellRegionMaster, labelList &outPiercedFaces) const
 Find faces including those with cells which have the same mastercell. More...
 
void setRefinement (const labelList &piercedFaces, const labelList &cellRegion, const labelList &cellRegionMaster, polyTopoChange &) const
 Play commands into polyTopoChange to remove faces. More...
 
void updateMesh (const mapPolyMesh &)
 Force recalculation of locally stored data on topological change. More...
 
void distribute (const mapDistributePolyMesh &)
 Force recalculation of locally stored data for mesh distribution. More...
 

Private Member Functions

void changeCellRegion (const label cellI, const label oldRegion, const label newRegion, labelList &cellRegion) const
 Change elements in cellRegion that are oldRegion to newRegion. More...
 
label changeFaceRegion (const labelList &cellRegion, const boolList &removedFace, const labelList &nFacesPerEdge, const label faceI, const label newRegion, const labelList &fEdges, labelList &faceRegion) const
 Changes region of connected set of faces. More...
 
boolList getFacesAffected (const labelList &cellRegion, const labelList &cellRegionMaster, const labelList &facesToRemove, const labelHashSet &edgesToRemove, const labelHashSet &pointsToRemove) const
 Get all affected faces (including faces marked for removal) More...
 
void mergeFaces (const labelList &cellRegion, const labelList &cellRegionMaster, const labelHashSet &pointsToRemove, const labelList &faceLabels, polyTopoChange &meshMod) const
 Merge faceLabels into single face. More...
 
void getFaceInfo (const label faceI, label &patchID, label &zoneID, label &zoneFlip) const
 Get patch, zone info for faceI. More...
 
face filterFace (const labelHashSet &, const label) const
 Return face with all pointsToRemove removed. More...
 
void modFace (const face &f, const label masterFaceID, const label own, const label nei, const bool flipFaceFlux, const label newPatchID, const bool removeFromZone, const label zoneID, const bool zoneFlip, polyTopoChange &meshMod) const
 Wrapper for meshMod.modifyFace. Reverses face if own>nei. More...
 
 removeFaces (const removeFaces &)
 Disallow default bitwise copy construct. More...
 
void operator= (const removeFaces &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static void writeOBJ (const indirectPrimitivePatch &, const fileName &)
 Debug: write set of faces to file in obj format. More...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
const scalar minCos_
 Cosine of angles between boundary faces. Boundary faces can be. More...
 

Detailed Description

Given list of faces to remove insert all the topology changes. Contains helper function to get consistent set of faces to remove.

Not very well tested in parallel.

Source files

Definition at line 62 of file removeFaces.H.

Constructor & Destructor Documentation

◆ removeFaces() [1/2]

removeFaces ( const removeFaces )
private

Disallow default bitwise copy construct.

◆ removeFaces() [2/2]

removeFaces ( const polyMesh mesh,
const scalar  minCos 
)

Construct from mesh and min cos of angle for boundary faces.

to be considered aligned. Set to >= 1 to disable checking and always merge (if on same patch)

Definition at line 562 of file removeFaces.C.

Member Function Documentation

◆ changeCellRegion()

void changeCellRegion ( const label  cellI,
const label  oldRegion,
const label  newRegion,
labelList cellRegion 
) const
private

Change elements in cellRegion that are oldRegion to newRegion.

Recurses to cell neighbours.

Definition at line 54 of file removeFaces.C.

References forAll.

◆ changeFaceRegion()

Foam::label changeFaceRegion ( const labelList cellRegion,
const boolList removedFace,
const labelList nFacesPerEdge,
const label  faceI,
const label  newRegion,
const labelList fEdges,
labelList faceRegion 
) const
private

Changes region of connected set of faces.

Definition at line 79 of file removeFaces.C.

References forAll.

◆ getFacesAffected()

Foam::boolList getFacesAffected ( const labelList cellRegion,
const labelList cellRegionMaster,
const labelList facesToRemove,
const labelHashSet edgesToRemove,
const labelHashSet pointsToRemove 
) const
private

Get all affected faces (including faces marked for removal)

Definition at line 140 of file removeFaces.C.

References forAll, forAllConstIter(), and pFaces.

Here is the call graph for this function:

◆ writeOBJ()

void writeOBJ ( const indirectPrimitivePatch fp,
const fileName fName 
)
staticprivate

Debug: write set of faces to file in obj format.

Definition at line 200 of file removeFaces.C.

References Foam::endl(), f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), OFstream::name(), Foam::nl, Foam::Pout, and writeOBJ().

Here is the call graph for this function:

◆ mergeFaces()

void mergeFaces ( const labelList cellRegion,
const labelList cellRegionMaster,
const labelHashSet pointsToRemove,
const labelList faceLabels,
polyTopoChange meshMod 
) const
private

◆ getFaceInfo()

void getFaceInfo ( const label  faceI,
label patchID,
label zoneID,
label zoneFlip 
) const
private

Get patch, zone info for faceI.

Definition at line 416 of file removeFaces.C.

References faceZone::flipMap(), and faceZone::whichFace().

Here is the call graph for this function:

◆ filterFace()

Foam::face filterFace ( const labelHashSet pointsToRemove,
const label  faceI 
) const
private

Return face with all pointsToRemove removed.

Definition at line 446 of file removeFaces.C.

References f(), forAll, HashTable::found(), and List::setSize().

Here is the call graph for this function:

◆ modFace()

void modFace ( const face f,
const label  masterFaceID,
const label  own,
const label  nei,
const bool  flipFaceFlux,
const label  newPatchID,
const bool  removeFromZone,
const label  zoneID,
const bool  zoneFlip,
polyTopoChange meshMod 
) const
private

Wrapper for meshMod.modifyFace. Reverses face if own>nei.

Definition at line 475 of file removeFaces.C.

References f(), and polyTopoChange::setAction().

Here is the call graph for this function:

◆ operator=()

void operator= ( const removeFaces )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "removeFaces"  )

Runtime type information.

◆ compatibleRemoves()

Foam::label compatibleRemoves ( const labelList inPiercedFaces,
labelList cellRegion,
labelList cellRegionMaster,
labelList outPiercedFaces 
) const

Find faces including those with cells which have the same mastercell.

Given set of faces to pierce calculates:

  • region for connected cells
  • mastercell for each region. This is the lowest numbered cell of all cells that get merged.
  • new set of faces which contains input set + additional ones where cells on both sides would have same mastercell. Returns number of regions.

Definition at line 581 of file removeFaces.C.

References Foam::abort(), DynamicList::append(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::min(), List::setSize(), List::size(), and List::transfer().

Referenced by main().

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

◆ setRefinement()

void setRefinement ( const labelList piercedFaces,
const labelList cellRegion,
const labelList cellRegionMaster,
polyTopoChange meshMod 
) const

◆ updateMesh()

void updateMesh ( const mapPolyMesh )
inline

Force recalculation of locally stored data on topological change.

Definition at line 207 of file removeFaces.H.

Referenced by main().

Here is the caller graph for this function:

◆ distribute()

void distribute ( const mapDistributePolyMesh )
inline

Force recalculation of locally stored data for mesh distribution.

Definition at line 211 of file removeFaces.H.

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 67 of file removeFaces.H.

◆ minCos_

const scalar minCos_
private

Cosine of angles between boundary faces. Boundary faces can be.

merged only if angle between faces > minCos.

Definition at line 71 of file removeFaces.H.


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