Go to the documentation of this file.
33 template<
class Po
int,
class Po
intRef>
49 template<
class Po
int,
class Po
intRef>
63 template<
class Po
int,
class Po
intRef>
72 template<
class Po
int,
class Po
intRef>
79 template<
class Po
int,
class Po
intRef>
86 template<
class Po
int,
class Po
intRef>
93 template<
class Po
int,
class Po
intRef>
100 template<
class Po
int,
class Po
intRef>
128 <<
"index out of range 0 -> 3. faceI = " << faceI
135 template<
class Po
int,
class Po
intRef>
142 template<
class Po
int,
class Po
intRef>
149 template<
class Po
int,
class Po
intRef>
156 template<
class Po
int,
class Po
intRef>
163 template<
class Po
int,
class Po
intRef>
166 return 0.25*(a_ + b_ + c_ + d_);
170 template<
class Po
int,
class Po
intRef>
173 return (1.0/6.0)*(((b_ - a_) ^ (c_ - a_)) & (d_ - a_));
177 template<
class Po
int,
class Po
intRef>
191 scalar denom = (
c & ba);
200 return a_ + 0.5*(a + num/denom);
204 template<
class Po
int,
class Po
intRef>
218 scalar denom = (
c & ba);
230 template<
class Po
int,
class Po
intRef>
237 *
pow3(
min(circumRadius(), GREAT))
243 template<
class Po
int,
class Po
intRef>
268 else if (
s + t + u > 1.0)
275 return (1 -
s - t - u)*a_ +
s*b_ + t*c_ + u*d_;
279 template<
class Po
int,
class Po
intRef>
304 else if (
s + t + u > 1.0)
311 return (1 -
s - t - u)*a_ +
s*b_ + t*c_ + u*d_;
315 template<
class Po
int,
class Po
intRef>
331 e0.
x(), e1.
x(), e2.
x(),
332 e0.
y(), e1.
y(), e2.
y(),
333 e0.
z(), e1.
z(), e2.
z()
336 scalar detT =
det(t);
354 bary[3] = (1.0 - res.
x() - res.
y() - res.
z());
360 template<
class Po
int,
class Po
intRef>
374 scalar minOutsideDistance = VGREAT;
378 if (((
p - b_) & Sa()) >= 0)
385 if (info.
distance() < minOutsideDistance)
389 minOutsideDistance = info.
distance();
393 if (((
p - a_) & Sb()) >= 0)
400 if (info.
distance() < minOutsideDistance)
404 minOutsideDistance = info.
distance();
408 if (((
p - a_) & Sc()) >= 0)
415 if (info.
distance() < minOutsideDistance)
419 minOutsideDistance = info.
distance();
423 if (((
p - a_) & Sd()) >= 0)
430 if (info.
distance() < minOutsideDistance)
434 minOutsideDistance = info.
distance();
442 minOutsideDistance = 0;
455 template<
class Po
int,
class Po
intRef>
477 const point& basePt = b_;
482 if (((pt - basePt) &
n) > SMALL)
490 const point& basePt = c_;
495 if (((pt - basePt) &
n) > SMALL)
503 const point& basePt = b_;
508 if (((pt - basePt) &
n) > SMALL)
516 const point& basePt = b_;
521 if (((pt - basePt) &
n) > SMALL)
531 template<
class Po
int,
class Po
intRef>
539 template<
class Po
int,
class Po
intRef>
546 template<
class Po
int,
class Po
intRef>
556 template<
class Po
int,
class Po
intRef>
568 template<
class Po
int,
class Po
intRef>
574 tets_[nTets_++] = tet;
578 template<
class Po
int,
class Po
intRef>
588 (
d[posI]*t[negI] -
d[negI]*t[posI])
589 / (-
d[negI]+
d[posI]);
593 template<
class Po
int,
class Po
intRef>
594 template<
class TetOp>
607 template<
class Po
int,
class Po
intRef>
608 template<
class AboveTetOp,
class BelowTetOp>
665 if (i0 == 0 || i0 == 2)
726 const edge posEdge(pos0, pos1);
728 if (posEdge ==
edge(0, 1))
758 else if (posEdge ==
edge(1, 2))
788 else if (posEdge ==
edge(2, 0))
818 else if (posEdge ==
edge(0, 3))
848 else if (posEdge ==
edge(1, 3))
878 else if (posEdge ==
edge(2, 3))
911 <<
"Missed edge:" << posEdge
938 if (i0 == 0 || i0 == 2)
982 template<
class Po
int,
class Po
intRef>
983 template<
class AboveTetOp,
class BelowTetOp>
997 template<
class Po
int,
class Po
intRef>
1005 is >> t.a_ >> t.b_ >> t.c_ >> t.d_;
1006 is.readEnd(
"tetrahedron");
1008 is.check(
"Istream& operator>>(Istream&, tetrahedron&)");
1014 template<
class Po
int,
class Po
intRef>
1018 const tetrahedron<Point, PointRef>& t
bool inside(const point &pt) const
Return true if point is inside tetrahedron.
Simple random number generator.
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
const vector & normal() const
Return plane normal.
pointHit nearestPoint(const point &p) const
Return nearest point to p on tetrahedron. Is p itself.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Type sample01()
Return a sample whose components lie in the range 0-1.
static void tetSliceWithPlane(const plane &pl, const tetPoints &tet, AboveTetOp &aboveOp, BelowTetOp &belowOp)
const dimensionedScalar mu
Atomic mass unit.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
const Point & rawPoint() const
Return point with no checking.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Point circumCentre() const
Return circum-centre.
tetrahedron(const Point &a, const Point &b, const Point &c, const Point &d)
Construct from points.
dimensioned< scalar > mag(const dimensioned< Type > &)
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
A triangle primitive used to calculate face normals and swept volumes.
scalar distance() const
Return distance to hit.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static point planeIntersection(const FixedList< scalar, 4 > &, const tetPoints &, const label, const label)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
vector normal() const
Return vector normal.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
triPointRef tri(const label faceI) const
Return i-th face.
scalar circumRadius() const
Return circum-radius.
scalar quality() const
Return quality: Ratio of tetrahedron and circum-sphere.
PointHit< point > pointHit
tetPointRef tet() const
Return the tetrahedron.
scalar scalar01()
Returns the current sample.
errorManip< error > abort(error &err)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
const Point & a() const
Return vertices.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
vector Sa() const
Return face normal.
Point randomPoint(Random &rndGen) const
Return a random point in the tetrahedron from a.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Point centre() const
Return centre (centroid)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const point & refPoint() const
Return or return plane base point.
const dimensionedScalar c
Speed of light in a vacuum.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
storeOp(tetIntersectionList &, label &)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
scalar barycentric(const point &pt, List< scalar > &bary) const
Calculate the barycentric coordinates of the given.
Istream & readBegin(const char *funcName)
scalar mag() const
Return volume.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
cachedRandom rndGen(label(0), -1)
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
void sliceWithPlane(const plane &pl, AboveTetOp &aboveOp, BelowTetOp &belowOp) const
Decompose tet into tets above and below plane.
static void decomposePrism(const FixedList< point, 6 > &points, TetOp &op)
triangle< point, const point & > triPointRef