mbsim 4.0.0 MBSim Kernel

Public Member Functions | Protected Attributes | Private Attributes | List of all members
MBSim::Body Class Reference

base class for all mechanical bodies with mass and generalised coordinates More...

`#include <body.h>`

Inheritance diagram for MBSim::Body:
[legend]

## Public Member Functions

| Body (const std::string &name)
| constructor More...
| ~Body () override
| destructor
void | setGeneralizedInitialPosition (const fmatvec::Vec &q0_)
void | setGeneralizedInitialVelocity (const fmatvec::Vec &u0_)
void | setGeneralizedInitialPosition (double q0_)
void | setGeneralizedInitialVelocity (double u0_)
void | sethSize (int hSize_, int i=0) override
void | sethInd (int hInd_, int i=0) override
void | plot () override
| plots time dependent data More...
void | setDynamicSystemSolver (DynamicSystemSolver *sys) override
| sets the used dynamics system solver to the element More...
void | init (InitStage stage, const InitConfigSet &config) override
| plots time series header More...
void | createPlotGroup () override
| creates the plotGroup for H5-output
virtual Contour * | getContour (const std::string &name, bool check=true) const
virtual Frame * | getFrame (const std::string &name, bool check=true) const
virtual Frame * | getFrameOfReference ()
virtual const Frame * | getFrameOfReference () const
virtual void | setFrameOfReference (Frame *frame)
const std::vector< Frame * > & | getFrames () const
const std::vector< Contour * > & | getContours () const
std::shared_ptr< OpenMBV::Group > | getOpenMBVGrp () override
std::shared_ptr< OpenMBV::Body > & | getOpenMBVBody ()
std::shared_ptr< OpenMBV::Group > | getFramesOpenMBVGrp () override
std::shared_ptr< OpenMBV::Group > | getContoursOpenMBVGrp () override
H5::GroupBase * | getFramesPlotGroup () override
H5::GroupBase * | getContoursPlotGroup () override
int | frameIndex (const Frame *frame_) const
int | contourIndex (const Contour *contour_) const
void | initializeUsingXML (xercesc::DOMElement *element) override
Element * | getChildByContainerAndName (const std::string &container, const std::string &name) const override
| Get the Element named name in the container named container.
fmatvec::Mat3xV & | getPJT (int i=0, bool check=true)
fmatvec::Mat3xV & | getPJR (int i=0, bool check=true)
const fmatvec::Mat3xV & | evalPJT ()
const fmatvec::Mat3xV & | evalPJR ()
void | resetUpToDate () override
virtual void | resetPositionsUpToDate ()
virtual void | resetVelocitiesUpToDate ()
virtual void | resetJacobiansUpToDate ()
virtual void | resetGyroscopicAccelerationsUpToDate ()
virtual void | updateJacobians ()
virtual void | addFrame (Frame *frame)
virtual void | addContour (Contour *contour)
Public Member Functions inherited from MBSim::Object
| 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 ()
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::GroupBase * | getPlotGroup ()
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
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.
void | setqSize (int qSize_)
void | setuSize (int uSize_, int i=0)
int | getzSize () const
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
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 | 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)
DynamicSystemSolver * | getDynamicSystemSolver ()
H5::GroupBase * | getPlotGroup ()
virtual H5::GroupBase * | getGroupsPlotGroup ()
virtual H5::GroupBase * | getObjectsPlotGroup ()
virtual H5::GroupBase * | getLinksPlotGroup ()
virtual H5::GroupBase * | getConstraintsPlotGroup ()
virtual H5::GroupBase * | getObserversPlotGroup ()
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)
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 std::shared_ptr< OpenMBV::Group > | getGroupsOpenMBVGrp ()
virtual std::shared_ptr< OpenMBV::Group > | getObjectsOpenMBVGrp ()
virtual std::shared_ptr< OpenMBV::Group > | getLinksOpenMBVGrp ()
virtual std::shared_ptr< OpenMBV::Group > | getConstraintsOpenMBVGrp ()
virtual std::shared_ptr< OpenMBV::Group > | getObserversOpenMBVGrp ()
virtual Element * | getParent ()
virtual const Element * | getParent () 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)
const double & | getTime () const
double | getStepSize () const
const MBXMLUtils::DOMEvalException & | getDOMEvalError () const

## Protected Attributes

std::vector< Frame * > | frame
| vector of frames and contours
std::vector< Contour * > | contour
Frame * | R
| frame of reference of the object
fmatvec::Mat3xV | PJT [2]
fmatvec::Mat3xV | PJR [2]
bool | updPos
bool | updVel
bool | updPJ
std::shared_ptr< OpenMBV::Body > | openMBVBody
std::shared_ptr< OpenMBV::Group > | openMBVGrp
std::shared_ptr< OpenMBV::Group > | framesOpenMBVGrp
std::shared_ptr< OpenMBV::Group > | contoursOpenMBVGrp
H5::GroupBase * | framesPlotGroup
H5::GroupBase * | contoursPlotGroup
Protected Attributes inherited from MBSim::Object
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
Element * | parent
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.
DynamicSystemSolver * | ds
| dynamic system
H5::VectorSerie< double > * | plotVectorSerie
| time series
std::vector< double > | plotVector
| one entry of time series
std::vector< std::string > | plotColumns
| columns of time series
H5::GroupBase * | plotGroup
| 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

## Private Attributes

std::string | saved_frameOfReference

## 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

base class for all mechanical bodies with mass and generalised coordinates

Author
  Martin Foerg

Date
  2009-04-06 object and body divided (Markus Schneider)

The following part is only a test for equation and image output for the XML documentation. A not inline equation

\[ \int_a^b\sin(x)dx +5 \]

And a inline equation \(x_a+\cos(x)\). And a image

The image caption

End of the test.

## Constructor & Destructor Documentation

## ◆ Body()

MBSim::Body::Body | ( | const std::string & | name | ) |

constructor

Parameters

  name | of body

## Member Function Documentation

## ◆ addContour()

void MBSim::Body::addContour | ( | Contour * | contour | ) |

virtual

Parameters

  contour | to add

## ◆ addFrame()

void MBSim::Body::addFrame | ( | Frame * | frame | ) |

virtual

Parameters

  frame | to add

## ◆ contourIndex()

int MBSim::Body::contourIndex | ( | const Contour * | contour_ | ) | const

Parameters

  contour |

Returns
  index of contour

## ◆ frameIndex()

int MBSim::Body::frameIndex | ( | const Frame * | frame_ | ) | const

Parameters

  frame |

Returns
  index of frame

## ◆ getContour()

Contour * MBSim::Body::getContour | ( | const std::string & | name,
|  | bool | check = `true`
| ) |  | const

virtual

Parameters

  name | of the contour
  flag | for checking existence

Returns
  contour

## ◆ getFrame()

Frame * MBSim::Body::getFrame | ( | const std::string & | name,
|  | bool | check = `true`
| ) |  | const

virtual

Parameters

  name | of the frame
  flag | for checking existence

Returns
  frame

## ◆ getFrameOfReference() [1/2]

virtual Frame* MBSim::Body::getFrameOfReference | ( |  | ) |

inline virtual

Returns
  frame of reference

## ◆ getFrameOfReference() [2/2]

virtual const Frame* MBSim::Body::getFrameOfReference | ( |  | ) | const

inline virtual

Returns
  frame of reference

## ◆ init()

void MBSim::Body::init | ( | InitStage | stage,
|  | const InitConfigSet & | config
| ) |  |

override virtual

plots time series header

Parameters

  invocing | parent class

Reimplemented from MBSim::Element.

Reimplemented in MBSim::RigidBody.

## ◆ plot()

void MBSim::Body::plot | ( |  | ) |

override virtual

plots time dependent data

Parameters

  simulation | time
  simulation | time step size for derivative calculation

Reimplemented from MBSim::Element.

Reimplemented in MBSim::RigidBody.

## ◆ setDynamicSystemSolver()

void MBSim::Body::setDynamicSystemSolver | ( | DynamicSystemSolver * | sys | ) |

override virtual

sets the used dynamics system solver to the element

Parameters

  pointer | to the dynamic system solver of which the element is part of

Reimplemented from MBSim::Element.

Reimplemented in MBSim::RigidBody.

## ◆ setFrameOfReference()

virtual void MBSim::Body::setFrameOfReference | ( | Frame * | frame | ) |

inline virtual

Parameters

  frame | of reference

## Member Data Documentation

## ◆ PJT

fmatvec::Mat3xV MBSim::Body::PJT[2]

protected

JACOBIAN of translation, rotation and their derivatives in parent system

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

- /mbsim-env/mbsim/kernel/mbsim/objects/body.h
- /mbsim-env/mbsim/kernel/mbsim/objects/body.cc