32 template<
class Po
int,
class Po
intRef>
48 template<
class Po
int,
class Po
intRef>
62 template<
class Po
int,
class Po
intRef>
71 template<
class Po
int,
class Po
intRef>
78 template<
class Po
int,
class Po
intRef>
85 template<
class Po
int,
class Po
intRef>
92 template<
class Po
int,
class Po
intRef>
99 template<
class Po
int,
class Po
intRef>
127 <<
"index out of range 0 -> 3. facei = " << facei
134 template<
class Po
int,
class Po
intRef>
141 template<
class Po
int,
class Po
intRef>
148 template<
class Po
int,
class Po
intRef>
155 template<
class Po
int,
class Po
intRef>
162 template<
class Po
int,
class Po
intRef>
165 return 0.25*(a_ + b_ + c_ + d_);
169 template<
class Po
int,
class Po
intRef>
172 return (1.0/6.0)*(((b_ - a_) ^ (c_ - a_)) & (d_ - a_));
176 template<
class Po
int,
class Po
intRef>
191 const scalar denom = (
c & ba);
196 static const scalar sqrt3 =
sqrt(scalar(3));
201 const vector v = (a + num/denom)/2;
207 template<
class Po
int,
class Po
intRef>
210 const scalar r = circumSphere().second();
211 static const scalar sqrt3 =
sqrt(scalar(3));
212 return mag()/((8.0/27.0)*sqrt3*
pow3(
min(r, great)) + rootVSmall);
216 template<
class Po
int,
class Po
intRef>
226 template<
class Po
int,
class Po
intRef>
232 return bary[0]*a_ + bary[1]*b_ + bary[2]*c_ + bary[3]*d_;
236 template<
class Po
int,
class Po
intRef>
243 pointToBarycentric(pt, bary);
248 template<
class Po
int,
class Po
intRef>
264 e0.
x(), e1.
x(), e2.
x(),
265 e0.
y(), e1.
y(), e2.
y(),
266 e0.
z(), e1.
z(), e2.
z()
269 scalar detT =
det(t);
291 template<
class Po
int,
class Po
intRef>
305 scalar minOutsideDistance = vGreat;
309 if (((
p - b_) & Sa()) >= 0)
316 if (info.
distance() < minOutsideDistance)
320 minOutsideDistance = info.
distance();
324 if (((
p - a_) & Sb()) >= 0)
331 if (info.
distance() < minOutsideDistance)
335 minOutsideDistance = info.
distance();
339 if (((
p - a_) & Sc()) >= 0)
346 if (info.
distance() < minOutsideDistance)
350 minOutsideDistance = info.
distance();
354 if (((
p - a_) & Sd()) >= 0)
361 if (info.
distance() < minOutsideDistance)
365 minOutsideDistance = info.
distance();
373 minOutsideDistance = 0;
386 template<
class Po
int,
class Po
intRef>
408 const point& basePt = b_;
413 if (((pt - basePt) &
n) > small)
421 const point& basePt = c_;
426 if (((pt - basePt) &
n) > small)
434 const point& basePt = b_;
439 if (((pt - basePt) &
n) > small)
447 const point& basePt = b_;
452 if (((pt - basePt) &
n) > small)
462 template<
class Po
int,
class Po
intRef>
476 template<
class Po
int,
class Po
intRef>
484 is >> t.a_ >> t.b_ >> t.c_ >> t.d_;
487 is.
check(
"Istream& operator>>(Istream&, tetrahedron&)");
493 template<
class Po
int,
class Po
intRef>
497 const tetrahedron<Point, PointRef>& t
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Istream & readEnd(const char *funcName)
Istream & readBegin(const char *funcName)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
scalar distance() const
Return distance to hit.
const Point & rawPoint() const
Return point with no checking.
A 2-tuple for storing two objects of different types.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
A bounding box defined in terms of the points at its extremities.
barycentric pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
triPointRef tri(const label facei) const
Return i-th face.
boundBox bounds() const
Calculate the bounding box.
const Point & a() const
Return vertices.
Point centre() const
Return centre (centroid)
bool inside(const point &pt) const
Return true if point is inside tetrahedron.
Tuple2< Point, scalar > circumSphere() const
Return the circum centre and radius.
scalar mag() const
Return volume.
pointHit nearestPoint(const point &p) const
Return nearest point to p on tetrahedron. Is p itself.
Point randomPoint(randomGenerator &rndGen) const
Return a random point in the tetrahedron from a.
Point barycentricToPoint(const barycentric &bary) const
Calculate the point from the given barycentric coordinates.
tetrahedron(const Point &a, const Point &b, const Point &c, const Point &d)
Construct from points.
scalar quality() const
Return quality: Ratio of tetrahedron and circum-sphere.
vector Sa() const
Return face normal.
A triangle primitive used to calculate face areas and swept volumes.
vector area() const
Return vector area.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar lambda(viscosity->lookup("lambda"))
const dimensionedScalar mu
Atomic mass unit.
const dimensionedScalar c
Speed of light in a vacuum.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar pow3(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
barycentric barycentric01(randomGenerator &rndGen)
Generate a random barycentric coordinate within the unit tetrahedron.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
PointHit< point > pointHit
triangle< point, const point & > triPointRef
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Cmpt cmptSum(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
randomGenerator rndGen(653213)