Go to the documentation of this file.
40 (a[0] ==
b[0] && a[1] ==
b[1] && a[2] ==
b[2])
41 || (a[0] ==
b[1] && a[1] ==
b[2] && a[2] ==
b[0])
42 || (a[0] ==
b[2] && a[1] ==
b[0] && a[2] ==
b[1])
50 (a[0] ==
b[2] && a[1] ==
b[1] && a[2] ==
b[0])
51 || (a[0] ==
b[1] && a[1] ==
b[0] && a[2] ==
b[2])
52 || (a[0] ==
b[0] && a[1] ==
b[2] && a[2] ==
b[1])
121 if (
operator[](0) ==
operator[](1) ||
operator[](1) == -1)
126 else if (
operator[](1) ==
operator[](2) ||
operator[](2) == -1)
131 if (
operator[](0) ==
operator[](2))
143 std::swap(
operator[](1),
operator[](2));
151 p[0] = pts[operator[](0)];
152 p[1] = pts[operator[](1)];
153 p[2] = pts[operator[](2)];
202 return s < ROOTVSMALL ?
Zero :
n/
s;
221 return triFace(
operator[](0),
operator[](2),
operator[](1));
233 return operator[](i);
239 return operator[]((i == 2 ? 0 : i+1));
245 return operator[]((i ? i-1 : 2));
258 (npts[operator[](0)] - opts[operator[](0)])
260 (opts[
operator[](1)] - opts[
operator[](0)])
261 ^ (opts[operator[](2)] - opts[operator[](0)])
265 (npts[
operator[](1)] - opts[operator[](1)])
267 (opts[
operator[](2)] - opts[
operator[](1)])
268 ^ (npts[operator[](0)] - opts[operator[](1)])
272 (opts[
operator[](2)] - npts[operator[](2)])
274 (npts[
operator[](1)] - npts[
operator[](2)])
275 ^ (npts[operator[](0)] - npts[operator[](2)])
290 return this->tri(
points).inertia(refPt, density);
303 return this->tri(
points).ray(
p, q, alg, dir);
317 return this->tri(
points).intersection(
p, q, alg, tol);
341 return this->tri(
points).nearestPoint(
p);
353 return this->tri(
points).nearestPointClassify(
p, nearType, nearLabel);
364 return this->tri(
points).sign(
p, tol);
376 return Foam::edge(thisLabel(edgei), nextLabel(edgei));
386 return vector(pts[nextLabel(edgei)] - pts[thisLabel(edgei)]);
394 const label pointi = edgei ? (3 - edgei) : 0;
395 return Foam::edge(thisLabel(pointi), prevLabel(pointi));
407 const label pointi = edgei ? (3 - edgei) : 0;
408 return vector(pts[prevLabel(pointi)] - pts[thisLabel(pointi)]);
416 theEdges[0].first() = operator[](0);
417 theEdges[0].second() = operator[](1);
419 theEdges[1].first() = operator[](1);
420 theEdges[1].second() = operator[](2);
422 theEdges[2].first() = operator[](2);
423 theEdges[2].second() = operator[](0);
433 theEdges[0].first() = operator[](0);
434 theEdges[0].second() = operator[](2);
436 theEdges[1].first() = operator[](2);
437 theEdges[1].second() = operator[](1);
439 theEdges[2].first() = operator[](1);
440 theEdges[2].second() = operator[](0);
448 if (
e.first() == operator[](0))
450 if (
e.second() == operator[](1))
return 1;
451 if (
e.second() == operator[](2))
return -1;
453 if (
e.first() == operator[](1))
455 if (
e.second() == operator[](2))
return 1;
456 if (
e.second() == operator[](0))
return -1;
458 if (
e.first() == operator[](2))
460 if (
e.second() == operator[](0))
return 1;
461 if (
e.second() == operator[](1))
return -1;
tensor inertia(const UList< point > &points, const point &refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
triFace reverseFace() const
Return face with reverse direction.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
pointField points(const UList< point > &pts) const
Return the points corresponding to this 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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
Foam::edge edge(const label edgei) const
Return i-th face edge (forward walk order).
static constexpr const zero Zero
Global zero (0)
label thisLabel(const label i) const
vector areaNormal(const UList< point > &points) const
The area normal - with magnitude equal to area of face.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
face triFaceFace() const
Return triangle as a face.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
vector unitNormal(const UList< point > &points) const
The unit normal.
triPointRef tri(const UList< point > &points) const
Return the triangle.
void flip()
Flip the face in-place.
label collapse()
'Collapse' face by marking duplicate point labels.
edgeList rcEdges() const
Return list of edges in reverse walk order.
bool operator!=(const eddy &a, const eddy &b)
A triangle primitive used to calculate face normals and swept volumes.
label which(const label pointLabel) const
Find local index on face for the point label, same as find()
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
label nTriangles() const noexcept
Number of triangles after splitting == 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.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
edgeList edges() const
Return list of edges in forward walk order.
scalar sweptVol(const UList< point > &opts, const UList< point > &npts) const
Return swept-volume from old-points to new-points.
point centre(const UList< point > &points) const
Return centre (centroid)
int edgeDirection(const Foam::edge &e) const
Test the edge direction on the face.
Vector< scalar > vector
A scalar version of the templated Vector.
pointHit nearestPoint(const point &p, const UList< point > &points) const
Return nearest point to face.
label nEdges() const noexcept
Return number of edges == 3.
pointHit nearestPointClassify(const point &p, const UList< point > &points, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
A triangular face using a FixedList of labels corresponding to mesh vertices.
Foam::edge rcEdge(const label edgei) const
Return i-th face edge in reverse walk order.
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.
scalar mag(const UList< point > &points) const
Magnitude of face area.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D vector of objects of type <T> with a fixed length <N>.
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.
const dimensionedScalar e
Elementary charge.
label prevLabel(const label i) const
Previous vertex on face.
const dimensionedScalar c
Speed of light in a vacuum.
label nextLabel(const label i) const
Next vertex on face.
A face is a list of labels corresponding to mesh vertices.
triFace()
Default construct, with invalid point labels (-1)
static int compare(const triFace &a, const triFace &b)
Compare triFaces.
triangle< point, const point & > triPointRef
A triangle using referred points.