Damping< FP, S > Class Template Reference

CPP API: mio::Damping< FP, S > Class Template Reference
mio::Damping< FP, S > Class Template Reference

represent interventions or effects that affect contact frequencies between multiple groups. More...

#include <damping.h>

Inheritance diagram for mio::Damping< FP, S >:
Collaboration diagram for mio::Damping< FP, S >:

Public Types

using Base = std::tuple< Matrix, DampingLevel, DampingType, SimulationTime< FP > >
 
using Matrix = typename Shape::Matrix
 
using Shape = S
 

Public Member Functions

template<class ME >
 Damping (const Eigen::MatrixBase< ME > &m, DampingLevel level, DampingType type, SimulationTime< FP > t)
 create a Damping. More...
 
template<class ME >
 Damping (const Eigen::MatrixBase< ME > &m, SimulationTime< FP > t)
 create a Damping at level and type zero More...
 
template<class... T>
requires std::is_constructible_v< Shape, T... > Damping (FP d, DampingLevel level, DampingType type, SimulationTime< FP > t, T... shape_args)
 create a Damping with constant coefficients. More...
 
template<class... T>
requires std::is_constructible_v< Shape, T... > Damping (FP d, SimulationTime< FP > t, T... shape_args)
 create a Damping with constant coefficients and zero level and type. More...
 
template<class... T>
requires std::is_constructible_v< Shape, T... > Damping (T... shape_args)
 create a default Damping. More...
 
Matrixget_coeffs ()
 
const Matrixget_coeffs () const
 the coefficients of this damping. More...
 
DampingLevel & get_level ()
 the level of this damping. More...
 
const DampingLevel & get_level () const
 
Shape get_shape () const
 shape of the damping matrix. More...
 
SimulationTime< FP > & get_time ()
 the time this damping becomes active. More...
 
const SimulationTime< FP > & get_time () const
 
DampingType & get_type ()
 the type of this damping. More...
 
const DampingType & get_type () const
 
template<class IOContext >
void serialize (IOContext &io) const
 serialize this. More...
 

Static Public Member Functions

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

Friends

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

Detailed Description

template<typename FP, class S>
class mio::Damping< FP, S >

represent interventions or effects that affect contact frequencies between multiple groups.

Dampings have a level and a type and are active from a certain point in time forward. Dampings are square matrix valued, coefficient d_ij affects the contacts from group i to group j.

Template Parameters
FPFloating point type, e.g., double
SMatrix shape type

Member Typedef Documentation

◆ Base

template<typename FP , class S >
using mio::Damping< FP, S >::Base = std::tuple<Matrix, DampingLevel, DampingType, SimulationTime<FP> >

◆ Matrix

template<typename FP , class S >
using mio::Damping< FP, S >::Matrix = typename Shape::Matrix

◆ Shape

template<typename FP , class S >
using mio::Damping< FP, S >::Shape = S

Constructor & Destructor Documentation

◆ Damping() [1/5]

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

create a default Damping.

Parameters
shape_argsarguments to construct the shape of the damping matrix (can be Shape itself, copy ctor)
Template Parameters
Tconstructor arguments of Damping::Shape.

◆ Damping() [2/5]

template<typename FP , class S >
template<class ME >
mio::Damping< FP, S >::Damping ( const Eigen::MatrixBase< ME > &  m,
DampingLevel  level,
DampingType  type,
SimulationTime< FP >  t 
)
inline

create a Damping.

Parameters
mmatrix of damping coefficients
leveldamping level
typedamping type
ttime at which the damping becomes active
Template Parameters
MEmatrix expression, must be compatible with Shape

◆ Damping() [3/5]

template<typename FP , class S >
template<class... T>
requires std::is_constructible_v<Shape, T...> mio::Damping< FP, S >::Damping ( FP  d,
DampingLevel  level,
DampingType  type,
SimulationTime< FP >  t,
T...  shape_args 
)
inline

create a Damping with constant coefficients.

Parameters
shape_argsarguments to construct the shape of the damping matrix (can be Shape itself, copy ctor)
ddamping coefficient for all groups.
leveldamping level
typedamping type
ttime at which the damping becomes active
Template Parameters
TShape constructor arguments.

◆ Damping() [4/5]

template<typename FP , class S >
template<class ME >
mio::Damping< FP, S >::Damping ( const Eigen::MatrixBase< ME > &  m,
SimulationTime< FP >  t 
)
inline

create a Damping at level and type zero

Parameters
mdamping coefficients
ttime at which the damping becomes active
Template Parameters
MEmatrix expression, must be compatible with Damping::Matrix

◆ Damping() [5/5]

template<typename FP , class S >
template<class... T>
requires std::is_constructible_v<Shape, T...> mio::Damping< FP, S >::Damping ( FP  d,
SimulationTime< FP >  t,
T...  shape_args 
)
inline

create a Damping with constant coefficients and zero level and type.

Parameters
shape_argsarguments to construct the shape of the damping matrix (can be Shape itself, copy ctor)
ddamping coefficient for all groups.
ttime at which the damping becomes active
Template Parameters
TShape constructor arguments.

Member Function Documentation

◆ deserialize()

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

deserialize an object of this class.

See also
mio::deserialize

◆ get_coeffs() [1/2]

template<typename FP , class S >
Matrix& mio::Damping< FP, S >::get_coeffs ( )
inline

◆ get_coeffs() [2/2]

template<typename FP , class S >
const Matrix& mio::Damping< FP, S >::get_coeffs ( ) const
inline

the coefficients of this damping.

◆ get_level() [1/2]

template<typename FP , class S >
DampingLevel& mio::Damping< FP, S >::get_level ( )
inline

the level of this damping.

◆ get_level() [2/2]

template<typename FP , class S >
const DampingLevel& mio::Damping< FP, S >::get_level ( ) const
inline

◆ get_shape()

template<typename FP , class S >
Shape mio::Damping< FP, S >::get_shape ( ) const
inline

shape of the damping matrix.

◆ get_time() [1/2]

template<typename FP , class S >
SimulationTime<FP>& mio::Damping< FP, S >::get_time ( )
inline

the time this damping becomes active.

◆ get_time() [2/2]

template<typename FP , class S >
const SimulationTime<FP>& mio::Damping< FP, S >::get_time ( ) const
inline

◆ get_type() [1/2]

template<typename FP , class S >
DampingType& mio::Damping< FP, S >::get_type ( )
inline

the type of this damping.

◆ get_type() [2/2]

template<typename FP , class S >
const DampingType& mio::Damping< FP, S >::get_type ( ) const
inline

◆ serialize()

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

serialize this.

See also
mio::serialize

Friends And Related Function Documentation

◆ PrintTo

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

GTest printer.