SpatialTensor< Cmpt > Class Template Reference

Templated 3D spatial tensor derived from MatrixSpace used to represent transformations of spatial vectors and the angular and linear inertia of rigid bodies. More...

Inheritance diagram for SpatialTensor< Cmpt >:
[legend]
Collaboration diagram for SpatialTensor< Cmpt >:
[legend]

Public Member Functions

 SpatialTensor ()
 Construct null. More...
 
 SpatialTensor (const Foam::zero)
 Construct initialized to zero. More...
 
 SpatialTensor (const typename SpatialTensor::msType &)
 Construct given MatrixSpace of the same rank. More...
 
 SpatialTensor (const Tensor< Cmpt > &t00, const Tensor< Cmpt > &t01, const Tensor< Cmpt > &t10, const Tensor< Cmpt > &t11)
 Construct given 4 tensor blocks. More...
 
 SpatialTensor (const Cmpt &t00, const Cmpt &t01, const Cmpt &t02, const Cmpt &t03, const Cmpt &t04, const Cmpt &t05, const Cmpt &t10, const Cmpt &t11, const Cmpt &t12, const Cmpt &t13, const Cmpt &t14, const Cmpt &t15, const Cmpt &t20, const Cmpt &t21, const Cmpt &t22, const Cmpt &t23, const Cmpt &t24, const Cmpt &t25, const Cmpt &t30, const Cmpt &t31, const Cmpt &t32, const Cmpt &t33, const Cmpt &t34, const Cmpt &t35, const Cmpt &t40, const Cmpt &t41, const Cmpt &t42, const Cmpt &t43, const Cmpt &t44, const Cmpt &t45, const Cmpt &t50, const Cmpt &t51, const Cmpt &t52, const Cmpt &t53, const Cmpt &t54, const Cmpt &t55)
 Construct given 36 components. More...
 
 SpatialTensor (Istream &)
 Construct from Istream. More...
 
- Public Member Functions inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
 MatrixSpace ()=default
 Default construct. More...
 
 MatrixSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 MatrixSpace (const VectorSpace< Form2, Cmpt2, Mrows *Ncols > &)
 Construct as copy of a VectorSpace with the same size. More...
 
 MatrixSpace (const Block2< SpatialTensor< Cmpt >, BRowStart, BColStart > &block)
 Construct from a block of another matrix space. More...
 
 MatrixSpace (Istream &is)
 Construct from Istream. More...
 
const Cmpt & elmt () const
 Fast const element access using compile-time addressing. More...
 
Cmpt & elmt ()
 Fast element access using compile-time addressing. More...
 
const Cmpt & xx () const
 
Cmpt & xx ()
 
const Cmpt & xy () const
 
Cmpt & xy ()
 
const Cmpt & xz () const
 
Cmpt & xz ()
 
const Cmpt & yx () const
 
Cmpt & yx ()
 
const Cmpt & yy () const
 
Cmpt & yy ()
 
const Cmpt & yz () const
 
Cmpt & yz ()
 
const Cmpt & zx () const
 
Cmpt & zx ()
 
const Cmpt & zy () const
 
Cmpt & zy ()
 
const Cmpt & zz () const
 
Cmpt & zz ()
 
typeOfTranspose< Cmpt, SpatialTensor< Cmpt > >::type T () const
 Return the transpose of the matrix. More...
 
ConstBlock< SubTensor, BRowStart, BColStart > block () const
 Return a const sub-block corresponding to the specified type. More...
 
Block< SubTensor, BRowStart, BColStart > block ()
 Return a sub-block corresponding to the specified type. More...
 
Foam::MatrixSpace< SpatialTensor< Cmpt >, Cmpt, Mrows, Ncols >::template ConstBlock< SubTensor, BRowStart, BColStart > block () const
 
Foam::MatrixSpace< SpatialTensor< Cmpt >, Cmpt, Mrows, Ncols >::template Block< SubTensor, BRowStart, BColStart > block ()
 
const Cmpt & operator() (const direction &i, const direction &j) const
 (i, j) const element access operator More...
 
Cmpt & operator() (const direction &i, const direction &j)
 (i, j) element access operator More...
 
void operator= (const Foam::zero)
 Assignment to zero. More...
 
void operator= (const Block2< SpatialTensor< Cmpt >, BRowStart, BColStart > &block)
 Assignment to a block of another matrix space. More...
 
void operator&= (const MatrixSpace< SpatialTensor< Cmpt >, Cmpt, Ncols, Ncols > &matrix)
 Inner product with a compatible square matrix. More...
 
- Public Member Functions inherited from VectorSpace< Form, Cmpt, Ncmpts >
 VectorSpace ()=default
 Default construct. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs)
 Copy construct. More...
 
template<class Form2 , class Cmpt2 >
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy construct of a VectorSpace with the same size. More...
 
 VectorSpace (Istream &is)
 Construct from Istream. More...
 
const Cmpt & component (const direction) const
 
Cmpt & component (const direction)
 
void component (Cmpt &, const direction) const
 
void replace (const direction, const Cmpt &)
 
const Cmpt * cdata () const noexcept
 Return const pointer to the first data element. More...
 
Cmpt * data () noexcept
 Return pointer to the first data element. More...
 
template<class SubVector , direction BStart>
const ConstBlock< SubVector, BStart > block () const
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator+= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator-= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 Return an iterator to begin of VectorSpace. More...
 
iterator end () noexcept
 Return an iterator to end of VectorSpace. More...
 
