All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MBSim::DynamicSystemSolver Class Reference

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

#include <dynamic_system_solver.h>

Inheritance diagram for MBSim::DynamicSystemSolver:
MBSim::Group MBSim::DynamicSystem MBSim::Element fmatvec::Atom

Public Types

enum  Solver {
  FixedPointTotal, FixedPointSingle, GaussSeidel, LinearEquations,
  RootFinding
}
 solver for contact equations
 
enum  Strategy { global, local }
 relaxation strategies in solution of contact equations
 
enum  LinAlg { LUDecomposition, LevenbergMarquardt, PseudoInverse }
 linear algebra for Newton scheme in solution of contact equations
 
- Public Types inherited from MBSim::Element
enum  PlotFeatureStatus { enabled, disabled, unset }
 Plot feature status. More...
 
enum  PlotFeature {
  plotRecursive =0, separateFilePerGroup, state, stateDerivative,
  notMinimalState, rightHandSide, globalPosition, globalVelocity,
  globalAcceleration, energy, openMBV, generalizedLinkForce,
  linkKinematics, stopVector, debug, LASTPLOTFEATURE
}
 Plot Features. More...
 
enum  InitStage {
  modelBuildup =0, resolveXMLPath, preInit, resize,
  relativeFrameContourLocation, worldFrameContourLocation, plotting, reorganizeHierarchy,
  unknownStage, calculateLocalInitialValues, LASTINITSTAGE
}
 The stages of the initialization. More...
 
- Public Types inherited from fmatvec::Atom
enum  MsgType
 

Public Member Functions

 DynamicSystemSolver (const std::string &name="")
 constructor More...
 
virtual ~DynamicSystemSolver ()
 destructor
 
void initialize ()
 Initialize the system. More...
 
void setTruncateSimulationFiles (bool trunc)
 
void init (InitStage stage)
 plots time series header More...
 
virtual int solveConstraintsFixpointSingle ()
 solve contact equations with single step fixed point scheme More...
 
virtual int solveImpactsFixpointSingle (double dt=0)
 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 (double dt=0)
 solve impact equations with Gauss-Seidel scheme on velocity level More...
 
virtual int solveConstraintsRootFinding ()
 solve contact equations with Newton scheme More...
 
virtual int solveImpactsRootFinding (double dt=0)
 solve impact equations with Newton scheme on velocity level More...
 
virtual void checkConstraintsForTermination ()
 validate force laws concerning given tolerances
 
virtual void checkImpactsForTermination (double dt=0)
 validate force laws concerning given tolerances on velocity level
 
virtual void updateh (double t, int i=0)
 
virtual void updateM (double t, int i=0)
 
virtual void updateStateDependentVariables (double t)
 
virtual void updater (double t, int j=0)
 update smooth link force law More...
 
virtual void updatewb (double t, int j=0)
 
virtual void updateW (double t, int j=0)
 
virtual void updateV (double t, int j=0)
 
virtual std::string getType () const
 
virtual void plot (const fmatvec::Vec &z, double t, double dt=1)
 
virtual void plot2 (const fmatvec::Vec &z, double t, double dt=1)
 
virtual void closePlot ()
 closes plot file
 
virtual int solveConstraints ()
 solves prox-functions for contact forces using sparsity structure More...
 
virtual int solveImpacts (double dt=0)
 solves prox-functions for impacts on velocity level using sparsity structure More...
 
void setConstraintSolver (Solver solver_)
 
void setImpactSolver (Solver solver_)
 
const SolvergetConstraintSolver ()
 
const SolvergetImpactSolver ()
 
void setTermination (bool term_)
 
void setStrategy (Strategy strategy_)
 
void setMaxIter (int iter)
 
void setHighIter (int iter)
 
void setNumJacProj (bool numJac_)
 
void setMaxDampingSteps (int maxDSteps)
 
void setLevenbergMarquardtParam (double lmParm_)
 
void setLinAlg (LinAlg linAlg_)
 
void setUseOldla (bool flag)
 
void setDecreaseLevels (const fmatvec::VecInt &decreaseLevels_)
 
void setCheckTermLevels (const fmatvec::VecInt &checkTermLevels_)
 
void setCheckGSize (bool checkGSize_)
 
void setLimitGSize (int limitGSize_)
 
const fmatvec::SparseMat & getGs () const
 
fmatvec::SparseMat & getGs ()
 
const fmatvec::SqrMatgetG () const
 
fmatvec::SqrMatgetG ()
 
const fmatvec::Vecgetb () const
 
fmatvec::Vecgetb ()
 
const fmatvec::SqrMatgetJprox () const
 
fmatvec::SqrMatgetJprox ()
 
