mbsim  4.0.0
MBSim Kernel
MBSim::Object Class Reference

class for all objects having own dynamics and mass More...

#include <object.h>

Inheritance diagram for MBSim::Object:
[legend]

Public Member Functions

 Object (const std::string &name)
 constructor
 
virtual void calcSize ()
 
int getGeneralizedPositionSize ()
 
int getGeneralizedVelocitySize ()
 
virtual void updateT ()
 
virtual void updateh (int j=0)
 
virtual void updateM ()
 
virtual void updatedhdz ()
 
virtual void updatedq ()
 
virtual void updatedu ()
 
virtual void updateud ()
 
virtual void updateqd ()
 
virtual void sethSize (int hSize_, int i=0)
 
int gethSize (int i=0) const
 
int getqSize () const
 
int getuSize (int i=0) const
 
virtual void calcqSize ()
 
virtual void calcuSize (int j)
 
int getqInd ()
 
int getuInd (int i=0)
 
virtual void setqInd (int qInd_)
 
virtual void setuInd (int uInd_, int i=0)
 
const fmatvec::Vec & getq () const
 
const fmatvec::Vec & getu () const
 
virtual H5::GroupBasegetPlotGroup ()
 
void plot () override
 plots time dependent data More...
 
virtual void updateqRef (fmatvec::Vec &qRef)
 references to positions of dynamic system parent More...
 
virtual void updateqdRef (fmatvec::Vec &qdRef)
 references to differentiated positions of dynamic system parent More...
 
virtual void updatedqRef (fmatvec::Vec &dqRef)
 references to differentiated positions of dynamic system parent More...
 
virtual void updateuRef (fmatvec::Vec &uRef)
 references to velocities of dynamic system parent More...
 
virtual void updateuallRef (fmatvec::Vec &uallRef)
 references to velocities of dynamic system parent More...
 
virtual void updateudRef (fmatvec::Vec &udRef)
 references to differentiated velocities of dynamic system parent More...
 
virtual void updateduRef (fmatvec::Vec &duRef)
 references to differentiated velocities of dynamic system parent More...
 
virtual void updateudallRef (fmatvec::Vec &udallRef)
 references to differentiated velocities of dynamic system parent More...
 
virtual void updatehRef (fmatvec::Vec &hRef, int i=0)
 references to smooth force vector of dynamic system parent More...
 
virtual void updatedhdqRef (fmatvec::Mat &dhdqRef, int i=0)
 references to object Jacobian for implicit integration of dynamic system parent regarding positions More...
 
virtual void updatedhduRef (fmatvec::SqrMat &dhduRef, int i=0)
 references to object Jacobian for implicit integration of dynamic system parent regarding velocities More...
 
virtual void updatedhdtRef (fmatvec::Vec &dhdtRef, int i=0)
 references to object Jacobian for implicit integration of dynamic system parent regarding time More...
 
virtual void updaterRef (fmatvec::Vec &ref, int i=0)
 references to nonsmooth force vector of dynamic system parent More...
 
virtual void updaterdtRef (fmatvec::Vec &ref)
 references to nonsmooth force vector of dynamic system parent More...
 
virtual void updateTRef (fmatvec::Mat &ref)
 references to linear transformation matrix between differentiated positions and velocities of dynamic system parent More...
 
virtual void updateMRef (fmatvec::SymMat &ref)
 references to mass matrix of dynamic system parent More...
 
virtual void updateLLMRef (fmatvec::SymMat &ref)
 references to Cholesky decomposition of dynamic system parent More...
 
void init (InitStage stage, const InitConfigSet &config) override
 initialize object at start of simulation with respect to contours and frames More...
 
virtual void initz ()
 
virtual void writez (H5::GroupBase *group)
 writes its z-Vector to a subgroup of the given group
 
virtual void readz0 (H5::GroupBase *group)
 reads the z-Vector of a subgroup of the given group
 
virtual void updateLLM ()
 perform Cholesky decomposition of mass martix
 
virtual void setUpInverseKinetics ()
 TODO. More...
 
void setqSize (int qSize_)
 
void setuSize (int uSize_, int i=0)
 
int getzSize () const
 
virtual void sethInd (int hInd_, int i=0)
 
int gethInd (int i=0)
 
const fmatvec::SymMat & getM (bool check=true) const
 
fmatvec::SymMat & getM (bool check=true)
 
const fmatvec::Vec & geth (int i=0, bool check=true) const
 
fmatvec::Vec & geth (int i=0, bool check=true)
 
fmatvec::Vec & getq ()
 
fmatvec::Vec & getu ()
 
const fmatvec::Vec & getq0 () const
 
const fmatvec::Vec & getu0 () const
 
fmatvec::Vec & getq0 ()
 
fmatvec::Vec & getu0 ()
 
