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

Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transformation as a matrix-barycentric inner-product. More...

#include <BarycentricTensor.H>

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

Public Types

enum  components {
  XA , XB , XC , XD ,
  YA , YB , YC , YD ,
  ZA , ZB , ZC , ZD
}
 Component labeling enumeration. More...
typedef BarycentricTensor< label > labelType
 Equivalent type of labels used for valid component indexing (unused).
Public Types inherited from MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, 4, 3 >
typedef MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows, Ncols > msType
 MatrixSpace type.
Public Types inherited from VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >
typedef VectorSpace< BarycentricTensor< 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

 BarycentricTensor ()=default
 Default construct.
 BarycentricTensor (const Foam::zero)
 Construct initialised to zero.
 BarycentricTensor (const Barycentric< Cmpt > &x, const Barycentric< Cmpt > &y, const Barycentric< Cmpt > &z)
 Construct given three barycentric components (rows).
 BarycentricTensor (const Vector< Cmpt > &a, const Vector< Cmpt > &b, const Vector< Cmpt > &c, const Vector< Cmpt > &d)
 Construct given four vector components (columns).
const Cmpt & xa () const noexcept
const Cmpt & xb () const noexcept
const Cmpt & xc () const noexcept
const Cmpt & xd () const noexcept
const Cmpt & ya () const noexcept
const Cmpt & yb () const noexcept
const Cmpt & yc () const noexcept
const Cmpt & yd () const noexcept
const Cmpt & za () const noexcept
const Cmpt & zb () const noexcept
const Cmpt & zc () const noexcept
const Cmpt & zd () const noexcept
Barycentric< Cmpt > x () const
Barycentric< Cmpt > y () const
Barycentric< Cmpt > z () const
Vector< Cmpt > a () const
Vector< Cmpt > b () const
Vector< Cmpt > c () const
Vector< Cmpt > d () const
Vector< Cmpt > inner (const Barycentric< Cmpt > &bry) const
 Tensor/barycentric inner product.
Public Member Functions inherited from MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, 4, 3 >
Foam::MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows, Ncols >::template ConstBlock< SubTensor, BRowStart, BColStart > block () const
Foam::MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows, Ncols >::template Block< SubTensor, BRowStart, BColStart > block ()
 MatrixSpace ()=default
 Default construct.
const Cmpt & elmt () const noexcept
 Fast const element access using compile-time addressing.
const Cmpt & xx () const noexcept
const Cmpt & xy () const noexcept
const Cmpt & xz () const noexcept
const Cmpt & yx () const noexcept
const Cmpt & yy () const noexcept
const Cmpt & yz () const noexcept
const Cmpt & zx () const noexcept
const Cmpt & zy () const noexcept
const Cmpt & zz () const noexcept
typeOfTranspose< Cmpt, BarycentricTensor< Cmpt > >::type T () const
 Return the transpose of the matrix.
const Cmpt & operator() (const direction i, const direction j) const
 (i, j) const element access operator
void operator= (Foam::zero)
 Assignment to zero.
void operator&= (const MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, Ncols, Ncols > &matrix)
 Inner product with a compatible square matrix.
