DampingMatrixExpression< FP, D > Class Template Reference

CPP API: mio::DampingMatrixExpression< FP, D > Class Template Reference

represents the coefficient wise matrix (or vector) expression B - D * M where B is a baseline, M is a minimum and D is some time dependent complex damping factor. More...

#include <contact_matrix.h>

Public Types

using DampingsType = D
 
using Matrix = typename Shape::Matrix
 
using Shape = typename DampingsType::Shape
 

Public Member Functions

template<class... T>
void add_damping (T &&... t)
 adds a damping. More...
 
void clear_dampings ()
 remove all dampings. More...
 
template<class M >
 DampingMatrixExpression (const Eigen::MatrixBase< M > &baseline)
 construct with only baseline, minimum and dampings is zero. More...
 
template<class M , class K >
 DampingMatrixExpression (const Eigen::MatrixBase< M > &baseline, const Eigen::MatrixBase< K > &minimum)
 construct with baseline and minimum contacts and zero dampings. More...
 
template<class... T>
requires std::is_constructible_v< Shape, T... > DampingMatrixExpression (T... shape_args)
 construct with shape. More...
 
Matrixget_baseline ()
 
const Matrixget_baseline () const
 get the baseline matrix. More...
 
auto get_dampings ()
 
auto get_dampings () const
 list of dampings. More...
 
auto get_matrix_at (SimulationTime< FP > t) const
 Applies dampings to compute the real contact frequency at a point in time. More...
 
Matrixget_minimum ()
 
const Matrixget_minimum () const
 get the minimum matrix. More...
 
Shape get_shape () const
 dimensions of the matrix. More...
 
bool operator!= (const DampingMatrixExpression &other) const
 
bool operator== (const DampingMatrixExpression &other) const
 equality operators. More...
 
void remove_damping (size_t i)
 remove a damping. More...
 
template<class IOContext >
void serialize (IOContext &io) const
 serialize this. More...
 
void set_automatic_cache_update (bool b)
 Enable/disable automatic cache update of the dampings. More...
 

Static Public Member Functions

template<class IOContext >
static IOResult< DampingMatrixExpressiondeserialize (IOContext &io)
 deserialize an object of this class. More...
 

Static Protected Member Functions

template<class IOContext , class Derived >
static IOResult< Derived > deserialize (IOContext &io, Tag< Derived >)
 deserialize an object of a class derived from this. More...
 

Private Attributes

Matrix m_baseline
 
DampingsType m_dampings
 
Matrix m_minimum
 

Friends

void PrintTo (const DampingMatrixExpression &self, std::ostream *os)
 gtest printer. More...
 

Detailed Description

template<typename FP, class D>
class mio::DampingMatrixExpression< FP, D >

represents the coefficient wise matrix (or vector) expression B - D * M where B is a baseline, M is a minimum and D is some time dependent complex damping factor.

Base class for e.g. time dependent contact matrices. Coefficient wise expression, so B, D, M matrices must have the same shape.

See also
Damping
ContactMatrix
Template Parameters
FPfloating point, e.g. double
Dinstance of Dampings or compatible type

Member Typedef Documentation

◆ DampingsType

template<typename FP , class D >
using mio::DampingMatrixExpression< FP, D >::DampingsType = D

◆ Matrix

template<typename FP , class D >
using mio::DampingMatrixExpression< FP, D >::Matrix = typename Shape::Matrix

◆ Shape

template<typename FP , class D >
using mio::DampingMatrixExpression< FP, D >::Shape = typename DampingsType::Shape

Constructor & Destructor Documentation

◆ DampingMatrixExpression() [1/3]

template<typename FP , class D >
template<class M , class K >
mio::DampingMatrixExpression< FP, D >::DampingMatrixExpression ( const Eigen::MatrixBase< M > &  baseline,
const Eigen::MatrixBase< K > &  minimum 
)
inline

construct with baseline and minimum contacts and zero dampings.

Parameters
baselinematrix expression
minimummatrix expression, must be same size as baseline
Template Parameters
M,Kmatrix expressions compatible with Matrix type

◆ DampingMatrixExpression() [2/3]

template<typename FP , class D >
template<class M >
mio::DampingMatrixExpression< FP, D >::DampingMatrixExpression ( const Eigen::MatrixBase< M > &  baseline)
inlineexplicit

construct with only baseline, minimum and dampings is zero.

Parameters
baselinematrix expression
Template Parameters
Mmatrix expressions compatible with Matrix type

◆ DampingMatrixExpression() [3/3]

