32 bool Foam::meshTriangulation::isInternalFace
34 const primitiveMesh& mesh,
39 if (mesh.isInternalFace(facei))
41 label own = mesh.faceOwner()[facei];
42 label nei = mesh.faceNeighbour()[facei];
44 if (includedCell[own] && includedCell[nei])
62 void Foam::meshTriangulation::getFaces
64 const primitiveMesh& mesh,
72 faceIsCut.setSize(mesh.nFaces());
78 forAll(includedCell, celli)
81 if (includedCell[celli])
83 const labelList& cFaces = mesh.cells()[celli];
87 label facei = cFaces[i];
89 if (!faceIsCut[facei])
93 faceIsCut[facei] =
true;
96 if (isInternalFace(mesh, includedCell, facei))
105 Pout<<
"Subset consists of " << nFaces <<
" faces out of " << mesh.nFaces()
106 <<
" of which " << nInternalFaces <<
" are internal" <<
endl;
110 void Foam::meshTriangulation::insertTriangles
117 List<labelledTri>& triangles,
124 const triFace& f = faceTris[i];
126 labelledTri& tri = triangles[triI];
141 tri.region() = regionI;
143 faceMap_[triI] = facei;
165 const label internalFacesPatch,
167 const bool faceCentreDecomposition
196 if (faceCentreDecomposition)
200 if (faceIsCut[facei])
202 nTotTri += faces[facei].
size();
210 if (faceIsCut[facei])
212 nTotTri += faces[facei].nTriangles(points);
216 Pout<<
"nTotTri : " << nTotTri <<
endl;
223 if (faceCentreDecomposition)
228 newPoints[pointi] = mesh.
points()[pointi];
243 if (faceCentreDecomposition)
251 if (faceIsCut[facei] && isInternalFace(mesh, includedCell, facei))
257 const face& f = faces[facei];
261 faceMap_[triI] = facei;
274 nInternalFaces_ = triI;
280 if (faceIsCut[facei] && !isInternalFace(mesh, includedCell, facei))
285 bool reverse =
false;
289 patchi = internalFacesPatch;
293 if (includedCell[mesh.
faceOwner()[facei]])
313 const face& f = faces[facei];
319 faceMap_[triI] = facei;
335 faceMap_[triI] = facei;
358 if (faceIsCut[facei] && isInternalFace(mesh, includedCell, facei))
366 if (faceTris.
empty())
369 <<
"Could not find triangulation for face " << facei
370 <<
" vertices " << faces[facei] <<
" coords " 389 nInternalFaces_ = triI;
395 if (faceIsCut[facei] && !isInternalFace(mesh, includedCell, facei))
400 bool reverse =
false;
404 patchi = internalFacesPatch;
408 if (includedCell[mesh.
faceOwner()[facei]])
429 if (faceTris.
empty())
432 <<
"Could not find triangulation for face " << facei
433 <<
" vertices " << faces[facei] <<
" coords " 458 Pout<<
"nInternalFaces_:" << nInternalFaces_ <<
endl;
469 patches[
patchi].physicalType(),
476 if (faceCentreDecomposition)
479 triSurface globalSurf(triangles, surfPatches, newPoints);
502 globalSurf.localFaces(),
504 globalSurf.localPoints()
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Triangulation of faces. Handles concave polygons as well (inefficiently)
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
friend Ostream & operator(Ostream &, const UList< T > &)
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label nextLabel(const label i) const
Next vertex on face.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
virtual const pointField & points() const
Return raw points.
List< bool > boolList
Bool container classes.
List< triFace > triFaceList
list of triFaces
virtual const labelList & faceOwner() const
Return face owner.
const Field< PointType > & points() const
Return reference to global points.
List< label > labelList
A List of labels.
Triangle with additional region number.
virtual const faceList & faces() const
Return raw faces.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
word name(const complex &)
Return a string representation of a complex.
meshTriangulation()
Construct null.
label size() const
Return the number of elements in the UPtrList.
const vectorField & faceCentres() const
void setSize(const label)
Reset size of List.
const geometricSurfacePatchList & patches() const
triSurface()
Construct null.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index...
faceList faces() const
Return the list of triangles as a faceList.
Mesh consisting of general polyhedral cells.
Triangulated surface description with patch information.
label nInternalFaces() const
Number of triangles in *this which are internal to the surface.
A List with indirect addressing.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.