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

Public Member Functions

 ClassName ("boundaryMesh")
 Runtime type information. More...
 
 boundaryMesh ()
 Default construct. More...
 
 ~boundaryMesh ()=default
 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
 

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 62 of file boundaryMesh.H.

Constructor & Destructor Documentation

◆ boundaryMesh()

Default construct.

Definition at line 440 of file boundaryMesh.C.

◆ ~boundaryMesh()

~boundaryMesh ( )
default

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "boundaryMesh"  )

Runtime type information.

◆ clearOut()

void clearOut ( )

Definition at line 456 of file boundaryMesh.C.

◆ mesh()

◆ patches()

const PtrList<boundaryPatch>& patches ( ) const
inline

Definition at line 217 of file boundaryMesh.H.

◆ meshFace()

const labelList& meshFace ( ) const
inline

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

Definition at line 224 of file boundaryMesh.H.

◆ featurePoints()

const pointField& featurePoints ( ) const
inline

Feature points.

Definition at line 230 of file boundaryMesh.H.

◆ featureEdges()

const edgeList& featureEdges ( ) const
inline

Feature edges. Indices into featurePoints.

Definition at line 236 of file boundaryMesh.H.

◆ featureToEdge()

const labelList& featureToEdge ( ) const
inline

From index into featureEdge to index into meshedges,.

Definition at line 242 of file boundaryMesh.H.

◆ edgeToFeature()

const labelList& edgeToFeature ( ) const
inline

From edge into featureEdges.

Definition at line 248 of file boundaryMesh.H.

◆ featureSegments()

const labelListList& featureSegments ( ) const
inline

Lists of connected featureEdges. Indices into featureEdges.

Definition at line 254 of file boundaryMesh.H.

◆ extraEdges()

const labelList& extraEdges ( ) const
inline

Indices into edges of additional edges.

Definition at line 260 of file boundaryMesh.H.

◆ read()

void read ( const polyMesh mesh)

◆ readTriSurface()

◆ writeTriSurface()

void writeTriSurface ( const fileName fName) const

Write to file.

Definition at line 757 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 1102 of file boundaryMesh.C.

References List< T >::append(), polyMesh::boundaryMesh(), repatchPolyTopoChanger::changePatches(), repatchPolyTopoChanger::changePatchID(), polyPatch::clone(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, patchIdentifier::name(), primitiveMesh::nBoundaryFaces(), polyPatch::New(), primitiveMesh::nInternalFaces(), Foam::foamVersion::patch, pFaces, patchIdentifier::physicalType(), Foam::Pout, repatchPolyTopoChanger::repatch(), and polyPatch::start().

Here is the call graph for this function:

◆ whichPatch()

Foam::label whichPatch ( const label  facei) const

Get index of patch face is in.

Definition at line 1519 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()

Foam::label findPatchID ( const word patchName) const

Get index of patch by name.

Definition at line 1540 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 275 of file boundaryMesh.C.

References forAll, and Foam::PtrListOps::names().

Here is the call graph for this function:

◆ addPatch()

void addPatch ( const word patchName)

Add to back of patch list.

Definition at line 1554 of file boundaryMesh.C.

References Foam::expressions::patchExpr::debug, 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)

Delete from patch list.

Definition at line 1591 of file boundaryMesh.C.

References Foam::abort(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, patchIdentifier::name(), patchIdentifier::physicalType(), Foam::Pout, PtrList< T >::set(), boundaryPatch::size(), and boundaryPatch::start().

Here is the call graph for this function:

◆ changePatchType()

void changePatchType ( const word patchName,
const word type 
)

Change patch.

Definition at line 1647 of file boundaryMesh.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, patchIdentifier::index(), patchIdentifier::name(), boundaryPatch::size(), and boundaryPatch::start().

Here is the call graph for this function:

◆ changeFaces()

void changeFaces ( const labelList patchIDs,
labelList oldToNew 
)

Recalculate face ordering and patches. Return old to new.

mapping.

Definition at line 1698 of file boundaryMesh.C.

References Foam::abort(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, mesh, patchIdentifier::name(), patchID, patchIdentifier::physicalType(), points, Foam::Pout, List< T >::setSize(), boundaryPatch::size(), HashTable< T, Key, Hash >::size(), boundaryPatch::start(), and Foam::Zero.

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 1303 of file boundaryMesh.C.

References DynamicList< T, SizeMin >::append(), Foam::constant::electromagnetic::e, primitiveMesh::edgeFaces(), primitiveMesh::edges(), stdFoam::end(), forAll, mesh, nPoints, and polyMesh::points().

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 1504 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 1817 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 1826 of file boundaryMesh.C.

References List< T >::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 1851 of file boundaryMesh.C.

References f(), forAll, mesh, points, and List< T >::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 1892 of file boundaryMesh.C.

References mesh, Foam::foamVersion::patch, and points.

◆ triangulateLocal()

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 1907 of file boundaryMesh.C.

References f(), forAll, mesh, Foam::foamVersion::patch, points, and List< T >::setSize().

Here is the call graph for this function:

◆ markFaces()

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

Definition at line 1954 of file boundaryMesh.C.

References forAll, mesh, and List< T >::setSize().

Here is the call graph for this function:

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