A face is a list of labels corresponding to mesh vertices. More...
Public Types | |
enum | proxType { NONE, POINT, EDGE } |
Return types for classify. More... | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. More... | |
Public Member Functions | |
face () | |
Construct null. More... | |
face (label) | |
Construct given size. More... | |
face (const labelUList &) | |
Construct from list of labels. More... | |
face (const labelList &) | |
Construct from list of labels. More... | |
face (const Xfer< labelList > &) | |
Construct by transferring the parameter contents. More... | |
face (const triFace &) | |
Copy construct from triFace. More... | |
face (Istream &) | |
Construct from Istream. More... | |
label | collapse () |
Collapse face by removing duplicate point labels. More... | |
void | flip () |
Flip the face in-place. More... | |
pointField | points (const pointField &) const |
Return the points corresponding to this face. More... | |
point | centre (const pointField &) const |
Centre point of face. More... | |
template<class Type > | |
Type | average (const pointField &, const Field< Type > &) const |
Calculate average value at centroid of face. More... | |
scalar | mag (const pointField &) const |
Magnitude of face area. More... | |
vector | normal (const pointField &) const |
Vector normal; magnitude is equal to area of face. More... | |
face | reverseFace () const |
Return face with reverse direction. More... | |
label | which (const label globalIndex) const |
Navigation through face vertices. More... | |
label | nextLabel (const label i) const |
Next vertex on face. More... | |
label | prevLabel (const label i) const |
Previous vertex on face. More... | |
scalar | sweptVol (const pointField &oldPoints, const pointField &newPoints) const |
Return the volume swept out by the face when its points move. More... | |
tensor | inertia (const pointField &, const point &refPt=vector::zero, scalar density=1.0) const |
Return the inertia tensor, with optional reference. More... | |
pointHit | ray (const point &p, const vector &n, const pointField &, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const |
Return potential intersection with face with a ray starting. More... | |
pointHit | intersection (const point &p, const vector &q, const point &ctr, const pointField &, const intersection::algorithm alg, const scalar tol=0.0) const |
Fast intersection with a ray. More... | |
pointHit | nearestPoint (const point &p, const pointField &) const |
Return nearest point to face. More... | |
pointHit | nearestPointClassify (const point &p, const pointField &, label &nearType, label &nearLabel) const |
Return nearest point to face and classify it: More... | |
scalar | contactSphereDiameter (const point &p, const vector &n, const pointField &) const |
Return contact sphere diameter. More... | |
scalar | areaInContact (const pointField &, const scalarField &v) const |
Return area in contact, given the displacement in vertices. More... | |
label | nEdges () const |
Return number of edges. More... | |
edgeList | edges () const |
Return edges in face point ordering,. More... | |
edge | faceEdge (const label n) const |
Return n-th face edge. More... | |
int | edgeDirection (const edge &) const |
Return the edge direction on the face. More... | |
label | nTriangles () const |
Number of triangles after splitting. More... | |
label | nTriangles (const pointField &points) const |
Number of triangles after splitting. More... | |
label | triangles (const pointField &points, label &triI, faceList &triFaces) const |
Split into triangles using existing points. More... | |
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> | |
label | triangles (const pointField &points, DynamicList< face, SizeInc, SizeMult, SizeDiv > &triFaces) const |
Split into triangles using existing points. More... | |
label | nTrianglesQuads (const pointField &points, label &nTris, label &nQuads) const |
Number of triangles and quads after splitting. More... | |
label | trianglesQuads (const pointField &points, label &triI, label &quadI, faceList &triFaces, faceList &quadFaces) const |
Split into triangles and quads. More... | |
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> | |
Foam::label | triangles (const pointField &points, DynamicList< face, SizeInc, SizeMult, SizeDiv > &triFaces) const |
![]() | |
List () | |
Null constructor. More... | |
List (const label) | |
Construct with given size. More... | |
List (const label, const T &) | |
Construct with given size and value for all elements. More... | |
List (const List< T > &) | |
Copy constructor. More... | |
List (const Xfer< List< T > > &) | |
Construct by transferring the parameter contents. More... | |
List (List< T > &, bool reUse) | |
Construct as copy or re-use as specified. More... | |
List (const UList< T > &, const labelUList &mapAddressing) | |
Construct as subset. More... | |
template<class InputIterator > | |
List (InputIterator first, InputIterator last) | |
Construct given start and end iterators. More... | |
template<unsigned Size> | |
List (const FixedList< T, Size > &) | |
Construct as copy of FixedList<T, Size> More... | |
List (const PtrList< T > &) | |
Construct as copy of PtrList<T> More... | |
List (const SLList< T > &) | |
Construct as copy of SLList<T> More... | |
List (const UIndirectList< T > &) | |
Construct as copy of UIndirectList<T> More... | |
List (const BiIndirectList< T > &) | |
Construct as copy of BiIndirectList<T> More... | |
List (Istream &) | |
Construct from Istream. More... | |
autoPtr< List< T > > | clone () const |
Clone. More... | |
~List () | |
Destructor. More... | |
label | size () const |
Return the number of elements in the UList. More... | |
void | resize (const label) |
Alias for setSize(const label) More... | |
void | resize (const label, const T &) |
Alias for setSize(const label, const T&) More... | |
void | setSize (const label) |
Reset size of List. More... | |
void | setSize (const label, const T &) |
Reset size of List and value for new elements. More... | |
void | clear () |
Clear the list, i.e. set size to zero. More... | |
void | append (const T &) |
Append an element at the end of the list. More... | |
void | append (const UList< T > &) |
Append a List at the end of this list. More... | |
void | append (const UIndirectList< T > &) |
Append a UIndirectList at the end of this list. More... | |
void | transfer (List< T > &) |
Transfer the contents of the argument List into this list. More... | |
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> | |
void | transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &) |
Transfer the contents of the argument List into this list. More... | |
void | transfer (SortableList< T > &) |
Transfer the contents of the argument List into this list. More... | |
Xfer< List< T > > | xfer () |
Transfer contents to the Xfer container. More... | |
T & | newElmt (const label) |
Return subscript-checked element of UList. More... | |
void | operator= (const UList< T > &) |
Assignment from UList operator. Takes linear time. More... | |
void | operator= (const List< T > &) |
Assignment operator. Takes linear time. More... | |
void | operator= (const SLList< T > &) |
Assignment from SLList operator. Takes linear time. More... | |
void | operator= (const UIndirectList< T > &) |
Assignment from UIndirectList operator. Takes linear time. More... | |
void | operator= (const BiIndirectList< T > &) |
Assignment from BiIndirectList operator. Takes linear time. More... | |
void | operator= (const T &) |
Assignment of all entries to the given value. More... | |
template<class T > | |
List (const label s) | |
template<class T > | |
List (const label s, const T &a) | |
template<class T > | |
List (const List< T > &a) | |
template<class T > | |
List (const Xfer< List< T > > &lst) | |
template<class T > | |
List (List< T > &a, bool reUse) | |
template<class T > | |
List (const UList< T > &a, const labelUList &map) | |
template<class T > | |
List (const PtrList< T > &lst) | |
template<class T > | |
List (const SLList< T > &lst) | |
template<class T > | |
List (const UIndirectList< T > &lst) | |
template<class T > | |
List (const BiIndirectList< T > &lst) | |
template<class T > | |
void | transfer (List< T > &a) |
template<class T > | |
void | transfer (SortableList< T > &a) |
template<class T > | |
List () | |
template<class T > | |
List (Istream &is) | |
Static Public Member Functions | |
static int | compare (const face &, const face &) |
Compare faces. More... | |
static bool | sameVertices (const face &, const face &) |
Return true if the faces have the same vertices. More... | |
![]() | |
static const List< T > & | null () |
Return a null List. More... | |
Static Public Attributes | |
static const char *const | typeName = "face" |
Private Types | |
enum | splitMode { COUNTTRIANGLE, COUNTQUAD, SPLITTRIANGLE, SPLITQUAD } |
Enumeration listing the modes for split() More... | |
Private Member Functions | |
label | right (const label i) const |
Edge to the right of face vertex i. More... | |
label | left (const label i) const |
Edge to the left of face vertex i. More... | |
tmp< vectorField > | calcEdges (const pointField &points) const |
Construct list of edge vectors for face. More... | |
scalar | edgeCos (const vectorField &edges, const label index) const |
Cos between neighbouring edges. More... | |
label | mostConcaveAngle (const pointField &points, const vectorField &edges, scalar &edgeCos) const |
Find index of largest internal angle on face. More... | |
label | split (const splitMode mode, const pointField &points, label &triI, label &quadI, faceList &triFaces, faceList &quadFaces) const |
Split face into triangles or triangles&quads. More... | |
Friends | |
bool | operator== (const face &a, const face &b) |
bool | operator!= (const face &a, const face &b) |
Istream & | operator>> (Istream &, face &) |
Additional Inherited Members | |
![]() | |
void | size (const label) |
Override size to be inconsistent with allocated storage. More... | |
|
private |
enum proxType |
|
inlineexplicit |
|
inlineprivate |
|
inlineprivate |
|
private |
Construct list of edge vectors for face.
Definition at line 41 of file face.C.
References face::edges(), forAll, Foam::mag(), face::points(), and List::size().
|
private |
|
private |
Find index of largest internal angle on face.
Definition at line 78 of file face.C.
References Foam::acos(), forAll, Foam::max(), Foam::min(), n, Foam::constant::mathematical::pi(), and points.
|
private |
Split face into triangles or triangles&quads.
Stores results quadFaces[quadI], triFaces[triI] Returns number of new faces created
Definition at line 125 of file face.C.
References Foam::abort(), Foam::acos(), Foam::diff(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), Foam::max(), Foam::min(), Foam::mode(), Foam::constant::mathematical::pi(), points, face::split(), and triFace().
Referenced by face::split().
Foam::label collapse | ( | ) |
void flip | ( | ) |
Flip the face in-place.
The starting points of the original and flipped face are identical.
Definition at line 474 of file face.C.
References n, and Foam::Swap().
Referenced by slidingInterface::decoupleInterface(), main(), layerAdditionRemoval::removeCellLayer(), layerAdditionRemoval::setLayerPairing(), and hexRef8::storeMidPointInfo().
|
inline |
Return the points corresponding to this face.
Definition at line 80 of file faceI.H.
Referenced by directAMI< SourcePatch, TargetPatch >::appendToDirectSeeds(), enrichedPatch::calcCutFaces(), face::calcEdges(), faceCoupleInfo::checkMatch(), faceCoupleInfo::growCutFaces(), and AMIMethod< SourcePatch, TargetPatch >::writeIntersectionOBJ().
Foam::point centre | ( | const pointField & | points | ) | const |
Centre point of face.
Definition at line 488 of file face.C.
References Foam::mag(), nPoints, points, and Vector< scalar >::zero.
Referenced by directAMI< SourcePatch, TargetPatch >::appendToDirectSeeds(), hexRef8::checkBoundaryOrientation(), hexRef8::checkInternalOrientation(), edgeExtractor::distributeBoundaryFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), meshSurfaceMapper::faceMetricInPatch(), edgeExtractor::findCornerCandidates(), autoSnapDriver::findDiagonalAttraction(), triangulateNonPlanarBaseFaces::findNonPlanarBoundaryFaces(), edgeExtractor::findPatchesNearSurfaceFace(), AMIMethod< SourcePatch, TargetPatch >::findTargetFace(), faceDecomposition::isFacePlanar(), and correctEdgesBetweenPatches::patchCorrection().
Type average | ( | const pointField & | meshPoints, |
const Field< Type > & | fld | ||
) | const |
Calculate average value at centroid of face.
Definition at line 51 of file faceTemplates.C.
References fld(), Foam::mag(), and nPoints.
|
inline |
Magnitude of face area.
Definition at line 97 of file faceI.H.
References Foam::mag(), and p.
Referenced by face::areaInContact(), hexCellLooper::cut(), faceAreaWeightAMI< SourcePatch, TargetPatch >::interArea(), and autoSnapDriver::preventFaceSqueeze().
Foam::vector normal | ( | const pointField & | p | ) | const |
Vector normal; magnitude is equal to area of face.
Definition at line 552 of file face.C.
References n, nPoints, p, and Vector< scalar >::zero.
Referenced by directAMI< SourcePatch, TargetPatch >::appendToDirectSeeds(), enrichedPatch::calcCutFaces(), meshSurfaceEngine::calculateFaceNormals(), boundaryLayerOptimisation::calculateHairVectorsAtTheBoundary(), blockMesh::checkBlockMesh(), hexRef8::checkBoundaryOrientation(), hexRef8::checkInternalOrientation(), faceDecomposition::concaveVertex(), autoSnapDriver::detectWarpedFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), meshSurfaceMapper::faceMetricInPatch(), autoSnapDriver::findDiagonalAttraction(), faceDecomposition::isFacePlanar(), and PairCollision< CloudType >::wallInteraction().
Foam::face reverseFace | ( | ) | const |
Return face with reverse direction.
The starting points of the original and reverse face are identical.
Definition at line 611 of file face.C.
References f(), List::size(), and Foam::xferMove().
Referenced by hexRef8::addFace(), meshCutAndRemove::addFace(), meshCutter::addFace(), slidingInterface::coupleInterface(), meshOctreeAddressing::createOctreeFaces(), decomposeFaces::decomposeMeshFaces(), extrudedMesh::extrudedFaces(), meshCutAndRemove::modFace(), hexRef8::modFace(), meshCutter::modFace(), surfaceMorpherCells::morphInternalFaces(), perfectInterface::setRefinement(), and createShellMesh::setRefinement().
Foam::label which | ( | const label | globalIndex | ) | const |
Navigation through face vertices.
Which vertex on face (face index given a global index)
returns -1 if not found
Definition at line 630 of file face.C.
Referenced by enrichedPatch::calcCutFaces(), polyMeshGenAddressing::calcEdges(), meshSurfaceEngine::calculateEdgeFacesAddressing(), meshSurfaceEngine::calculateEdgesAndAddressing(), boundaryLayerOptimisation::calculateHairVectorsAtTheBoundary(), meshSurfaceEngine::calculatePointPoints(), edgeExtractor::checkCorners(), boundaryLayers::createLayerCells(), refineBoundaryLayers::refineCornerHexCell::determineFacesInDirections(), refineBoundaryLayers::generateNewCellsPrism(), edgeExtractor::cornerEvaluator::improveCorners(), and boundaryLayerOptimisation::optimiseThicknessVariation().
|
inline |
Next vertex on face.
Definition at line 117 of file faceI.H.
Referenced by enrichedPatch::calcCutFaces(), polyDualMesh::calcDual(), meshSurfaceEngine::calculateEdgeFacesAddressing(), meshSurfaceEngine::calculateEdgesAndAddressing(), meshSurfaceEngine::calculatePointPoints(), meshSurfaceCheckInvertedVertices::checkVertices(), slidingInterface::coupleInterface(), partTriMesh::createPointsAndTrias(), triangulateNonPlanarBaseFaces::findNonPlanarBoundaryFaces(), combineFaces::getOutsideFace(), polyMeshAdder::insertVertices(), correctEdgesBetweenPatches::patchCorrection(), boundaryCutter::setRefinement(), and tetDecomposer::setRefinement().
|
inline |
Previous vertex on face.
Definition at line 124 of file faceI.H.
Referenced by meshSurfaceEngine::calculateEdgesAndAddressing(), boundaryLayerOptimisation::calculateHairVectorsAtTheBoundary(), meshSurfaceEngine::calculatePointPoints(), meshSurfaceCheckInvertedVertices::checkVertices(), partTriMesh::createPointsAndTrias(), correctEdgesBetweenPatches::patchCorrection(), tetDecomposer::setRefinement(), and autoLayerDriver::truncateDisplacement().
Foam::scalar sweptVol | ( | const pointField & | oldPoints, |
const pointField & | newPoints | ||
) | const |
Return the volume swept out by the face when its points move.
Definition at line 647 of file face.C.
References nPoints, and Foam::constant::mathematical::pi().
Foam::tensor inertia | ( | const pointField & | p, |
const point & | refPt = vector::zero , |
||
scalar | density = 1.0 |
||
) | const |
Return the inertia tensor, with optional reference.
point and density specification
Definition at line 726 of file face.C.
References forAll, p, and Tensor::zero.
Foam::pointHit ray | ( | const point & | p, |
const vector & | n, | ||
const pointField & | meshPoints, | ||
const intersection::algorithm | alg = intersection::FULL_RAY , |
||
const intersection::direction | dir = intersection::VECTOR |
||
) | const |
Return potential intersection with face with a ray starting.
at p, direction n (does not need to be normalized) Does face-centre decomposition and returns triangle intersection point closest to p. Face-centre is calculated from point average. For a hit, the distance is signed. Positive number represents the point in front of triangle In case of miss the point is the nearest point on the face and the distance is the distance between the intersection point and the original point. The half-ray or full-ray intersection and the contact sphere adjustment of the projection vector is set by the intersection parameters
Definition at line 43 of file faceIntersection.C.
References Foam::average(), PointHit::distance(), PointHit::eligibleMiss(), f(), PointHit::hit(), PointHit::hitPoint(), Foam::mag(), PointHit::missPoint(), n, nPoints, p, points, PointHit::setDistance(), PointHit::setHit(), PointHit::setMiss(), and PointHit::setPoint().
Referenced by directAMI< SourcePatch, TargetPatch >::appendToDirectSeeds().
Foam::pointHit intersection | ( | const point & | p, |
const vector & | q, | ||
const point & | ctr, | ||
const pointField & | meshPoints, | ||
const intersection::algorithm | alg, | ||
const scalar | tol = 0.0 |
||
) | const |
Fast intersection with a ray.
Does face-centre decomposition and returns triangle intersection point closest to p. See triangle::intersection for details.
Definition at line 141 of file faceIntersection.C.
References PointHit::distance(), f(), forAll, PointHit::hit(), PointHit::hitPoint(), Foam::mag(), p, PointHit::setDistance(), PointHit::setHit(), and PointHit::setPoint().
Foam::pointHit nearestPoint | ( | const point & | p, |
const pointField & | meshPoints | ||
) | const |
Return nearest point to face.
Definition at line 199 of file faceIntersection.C.
References p.
Referenced by faceCoupleInfo::maxDistance(), and PairCollision< CloudType >::wallInteraction().
Foam::pointHit nearestPointClassify | ( | const point & | p, |
const pointField & | meshPoints, | ||
label & | nearType, | ||
label & | nearLabel | ||
) | const |
Return nearest point to face and classify it:
+ near point (nearType=POINT, nearLabel=0, 1, 2) + near edge (nearType=EDGE, nearLabel=0, 1, 2) Note: edges are counted from starting vertex so e.g. edge n is from f[n] to f[0], where the face has n + 1 points
Definition at line 213 of file faceIntersection.C.
References PointHit::distance(), f(), PointHit::hit(), PointHit::hitPoint(), Foam::mag(), PointHit::missPoint(), triangle::nearestPointClassify(), nPoints, p, PointHit::setDistance(), PointHit::setHit(), PointHit::setMiss(), and PointHit::setPoint().
Foam::scalar contactSphereDiameter | ( | const point & | p, |
const vector & | n, | ||
const pointField & | meshPoints | ||
) | const |
Return contact sphere diameter.
Definition at line 34 of file faceContactSphere.C.
References Foam::mag(), n, and p.
Foam::scalar areaInContact | ( | const pointField & | meshPoints, |
const scalarField & | v | ||
) | const |
Return area in contact, given the displacement in vertices.
Definition at line 36 of file faceAreaInContact.C.
References forAll, face::mag(), Foam::mag(), and List::size().
|
inline |
Foam::edgeList edges | ( | ) | const |
Return edges in face point ordering,.
i.e. edges()[0] is edge between [0] and [1]
Definition at line 761 of file face.C.
References Foam::e, and points.
Referenced by enrichedPatch::calcCutFaces(), face::calcEdges(), faceDecomposition::concaveVertex(), Foam::help::createFaceFromRemovedPart(), faceDecomposition::decomposeFaceIntoTriangles(), Foam::help::modifyFacesToShareOneEdge(), surfaceMorpherCells::morphBoundaryFaces(), Foam::polyMeshZipUpCells(), and polyMeshGenModifier::zipUpCells().
|
inline |
Return n-th face edge.
Definition at line 110 of file faceI.H.
References n.
Referenced by meshSurfaceEngine::calculateEdgeFacesAddressing(), meshSurfaceEngine::calculateFaceEdgesAddressing(), boundaryLayerOptimisation::calculateHairVectorsAtTheBoundary(), boundaryLayerOptimisation::calculateThicknessOverCell(), boundaryLayers::checkTopologyOfBoundaryFaces(), boundaryLayers::createLayerCells(), refineBoundaryLayers::refineCornerHexCell::determineFacesInDirections(), boundaryLayerOptimisation::optimiseHairNormalsAtTheBoundary(), Foam::help::removeEdgesFromFace(), and edgeExtractor::cornerEvaluator::sortedFacesAtPoint().
int edgeDirection | ( | const edge & | e | ) | const |
|
inline |
Foam::label nTriangles | ( | const pointField & | points | ) | const |
Foam::label triangles | ( | const pointField & | points, |
label & | triI, | ||
faceList & | triFaces | ||
) | const |
Split into triangles using existing points.
Result in triFaces[triI..triI+nTri]. Splits intelligently to maximize triangle quality. Returns number of faces created.
Definition at line 830 of file face.C.
References points.
Referenced by faceAreaIntersect::calc(), and thresholdCellFaces::calculate().
label triangles | ( | const pointField & | points, |
DynamicList< face, SizeInc, SizeMult, SizeDiv > & | triFaces | ||
) | const |
Split into triangles using existing points.
Append to DynamicList. Returns number of faces created.
Foam::label nTrianglesQuads | ( | const pointField & | points, |
label & | nTris, | ||
label & | nQuads | ||
) | const |
Foam::label trianglesQuads | ( | const pointField & | points, |
label & | triI, | ||
label & | quadI, | ||
faceList & | triFaces, | ||
faceList & | quadFaces | ||
) | const |
Compare faces.
0: different +1: identical -1: same face, but different orientation
Definition at line 298 of file face.C.
References CirculatorBase::ANTICLOCKWISE, Foam::constant::physicoChemical::b, ConstCirculator< ContainerType >::circulate(), CirculatorBase::CLOCKWISE, ConstCirculator< ContainerType >::setFulcrumToIterator(), ConstCirculator< ContainerType >::setIteratorToFulcrum(), and List::size().
Referenced by meshReader::createPolyCells(), main(), Foam::operator!=(), and Foam::operator==().
Return true if the faces have the same vertices.
Definition at line 400 of file face.C.
References Foam::constant::physicoChemical::b, forAll, and List::size().
Foam::label triangles | ( | const pointField & | points, |
DynamicList< face, SizeInc, SizeMult, SizeDiv > & | triFaces | ||
) | const |
Definition at line 33 of file faceTemplates.C.
References points, and DynamicList::setSize().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.