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

Remove the edges and faces of a polyMesh whilst satisfying the given mesh quality criteria. More...

Inheritance diagram for polyMeshFilter:
Inheritance graph
[legend]
Collaboration diagram for polyMeshFilter:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("polyMeshFilter")
 Runtime type information. More...
 
 polyMeshFilter (const fvMesh &mesh)
 Construct from fvMesh. More...
 
 polyMeshFilter (const fvMesh &mesh, const labelList &pointPriority)
 Construct from fvMesh and a label list of point priorities. More...
 
 ~polyMeshFilter ()
 Destructor. More...
 
const autoPtr< fvMesh > & filteredMesh () const
 Return reference to the filtered mesh. Does not check if the. More...
 
const autoPtr< labelList > & pointPriority () const
 Return the new pointPriority list. More...
 
label filter (const label nOriginalBadFaces)
 Filter edges and faces. More...
 
label filter (const faceSet &fSet)
 Filter all faces that are in the face set. More...
 
label filterEdges (const label nOriginalBadFaces)
 Filter edges only. More...
 

Static Public Member Functions

static autoPtr< fvMeshcopyMesh (const fvMesh &mesh)
 Return a copy of an fvMesh. More...
 
static void copySets (const polyMesh &oldMesh, const polyMesh &newMesh)
 Copy loaded topoSets from the old mesh to the new mesh. More...
 
static void updateSets (const mapPolyMesh &map)
 Update the loaded topoSets. More...
 

Private Member Functions

label filterFacesLoop (const label nOriginalBadFaces)
 
label filterFaces (polyMesh &newMesh, scalarField &newMeshFaceFilterFactor, labelList &origToCurrentPointMap)
 
label filterEdges (polyMesh &newMesh, scalarField &newMeshMinEdgeLen, labelList &origToCurrentPointMap)
 
void updatePointErrorCount (const PackedBoolList &isErrorPoint, const labelList &oldToNewMesh, labelList &pointErrorCount) const
 Increment pointErrorCount for points attached to a bad face. More...
 
void checkMeshEdgesAndRelaxEdges (const polyMesh &newMesh, const labelList &oldToNewMesh, const PackedBoolList &isErrorPoint, const labelList &pointErrorCount)
 Given the new points that are part of bad faces, and a map from the. More...
 
void checkMeshFacesAndRelaxEdges (const polyMesh &newMesh, const labelList &oldToNewMesh, const PackedBoolList &isErrorPoint, const labelList &pointErrorCount)
 Given the new points that are part of bad faces, and a map from the. More...
 
void updatePointPriorities (const polyMesh &newMesh, const labelList &pointMap)
 
void printScalarFieldStats (const string desc, const scalarField &fld) const
 Print min/mean/max data for a field. More...
 
void mapOldMeshEdgeFieldToNewMesh (const polyMesh &newMesh, const labelList &pointMap, scalarField &newMeshMinEdgeLen) const
 Update minEdgeLen_ for the new mesh based upon the movement of the. More...
 
void mapOldMeshFaceFieldToNewMesh (const polyMesh &newMesh, const labelList &faceMap, scalarField &newMeshFaceFilterFactor) const
 Update faceFilterFactor_ for the new mesh based upon the movement. More...
 
void updateOldToNewPointMap (const labelList &currToNew, labelList &origToCurrentPointMap) const
 Maintain a map of the original mesh points to the latest version of. More...
 
 polyMeshFilter (const polyMeshFilter &)
 Disallow default bitwise copy construct. More...
 
void operator= (const polyMeshFilter &)
 Disallow default bitwise assignment. More...
 
- Private Member Functions inherited from polyMeshFilterSettings
 polyMeshFilterSettings (const dictionary &dict)
 Construct from dictionary. More...
 
 ~polyMeshFilterSettings ()
 Destructor. More...
 
const dictionarycollapseEdgesCoeffDict () const
 
const dictionarycollapseFacesCoeffDict () const
 
const dictionarymeshQualityCoeffDict () const
 
const SwitchcontrolMeshQuality () const
 
const scalar & minLen () const
 
const scalar & maxCos () const
 
const scalar & edgeReductionFactor () const
 
const labelmaxIterations () const
 
const labelmaxSmoothIters () const
 
const scalar & initialFaceLengthFactor () const
 
const scalar & faceReductionFactor () const
 
const labelmaxPointErrorCount () const
 
void writeSettings (Ostream &os) const
 Write the settings to a stream. More...
 

Static Private Member Functions

template<typename T >
static void updateSets (const mapPolyMesh &map)
 