const fmatvec::MatgetWParent (int i=0) const
 
const fmatvec::MatgetVParent (int i=0) const
 
const fmatvec::VecgetlaParent () const
 
const fmatvec::VecgetgdParent () const
 
const fmatvec::VecgetresParent () const
 
const fmatvec::VecgetrFactorParent () const
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
bool getIntegratorExitRequest ()
 
int getMaxIter ()
 
void computeInitialCondition ()
 compute initial condition for links for event driven integrator
 
fmatvec::Vec deltau (const fmatvec::Vec &zParent, double t, double dt)
 
fmatvec::Vec deltaq (const fmatvec::Vec &zParent, double t, double dt)
 
fmatvec::Vec deltax (const fmatvec::Vec &zParent, double t, double dt)
 return x-state difference for current time More...
 
virtual void initz (fmatvec::Vec &z0)
 initialises state variables
 
int solveConstraintsLinearEquations ()
 solution of contact equations with Cholesky decomposition More...
 
int solveImpactsLinearEquations (double dt=0)
 solution of contact equations with Cholesky decomposition on velocity level More...
 
virtual void updateG (double t, int i=0)
 updates mass action matrix More...
 
void decreaserFactors ()
 decrease relaxation factors if mass action matrix is not diagonal dominant
 
void update (const fmatvec::Vec &z, double t, int options=0)
 update of dynamic system for time-stepping integrator More...
 
virtual void shift (fmatvec::Vec &z, const fmatvec::VecInt &jsv, double t)
 update for event driven integrator for event More...
 
virtual void zdot (const fmatvec::Vec &z, fmatvec::Vec &zd, double t)
 update for event driven integrator during smooth phase More...
 
virtual fmatvec::Vec zdot (const fmatvec::Vec &zParent, double t)
 standard invocation of smooth update for event driven integration More...
 
virtual void getsv (const fmatvec::Vec &z, fmatvec::Vec &svExt, double t)
 evaluation of stop vector More...
 
void getLinkStatus (fmatvec::VecInt &LinkStatusExt, double t)
 
void getLinkStatusReg (fmatvec::VecInt &LinkStatusRegExt, double t)
 
void projectGeneralizedPositions (double t, int mode, bool fullUpdate=false)
 drift projection for positions More...
 
void projectGeneralizedVelocities (double t, int mode)
 drift projection for positions More...
 
void savela (double dt=1.0)
 save contact force parameter for use as starting value in next time step More...
 
void initla (double dt=1.0)
 load contact force parameter for use as starting value More...
 
double computeKineticEnergy ()
 compute kinetic energy of entire dynamic system
 
double computePotentialEnergy ()
 compute potential energy of entire dynamic system change? TODO
 
void addElement (Element *element_)
 
ElementgetElement (const std::string &name)
 
std::string getSolverInfo ()
 
void setStopIfNoConvergence (bool flag, bool dropInfo=false)
 
void dropContactMatrices ()
 
void setPartialEventDrivenSolver (bool peds_)
 
void writez (std::string fileName, bool formatH5=true)
 writes state to a file More...
 
void readz0 (std::string fileName)
 reads state from a file More...
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
virtual xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *element)
 
void writeXMLFile (const std::string &name)
 
void writeXMLFile ()
 
void setProjectionTolerance (double tol)
 set tolerance for projection of generalized position More...
 
void setgTol (double tol)
 
void setgdTol (double tol)
 
void setgddTol (double tol)
 
void setlaTol (double tol)
 
void setLaTol (double tol)
 
void updatezRef (const fmatvec::Vec &ext)
 references to external state More...
 
void setFlushEvery (unsigned int every)
 set the number of plot-routine-calls after which all hdf5-files will be flushed More...
 
void setAlwaysConsiderContact (bool alwaysConsiderContact_)
 
void setInverseKinetics (bool inverseKinetics_)
 
void setInitialProjection (bool initialProjection_)
 
void setUseConstraintSolverForPlot (bool useConstraintSolverForPlot_)
 
fmatvec::Mat dhdq (double t, int lb=0, int ub=0)
 
fmatvec::Mat dhdu (double t, int lb=0, int ub=0)
 
fmatvec::Mat dhdx (double t)
 
fmatvec::Vec dhdt (double t)
 
void setRootID (int ID)
 
int getRootID () const
 
void setq (const fmatvec::Vec &q_)
 
void setLa (const fmatvec::Vec &la_)
 
- Public Member Functions inherited from MBSim::Group
 Group (const std::string &name="")
 constructor More...
 
virtual ~Group ()
 destructor
 
virtual void updateJacobians (double t, int j=0)
 
virtual void facLLM (int i=0)
 compute Cholesky decomposition of mass matrix TODO necessary?
 
virtual void updatedu (double t, double dt)
 
virtual void updatezd (double t)
 
virtual void updateud (double t, int i=0)
 
- Public Member Functions inherited from MBSim::DynamicSystem
 DynamicSystem (const std::string &name)
 constructor
 
virtual ~DynamicSystem ()
 destructor
 
virtual void updateT (double t)
 
virtual void updateStateDerivativeDependentVariables (double t)
 
virtual void updatedq (double t, double dt)
 
virtual void updateqd (double t)
 
virtual void sethSize (int hSize_, int i=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 i=0)
 
virtual void sethInd (int hInd_, int i=0)
 
virtual void setxInd (int xInd_)
 
virtual const fmatvec::Vecgetq () const
 
virtual fmatvec::Vecgetq ()
 
virtual const fmatvec::Vecgetu () const
 
virtual fmatvec::Vecgetu ()
 
virtual H5::GroupBasegetPlotGroup ()
 
virtual PlotFeatureStatus getPlotFeature (PlotFeature fp)
 
virtual PlotFeatureStatus getPlotFeatureForChildren (PlotFeature fp)
 
virtual void updateg (double t)
 
virtual void updategd (double t)
 
virtual void updateStopVector (double t)
 
virtual void updateLinkStatus (double t)
 
virtual void updateLinkStatusReg (double t)
 
virtual void updategInverseKinetics (double t)
 
virtual void updategdInverseKinetics (double t)
 
virtual void updateWInverseKinetics (double t, int j=0)
 
virtual void updatehInverseKinetics (double t, int j=0)
 
virtual void updateJacobiansInverseKinetics (double t, int j=0)
 
virtual void updatebInverseKinetics (double t)
 
virtual void updatedx (double t, double dt)
 
virtual void updatexd (double t)
 
virtual void calcxSize ()
 
const fmatvec::Vecgetx () const
 
fmatvec::Vecgetx ()
 
int getxSize () const
 
void updatexRef (const fmatvec::Vec &ref)
 
void updatexdRef (const fmatvec::Vec &ref)
 
virtual void initz ()
 
virtual void writez (H5::GroupBase *group)
 
virtual void readz0 (H5::GroupBase *parent)
 
virtual void setDynamicSystemSolver (DynamicSystemSolver *sys)
 sets the used dynamics system solver to the element More...
 
virtual void plot (double t, double dt)
 plots time dependent data More...
 
virtual void plotAtSpecialEvent (double t, double dt=1.)
 plots time dependent data at special events More...
 
virtual int jacobianConstraints ()
 compute JACOBIAN of contact equations
 
virtual int jacobianImpacts ()
 compute JACOBIAN of contact equations on velocity level
 
virtual FramegetFrame (const std::string &name, bool check=true) const
 
virtual ContourgetContour (const std::string &name, bool check=true) const
 
void setPosition (const fmatvec::Vec3 &PrPF_)
 
void setOrientation (const fmatvec::SqrMat3 &APF_)
 
void setFrameOfReference (Frame *frame)
 
const fmatvec::Vec3 & getPosition () const
 
const fmatvec::SqrMat3 & getOrientation () const
 
const FramegetFrameOfReference () const
 
const fmatvec::Vecgetxd () const
 
fmatvec::Vecgetxd ()
 
const fmatvec::Vecgetx0 () const
 
fmatvec::Vecgetx0 ()
 
const fmatvec::MatgetT () const
 
const fmatvec::SymMatgetM (int i=0) const
 
const fmatvec::SymMatgetLLM (int i=0) const
 
fmatvec::SymMatgetLLM (int i=0)
 
const fmatvec::Vecgeth (int j=0) const
 
fmatvec::Vecgeth (int j=0)
 
const fmatvec::Vecgetf () const
 
fmatvec::Vecgetf ()
 
const fmatvec::MatgetW (int i=0) const
 
fmatvec::MatgetW (int i=0)
 
const fmatvec::MatgetV (int i=0) const
 
fmatvec::MatgetV (int i=0)
 
const fmatvec::Vecgetla () const
 
fmatvec::Vecgetla ()
 
const fmatvec::Vecgetg () const
 
fmatvec::Vecgetg ()
 
const fmatvec::Vecgetgd () const
 
fmatvec::Vecgetgd ()
 
const fmatvec::VecgetrFactor () const
 
fmatvec::VecgetrFactor ()
 
fmatvec::Vecgetsv ()
 
const fmatvec::Vecgetsv () const
 
fmatvec::VecInt & getjsv ()
 
const fmatvec::VecInt & getjsv () const
 
