All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
rksuite_integrator.h
1 /* Copyright (C) 2004-2009 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 _RKSUITE_INTEGRATOR_H_
21 #define _RKSUITE_INTEGRATOR_H_
22 
23 #include "integrator.h"
24 
25 namespace MBSimIntegrator {
26 
30  class RKSuiteIntegrator : public Integrator {
31  public:
32  enum Method {
33  RK23=1,
34  RK45,
35  RK78
36  };
37 
42 
46  virtual ~RKSuiteIntegrator() { if(dworkarray) { delete[] dworkarray; dworkarray=0; } }
47 
48  void preIntegrate(MBSim::DynamicSystemSolver& system);
49  void subIntegrate(MBSim::DynamicSystemSolver& system, double tStop);
50  void postIntegrate(MBSim::DynamicSystemSolver& system);
51 
52  /* GETTER / SETTER */
53  void setMethod(Method method_) {method = method_;}
54  void setrTol(double rTol_) {rTol = rTol_;}
55  void setThreshold(const fmatvec::Vec &thres_) {thres = thres_;}
56  void setThreshold(double thres_) {thres = fmatvec::Vec(1,fmatvec::INIT,thres_);}
57  void setInitialStepSize(double dt0_) {dt0 = dt0_;}
58  /***************************************************/
59 
60 
61  /* INHERITED INTERFACE OF INTEGRATOR */
63  virtual void initializeUsingXML(xercesc::DOMElement *element);
64  /***************************************************/
65 
66  private:
67 
68  static void fzdot(double* t, double* z_, double* zd_);
69 
70  static int zSize;
71 
72  Method method;
76  double rTol;
78  double dt0;
79 
80 
81  int ndworkarray, messages, integrationSteps;
82  double t, tPlot, s0, time;
83  double * dworkarray;
84  fmatvec::Vec z, zdGot, zMax;
85 
86  std::ofstream integPlot;
87 
88  };
89 
90 }
91 
92 #endif
Vector< Ref, double > Vec
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:48
RKSuiteIntegrator()
constructor
Definition: rksuite_integrator.cc:40
ODE-Integrator RKSuite. Integrator for ODEs. This integrator uses rksuite from http://www.netlib.org .
Definition: rksuite_integrator.h:30
virtual void initializeUsingXML(xercesc::DOMElement *element)
initialize integrator
Definition: rksuite_integrator.cc:146
double dt0
Definition: rksuite_integrator.h:78
fmatvec::Vec thres
Definition: rksuite_integrator.h:74
virtual ~RKSuiteIntegrator()
destructor
Definition: rksuite_integrator.h:46
double rTol
Definition: rksuite_integrator.h:76
integrator-interface for dynamic systems
Definition: integrator.h:40
virtual void integrate(MBSim::DynamicSystemSolver &system)
start the integration
Definition: rksuite_integrator.cc:139
static DynamicSystemSolver * system
dynamic system
Definition: solver.h:65

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML