mbsim  4.0.0
MBSim Kernel
hets2_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: thorsten.schindler@mytum.de
18  */
19 
20 #ifndef _HETS2_INTEGRATOR_H_
21 #define _HETS2_INTEGRATOR_H_
22 
23 #include "integrator.h"
24 
25 namespace MBSim {
26 
43  class HETS2Integrator : public Integrator {
44  public:
48  ~HETS2Integrator() override = default;
49 
54  void preIntegrate() override;
55 
60  void subIntegrate(double tStop) override;
61 
66  void postIntegrate() override;
67 
68  /* INHERITED INTERFACE OF INTEGRATOR */
70  void integrate() override;
71  void initializeUsingXML(xercesc::DOMElement *element) override;
72  /***************************************************/
73 
74  /* GETTER / SETTER */
75  void setStepSize(double dt_) { dt = dt_; dtImpulsive = dt*1e-1, dtInfo = dt; }
76  /***************************************************/
77 
78  void updatebc();
79  void updatezd();
80 
81  private:
87  bool evaluateStage();
88 
92  double dt{1e-3}, dtImpulsive{1e-4}, dtInfo{1e-3};
93 
97  double tPlot{0.};
98 
102  int integrationSteps{0}, integrationStepsConstraint{0}, integrationStepsImpact{0}, maxIter{0}, sumIter{0};
103 
107  double s0{0.}, time{0.};
108 
109  fmatvec::Vec bc;
110  };
111 
112 }
113 
114 #endif /* _HETS2_INTEGRATOR_H_ */
time integration scheme on velocity level for nonsmooth dynamical systems using half-explicit trapezo...
Definition: hets2_integrator.h:43
double dt
step size for non-impulsive periods, and impulsive periods, and last used
Definition: hets2_integrator.h:92
void preIntegrate() override
initializes the integration
Definition: hets2_integrator.cc:38
integrator-interface for dynamic systems
Definition: integrator.h:37
bool evaluateStage()
evaluates the dynamical system given the state of the stage until the Jacobian matrices
Definition: hets2_integrator.cc:197
void postIntegrate() override
closes the integration
Definition: hets2_integrator.cc:170
double s0
computing time counter
Definition: hets2_integrator.h:107
virtual void integrate()=0
start the integration of the system set by setSystem. Each class implemeting this function should cal...
int integrationSteps
iteration counter for constraints, integration, non-impulsive integration, impulsive integration,...
Definition: hets2_integrator.h:102
void subIntegrate(double tStop) override
does the integration
Definition: hets2_integrator.cc:70
void integrate() override
start the integration of the system set by setSystem. Each class implemeting this function should cal...
Definition: hets2_integrator.cc:183
double tPlot
time and plot time
Definition: hets2_integrator.h:97
~HETS2Integrator() override=default
destructor
namespace MBSim
Definition: eigenanalyzer.cc:47