Public Member Functions inherited from VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >
const Foam::VectorSpace< BarycentricTensor< 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< BarycentricTensor< Cmpt >, Cmpt, Ncmpts > &)
void operator+= (const VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Ncmpts > &)
void operator-= (const VectorSpace< BarycentricTensor< 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 = 2
 Rank of BarycentricTensor is 2.
Static Public Attributes inherited from MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, 4, 3 >
static constexpr direction mRows
static constexpr direction nCols
Static Public Attributes inherited from VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >
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 BarycentricTensor< Cmpt > zero
static const BarycentricTensor< Cmpt > one
static const BarycentricTensor< Cmpt > max
static const BarycentricTensor< Cmpt > min
static const BarycentricTensor< Cmpt > rootMax
static const BarycentricTensor< Cmpt > rootMin

Additional Inherited Members

Static Public Member Functions inherited from MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, 4, 3 >
static direction m () noexcept
 The number of rows.
static direction n () noexcept
 The number of columns.
static msType identity ()
 An identity matrix for square matrix-spaces.
Static Public Member Functions inherited from VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts.
static BarycentricTensor< Cmpt > uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s.
Public Attributes inherited from VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >
Cmpt v_ [Ncmpts]
 The components of this vector space.

Detailed Description

template<class Cmpt>
class Foam::BarycentricTensor< Cmpt >

Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transformation as a matrix-barycentric inner-product.

Source files

Definition at line 52 of file BarycentricTensor.H.

Member Typedef Documentation

◆ labelType

template<class Cmpt>
typedef BarycentricTensor<label> labelType

Equivalent type of labels used for valid component indexing (unused).

Definition at line 64 of file BarycentricTensor.H.

Member Enumeration Documentation

◆ components

template<class Cmpt>
enum components

Component labeling enumeration.

Enumerator
XA 
XB 
XC 
XD 
YA 
YB 
YC 
YD 
ZA 
ZB 
ZC 
ZD 

Definition at line 78 of file BarycentricTensor.H.

Constructor & Destructor Documentation

◆ BarycentricTensor() [1/4]

template<class Cmpt>
BarycentricTensor ( )
default

Default construct.

Referenced by BarycentricTensor(), and inner().

Here is the caller graph for this function:

◆ BarycentricTensor() [2/4]

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

Construct initialised to zero.

Definition at line 25 of file BarycentricTensorI.H.

References BarycentricTensor(), and Foam::Zero.

Here is the call graph for this function:

◆ BarycentricTensor() [3/4]

template<class Cmpt>
BarycentricTensor ( const Barycentric< Cmpt > & x,
const Barycentric< Cmpt > & y,
const Barycentric< Cmpt > & z )
inline

Construct given three barycentric components (rows).

Definition at line 32 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, x(), XA, XB, XC, XD, y(), YA, YB, YC, YD, z(), ZA, ZB, ZC, and ZD.

Here is the call graph for this function:

◆ BarycentricTensor() [4/4]

template<class Cmpt>
BarycentricTensor ( const Vector< Cmpt > & a,
const Vector< Cmpt > & b,
const Vector< Cmpt > & c,
const Vector< Cmpt > & d )
inline

Construct given four vector components (columns).

Eg, the corners of a tetrahedron

Definition at line 57 of file BarycentricTensorI.H.

References a(), b(), c(), d(), VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, XA, XB, XC, XD, YA, YB, YC, YD, ZA, ZB, ZC, and ZD.

Here is the call graph for this function:

Member Function Documentation

◆ xa()

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

Definition at line 124 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ xb()

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

Definition at line 125 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ xc()

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

Definition at line 126 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ xd()

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

Definition at line 127 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ ya()

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

Definition at line 129 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ yb()

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

Definition at line 130 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ yc()

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

Definition at line 131 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ yd()

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

Definition at line 132 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ za()

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

Definition at line 134 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ zb()

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

Definition at line 135 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ zc()

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

Definition at line 136 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ zd()

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

Definition at line 137 of file BarycentricTensor.H.

Referenced by inner().

Here is the caller graph for this function:

◆ x()

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

Definition at line 85 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, XA, XB, XC, and XD.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ y()

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

Definition at line 99 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, YA, YB, YC, and YD.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ z()

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

Definition at line 113 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, ZA, ZB, ZC, and ZD.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ a()

template<class Cmpt>
Foam::Vector< Cmpt > a ( ) const
inline

Definition at line 127 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, XA, YA, and ZA.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ b()

template<class Cmpt>
Foam::Vector< Cmpt > b ( ) const
inline

Definition at line 134 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, XB, YB, and ZB.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ c()

template<class Cmpt>
Foam::Vector< Cmpt > c ( ) const
inline

Definition at line 141 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, XC, YC, and ZC.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ d()

template<class Cmpt>
Foam::Vector< Cmpt > d ( ) const
inline

Definition at line 148 of file BarycentricTensorI.H.

References VectorSpace< BarycentricTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_, XD, YD, and ZD.

Referenced by BarycentricTensor().

Here is the caller graph for this function:

◆ inner()

template<class Cmpt>
Foam::Vector< Cmpt > inner ( const Barycentric< Cmpt > & bry) const
inline

Tensor/barycentric inner product.

(transforms barycentric coordinates to vector)

Definition at line 161 of file BarycentricTensorI.H.

References Barycentric< Cmpt >::a(), Barycentric< Cmpt >::b(), BarycentricTensor(), Barycentric< Cmpt >::c(), Barycentric< Cmpt >::d(), xa(), xb(), xc(), xd(), ya(), yb(), yc(), yd(), za(), zb(), zc(), and zd().

Here is the call graph for this function:

Member Data Documentation

◆ rank

template<class Cmpt>
direction rank = 2
staticconstexpr

Rank of BarycentricTensor is 2.

Definition at line 72 of file BarycentricTensor.H.


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