const_iterator cbegin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator cend () const noexcept
 Return const_iterator to end of VectorSpace. More...
 
const_iterator begin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator end () const noexcept
 Return const_iterator to end of VectorSpace. More...
 
template<class SubVector , Foam::direction BStart>
const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 

Static Public Attributes

static constexpr direction rank = 2
 Rank of Tensor is 2. More...
 
static const SpatialTensor I
 Identity matrix for square matrices. More...
 
- Static Public Attributes inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
static constexpr direction mRows
 
static constexpr direction nCols
 
- Static Public Attributes inherited from VectorSpace< Form, Cmpt, Ncmpts >
static constexpr direction dim = 3
 Dimensionality of space. More...
 
static constexpr direction nComponents = Ncmpts
 Number of components in this vector space. More...
 
static constexpr direction mRows = Ncmpts
 
static constexpr direction nCols = 1
 
static const char *const typeName = "diagTensor"
 
static const char *const componentNames []
 
static const Form zero
 
static const Form one
 
static const Form max
 
static const Form min
 
static const Form rootMax
 
static const Form rootMin
 

Additional Inherited Members

- Public Types inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
typedef MatrixSpace< SpatialTensor< Cmpt >, Cmpt, Mrows, Ncols > msType
 MatrixSpace type. More...
 
- Public Types inherited from VectorSpace< Form, Cmpt, Ncmpts >
typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 VectorSpace type. More...
 
typedef Cmpt cmptType
 Component type. More...
 
typedef Cmpt magType
 Magnitude type. More...
 
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace. More...
 
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace. More...
 
- Static Public Member Functions inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
static direction m () noexcept
 The number of rows. More...
 
static direction n () noexcept
 The number of columns. More...
 
static msType identity ()
 An identity matrix for square matrix-spaces. More...
 
- Static Public Member Functions inherited from VectorSpace< Form, Cmpt, Ncmpts >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts. More...
 
static Form uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s. More...
 
- Public Attributes inherited from VectorSpace< Form, Cmpt, Ncmpts >
Cmpt v_ [Ncmpts]
 The components of this vector space. More...
 

Detailed Description

template<class Cmpt>
class Foam::SpatialTensor< Cmpt >

Templated 3D spatial tensor derived from MatrixSpace used to represent transformations of spatial vectors and the angular and linear inertia of rigid bodies.

Reference:

    Featherstone, R. (2008).
    Rigid body dynamics algorithms.
    Springer.
Source files
See also
Foam::MatrixSpace Foam::Tensor Foam::SpatialVector

Definition at line 67 of file SpatialTensor.H.

Constructor & Destructor Documentation

◆ SpatialTensor() [1/6]

SpatialTensor
inline

Construct null.

Definition at line 33 of file SpatialTensorI.H.

◆ SpatialTensor() [2/6]

SpatialTensor ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 38 of file SpatialTensorI.H.

◆ SpatialTensor() [3/6]

SpatialTensor ( const typename SpatialTensor< Cmpt >::msType ms)
inline

Construct given MatrixSpace of the same rank.

Definition at line 45 of file SpatialTensorI.H.

◆ SpatialTensor() [4/6]

SpatialTensor ( const Tensor< Cmpt > &  t00,
const Tensor< Cmpt > &  t01,
const Tensor< Cmpt > &  t10,
const Tensor< Cmpt > &  t11 
)
inline

Construct given 4 tensor blocks.

Definition at line 55 of file SpatialTensorI.H.

References Tensor< Cmpt >::xx(), Tensor< Cmpt >::xy(), Tensor< Cmpt >::xz(), Tensor< Cmpt >::yx(), Tensor< Cmpt >::yy(), Tensor< Cmpt >::yz(), Tensor< Cmpt >::zx(), Tensor< Cmpt >::zy(), and Tensor< Cmpt >::zz().

Here is the call graph for this function:

◆ SpatialTensor() [5/6]

SpatialTensor ( const Cmpt &  t00,
const Cmpt &  t01,
const Cmpt &  t02,
const Cmpt &  t03,
const Cmpt &  t04,
const Cmpt &  t05,
const Cmpt &  t10,
const Cmpt &  t11,
const Cmpt &  t12,
const Cmpt &  t13,
const Cmpt &  t14,
const Cmpt &  t15,
const Cmpt &  t20,
const Cmpt &  t21,
const Cmpt &  t22,
const Cmpt &  t23,
const Cmpt &  t24,
const Cmpt &  t25,
const Cmpt &  t30,
const Cmpt &  t31,
const Cmpt &  t32,
const Cmpt &  t33,
const Cmpt &  t34,
const Cmpt &  t35,
const Cmpt &  t40,
const Cmpt &  t41,
const Cmpt &  t42,
const Cmpt &  t43,
const Cmpt &  t44,
const Cmpt &  t45,
const Cmpt &  t50,
const Cmpt &  t51,
const Cmpt &  t52,
const Cmpt &  t53,
const Cmpt &  t54,
const Cmpt &  t55 
)
inline

Construct given 36 components.

Definition at line 84 of file SpatialTensorI.H.

◆ SpatialTensor() [6/6]

SpatialTensor ( Istream is)
inline

Construct from Istream.

Definition at line 132 of file SpatialTensorI.H.

Member Data Documentation

◆ rank

constexpr direction rank = 2
staticconstexpr

Rank of Tensor is 2.

Definition at line 77 of file SpatialTensor.H.

◆ I

const Foam::spatialTensor I
static

Identity matrix for square matrices.

Definition at line 83 of file SpatialTensor.H.


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