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

Constructor & Destructor Documentation

◆ boundaryMesh()

Default construct.

Definition at line 433 of file boundaryMesh.C.

◆ ~boundaryMesh()

~boundaryMesh ( )
default

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "boundaryMesh"  )

Runtime type information.

◆ clearOut()

void clearOut ( )

Definition at line 449 of file boundaryMesh.C.

◆ mesh()

◆ patches()

const PtrList<boundaryPatch>& patches ( ) const
inline

Definition at line 270 of file boundaryMesh.H.

◆ meshFace()

const labelList& meshFace ( ) const
inline

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

Definition at line 279 of file boundaryMesh.H.

◆ featurePoints()

const pointField& featurePoints ( ) const
inline

Feature points.

Definition at line 287 of file boundaryMesh.H.

◆ featureEdges()

const edgeList& featureEdges ( ) const
inline

Feature edges. Indices into featurePoints.

Definition at line 295 of file boundaryMesh.H.

◆ featureToEdge()

const labelList& featureToEdge ( ) const
inline

From index into featureEdge to index into meshedges,.

Definition at line 303 of file boundaryMesh.H.

◆ edgeToFeature()

const labelList& edgeToFeature ( ) const
inline

From edge into featureEdges.

Definition at line 311 of file boundaryMesh.H.

◆ featureSegments()

const labelListList& featureSegments ( ) const
inline

Lists of connected featureEdges. Indices into featureEdges.

Definition at line 319 of file boundaryMesh.H.

◆ extraEdges()

const labelList& extraEdges ( ) const
inline

Indices into edges of additional edges.

Definition at line 327 of file boundaryMesh.H.

◆ read()

◆ readTriSurface()

◆ writeTriSurface()

void writeTriSurface ( const fileName fName) const

Write to file.

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

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

References List< T >::append(), polyMesh::boundaryMesh(), repatchPolyTopoChanger::changePatches(), repatchPolyTopoChanger::changePatchID(), polyPatch::clone(), Foam::ensightOutput::debug, Foam::endl(), forAll, patchIdentifier::name(), primitiveMesh::nBoundaryFaces(), polyPatch::New(), primitiveMesh::nInternalFaces(), Foam::foamVersion::patch, pFaces, patchIdentifier::physicalType(), Foam::Pout, repatchPolyTopoChanger::repatch(), PtrList< T >::set(), UList< T >::size(), UPtrList< T >::size(), HashTable< T, Key, Hash >::size(), 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 1517 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 1538 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 268 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 1552 of file boundaryMesh.C.

References Foam::ensightOutput::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)

◆ changePatchType()

void changePatchType ( const word patchName,
const word type 
)

Change patch.

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

◆ setFeatureEdges()

void setFeatureEdges ( const scalar  minCos)

Set featureEdges, edgeToFeature, featureSegments according.

to angle of faces across edge

Definition at line 1301 of file boundaryMesh.C.

References DynamicList< T, SizeMin >::append(), Foam::constant::electromagnetic::e, primitiveMesh::edgeFaces(), primitiveMesh::edges(), stdFoam::end(), forAll, mesh, nPoints, polyMesh::points(), and UList< T >::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 1502 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 1813 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 1822 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 1847 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 1888 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 1905 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: