Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells due to face removal! Also removes unused points. More...
Public Types | |
enum | collapseType { noCollapse = 0, toPoint = 1, toEdge = 2 } |
Public Member Functions | |
ClassName ("edgeCollapser") | |
Runtime type information. More... | |
edgeCollapser (const polyMesh &mesh) | |
Construct from mesh. More... | |
edgeCollapser (const polyMesh &mesh, const dictionary &dict) | |
Construct from mesh and dict. More... | |
void | consistentCollapse (const globalIndex &globalPoints, const labelList &pointPriority, const Map< point > &collapsePointToLocation, PackedBoolList &collapseEdge, List< pointEdgeCollapse > &allPointInfo, const bool allowCellCollapse=false) const |
Ensure that the collapse is parallel consistent and update. More... | |
bool | setRefinement (const List< pointEdgeCollapse > &allPointInfo, polyTopoChange &meshMod) const |
Play commands into polyTopoChange to create mesh. More... | |
label | markSmallEdges (const scalarField &minEdgeLen, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const |
Mark (in collapseEdge) any edges to collapse. More... | |
label | markMergeEdges (const scalar maxCos, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const |
Mark (in collapseEdge) any edges to merge. More... | |
labelPair | markSmallSliverFaces (const scalarField &faceFilterFactor, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const |
Find small faces and sliver faces in the mesh and mark the. More... | |
labelPair | markFaceZoneEdges (const faceZone &fZone, const scalarField &faceFilterFactor, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const |
Marks edges in the faceZone indirectPatchFaces for collapse. More... | |
Static Public Member Functions | |
static HashSet< label > | checkBadFaces (const polyMesh &mesh, const dictionary &meshQualityDict) |
Calls motionSmoother::checkMesh and returns a set of bad faces. More... | |
static label | checkMeshQuality (const polyMesh &mesh, const dictionary &meshQualityDict, PackedBoolList &isErrorPoint) |
Check mesh and mark points on faces in error. More... | |
Private Member Functions | |
labelList | edgesFromPoints (const label &faceI, const labelList &pointLabels) const |
Create an edgeList of edges in faceI which have both their points. More... | |
void | collapseToEdge (const label faceI, const pointField &pts, const labelList &pointPriority, const vector &collapseAxis, const point &fC, const labelList &facePtsNeg, const labelList &facePtsPos, const scalarList &dNeg, const scalarList &dPos, const scalar dShift, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const |
Collapse a face to an edge, marking the collapsed edges and new. More... | |
void | collapseToPoint (const label &faceI, const pointField &pts, const labelList &pointPriority, const point &fC, const labelList &facePts, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const |
Collapse a face to a point, marking the collapsed edges and new. More... | |
void | faceCollapseAxisAndAspectRatio (const face &f, const point &fC, vector &collapseAxis, scalar &aspectRatio) const |
Do an eigenvector analysis of the face to get its collapse axis. More... | |
scalarField | calcTargetFaceSizes () const |
Return the target length scale for each face. More... | |
collapseType | collapseFace (const labelList &pointPriority, const face &f, const label faceI, const scalar targetFaceSize, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation, const scalarField &faceFilterFactor) const |
Decides whether a face should be collapsed (and if so it it is to a. More... | |
label | edgeMaster (const labelList &pointPriority, const edge &e) const |
Return label of point that has the highest priority. This will be. More... | |
void | checkBoundaryPointMergeEdges (const label pointI, const label otherPointI, const labelList &pointPriority, Map< point > &collapsePointToLocation) const |
Decides which points in an edge to collapse, based on their priority. More... | |
label | breakStringsAtEdges (const PackedBoolList &markedEdges, PackedBoolList &collapseEdge, List< pointEdgeCollapse > &allPointInfo) const |
Helper function that breaks strings of collapses if an edge is not. More... | |
void | determineDuplicatePointsOnFace (const face &f, PackedBoolList &markedPoints, labelHashSet &uniqueCollapses, labelHashSet &duplicateCollapses, List< pointEdgeCollapse > &allPointInfo) const |
Prevent face pinching by finding points in a face that will be. More... | |
label | countEdgesOnFace (const face &f, List< pointEdgeCollapse > &allPointInfo) const |
Count the number of edges on the face that will exist as a result. More... | |
bool | isFaceCollapsed (const face &f, List< pointEdgeCollapse > &allPointInfo) const |
Does the face have fewer than 3 edges as a result of the potential. More... | |
label | syncCollapse (const globalIndex &globalPoints, const labelList &boundaryPoint, const PackedBoolList &collapseEdge, const Map< point > &collapsePointToLocation, List< pointEdgeCollapse > &allPointInfo) const |
Given the collapse information, propagates the information using. More... | |
void | filterFace (const Map< DynamicList< label > > &collapseStrings, const List< pointEdgeCollapse > &allPointInfo, face &f) const |
Renumber f with new vertices. Removes consecutive duplicates. More... | |
edgeCollapser (const edgeCollapser &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const edgeCollapser &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
const polyMesh & | mesh_ |
Reference to mesh. More... | |
const scalar | guardFraction_ |
Controls collapse of a face to an edge. More... | |
const scalar | maxCollapseFaceToPointSideLengthCoeff_ |
Only collapse face to a point if high aspect ratio. More... | |
const Switch | allowEarlyCollapseToPoint_ |
Allow a face to be collapsed to a point early, before the test. More... | |
const scalar | allowEarlyCollapseCoeff_ |
Fraction of maxCollapseFaceToPointSideLengthCoeff_ to use when. More... | |
Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells due to face removal! Also removes unused points.
Definition at line 66 of file edgeCollapser.H.
enum collapseType |
Enumerator | |
---|---|
noCollapse | |
toPoint | |
toEdge |
Definition at line 71 of file edgeCollapser.H.
|
private |
Disallow default bitwise copy construct.
edgeCollapser | ( | const polyMesh & | mesh | ) |
Construct from mesh.
Definition at line 1214 of file edgeCollapser.C.
edgeCollapser | ( | const polyMesh & | mesh, |
const dictionary & | dict | ||
) |
Construct from mesh and dict.
Definition at line 1225 of file edgeCollapser.C.
References Foam::endl(), Foam::Info, and Foam::nl.
|
private |
Create an edgeList of edges in faceI which have both their points.
in pointLabels
Definition at line 121 of file edgeCollapser.C.
References Foam::constant::electromagnetic::e, forAll, pointLabels(), List::setSize(), and List::size().
|
private |
Collapse a face to an edge, marking the collapsed edges and new.
locations for points that will move as a result of the collapse
Definition at line 170 of file edgeCollapser.C.
References DynamicList::append(), DynamicList::clear(), collapseEdge(), forAll, Foam::labelMin, Foam::max(), and List::size().
|
private |
Collapse a face to a point, marking the collapsed edges and new.
locations for points that will move as a result of the collapse
Definition at line 288 of file edgeCollapser.C.
References DynamicList::append(), DynamicList::clear(), collapseEdge(), f(), forAll, and Foam::labelMin.
|
private |
Do an eigenvector analysis of the face to get its collapse axis.
and aspect ratio
Definition at line 390 of file edgeCollapser.C.
References Foam::det(), Foam::constant::electromagnetic::e, Foam::eigenValues(), Foam::eigenVector(), f(), Foam::longestEdge(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::sqrt(), Vector< Cmpt >::x(), and Vector< Cmpt >::y().
|
private |
Return the target length scale for each face.
Definition at line 474 of file edgeCollapser.C.
References polyMesh::boundaryMesh(), primitiveMesh::cellVolumes(), polyPatch::coupled(), polyPatch::faceCells(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, Foam::max(), edgeCollapser::mesh_, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), patches, Foam::pow(), polyPatch::start(), and syncTools::swapBoundaryFaceList().
|
private |
Decides whether a face should be collapsed (and if so it it is to a.
point or an edge)
Definition at line 563 of file edgeCollapser.C.
References collapseEdge(), Foam::endl(), f(), UList< T >::first(), forAll, Foam::inplaceReorder(), Foam::invert(), UList< T >::last(), Foam::magSqr(), List::size(), UList< T >::size(), Foam::sortedOrder(), Foam::sqr(), Foam::toPoint(), WarningInFunction, and Vector< scalar >::zero.
|
private |
Return label of point that has the highest priority. This will be.
the point on the edge that will be collapsed to.
Definition at line 750 of file edgeCollapser.C.
References Foam::e.
|
private |
Decides which points in an edge to collapse, based on their priority.
Definition at line 808 of file edgeCollapser.C.
References points.
|
private |
Helper function that breaks strings of collapses if an edge is not.
labelled to collapse, but its points both collapse to the same location
Definition at line 856 of file edgeCollapser.C.
References collapseEdge(), Foam::e, and forAll.
|
private |
Prevent face pinching by finding points in a face that will be.
collapsed to the same location, but that are not ordered consecutively in the face
Definition at line 918 of file edgeCollapser.C.
References HashTable::clear(), f(), forAll, HashTable::found(), and HashSet< Key, Hash >::insert().
|
private |
Count the number of edges on the face that will exist as a result.
of the collapse
Definition at line 958 of file edgeCollapser.C.
|
private |
Does the face have fewer than 3 edges as a result of the potential.
collapse
Definition at line 992 of file edgeCollapser.C.
References f().
|
private |
Given the collapse information, propagates the information using.
PointEdgeWave. Result is a list of new point locations and indices
Definition at line 1016 of file edgeCollapser.C.
References Foam::abort(), DynamicList::append(), List::clear(), collapseEdge(), Foam::e, Foam::FatalError, FatalErrorInFunction, forAll, Foam::labelMax, Foam::labelMin, List::setSize(), and Vector< scalar >::zero.
|
private |
Renumber f with new vertices. Removes consecutive duplicates.
Definition at line 1122 of file edgeCollapser.C.
References Foam::endl(), f(), Foam::findIndex(), forAll, List::setSize(), and WarningInFunction.
|
private |
Disallow default bitwise assignment.
ClassName | ( | "edgeCollapser" | ) |
Runtime type information.
|
static |
Calls motionSmoother::checkMesh and returns a set of bad faces.
Definition at line 46 of file edgeCollapser.C.
References DynamicList::append(), Foam::polyMeshGenChecks::checkMesh(), Foam::endl(), forAll, Foam::Info, Foam::mag(), and mesh.
|
static |
Check mesh and mark points on faces in error.
Returns boolList with points in error set
Definition at line 82 of file edgeCollapser.C.
References f(), forAll, forAllConstIter(), mesh, Foam::returnReduce(), and HashTable::size().
Referenced by polyMeshFilter::filterEdges(), and polyMeshFilter::filterFacesLoop().
void consistentCollapse | ( | const globalIndex & | globalPoints, |
const labelList & | pointPriority, | ||
const Map< point > & | collapsePointToLocation, | ||
PackedBoolList & | collapseEdge, | ||
List< pointEdgeCollapse > & | allPointInfo, | ||
const bool | allowCellCollapse = false |
||
) | const |
Ensure that the collapse is parallel consistent and update.
allPointInfo. Returns a list of edge collapses that is consistent across coupled boundaries and a list of pointEdgeCollapses.
Definition at line 1637 of file edgeCollapser.C.
References Foam::abort(), cells, collapseEdge(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, Foam::nl, Foam::reduce(), Foam::returnReduce(), List::size(), syncTools::syncEdgeList(), and syncTools::syncPointList().
Referenced by polyMeshFilter::filterEdges(), polyMeshFilter::filterFaces(), and main().
bool setRefinement | ( | const List< pointEdgeCollapse > & | allPointInfo, |
polyTopoChange & | meshMod | ||
) | const |
Play commands into polyTopoChange to create mesh.
Return true if anything changed.
Definition at line 1265 of file edgeCollapser.C.
References boundaryMesh::boundaryMesh(), cells, pointEdgeCollapse::collapseIndex(), Foam::decrIndent(), Foam::endl(), f(), faceZone::flipMap(), forAll, forAllConstIter(), Foam::incrIndent(), Foam::indent(), Foam::Info, polyTopoChange::modifyFace(), polyTopoChange::modifyPoint(), Foam::nl, nPoints, Foam::Pout, Foam::reduce(), polyTopoChange::removeCell(), polyTopoChange::removeFace(), polyTopoChange::removePoint(), List::size(), faceZone::whichFace(), boundaryMesh::whichPatch(), and ZoneMesh::whichZone().
Referenced by polyMeshFilter::filterEdges(), polyMeshFilter::filterFaces(), and main().
Foam::label markSmallEdges | ( | const scalarField & | minEdgeLen, |
const labelList & | pointPriority, | ||
PackedBoolList & | collapseEdge, | ||
Map< point > & | collapsePointToLocation | ||
) | const |
Mark (in collapseEdge) any edges to collapse.
Definition at line 1828 of file edgeCollapser.C.
References Foam::average(), collapseEdge(), Foam::e, forAll, and points.
Referenced by polyMeshFilter::filterEdges().
Foam::label markMergeEdges | ( | const scalar | maxCos, |
const labelList & | pointPriority, | ||
PackedBoolList & | collapseEdge, | ||
Map< point > & | collapsePointToLocation | ||
) | const |
Mark (in collapseEdge) any edges to merge.
Definition at line 1880 of file edgeCollapser.C.
References collapseEdge(), removePoints::countPointUsage(), forAll, Foam::mag(), points, and List::size().
Referenced by polyMeshFilter::filterEdges().
Foam::labelPair markSmallSliverFaces | ( | const scalarField & | faceFilterFactor, |
const labelList & | pointPriority, | ||
PackedBoolList & | collapseEdge, | ||
Map< point > & | collapsePointToLocation | ||
) | const |
Find small faces and sliver faces in the mesh and mark the.
edges that need to be collapsed in order to remove these faces. Also returns a map of new locations for points that will move as a result of the collapse. Use in conjuctions with edgeCollapser to synchronise the collapses and modify the mesh
Definition at line 1967 of file edgeCollapser.C.
References Foam::abort(), collapseEdge(), f(), Foam::FatalError, FatalErrorInFunction, forAll, and Foam::toPoint().
Referenced by polyMeshFilter::filterFaces().
Foam::labelPair markFaceZoneEdges | ( | const faceZone & | fZone, |
const scalarField & | faceFilterFactor, | ||
const labelList & | pointPriority, | ||
PackedBoolList & | collapseEdge, | ||
Map< point > & | collapsePointToLocation | ||
) | const |
Marks edges in the faceZone indirectPatchFaces for collapse.
Definition at line 2028 of file edgeCollapser.C.
References Foam::abort(), collapseEdge(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::toPoint(), and faceZone::whichFace().
|
private |
Reference to mesh.
Definition at line 84 of file edgeCollapser.H.
Referenced by edgeCollapser::calcTargetFaceSizes().
|
private |
Controls collapse of a face to an edge.
Definition at line 87 of file edgeCollapser.H.
|
private |
Only collapse face to a point if high aspect ratio.
Definition at line 90 of file edgeCollapser.H.
|
private |
Allow a face to be collapsed to a point early, before the test.
to collapse to an edge
Definition at line 94 of file edgeCollapser.H.
|
private |
Fraction of maxCollapseFaceToPointSideLengthCoeff_ to use when.
allowEarlyCollapseToPoint_ is on
Definition at line 98 of file edgeCollapser.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.