fmatvec::VecInt & getLinkStatus ()
 
fmatvec::VecInt & getLinkStatusReg ()
 
const fmatvec::VecInt & getLinkStatus () const
 
const fmatvec::VecInt & getLinkStatusReg () const
 
const fmatvec::Vecgetres () const
 
fmatvec::Vecgetres ()
 
const fmatvec::Vecgetcorr () const
 
fmatvec::Vecgetcorr ()
 
void setx (const fmatvec::Vec &x_)
 
void setx0 (const fmatvec::Vec &x0_)
 
void setx0 (double x0_)
 
int getxInd ()
 
int getlaInd () const
 
int gethInd (int i=0)
 
void setlaInd (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_)
 
int getzSize () const
 
void setqSize (int qSize_)
 
void setuSize (int uSize_, int i=0)
 
void setxSize (int xSize_)
 
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
 
void updateqRef (const fmatvec::Vec &ref)
 references to positions of dynamic system parent More...
 
void updateqdRef (const fmatvec::Vec &ref)
 references to differentiated positions of dynamic system parent More...
 
void updateuRef (const fmatvec::Vec &ref)
 references to velocities of dynamic system parent More...
 
void updateuallRef (const fmatvec::Vec &ref)
 references to velocities of dynamic system parent More...
 
void updateudRef (const fmatvec::Vec &ref, int i=0)
 references to differentiated velocities of dynamic system parent More...
 
void updateudallRef (const fmatvec::Vec &ref, int i=0)
 references to velocities of dynamic system parent More...
 
void updatehRef (const fmatvec::Vec &hRef, int i=0)
 references to smooth right hand side of dynamic system parent More...
 
void updaterRef (const fmatvec::Vec &ref, int j=0)
 references to nonsmooth right hand side of dynamic system parent More...
 
void updateTRef (const fmatvec::Mat &ref)
 references to linear transformation matrix between differentiated positions and velocities of dynamic system parent More...
 
void updateMRef (const fmatvec::SymMat &ref, int i=0)
 references to mass matrix of dynamic system parent More...
 
void updateLLMRef (const fmatvec::SymMat &ref, int i=0)
 references to Cholesky decomposition of dynamic system parent More...
 
void updategRef (const fmatvec::Vec &ref)
 references to relative distances of dynamic system parent More...
 
void updategdRef (const fmatvec::Vec &ref)
 references to relative velocities of dynamic system parent More...
 
void updatelaRef (const fmatvec::Vec &ref)
 references to contact force parameters of dynamic system parent More...
 
void updatelaInverseKineticsRef (const fmatvec::Vec &ref)
 
void updatebInverseKineticsRef (const fmatvec::Mat &ref)
 
void updatewbRef (const fmatvec::Vec &ref)
 references to TODO of dynamic system parent More...
 
void updateWRef (const fmatvec::Mat &ref, int i=0)
 references to contact force direction matrix of dynamic system parent More...
 
void updateWInverseKineticsRef (const fmatvec::Mat &ref, int i=0)
 references to contact force direction matrix of dynamic system parent More...
 
void updateVRef (const fmatvec::Mat &ref, int i=0)
 references to condensed contact force direction matrix of dynamic system parent More...
 
void updatesvRef (const fmatvec::Vec &ref)
 references to stopvector (rootfunction for event driven integrator) of dynamic system parent More...
 
void updatejsvRef (const fmatvec::VecInt &ref)
 references to boolean evaluation of stopvector concerning roots of dynamic system parent More...
 
void updateLinkStatusRef (const fmatvec::VecInt &LinkStatusParent)
 references to status vector of set valued links with piecewise link equations (which piece is valid) More...
 
void updateLinkStatusRegRef (const fmatvec::VecInt &LinkStatusRegParent)
 references to status vector of single valued links More...
 
void updateresRef (const fmatvec::Vec &ref)
 references to residuum of contact equations of dynamic system parent More...
 
void updaterFactorRef (const fmatvec::Vec &ref)
 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 buildListOfSetValuedLinks (std::vector< Link * > &lnk)
 build flat list of all setvalued links 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 * > &model)
 build flat list of models More...
 
void buildListOfInverseKineticsLinks (std::vector< Link * > &lnk)
 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 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 setUpActiveLinks ()
 rearrange vector of active setvalued links
 
void checkActive (int i)
 check if set-valued contacts are active and set corresponding attributes More...
 
void checkActiveReg (int i)
 check if single-valued contacts are active
 
void setrMax (double rMax)
 
void addFrame (FixedRelativeFrame *frame)
 
int frameIndex (const Frame *frame_) const
 
void addGroup (DynamicSystem *dynamicsystem)
 
