All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
quasi_static_integrator.h
1 /* Copyright (C) 2004-2010 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 _QUASI_STATIC_INTEGRATOR_H_
21 #define _QUASI_STATIC_INTEGRATOR_H_
22 
23 #include "integrator.h"
24 #include "mbsim/functions/function.h"
25 #include<mbsim/dynamic_system_solver.h>
26 
27 namespace MBSimIntegrator {
28 
34  class hgFun : public MBSim::Function<fmatvec::Vec(fmatvec::Vec)> {
35  public:
40  sys(sys_), t(0) {
41  }
42 
46  virtual ~hgFun() {
47  }
48  ;
49 
50  /* INHERITED INTERFACE */
51  fmatvec::Vec operator()(const fmatvec::Vec& qla);
52 
53  void setT(double t) {
54  this->t = t;
55  }
56 
57  /*******************************************************/
58 
59  private:
60 
62  double t;
63 
64  };
65 
71  class jacFun : public MBSim::Function<fmatvec::SqrMat(fmatvec::Vec)> {
72  public:
77  sys(sys_), t(t_), z(z_) {
78  }
79 
83  virtual ~jacFun() {
84  }
85  ;
86 
87  /* INHERITED INTERFACE */
88  fmatvec::SqrMat operator()(const fmatvec::Vec& q);
89  /*******************************************************/
90 
91  private:
92 
94  double t;
95  fmatvec::Vec z;
96 
97  };
104  public:
109 
114  }
115 
116  void preIntegrate(MBSim::DynamicSystemSolver& system);
117  void subIntegrate(MBSim::DynamicSystemSolver& system, double tStop);
118  void postIntegrate(MBSim::DynamicSystemSolver& system);
119 
120  /* INHERITED INTERFACE OF INTEGRATOR */
122  virtual void initializeUsingXML(xercesc::DOMElement *element);
123  /***************************************************/
124 
125  /* GETTER / SETTER */
126  void setStepSize(double dt_) {
127  dt = dt_;
128  }
129  void setgTolerance(double tolerance_) {
130  gTol = tolerance_;
131  }
132  void sethTolerance(double tolerance_) {
133  hTol = tolerance_;
134  }
135  void setmaxExtraPolate(int value) {
136  maxExtraPolate = value;
137  }
138  void setextraPolateAfter(int value) {
139  extraPolateAfter = value;
140  }
141  void setupdateJacobianEvery(int value) {
142  updateJacobianEvery = value;
143  }
144  /***************************************************/
145 
146  private:
150  double dt;
151 
155  double t, tPlot;
156 
160  double gTol;
161 
165  double hTol;
166 
170  int iter, step, integrationSteps, maxIter, sumIter;
171 
176 
181 
186 
190  double s0, time;
191 
195  int stepPlot;
196 
200  fmatvec::Vec z, q, u, x;
201 
205  std::ofstream integPlot;
206  };
207 
208 }
209 
210 #endif /* _QUASI_STATIC_INTEGRATOR_H_ */
211 
jacFun(MBSim::DynamicSystemSolver *sys_, double t_, fmatvec::Vec &z_)
constructor
Definition: quasi_static_integrator.h:76
virtual void initializeUsingXML(xercesc::DOMElement *element)
initialize integrator
Definition: quasi_static_integrator.cc:215
int maxExtraPolate
value of how many points in the past should be used to extrapolate for new value
Definition: quasi_static_integrator.h:175
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:48
function for the dh/dq
Definition: quasi_static_integrator.h:71
virtual ~hgFun()
destructor
Definition: quasi_static_integrator.h:46
std::ofstream integPlot
file stream for integration information
Definition: quasi_static_integrator.h:205
virtual ~QuasiStaticIntegrator()
destructor
Definition: quasi_static_integrator.h:113
fmatvec::Vec z
state, position, velocity, order coordinate of dynamical system
Definition: quasi_static_integrator.h:200
int stepPlot
plot step difference
Definition: quasi_static_integrator.h:195
double s0
computing time counter
Definition: quasi_static_integrator.h:190
int extraPolateAfter
extrapolate after such and that integration steps
Definition: quasi_static_integrator.h:180
double dt
step size
Definition: quasi_static_integrator.h:150
calculate h vector according the new q and system boundary conditions
Definition: quasi_static_integrator.h:34
double t
time and plot time
Definition: quasi_static_integrator.h:155
double hTol
tolerance for newton iteration for forces
Definition: quasi_static_integrator.h:165
double gTol
tolerance for the newton iteration for distances
Definition: quasi_static_integrator.h:160
Definition: planar_contour.h:31
virtual ~jacFun()
destructor
Definition: quasi_static_integrator.h:83
Definition: quasi_static_integrator.h:103
QuasiStaticIntegrator()
constructor
Definition: quasi_static_integrator.cc:47
integrator-interface for dynamic systems
Definition: integrator.h:40
hgFun(MBSim::DynamicSystemSolver *sys_)
constructor
Definition: quasi_static_integrator.h:39
virtual void integrate(MBSim::DynamicSystemSolver &system)
start the integration
Definition: quasi_static_integrator.cc:208
static DynamicSystemSolver * system
dynamic system
Definition: solver.h:65
int updateJacobianEvery
value of how often the Jacobian should be updated every step
Definition: quasi_static_integrator.h:185
int iter
iteration counter for constraints, plots, integration, maximum constraints, cummulation constraint ...
Definition: quasi_static_integrator.h:170

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML