AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::primal::Tetrahedron< T, NDIMS > Class Template Reference

Represents a tetrahedral geometric shape defined by four points. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/primal/geometry/Tetrahedron.hpp>

Public Types

enum  { NUM_TET_VERTS = 4 }
 
typedef Point< T, NDIMS > PointType
 
typedef Vector< T, NDIMS > VectorType
 

Public Member Functions

 Tetrahedron ()
 Default constructor. Creates a degenerate tetrahedron. More...
 
 Tetrahedron (const PointType &A, const PointType &B, const PointType &C, const PointType &D)
 Custom Constructor. Creates a tetrahedron from the 4 points A,B,C,D. More...
 
 ~Tetrahedron ()
 Destructor. More...
 
PointTypeoperator[] (int idx)
 Index operator to get the i^th vertex. More...
 
const PointTypeoperator[] (int idx) const
 Index operator to get the i^th vertex. More...
 
bool degenerate (double eps=1.0e-12) const
 Returns whether the tetrahedron is degenerate. More...
 
Point< double, 4 > physToBarycentric (const PointType &p) const
 Returns the barycentric coordinates of a point within a tetrahedron. More...
 
std::ostream & print (std::ostream &os) const
 Simple formatted print of a tetrahedron instance. More...
 
double signedVolume () const
 Returns the signed volume of the tetrahedron. More...
 
double volume () const
 Returns the signed volume of the tetrahedron. More...
 

Detailed Description

template<typename T, int NDIMS>
class axom::primal::Tetrahedron< T, NDIMS >

Represents a tetrahedral geometric shape defined by four points.

Template Parameters
Tthe coordinate type, e.g., double, float, etc.
NDIMSthe number of spatial dimensions

Member Typedef Documentation

◆ PointType

template<typename T , int NDIMS>
typedef Point<T, NDIMS> axom::primal::Tetrahedron< T, NDIMS >::PointType

◆ VectorType

template<typename T , int NDIMS>
typedef Vector<T, NDIMS> axom::primal::Tetrahedron< T, NDIMS >::VectorType

Member Enumeration Documentation

◆ anonymous enum

template<typename T , int NDIMS>
anonymous enum
Enumerator
NUM_TET_VERTS 

Constructor & Destructor Documentation

◆ Tetrahedron() [1/2]

template<typename T , int NDIMS>
axom::primal::Tetrahedron< T, NDIMS >::Tetrahedron ( )
inline

Default constructor. Creates a degenerate tetrahedron.

◆ Tetrahedron() [2/2]

template<typename T , int NDIMS>
axom::primal::Tetrahedron< T, NDIMS >::Tetrahedron ( const PointType A,
const PointType B,
const PointType C,
const PointType D 
)
inline

Custom Constructor. Creates a tetrahedron from the 4 points A,B,C,D.

Parameters
[in]Apoint instance corresponding to vertex A of the tetrahedron.
[in]Bpoint instance corresponding to vertex B of the tetrahedron.
[in]Cpoint instance corresponding to vertex C of the tetrahedron.
[in]Dpoint instance corresponding to vertex D of the tetrahedron.

References A, B, and C.

◆ ~Tetrahedron()

template<typename T , int NDIMS>
axom::primal::Tetrahedron< T, NDIMS >::~Tetrahedron ( )
inline

Destructor.

Member Function Documentation

◆ operator[]() [1/2]

template<typename T , int NDIMS>
PointType& axom::primal::Tetrahedron< T, NDIMS >::operator[] ( int  idx)
inline

Index operator to get the i^th vertex.

Parameters
idxThe index of the desired vertex
Precondition
idx is 0, 1, 2, or 3

References axom::primal::Tetrahedron< T, NDIMS >::NUM_TET_VERTS, and SLIC_ASSERT.

◆ operator[]() [2/2]

template<typename T , int NDIMS>
const PointType& axom::primal::Tetrahedron< T, NDIMS >::operator[] ( int  idx) const
inline

Index operator to get the i^th vertex.

Parameters
idxThe index of the desired vertex
Precondition
idx is 0, 1, 2, or 3

References axom::primal::Tetrahedron< T, NDIMS >::NUM_TET_VERTS, and SLIC_ASSERT.

◆ degenerate()

template<typename T , int NDIMS>
bool axom::primal::Tetrahedron< T, NDIMS >::degenerate ( double  eps = 1.0e-12) const
inline

Returns whether the tetrahedron is degenerate.

Returns
true iff the tetrahedron is degenerate (has near zero volume)

References axom::utilities::isNearlyEqual().

◆ physToBarycentric()

template<typename T , int NDIMS>
Point<double, 4> axom::primal::Tetrahedron< T, NDIMS >::physToBarycentric ( const PointType p) const
inline

Returns the barycentric coordinates of a point within a tetrahedron.

Returns
The barycentric coordinates of the tetrahedron
Postcondition
The barycentric coordinates sum to 1.

References axom::numerics::determinant(), axom::utilities::isNearlyEqual(), and SLIC_CHECK_MSG.

◆ print()

template<typename T , int NDIMS>
std::ostream& axom::primal::Tetrahedron< T, NDIMS >::print ( std::ostream &  os) const
inline

Simple formatted print of a tetrahedron instance.

Parameters
osThe output stream to write to
Returns
A reference to the modified ostream

◆ signedVolume()

template<typename T , int NDIMS>
double axom::primal::Tetrahedron< T, NDIMS >::signedVolume ( ) const
inline

Returns the signed volume of the tetrahedron.

See also
volume()

Referenced by axom::primal::Tetrahedron< T, NDIMS >::volume().

◆ volume()

template<typename T , int NDIMS>
double axom::primal::Tetrahedron< T, NDIMS >::volume ( ) const
inline

Returns the signed volume of the tetrahedron.

See also
signedVolume()

References axom::utilities::abs(), and axom::primal::Tetrahedron< T, NDIMS >::signedVolume().


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