mbsim  4.0.0
MBSim Kernel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
theta_time_stepping_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 _THETA_TIME_STEPPING_INTEGRATOR_H_
21 #define _THETA_TIME_STEPPING_INTEGRATOR_H_
22 
23 #include "integrator.h"
24 
25 namespace MBSim {
26 
37  public:
41  ~ThetaTimeSteppingIntegrator() override = default;
42 
43  void preIntegrate() override;
44  void subIntegrate(double tStop) override;
45  void postIntegrate() override;
46 
47  /* INHERITED INTERFACE OF INTEGRATOR */
49  void integrate() override;
50  void initializeUsingXML(xercesc::DOMElement *element) override;
51  /***************************************************/
52 
53  /* GETTER / SETTER */
54  void setStepSize(double dt_) { dt = dt_; }
55  void setTheta(double theta_ ) { theta = theta_; }
56  void setToleranceForPositionConstraints(double gMax_) { gMax = gMax_; }
57  /***************************************************/
58 
59  private:
60  void resize();
61 
65  double dt{1e-3};
66 
70  double theta{0.5};
71 
75  double t{0}, tPlot{0};
76 
80  int iter{0}, step{0}, integrationSteps{0}, maxIter{0}, sumIter{0};
81 
85  double s0{0}, time{0};
86 
90  int stepPlot{0};
91 
93  double gMax{-1};
94  };
95 
96 }
97 
98 #endif /* _THETA_TIME_STEPPING_INTEGRATOR_H_ */
double theta
convex combination parameter between explicit (0) and implicit (1) Euler scheme
Definition: theta_time_stepping_integrator.h:70
double s0
computing time counter
Definition: theta_time_stepping_integrator.h:85
Definition: theta_time_stepping_integrator.h:36
integrator-interface for dynamic systems
Definition: integrator.h:37
double dt
step size
Definition: theta_time_stepping_integrator.h:65
int stepPlot
plot step difference
Definition: theta_time_stepping_integrator.h:90
int iter
iteration counter for constraints, plots, integration, maximum constraints, cummulation constraint ...
Definition: theta_time_stepping_integrator.h:80
void initializeUsingXML(xercesc::DOMElement *element) override
initialize integrator
Definition: theta_time_stepping_integrator.cc:162
virtual void integrate()=0
start the integration of the system set by setSystem. Each class implemeting this function should cal...
~ThetaTimeSteppingIntegrator() override=default
destructor
double gMax
Definition: theta_time_stepping_integrator.h:93
void integrate() override
start the integration of the system set by setSystem. Each class implemeting this function should cal...
Definition: theta_time_stepping_integrator.cc:156
double t
time and plot time
Definition: theta_time_stepping_integrator.h:75