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

Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface. Used for repatching existing meshes. More...

Collaboration diagram for boundaryMesh:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("boundaryMesh")
 Runtime type information. More...
 
 boundaryMesh ()
 Construct null. More...
 
 ~boundaryMesh ()
 Destructor. More...
 
void clearOut ()
 
const bMeshmesh () const
 
const PtrList< boundaryPatch > & patches () const
 
const labelListmeshFace () const
 Label of original face in polyMesh (before patchify(...)) More...
 
const pointFieldfeaturePoints () const
 Feature points. More...
 
const edgeListfeatureEdges () const
 Feature edges. Indices into featurePoints. More...
 
const labelListfeatureToEdge () const
 From index into featureEdge to index into meshedges,. More...
 
const labelListedgeToFeature () const
 From edge into featureEdges. More...
 
const labelListListfeatureSegments () const
 Lists of connected featureEdges. Indices into featureEdges. More...
 
const labelListextraEdges () 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 &regionEdge, 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

bMeshmeshPtr_
 All boundary mesh data. Reconstructed every time faces are repatched. More...
 
PtrList< boundaryPatchpatches_
 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...
 

Detailed Description

Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface. Used for repatching existing meshes.

Source files

Definition at line 59 of file boundaryMesh.H.

Constructor & Destructor Documentation

◆ boundaryMesh() [1/2]

boundaryMesh ( const boundaryMesh )
private

Disallow default bitwise copy construct.

Referenced by edgeCollapser::setRefinement().

Here is the caller graph for this function:

◆ boundaryMesh() [2/2]

Construct null.

Definition at line 437 of file boundaryMesh.C.

◆ ~boundaryMesh()

Destructor.

Definition at line 453 of file boundaryMesh.C.

Member Function Documentation

◆ nFeatureEdges()

Foam::label nFeatureEdges ( label  pointI) const
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().

Here is the call graph for this function:

◆ nextFeatureEdge()

Foam::label nextFeatureEdge ( const label  edgeI,
const label  vertI 
) const
private

Step to next feature edge.

Definition at line 76 of file boundaryMesh.C.

References forAll, mesh, and primitiveMesh::pointEdges().

Here is the call graph for this function:

◆ collectSegment()

Foam::labelList collectSegment ( const boolList isFeaturePoint,
const label  startEdgeI,
boolList featVisited 
) const
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().

Here is the call graph for this function:

◆ markEdges()

void markEdges ( const label  maxDistance,
const label  edgeI,
const label  distance,
labelList minDistance,
DynamicList< label > &  visited 
) const
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().

Here is the call graph for this function:

◆ findPatchID() [1/2]

Foam::label findPatchID ( const polyPatchList patches,
const word patchName 
) const
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().

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

◆ whichPatch() [1/2]

Foam::label whichPatch ( const polyPatchList patches,
const label  faceI 
) const
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().

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

◆ faceToEdge()

Foam::labelList faceToEdge ( const boolList regionEdge,
const label  region,
const labelList changedFaces,
labelList edgeRegion 
) const
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().

Here is the call graph for this function:

◆ edgeToFace()

Foam::labelList edgeToFace ( const label  region,
const labelList changedEdges,
labelList faceRegion 
) const
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().

Here is the call graph for this function:

◆ markZone()

void markZone ( const boolList borderEdge,
label  faceI,
label  currentZone,
labelList faceZone 
) const
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().

Here is the call graph for this function:

◆ operator=()

void operator= ( const boundaryMesh )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "boundaryMesh"  )

Runtime type information.

◆ clearOut()

void clearOut ( )

Definition at line 459 of file boundaryMesh.C.

◆ mesh()

const bMesh& mesh ( ) const
inline

◆ patches()

const PtrList<boundaryPatch>& patches ( ) const
inline

Definition at line 213 of file boundaryMesh.H.

References boundaryMesh::patches_.

◆ meshFace()

const labelList& meshFace ( ) const
inline

Label of original face in polyMesh (before patchify(...))

Definition at line 220 of file boundaryMesh.H.

References boundaryMesh::meshFace_.

◆ featurePoints()

const pointField& featurePoints ( ) const
inline

Feature points.

Definition at line 226 of file boundaryMesh.H.

References boundaryMesh::featurePoints_.

◆ featureEdges()

const edgeList& featureEdges ( ) const
inline

Feature edges. Indices into featurePoints.

Definition at line 232 of file boundaryMesh.H.

References boundaryMesh::featureEdges_.

◆ featureToEdge()

const labelList& featureToEdge ( ) const
inline

From index into featureEdge to index into meshedges,.

