79 void front() =
delete;
91 inline triFace(
const label
p0,
const label p1,
const label p2)
noexcept;
94 inline explicit triFace(std::initializer_list<label> list);
199 inline label
which(const label vertex) const;
202 inline label
nextLabel(const label i) const;
205 inline label
prevLabel(const label i) const;
209 inline label
thisLabel(const label i) const;
244 const scalar tol = 0.0
254 const scalar tol = 0.0
289 const scalar tol = SMALL
359 inline
void operator+=(const label vertexOffset);
365 inline
unsigned hash_code(
unsigned seed=0)
const
368 const uLabel t0((*
this)[0]);
369 const uLabel t1((*
this)[1]);
370 const uLabel t2((*
this)[2]);
372 const uLabel val(t0*t1*t2 + t0+t1+t2);
388 template<
class Unused=
bool>
389 struct Hash : triFace::hasher
401 Foam::edge
faceEdge(label edgei)
const {
return this->
edge(edgei); }
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A 1D vector of objects of type <T> with a fixed length <N>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An ordered pair of two objects of type <T> with first() and second() elements.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A face is a list of labels corresponding to mesh vertices.
A triangular face using a FixedList of labels corresponding to mesh vertices.
scalar sweptVol(const UList< point > &opts, const UList< point > &npts) const
Return swept-volume from old-points to new-points.
vector unitNormal(const UList< point > &points) const
The unit normal.
FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") vector normal(const UList< point > &points) const
Legacy name for areaNormal().
Foam::edge edge(const label edgei) const
Return i-th face edge (forward walk order).
void flip()
Flip the face in-place.
label b() const noexcept
The second vertex.
pointHit ray(const point &p, const vector &q, const UList< point > &points, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
Return point intersection with a ray starting at p, in direction q.
pointHit nearestPointClassify(const point &p, const UList< point > &points, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
void back()=delete
The back() accessor (from FixedList) has no purpose.
void front()=delete
The front() accessor (from FixedList) has no purpose.
pointHit nearestPoint(const point &p, const UList< point > &points) const
Return nearest point to face.
scalar magSqr(const UList< point > &points) const
Magnitude squared of face area.
pointHit intersection(const point &p, const vector &q, const UList< point > &points, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
bool contains(const Foam::edge &e) const
True if face contains(edge).
label nEdges() const noexcept
Return number of edges == 3.
unsigned hash_code(unsigned seed=0) const
The (commutative) hash value for triFace.
triFace reverseFace() const
Return face with reverse direction.
scalar mag(const UList< point > &points) const
Magnitude of face area.
bool good() const noexcept
True if vertices are unique and non-negative.
label find(const Foam::edge &e) const
Find the edge within the face.
Pair< point > box(const UList< point > &points) const
The enclosing (bounding) box for the face.
int edgeDirection(const Foam::edge &e) const
Test the edge direction on the face.
Foam::edge rcEdge(const label edgei) const
Return i-th face edge in reverse walk order.
triFace()
Default construct, with invalid vertex labels (-1).
label & b() noexcept
The second vertex.
tensor inertia(const UList< point > &points, const point &refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
label c() const noexcept
The third vertex.
point centre(const UList< point > &points) const
Return centre (centroid).
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
int sign(const point &p, const UList< point > &points, const scalar tol=SMALL) const
The sign for which side of the face plane the point is on.
static int compare(const triFace &a, const triFace &b)
Compare triFaces.
label which(const label vertex) const
Find local vertex on face for the vertex label, same as find().
label a() const noexcept
The first vertex.
label nextLabel(const label i) const
Next vertex on face.
bool valid() const noexcept
Same as good().
label thisLabel(const label i) const
The vertex on face - identical to operator[], but with naming similar to nextLabel(),...
edgeList rcEdges() const
Return list of edges in reverse walk order.
label collapse()
'Collapse' face by marking duplicate vertex labels.
face triFaceFace() const
Return triangle as a face.
Foam::edge faceEdge(label edgei) const
Identical to edge().
edgeList edges() const
Return list of edges in forward walk order.
vector areaNormal(const UList< point > &points) const
The area normal - with magnitude equal to area of face.
label nTriangles() const noexcept
Number of triangles after splitting == 1.
Type average(const UList< point > &unused, const Field< Type > &fld) const
Calculate average value at centroid of face.
label & a() noexcept
The first vertex.
label prevLabel(const label i) const
Previous vertex on face.
label & c() noexcept
The third vertex.
triPointRef tri(const UList< point > &points) const
Return the triangle.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const volScalarField & p0
List< edge > edgeList
List of edge.
bool operator!=(const eddy &a, const eddy &b)
PointHit< point > pointHit
A PointHit with a 3D point.
dimensionedScalar sign(const dimensionedScalar &ds)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
vector point
Point is a vector.
triangle< point, const point & > triPointRef
A triangle using referred points.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
#define FOAM_DEPRECATED_FOR(since, replacement)
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
A template class to specify if a data type is composed solely of Foam::label elements.
A template class to specify that a data type can be considered as being contiguous in memory.
triFace operator()(const triFace &x, const label offset) const
Offset operator for ListListOps::combineOffset().
T operator()(const T &x, const label offset) const
Deprecated(2021-04) hashing functor. Use hasher().
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
Hashing functor for triFace (commutative).
unsigned operator()(const triFace &obj, unsigned seed=0) const