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

Combines boundary faces into single face. The faces get the patch of the first face ('the master') More...

Collaboration diagram for combineFaces:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("combineFaces")
 Runtime type information. More...
 
 combineFaces (const polyMesh &mesh, const bool undoable=false)
 Construct from mesh. More...
 
const labelListmasterFace () const
 If undoable: masterface for every set. More...
 
const labelListsavedPointLabels () const
 If undoable: set of original point labels of stored points. More...
 
labelListList getMergeSets (const scalar featureCos, const scalar minConcaveCos, const labelHashSet &boundaryCells) const
 Extract lists of all (non-coupled) boundary faces on selected. More...
 
labelListList getMergeSets (const scalar featureCos, const scalar minConcaveCos) const
 Extract lists of all (non-coupled) boundary faces that can. More...
 
void setRefinement (const labelListList &, polyTopoChange &)
 Play commands into polyTopoChange to combine faces. Gets. More...
 
void updateMesh (const mapPolyMesh &)
 Force recalculation of locally stored data on topological change. More...
 
void setUnrefinement (const labelList &masterFaces, polyTopoChange &meshMod, Map< label > &restoredPoints, Map< label > &restoredFaces, Map< label > &restoredCells)
 Play commands into polyTopoChange to reinsert original faces. More...
 

Static Public Member Functions

static face getOutsideFace (const indirectPrimitivePatch &)
 Gets outside of patch as a face (in mesh point labels) More...
 

Private Member Functions

