38 (
a[0] ==
b[0] &&
a[1] ==
b[1] &&
a[2] ==
b[2])
39 || (
a[0] ==
b[1] &&
a[1] ==
b[2] &&
a[2] ==
b[0])
40 || (
a[0] ==
b[2] &&
a[1] ==
b[0] &&
a[2] ==
b[1])
48 (
a[0] ==
b[2] &&
a[1] ==
b[1] &&
a[2] ==
b[0])
49 || (
a[0] ==
b[1] &&
a[1] ==
b[0] &&
a[2] ==
b[2])
50 || (
a[0] ==
b[0] &&
a[1] ==
b[2] &&
a[2] ==
b[1])
116 a() >= 0 && a() !=
b()
117 &&
b() >= 0 &&
b() !=
c()
118 &&
c() >= 0 &&
c() != a()
130 if (
operator[](0) ==
operator[](1) ||
operator[](1) == -1)
135 else if (
operator[](1) ==
operator[](2) ||
operator[](2) == -1)
140 if (
operator[](0) ==
operator[](2))
152 std::swap(get<1>(), get<2>());
238 return operator[](i);
244 return operator[]((i == 2 ? 0 : i+1));
250 return operator[]((i ? i-1 : 2));
263 (npts[operator[](0)] - opts[operator[](0)])
265 (opts[
operator[](1)] - opts[
operator[](0)])
266 ^ (opts[operator[](2)] - opts[operator[](0)])
270 (npts[
operator[](1)] - opts[operator[](1)])
272 (opts[
operator[](2)] - opts[
operator[](1)])
273 ^ (npts[operator[](0)] - opts[operator[](1)])
277 (opts[
operator[](2)] - npts[operator[](2)])
279 (npts[
operator[](1)] - npts[
operator[](2)])
280 ^ (npts[operator[](0)] - npts[operator[](2)])
295 return this->tri(
points).inertia(refPt, density);
308 return this->tri(
points).ray(
p, q, alg, dir);
322 return this->tri(
points).intersection(
p, q, alg, tol);
346 return this->tri(
points).nearestPoint(
p);
358 return this->tri(
points).nearestPointClassify(
p, nearType, nearLabel);
369 return this->tri(
points).sign(
p, tol);
381 return Foam::edge(thisLabel(edgei), nextLabel(edgei));
391 return vector(
pts[nextLabel(edgei)] -
pts[thisLabel(edgei)]);
399 const label pointi = edgei ? (3 - edgei) : 0;
400 return Foam::edge(thisLabel(pointi), prevLabel(pointi));
412 const label pointi = edgei ? (3 - edgei) : 0;
413 return vector(
pts[prevLabel(pointi)] -
pts[thisLabel(pointi)]);
421 theEdges[0].first() = a();
422 theEdges[0].second() =
b();
424 theEdges[1].first() =
b();
425 theEdges[1].second() =
c();
427 theEdges[2].first() =
c();
428 theEdges[2].second() = a();
438 theEdges[0].first() = a();
439 theEdges[0].second() =
c();
441 theEdges[1].first() =
c();
442 theEdges[1].second() =
b();
444 theEdges[2].first() =
b();
445 theEdges[2].second() = a();
453 if (
e.first() == a())
455 if (
e.second() ==
b())
return 1;
456 if (
e.second() ==
c())
return -1;
458 if (
e.first() ==
b())
460 if (
e.second() ==
c())
return 1;
461 if (
e.second() == a())
return -1;
463 if (
e.first() ==
c())
465 if (
e.second() == a())
return 1;
466 if (
e.second() ==
b())
return -1;
475 if (
e.first() == a())
477 if (
e.second() ==
b())
return 0;
478 if (
e.second() ==
c())
return 2;
480 if (
e.first() ==
b())
482 if (
e.second() ==
c())
return 1;
483 if (
e.second() == a())
return 0;
485 if (
e.first() ==
c())
487 if (
e.second() == a())
return 2;
488 if (
e.second() ==
b())
return 1;
498 return (edgeDirection(
e) != 0);
508 (*this)[0] += vertexOffset;
509 (*this)[1] += vertexOffset;
510 (*this)[2] += vertexOffset;
scalar magSqr(const UList< point > &points) const
Magnitude squared of face area.
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.
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
void operator+=(const label vertexOffset)
Increment (offset) vertices by given amount.
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D vector of objects of type <T> with a fixed length <N>.
triFace reverseFace() const
Return face with reverse direction.
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)...
Pair< Point > box() const
The enclosing (bounding) box for the triangle.
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.
label nTriangles() const noexcept
Number of triangles after splitting == 1.
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
scalar sweptVol(const UList< point > &opts, const UList< point > &npts) const
Return swept-volume from old-points to new-points.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Foam::edge rcEdge(const label edgei) const
Return i-th face edge in reverse walk order.
const dimensionedScalar e
Elementary charge.
An ordered pair of two objects of type <T> with first() and second() elements.
vector unitNormal() const
Return unit normal.
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.
Point centre() const
Return centre (centroid)
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.
label find(const Foam::edge &e) const
Find the edge within the 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.
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.
label find(const T &val) const
Find index of the first occurrence of the value.
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.
const dimensionedScalar c
Speed of light in a vacuum.
triangle< point, const point & > triPointRef
A triangle using referred points.
void flip()
Flip the face in-place.
bool contains(const Foam::edge &e) const
True if face contains(edge)
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)
label a() const noexcept
The first vertex.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Tensor of scalars, i.e. Tensor<scalar>.
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.
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
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
face triFaceFace() const
Return triangle as a face.
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.