DynamicSystemgetGroup (const std::string &name, bool check=true) const
 
void addObject (Object *object)
 
ObjectgetObject (const std::string &name, bool check=true) const
 
void addLink (Link *link)
 
void addInverseKineticsLink (Link *link)
 
ObservergetObserver (const std::string &name, bool check=true) const
 
void addObserver (Observer *element)
 
LinkgetLink (const std::string &name, bool check=true) const
 
void addModel (ModellingInterface *modell)
 
ModellingInterfacegetModel (const std::string &name, bool check=true) const
 
FixedRelativeFramegetFrameI ()
 
virtual ElementgetChildByContainerAndName (const std::string &container, const std::string &name) const
 Get the Element named name in the container named container.
 
virtual void updatecorr (int j)
 
void updatecorrRef (const fmatvec::Vec &ref)
 
void calccorrSize (int j)
 
void checkRoot ()
 
- Public Member Functions inherited from MBSim::Element
 Element (const std::string &name)
 constructor
 
virtual ~Element ()
 destructor
 
virtual void initDataInterfaceBase (DynamicSystemSolver *parentds)
 TODO.
 
const std::string & getName () const
 
void setName (const std::string &str)
 
void setPath (const std::string &str)
 
DynamicSystemSolvergetDynamicSystemSolver ()
 
virtual void createPlotGroup ()
 creates the plotGroup for H5-output
 
H5::GroupBasegetPlotGroup ()
 
