tetrahedron< Point, PointRef > Class Template Reference

A tetrahedron primitive. More...

Classes

class  dummyOp
 Dummy. More...
 
class  storeOp
 Store resulting tets. More...
 
class  sumVolOp
 Sum resulting volumes. More...
 

Public Types

enum  { nVertices = 4 , nEdges = 6 }
 
typedef FixedList< tetPoints, 200 > tetIntersectionList
 Storage type for tets originating from intersecting tets. More...
 

Public Member Functions

 tetrahedron (const Point &a, const Point &b, const Point &c, const Point &d)
 Construct from points. More...
 
 tetrahedron (const UList< Point > &points, const FixedList< label, 4 > &indices)
 Construct from four points in the list of points. More...
 
 tetrahedron (Istream &)
 Construct from Istream. More...
 
const Pointa () const
 Return vertices. More...
 
const Pointb () const
 
const Pointc () const
 
const Pointd () const
 
triPointRef tri (const label facei) const
 Return i-th face. More...
 
vector Sa () const
 Face area normal for side a. More...
 
vector Sb () const
 Face area normal for side b. More...
 
vector Sc () const
 Face area normal for side c. More...
 
vector Sd () const
 Face area normal for side d. More...
 
Point centre () const
 Return centre (centroid) More...
 
scalar mag () const
 Return volume. More...
 
Point circumCentre () const
 Return circum-centre. More...
 
scalar circumRadius () const
 Return circum-radius. More...
 
scalar quality () const
 Return quality: Ratio of tetrahedron and circum-sphere. More...
 
Point randomPoint (Random &rndGen) const
 Return a random point in the tetrahedron from a. More...
 
Point barycentricToPoint (const barycentric &bary) const
 Calculate the point from the given barycentric coordinates. More...
 
barycentric pointToBarycentric (const point &pt) const
 Calculate the barycentric coordinates from the given point. More...
 
scalar pointToBarycentric (const point &pt, barycentric &bary) const
 Calculate the barycentric coordinates from the given point. More...
 
pointHit nearestPoint (const point &p) const
 Return nearest point to p on tetrahedron. Is p itself. More...
 
bool inside (const point &pt) const
 Return true if point is inside tetrahedron. More...
 
template<class AboveTetOp , class BelowTetOp >
void sliceWithPlane (const plane &pl, AboveTetOp &aboveOp, BelowTetOp &belowOp) const
 Decompose tet into tets above and below plane. More...
 
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. More...
 
pointHit containmentSphere (const scalar tol) const
 Return (min)containment sphere, i.e. the smallest sphere with. More...
 
void gradNiSquared (scalarField &buffer) const
 Fill buffer with shape function products. More...
 
void gradNiDotGradNj (scalarField &buffer) const
 
void gradNiGradNi (tensorField &buffer) const
 
void gradNiGradNj (tensorField &buffer) const
 
boundBox bounds () const
 Calculate the bounding box. More...
 

Friends

Istreamoperator>> (Istream &, tetrahedron &)
 
Ostreamoperator (Ostream &, const tetrahedron &)
 

Detailed Description

template<class Point, class PointRef>
class Foam::tetrahedron< Point, PointRef >

A tetrahedron primitive.

Ordering of edges needs to be the same for a tetrahedron class, a tetrahedron cell shape model and a tetCell.

Source files

Definition at line 86 of file tetrahedron.H.

Member Typedef Documentation

◆ tetIntersectionList

Storage type for tets originating from intersecting tets.

(can possibly be smaller than 200)

Definition at line 94 of file tetrahedron.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
nVertices 
nEdges 

Definition at line 165 of file tetrahedron.H.

Constructor & Destructor Documentation

◆ tetrahedron() [1/3]

tetrahedron ( const Point a,
const Point b,
const Point c,
const Point d 
)
inline

Construct from points.

Definition at line 37 of file tetrahedronI.H.

◆ tetrahedron() [2/3]

tetrahedron ( const UList< Point > &  points,
const FixedList< label, 4 > &  indices 
)
inline

Construct from four points in the list of points.

Definition at line 53 of file tetrahedronI.H.

◆ tetrahedron() [3/3]

tetrahedron ( Istream is)
inline

Construct from Istream.

Definition at line 67 of file tetrahedronI.H.

Member Function Documentation

◆ a()

const Point & a
inline

Return vertices.

Definition at line 76 of file tetrahedronI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ b()

const Point & b
inline

Definition at line 83 of file tetrahedronI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ c()

const Point & c
inline

Definition at line 90 of file tetrahedronI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ d()

const Point & d
inline

Definition at line 97 of file tetrahedronI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ tri()

Foam::triPointRef tri ( const label  facei) const
inline

Return i-th face.

Definition at line 104 of file tetrahedronI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ Sa()

Foam::vector Sa
inline

Face area normal for side a.

Definition at line 137 of file tetrahedronI.H.

References triangle< Point, PointRef >::areaNormal().

Here is the call graph for this function:

◆ Sb()

Foam::vector Sb
inline

Face area normal for side b.

Definition at line 144 of file tetrahedronI.H.

References triangle< Point, PointRef >::areaNormal().

Here is the call graph for this function:

◆ Sc()

Foam::vector Sc
inline

Face area normal for side c.

Definition at line 151 of file tetrahedronI.H.

References triangle< Point, PointRef >::areaNormal().

Here is the call graph for this function:

◆ Sd()

Foam::vector Sd
inline

Face area normal for side d.

Definition at line 158 of file tetrahedronI.H.

References triangle< Point, PointRef >::areaNormal().

Here is the call graph for this function:

◆ centre()

Point centre
inline

Return centre (centroid)

Definition at line 165 of file tetrahedronI.H.

