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>());
232 return operator[](i);
238 return operator[]((i == 2 ? 0 : i+1));
244 return operator[]((i ? i-1 : 2));
257 (npts[operator[](0)] - opts[operator[](0)])
259 (opts[
operator[](1)] - opts[
operator[](0)])
260 ^ (opts[operator[](2)] - opts[operator[](0)])
264 (npts[
operator[](1)] - opts[operator[](1)])
266 (opts[
operator[](2)] - opts[
operator[](1)])
267 ^ (npts[operator[](0)] - opts[operator[](1)])
271 (opts[
operator[](2)] - npts[operator[](2)])
273 (npts[
operator[](1)] - npts[
operator[](2)])
274 ^ (npts[operator[](0)] - npts[operator[](2)])
289 return this->tri(
points).inertia(refPt, density);
302 return this->tri(
points).ray(
p, q, alg, dir);
316 return this->tri(
points).intersection(
p, q, alg, tol);
340 return this->tri(
points).nearestPoint(
p);
352 return this->tri(
points).nearestPointClassify(
p, nearType, nearLabel);
363 return this->tri(
points).sign(
p, tol);
375 return Foam::edge(thisLabel(edgei), nextLabel(edgei));
385 return vector(
pts[nextLabel(edgei)] -
pts[thisLabel(edgei)]);
393 const label pointi = edgei ? (3 - edgei) : 0;
394 return Foam::edge(thisLabel(pointi), prevLabel(pointi));
406 const label pointi = edgei ? (3 - edgei) : 0;
407 return vector(
pts[prevLabel(pointi)] -
pts[thisLabel(pointi)]);
415 theEdges[0].first() = a();
416 theEdges[0].second() =
b();
418 theEdges[1].first() =
b();
419 theEdges[1].second() =
c();
421 theEdges[2].first() =
c();
422 theEdges[2].second() = a();
432 theEdges[0].first() = a();
433 theEdges[0].second() =
c();
435 theEdges[1].first() =
c();
436 theEdges[1].second() =
b();
438 theEdges[2].first() =
b();
439 theEdges[2].second() = a();
447 if (
e.first() == a())
449 if (
e.second() ==
b())
return 1;
450 if (
e.second() ==
c())
return -1;
452 if (
e.first() ==
b())
454 if (
e.second() ==
c())
return 1;
455 if (
e.second() == a())
return -1;
457 if (
e.first() ==
c())
459 if (
e.second() == a())
return 1;
460 if (
e.second() ==
b())
return -1;
473 (*this)[0] += vertexOffset;
474 (*this)[1] += vertexOffset;
475 (*this)[2] += vertexOffset;
label collapse()
'Collapse' face by marking duplicate point 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 point labels. The functionality it provides supports the discretisation 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.
label which(const label pointLabel) const
Find local index on face for the point label, same as find()
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.
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 point 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.
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 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
face triFaceFace() const
Return triangle as a face.
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.