const fmatvec::Mat & evalT ()
 
const fmatvec::Vec & evalh (int i=0)
 
const fmatvec::SymMat & evalM ()
 
const fmatvec::SymMat & evalLLM ()
 
const fmatvec::Vec & evalr (int i=0)
 
const fmatvec::Vec & evalrdt ()
 
const fmatvec::Vec & evalqd ()
 
const fmatvec::Vec & evalud ()
 
const fmatvec::Vec & evaludall ()
 
fmatvec::Vec & getud (bool check=true)
 
fmatvec::Vec & getudall (bool check=true)
 
void resetUpToDate () override
 
virtual void updateGeneralizedPositions ()
 
virtual void updateGeneralizedVelocities ()
 
virtual void updateGeneralizedAccelerations ()
 
virtual void updateDerivativeOfGeneralizedPositions ()
 
const fmatvec::VecV & evalGeneralizedPosition ()
 
const fmatvec::VecV & evalGeneralizedVelocity ()
 
const fmatvec::VecV & evalDerivativeOfGeneralizedPosition ()
 
const fmatvec::VecV & evalGeneralizedAcceleration ()
 
fmatvec::VecV & getGeneralizedPosition (bool check=true)
 
fmatvec::VecV & getGeneralizedVelocity (bool check=true)
 
fmatvec::VecV & getDerivativeOfGeneralizedPosition (bool check=true)
 
fmatvec::VecV & getGeneralizedAcceleration (bool check=true)
 
void setq (const fmatvec::Vec &q_)
 
void setu (const fmatvec::Vec &u_)
 
bool hasNonCostantMassMatrix ()
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
void createPlotGroup () override
 creates the plotGroup for H5-output More...
 
- Public Member Functions inherited from MBSim::Element
 Element (const std::string &name)
 constructor
 
 ~Element () override=default
 destructor
 
void throwError (const std::string &msg) const
 
virtual void setDynamicSystemSolver (DynamicSystemSolver *sys)
 sets the used dynamics system solver to the element More...
 
virtual void plot ()
 plots time dependent data More...
 
virtual void plotAtSpecialEvent ()
 plots time dependent data at special events More...
 
const std::string & getName () const
 
void setName (const std::string &str)
 
void setPath (const std::string &str)
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
virtual void init (InitStage stage, const InitConfigSet &config=InitConfigSet())
 plots time series header More...
 
virtual void createPlotGroup ()
 creates the plotGroup for H5-output More...
 
H5::GroupBasegetPlotGroup ()
 
virtual H5::GroupBasegetFramesPlotGroup ()
 
virtual H5::GroupBasegetContoursPlotGroup ()
 
virtual H5::GroupBasegetGroupsPlotGroup ()
 
virtual H5::GroupBasegetObjectsPlotGroup ()
 
virtual H5::GroupBasegetLinksPlotGroup ()
 
virtual H5::GroupBasegetConstraintsPlotGroup ()
 
virtual H5::GroupBasegetObserversPlotGroup ()
 
bool getPlotFeature (const PlotFeatureEnum &pf)
 
virtual void setPlotFeature (const PlotFeatureEnum &pf, bool value)
 Set a plot feature. More...
 
void setPlotFeatureForChildren (const PlotFeatureEnum &pf, bool value)
 Set a plot feature for the children of this object. More...
 
void setPlotFeatureRecursive (const PlotFeatureEnum &pf, bool value)
 Set a plot feature for this object and the children of this object. More...
 
template<class T >
void setPlotAttribute (const std::string &name, const T &value)
 Set a plot attribute: static data attached as key/value pairs to the plot datasets/groups.
 
void setPlotAttribute (const std::string &name)
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
template<class T >
T * getByPath (const std::string &path, bool initialCaller=true) const
 Get the object of type T represented by the path path. Do not set any argurment other than path!
 
std::string getPath (const Element *relTo=nullptr, std::string sep="/") const
 Return the path of this object. If relativeTo is not NULL return a relative path to relativeTo. Do not set any argurment other than relTo and sep!
 
virtual ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const
 Get the Element named name in the container named container. More...
 
virtual std::shared_ptr< OpenMBV::GroupgetOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetFramesOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetContoursOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetGroupsOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetObjectsOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetLinksOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetConstraintsOpenMBVGrp ()
 
virtual std::shared_ptr< OpenMBV::GroupgetObserversOpenMBVGrp ()
 
virtual ElementgetParent ()
 
virtual const ElementgetParent () const
 
virtual void setParent (Element *parent_)
 
std::vector< Element * > getDependencies () const
 checks dependency on other elements. More...
 
void addDependency (Element *ele)
 
int computeLevel ()
 computes the length of the pathes in the graph that represents the dependencies between all elements. More...
 
virtual void updatePositions (Frame *frame)
 
virtual void updateVelocities (Frame *frame)
 
virtual void updateAccelerations (Frame *frame)
 
virtual void updateJacobians (Frame *frame, int j=0)
 
virtual void updateGyroscopicAccelerations (Frame *frame)
 
virtual void resetUpToDate ()
 
const double & getTime () const
 
double getStepSize () const
 
const MBXMLUtils::DOMEvalExceptiongetDOMEvalError () const
 

Protected Attributes

int nq
 
int nu
 
int qSize
 size of object positions
 
int uSize [2]
 size of object velocities
 
int hSize [2]
 size of object h-vector (columns of J)
 
int qInd
 indices of positions, velocities, right hand side
 
int uInd [2]
 
int hInd [2]
 
fmatvec::Vec q
 positions, velocities
 
fmatvec::Vec u
 
fmatvec::Vec uall
 
fmatvec::Vec q0
 initial position, velocity
 
fmatvec::Vec u0
 
fmatvec::Vec qd
 differentiated positions, velocities
 
fmatvec::Vec ud
 
fmatvec::Vec dq
 
fmatvec::Vec du
 
fmatvec::Vec udall
 
fmatvec::Vec h [2]
 complete and object smooth and nonsmooth right hand side
 
fmatvec::Vec r [2]
 
fmatvec::Vec rdt
 
fmatvec::Mat W [2]
 
fmatvec::Mat V [2]
 
fmatvec::Mat dhdq
 Jacobians of h.
 
fmatvec::SqrMat dhdu
 
fmatvec::Vec dhdt
 
fmatvec::Mat T
 linear relation matrix of differentiated position and velocity parameters
 
fmatvec::SymMat M
 mass matrix
 
fmatvec::SymMat LLM
 LU-decomposition of mass matrix.
 
fmatvec::VecV qRel
 
fmatvec::VecV uRel
 
fmatvec::VecV qdRel
 
fmatvec::VecV udRel
 
bool updSize
 
bool updq
 
bool updu
 
bool updqd
 
bool updud
 
bool nonConstantMassMatrix {true}
 
- Protected Attributes inherited from MBSim::Element
Elementparent { nullptr }
 
std::string name
 name of element
 
std::string path
 The path of this object. Is set during the init stage reorganizeHierarchy. Before this the path is calculated dynamically using getPath() after this stage getPath just returns this value.
 
MBXMLUtils::DOMEvalException domEvalError
 Special XML helper variable.
 
DynamicSystemSolverds { nullptr }
 dynamic system
 
H5::VectorSerie< double > * plotVectorSerie { nullptr }
 time series
 
std::vector< double > plotVector
 one entry of time series
 
std::vector< std::string > plotColumns
 columns of time series
 
H5::GroupBaseplotGroup { nullptr }
 associated plot group
 
std::vector< Element * > dependency
 vector containing all dependencies.
 
PlotFeatureMap plotFeature
 plot feature
 
PlotFeatureMap plotFeatureForChildren
 
std::map< std::string, std::variant< std::monostate, int, double, std::string, std::vector< int >, std::vector< double >, std::vector< std::vector< double > > > > plotAttribute
 

Additional Inherited Members

- Public Types inherited from MBSim::Element
enum  InitStage {
  resolveStringRef =0 , preInit , plotting , unknownStage ,
  LASTINITSTAGE
}
 The stages of the initialization. More...
 
- Protected Member Functions inherited from MBSim::Element
void updatePlotFeatures ()
 
void addToPlot (const std::string &name)
 
void addToPlot (const std::string &name, int size)
 
void addToPlot (const std::string &name, const std::vector< std::string > &iname)
 
template<class AT >
void plot (const AT &x)
 
template<class Type , class AT >
void plot (const fmatvec::Vector< Type, AT > &x)
 

Detailed Description

class for all objects having own dynamics and mass

Author
Martin Foerg
Date
2009-03-24 plot energy added (Thorsten Schindler)
2009-07-16 splitted link / object right hand side (Thorsten Schindler)
2009-07-27 implicit integration improvement (Thorsten Schindler)
2009-07-28 splitted interfaces (Thorsten Schindler)
2009-12-14 revised inverse kinetics (Martin Foerg)
2010-06-20 revision of doxygen comments: add parameter names (Roland Zander)

Member Function Documentation

◆ createPlotGroup()

void MBSim::Object::createPlotGroup ( )
overridevirtual

creates the plotGroup for H5-output

Reimplemented from MBSim::Element.

◆ init()

void MBSim::Object::init ( InitStage  stage,
const InitConfigSet &  config 
)
overridevirtual

initialize object at start of simulation with respect to contours and frames

Reimplemented from MBSim::Element.

Reimplemented in MBSim::RigidBody.

◆ initializeUsingXML()

void MBSim::Object::initializeUsingXML ( xercesc::DOMElement *  element)
overridevirtual