template<typename T >
static void copySets (const polyMesh &oldMesh, const polyMesh &newMesh)
 

Private Attributes

const fvMeshmesh_
 Reference to the original mesh. More...
 
autoPtr< fvMeshnewMeshPtr_
 Copy of the original mesh to perform the filtering on. More...
 
labelList originalPointPriority_
 Original point priorities. If a point has a higher priority than. More...
 
autoPtr< labelListpointPriority_
 Point priority associated with the new mesh. More...
 
scalarField minEdgeLen_
 The minimum edge length for each edge. More...
 
scalarField faceFilterFactor_
 The face filter factor for each face. More...
 

Detailed Description

Remove the edges and faces of a polyMesh whilst satisfying the given mesh quality criteria.

Works on a copy of the mesh.

Source files

Definition at line 62 of file polyMeshFilter.H.

Constructor & Destructor Documentation

◆ polyMeshFilter() [1/3]

polyMeshFilter ( const polyMeshFilter )
private

Disallow default bitwise copy construct.

◆ polyMeshFilter() [2/3]

polyMeshFilter ( const fvMesh mesh)
explicit

Construct from fvMesh.

Definition at line 892 of file polyMeshFilter.C.

References Foam::Info, and polyMeshFilterSettings::writeSettings().

Here is the call graph for this function:

◆ polyMeshFilter() [3/3]

polyMeshFilter ( const fvMesh mesh,
const labelList pointPriority 
)

Construct from fvMesh and a label list of point priorities.

Definition at line 920 of file polyMeshFilter.C.

References Foam::Info.

◆ ~polyMeshFilter()

Destructor.

Definition at line 952 of file polyMeshFilter.C.

Member Function Documentation

◆ updateSets() [1/2]

void updateSets ( const mapPolyMesh map)
staticprivate

◆ copySets() [1/2]

void copySets ( const polyMesh oldMesh,
const polyMesh newMesh 
)
staticprivate

Definition at line 71 of file polyMeshFilterTemplates.C.

References forAllConstIter(), and IOobject::name().

Here is the call graph for this function:

◆ filterFacesLoop()

Foam::label filterFacesLoop ( const label  nOriginalBadFaces)
private

◆ filterFaces()

Foam::label filterFaces ( polyMesh newMesh,
scalarField newMeshFaceFilterFactor,
labelList origToCurrentPointMap 
)
private

◆ filterEdges() [1/2]

Foam::label filterEdges ( polyMesh newMesh,
scalarField newMeshMinEdgeLen,
labelList origToCurrentPointMap 
)
private

◆ updatePointErrorCount()

void updatePointErrorCount ( const PackedBoolList isErrorPoint,
const labelList oldToNewMesh,
labelList pointErrorCount 
) const
private

Increment pointErrorCount for points attached to a bad face.

Definition at line 530 of file polyMeshFilter.C.

References forAll.

◆ checkMeshEdgesAndRelaxEdges()

void checkMeshEdgesAndRelaxEdges ( const polyMesh newMesh,
const labelList oldToNewMesh,
const PackedBoolList isErrorPoint,
const labelList pointErrorCount 
)
private

Given the new points that are part of bad faces, and a map from the.

old mesh points to the new mesh points, relax minEdgeLen_

Definition at line 547 of file polyMeshFilter.C.

References Foam::e, forAll, Foam::min(), and syncTools::syncEdgeList().

Here is the call graph for this function:

◆ checkMeshFacesAndRelaxEdges()

void checkMeshFacesAndRelaxEdges ( const polyMesh newMesh,
const labelList oldToNewMesh,
const PackedBoolList isErrorPoint,
const labelList pointErrorCount 
)
private

Given the new points that are part of bad faces, and a map from the.

old mesh points to the new mesh points, relax faceFilterFactor_

Definition at line 624 of file polyMeshFilter.C.

References f(), forAll, Foam::min(), and syncTools::syncFaceList().

Here is the call graph for this function:

◆ updatePointPriorities()

void updatePointPriorities ( const polyMesh newMesh,
const labelList pointMap 
)
private

Definition at line 719 of file polyMeshFilter.C.

References forAll, Foam::labelMin, Foam::max(), primitiveMesh::nPoints(), and syncTools::syncPointList().

Here is the call graph for this function:

◆ printScalarFieldStats()

void printScalarFieldStats ( const string  desc,
const scalarField fld 
) const
private

Print min/mean/max data for a field.

Definition at line 748 of file polyMeshFilter.C.

References Foam::decrIndent(), Foam::endl(), fld(), forAll, Foam::incrIndent(), Foam::indent(), Foam::Info, Foam::max(), Foam::min(), Foam::nl, Foam::reduce(), Foam::returnReduce(), and Foam::sum().

