Loading...
Searching...
No Matches
Barycentric< Cmpt > Class Template Reference

Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant. More...

#include <Barycentric.H>

Inheritance diagram for Barycentric< Cmpt >:
Collaboration diagram for Barycentric< Cmpt >:

Public Types

enum  components { A , B , C , D }
 Component labeling enumeration. More...
typedef Barycentric< label > labelType
 Equivalent type of labels used for valid component indexing.
Public Types inherited from VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >
typedef VectorSpace< Barycentric< Cmpt >, Cmpt, Ncmpts > vsType
 VectorSpace type.
typedef Cmpt cmptType
 Component type.
typedef Cmpt magType
 Magnitude type.
typedef direction size_type
 The type to represent the size of a VectorSpace.
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace.
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace.

Public Member Functions

 Barycentric ()=default
 Default construct.
 Barycentric (const Foam::zero)
 Construct initialized to zero.
 Barycentric (const Cmpt &va, const Cmpt &vb, const Cmpt &vc, const Cmpt &vd)
 Construct from components.
 Barycentric (const Cmpt &va, const Cmpt &vb, const Cmpt &vc)
 Construct from three components, calculate fourth component.
const Cmpt & a () const noexcept
const Cmpt & b () const noexcept
const Cmpt & c () const noexcept
const Cmpt & d () const noexcept
Cmpt & a () noexcept
Cmpt & b () noexcept
Cmpt & c () noexcept
Cmpt & d () noexcept
Cmpt inner (const Barycentric< Cmpt > &b2) const
 Scalar-product of this with another Barycentric.
Public Member Functions inherited from VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >
const Foam::VectorSpace< Barycentric< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 VectorSpace ()=default
 Default construct.
const Cmpt & component (const direction) const
void replace (const direction, const Cmpt &)
const Cmpt * cdata () const noexcept
 Return const pointer to the first data element.
Cmpt * data () noexcept
 Return pointer to the first data element.
void fill (const Cmpt &s)
 Assign all components to given value.
const Cmpt & operator[] (const direction) const
void operator= (const VectorSpace< Barycentric< Cmpt >, Cmpt, Ncmpts > &)
void operator+= (const VectorSpace< Barycentric< Cmpt >, Cmpt, Ncmpts > &)
void operator-= (const VectorSpace< Barycentric< Cmpt >, Cmpt, Ncmpts > &)
void operator*= (const scalar)
void operator/= (const scalar)
iterator begin () noexcept
 Return an iterator (pointer) to begin of VectorSpace.
const_iterator cbegin () const noexcept
 Return const_iterator (const pointer) to begin of VectorSpace.
iterator end () noexcept
 Return an iterator (pointer) to end of VectorSpace.
const_iterator cend () const noexcept
 Return const_iterator (const pointer) to end of VectorSpace.

Static Public Attributes

static constexpr direction rank = 1
 Rank of Barycentric is 1.
Static Public Attributes inherited from VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >
static constexpr direction dim
 Dimensionality of space.
static constexpr direction nComponents
 Number of components in this vector space.
static constexpr direction mRows
static constexpr direction nCols
static const char *const typeName
static const char *const componentNames []
static const Barycentric< Cmpt > zero
static const Barycentric< Cmpt > one
static const Barycentric< Cmpt > max
static const Barycentric< Cmpt > min
static const Barycentric< Cmpt > rootMax
static const Barycentric< Cmpt > rootMin

Additional Inherited Members

Static Public Member Functions inherited from VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts.
static Barycentric< Cmpt > uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s.
Public Attributes inherited from VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >
Cmpt v_ [Ncmpts]
 The components of this vector space.

Detailed Description

template<class Cmpt>
class Foam::Barycentric< Cmpt >

Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant.

Source files

Definition at line 50 of file Barycentric.H.

Member Typedef Documentation

◆ labelType

template<class Cmpt>
typedef Barycentric<label> labelType

Equivalent type of labels used for valid component indexing.

Definition at line 61 of file Barycentric.H.

