MBSim

Project Page
hets2_integrator.h
00001 /* Copyright (C) 2004-2014 MBSim Development Team
00002  *
00003  * This library is free software; you can redistribute it and/or 
00004  * modify it under the terms of the GNU Lesser General Public 
00005  * License as published by the Free Software Foundation; either 
00006  * version 2.1 of the License, or (at your option) any later version. 
00007  *  
00008  * This library is distributed in the hope that it will be useful, 
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011  * Lesser General Public License for more details. 
00012  *  
00013  * You should have received a copy of the GNU Lesser General Public 
00014  * License along with this library; if not, write to the Free Software 
00015  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
00016  *
00017  * Contact: thorsten.schindler@mytum.de
00018  */
00019 
00020 #ifndef _HETS2_INTEGRATOR_H_ 
00021 #define _HETS2_INTEGRATOR_H_
00022 
00023 #include "integrator.h"
00024 
00025 namespace MBSimIntegrator {
00026 
00043   class HETS2Integrator : public Integrator { 
00044     public:
00048       HETS2Integrator();
00049 
00053       virtual ~HETS2Integrator() {}
00054 
00059       void preIntegrate(MBSim::DynamicSystemSolver& system);
00060 
00065       void subIntegrate(MBSim::DynamicSystemSolver& system, double tStop);
00066 
00071       void postIntegrate(MBSim::DynamicSystemSolver& system);
00072 
00073       /* INHERITED INTERFACE OF INTEGRATOR */
00074       virtual void integrate(MBSim::DynamicSystemSolver& system);
00075       virtual void initializeUsingXML(xercesc::DOMElement *element);
00076       /***************************************************/
00077 
00078       /* GETTER / SETTER */
00079       void setStepSize(double dt_) { dt = dt_; dtImpulsive = dt*1e-1, dtInfo = dt; }
00080       /***************************************************/
00081 
00082     private:
00088       bool evaluateStage(MBSim::DynamicSystemSolver& system);
00089 
00093       double dt, dtImpulsive, dtInfo;
00094 
00098       double t, tPlot;
00099 
00103       int iter, integrationSteps, integrationStepsConstraint, integrationStepsImpact, maxIter, sumIter;
00104 
00108       double s0, time;
00109 
00113       fmatvec::Vec z, q, u, x;
00114 
00118       std::ofstream integPlot;
00119   };
00120 
00121 }
00122 
00123 #endif /* _HETS2_INTEGRATOR_H_ */
00124