template<typename FP , class D >
template<class... T>
requires std::is_constructible_v<Shape, T...> mio::DampingMatrixExpression< FP, D >::DampingMatrixExpression ( T...  shape_args)
inlineexplicit

construct with shape.

baseline, minimum and dampings all zero.

Parameters
shape_argsshape arguments.
Template Parameters
Tshape arguments.

Member Function Documentation

◆ add_damping()

template<typename FP , class D >
template<class... T>
void mio::DampingMatrixExpression< FP, D >::add_damping ( T &&...  t)
inline

adds a damping.

See also
Dampings::add

◆ clear_dampings()

template<typename FP , class D >
void mio::DampingMatrixExpression< FP, D >::clear_dampings ( )
inline

remove all dampings.

◆ deserialize() [1/2]

template<typename FP , class D >
template<class IOContext >
static IOResult<DampingMatrixExpression> mio::DampingMatrixExpression< FP, D >::deserialize ( IOContext &  io)
inlinestatic

deserialize an object of this class.

See also
mio::deserialize

◆ deserialize() [2/2]

template<typename FP , class D >
template<class IOContext , class Derived >
static IOResult<Derived> mio::DampingMatrixExpression< FP, D >::deserialize ( IOContext &  io,
Tag< Derived >   
)
inlinestaticprotected

deserialize an object of a class derived from this.

◆ get_baseline() [1/2]

template<typename FP , class D >
Matrix& mio::DampingMatrixExpression< FP, D >::get_baseline ( )
inline

◆ get_baseline() [2/2]

template<typename FP , class D >
const Matrix& mio::DampingMatrixExpression< FP, D >::get_baseline ( ) const
inline

get the baseline matrix.

◆ get_dampings() [1/2]

template<typename FP , class D >
auto mio::DampingMatrixExpression< FP, D >::get_dampings ( )
inline

◆ get_dampings() [2/2]

template<typename FP , class D >
auto mio::DampingMatrixExpression< FP, D >::get_dampings ( ) const
inline

list of dampings.

◆ get_matrix_at()

template<typename FP , class D >
auto mio::DampingMatrixExpression< FP, D >::get_matrix_at ( SimulationTime< FP >  t) const
inline

Applies dampings to compute the real contact frequency at a point in time.

Uses lazy evaluation, coefficients are calculated on indexed access.

Parameters
ttime in the simulation
Returns
matrix expression (num_groups x num_groups)

◆ get_minimum() [1/2]

template<typename FP , class D >
Matrix& mio::DampingMatrixExpression< FP, D >::get_minimum ( )
inline

◆ get_minimum() [2/2]

template<typename FP , class D >
const Matrix& mio::DampingMatrixExpression< FP, D >::get_minimum ( ) const
inline

get the minimum matrix.

◆ get_shape()

template<typename FP , class D >
Shape mio::DampingMatrixExpression< FP, D >::get_shape ( ) const
inline

dimensions of the matrix.

◆ operator!=()

template<typename FP , class D >
bool mio::DampingMatrixExpression< FP, D >::operator!= ( const DampingMatrixExpression< FP, D > &  other) const
inline

◆ operator==()

template<typename FP , class D >
bool mio::DampingMatrixExpression< FP, D >::operator== ( const DampingMatrixExpression< FP, D > &  other) const
inline

equality operators.

◆ remove_damping()

template<typename FP , class D >
void mio::DampingMatrixExpression< FP, D >::remove_damping ( size_t  i)
inline

remove a damping.

Parameters
iindex to remove.

◆ serialize()

template<typename FP , class D >
template<class IOContext >
void mio::DampingMatrixExpression< FP, D >::serialize ( IOContext &  io) const
inline

serialize this.

See also
mio::serialize

◆ set_automatic_cache_update()

template<typename FP , class D >
void mio::DampingMatrixExpression< FP, D >::set_automatic_cache_update ( bool  b)
inline

Enable/disable automatic cache update of the dampings.

See also
Dampings::set_automatic_cache_update

Friends And Related Function Documentation

◆ PrintTo

template<typename FP , class D >
void PrintTo ( const DampingMatrixExpression< FP, D > &  self,
std::ostream *  os 
)
friend

gtest printer.

Member Data Documentation

◆ m_baseline

template<typename FP , class D >
Matrix mio::DampingMatrixExpression< FP, D >::m_baseline
private

◆ m_dampings

template<typename FP , class D >
DampingsType mio::DampingMatrixExpression< FP, D >::m_dampings
private

◆ m_minimum

template<typename FP , class D >
Matrix mio::DampingMatrixExpression< FP, D >::m_minimum
private