Reimplemented from MBSim::Element.

◆ initz()

void MBSim::Object::initz ( )
virtual

initialize state of object at start of simulation

◆ plot()

void MBSim::Object::plot ( )
overridevirtual

plots time dependent data

Parameters
simulationtime
simulationtime step size for derivative calculation

Reimplemented from MBSim::Element.

Reimplemented in MBSim::RigidBody.

◆ resetUpToDate()

void MBSim::Object::resetUpToDate ( )
inlineoverridevirtual

Reimplemented from MBSim::Element.

◆ setUpInverseKinetics()

virtual void MBSim::Object::setUpInverseKinetics ( )
inlinevirtual

TODO.

Reimplemented in MBSim::RigidBody.

◆ updatedhdqRef()

void MBSim::Object::updatedhdqRef ( fmatvec::Mat &  dhdqRef,
int  i = 0 
)
virtual

references to object Jacobian for implicit integration of dynamic system parent regarding positions

Parameters
dhdqRefmatrix concerning links to be referenced
iindex of normal usage and inverse kinetics

◆ updatedhdtRef()

void MBSim::Object::updatedhdtRef ( fmatvec::Vec &  dhdtRef,
int  i = 0 
)
virtual

references to object Jacobian for implicit integration of dynamic system parent regarding time

Parameters
dhdtRefmatrix concerning links to be referenced
iindex of normal usage and inverse kinetics

◆ updatedhduRef()

void MBSim::Object::updatedhduRef ( fmatvec::SqrMat &  dhduRef,
int  i = 0 
)
virtual

references to object Jacobian for implicit integration of dynamic system parent regarding velocities

Parameters
dhduRefmatrix concerning links to be referenced
iindex of normal usage and inverse kinetics

◆ updatedqRef()

void MBSim::Object::updatedqRef ( fmatvec::Vec &  dqRef)
virtual

references to differentiated positions of dynamic system parent

Parameters
qdRefvector to be referenced

◆ updateduRef()

void MBSim::Object::updateduRef ( fmatvec::Vec &  duRef)
virtual

references to differentiated velocities of dynamic system parent

Parameters
udRefvector to be referenced

◆ updatehRef()

void MBSim::Object::updatehRef ( fmatvec::Vec &  hRef,
int  i = 0 
)
virtual

references to smooth force vector of dynamic system parent

Parameters
hRefvector to be referenced
iindex of normal usage and inverse kinetics

◆ updateLLMRef()

void MBSim::Object::updateLLMRef ( fmatvec::SymMat &  ref)
virtual

references to Cholesky decomposition of dynamic system parent

Parameters
vectorto be referenced
indexof normal usage and inverse kinetics

◆ updateMRef()

void MBSim::Object::updateMRef ( fmatvec::SymMat &  ref)
virtual

references to mass matrix of dynamic system parent

Parameters
vectorto be referenced
indexof normal usage and inverse kinetics

◆ updateqdRef()

void MBSim::Object::updateqdRef ( fmatvec::Vec &  qdRef)
virtual

references to differentiated positions of dynamic system parent

Parameters
qdRefvector to be referenced

◆ updateqRef()

void MBSim::Object::updateqRef ( fmatvec::Vec &  qRef)
virtual

references to positions of dynamic system parent

Parameters
qRefvector to be referenced

◆ updaterdtRef()

void MBSim::Object::updaterdtRef ( fmatvec::Vec &  ref)
virtual

references to nonsmooth force vector of dynamic system parent

Parameters
vectorto be referenced

◆ updaterRef()

void MBSim::Object::updaterRef ( fmatvec::Vec &  ref,
int  i = 0 
)
virtual

references to nonsmooth force vector of dynamic system parent

Parameters
vectorto be referenced

◆ updateTRef()

void MBSim::Object::updateTRef ( fmatvec::Mat &  ref)
virtual

references to linear transformation matrix between differentiated positions and velocities of dynamic system parent

Parameters
matrixto be referenced

◆ updateuallRef()

void MBSim::Object::updateuallRef ( fmatvec::Vec &  uallRef)
virtual

references to velocities of dynamic system parent

Parameters
uallRefvector to be referenced

◆ updateudallRef()

void MBSim::Object::updateudallRef ( fmatvec::Vec &  udallRef)
virtual

references to differentiated velocities of dynamic system parent

Parameters
udallRefvector to be referenced

◆ updateudRef()

void MBSim::Object::updateudRef ( fmatvec::Vec &  udRef)
virtual

references to differentiated velocities of dynamic system parent

Parameters
udRefvector to be referenced

◆ updateuRef()

void MBSim::Object::updateuRef ( fmatvec::Vec &  uRef)
virtual

references to velocities of dynamic system parent

Parameters
uRefvector to be referenced

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