Here is the call graph for this function:

◆ mapOldMeshEdgeFieldToNewMesh()

void mapOldMeshEdgeFieldToNewMesh ( const polyMesh newMesh,
const labelList pointMap,
scalarField newMeshMinEdgeLen 
) const
private

Update minEdgeLen_ for the new mesh based upon the movement of the.

old points to the new points

Definition at line 797 of file polyMeshFilter.C.

References primitiveMesh::edges(), edge::end(), forAll, Foam::min(), primitiveMesh::nEdges(), edge::start(), and syncTools::syncEdgeList().

Here is the call graph for this function:

◆ mapOldMeshFaceFieldToNewMesh()

void mapOldMeshFaceFieldToNewMesh ( const polyMesh newMesh,
const labelList faceMap,
scalarField newMeshFaceFilterFactor 
) const
private

Update faceFilterFactor_ for the new mesh based upon the movement.

of the old faces to the new faces

Definition at line 833 of file polyMeshFilter.C.

References Foam::faceMap(), forAll, primitiveMesh::nFaces(), and syncTools::syncFaceList().

Here is the call graph for this function:

◆ updateOldToNewPointMap()

void updateOldToNewPointMap ( const labelList currToNew,
labelList origToCurrentPointMap 
) const
private

Maintain a map of the original mesh points to the latest version of.

the filtered mesh.

Definition at line 860 of file polyMeshFilter.C.

References forAll.

◆ operator=()

void operator= ( const polyMeshFilter )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "polyMeshFilter"  )

Runtime type information.

◆ filteredMesh()

const Foam::autoPtr< Foam::fvMesh > & filteredMesh ( ) const

Return reference to the filtered mesh. Does not check if the.

mesh has actually been filtered.

Definition at line 1107 of file polyMeshFilter.C.

◆ pointPriority()

const Foam::autoPtr< Foam::labelList > & pointPriority ( ) const

Return the new pointPriority list.

Definition at line 1114 of file polyMeshFilter.C.

◆ copyMesh()

Foam::autoPtr< Foam::fvMesh > copyMesh ( const fvMesh mesh)
static

Return a copy of an fvMesh.

Definition at line 67 of file polyMeshFilter.C.

References mapPolyMesh::hasMotionPoints(), polyTopoChange::makeMesh(), mesh, fvMesh::name(), IOobject::NO_READ, IOobject::NO_WRITE, mapPolyMesh::preMotionPoints(), and fvMesh::time().

Here is the call graph for this function:

◆ copySets() [2/2]

void copySets ( const polyMesh oldMesh,
const polyMesh newMesh 
)
static

Copy loaded topoSets from the old mesh to the new mesh.

Definition at line 56 of file polyMeshFilter.C.

◆ updateSets() [2/2]

void updateSets ( const mapPolyMesh map)
static

Update the loaded topoSets.

Definition at line 47 of file polyMeshFilter.C.

◆ filter() [1/2]

Foam::label filter ( const label  nOriginalBadFaces)

Filter edges and faces.

Definition at line 958 of file polyMeshFilter.C.

◆ filter() [2/2]

Foam::label filter ( const faceSet fSet)

Filter all faces that are in the face set.

Definition at line 967 of file polyMeshFilter.C.

References forAll, and HashTable::found().

Here is the call graph for this function:

◆ filterEdges() [2/2]

Foam::label filterEdges ( const label  nOriginalBadFaces)

Field Documentation

◆ mesh_

const fvMesh& mesh_
private

Reference to the original mesh.

Definition at line 69 of file polyMeshFilter.H.

◆ newMeshPtr_

autoPtr<fvMesh> newMeshPtr_
private

Copy of the original mesh to perform the filtering on.

Definition at line 72 of file polyMeshFilter.H.

◆ originalPointPriority_

labelList originalPointPriority_
private

Original point priorities. If a point has a higher priority than.

another point then the edge between them collapses towards the point with the higher priority. (e.g. 2 is a higher priority than 1)

Definition at line 77 of file polyMeshFilter.H.

◆ pointPriority_

autoPtr<labelList> pointPriority_
private

Point priority associated with the new mesh.

Definition at line 80 of file polyMeshFilter.H.

◆ minEdgeLen_

scalarField minEdgeLen_
private

The minimum edge length for each edge.

Definition at line 83 of file polyMeshFilter.H.

◆ faceFilterFactor_

scalarField faceFilterFactor_
private

The face filter factor for each face.

Definition at line 86 of file polyMeshFilter.H.


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