mbsim 4.0.0 MBSim Kernel

time_stepping_integrator.h
1 /* Copyright (C) 2004-2014 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 _TIME_STEPPING_INTEGRATOR_H_
21 #define _TIME_STEPPING_INTEGRATOR_H_
22
23 #include "integrator.h"
24
25 namespace MBSim {
26
32 class TimeSteppingIntegrator : public Integrator {
33 public:
37 ~TimeSteppingIntegrator() override = default;
38
39 void preIntegrate() override;
40 void subIntegrate(double tStop) override;
41 void postIntegrate() override;
42
43 /* INHERITED INTERFACE OF INTEGRATOR */
44 using Integrator::integrate;
45 void integrate() override;
46 void initializeUsingXML(xercesc::DOMElement *element) override;
47 /***************************************************/
48
49 /* GETTER / SETTER */
50 void setStepSize(double dt_) { dt = dt_; }
51 void setToleranceForPositionConstraints(double gMax_) { gMax = gMax_; }
52 /***************************************************/
53
54 private:
55 void resize();
56
60 double dt{1e-3};
61
65 double tPlot{0.};
66
70 int step{0}, integrationSteps{0}, maxIter{0}, sumIter{0};
71
75 double s0{0.}, time{0.};
76
80 int stepPlot{0};
81
83 double gMax{-1};
84 };
85
86 }
87
88 #endif /* _TIME_STEPPING_INTEGRATOR_H_ */
MBSim::TimeSteppingIntegrator::s0
double s0
computing time counter
Definition: time_stepping_integrator.h:75
MBSim::TimeSteppingIntegrator::initializeUsingXML
void initializeUsingXML(xercesc::DOMElement *element) override
initialize integrator
Definition: time_stepping_integrator.cc:134
MBSim::TimeSteppingIntegrator::integrate
void integrate() override
start the integration of the system set by setSystem. Each class implemeting this function should cal...
Definition: time_stepping_integrator.cc:128
MBSim::TimeSteppingIntegrator::tPlot
double tPlot
time and plot time
Definition: time_stepping_integrator.h:65
MBSim::TimeSteppingIntegrator::stepPlot
int stepPlot
plot step difference
Definition: time_stepping_integrator.h:80
MBSim::Integrator
integrator-interface for dynamic systems
Definition: integrator.h:37
MBSim::TimeSteppingIntegrator::~TimeSteppingIntegrator
~TimeSteppingIntegrator() override=default
destructor
MBSim::Integrator::integrate
virtual void integrate()=0
start the integration of the system set by setSystem. Each class implemeting this function should cal...
MBSim::TimeSteppingIntegrator
Definition: time_stepping_integrator.h:32
MBSim::TimeSteppingIntegrator::step
int step
iteration counter for constraints, plots, integration, maximum constraints, cummulation constraint
Definition: time_stepping_integrator.h:70
MBSim::TimeSteppingIntegrator::gMax
double gMax
Definition: time_stepping_integrator.h:83
MBSim::TimeSteppingIntegrator::dt
double dt
step size
Definition: time_stepping_integrator.h:60
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30