Member Enumeration Documentation

◆ components

template<class Cmpt>
enum components

Component labeling enumeration.

Enumerator

Definition at line 75 of file Barycentric.H.

Constructor & Destructor Documentation

◆ Barycentric() [1/4]

template<class Cmpt>
Barycentric ( )
default

Default construct.

Referenced by Barycentric(), Barycentric(), and inner().

Here is the caller graph for this function:

◆ Barycentric() [2/4]

template<class Cmpt>
Barycentric ( const Foam::zero )
inline

Construct initialized to zero.

Definition at line 25 of file BarycentricI.H.

References Barycentric(), and Foam::Zero.

Here is the call graph for this function:

◆ Barycentric() [3/4]

template<class Cmpt>
Barycentric ( const Cmpt & va,
const Cmpt & vb,
const Cmpt & vc,
const Cmpt & vd )
inline

Construct from components.

Definition at line 32 of file BarycentricI.H.

References A, B, C, D, and VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >::v_.

◆ Barycentric() [4/4]

template<class Cmpt>
Barycentric ( const Cmpt & va,
const Cmpt & vb,
const Cmpt & vc )
inline

Construct from three components, calculate fourth component.

Definition at line 48 of file BarycentricI.H.

References Barycentric(), and VectorSpace< Barycentric< Cmpt >, Cmpt, 4 >::one.

Here is the call graph for this function:

Member Function Documentation

◆ a() [1/2]

template<class Cmpt>
const Cmpt & a ( ) const
inlinenoexcept

Definition at line 114 of file Barycentric.H.

Referenced by tetIndices::barycentricToPoint(), tetrahedron< Point, PointRef >::barycentricToPoint(), inner(), and BarycentricTensor< Cmpt >::inner().

Here is the caller graph for this function:

◆ b() [1/2]

template<class Cmpt>
const Cmpt & b ( ) const
inlinenoexcept

Definition at line 115 of file Barycentric.H.

Referenced by tetIndices::barycentricToPoint(), tetrahedron< Point, PointRef >::barycentricToPoint(), inner(), and BarycentricTensor< Cmpt >::inner().

Here is the caller graph for this function:

◆ c() [1/2]

template<class Cmpt>
const Cmpt & c ( ) const
inlinenoexcept

Definition at line 116 of file Barycentric.H.

Referenced by tetIndices::barycentricToPoint(), tetrahedron< Point, PointRef >::barycentricToPoint(), inner(), and BarycentricTensor< Cmpt >::inner().

Here is the caller graph for this function:

◆ d() [1/2]

template<class Cmpt>
const Cmpt & d ( ) const
inlinenoexcept

Definition at line 117 of file Barycentric.H.

Referenced by tetIndices::barycentricToPoint(), tetrahedron< Point, PointRef >::barycentricToPoint(), inner(), and BarycentricTensor< Cmpt >::inner().

Here is the caller graph for this function:

◆ a() [2/2]

template<class Cmpt>
Cmpt & a ( )
inlinenoexcept

Definition at line 119 of file Barycentric.H.

◆ b() [2/2]

template<class Cmpt>
Cmpt & b ( )
inlinenoexcept

Definition at line 120 of file Barycentric.H.

◆ c() [2/2]

template<class Cmpt>
Cmpt & c ( )
inlinenoexcept

Definition at line 121 of file Barycentric.H.

◆ d() [2/2]

template<class Cmpt>
Cmpt & d ( )
inlinenoexcept

Definition at line 122 of file Barycentric.H.

◆ inner()

template<class Cmpt>
Cmpt inner ( const Barycentric< Cmpt > & b2) const
inline

Scalar-product of this with another Barycentric.

Definition at line 62 of file BarycentricI.H.

References a(), b(), Barycentric(), c(), and d().

Referenced by Foam::operator&().

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

Member Data Documentation

◆ rank

template<class Cmpt>
direction rank = 1
staticconstexpr

Rank of Barycentric is 1.

Definition at line 69 of file Barycentric.H.


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