Loading...
Searching...
No Matches
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...

#include <SpatialTensor.H>

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

Public Member Functions

 SpatialTensor ()=default
 Default Construct.
 SpatialTensor (const Foam::zero)
 Construct initialized to zero.
 SpatialTensor (const typename SpatialTensor::msType &)
 Construct given MatrixSpace of the same rank.
 SpatialTensor (const Tensor< Cmpt > &t00, const Tensor< Cmpt > &t01, const Tensor< Cmpt > &t10, const Tensor< Cmpt > &t11)
 Construct given 4 tensor blocks.
 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.
 SpatialTensor (Istream &)
 Construct from Istream.
Public Member Functions inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
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 ()
 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, SpatialTensor< 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< SpatialTensor< Cmpt >, Cmpt, Ncols, Ncols > &matrix)
 Inner product with a compatible square matrix.
Public Member Functions inherited from VectorSpace< SpatialTensor< Cmpt >, Cmpt, Mrows *Ncols >
const Foam::VectorSpace< SpatialTensor< 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< SpatialTensor< Cmpt >, Cmpt, Ncmpts > &)
void operator+= (const VectorSpace< SpatialTensor< Cmpt >, Cmpt, Ncmpts > &)
void operator-= (const VectorSpace< SpatialTensor< 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 Tensor is 2.
static const SpatialTensor I
 Identity matrix for square matrices.
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< SpatialTensor< 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 SpatialTensor< Cmpt > zero
static const SpatialTensor< Cmpt > one
static const SpatialTensor< Cmpt > max
static const SpatialTensor< Cmpt > min
static const SpatialTensor< Cmpt > rootMax
static const SpatialTensor< Cmpt > rootMin

Additional Inherited Members

Public Types inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
typedef MatrixSpace< SpatialTensor< Cmpt >, Cmpt, Mrows, Ncols > msType
 MatrixSpace type.
Public Types inherited from VectorSpace< SpatialTensor< Cmpt >, Cmpt, Mrows *Ncols >
typedef VectorSpace< SpatialTensor< 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.
Static Public Member Functions inherited from MatrixSpace< SpatialTensor< Cmpt >, Cmpt, 6, 6 >
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< SpatialTensor< Cmpt >, Cmpt, Mrows *Ncols >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts.
static SpatialTensor< Cmpt > uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s.
Public Attributes inherited from VectorSpace< SpatialTensor< Cmpt >, Cmpt, Mrows *Ncols >
Cmpt v_ [Ncmpts]
 The components of this vector space.

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 63 of file SpatialTensor.H.

Constructor & Destructor Documentation

◆ SpatialTensor() [1/6]

template<class Cmpt>
SpatialTensor ( )
default

Default Construct.

Referenced by SpatialTensor(), SpatialTensor(), and SpatialTensor().

Here is the caller graph for this function:

◆ SpatialTensor() [2/6]

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

Construct initialized to zero.

Definition at line 26 of file SpatialTensorI.H.

References SpatialTensor(), and Foam::Zero.

Here is the call graph for this function:

◆ SpatialTensor() [3/6]

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

Construct given MatrixSpace of the same rank.

Definition at line 33 of file SpatialTensorI.H.

References SpatialTensor().

Here is the call graph for this function:

◆ SpatialTensor() [4/6]

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

◆ SpatialTensor() [5/6]

template<class Cmpt>
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 72 of file SpatialTensorI.H.

References VectorSpace< SpatialTensor< Cmpt >, Cmpt, Mrows *Ncols >::v_.

◆ SpatialTensor() [6/6]

template<class Cmpt>
SpatialTensor ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 120 of file SpatialTensorI.H.

References SpatialTensor().

Here is the call graph for this function:

Member Data Documentation

◆ rank

template<class Cmpt>
direction rank = 2
staticconstexpr

Rank of Tensor is 2.

Definition at line 75 of file SpatialTensor.H.

◆ I

template<class Cmpt>
const 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: