43 #ifndef Foam_triFace_H 44 #define Foam_triFace_H 79 void front() =
delete;
94 inline explicit triFace(std::initializer_list<label> list);
115 label
a()
const noexcept {
return get<0>(); }
118 label
b()
const noexcept {
return get<1>(); }
121 label
c()
const noexcept {
return get<2>(); }
196 inline label
which(const label vertex) const;
199 inline label
nextLabel(const label i) const;
202 inline label
prevLabel(const label i) const;
206 inline label
thisLabel(const label i) const;
241 const scalar tol = 0.0
251 const scalar tol = 0.0
286 const scalar tol = SMALL
356 inline
void operator+=(const label vertexOffset);
362 inline
unsigned hash_code(
unsigned seed=0)
const 365 const uLabel t0((*
this)[0]);
366 const uLabel t1((*
this)[1]);
367 const uLabel t2((*
this)[2]);
369 const uLabel val(t0*t1*t2 + t0+t1+t2);
385 template<
class Unused=
bool>
386 struct Hash : triFace::hasher
405 template<>
struct is_contiguous<
triFace> : std::true_type {};
408 template<>
struct is_contiguous_label<
triFace> : std::true_type {};
411 template<>
struct Hash<
triFace> : triFace::hasher {};
label collapse()
'Collapse' face by marking duplicate vertex labels.
label nEdges() const noexcept
Return number of edges == 3.
label b() const noexcept
The second vertex.
void front()=delete
The front() accessor (from FixedList) has no purpose.
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
void back()=delete
The back() accessor (from FixedList) has no purpose.
A face is a list of labels corresponding to mesh vertices.
A 1D vector of objects of type <T> with a fixed length <N>.
triFace reverseFace() const
Return face with reverse direction.
unsigned operator()(const triFace &obj, unsigned seed=0) const
triPointRef tri(const UList< point > &points) const
Return the triangle.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
edgeList rcEdges() const
Return list of edges in reverse walk order.
static int compare(const triFace &a, const triFace &b)
Compare triFaces.
Foam::edge edge(const label edgei) const
Return i-th face edge (forward walk order).
edgeList edges() const
Return list of edges in forward walk order.
pointHit nearestPoint(const point &p, const UList< point > &points) const
Return nearest point to face.
unsigned hash_code(unsigned seed=0) const
The (commutative) hash value for triFace.
label nTriangles() const noexcept
Number of triangles after splitting == 1.
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
bool valid() const noexcept
Same as good()
scalar sweptVol(const UList< point > &opts, const UList< point > &npts) const
Return swept-volume from old-points to new-points.
T operator()(const T &x, const label offset) const
Foam::edge rcEdge(const label edgei) const
Return i-th face edge in reverse walk order.
const dimensionedScalar e
Elementary charge.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A triangular face using a FixedList of labels corresponding to mesh vertices.
tensor inertia(const UList< point > &points, const point &refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
Pair< point > box(const UList< point > &points) const
The enclosing (bounding) box for the face.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
label prevLabel(const label i) const
Previous vertex on face.
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
label find(const Foam::edge &e) const
Find the edge within the face.
Type average(const UList< point > &unused, const Field< Type > &fld) const
Calculate average value at centroid of face.
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.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
point centre(const UList< point > &points) const
Return centre (centroid)
label thisLabel(const label i) const
The vertex on face - identical to operator[], but with naming similar to nextLabel(), prevLabel()
bool good() const noexcept
True if vertices are unique and non-negative.
vector areaNormal(const UList< point > &points) const
The area normal - with magnitude equal to area of face.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
triFace()
Default construct, with invalid vertex labels (-1)
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.
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
pointHit nearestPointClassify(const point &p, const UList< point > &points, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
int edgeDirection(const Foam::edge &e) const
Test the edge direction on the face.
void flip()
Flip the face in-place.
label c() const noexcept
The third vertex.
bool contains(const Foam::edge &e) const
True if face contains(edge)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
label which(const label vertex) const
Find local vertex on face for the vertex label, same as find()
bool operator!=(const eddy &a, const eddy &b)
FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") vector normal(const UList< point > &points) const
Legacy name for areaNormal()
Foam::edge faceEdge(label edgei) const
Identical to edge()
label a() const noexcept
The first vertex.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Tensor of scalars, i.e. Tensor<scalar>.
vector unitNormal(const UList< point > &points) const
The unit normal.
scalar mag(const UList< point > &points) const
Magnitude of face area.
label nextLabel(const label i) const
Next vertex on face.
const volScalarField & p0
face triFaceFace() const
Return triangle as a face.