void regioniseFaces (const scalar minCos, const label cellI, const labelList &cEdges, Map< label > &faceRegion) const
 Create cell-local map from face to region (formed by merging faces. More...
 
bool faceNeighboursValid (const label cellI, const Map< label > &faceRegion) const
 Does merging faces invalidate (unmerged) neighbouring faces? More...
 
 combineFaces (const combineFaces &)
 Disallow default bitwise copy construct. More...
 
void operator= (const combineFaces &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static bool convexFace (const scalar minConcaveCos, const pointField &, const face &)
 Test if face is convex. Allow slight concavity through. More...
 
static bool validFace (const scalar minConcaveCos, const indirectPrimitivePatch &)
 Test if set of faces (in primitivePatch) can be combined into. More...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
const bool undoable_
 Whether undoable. More...
 
labelList masterFace_
 If undoable: masterface for every set. More...
 
List< faceListfaceSetsVertices_
 If undoable: per set the vertices of all the faces in the set. More...
 
labelList savedPointLabels_
 If undoable: saved point labels. More...
 
pointField savedPoints_
 If undoable: saved coordinates of above points. More...
 

Detailed Description

Combines boundary faces into single face. The faces get the patch of the first face ('the master')

Source files

Definition at line 55 of file combineFaces.H.

Constructor & Destructor Documentation

◆ combineFaces() [1/2]

combineFaces ( const combineFaces )
private

Disallow default bitwise copy construct.

◆ combineFaces() [2/2]

combineFaces ( const polyMesh mesh,
const bool  undoable = false 
)

Construct from mesh.

Definition at line 282 of file combineFaces.C.

Member Function Documentation

◆ convexFace()

bool convexFace ( const scalar  minConcaveCos,
const pointField points,
const face f 
)
staticprivate

Test if face is convex. Allow slight concavity through.

minConcaveCos.

Definition at line 52 of file combineFaces.C.

References f(), forAll, Foam::mag(), n, and points.

Here is the call graph for this function:

◆ validFace()

bool validFace ( const scalar  minConcaveCos,
const indirectPrimitivePatch bigFace 
)
staticprivate

Test if set of faces (in primitivePatch) can be combined into.

single face. Uses convexFace.

Definition at line 102 of file combineFaces.C.

References PrimitivePatch< Face, FaceList, PointField, PointType >::checkPointManifold(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeLoops(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and List::size().

Here is the call graph for this function:

◆ regioniseFaces()

void regioniseFaces ( const scalar  minCos,
const label  cellI,
const labelList cEdges,
Map< label > &  faceRegion 
) const
private

Create cell-local map from face to region (formed by merging faces.

across edges)

Definition at line 129 of file combineFaces.C.

References f1, forAll, forAllIter, Foam::meshTools::getEdgeFaces(), Foam::mag(), Foam::max(), Foam::min(), and patches.

Here is the call graph for this function:

◆ faceNeighboursValid()

bool faceNeighboursValid ( const label  cellI,
const Map< label > &  faceRegion 
) const
private

Does merging faces invalidate (unmerged) neighbouring faces?

Definition at line 217 of file combineFaces.C.

References DynamicList::append(), Foam::findIndex(), forAll, HashSet< Key, Hash >::insert(), Foam::meshTools::otherFace(), List::size(), and HashTable::size().

Here is the call graph for this function:

◆ operator=()

void operator= ( const combineFaces )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "combineFaces"  )

Runtime type information.

◆ masterFace()

const labelList& masterFace ( ) const
inline

If undoable: masterface for every set.

Definition at line 140 of file combineFaces.H.

References combineFaces::masterFace_.

Referenced by meshRefinement::mergePatchFacesUndo().

Here is the caller graph for this function:

◆ savedPointLabels()

const labelList& savedPointLabels ( ) const
inline

If undoable: set of original point labels of stored points.

Definition at line 146 of file combineFaces.H.

References combineFaces::savedPointLabels_.

Referenced by meshRefinement::mergePatchFacesUndo().

Here is the caller graph for this function:

◆ getMergeSets() [1/2]

Foam::labelListList getMergeSets ( const scalar  featureCos,
const scalar  minConcaveCos,
const labelHashSet boundaryCells 
) const

Extract lists of all (non-coupled) boundary faces on selected.

cells that can be merged. Uses getFaceRegions.

Definition at line 299 of file combineFaces.C.

References DynamicList::append(), forAllConstIter(), List::setSize(), DynamicList::shrink(), List::size(), and HashTable::size().

Referenced by meshRefinement::mergePatchFaces(), and meshRefinement::mergePatchFacesUndo().

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

◆ getMergeSets() [2/2]

Foam::labelListList getMergeSets ( const scalar  featureCos,
const scalar  minConcaveCos 
) const

Extract lists of all (non-coupled) boundary faces that can.

be merged. Uses getFaceRegions.

Definition at line 383 of file combineFaces.C.

References polyPatch::coupled(), forAll, HashSet< Key, Hash >::insert(), patches, and polyPatch::start().

Here is the call graph for this function:

◆ getOutsideFace()

Foam::face getOutsideFace ( const indirectPrimitivePatch fp)
static

◆ setRefinement()

void setRefinement ( const labelListList faceSets,
polyTopoChange meshMod 
)

Play commands into polyTopoChange to combine faces. Gets.

labelListList of sets of faces to combine. Does no check for whether resulting face is legal.

Definition at line 542 of file combineFaces.C.

References Foam::abort(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeLoops(), f(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, n, Foam::nl, patches, polyTopoChange::setAction(), List::size(), and faceZone::whichFace().

Referenced by meshRefinement::mergePatchFaces(), and meshRefinement::mergePatchFacesUndo().

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

◆ updateMesh()

void updateMesh ( const mapPolyMesh map)

Force recalculation of locally stored data on topological change.

Definition at line 767 of file combineFaces.C.

References Foam::abort(), f(), combineFaces::faceSetsVertices_, Foam::FatalError, FatalErrorInFunction, forAll, Foam::inplaceRenumber(), combineFaces::masterFace_, Foam::nl, mapPolyMesh::reverseFaceMap(), mapPolyMesh::reversePointMap(), and combineFaces::undoable_.

Referenced by meshRefinement::mergePatchFaces(), and meshRefinement::mergePatchFacesUndo().

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

◆ setUnrefinement()

void setUnrefinement ( const labelList masterFaces,
polyTopoChange meshMod,
Map< label > &  restoredPoints,
Map< label > &  restoredFaces,
Map< label > &  restoredCells 
)

Play commands into polyTopoChange to reinsert original faces.

No other topo changes can be done inbetween setRefinement and setUnrefinement. Can be called multiple times to undo parts of the last setRefinement call. Gets the master face labels whose sets need to be restored. Returns maps from added restored point to original point label (i.e. content of savedPointLabels_). (only restoredPoints are actually set; rest are just for generalness)

Definition at line 816 of file combineFaces.C.

References Foam::abort(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, polyTopoChange::setAction(), List::size(), and faceZone::whichFace().

Referenced by meshRefinement::mergePatchFacesUndo().

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

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 60 of file combineFaces.H.

◆ undoable_

const bool undoable_
private

Whether undoable.

Definition at line 63 of file combineFaces.H.

Referenced by combineFaces::updateMesh().

◆ masterFace_

labelList masterFace_
private

If undoable: masterface for every set.

Definition at line 66 of file combineFaces.H.

Referenced by combineFaces::masterFace(), and combineFaces::updateMesh().

◆ faceSetsVertices_

List<faceList> faceSetsVertices_
private

If undoable: per set the vertices of all the faces in the set.

Definition at line 69 of file combineFaces.H.

Referenced by combineFaces::updateMesh().

◆ savedPointLabels_

labelList savedPointLabels_
private

If undoable: saved point labels.

Definition at line 72 of file combineFaces.H.

Referenced by combineFaces::savedPointLabels().

◆ savedPoints_

pointField savedPoints_
private

If undoable: saved coordinates of above points.

Definition at line 75 of file combineFaces.H.


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