Definition at line 238 of file boundaryMesh.H.

References boundaryMesh::featureToEdge_.

◆ edgeToFeature()

const labelList& edgeToFeature ( ) const
inline

From edge into featureEdges.

Definition at line 244 of file boundaryMesh.H.

References boundaryMesh::edgeToFeature_.

◆ featureSegments()

const labelListList& featureSegments ( ) const
inline

Lists of connected featureEdges. Indices into featureEdges.

Definition at line 250 of file boundaryMesh.H.

References boundaryMesh::featureSegments_.

◆ extraEdges()

const labelList& extraEdges ( ) const
inline

Indices into edges of additional edges.

Definition at line 256 of file boundaryMesh.H.

References boundaryMesh::extraEdges_.

◆ read()

void read ( const polyMesh mesh)

◆ readTriSurface()

void readTriSurface ( const fileName fName)

◆ writeTriSurface()

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().

Here is the call graph for this function:

◆ getNearest()

Foam::labelList getNearest ( const primitiveMesh pMesh,
const vector searchSpan 
) const

◆ patchify()

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().

Here is the call graph for this function:

◆ whichPatch() [2/2]

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().

Here is the call graph for this function:

◆ findPatchID() [2/2]

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().

Here is the call graph for this function:

◆ patchNames()

Foam::wordList patchNames ( ) const

Get names of patches.

Definition at line 271 of file boundaryMesh.C.

References forAll.

◆ addPatch()

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().

Here is the call graph for this function:

◆ deletePatch()

void deletePatch ( const word patchName)

◆ changePatchType()

void changePatchType ( const word patchName,
const word type 
)

◆ changeFaces()

void changeFaces ( const labelList patchIDs,
labelList oldToNew 
)

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().

Here is the call graph for this function:

◆ setFeatureEdges()

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().

Here is the call graph for this function:

◆ setExtraEdges()

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.

◆ getNTris() [1/2]

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.

Here is the call graph for this function:

◆ getNTris() [2/2]

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().

Here is the call graph for this function:

◆ triangulate()

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().

Here is the call graph for this function:

◆ getNPoints()

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.

Here is the call graph for this function:

◆ triangulateLocal()

void triangulateLocal ( const label  startFaceI,
const label  nFaces,
const label  totalNTris,
labelList triVerts,
labelList localToGlobal 
) const

◆ markFaces()

void markFaces ( const labelList protectedEdges,
const label  faceI,
boolList visited 
) const

Definition at line 1969 of file boundaryMesh.C.

References forAll, mesh, and List::setSize().

Here is the call graph for this function:

Field Documentation

◆ splitNormal_

const vector splitNormal_
staticprivate

Normal along which to divide faces into categories.

(used in getNearest)

Definition at line 65 of file boundaryMesh.H.

◆ distanceTol_

const scalar distanceTol_ = 1e-2
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.

◆ meshPtr_

bMesh* meshPtr_
private

All boundary mesh data. Reconstructed every time faces are repatched.

Definition at line 75 of file boundaryMesh.H.

Referenced by boundaryMesh::mesh().

◆ patches_

PtrList<boundaryPatch> patches_
private

Patches. Reconstructed every time faces are repatched.

Definition at line 78 of file boundaryMesh.H.

Referenced by boundaryMesh::patches().

◆ meshFace_

labelList meshFace_
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().

◆ featurePoints_

pointField featurePoints_
private

Points referenced by feature edges.

Definition at line 90 of file boundaryMesh.H.

Referenced by boundaryMesh::featurePoints().

◆ featureEdges_

edgeList featureEdges_
private

Feature edges. Indices into featurePoints.

Definition at line 93 of file boundaryMesh.H.

Referenced by boundaryMesh::featureEdges().

◆ featureToEdge_

labelList featureToEdge_
private

From feature edge to mesh edge.

Definition at line 96 of file boundaryMesh.H.

Referenced by boundaryMesh::featureToEdge().

◆ edgeToFeature_

labelList edgeToFeature_
private

From mesh edges to featureEdges_;.

Definition at line 99 of file boundaryMesh.H.

Referenced by boundaryMesh::edgeToFeature(), and boundaryMesh::nFeatureEdges().

◆ featureSegments_

labelListList featureSegments_
private

Feature 'segments'. Collections of connected featureEdges.

Indices into featureEdges_.

Definition at line 103 of file boundaryMesh.H.

Referenced by boundaryMesh::featureSegments().

◆ extraEdges_

labelList extraEdges_
private

Additional edges (indices of mesh edges)

Definition at line 106 of file boundaryMesh.H.

Referenced by boundaryMesh::extraEdges().


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