mbsim 4.0.0 MBSim Kernel

explicit_euler_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 _EXPLICIT_EULER_INTEGRATOR_H_
21 #define _EXPLICIT_EULER_INTEGRATOR_H_
22
23 #include "integrator.h"
24
25 namespace MBSim {
26
28 class ExplicitEulerIntegrator : public Integrator {
29 public:
33 ~ExplicitEulerIntegrator() override = default;
34
35 void preIntegrate() override;
36 void subIntegrate(double tStop) override;
37 void postIntegrate() override;
38
39 /* INHERITED INTERFACE OF INTEGRATOR */
40 using Integrator::integrate;
41 void integrate() override;
42 void initializeUsingXML(xercesc::DOMElement *element) override;
43 /***************************************************/
44
45 /* GETTER / SETTER */
46 void setStepSize(double dt_) {dt = dt_;}
47 /***************************************************/
48
49 private:
53 double dt{1e-3};
54
55 double tPlot;
56 int iter, step, integrationSteps;
57 double s0, time;
58 int stepPlot;
59 };
60
61 }
62
63 #endif
MBSim::ExplicitEulerIntegrator
Explicit Euler integrator.
Definition: explicit_euler_integrator.h:28
MBSim::Integrator
integrator-interface for dynamic systems
Definition: integrator.h:37
MBSim::Integrator::integrate
virtual void integrate()=0
start the integration of the system set by setSystem. Each class implemeting this function should cal...
MBSim::ExplicitEulerIntegrator::~ExplicitEulerIntegrator
~ExplicitEulerIntegrator() override=default
destructor
MBSim::ExplicitEulerIntegrator::integrate
void integrate() override
start the integration of the system set by setSystem. Each class implemeting this function should cal...
Definition: explicit_euler_integrator.cc:96
MBSim::ExplicitEulerIntegrator::dt
double dt
step size
Definition: explicit_euler_integrator.h:53
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30