virtual void setPlotFeature (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature. More...
 
void setPlotFeatureForChildren (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature for the children of this object. More...
 
void setPlotFeatureRecursive (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature for this object and the children of this object. More...
 
PlotFeatureStatus getPlotFeature (PlotFeature pf)
 
PlotFeatureStatus getPlotFeatureForChildren (PlotFeature pf)
 
const std::vector
< MBXMLUtils::EmbedDOMLocator > & 
getLocationStack () const
 
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=NULL, 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 ElementgetParent ()
 
virtual const ElementgetParent () const
 
virtual void setParent (Element *parent_)
 
std::vector< Element * > getElementsDependingOn () 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...
 
- Public Member Functions inherited from fmatvec::Atom
Atomoperator= (const Atom &)
 
void setMessageStreamActive (MsgType type, bool active)
 
void getMessageStream (MsgType type, boost::shared_ptr< bool > &a, boost::shared_ptr< std::ostream > &s)
 
void adoptMessageStreams (const Atom *src=NULL)
 
std::ostream & msg (MsgType type)
 
bool msgAct (MsgType type)
 

Static Public Member Functions

static void sigInterruptHandler (int)
 handler for user interrupt signal
 
static void sigAbortHandler (int)
 handler for abort signals
 
static void sigSegfaultHandler (int)
 
static DynamicSystemSolverreadXMLFile (const std::string &filename)
 
- Static Public Member Functions inherited from MBSim::Element
static double getDouble (xercesc::DOMElement *e)
 
static int getInt (xercesc::DOMElement *e)
 
static bool getBool (xercesc::DOMElement *e)
 
static fmatvec::Vec3 getVec3 (xercesc::DOMElement *e)
 
static fmatvec::Vec getVec (xercesc::DOMElement *e, int rows=0)
 
static fmatvec::Mat3xV getMat3xV (xercesc::DOMElement *e, int cols=0)
 
static fmatvec::Mat getMat (xercesc::DOMElement *e, int rows=0, int cols=0)
 
static fmatvec::SqrMat3 getSqrMat3 (xercesc::DOMElement *e)
 
static fmatvec::SqrMat getSqrMat (xercesc::DOMElement *e, int size=0)
 
static fmatvec::SymMat3 getSymMat3 (xercesc::DOMElement *e)
 
static fmatvec::SymMat getSymMat (xercesc::DOMElement *e, int size=0)
 
- Static Public Member Functions inherited from fmatvec::Atom
static void setCurrentMessageStream (MsgType type, const boost::shared_ptr< bool > &a=boost::make_shared< bool >(true), const boost::shared_ptr< std::ostream > &s=boost::make_shared< std::ostream >(std::cout.rdbuf()))
 
static std::ostream & msgStatic (MsgType type)
 
static bool msgActStatic (MsgType type)
 

Public Attributes

int(DynamicSystemSolver::* solveConstraints_ )()
 
int(DynamicSystemSolver::* solveImpacts_ )(double dt)
 function pointer for election of prox-solver for impact equations on velocity level More...
 
- Public Attributes inherited from MBSim::Group
fmatvec::Vec RrRD
 
fmatvec::SqrMat ARD
 

Protected Member Functions

void updatezdRef (const fmatvec::Vec &ext)
 references to differentiated external state More...
 
virtual void updaterFactors ()
 update relaxation factors for contact equations More...
 
void computeConstraintForces (double t)
 compute inverse kinetics constraint forces More...
 
- Protected Member Functions inherited from MBSim::DynamicSystem
void addContour (Contour *contour)
 
- Protected Member Functions inherited from MBSim::Element
void updatePlotFeatures ()
 
- Protected Member Functions inherited from fmatvec::Atom
 Atom (const Atom &src)
 

Protected Attributes

fmatvec::SymMat MParent [2]
 mass matrix
 
fmatvec::SymMat LLMParent [2]
 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 rFactorParent
 relaxation parameters for contact equations
 
fmatvec::Vec sParent
 TODO.
 
fmatvec::Vec resParent
 residuum of contact equations
 
fmatvec::Vec gParent
 relative distances
 
fmatvec::Vec gdParent
 relative velocities
 
fmatvec::Vec zParent
 state
 
fmatvec::Vec zdParent
 differentiated state
 
fmatvec::Vec udParent1
 
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 fParent
 right hand side of order one parameters
 
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 b
 TODO.
 
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
 
double lmParm
 Levenberg-Marquard parameter.
 
Solver contactSolver
 solver for contact equations and impact equations
 
Solver impactSolver
 
Strategy strategy
 relaxarion strategy for solution of fixed-point scheme
 
LinAlg linAlg
 linear system solver used for Newton scheme in contact equations
 
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.
 
int warnLevel
 level for warning output (0-2)
 
bool peds
 TODO, flag for occuring impact and sticking in event driven solver.
 
unsigned int driftCount
 TODO, additional stop in event driven solver for drift correction.
 
unsigned int flushEvery
 flushes all hdf5-files every x-times the plot-routine is called TODO
 
unsigned int flushCount
 counts plot-calls until files to be flushed TODO
 
double tolProj
 Tolerance for projection of generalized position.
 
fmatvec::Vec laInverseKineticsParent
 
fmatvec::Mat bInverseKineticsParent
 
fmatvec::Mat WInverseKineticsParent [2]
 
bool alwaysConsiderContact
 
bool inverseKinetics
 
bool initialProjection
 
bool useConstraintSolverForPlot
 
fmatvec::Vec corrParent
 
int rootID
 
double gTol
 
double gdTol
 
double gddTol
 
double laTol
 
double LaTol
 
- Protected Attributes inherited from MBSim::DynamicSystem
FrameR
 parent frame
 
fmatvec::Vec3 PrPF
 relative translation with respect to parent frame
 
fmatvec::SqrMat3 APF
 relative rotation with respect to parent frame
 
std::vector< Object * > object
 container for possible ingredients
 
std::vector< Link * > link
 
std::vector< Link * > linkSingleValued
 
std::vector< Link * > linkSetValued
 
std::vector< Link * > linkSetValuedActive
 
std::vector< ModellingInterface * > model
 
std::vector< DynamicSystem * > dynamicsystem
 
std::vector< Link * > inverseKineticsLink
 
std::vector< Observer * > observer
 
std::vector< std::vector< Link * > > linkOrdered
 
fmatvec::Mat T
 linear relation matrix of position and velocity parameters
 
fmatvec::SymMat M [2]
 mass matrix
 
fmatvec::SymMat LLM [2]
 Cholesky decomposition of mass matrix.
 
fmatvec::Vec q
 positions, differentiated positions, initial positions
 
fmatvec::Vec qd
 
fmatvec::Vec q0
 
fmatvec::Vec u
 velocities, differentiated velocities, initial velocities
 
fmatvec::Vec ud [2]
 
fmatvec::Vec u0
 
fmatvec::Vec x
 order one parameters, differentiated order one parameters, initial order one parameters
 
fmatvec::Vec xd
 
fmatvec::Vec x0
 
fmatvec::Vec h [2]
 smooth, smooth with respect to objects, smooth with respect to links, nonsmooth and order one right hand side
 
fmatvec::Vec r [2]
 
fmatvec::Vec f
 
fmatvec::Mat W [2]
 
fmatvec::Mat V [2]
 
fmatvec::Vec la
 contact force parameters
 
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 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
 
boost::shared_ptr< H5::Filehdf5File
 
FixedRelativeFrameI
 
int laInverseKineticsSize
 size of contact force parameters of special links relative to parent
 
int bInverseKineticsSize
 
fmatvec::Mat WInverseKinetics [2]
 
fmatvec::Mat bInverseKinetics
 
fmatvec::Vec laInverseKinetics
 
int corrSize
 
int corrInd
 
fmatvec::Vec corr
 
std::string saved_frameOfReference
 
- Protected Attributes inherited from MBSim::Element
Elementparent
 
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.
 
std::vector
< MBXMLUtils::EmbedDOMLocator > 
locationStack
 
DynamicSystemSolverds
 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::GroupBaseplotGroup
 associated plot group
 
std::vector< Element * > dependency
 vector containing all dependencies.
 

Private Member Functions

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

Private Attributes

bool integratorExitRequest
 boolean signal evaluation for end integration set by program
 
bool READZ0
 is a state read from a file
 
bool truncateSimulationFiles
 
std::vector< DynamicSystem * > dynamicsystemPreReorganize
 

Static Private Attributes

static bool exitRequest = false
 boolean signal evaluation for end integration set by user
 

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)
Todo:

projectGeneralizedPositions seems to be buggy with at least TimeSteppingIntegrator (see SliderCrank)

RootFinding seems to be buggy (see EdgeMill)

Constructor & Destructor Documentation

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

constructor

Parameters
nameof dynamic system

Member Function Documentation

void MBSim::DynamicSystemSolver::addElement ( Element element_)
Parameters
elementto add
Todo:
necessary? TODO
void MBSim::DynamicSystemSolver::addToGraph ( Graph graph,
fmatvec::SqrMat A,
int  i,
std::vector< Object * > &  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
void MBSim::DynamicSystemSolver::computeConstraintForces ( double  t)
protected

compute inverse kinetics constraint forces

Parameters
currenttime
Vec MBSim::DynamicSystemSolver::deltaq ( const fmatvec::Vec zParent,
double  t,
double  dt 
)
Returns
position difference for current time
Parameters
state
time
timestep
Vec MBSim::DynamicSystemSolver::deltau ( const fmatvec::Vec zParent,
double  t,
double  dt 
)
Parameters
state
time
timestep
Returns
velocity difference for current time
Vec MBSim::DynamicSystemSolver::deltax ( const fmatvec::Vec zParent,
double  t,
double  dt 
)

return x-state difference for current time

Parameters
parentstate
time
timestep
void MBSim::DynamicSystemSolver::dropContactMatrices ( )

writes a file with relevant matrices for debugging

Element * MBSim::DynamicSystemSolver::getElement ( const std::string &  name)
Parameters
nameof the element
Returns
the pointer to an element
Todo:
not activated TODO
void MBSim::DynamicSystemSolver::getLinkStatus ( fmatvec::VecInt &  LinkStatusExt,
double  t 
)

brief collect status of all set-valued links

Parameters
resultvector
time
void MBSim::DynamicSystemSolver::getLinkStatusReg ( fmatvec::VecInt &  LinkStatusRegExt,
double  t 
)

brief collect status of all single-valued links

Parameters
resultvector
time
string MBSim::DynamicSystemSolver::getSolverInfo ( )
Returns
information for solver including strategy and linear algebra
void MBSim::DynamicSystemSolver::getsv ( const fmatvec::Vec z,
fmatvec::Vec svExt,
double  t 
)
virtual

evaluation of stop vector

Parameters
state
TODO
time
virtual std::string MBSim::DynamicSystemSolver::getType ( ) const
inlinevirtual

DEPRECATED

Reimplemented from MBSim::Group.

void MBSim::DynamicSystemSolver::init ( InitStage  stage)
virtual

plots time series header

Parameters
invocingparent class

Reimplemented from MBSim::DynamicSystem.

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); // base must be called
* // do something
* }
* else if(stage==plot) {
* // do something
* // base need not be called
* }
* else
* MyBaseClass::init(stage);
*
* for(int i=0; i<container.size(); i++)
* container[i]->init(stage);
* }
*
void MBSim::DynamicSystemSolver::initla ( double  dt = 1.0)

