42#ifndef Foam_tetrahedron_H
43#define Foam_tetrahedron_H
63template<
class Po
int,
class Po
intRef>
class tetrahedron;
65template<
class Po
int,
class Po
intRef>
68template<
class Po
int,
class Po
intRef>
95 void front() =
delete;
170template<
class Po
int,
class Po
intRef>
222 PointRef a_, b_, c_, d_;
227 inline static point planeIntersection
235 template<
class TetOp>
236 inline static void decomposePrism
242 template<
class AboveTetOp,
class BelowTetOp>
243 inline static void tetSliceWithPlane
338 inline scalar
mag()
const;
383 template<
class AboveTetOp,
class BelowTetOp>
A 1D vector of objects of type <T> with a fixed length <N>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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...
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
Tet point storage. Default constructable (tetrahedron is not).
void flip()
Invert tetrahedron by swapping third and fourth vertices.
point & b() noexcept
The second vertex.
void back()=delete
The back() accessor (from FixedList) has no purpose.
void front()=delete
The front() accessor (from FixedList) has no purpose.
const point & c() const noexcept
The third vertex.
point & a() noexcept
The first vertex.
const point & d() const noexcept
The fourth vertex.
const point & b() const noexcept
The second vertex.
Pair< point > box() const
The enclosing (bounding) box for the tetrahedron.
point & d() noexcept
The fourth vertex.
tetPointRef tet() const
Return as tetrahedron reference.
point & c() noexcept
The third vertex.
const point & a() const noexcept
The first vertex.
tetPoints()=default
Default construct.
treeBoundBox bounds() const
The bounding box for the tetrahedron.
Point circumCentre() const
Return circum-centre.
barycentric pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
pointHit containmentSphere(const scalar tol) const
Return (min)containment sphere, i.e. the smallest sphere with.
scalar pointToBarycentric(const point &pt, barycentric &bary) const
Calculate the barycentric coordinates from the given point.
void gradNiDotGradNj(scalarField &buffer) const
void gradNiGradNi(tensorField &buffer) const
vector Sd() const
Face area normal for side d.
triPointRef tri(const label facei) const
Return i-th face.
tetrahedron(const FixedList< Point, 4 > &pts)
Construct from four points.
scalar circumRadius() const
Return circum-radius.
Point centre() const
Return centre (centroid).
vector Sc() const
Face area normal for side c.
bool inside(const point &pt) const
Return true if point is inside tetrahedron.
vector Sb() const
Face area normal for side b.
tetrahedron(const Point &p0, const Point &p1, const Point &p2, const Point &p3)
Construct from four points.
const Point & b() const noexcept
Return vertex b.
scalar mag() const
Return volume.
friend Ostream & operator(Ostream &, const tetrahedron &)
void tetOverlap(const tetrahedron< Point, PointRef > &tetB, tetIntersectionList &insideTets, label &nInside, tetIntersectionList &outsideTets, label &nOutside) const
Decompose tet into tets inside and outside other tet.
void gradNiGradNj(tensorField &buffer) const
pointHit nearestPoint(const point &p) const
Return nearest point to p on tetrahedron. Is p itself.
Point randomPoint(Random &rndGen) const
Return a random point in the tetrahedron from a uniform distribution.
tetrahedron(const UList< Point > &points, const FixedList< label, 4 > &indices)
Construct from four points in the list of points.
Pair< Point > box() const
The enclosing (bounding) box for the tetrahedron.
FixedList< tetPoints, 200 > tetIntersectionList
void sliceWithPlane(const plane &pl, AboveTetOp &aboveOp, BelowTetOp &belowOp) const
Decompose tet into tets above and below plane.
Point barycentricToPoint(const barycentric &bary) const
Calculate the point from the given barycentric coordinates.
treeBoundBox bounds() const
The bounding box for the tetrahedron.
tetrahedron(Istream &)
Construct from Istream.
scalar quality() const
Return quality: Ratio of tetrahedron and circum-sphere volume, scaled so that a regular tetrahedron h...
const Point & c() const noexcept
Return vertex c.
void gradNiSquared(scalarField &buffer) const
Fill buffer with shape function products.
const Point & a() const noexcept
Return vertex a.
vector Sa() const
Face area normal for side a.
const Point & d() const noexcept
Return vertex d.
static Pair< Point > box(const Point &p0, const Point &p1, const Point &p2, const Point &p3)
The enclosing (bounding) box for four points.
Standard boundBox with extra functionality for use in octree.
const volScalarField & p0
PointHit< point > pointHit
A PointHit with a 3D point.
tetrahedron< point, const point & > tetPointRef
A tetrahedron using referred points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
vector point
Point is a vector.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
triangle< point, const point & > triPointRef
A triangle using referred points.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
void operator()(const tetPoints &) const noexcept
tetIntersectionList & tets_
void operator()(const tetPoints &)
storeOp(tetIntersectionList &, label &)
void operator()(const tetPoints &)
constexpr sumVolOp() noexcept
scalar total() const noexcept