All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
dynamic_system_solver.h
1 /* Copyright (C) 2004-2018 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _DYNAMIC_SYSTEM_SOLVER_H_
21 #define _DYNAMIC_SYSTEM_SOLVER_H_
22 
23 #include "mbsim/group.h"
24 #include "fmatvec/sparse_matrix.h"
25 #include "mbsim/functions/function.h"
26 
27 namespace MBSim {
28 
29  class Graph;
30 
46  class DynamicSystemSolver : public Group {
47 
48  class Residuum : public MBSim::Function<fmatvec::Vec(fmatvec::Vec)> {
49  public:
50  Residuum(MBSim::DynamicSystemSolver *sys_) : sys(sys_) { }
51  fmatvec::Vec operator()(const fmatvec::Vec &z);
52  private:
54  };
55 
56  public:
57 
61  enum Solver { fixedpoint, GaussSeidel, direct, rootfinding, unknownSolver };
62 
67  DynamicSystemSolver(const std::string &name="");
68 
72  ~DynamicSystemSolver() override;
73 
112  void initialize();
113 
114  /*
115  * If true (the default) then
116  * the simulation output files (h5 files) are deleted/truncated/regenerated.
117  * If false, then these files left are untouched from a previous run.
118  * This is useful to regenerate the
119  * e.g. OpenMBV XML files without doing a new integration.
120  */
121  void setTruncateSimulationFiles(bool trunc) { truncateSimulationFiles=trunc; }
122 
123  /* INHERITED INTERFACE OF GROUP */
124  void init(InitStage stage, const InitConfigSet &config) override;
125  using Group::plot;
126  /***************************************************/
127 
128  /* INHERITED INTERFACE OF DYNAMICSYSTEM */
129  int solveConstraintsFixpointSingle() override;
130  int solveImpactsFixpointSingle() override;
131  int solveConstraintsGaussSeidel() override;
132  int solveImpactsGaussSeidel() override;
133  int solveConstraintsRootFinding() override;
134  int solveImpactsRootFinding() override;
135  void checkConstraintsForTermination() override;
136  void checkImpactsForTermination() override;
137  /***************************************************/
138 
139  /* INHERITED INTERFACE OF OBJECTINTERFACE */
140  void updateT() override;
141  void updateh(int i=0) override;
142  void updateM() override;
143  void updateLLM() override;
144  void updatezd() override;
145  /***************************************************/
146 
147  /* INHERITED INTERFACE OF LINKINTERFACE */
148 
159  virtual void updater(int j=0);
160  virtual void updaterdt();
161  void updatewb() override;
162  void updateg() override;
163  void updategd() override;
164  void updateW(int j=0) override;
165  void updateV(int j=0) override;
166  virtual void updatebc();
167  virtual void updatebi();
168  virtual void updatela();
169  virtual void updateLa();
170  /***************************************************/
171 
172  /* INHERITED INTERFACE OF ELEMENT */
173  /***************************************************/
174 
175  /* GETTER / SETTER */
176 
177  void setConstraintSolver(Solver solver_) { contactSolver = solver_; }
178  void setImpactSolver(Solver solver_) { impactSolver = solver_; }
179  const Solver& getConstraintSolver() { return contactSolver; }
180  const Solver& getImpactSolver() { return impactSolver; }
181  void setTermination(bool term_) { term = term_; }
182  void setMaximumIterations(int iter) { maxIter = iter; }
183  void setHighIterations(int iter) { highIter = iter; }
184  void setNumericalJacobian(bool numJac_) { numJac = numJac_; }
185  void setMaximumDampingSteps(int maxDSteps) { maxDampingSteps = maxDSteps; }
186  void setLevenbergMarquardtParamater(double lmParm_) { lmParm = lmParm_; }
187 
188  void setUseOldla(bool flag) { useOldla = flag; }
189  void setDecreaseLevels(const fmatvec::VecInt &decreaseLevels_) { decreaseLevels = decreaseLevels_; }
190  void setCheckTermLevels(const fmatvec::VecInt &checkTermLevels_) { checkTermLevels = checkTermLevels_; }
191  void setCheckGSize(bool checkGSize_) { checkGSize = checkGSize_; }
192  void setLimitGSize(int limitGSize_) { limitGSize = limitGSize_; checkGSize = false; }
193 
194  double& getTime() { return t; }
195  const double& getTime() const { return t; }
196  void setTime(double t_) { t = t_; }
197 
198  double getStepSize() const { return dt; }
199  void setStepSize(double dt_) { dt = dt_; }
200 
201  int getzSize() const { return zSize; }
202 
203  fmatvec::Vec& getState() { return z; }
204  const fmatvec::Vec& getState() const { return z; }
205  void setState(const fmatvec::Vec &z_) { z = z_; }
206 
207  void setzd(const fmatvec::Vec &zd_) { zd = zd_; }
208 
209  const fmatvec::SqrMat& getG(bool check=true) const { assert((not check) or (not updG)); return G; }
210  const fmatvec::SparseMat& getGs(bool check=true) const { assert((not check) or (not updG)); return Gs; }
211  const fmatvec::Vec& getbc(bool check=true) const { assert((not check) or (not updbc)); return bc; }
212  const fmatvec::Vec& getbi(bool check=true) const { assert((not check) or (not updbi)); return bi; }
213  const fmatvec::SqrMat& getJprox() const { return Jprox; }
214  fmatvec::SqrMat& getG(bool check=true) { assert((not check) or (not updG)); return G; }
215  fmatvec::SparseMat& getGs(bool check=true) { assert((not check) or (not updG)); return Gs; }
216  fmatvec::Vec& getbc(bool check=true) { assert((not check) or (not updbc)); return bc; }
217  fmatvec::Vec& getbi(bool check=true) { assert((not check) or (not updbi)); return bi; }
218  fmatvec::SqrMat& getJprox() { return Jprox; }
219 
220  const fmatvec::Vec& evaldq() { if(upddq) updatedq(); return dq; }
221  const fmatvec::Vec& evaldu() { if(upddu) updatedu(); return du; }
222  const fmatvec::Vec& evaldx() { if(upddx) updatedx(); return dx; }
223  const fmatvec::Vec& evalzd();
224  const fmatvec::SqrMat& evalG() { if(updG) updateG(); return G; }
225  const fmatvec::SparseMat& evalGs() { if(updG) updateG(); return Gs; }
226  const fmatvec::Vec& evalbc() { if(updbc) updatebc(); return bc; }
227  const fmatvec::Vec& evalbi() { if(updbi) updatebi(); return bi; }
228  const fmatvec::Vec& evalsv();
229  const fmatvec::Vec& evalz0();
230  const fmatvec::Vec& evalla() { if(updla) updatela(); return la; }
231  const fmatvec::Vec& evalLa() { if(updLa) updateLa(); return La; }
232 
233  fmatvec::Vec& getzParent() { return zParent; }
234  fmatvec::Vec& getzdParent() { return zdParent; }
235  fmatvec::Vec& getlaParent() { return laParent; }
236  fmatvec::Vec& getLaParent() { return LaParent; }
237  const fmatvec::Vec& getzParent() const { return zParent; }
238  const fmatvec::Vec& getzdParent() const { return zdParent; }
239  const fmatvec::Mat& getWParent(int i=0) const { return WParent[i]; }
240  const fmatvec::Mat& getVParent(int i=0) const { return VParent[i]; }
241  const fmatvec::Vec& getlaParent() const { return laParent; }
242  const fmatvec::Vec& getLaParent() const { return LaParent; }
243  const fmatvec::Vec& getgParent() const { return gParent; }
244  const fmatvec::Vec& getgdParent() const { return gdParent; }
245  const fmatvec::Vec& getresParent() const { return resParent; }
246  const fmatvec::Vec& getrFactorParent() const { return rFactorParent; }
247 
248  void resizezParent(int nz) { zParent.resize(nz); }
249  void resizezdParent(int nz) { zdParent.resize(nz); }
250 
251  DynamicSystemSolver* getDynamicSystemSolver() { return this; }
252  bool getIntegratorExitRequest() { return integratorExitRequest; }
253  int getMaxIter() {return maxIter;}
254  int getIterC() {return iterc;}
255  int getIterI() {return iteri;}
256  /***************************************************/
257 
262 
268 
275 
282 
290 
295  virtual void updateG();
296 
300  void decreaserFactors();
301 
308  virtual const fmatvec::Vec& shift();
309 
314  void getLinkStatus(fmatvec::VecInt &LinkStatusExt);
315 
320  void getLinkStatusReg(fmatvec::VecInt &LinkStatusRegExt);
321 
325  bool positionDriftCompensationNeeded(double gmax);
326 
330  bool velocityDriftCompensationNeeded(double gdmax);
331 
335  void projectGeneralizedPositions(int mode, bool fullUpdate=false);
336 
340  void projectGeneralizedVelocities(int mode);
341 
346  void savela();
347 
352  void initla();
353 
358  void saveLa();
359 
364  void initLa();
365 
369  double evalKineticEnergy() { return 0.5*u.T()*M*u; }
370 
375  double evalPotentialEnergy();
376 
381  void addElement(Element *element_);
382 
388  Element* getElement(const std::string &name);
389 
393  std::string getSolverInfo();
394 
399  void setStopIfNoConvergence(bool flag, bool dropInfo = false) { stopIfNoConvergence = flag; dropContactInfo=dropInfo; }
400 
404  void dropContactMatrices();
405 
406  // install the MBSim signal handler
407  static void installSignalHandler();
408 
412  static void sigInterruptHandler(int);
413 
417  static void sigAbortHandler(int);
418 
419  static void sigSegfaultHandler(int);
420 
421  void checkExitRequest();
422 
423  // TODO just for testing
424  void setPartialEventDrivenSolver(bool peds_) { peds = peds_; }
425 
431  void writez(std::string fileName, bool formatH5=true);
432 
437  void readz0(std::string fileName);
438 
439  void initializeUsingXML(xercesc::DOMElement *element) override;
440 
445  void setProjectionTolerance(double tol) { tolProj = tol; }
446 
451  void updatezRef(const fmatvec::Vec &ext);
452 
457  void updatezdRef(const fmatvec::Vec &ext);
458 
463  void setFlushEvery(unsigned int every) { flushEvery = every; }
464 
465  void setAlwaysConsiderContact(bool alwaysConsiderContact_) { alwaysConsiderContact = alwaysConsiderContact_; }
466 
467  void setInverseKinetics(bool inverseKinetics_) { inverseKinetics = inverseKinetics_; }
468  bool getInverseKinetics() const { return inverseKinetics; }
469 
470  void setInitialProjection(bool initialProjection_) { initialProjection = initialProjection_; }
471  bool getInitialProjection() const { return initialProjection; }
472 
473  void setDetermineEquilibriumState(bool determineEquilibriumState_) { determineEquilibriumState = determineEquilibriumState_; }
474  bool getDetermineEquilibriumState() const { return determineEquilibriumState; }
475 
476  void setUseConstraintSolverForSmoothMotion(bool useConstraintSolverForSmoothMotion_) { useConstraintSolverForSmoothMotion = useConstraintSolverForSmoothMotion_; }
477  bool getUseConstraintSolverForSmoothMotion() const { return useConstraintSolverForSmoothMotion; }
478 
479  void setUseConstraintSolverForPlot(bool useConstraintSolverForPlot_) { useConstraintSolverForPlot = useConstraintSolverForPlot_; }
480  bool getUseConstraintSolverForPlot() const { return useConstraintSolverForPlot; }
481 
482  fmatvec::Mat dhdq(int lb=0, int ub=0);
483  fmatvec::Mat dhdu(int lb=0, int ub=0);
484  fmatvec::Mat dhdx();
485  fmatvec::Vec dhdt();
486 
487  void setRootID(int ID) {rootID = ID;}
488  int getRootID() const {return rootID;}
489 
490  void resetUpToDate() override;
491 
492  bool getUpdateT() { return updT; }
493  bool getUpdateM() { return updM; }
494  bool getUpdateLLM() { return updLLM; }
495  bool getUpdateh(int j) { return updh[j]; }
496  bool getUpdater(int j) { return updr[j]; }
497  bool getUpdaterdt() { return updrdt; }
498  bool getUpdateW(int j) { return updW[j]; }
499  bool getUpdateV(int j) { return updV[j]; }
500  bool getUpdatewb() { return updwb; }
501  bool getUpdateg() { return updg; }
502  bool getUpdategd() { return updgd; }
503  bool getUpdatela() { return updla; }
504  bool getUpdateLa() { return updLa; }
505  bool getUpdatezd() { return updzd; }
506  bool getUpdatedq() { return upddq; }
507  bool getUpdatedu() { return upddu; }
508  bool getUpdatedx() { return upddx; }
509  void setUpdatela(bool updla_) { updla = updla_; }
510  void setUpdateLa(bool updLa_) { updLa = updLa_; }
511  void setUpdateG(bool updG_) { updG = updG_; }
512  void setUpdatebi(bool updbi_) { updbi = updbi_; }
513  void setUpdatebc(bool updbc_) { updbc = updbc_; }
514  void setUpdatezd(bool updzd_) { updzd = updzd_; }
515  void setUpdateW(bool updW_, int i=0) { updW[i] = updW_; }
516 
521  void updategRef(const fmatvec::Vec &ref) override { Group::updategRef(ref); updg = true; }
522 
527  void updategdRef(const fmatvec::Vec &ref) override { Group::updategdRef(ref); updgd = true; }
528 
533  void updatewbRef(const fmatvec::Vec &ref) override { Group::updatewbRef(ref); updwb = true; }
534 
540  void updateWRef(const fmatvec::Mat &ref, int i=0) override { Group::updateWRef(ref,i); updW[i] = true; }
541 
547  void updateVRef(const fmatvec::Mat &ref, int i=0) override { Group::updateVRef(ref,i); updV[i] = true; }
548 
552  virtual void updatelaInverseKinetics();
553 
554  void updatedq() override;
555  void updatedu() override;
556  void updatedx() override;
557 
558  void updateStopVector() override;
559 
560  void plot() override;
561 
562  protected:
566  double t;
567 
571  double dt;
572 
576  int zSize;
577 
582 
587 
592 
597 
602 
607 
612 
617 
622 
627 
632 
637 
642 
647 
652 
657 
658  fmatvec::Vec dxParent, dqParent, duParent;
659 
664 
668  fmatvec::Vec rParent[2], rdtParent;
669 
674 
678  fmatvec::VecInt jsvParent;
679 
683  fmatvec::VecInt LinkStatusParent;
684 
689  fmatvec::VecInt LinkStatusRegParent;
690 
694  fmatvec::SparseMat Gs;
695 
700 
705 
710 
714  bool term;
715 
719  int maxIter, highIter, maxDampingSteps, iterc, iteri;
720 
724  double lmParm;
725 
729  Solver contactSolver, impactSolver;
730 
735 
740 
744  bool useOldla;
745 
749  bool numJac;
750 
754  fmatvec::VecInt decreaseLevels;
755 
759  fmatvec::VecInt checkTermLevels;
760 
765 
770 
774  bool peds;
775 
780  unsigned int flushEvery;
781 
786  unsigned int flushCount;
787 
791  double tolProj;
792 
796  fmatvec::Vec laInverseKineticsParent;
797  fmatvec::Mat bInverseKineticsParent;
798 
802  fmatvec::Mat WInverseKineticsParent;
803 
804  bool alwaysConsiderContact;
805  bool inverseKinetics;
806  bool initialProjection;
807  bool determineEquilibriumState;
808  bool useConstraintSolverForSmoothMotion;
809  bool useConstraintSolverForPlot;
810 
811  fmatvec::Vec corrParent;
812 
813  int rootID;
814 
815  double gTol, gdTol, gddTol, laTol, LaTol;
816 
817  bool updT, updh[2], updr[2], updrdt, updM, updLLM, updW[2], updV[2], updwb, updg, updgd, updG, updbc, updbi, updsv, updzd, updla, updLa, upddq, upddu, upddx;
818 
819  bool solveDirectly;
820 
821  private:
825  void constructor();
826 
831 
835  static bool exitRequest;
836 
840  bool READZ0;
841 
850  void addToGraph(Graph* graph, fmatvec::SqrMat &A, int i, std::vector<Element*> &objList);
851 
852  bool truncateSimulationFiles;
853 
854  // Holds the dynamic systems before the "reorganize hierarchy" takes place.
855  // This is required since all elements of all other containers from DynamicSystem are readded to DynamicSystemSolver,
856  // except this container (which is a "pure" container = no calculation is done in DynamicSystem)
857  // However, we must hold this container until the dtor of DynamicSystemSolver is called to avoid the deallocation of other
858  // elements hold by DynamicSystem elements (especially (currently only) hdf5File)
859  std::vector<DynamicSystem*> dynamicsystemPreReorganize;
860 
861  double facSizeGs;
862  };
863 
864 }
865 
866 #endif /* _DYNAMIC_SYSTEM_SOLVER_H_ */
bool useOldla
flag if contac force parameter of last time step should be used
Definition: dynamic_system_solver.h:744
void plot() override
plots time dependent data
Definition: dynamic_system_solver.cc:1553
int solveImpactsGaussSeidel() override
solve impact equations with Gauss-Seidel scheme on velocity level
Definition: dynamic_system_solver.cc:482
int solveConstraintsLinearEquations()
solution of contact equations with Cholesky decomposition
Definition: dynamic_system_solver.cc:841
void updategRef(const fmatvec::Vec &ref) override
references to relative distances of dynamic system parent
Definition: dynamic_system_solver.h:521
fmatvec::Vec gParent
relative distances
Definition: dynamic_system_solver.h:641
virtual void updateVRef(const fmatvec::Mat &VParent, int j=0)
references to condensed contact force direction matrix of dynamic system parent
Definition: dynamic_system.cc:810
void updatezRef(const fmatvec::Vec &ext)
references to external state
Definition: dynamic_system_solver.cc:1262
int zSize
size of state vector
Definition: dynamic_system_solver.h:576
double t
time
Definition: dynamic_system_solver.h:566
bool checkGSize
boolean if force action matrix should be resized in each step
Definition: dynamic_system_solver.h:764
int solveImpactsLinearEquations()
solution of contact equations with Cholesky decomposition on velocity level
Definition: dynamic_system_solver.cc:846
fmatvec::Vec rParent[2]
nonsmooth right hand side
Definition: dynamic_system_solver.h:668
int solveConstraintsGaussSeidel() override
solve contact equations with Gauss-Seidel scheme
Definition: dynamic_system_solver.cc:462
void initLa()
load contact impulses for use as starting value
Definition: dynamic_system_solver.cc:1100
bool term
boolean to check for termination of contact equations solution
Definition: dynamic_system_solver.h:714
void readz0(std::string fileName)
reads state from a file
Definition: dynamic_system_solver.cc:1254
bool dropContactInfo
flag if contact matrices for debugging should be dropped in no-convergence case
Definition: dynamic_system_solver.h:739
int solveConstraintsFixpointSingle() override
solve contact equations with single step fixed point scheme
Definition: dynamic_system_solver.cc:400
double tolProj
Tolerance for projection of generalized position.
Definition: dynamic_system_solver.h:791
virtual void updategRef(const fmatvec::Vec &gParent)
references to relative distances of dynamic system parent
Definition: dynamic_system.cc:747
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:46
void initla()
load contact forces for use as starting value
Definition: dynamic_system_solver.cc:1090
fmatvec::SparseMat Gs
sparse mass action matrix
Definition: dynamic_system_solver.h:694
fmatvec::VecInt checkTermLevels
TODO.
Definition: dynamic_system_solver.h:759
DynamicSystemSolver(const std::string &name="")
constructor
Definition: dynamic_system_solver.cc:71
Solver contactSolver
solver for contact equations and impact equations
Definition: dynamic_system_solver.h:729
fmatvec::Vec bc
TODO.
Definition: dynamic_system_solver.h:709
bool stopIfNoConvergence
flag if the contact equations should be stopped if there is no convergence
Definition: dynamic_system_solver.h:734
virtual const fmatvec::Vec & shift()
update for event driven integrator for event
Definition: dynamic_system_solver.cc:1389
fmatvec::Mat TParent
matrix of linear relation between differentiated positions and velocities
Definition: dynamic_system_solver.h:601
fmatvec::Vec sParent
TODO.
Definition: dynamic_system_solver.h:631
fmatvec::Vec u
velocities, differentiated velocities, initial velocities
Definition: dynamic_system.h:810
fmatvec::VecInt LinkStatusRegParent
status vector of single valued links
Definition: dynamic_system_solver.h:689
fmatvec::Vec zd
derivative of state vector
Definition: dynamic_system_solver.h:586
void getLinkStatusReg(fmatvec::VecInt &LinkStatusRegExt)
Definition: dynamic_system_solver.cc:960
fmatvec::Vec gdParent
relative velocities
Definition: dynamic_system_solver.h:646
void projectGeneralizedVelocities(int mode)
drift projection for positions
Definition: dynamic_system_solver.cc:1047
fmatvec::VecInt LinkStatusParent
status vector of set valued links with piecewise link equation (which piece is valid) ...
Definition: dynamic_system_solver.h:683
group ingredients do not depend on each other
Definition: group.h:35
unsigned int flushCount
counts plot-calls until files to be flushed TODO
Definition: dynamic_system_solver.h:786
void checkImpactsForTermination() override
validate force laws concerning given tolerances on velocity level
Definition: dynamic_system_solver.cc:645
std::string getSolverInfo()
Definition: dynamic_system_solver.cc:1157
fmatvec::Vec z
state vector
Definition: dynamic_system_solver.h:581
basic class of MBSim mainly for plotting
Definition: element.h:56
static void sigInterruptHandler(int)
handler for user interrupt signal
Definition: dynamic_system_solver.cc:1202
double lmParm
Levenberg-Marquard parameter.
Definition: dynamic_system_solver.h:724
int solveImpactsFixpointSingle() override
solve impact equations with single step fixed point scheme on velocity level
Definition: dynamic_system_solver.cc:431
void addElement(Element *element_)
Definition: dynamic_system_solver.cc:1118
fmatvec::Vec rFactorParent
relaxation parameters for contact equations
Definition: dynamic_system_solver.h:626
void checkConstraintsForTermination() override
validate force laws concerning given tolerances
Definition: dynamic_system_solver.cc:634
fmatvec::VecInt decreaseLevels
decreasing relaxation factors is done in levels containing the number of contact iterations as condit...
Definition: dynamic_system_solver.h:754
virtual void updatelaInverseKinetics()
update inverse kinetics constraint forces
Definition: dynamic_system_solver.cc:1482
void setStopIfNoConvergence(bool flag, bool dropInfo=false)
Definition: dynamic_system_solver.h:399
Definition: dynamic_system_solver.h:48
virtual void updatewbRef(const fmatvec::Vec &wbParent)
references to TODO of dynamic system parent
Definition: dynamic_system.cc:782
virtual void updater(int j=0)
update smooth link force law
Definition: dynamic_system_solver.cc:759
void dropContactMatrices()
Definition: dynamic_system_solver.cc:1172
void initialize()
Initialize the system.
Definition: dynamic_system_solver.cc:89
virtual void updateWRef(const fmatvec::Mat &WParent, int j=0)
references to contact force direction matrix of dynamic system parent
Definition: dynamic_system.cc:789
virtual void updateG()
updates mass action matrix
Definition: dynamic_system_solver.cc:851
~DynamicSystemSolver() override
destructor
Definition: dynamic_system_solver.cc:81
bool numJac
flag if Jacobian for Newton scheme should be calculated numerically
Definition: dynamic_system_solver.h:749
int(DynamicSystemSolver::* solveImpacts_)()
function pointer for election of prox-solver for impact equations on velocity level ...
Definition: dynamic_system_solver.h:274
unsigned int flushEvery
flushes all hdf5-files every x-times the plot-routine is called TODO
Definition: dynamic_system_solver.h:780
fmatvec::Mat WParent[2]
contact force directions
Definition: dynamic_system_solver.h:606
void plot() override
plots time dependent data
Definition: dynamic_system.cc:336
double evalPotentialEnergy()
compute potential energy of entire dynamic system change? TODO
Definition: dynamic_system_solver.cc:1105
class for tree-structured mechanical systems with recursive and flat memory mechanism ...
Definition: graph.h:36
InitStage
The stages of the initialization.
Definition: element.h:62
void setProjectionTolerance(double tol)
set tolerance for projection of generalized position
Definition: dynamic_system_solver.h:445
int(DynamicSystemSolver::* solveConstraints_)()
Definition: dynamic_system_solver.h:267
Element * getElement(const std::string &name)
Definition: dynamic_system_solver.cc:1130
bool positionDriftCompensationNeeded(double gmax)
check if drift compensation on position level is needed
Definition: dynamic_system_solver.cc:968
fmatvec::VecInt jsvParent
boolean evaluation of stopvector
Definition: dynamic_system_solver.h:678
void savela()
save contact forces for use as starting value in next time step
Definition: dynamic_system_solver.cc:1085
Definition: planar_contour.h:30
void projectGeneralizedPositions(int mode, bool fullUpdate=false)
drift projection for positions
Definition: dynamic_system_solver.cc:994
fmatvec::SymMat LLMParent
Cholesky decomposition of mass matrix.
Definition: dynamic_system_solver.h:596
std::string name
name of element
Definition: element.h:235
int limitGSize
TODO.
Definition: dynamic_system_solver.h:769
static bool exitRequest
boolean signal evaluation for end integration set by user
Definition: dynamic_system_solver.h:835
fmatvec::SymMat MParent
mass matrix
Definition: dynamic_system_solver.h:591
bool peds
TODO, flag for occuring impact and sticking in event driven solver.
Definition: dynamic_system_solver.h:774
fmatvec::Vec hParent[2]
smooth, smooth with respect to objects, smooth with respect to links right hand side ...
Definition: dynamic_system_solver.h:663
void constructor()
set plot feature default values
Definition: dynamic_system_solver.cc:1288
void updateVRef(const fmatvec::Mat &ref, int i=0) override
references to condensed contact force direction matrix of dynamic system parent
Definition: dynamic_system_solver.h:547
fmatvec::SqrMat G
mass action matrix
Definition: dynamic_system_solver.h:704
double dt
step size
Definition: dynamic_system_solver.h:571
void saveLa()
save contact impulses for use as starting value in next time step
Definition: dynamic_system_solver.cc:1095
bool integratorExitRequest
boolean signal evaluation for end integration set by program
Definition: dynamic_system_solver.h:830
fmatvec::Vec wbParent
TODO.
Definition: dynamic_system_solver.h:616
virtual void updategdRef(const fmatvec::Vec &gdParent)
references to relative velocities of dynamic system parent
Definition: dynamic_system.cc:754
void addToGraph(Graph *graph, fmatvec::SqrMat &A, int i, std::vector< Element * > &objList)
adds list of objects to tree
Definition: dynamic_system_solver.cc:1376
void updatewbRef(const fmatvec::Vec &ref) override
references to TODO of dynamic system parent
Definition: dynamic_system_solver.h:533
fmatvec::Vec la
contact force parameters
Definition: dynamic_system.h:830
int maxIter
maximum number of contact iterations, high number of contact iterations for warnings, maximum number of damping steps for Newton scheme
Definition: dynamic_system_solver.h:719
void getLinkStatus(fmatvec::VecInt &LinkStatusExt)
Definition: dynamic_system_solver.cc:952
Solver
solver for contact equations
Definition: dynamic_system_solver.h:61
fmatvec::Vec zParent
state
Definition: dynamic_system_solver.h:651
fmatvec::Vec laParent
contact force parameters
Definition: dynamic_system_solver.h:621
fmatvec::Vec resParent
residuum of contact equations
Definition: dynamic_system_solver.h:636
void setFlushEvery(unsigned int every)
set the number of plot-routine-calls after which all hdf5-files will be flushed
Definition: dynamic_system_solver.h:463
bool velocityDriftCompensationNeeded(double gdmax)
check if drift compensation on velocity level is needed
Definition: dynamic_system_solver.cc:981
fmatvec::Vec svParent
stopvector (rootfunctions for event driven integration
Definition: dynamic_system_solver.h:673
fmatvec::SqrMat Jprox
JACOBIAN of contact equations for Newton scheme.
Definition: dynamic_system_solver.h:699
fmatvec::Mat VParent[2]
condensed contact force directions
Definition: dynamic_system_solver.h:611
void writez(std::string fileName, bool formatH5=true)
writes state to a file
Definition: dynamic_system_solver.cc:1234
static void sigAbortHandler(int)
handler for abort signals
Definition: dynamic_system_solver.cc:1207
fmatvec::SymMat M
mass matrix
Definition: dynamic_system.h:795
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: dynamic_system_solver.cc:105
int solveConstraintsRootFinding() override
solve contact equations with Newton scheme
Definition: dynamic_system_solver.cc:502
void decreaserFactors()
decrease relaxation factors if mass action matrix is not diagonal dominant
Definition: dynamic_system_solver.cc:946
void computeInitialCondition()
compute initial condition for links for event driven integrator
Definition: dynamic_system_solver.cc:802
void updatezdRef(const fmatvec::Vec &ext)
references to differentiated external state
Definition: dynamic_system_solver.cc:1274
bool READZ0
is a state read from a file
Definition: dynamic_system_solver.h:840
int solveImpactsRootFinding() override
solve impact equations with Newton scheme on velocity level
Definition: dynamic_system_solver.cc:569
void updateWRef(const fmatvec::Mat &ref, int i=0) override
references to contact force direction matrix of dynamic system parent
Definition: dynamic_system_solver.h:540
void updategdRef(const fmatvec::Vec &ref) override
references to relative velocities of dynamic system parent
Definition: dynamic_system_solver.h:527
fmatvec::Vec zdParent
differentiated state
Definition: dynamic_system_solver.h:656
double evalKineticEnergy()
compute kinetic energy of entire dynamic system
Definition: dynamic_system_solver.h:369

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Home