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])
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))
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)])
295 return this->
tri(
points).inertia(refPt, density);
322 return this->
tri(
points).intersection(
p, q, alg, tol);
358 return this->
tri(
points).nearestPointClassify(
p, nearType, nearLabel);
399 const label pointi = edgei ? (3 - edgei) : 0;
412 const label pointi = edgei ? (3 - edgei) : 0;
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;
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;
482 if (
e.second() ==
c())
return 1;
483 if (
e.second() == a())
return 0;
487 if (
e.second() == a())
return 2;
488 if (
e.second() ==
b())
return 1;
508 (*this)[0] += vertexOffset;
509 (*this)[1] += vertexOffset;
510 (*this)[2] += vertexOffset;
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
label & operator[](const label i)
label find(const T &val) const
Find index of the first occurrence of the value.
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...
T & first()
Access first element of the list, position [0].
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::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:
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.
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.
void operator+=(const label vertexOffset)
Increment (offset) vertices by given amount.
Foam::edge rcEdge(const label edgei) const
Return i-th face edge in reverse walk order.
triFace()
Default construct, with invalid vertex labels (-1).
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.
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.
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.
label prevLabel(const label i) const
Previous vertex on face.
triPointRef tri(const UList< point > &points) const
Return the triangle.
vector areaNormal() const
vector unitNormal() const
Pair< point > box() const
const volScalarField & p0
const dimensionedScalar c
Speed of light in a vacuum.
List< edge > edgeList
List of edge.
bool operator!=(const eddy &a, const eddy &b)
PointHit< point > pointHit
A PointHit with a 3D point.
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.