Referenced by nearWallFields::calcAddressing().

Here is the caller graph for this function:

◆ mag()

Foam::scalar mag
inline

Return volume.

Definition at line 172 of file tetrahedronI.H.

Referenced by Dual< Type >::Dual(), Moment< Type >::Moment(), and wallBoundedParticle::trackToEdge().

Here is the caller graph for this function:

◆ circumCentre()

Point circumCentre
inline

Return circum-centre.

Definition at line 179 of file tetrahedronI.H.

References b, lambda(), Foam::mag(), Foam::magSqr(), and mu.

Here is the call graph for this function:

◆ circumRadius()

Foam::scalar circumRadius
inline

Return circum-radius.

Definition at line 206 of file tetrahedronI.H.

References b, lambda(), Foam::mag(), Foam::magSqr(), and mu.

Here is the call graph for this function:

◆ quality()

Foam::scalar quality
inline

Return quality: Ratio of tetrahedron and circum-sphere.

volume, scaled so that a regular tetrahedron has a quality of 1

Definition at line 232 of file tetrahedronI.H.

References Foam::mag(), Foam::min(), Foam::pow3(), and Foam::sqrt().

Referenced by polyMeshTetDecomposition::minQuality().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ randomPoint()

Point randomPoint ( Random rndGen) const
inline

Return a random point in the tetrahedron from a.

uniform distribution

Definition at line 245 of file tetrahedronI.H.

References Foam::barycentric01(), and rndGen.

Here is the call graph for this function:

◆ barycentricToPoint()

Point barycentricToPoint ( const barycentric bary) const
inline

Calculate the point from the given barycentric coordinates.

Definition at line 255 of file tetrahedronI.H.

Referenced by interpolation< Type >::interpolate().

Here is the caller graph for this function:

◆ pointToBarycentric() [1/2]

Foam::barycentric pointToBarycentric ( const point pt) const
inline

Calculate the barycentric coordinates from the given point.

Definition at line 265 of file tetrahedronI.H.

Referenced by cellPointWeight::findTetrahedron().

Here is the caller graph for this function:

◆ pointToBarycentric() [2/2]

Foam::scalar pointToBarycentric ( const point pt,
barycentric bary 
) const
inline

Calculate the barycentric coordinates from the given point.

Returns the determinant.

Definition at line 277 of file tetrahedronI.H.

References Foam::cmptSum(), Foam::det(), Foam::inv(), Foam::mag(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ nearestPoint()

Foam::pointHit nearestPoint ( const point p) const
inline

Return nearest point to p on tetrahedron. Is p itself.

if inside.

Definition at line 320 of file tetrahedronI.H.

References PointHit< PointType >::distance(), triangle< Point, PointRef >::nearestPoint(), p, and PointHit< PointType >::rawPoint().

Referenced by cellPointWeight::findTetrahedron().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inside()

bool inside ( const point pt) const
inline

Return true if point is inside tetrahedron.

Definition at line 415 of file tetrahedronI.H.

References Foam::mag(), n, and Foam::Zero.

Referenced by polyMeshTetDecomposition::findTet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sliceWithPlane()

void sliceWithPlane ( const plane pl,
AboveTetOp &  aboveOp,
BelowTetOp &  belowOp 
) const
inline

Decompose tet into tets above and below plane.

Definition at line 1021 of file tetrahedronI.H.

◆ tetOverlap()

void tetOverlap ( const tetrahedron< Point, PointRef > &  tetB,
tetIntersectionList insideTets,
label &  nInside,
tetIntersectionList outsideTets,
label &  nOutside 
) const
inline

Decompose tet into tets inside and outside other tet.

◆ containmentSphere()

Foam::pointHit containmentSphere ( const scalar  tol) const

Return (min)containment sphere, i.e. the smallest sphere with.

all points inside. Returns pointHit with:

  • hit : if sphere is equal to circumsphere (biggest sphere)
  • point : centre of sphere
  • distance : radius of sphere
  • eligiblemiss: false Tol (small compared to 1, e.g. 1e-9) is used to determine whether point is inside: mag(pt - ctr) < (1+tol)*radius.

Definition at line 35 of file tetrahedron.C.

References triangle< Point, PointRef >::circumCentre(), Foam::magSqr(), PointHit< PointType >::rawPoint(), PointHit< PointType >::setDistance(), PointHit< PointType >::setHit(), PointHit< PointType >::setMiss(), PointHit< PointType >::setPoint(), and Foam::sqrt().

Here is the call graph for this function:

◆ gradNiSquared()

void gradNiSquared ( scalarField buffer) const

Fill buffer with shape function products.

Definition at line 247 of file tetrahedron.C.

References Foam::mag(), and Foam::magSqr().

Here is the call graph for this function:

◆ gradNiDotGradNj()

void gradNiDotGradNj ( scalarField buffer) const

Definition at line 268 of file tetrahedron.C.

References Foam::mag().

Here is the call graph for this function:

◆ gradNiGradNi()

void gradNiGradNi ( tensorField buffer) const

Definition at line 298 of file tetrahedron.C.

References Foam::mag(), and Foam::sqr().

Here is the call graph for this function:

◆ gradNiGradNj()

void gradNiGradNj ( tensorField buffer) const

Definition at line 316 of file tetrahedron.C.

References Foam::mag().

Here is the call graph for this function:

◆ bounds()

Calculate the bounding box.

Definition at line 342 of file tetrahedron.C.

References b, max(), and Foam::min().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream & operator>> ( Istream ,
tetrahedron< Point, PointRef > &   
)
friend

◆ operator

Ostream & operator ( Ostream ,
const tetrahedron< Point, PointRef > &   
)
friend

The documentation for this class was generated from the following files: