mbsim  4.0.0
MBSim Kernel
MBSim::DynamicSystemSolver Class Reference

solver interface for modelling and simulation of dynamic systems More...

#include <dynamic_system_solver.h>

Inheritance diagram for MBSim::DynamicSystemSolver:
[legend]

Classes

class  Residuum
 
class  SignalHandler
 

Public Types

enum  Solver {
  fixedpoint , GaussSeidel , direct , rootfinding ,
  unknownSolver , directNonlinear
}
 solver for contact equations
 
- Public Types inherited from MBSim::Element
enum  InitStage {
  resolveStringRef =0 , preInit , plotting , unknownStage ,
  LASTINITSTAGE
}
 The stages of the initialization. More...
 

Public Member Functions

 DynamicSystemSolver (const std::string &name="")
 constructor More...
 
 ~DynamicSystemSolver () override
 destructor
 
void initialize ()
 Initialize the system. More...
 
void setTruncateSimulationFiles (bool trunc)
 
void init (InitStage stage, const InitConfigSet &config) override
 plots time series header More...
 
int solveConstraintsFixpointSingle () override
 solve contact equations with single step fixed point scheme More...
 
int solveImpactsFixpointSingle () override
 solve impact equations with single step fixed point scheme on velocity level More...
 
int solveConstraintsGaussSeidel () override
 solve contact equations with Gauss-Seidel scheme More...
 
int solveImpactsGaussSeidel () override
 solve impact equations with Gauss-Seidel scheme on velocity level More...
 
int solveConstraintsRootFinding () override
 solve contact equations with Newton scheme More...
 
int solveImpactsRootFinding () override
 solve impact equations with Newton scheme on velocity level More...
 
void checkConstraintsForTermination () override
 validate force laws concerning given tolerances More...
 
void checkImpactsForTermination () override
 validate force laws concerning given tolerances on velocity level More...
 
void updateT () override
 
void updateh (int i=0) override
 
void updateM () override
 
void updateLLM () override
 
void updatezd () override
 
virtual void updater (int j=0)
 update smooth link force law More...
 
virtual void updateJrla (int j=0)
 
virtual void updaterdt ()
 
void updatewb () override
 
void updateg () override
 
void updategd () override
 
void updateW (int j=0) override
 
void updateV (int j=0) override
 
virtual void updatebc ()
 
virtual void updatebi ()
 
virtual void updatela ()
 
virtual void updateLa ()
 
void setSmoothSolver (Solver solver_)
 
void setConstraintSolver (Solver solver_)
 
void setImpactSolver (Solver solver_)
 
const SolvergetSmoothSolver ()
 
const SolvergetConstraintSolver ()
 
const SolvergetImpactSolver ()
 
void setTermination (bool term_)
 
void setMaximumNumberOfIterations (int iter)
 
void setHighNumberOfIterations (int iter)
 
void setNumericalJacobian (bool numJac_)
 
void setMaximumDampingSteps (int maxDSteps)
 
void setLevenbergMarquardtParamater (double lmParm_)
 
void setUseOldla (bool flag)
 
void setDecreaseLevels (const fmatvec::VecInt &decreaseLevels_)
 
void setCheckTermLevels (const fmatvec::VecInt &checkTermLevels_)
 
void setCheckGSize (bool checkGSize_)
 
void setLimitGSize (int limitGSize_)
 
double & getTime ()
 
const double & getTime () const
 
void setTime (double t_)
 
double getStepSize () const
 
void setStepSize (double dt_)
 
int getzSize () const
 
fmatvec::Vec & getState ()
 
const fmatvec::Vec & getState () const
 
void setState (const fmatvec::Vec &z_)
 
const fmatvec::Vec & getzd (bool check=true) const
 
void setzd (const fmatvec::Vec &zd_)
 
const fmatvec::SqrMat & getG (bool check=true) const
 
const fmatvec::SparseMat & getGs (bool check=true) const
 
const fmatvec::Vec & getbc (bool check=true) const
 
const fmatvec::Vec & getbi (bool check=true) const
 
const fmatvec::SqrMat & getJprox () const
 
fmatvec::SqrMat & getG (bool check=true)
 
fmatvec::SparseMat & getGs (bool check=true)
 
fmatvec::Vec & getbc (bool check=true)
 
fmatvec::Vec & getbi (bool check=true)
 
fmatvec::SqrMat & getJprox ()
 
const fmatvec::Vec & getr (int j=0, bool check=true) const
 
fmatvec::Vec & getr (int j=0, bool check=true)
 
const fmatvec::Mat & getJrla (int j=0, bool check=true) const
 
fmatvec::Mat & getJrla (int j=0, bool check=true)
 
const fmatvec::Vec & evaldq ()
 
const fmatvec::Vec & evaldu ()
 
const fmatvec::Vec & evaldx ()
 
const fmatvec::Vec & evalzd ()
 
const fmatvec::SqrMat & evalG ()
 
const fmatvec::SparseMat & evalGs ()
 
const fmatvec::Vec & evalbc ()
 
const fmatvec::Vec & evalbi ()
 
const fmatvec::Vec & evalsv ()
 
const fmatvec::Vec & evalz0 ()
 
const fmatvec::Vec & evalla ()
 
const fmatvec::Vec & evalLa ()
 
fmatvec::Vec & getzParent ()
 
fmatvec::Vec & getzdParent ()
 
fmatvec::Vec & getlaParent ()
 
fmatvec::Vec & getLaParent ()
 
fmatvec::Mat & getWParent (int i=0)
 
fmatvec::Mat & getVParent (int i=0)
 
fmatvec::Vec & getgParent ()
 
fmatvec::Vec & getgdParent ()
 
fmatvec::Vec & getresParent ()
 
fmatvec::Vec & getrFactorParent ()
 
void resizezParent (int nz)
 
void resizezdParent (int nz)
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
int getMaxIter ()
 
int getHighIter ()
 
int getIterC ()
 
int getIterI ()
 
void computeInitialCondition ()
 compute initial condition for links for event driven integrator
 
int solveConstraintsLinearEquations ()
 solution of contact equations with direct linear solver using minimum of least squares More...
 
int solveConstraintsNonlinearEquations ()
 solution of contact equations with direct nonlinear newton solver using minimum of least squares in each iteration step More...
 
int solveImpactsLinearEquations ()
 solution of contact equations with Cholesky decomposition on velocity level More...
 
int solveImpactsNonlinearEquations ()
 
virtual void updateG ()
 updates mass action matrix More...
 
void decreaserFactors ()
 decrease relaxation factors if mass action matrix is not diagonal dominant
 
virtual const fmatvec::Vec & shift (std::optional< std::reference_wrapper< bool > > &&velProjWasCalled={}, std::optional< std::reference_wrapper< bool > > &&posProjWasCalled={})
 update for event driven integrator for event More...
 
void getLinkStatus (fmatvec::VecInt &LinkStatusExt)
 
void getLinkStatusReg (fmatvec::VecInt &LinkStatusRegExt)
 
bool positionDriftCompensationNeeded (double gmax)
 check if drift compensation on position level is needed
 
bool velocityDriftCompensationNeeded (double gdmax)
 check if drift compensation on velocity level is needed
 
void projectGeneralizedPositions (int mode, bool fullUpdate=false)
 drift projection for positions
 
void projectGeneralizedVelocities (int mode)
 drift projection for positions
 
void savela ()
 save contact forces for use as starting value in next time step More...
 
void initla ()
 load contact forces for use as starting value More...
 
void saveLa ()
 save contact impulses for use as starting value in next time step More...
 
void initLa ()
 load contact impulses for use as starting value More...
 
void addElement (Element *element_)
 
ElementgetElement (const std::string &name)
 
std::string getSolverInfo ()
 
void setStopIfNoConvergence (bool flag, bool dropInfo=false)
 
bool getStopIfNoConvergence ()
 
void dropContactMatrices ()
 
void throwIfExitRequested ()
 
bool exitRequested ()
 
void setPartialEventDrivenSolver (bool peds_)
 
void writez (std::string fileName, bool formatH5=true)
 writes state to a file More...
 
void writeStateTable (std::string fileName)
 writes state table to a file More...
 
void readz0 (std::string fileName)
 reads state from a file More...
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
void setProjectionTolerance (double tol)
 set tolerance for projection of generalized position More...
 
void setLocalSolverTolerance (double tol)
 set tolerance for local none-linear solver (solvers on element level), like the Newton-Solver in JointConstraint More...
 
double getLocalSolverTolerance ()
 
void setDynamicSystemSolverTolerance (double tol)
 set tolerance for global none-linear solver (solvers on DynamicSystemSolver level), like the Newton-Solver in directNonlinear More...
 
double getDynamicSystemSolverTolerance ()
 
void updatezRef (fmatvec::Vec &ext)
 references to external state More...
 
void updatezdRef (fmatvec::Vec &ext)
 references to differentiated external state More...
 
void setAlwaysConsiderContact (bool alwaysConsiderContact_)
 
void setInverseKinetics (bool inverseKinetics_)
 
bool getInverseKinetics () const
 
void setInitialProjection (bool initialProjection_)
 
bool getInitialProjection () const
 
void setDetermineEquilibriumState (bool determineEquilibriumState_)
 
bool getDetermineEquilibriumState () const
 
void setUseConstraintSolverForPlot (bool useConstraintSolverForPlot_)
 
bool getUseConstraintSolverForPlot () const
 
fmatvec::Mat dhdq (int lb=0, int ub=0)
 
fmatvec::Mat dhdu (int lb=0, int ub=0)
 
fmatvec::Mat dhdx ()
 
fmatvec::Vec dhdt ()
 
void setRootID (int ID)
 
int getRootID () const
 
void resetUpToDate () override
 
bool getUpdateT ()
 
bool getUpdateM ()
 
bool getUpdateLLM ()
 
bool getUpdateh (int j)
 
bool getUpdater (int j)
 
bool getUpdateJrla (int j)
 
bool getUpdaterdt ()
 
bool getUpdateW (int j)
 
bool getUpdateV (int j)
 
bool getUpdatewb ()
 
bool getUpdateg ()
 
bool getUpdategd ()
 
bool getUpdatela ()
 
bool getUpdateLa ()
 
bool getUpdatezd ()
 
bool getUpdatedq ()
 
bool getUpdatedu ()
 
bool getUpdatedx ()
 
void setUpdatela (bool updla_)
 
void setUpdateLa (bool updLa_)
 
void setUpdateG (bool updG_)
 
void setUpdatebi (bool updbi_)
 
void setUpdatebc (bool updbc_)
 
void setUpdatezd (bool updzd_)
 
void setUpdateW (bool updW_, int i=0)
 
void updategRef (fmatvec::Vec &ref) override
 references to relative distances of dynamic system parent More...
 
void updategdRef (fmatvec::Vec &ref) override
 references to relative velocities of dynamic system parent More...
 
void updatewbRef (fmatvec::Vec &ref) override
 references to TODO of dynamic system parent More...
 
void updateWRef (fmatvec::Mat &ref, int i=0) override
 references to contact force direction matrix of dynamic system parent More...
 
void updateVRef (fmatvec::Mat &ref, int i=0) override
 references to condensed contact force direction matrix of dynamic system parent More...
 
virtual void updatelaInverseKinetics ()
 update inverse kinetics constraint forces
 
void updatedq () override
 
void updatedu () override
 
void updatedx () override
 
void updateStopVector () override
 
void updateInternalState ()
 
void plot () override
 plots time dependent data More...
 
void addEnvironment (Environment *env)
 
template<class Env >
Env * getEnvironment ()
 
MBSimEnvironmentgetMBSimEnvironment ()
 
std::vector< StateTable > & getStateTable ()
 
void setCompressionLevel (int level)
 
void setChunkSize (int size)
 
void setCacheSize (int size)
 
void setqdequ (bool qdequ_)
 
bool getqdequ ()
 
- Public Member Functions inherited from MBSim::Group
 Group (const std::string &name="")
 constructor More...
 
 ~Group () override=default
 destructor
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
void addObject (Object *obj)
 
- Public Member Functions inherited from MBSim::DynamicSystem
 DynamicSystem (const std::string &name)
 constructor
 
 ~DynamicSystem () override
 destructor
 
virtual void updateT ()
 
virtual void updateh (int k=0)
 
virtual void updateM ()
 
virtual void updateLLM ()
 
virtual void updatedq ()
 
virtual void updatedu ()
 
virtual void updatedx ()
 
virtual void updateqd ()
 
virtual void updateud ()
 
virtual void updatexd ()
 
virtual void updatezd ()
 
virtual void updatewb ()
 
virtual void updateW (int j=0)
 
virtual void updateV (int j=0)
 
virtual void updater (int j=0)
 
virtual void updateJrla (int j=0)
 
virtual void updateg ()
 
virtual void updategd ()
 
virtual void updateStopVector ()
 
virtual void updateStopVectorParameters ()
 
virtual void updateLinkStatus ()
 
virtual void updateLinkStatusReg ()
 
virtual void updateWInverseKinetics ()
 
virtual void updatebInverseKinetics ()
 
virtual void sethSize (int hSize_, int j=0)
 
virtual int gethSize (int i=0) const
 
virtual int getqSize () const
 
virtual int getuSize (int i=0) const
 
virtual void calcqSize ()
 
virtual void calcuSize (int j=0)
 
virtual int getuInd (int i=0)
 
virtual void setqInd (int qInd_)
 
virtual void setuInd (int uInd_, int j=0)
 
virtual void sethInd (int hInd_, int j=0)
 
virtual void setxInd (int xInd_)
 
virtual const fmatvec::Vec & getq () const
 
virtual fmatvec::Vec & getq ()
 
virtual const fmatvec::Vec & getu () const
 
virtual fmatvec::Vec & getu ()
 
void setq (const fmatvec::Vec &q_)
 
void setu (const fmatvec::Vec &u_)
 
void setx (const fmatvec::Vec &x_)
 
void setjsv (const fmatvec::VecInt &jsv_)
 
void setInternalState (const fmatvec::Vec &internalState)
 
virtual H5::GroupBasegetPlotGroup ()
 
std::shared_ptr< OpenMBV::GroupgetOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetFramesOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetContoursOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetGroupsOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetObjectsOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetLinksOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetConstraintsOpenMBVGrp () override
 
std::shared_ptr< OpenMBV::GroupgetObserversOpenMBVGrp () override
 
virtual void calcxSize ()
 
const fmatvec::Vec & getx () const
 
fmatvec::Vec & getx ()
 
int getxSize () const
 
void updatexRef (fmatvec::Vec &xParent)
 
void updatexdRef (fmatvec::Vec &xdParent)
 
void updatedxRef (fmatvec::Vec &dxParent)
 
void init (InitStage stage, const InitConfigSet &config) override
 plots time series header More...
 
virtual void initz ()
 
virtual void writez (H5::GroupBase *parent)
 
virtual void readz0 (H5::GroupBase *parent)
 
void setDynamicSystemSolver (DynamicSystemSolver *sys) override
 
void plot () override
 plots time dependent data More...
 
void plotAtSpecialEvent () override
 plots time dependent data at special events More...
 
virtual int solveConstraintsFixpointSingle ()
 solve contact equations with single step fixed point scheme More...
 
virtual int solveImpactsFixpointSingle ()
 solve impact equations with single step fixed point scheme on velocity level More...
 
virtual int solveConstraintsGaussSeidel ()
 solve contact equations with Gauss-Seidel scheme More...
 
virtual int solveImpactsGaussSeidel ()
 solve impact equations with Gauss-Seidel scheme on velocity level More...
 
virtual int solveConstraintsRootFinding ()
 solve contact equations with Newton scheme More...
 
virtual int solveImpactsRootFinding ()
 solve impact equations with Newton scheme on velocity level More...
 
virtual int jacobianConstraints ()
 compute JACOBIAN of contact equations
 
virtual int jacobianImpacts ()
 compute JACOBIAN of contact equations on velocity level
 
virtual void checkConstraintsForTermination ()
 validate force laws concerning given tolerances More...
 
virtual void checkImpactsForTermination ()
 validate force laws concerning given tolerances on velocity level More...
 
virtual void updaterFactors ()
 update relaxation factors for contact equations
 
virtual FramegetFrame (const std::string &name, bool check=true) const
 
virtual ContourgetContour (const std::string &name, bool check=true) const
 
void setFrameOfReference (Frame *frame)
 
const FramegetFrameOfReference () const
 
const fmatvec::Mat & getT (bool check=true) const
 
const fmatvec::Vec & geth (int i=0, bool check=true) const
 
const fmatvec::SymMat & getM (bool check=true) const
 
const fmatvec::SymMat & getLLM (bool check=true) const
 
const fmatvec::Vec & getdq (bool check=true) const
 
const fmatvec::Vec & getdu (bool check=true) const
 
const fmatvec::Vec & getdx (bool check=true) const
 
const fmatvec::Vec & getqd (bool check=true) const
 
const fmatvec::Vec & getud (bool check=true) const
 
const fmatvec::Vec & getxd (bool check=true) const
 
const fmatvec::Mat & getW (int i=0, bool check=true) const
 
const fmatvec::Mat & getV (int i=0, bool check=true) const
 
const fmatvec::Vec & getwb (bool check=true) const
 
const fmatvec::Vec & getla (bool check=true) const
 
const fmatvec::Vec & getLa (bool check=true) const
 
const fmatvec::Vec & getg (bool check=true) const
 
const fmatvec::Vec & getgd (bool check=true) const
 
fmatvec::Vec & getla (bool check=true)
 
fmatvec::Vec & getLa (bool check=true)
 
void setla (const fmatvec::Vec &la_)
 
void setLa (const fmatvec::Vec &La_)
 
fmatvec::VecInt & getjsv ()
 
const fmatvec::VecInt & getjsv () const
 
fmatvec::Mat & getW (int i=0, bool check=true)
 
fmatvec::SymMat & getLLM (bool check=true)
 
fmatvec::Vec & getdq (bool check=true)
 
fmatvec::Vec & getdu (bool check=true)
 
fmatvec::Vec & getdx (bool check=true)
 
fmatvec::VecInt & getLinkStatus ()
 
fmatvec::VecInt & getLinkStatusReg ()
 
const fmatvec::VecInt & getLinkStatus () const
 
const fmatvec::VecInt & getLinkStatusReg () const
 
const fmatvec::Mat & evalT ()
 
const fmatvec::Vec & evalh (int i=0)
 
const fmatvec::SymMat & evalM ()
 
const fmatvec::SymMat & evalLLM ()
 
const fmatvec::Mat & evalW (int i=0)
 
const fmatvec::Mat & evalV (int i=0)
 
const fmatvec::Vec & evalwb ()
 
const fmatvec::Vec & evalr (int i=0)
 
const fmatvec::Mat & evalJrla (int i=0)
 
const fmatvec::Vec & evalrdt ()
 
const fmatvec::Vec & evalg ()
 
const fmatvec::Vec & evalgd ()
 
const fmatvec::Mat & evalWInverseKinetics ()
 
const fmatvec::Mat & evalbInverseKinetics ()
 
void setqd (const fmatvec::Vec &qd_)
 
void setud (const fmatvec::Vec &ud_)
 
void setxd (const fmatvec::Vec &xd_)
 
int getxInd ()
 
int getlaInd () const
 
int gethInd (int i=0)
 
void setlaInd (int ind)
 
void setisInd (int ind)
 
void setgInd (int ind)
 
void setgdInd (int ind)
 
void setrFactorInd (int ind)
 
virtual void setsvInd (int svInd_)
 
void setLinkStatusInd (int LinkStatusInd_)
 
void setLinkStatusRegInd (int LinkStatusRegInd_)
 
void setqSize (int qSize_)
 
void setuSize (int uSize_, int i=0)
 
void setxSize (int xSize_)
 
int getisSize () const
 
int getlaSize () const
 
int getgSize () const
 
int getgdSize () const
 
int getrFactorSize () const
 
int getsvSize () const
 
int getLinkStatusSize () const
 
int getLinkStatusRegSize () const
 
const std::vector< Object * > & getObjects () const
 
const std::vector< Link * > & getLinks () const
 
const std::vector< DynamicSystem * > & getDynamicSystems () const
 
const std::vector< Frame * > & getFrames () const
 
const std::vector< Contour * > & getContours () const
 
const std::vector< Link * > & getSetValuedLinks () const
 
void updateqRef (fmatvec::Vec &qParent)
 references to positions of dynamic system parent More...
 
void updateqdRef (fmatvec::Vec &qdParent)
 references to differentiated positions of dynamic system parent More...
 
void updatedqRef (fmatvec::Vec &dqParent)
 
void updateuRef (fmatvec::Vec &uParent)
 references to velocities of dynamic system parent More...
 
void updateuallRef (fmatvec::Vec &uParent)
 references to velocities of dynamic system parent More...
 
void updateudRef (fmatvec::Vec &udParent)
 references to differentiated velocities of dynamic system parent More...
 
void updateduRef (fmatvec::Vec &duParent)
 
void updateudallRef (fmatvec::Vec &udParent)
 references to velocities of dynamic system parent More...
 
void updatehRef (fmatvec::Vec &hParent, int j=0)
 references to smooth right hand side of dynamic system parent More...
 
void updaterRef (fmatvec::Vec &rParent, int j=0)
 references to nonsmooth right hand side of dynamic system parent More...
 
void updateJrlaRef (fmatvec::Mat &rParent, int j=0)
 
void updaterdtRef (fmatvec::Vec &rdtParent)
 references to nonsmooth right hand side of dynamic system parent More...
 
void updateTRef (fmatvec::Mat &TParent)
 references to linear transformation matrix between differentiated positions and velocities of dynamic system parent More...
 
void updateMRef (fmatvec::SymMat &MParent)
 references to mass matrix of dynamic system parent More...
 
void updateLLMRef (fmatvec::SymMat &LLMParent)
 references to Cholesky decomposition of dynamic system parent More...
 
virtual void updateInternalStateRef (fmatvec::Vec &curisParent, fmatvec::Vec &nextisParent)
 references to internal state of dynamic system parent
 
virtual void updategRef (fmatvec::Vec &gParent)
 references to relative distances of dynamic system parent More...
 
virtual void updategdRef (fmatvec::Vec &gdParent)
 references to relative velocities of dynamic system parent More...
 
void updatelaRef (fmatvec::Vec &laParent)
 references to contact forces of dynamic system parent More...
 
void updateLaRef (fmatvec::Vec &LaParent)
 references to contact impulses of dynamic system parent More...
 
void updatelaInverseKineticsRef (fmatvec::Vec &laParent)
 
void updatebInverseKineticsRef (fmatvec::Mat &bParent)
 
virtual void updatewbRef (fmatvec::Vec &wbParent)
 references to TODO of dynamic system parent More...
 
virtual void updateWRef (fmatvec::Mat &WParent, int j=0)
 references to contact force direction matrix of dynamic system parent More...
 
void updateWInverseKineticsRef (fmatvec::Mat &WParent)
 references to contact force direction matrix of dynamic system parent More...
 
virtual void updateVRef (fmatvec::Mat &VParent, int j=0)
 references to condensed contact force direction matrix of dynamic system parent More...
 
void updatesvRef (fmatvec::Vec &svParent)
 references to stopvector (rootfunction for event driven integrator) of dynamic system parent More...
 
void updatejsvRef (fmatvec::VecInt &jsvParent)
 references to boolean evaluation of stopvector concerning roots of dynamic system parent More...
 
void updateLinkStatusRef (fmatvec::VecInt &LinkStatusParent)
 references to status vector of set valued links with piecewise link equations (which piece is valid) More...
 
void updateLinkStatusRegRef (fmatvec::VecInt &LinkStatusRegParent)
 references to status vector of single valued links More...
 
void updateresRef (fmatvec::Vec &resParent)
 references to residuum of contact equations of dynamic system parent More...
 
void updaterFactorRef (fmatvec::Vec &rFactorParent)
 references to relaxation factors for contact equations of dynamic system parent More...
 
void clearElementLists ()
 
void buildListOfDynamicSystems (std::vector< DynamicSystem * > &sys)
 build flat list of dynamic systems More...
 
void buildListOfObjects (std::vector< Object * > &obj)
 build flat list of objects More...
 
void buildListOfLinks (std::vector< Link * > &lnk)
 build flat list of links More...
 
void buildListOfConstraints (std::vector< Constraint * > &crt)
 build flat list of all constraints More...
 
void buildListOfFrames (std::vector< Frame * > &frm)
 build flat list of frames More...
 
void buildListOfContours (std::vector< Contour * > &cnt)
 build flat list of contours More...
 
void buildListOfModels (std::vector< ModellingInterface * > &modelList)
 build flat list of models More...
 
void buildListOfInverseKineticsLinks (std::vector< Link * > &iklnk)
 build flat list of inverse kinetics links More...
 
void buildListOfObservers (std::vector< Observer * > &obsrv)
 build flat list of observers More...
 
void setUpInverseKinetics ()
 analyse constraints of dynamic systems for usage in inverse kinetics
 
void setUpLinks ()
 distribute links to set- and single valued container
 
bool gActiveChanged ()
 
bool gActiveChangedReg ()
 
bool detectImpact ()
 
void calcsvSize ()
 calculates size of stop vector
 
void calclaSize (int j)
 calculates size of contact force parameters
 
void calcLinkStatusSize ()
 calculates size of set-valued link status vector
 
void calcLinkStatusRegSize ()
 calculates size of single-valued link status vector
 
void calclaInverseKineticsSize ()
 calculates size of contact force parameters
 
void calcbInverseKineticsSize ()
 calculates size of contact force parameters
 
void calcisSize ()
 
virtual void aboutToUpdateInternalState ()
 
virtual void postprocessing ()
 
void calcgSize (int j)
 calculates size of relative distances
 
void calcgdSize (int j)
 calculates size of gap velocities More...
 
void calcrFactorSize (int j)
 calculates size of relaxation factors for contact equations
 
void setUpObjectsWithNonConstantMassMatrix ()
 rearrange vector of active setvalued links
 
void setUpActiveLinks ()
 rearrange vector of active setvalued links
 
void checkActive (int j)
 check if set-valued contacts are active and set corresponding attributes More...
 
virtual void setGeneralizedRelativePositionTolerance (double tol)
 
virtual void setGeneralizedRelativeVelocityTolerance (double tol)
 
virtual void setGeneralizedRelativeAccelerationTolerance (double tol)
 
virtual void setGeneralizedForceTolerance (double tol)
 
virtual void setGeneralizedImpulseTolerance (double tol)
 
virtual void setGeneralizedRelativePositionCorrectionValue (double corr)
 
virtual void setGeneralizedRelativeVelocityCorrectionValue (double corr)
 
void setrMax (double rMax)
 
int frameIndex (const Frame *frame_) const
 
void addFrame (FixedRelativeFrame *frame)
 
void addContour (RigidContour *contour)
 
void addGroup (DynamicSystem *sys)
 
DynamicSystemgetGroup (const std::string &name, bool check=true) const
 
void addObject (Object *obj)
 
ObjectgetObject (const std::string &name, bool check=true) const
 
void addLink (Link *lnk)
 
void addConstraint (Constraint *crt)
 
void addInverseKineticsLink (Link *lnk)
 
ObservergetObserver (const std::string &name, bool check=true) const
 
void addObserver (Observer *ele)
 
LinkgetLink (const std::string &name, bool check=true) const
 
ConstraintgetConstraint (const std::string &name, bool check=true) const
 
void addModel (ModellingInterface *model_)
 
ModellingInterfacegetModel (const std::string &name, bool check=true) const
 
FramegetFrameI ()
 
ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const override
 Get the Element named name in the container named container. More...
 
virtual void updatecorr (int j)
 
void updatecorrRef (fmatvec::Vec &ref)
 
void calccorrSize (int j)
 
void checkRoot ()
 
void resetUpToDate () override
 
void updateStateTable ()
 
H5::GroupBasegetFramesPlotGroup () override
 
H5::GroupBasegetContoursPlotGroup () override
 
H5::GroupBasegetGroupsPlotGroup () override
 
H5::GroupBasegetObjectsPlotGroup () override
 
H5::GroupBasegetLinksPlotGroup () override
 
H5::GroupBasegetConstraintsPlotGroup () override
 
H5::GroupBasegetObserversPlotGroup () override
 
- 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
 

Public Attributes

int(DynamicSystemSolver::* solveSmooth_ )()
 
int(DynamicSystemSolver::* solveConstraints_ )()
 
int(DynamicSystemSolver::* solveImpacts_ )()
 function pointer for election of prox-solver for impact equations on velocity level More...
 

Protected Attributes

double t
 time
 
double dt
 step size
 
int zSize
 size of state vector
 
fmatvec::Vec z
 state vector
 
fmatvec::Vec zd
 derivative of state vector
 
fmatvec::SymMat MParent
 mass matrix
 
fmatvec::SymMat LLMParent
 Cholesky decomposition of mass matrix.
 
fmatvec::Mat TParent
 matrix of linear relation between differentiated positions and velocities
 
fmatvec::Mat WParent [2]
 contact force directions
 
fmatvec::Mat VParent [2]
 condensed contact force directions
 
fmatvec::Vec wbParent
 TODO.
 
fmatvec::Vec laParent
 contact force parameters
 
fmatvec::Vec LaParent
 
fmatvec::Vec rFactorParent
 relaxation parameters for contact equations
 
fmatvec::Vec sParent
 TODO.
 
fmatvec::Vec resParent
 residuum of contact equations
 
fmatvec::Vec curisParent
 
fmatvec::Vec nextisParent
 
fmatvec::Vec gParent
 relative distances
 
fmatvec::Vec gdParent
 relative velocities
 
fmatvec::Vec zParent
 state
 
fmatvec::Vec zdParent
 differentiated state
 
fmatvec::Vec dxParent
 
fmatvec::Vec dqParent
 
fmatvec::Vec duParent
 
fmatvec::Vec hParent [2]
 smooth, smooth with respect to objects, smooth with respect to links right hand side
 
fmatvec::Vec rParent [2]
 nonsmooth right hand side
 
fmatvec::Vec rdtParent
 
fmatvec::Mat JrlaParent [2]
 
fmatvec::Vec svParent
 stopvector (rootfunctions for event driven integration
 
fmatvec::VecInt jsvParent
 boolean evaluation of stopvector
 
fmatvec::VecInt LinkStatusParent
 status vector of set valued links with piecewise link equation (which piece is valid)
 
fmatvec::VecInt LinkStatusRegParent
 status vector of single valued links
 
fmatvec::SparseMat Gs
 sparse mass action matrix
 
fmatvec::SqrMat Jprox
 JACOBIAN of contact equations for Newton scheme.
 
fmatvec::SqrMat G
 mass action matrix
 
fmatvec::Vec bc
 TODO.
 
fmatvec::Vec bi
 
bool term
 boolean to check for termination of contact equations solution
 
int maxIter
 maximum number of contact iterations, high number of contact iterations for warnings, maximum number of damping steps for Newton scheme
 
int highIter
 
int maxDampingSteps
 
int iterc
 
int iteri
 
double lmParm
 Levenberg-Marquard parameter.
 
Solver smoothSolver
 solver for contact equations and impact equations
 
Solver contactSolver
 
Solver impactSolver
 
bool stopIfNoConvergence
 flag if the contact equations should be stopped if there is no convergence
 
bool dropContactInfo
 flag if contact matrices for debugging should be dropped in no-convergence case
 
bool useOldla
 flag if contac force parameter of last time step should be used
 
bool numJac
 flag if Jacobian for Newton scheme should be calculated numerically
 
fmatvec::VecInt decreaseLevels
 decreasing relaxation factors is done in levels containing the number of contact iterations as condition
 
fmatvec::VecInt checkTermLevels
 TODO.
 
bool checkGSize
 boolean if force action matrix should be resized in each step
 
int limitGSize
 TODO.
 
bool peds
 TODO, flag for occuring impact and sticking in event driven solver.
 
double tolProj
 Tolerance for projection of generalized position.
 
double tolLocalSolver { 1e-10 }
 Tolerance for local none-linear solvers (solvers on element level)
 
double tolDSS { 1e-9 }
 Tolerance for global none-linear solvers (solvers on DynamicSystemSolver level)
 
fmatvec::Vec laInverseKineticsParent
 
fmatvec::Mat bInverseKineticsParent
 
fmatvec::Mat WInverseKineticsParent
 
bool alwaysConsiderContact
 
bool inverseKinetics
 
bool initialProjection
 
bool determineEquilibriumState
 
bool useConstraintSolverForPlot
 
fmatvec::Vec corrParent
 
int rootID
 
double gTol
 
double gdTol
 
double gddTol
 
double laTol
 
double LaTol
 
bool updT
 
bool updh [2]
 
bool updr [2]
 
bool updJrla [2]
 
bool updrdt
 
bool updM
 
bool updLLM
 
bool updW [2]
 
bool updV [2]
 
bool updwb
 
bool updg
 
bool updgd
 
bool updG
 
bool updbc
 
bool updbi
 
bool updsv
 
bool updzd
 
bool updla
 
bool updLa
 
bool upddq
 
bool upddu
 
bool upddx
 
bool useSmoothSolver
 
bool qdequ
 
std::vector< StateTabletabz
 
int compressionLevel { H5::File::getDefaultCompression() }
 
int chunkSize { H5::File::getDefaultChunkSize() }
 
int cacheSize { H5::File::getDefaultCacheSize() }
 
- Protected Attributes inherited from MBSim::Group
fmatvec::Vec RrRD
 
fmatvec::SqrMat ARD
 
- Protected Attributes inherited from MBSim::DynamicSystem
FrameR
 parent frame
 
std::vector< Object * > object
 container for possible ingredients
 
std::vector< Object * > objectWithNonConstantMassMatrix
 
std::vector< Link * > link
 
std::vector< Link * > linkSingleValued
 
std::vector< Link * > linkSetValued
 
std::vector< Link * > linkSetValuedActive
 
std::vector< Link * > linkWithStopVector
 
std::vector< ModellingInterface * > model
 
std::vector< DynamicSystem * > dynamicsystem
 
std::vector< Link * > inverseKineticsLink
 
std::vector< Observer * > observer
 
std::vector< Constraint * > constraint
 
fmatvec::Mat T
 linear relation matrix of position and velocity parameters
 
fmatvec::SymMat M
 mass matrix
 
fmatvec::SymMat LLM
 Cholesky decomposition of mass matrix.
 
fmatvec::Vec q
 positions, differentiated positions, initial positions
 
fmatvec::Vec qd
 
fmatvec::Vec dq
 
fmatvec::Vec u
 velocities, differentiated velocities, initial velocities
 
fmatvec::Vec ud
 
fmatvec::Vec du
 
fmatvec::Vec x
 order one parameters, differentiated order one parameters, initial order one parameters
 
fmatvec::Vec xd
 
fmatvec::Vec dx
 
fmatvec::Vec h [2]
 smooth, smooth with respect to objects, smooth with respect to links and nonsmooth
 
fmatvec::Vec r [2]
 
fmatvec::Vec rdt
 
fmatvec::Mat Jrla [2]
 Jacobian dr/dla.
 
fmatvec::Mat W [2]
 
fmatvec::Mat V [2]
 
fmatvec::Vec la
 contact force parameters
 
fmatvec::Vec La
 
fmatvec::Vec curis
 
fmatvec::Vec nextis
 
fmatvec::Vec g
 relative distances and velocities
 
fmatvec::Vec gd
 
fmatvec::Vec wb
 TODO.
 
fmatvec::Vec res
 residuum of nonlinear contact equations for Newton scheme
 
fmatvec::Vec rFactor
 rfactors for relaxation nonlinear contact equations
 
fmatvec::Vec sv
 stop vector (root functions for event driven integration
 
fmatvec::VecInt jsv
 boolean evaluation of stop vector concerning roots
 
fmatvec::VecInt LinkStatus
 status of set-valued links
 
fmatvec::VecInt LinkStatusReg
 status of single-valued links
 
int qSize
 size and local start index of positions relative to parent
 
int qInd
 
int uSize [2]
 size and local start index of velocities relative to parent
 
int uInd [2]
 
int xSize
 size and local start index of order one parameters relative to parent
 
int xInd
 
int hSize [2]
 size and local start index of order smooth right hand side relative to parent
 
int hInd [2]
 
int isSize
 
int isInd
 
int gSize
 size and local start index of relative distances relative to parent
 
int gInd
 
int gdSize
 size and local start index of relative velocities relative to parent
 
int gdInd
 
int laSize
 size and local start index of contact force parameters relative to parent
 
int laInd
 
int rFactorSize
 size and local start index of rfactors relative to parent
 
int rFactorInd
 
int svSize
 size and local start index of stop vector relative to parent
 
int svInd
 
int LinkStatusSize
 size and local start index of set-valued link status vector relative to parent
 
int LinkStatusInd
 
int LinkStatusRegSize
 size and local start index of single-valued link status vector relative to parent
 
int LinkStatusRegInd
 
std::vector< Frame * > frame
 vector of frames and contours
 
std::vector< Contour * > contour
 
std::shared_ptr< OpenMBV::GroupopenMBVGrp
 
std::shared_ptr< OpenMBV::GroupframesOpenMBVGrp
 
std::shared_ptr< OpenMBV::GroupcontoursOpenMBVGrp
 
std::shared_ptr< OpenMBV::GroupgroupsOpenMBVGrp
 
std::shared_ptr< OpenMBV::GroupobjectsOpenMBVGrp
 
std::shared_ptr< OpenMBV::GrouplinksOpenMBVGrp
 
std::shared_ptr< OpenMBV::GroupconstraintsOpenMBVGrp
 
std::shared_ptr< OpenMBV::GroupobserversOpenMBVGrp
 
std::shared_ptr< H5::Filehdf5File
 
FrameI
 
int laInverseKineticsSize
 size of contact force parameters of special links relative to parent
 
int bInverseKineticsSize
 
fmatvec::Mat WInverseKinetics
 
fmatvec::Mat bInverseKinetics
 
fmatvec::Vec laInverseKinetics
 
int corrSize
 
int corrInd
 
fmatvec::Vec corr
 
std::string saved_frameOfReference
 
H5::GroupBaseframesPlotGroup
 
H5::GroupBasecontoursPlotGroup
 
H5::GroupBasegroupsPlotGroup
 
H5::GroupBaseobjectsPlotGroup
 
H5::GroupBaselinksPlotGroup
 
H5::GroupBaseconstraintsPlotGroup
 
H5::GroupBaseobserversPlotGroup
 
- 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
 

Private Member Functions

void constructor ()
 set plot feature default values
 
void addToGraph (Graph *graph, fmatvec::SqrMat &A, int i, std::vector< Element * > &objList)
 adds list of objects to tree More...
 

Static Private Member Functions

static void sigInterruptHandler (int)
 handler for user interrupt signal
 

Private Attributes

bool exitRequestPrinted
 
bool READZ0
 is a state read from a file
 
bool truncateSimulationFiles
 
std::vector< DynamicSystem * > dynamicsystemPreReorganize
 
double facSizeGs
 
std::vector< std::unique_ptr< Environment > > environments
 
MBSimEnvironmentmbsimEnvironment = nullptr
 
bool firstPlot { true }
 
std::unique_ptr< MultiDimNewtonMethodnonlinearConstraintNewtonSolver
 
std::unique_ptr< ConstraintResiduumconstraintResiduum
 
std::unique_ptr< ConstraintJacobianconstraintJacobian
 

Static Private Attributes

static std::atomic< bool > exitRequest = false
 boolean signal evaluation for end integration set by user
 

Additional Inherited Members

- 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

solver interface for modelling and simulation of dynamic systems

Author
Martin Foerg
Date
2009-03-31 some comments (Thorsten Schindler)
2009-07-16 splitted link / object right hand side (Thorsten Schindler)
2009-07-27 implicit integration (Thorsten Schindler)
2009-07-28 splitted interfaces (Thorsten Schindler)
2009-08-07 preintegration (Thorsten Schindler)
2009-08-21 reorganize hierarchy (Thorsten Schindler)
2009-12-14 revised inverse kinetics (Martin Foerg)
2010-07-06 modifications for timestepper ssc - e.g LinkStatus (Robert Huber)
2012-05-08 modifications for AutoTimeSteppingSSCIntegrator (Jan Clauberg)
2012-05-08 dhdq and dhdu with lower and upper bound (Jan Clauberg)
2014-09-16 contact forces are calculated on acceleration level (Thorsten Schindler)

Constructor & Destructor Documentation

◆ DynamicSystemSolver()

MBSim::DynamicSystemSolver::DynamicSystemSolver ( const std::string &  name = "")

constructor

Parameters
nameof dynamic system

Member Function Documentation

◆ addElement()

void MBSim::DynamicSystemSolver::addElement ( Element element_)
Parameters
elementto add
Todo:
necessary? TODO

◆ addToGraph()

void MBSim::DynamicSystemSolver::addToGraph ( Graph graph,
fmatvec::SqrMat &  A,
int  i,
std::vector< Element * > &  objList 
)
private

adds list of objects to tree

Parameters
treewhere to add objects
currentnode in the tree
matrixof dependencies
currententry of matrix of dependencies
listof objects

◆ checkConstraintsForTermination()

void MBSim::DynamicSystemSolver::checkConstraintsForTermination ( )
overridevirtual

validate force laws concerning given tolerances

Reimplemented from MBSim::DynamicSystem.

◆ checkImpactsForTermination()

void MBSim::DynamicSystemSolver::checkImpactsForTermination ( )
overridevirtual

validate force laws concerning given tolerances on velocity level

Reimplemented from MBSim::DynamicSystem.

◆ dropContactMatrices()

void MBSim::DynamicSystemSolver::dropContactMatrices ( )

writes a file with relevant matrices for debugging

◆ getElement()

Element * MBSim::DynamicSystemSolver::getElement ( const std::string &  name)
Parameters
nameof the element
Returns
the pointer to an element
Todo:
not activated TODO

◆ getEnvironment()

template<class Env >
Env * MBSim::DynamicSystemSolver::getEnvironment

Get the Environment of type Env. Note that this function uses runtime type information to get the correct environment. This may be slow! Instead of calling this method often you should call it once, store the returned pointer and use this pointer. If no Environment of type Env exits a new one (empty one) is added first and than returned.

◆ getLinkStatus()

void MBSim::DynamicSystemSolver::getLinkStatus ( fmatvec::VecInt &  LinkStatusExt)

brief collect status of all set-valued links

Parameters
resultvector
time

◆ getLinkStatusReg()

void MBSim::DynamicSystemSolver::getLinkStatusReg ( fmatvec::VecInt &  LinkStatusRegExt)

brief collect status of all single-valued links

Parameters
resultvector
time

◆ getMBSimEnvironment()

MBSimEnvironment * MBSim::DynamicSystemSolver::getMBSimEnvironment ( )

Get the MBSimEnvironment. This method a convinence method being fast compared to getEnvironment<MBSimEnvironment>

◆ getSolverInfo()

string MBSim::DynamicSystemSolver::getSolverInfo ( )
Returns
information for solver

◆ init()

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

plots time series header

Parameters
invocingparent class

Reimplemented from MBSim::DynamicSystem.

◆ initialize()

void MBSim::DynamicSystemSolver::initialize ( )

Initialize the system.

This function calls init(InitStage stage) with all stages defined in the enumeration InitStage, in the order in which they are defined in this enumeration.

The init(InitStage stage) functions of all classes MUST call the init(InitStage stage) functions of all objects for which this class holds as a container. This call is always done at the end of the function independent of the stage.

If the init(InitStage stage) function implements a given stage, the init(InitStage stage) function of the base class should be call or not as expected by the programer for this stage. For all other (not implemented) stages the function of the base call must always be called.

Example for a proper init(InitStage stage) function:

void MyClass::init(InitStage stage) {
if(stage==preInit) {
// do something
MyBaseClass::init(stage, config); // base must be called
// do something
}
else if(stage==plot) {
// do something
// base need not be called
}
else
MyBaseClass::init(stage, config);
for(int i=0; i<container.size(); i++)
container[i]->init(stage, config);
}
void plot() override
plots time dependent data
Definition: dynamic_system_solver.cc:1748
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: dynamic_system_solver.cc:120
InitStage
The stages of the initialization.
Definition: element.h:62
@ preInit
Definition: element.h:64

◆ initializeUsingXML()

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

Reimplemented from MBSim::Element.

◆ initla()

void MBSim::DynamicSystemSolver::initla ( )

load contact forces for use as starting value

Todo:
put in dynamic system TODO

◆ initLa()

void MBSim::DynamicSystemSolver::initLa ( )

load contact impulses for use as starting value

Todo:
put in dynamic system TODO

◆ plot()

void MBSim::DynamicSystemSolver::plot ( )
overridevirtual

plots time dependent data

Parameters
simulationtime
simulationtime step size for derivative calculation

Reimplemented from MBSim::DynamicSystem.

◆ readz0()

void MBSim::DynamicSystemSolver::readz0 ( std::string  fileName)

reads state from a file

Parameters
nameof the file

◆ resetUpToDate()

void MBSim::DynamicSystemSolver::resetUpToDate ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ savela()

void MBSim::DynamicSystemSolver::savela ( )

save contact forces for use as starting value in next time step

Todo:
put in dynamic system TODO

◆ saveLa()

void MBSim::DynamicSystemSolver::saveLa ( )

save contact impulses for use as starting value in next time step

Todo:
put in dynamic system TODO

◆ setDynamicSystemSolverTolerance()

void MBSim::DynamicSystemSolver::setDynamicSystemSolverTolerance ( double  tol)
inline

set tolerance for global none-linear solver (solvers on DynamicSystemSolver level), like the Newton-Solver in directNonlinear

Parameters
tolerance

◆ setLocalSolverTolerance()

void MBSim::DynamicSystemSolver::setLocalSolverTolerance ( double  tol)
inline

set tolerance for local none-linear solver (solvers on element level), like the Newton-Solver in JointConstraint

Parameters
tolerance

◆ setProjectionTolerance()

void MBSim::DynamicSystemSolver::setProjectionTolerance ( double  tol)
inline

set tolerance for projection of generalized position

Parameters
tolerance

◆ setStopIfNoConvergence()

void MBSim::DynamicSystemSolver::setStopIfNoConvergence ( bool  flag,
bool  dropInfo = false 
)
inline
Parameters
specifywhether time integration should be stopped in case of no convergence of constraint-problem
specifywhether contact informations should be dropped to file

◆ shift()

const Vec & MBSim::DynamicSystemSolver::shift ( std::optional< std::reference_wrapper< bool > > &&  velProjWasCalled = {},
std::optional< std::reference_wrapper< bool > > &&  posProjWasCalled = {} 
)
virtual

update for event driven integrator for event

Parameters
state(return)
booleanevaluation of stop vector
time

◆ solveConstraintsFixpointSingle()

int MBSim::DynamicSystemSolver::solveConstraintsFixpointSingle ( )
overridevirtual

solve contact equations with single step fixed point scheme

Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

◆ solveConstraintsGaussSeidel()

int MBSim::DynamicSystemSolver::solveConstraintsGaussSeidel ( )
overridevirtual

solve contact equations with Gauss-Seidel scheme

Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

◆ solveConstraintsLinearEquations()

int MBSim::DynamicSystemSolver::solveConstraintsLinearEquations ( )

solution of contact equations with direct linear solver using minimum of least squares

Returns
iterations of solver
Todo:
put in dynamic system? TODO

◆ solveConstraintsNonlinearEquations()

int MBSim::DynamicSystemSolver::solveConstraintsNonlinearEquations ( )

solution of contact equations with direct nonlinear newton solver using minimum of least squares in each iteration step

Returns
iterations of solver
Todo:
put in dynamic system? TODO

◆ solveConstraintsRootFinding()

int MBSim::DynamicSystemSolver::solveConstraintsRootFinding ( )
overridevirtual

solve contact equations with Newton scheme

Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

◆ solveImpactsFixpointSingle()

int MBSim::DynamicSystemSolver::solveImpactsFixpointSingle ( )
overridevirtual

solve impact equations with single step fixed point scheme on velocity level

Parameters
timestep-size
Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

◆ solveImpactsGaussSeidel()

int MBSim::DynamicSystemSolver::solveImpactsGaussSeidel ( )
overridevirtual

solve impact equations with Gauss-Seidel scheme on velocity level

Parameters
timestep-size
Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

◆ solveImpactsLinearEquations()

int MBSim::DynamicSystemSolver::solveImpactsLinearEquations ( )

solution of contact equations with Cholesky decomposition on velocity level

Parameters
timestep-size, if 0 non-impulsive contributions vanish
Returns
iterations of solver
Todo:
put in dynamic system? TODO

◆ solveImpactsRootFinding()

int MBSim::DynamicSystemSolver::solveImpactsRootFinding ( )
overridevirtual

solve impact equations with Newton scheme on velocity level

Parameters
timestep-size
Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

◆ updatedq()

void MBSim::DynamicSystemSolver::updatedq ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updatedu()

void MBSim::DynamicSystemSolver::updatedu ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updatedx()

void MBSim::DynamicSystemSolver::updatedx ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updateG()

void MBSim::DynamicSystemSolver::updateG ( )
virtual

updates mass action matrix

Parameters
time

◆ updateg()

void MBSim::DynamicSystemSolver::updateg ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updategd()

void MBSim::DynamicSystemSolver::updategd ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updategdRef()

void MBSim::DynamicSystemSolver::updategdRef ( fmatvec::Vec &  ref)
inlineoverridevirtual

references to relative velocities of dynamic system parent

Parameters
vectorto be referenced

Reimplemented from MBSim::DynamicSystem.

◆ updategRef()

void MBSim::DynamicSystemSolver::updategRef ( fmatvec::Vec &  ref)
inlineoverridevirtual

references to relative distances of dynamic system parent

Parameters
vectorto be referenced

Reimplemented from MBSim::DynamicSystem.

◆ updateh()

void MBSim::DynamicSystemSolver::updateh ( int  i = 0)
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updateJrla()

void MBSim::DynamicSystemSolver::updateJrla ( int  j = 0)
virtual

Reimplemented from MBSim::DynamicSystem.

◆ updateLLM()

void MBSim::DynamicSystemSolver::updateLLM ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updateM()

void MBSim::DynamicSystemSolver::updateM ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updater()

void MBSim::DynamicSystemSolver::updater ( int  j = 0)
virtual

update smooth link force law

for links holding non-smooth contributions \(\dd\vLambda\), the respective forces are projected into the minimal coordinate representation of the associated Bodys using the JACOBIAN matrices \(\vJ\).

\[ \vr = \vJ\dd\vLambda \]

The JACOBIAN is provided by the connected Frames (which might be user-defined for Joints or internally defined for Contacts).

Parameters
simulationtime

Reimplemented from MBSim::DynamicSystem.

◆ updateStopVector()

void MBSim::DynamicSystemSolver::updateStopVector ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updateT()

void MBSim::DynamicSystemSolver::updateT ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updateV()

void MBSim::DynamicSystemSolver::updateV ( int  j = 0)
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updateVRef()

void MBSim::DynamicSystemSolver::updateVRef ( fmatvec::Mat &  ref,
int  i = 0 
)
inlineoverridevirtual

references to condensed contact force direction matrix of dynamic system parent

Parameters
matrixto be referenced
indexof normal usage and inverse kinetics

Reimplemented from MBSim::DynamicSystem.

◆ updateW()

void MBSim::DynamicSystemSolver::updateW ( int  j = 0)
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updatewb()

void MBSim::DynamicSystemSolver::updatewb ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updatewbRef()

void MBSim::DynamicSystemSolver::updatewbRef ( fmatvec::Vec &  ref)
inlineoverridevirtual

references to TODO of dynamic system parent

Parameters
vectorto be referenced

Reimplemented from MBSim::DynamicSystem.

◆ updateWRef()

void MBSim::DynamicSystemSolver::updateWRef ( fmatvec::Mat &  ref,
int  i = 0 
)
inlineoverridevirtual

references to contact force direction matrix of dynamic system parent

Parameters
matrixto be referenced
indexof normal usage and inverse kinetics

Reimplemented from MBSim::DynamicSystem.

◆ updatezd()

void MBSim::DynamicSystemSolver::updatezd ( )
overridevirtual

Reimplemented from MBSim::DynamicSystem.

◆ updatezdRef()

void MBSim::DynamicSystemSolver::updatezdRef ( fmatvec::Vec &  ext)

references to differentiated external state

mbsim/dynamic_system_solver.cc

Parameters
differentiatedexternal state

◆ updatezRef()

void MBSim::DynamicSystemSolver::updatezRef ( fmatvec::Vec &  ext)

references to external state

Parameters
externalstate

◆ writeStateTable()

void MBSim::DynamicSystemSolver::writeStateTable ( std::string  fileName)

writes state table to a file

Parameters
nameof the file
h5,elseascii

◆ writez()

void MBSim::DynamicSystemSolver::writez ( std::string  fileName,
bool  formatH5 = true 
)

writes state to a file

Parameters
nameof the file
h5,elseascii

Member Data Documentation

◆ solveConstraints_

int(DynamicSystemSolver::* MBSim::DynamicSystemSolver::solveConstraints_) ()

\function pointer for election of prox-solver for contact equations

Returns
iterations of solver

◆ solveImpacts_

int(DynamicSystemSolver::* MBSim::DynamicSystemSolver::solveImpacts_) ()

function pointer for election of prox-solver for impact equations on velocity level

Parameters
timestep
Returns
iterations of solver

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