Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface. Used for repatching existing meshes. More...
Public Member Functions | |
ClassName ("boundaryMesh") | |
Runtime type information. More... | |
boundaryMesh () | |
Construct null. More... | |
~boundaryMesh () | |
Destructor. More... | |
void | clearOut () |
const bMesh & | mesh () const |
const PtrList< boundaryPatch > & | patches () const |
const labelList & | meshFace () const |
Label of original face in polyMesh (before patchify(...)) More... | |
const pointField & | featurePoints () const |
Feature points. More... | |
const edgeList & | featureEdges () const |
Feature edges. Indices into featurePoints. More... | |
const labelList & | featureToEdge () const |
From index into featureEdge to index into meshedges,. More... | |
const labelList & | edgeToFeature () const |
From edge into featureEdges. More... | |
const labelListList & | featureSegments () const |
Lists of connected featureEdges. Indices into featureEdges. More... | |
const labelList & | extraEdges () const |
Indices into edges of additional edges. More... | |
void | read (const polyMesh &) |
Read from boundaryMesh of polyMesh. More... | |
void | readTriSurface (const fileName &) |
Read from triSurface. More... | |
void | writeTriSurface (const fileName &) const |
Write to file. More... | |
labelList | getNearest (const primitiveMesh &pMesh, const vector &searchSpan) const |
Get bMesh index of nearest face for every boundary face in. More... | |
void | patchify (const labelList &nearest, const polyBoundaryMesh &oldPatches, polyMesh &newMesh) const |
Take over patches onto polyMesh from nearest face in *this. More... | |
label | whichPatch (const label faceI) const |
Get index of patch face is in. More... | |
label | findPatchID (const word &patchName) const |
Get index of patch by name. More... | |
wordList | patchNames () const |
Get names of patches. More... | |
void | addPatch (const word &patchName) |
Add to back of patch list. More... | |
void | deletePatch (const word &patchName) |
Delete from patch list. More... | |
void | changePatchType (const word &patchName, const word &type) |
Change patch. More... | |
void | changeFaces (const labelList &patchIDs, labelList &oldToNew) |
Recalculate face ordering and patches. Return old to new. More... | |
void | setFeatureEdges (const scalar minCos) |
Set featureEdges, edgeToFeature, featureSegments according. More... | |
void | setExtraEdges (const label edgeI) |
Set extraEdges to edges 'near' to edgeI. Uses point-edge walk. More... | |
label | getNTris (const label faceI) const |
Simple triangulation of face subset. Returns number of triangles. More... | |
label | getNTris (const label startFaceI, const label nFaces, labelList &nTris) const |
Simple triangulation of face subset. TotalNTris is total number. More... | |
void | triangulate (const label startFaceI, const label nFaces, const label totalNTris, labelList &triVerts) const |
Simple triangulation of face subset. TotalNTris is total number. More... | |
label | getNPoints (const label startFaceI, const label nFaces) const |
Number of points used in face subset. More... | |
void | triangulateLocal (const label startFaceI, const label nFaces, const label totalNTris, labelList &triVerts, labelList &localToGlobal) const |
Same as triangulate but in local vertex numbering. More... | |
void | markFaces (const labelList &protectedEdges, const label faceI, boolList &visited) const |
Private Member Functions | |
label | nFeatureEdges (label pointI) const |
Number of connected feature edges. More... | |
label | nextFeatureEdge (const label edgeI, const label vertI) const |
Step to next feature edge. More... | |
labelList | collectSegment (const boolList &isFeaturePoint, const label startEdgeI, boolList &featVisited) const |
Return connected list of feature edges. More... | |
void | markEdges (const label maxDistance, const label edgeI, const label distance, labelList &minDistance, DynamicList< label > &visited) const |
Do point-edge walk to determine nearest (to edgeI). Stops if. More... | |
label | findPatchID (const polyPatchList &, const word &) const |
Get index of polypatch by name. More... | |
label | whichPatch (const polyPatchList &, const label) const |
Get index of patch for face. More... | |
labelList | faceToEdge (const boolList ®ionEdge, const label region, const labelList &changedFaces, labelList &edgeRegion) const |
Gets labels of changed faces and propagates them to the edges. More... | |
labelList | edgeToFace (const label region, const labelList &changedEdges, labelList &faceRegion) const |
Reverse of faceToEdge: gets edges and returns faces. More... | |
void | markZone (const boolList &borderEdge, label faceI, label currentZone, labelList &faceZone) const |
Finds area, starting at faceI, delimited by borderEdge. Marks all. More... | |
boundaryMesh (const boundaryMesh &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const boundaryMesh &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
bMesh * | meshPtr_ |
All boundary mesh data. Reconstructed every time faces are repatched. More... | |
PtrList< boundaryPatch > | patches_ |
Patches. Reconstructed every time faces are repatched. More... | |
labelList | meshFace_ |
For every face in mesh() gives corresponding polyMesh face. More... | |
pointField | featurePoints_ |
Points referenced by feature edges. More... | |
edgeList | featureEdges_ |
Feature edges. Indices into featurePoints. More... | |
labelList | featureToEdge_ |
From feature edge to mesh edge. More... | |
labelList | edgeToFeature_ |
From mesh edges to featureEdges_;. More... | |
labelListList | featureSegments_ |
Feature 'segments'. Collections of connected featureEdges. More... | |
labelList | extraEdges_ |
Additional edges (indices of mesh edges) More... | |
Static Private Attributes | |
static const vector | splitNormal_ |
Normal along which to divide faces into categories. More... | |
static const scalar | distanceTol_ = 1e-2 |
Distance to face tolerance for getNearest. Triangles are considered. More... | |
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface. Used for repatching existing meshes.
Definition at line 59 of file boundaryMesh.H.
|
private |
Disallow default bitwise copy construct.
Referenced by edgeCollapser::setRefinement().
boundaryMesh | ( | ) |
Construct null.
Definition at line 437 of file boundaryMesh.C.
~boundaryMesh | ( | ) |
Destructor.
Definition at line 453 of file boundaryMesh.C.
|
private |
Number of connected feature edges.
Definition at line 55 of file boundaryMesh.C.
References boundaryMesh::edgeToFeature_, forAll, boundaryMesh::mesh(), and PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges().
|
private |
Step to next feature edge.
Definition at line 76 of file boundaryMesh.C.
References forAll, mesh, and primitiveMesh::pointEdges().
|
private |
Return connected list of feature edges.
Definition at line 106 of file boundaryMesh.C.
References Foam::abort(), Foam::e, primitiveMesh::edges(), Foam::FatalError, FatalErrorInFunction, mesh, and List::setSize().
|
private |
Do point-edge walk to determine nearest (to edgeI). Stops if.
distance >= maxDistance. Used to determine edges close to seed point.
Definition at line 193 of file boundaryMesh.C.
References DynamicList::append(), Foam::distance(), Foam::e, primitiveMesh::edges(), forAll, mesh, and primitiveMesh::pointEdges().
|
private |
Get index of polypatch by name.
Definition at line 254 of file boundaryMesh.C.
References forAll, Foam::name(), and patches.
Referenced by pointBoundaryMesh::findPatchID(), cyclicAMIPolyPatch::neighbPatchID(), cyclicPolyPatch::neighbPatchID(), cyclicACMIPolyPatch::nonOverlapPatchID(), and cyclicPeriodicAMIPolyPatch::periodicPatchID().
|
private |
Get index of patch for face.
Definition at line 284 of file boundaryMesh.C.
References forAll, patches, and polyPatch::start().
Referenced by dynamicRefineFvMesh::refine(), edgeCollapser::setRefinement(), and dynamicRefineFvMesh::unrefine().
|
private |
Gets labels of changed faces and propagates them to the edges.
Returns labels of edges changed. Fills edgeRegion of visited edges with current region.
Definition at line 305 of file boundaryMesh.C.
References primitiveMesh::faceEdges(), forAll, mesh, and List::setSize().
|
private |
Reverse of faceToEdge: gets edges and returns faces.
Definition at line 342 of file boundaryMesh.C.
References primitiveMesh::edgeFaces(), forAll, mesh, and List::setSize().
|
private |
Finds area, starting at faceI, delimited by borderEdge. Marks all.
faces thus visited with currentZone.
Definition at line 378 of file boundaryMesh.C.
References Foam::endl(), mesh, Foam::Pout, and List::size().
|
private |
Disallow default bitwise assignment.
ClassName | ( | "boundaryMesh" | ) |
Runtime type information.
void clearOut | ( | ) |
Definition at line 459 of file boundaryMesh.C.
|
inline |
Definition at line 202 of file boundaryMesh.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and boundaryMesh::meshPtr_.
Referenced by fvPatch::Cf(), fvPatch::Cn(), fvPatch::deltaCoeffs(), fvPatch::magSf(), boundaryMesh::nFeatureEdges(), cyclicPeriodicAMIPolyPatch::resetAMI(), cyclicAMIPolyPatch::resetAMI(), fvPatch::Sf(), cyclicAMIPolyPatch::surfPtr(), and fvPatch::weights().
|
inline |
Definition at line 213 of file boundaryMesh.H.
References boundaryMesh::patches_.
|
inline |
Label of original face in polyMesh (before patchify(...))
Definition at line 220 of file boundaryMesh.H.
References boundaryMesh::meshFace_.
|
inline |
Feature points.
Definition at line 226 of file boundaryMesh.H.
References boundaryMesh::featurePoints_.
|
inline |
Feature edges. Indices into featurePoints.
Definition at line 232 of file boundaryMesh.H.
References boundaryMesh::featureEdges_.
|
inline |
From index into featureEdge to index into meshedges,.
Definition at line 238 of file boundaryMesh.H.
References boundaryMesh::featureToEdge_.
|
inline |
From edge into featureEdges.
Definition at line 244 of file boundaryMesh.H.
References boundaryMesh::edgeToFeature_.
|
inline |
Lists of connected featureEdges. Indices into featureEdges.
Definition at line 250 of file boundaryMesh.H.
References boundaryMesh::featureSegments_.
|
inline |
Indices into edges of additional edges.
Definition at line 256 of file boundaryMesh.H.
References boundaryMesh::extraEdges_.
void read | ( | const polyMesh & | mesh | ) |
Read from boundaryMesh of polyMesh.
Definition at line 472 of file boundaryMesh.C.
References polyMesh::boundaryMesh(), Foam::endl(), f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, patchIdentifier::name(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), patchIdentifier::physicalType(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), polyMesh::points(), Foam::Pout, PtrList::set(), List::size(), boundaryPatch::size(), PtrList::size(), boundaryPatch::start(), polyPatch::start(), and Vector< scalar >::zero.
void readTriSurface | ( | const fileName & | fName | ) |
Read from triSurface.
Definition at line 602 of file boundaryMesh.C.
References List::clear(), Foam::endl(), forAll, geometricSurfacePatch::geometricType(), SortableList::indices(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), OSstream::name(), geometricSurfacePatch::name(), Foam::name(), triSurface::patches(), Foam::Pout, labelledTri::region(), List::setSize(), List::size(), boundaryPatch::size(), SortableList::sort(), and boundaryPatch::start().
void writeTriSurface | ( | const fileName & | fName | ) | const |
Write to file.
Definition at line 771 of file boundaryMesh.C.
References forAll, mesh, patchIdentifier::name(), patchIdentifier::physicalType(), points, boundaryPatch::start(), and triSurface::write().
Foam::labelList getNearest | ( | const primitiveMesh & | pMesh, |
const vector & | searchSpan | ||
) | const |
Get bMesh index of nearest face for every boundary face in.
pMesh. Gets passed initial search box. If not found returns -1 for the face.
Definition at line 861 of file boundaryMesh.C.
References DynamicList::append(), boundBox::avgDim(), Foam::e, Foam::endl(), f(), primitiveMesh::faceAreas(), primitiveMesh::faceCentres(), primitiveMesh::faces(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::mag(), Foam::magSqr(), boundBox::max(), Foam::max(), mesh, boundBox::min(), n, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), points, primitiveMesh::points(), Foam::Pout, DynamicList::shrink(), Foam::sign(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
void patchify | ( | const labelList & | nearest, |
const polyBoundaryMesh & | oldPatches, | ||
polyMesh & | newMesh | ||
) | const |
Take over patches onto polyMesh from nearest face in *this.
(from call to getNearest). Insert as -new set of patches (newMesh.addPatches) -topoChanges to change faces. nearest is list of nearest face in *this for every boundary face. oldPatches is list of existing patches in mesh. newMesh is the mesh to which the new patches are added. (so has to be constructed without patches).
Definition at line 1116 of file boundaryMesh.C.
References List::append(), polyMesh::boundaryMesh(), repatchPolyTopoChanger::changePatches(), repatchPolyTopoChanger::changePatchID(), polyPatch::clone(), Foam::endl(), findPatchID(), forAll, HashTable::found(), HashTable::insert(), patchIdentifier::name(), polyPatch::New(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), patchFaces(), pFaces, patchIdentifier::physicalType(), Foam::Pout, repatchPolyTopoChanger::repatch(), List::size(), and polyPatch::start().
Foam::label whichPatch | ( | const label | faceI | ) | const |
Get index of patch face is in.
Definition at line 1535 of file boundaryMesh.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, boundaryPatch::size(), and boundaryPatch::start().
Foam::label findPatchID | ( | const word & | patchName | ) | const |
Get index of patch by name.
Definition at line 1556 of file boundaryMesh.C.
References forAll, and Foam::name().
Foam::wordList patchNames | ( | ) | const |
void addPatch | ( | const word & | patchName | ) |
Add to back of patch list.
Definition at line 1570 of file boundaryMesh.C.
References Foam::endl(), forAll, mesh, patchIdentifier::name(), patchIdentifier::physicalType(), Foam::Pout, boundaryPatch::size(), and boundaryPatch::start().
void deletePatch | ( | const word & | patchName | ) |
Delete from patch list.
Definition at line 1607 of file boundaryMesh.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, findPatchID(), forAll, patchIdentifier::name(), patchIdentifier::physicalType(), Foam::Pout, PtrList::set(), boundaryPatch::size(), and boundaryPatch::start().
Change patch.
Definition at line 1663 of file boundaryMesh.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, findPatchID(), forAll, patchIdentifier::index(), patchIdentifier::name(), PtrList::set(), boundaryPatch::size(), and boundaryPatch::start().
Recalculate face ordering and patches. Return old to new.
mapping.
Definition at line 1714 of file boundaryMesh.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, mesh, patchIdentifier::name(), patchIdentifier::physicalType(), points, Foam::Pout, PtrList::set(), List::setSize(), List::size(), boundaryPatch::size(), HashTable::size(), and boundaryPatch::start().
void setFeatureEdges | ( | const scalar | minCos | ) |
Set featureEdges, edgeToFeature, featureSegments according.
to angle of faces across edge
Definition at line 1319 of file boundaryMesh.C.
References DynamicList::append(), Foam::e, primitiveMesh::edgeFaces(), primitiveMesh::edges(), forAll, mesh, nPoints, polyMesh::points(), and List::size().
void setExtraEdges | ( | const label | edgeI | ) |
Set extraEdges to edges 'near' to edgeI. Uses point-edge walk.
to determine 'near'.
Definition at line 1520 of file boundaryMesh.C.
References mesh.
Foam::label getNTris | ( | const label | faceI | ) | const |
Simple triangulation of face subset. Returns number of triangles.
needed.
Definition at line 1832 of file boundaryMesh.C.
References f(), mesh, and points.
Foam::label getNTris | ( | const label | startFaceI, |
const label | nFaces, | ||
labelList & | nTris | ||
) | const |
Simple triangulation of face subset. TotalNTris is total number.
of triangles, nTris is per face number of triangles.
Definition at line 1841 of file boundaryMesh.C.
References List::setSize().
void triangulate | ( | const label | startFaceI, |
const label | nFaces, | ||
const label | totalNTris, | ||
labelList & | triVerts | ||
) | const |
Simple triangulation of face subset. TotalNTris is total number.
of triangles (from call to getNTris) triVerts is triangle vertices, three per triangle.
Definition at line 1866 of file boundaryMesh.C.
References f(), forAll, mesh, points, and List::setSize().
Foam::label getNPoints | ( | const label | startFaceI, |
const label | nFaces | ||
) | const |
Number of points used in face subset.
Definition at line 1907 of file boundaryMesh.C.
References mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), patchFaces(), and points.
void triangulateLocal | ( | const label | startFaceI, |
const label | nFaces, | ||
const label | totalNTris, | ||
labelList & | triVerts, | ||
labelList & | localToGlobal | ||
) | const |
Same as triangulate but in local vertex numbering.
(Map returned).
Definition at line 1922 of file boundaryMesh.C.
References f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), patchFaces(), points, and List::setSize().
Definition at line 1969 of file boundaryMesh.C.
References forAll, mesh, and List::setSize().
|
staticprivate |
Normal along which to divide faces into categories.
(used in getNearest)
Definition at line 65 of file boundaryMesh.H.
|
staticprivate |
Distance to face tolerance for getNearest. Triangles are considered.
near if they are nearer than distanceTol_*typDim where typDim is the largest distance from face centre to one of its vertices.
Definition at line 70 of file boundaryMesh.H.
|
private |
All boundary mesh data. Reconstructed every time faces are repatched.
Definition at line 75 of file boundaryMesh.H.
Referenced by boundaryMesh::mesh().
|
private |
Patches. Reconstructed every time faces are repatched.
Definition at line 78 of file boundaryMesh.H.
Referenced by boundaryMesh::patches().
|
private |
For every face in mesh() gives corresponding polyMesh face.
(not sensible if mesh read from triSurface)
Definition at line 82 of file boundaryMesh.H.
Referenced by boundaryMesh::meshFace().
|
private |
Points referenced by feature edges.
Definition at line 90 of file boundaryMesh.H.
Referenced by boundaryMesh::featurePoints().
|
private |
Feature edges. Indices into featurePoints.
Definition at line 93 of file boundaryMesh.H.
Referenced by boundaryMesh::featureEdges().
|
private |
From feature edge to mesh edge.
Definition at line 96 of file boundaryMesh.H.
Referenced by boundaryMesh::featureToEdge().
|
private |
From mesh edges to featureEdges_;.
Definition at line 99 of file boundaryMesh.H.
Referenced by boundaryMesh::edgeToFeature(), and boundaryMesh::nFeatureEdges().
|
private |
Feature 'segments'. Collections of connected featureEdges.
Indices into featureEdges_.
Definition at line 103 of file boundaryMesh.H.
Referenced by boundaryMesh::featureSegments().
|
private |
Additional edges (indices of mesh edges)
Definition at line 106 of file boundaryMesh.H.
Referenced by boundaryMesh::extraEdges().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.