load contact force parameter for use as starting value

Todo:
put in dynamic system TODO
void MBSim::DynamicSystemSolver::projectGeneralizedPositions ( double  t,
int  mode,
bool  fullUpdate = false 
)

drift projection for positions

Parameters
time
void MBSim::DynamicSystemSolver::projectGeneralizedVelocities ( double  t,
int  mode 
)

drift projection for positions

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

reads state from a file

Parameters
nameof the file
void MBSim::DynamicSystemSolver::savela ( double  dt = 1.0)

save contact force parameter for use as starting value in next time step

Todo:
put in dynamic system TODO
void MBSim::DynamicSystemSolver::setFlushEvery ( unsigned int  every)
inline

set the number of plot-routine-calls after which all hdf5-files will be flushed

Parameters
flag
void MBSim::DynamicSystemSolver::setgddTol ( double  tol)
inlinevirtual
Parameters
tolerancefor relative acceleration

Reimplemented from MBSim::DynamicSystem.

void MBSim::DynamicSystemSolver::setgdTol ( double  tol)
inlinevirtual
Parameters
tolerancefor relative velocity

Reimplemented from MBSim::DynamicSystem.

void MBSim::DynamicSystemSolver::setgTol ( double  tol)
inlinevirtual
Parameters
tolerancefor relative velocity

