MBSim

Project Page
theta_time_stepping_ssc_integrator.h
00001 /* Copyright (C) 2004-2012 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: jan.p.clauberg@googlemail.com
00018  */
00019 
00020 #ifndef _THETA_TIME_STEPPING_SSC_INTEGRATOR_H_ 
00021 #define _THETA_TIME_STEPPING_SSC_INTEGRATOR_H_
00022 
00023 #include "integrator.h"
00024 
00025 namespace MBSim {
00026 
00031   class ThetaTimeSteppingSSCIntegrator : public Integrator { 
00032     public:
00036       ThetaTimeSteppingSSCIntegrator();
00037 
00041       virtual ~ThetaTimeSteppingSSCIntegrator() {}
00042 
00043       /* INHERITED INTERFACE OF INTEGRATOR */
00044       void integrate(DynamicSystemSolver& system);
00045       virtual void initializeUsingXML(xercesc::DOMElement *element);
00046       /***************************************************/
00047 
00048       /* GETTER / SETTER */
00049       void setStepSize(double dt_) { dt = dt_; }
00050       void setTheta(double theta_ ) { theta  = theta_; }
00051       void setDriftCompensation(bool dc) { driftCompensation = dc; }
00052       /***************************************************/
00053 
00060       void update(DynamicSystemSolver& system, const fmatvec::Vec& z, double t);
00061 
00066       void preIntegrate(DynamicSystemSolver& system);
00067       
00074       void subIntegrate(DynamicSystemSolver& system, double tStop);
00079       void postIntegrate(DynamicSystemSolver& system);
00080 
00081     private:
00085       double dt;
00086 
00090       double theta;
00091 
00095       double t, tPlot;
00096 
00100       int iter,step, integrationSteps, maxIter, sumIter;
00101 
00105       double s0, time;
00106 
00110       int stepPlot;
00111 
00115       fmatvec::Vec z, q, u, x;
00116 
00120       std::ofstream integPlot;
00121 
00125       bool driftCompensation;    
00126   };
00127 
00128 }
00129 
00130 #endif /* _THETA_TIME_STEPPING_SSC_INTEGRATOR_H_ */
00131