Reimplemented from MBSim::DynamicSystem.

void MBSim::DynamicSystemSolver::setlaTol ( double  tol)
inlinevirtual
Parameters
tolerancefor contact force

Reimplemented from MBSim::DynamicSystem.

void MBSim::DynamicSystemSolver::setLaTol ( double  tol)
inlinevirtual
Parameters
tolerancefor impact

Reimplemented from MBSim::DynamicSystem.

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

set tolerance for projection of generalized position

Parameters
tolerance
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
void MBSim::DynamicSystemSolver::shift ( fmatvec::Vec z,
const fmatvec::VecInt &  jsv,
double  t 
)
virtual

update for event driven integrator for event

Parameters
state(return)
booleanevaluation of stop vector
time
int MBSim::DynamicSystemSolver::solveConstraints ( )
virtual

solves prox-functions for contact forces using sparsity structure

Returns
iterations of solver
int MBSim::DynamicSystemSolver::solveConstraintsFixpointSingle ( )
virtual

solve contact equations with single step fixed point scheme

Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

int MBSim::DynamicSystemSolver::solveConstraintsGaussSeidel ( )
virtual

solve contact equations with Gauss-Seidel scheme

Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

int MBSim::DynamicSystemSolver::solveConstraintsLinearEquations ( )

solution of contact equations with Cholesky decomposition

Returns
iterations of solver
Todo:
put in dynamic system? TODO
int MBSim::DynamicSystemSolver::solveConstraintsRootFinding ( )
virtual

solve contact equations with Newton scheme

Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

int MBSim::DynamicSystemSolver::solveImpacts ( double  dt = 0)
virtual

solves prox-functions for impacts on velocity level using sparsity structure

Parameters
timestep-size
Returns
iterations of solver
int MBSim::DynamicSystemSolver::solveImpactsFixpointSingle ( double  dt = 0)
virtual

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

Parameters
timestep-size
Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

int MBSim::DynamicSystemSolver::solveImpactsGaussSeidel ( double  dt = 0)
virtual

solve impact equations with Gauss-Seidel scheme on velocity level

Parameters
timestep-size
Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

int MBSim::DynamicSystemSolver::solveImpactsLinearEquations ( double  dt = 0)

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
int MBSim::DynamicSystemSolver::solveImpactsRootFinding ( double  dt = 0)
virtual

solve impact equations with Newton scheme on velocity level

Parameters
timestep-size
Returns
iterations of solver

Reimplemented from MBSim::DynamicSystem.

void MBSim::DynamicSystemSolver::update ( const fmatvec::Vec z,
double  t,
int  options = 0 
)

update of dynamic system for time-stepping integrator

Parameters
state
time
options= 0 (default) nothing = 1 force updates as if active constraints has changed
void MBSim::DynamicSystemSolver::updateG ( double  t,
int  i = 0 
)
virtual

updates mass action matrix

Parameters
time
void MBSim::DynamicSystemSolver::updater ( double  t,
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
void MBSim::DynamicSystemSolver::updaterFactors ( )
protectedvirtual

update relaxation factors for contact equations

Todo:
global not available because of unsymmetric mass action matrix TODO

Reimplemented from MBSim::DynamicSystem.

void MBSim::DynamicSystemSolver::updatezdRef ( const fmatvec::Vec ext)
protected

references to differentiated external state

Parameters
differentiatedexternal state
void MBSim::DynamicSystemSolver::updatezRef ( const fmatvec::Vec ext)

references to external state

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

writes state to a file

Parameters
nameof the file
h5,elseascii
void MBSim::DynamicSystemSolver::zdot ( const fmatvec::Vec z,
fmatvec::Vec zd,
double  t 
)
virtual

update for event driven integrator during smooth phase

Parameters
state
differentiatedstate (return)
time
Vec MBSim::DynamicSystemSolver::zdot ( const fmatvec::Vec zParent,
double  t 
)
virtual

standard invocation of smooth update for event driven integration

Parameters
state
time

Member Data Documentation

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

pointer for election of prox-solver for contact equations

Returns
iterations of solver
int(DynamicSystemSolver::* MBSim::DynamicSystemSolver::solveImpacts_)(double dt)

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:

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML