00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _RKSUITE_INTEGRATOR_H_
00021 #define _RKSUITE_INTEGRATOR_H_
00022
00023 #include "integrator.h"
00024
00025 namespace MBSimIntegrator {
00026
00030 class RKSuiteIntegrator : public Integrator {
00031 public:
00035 RKSuiteIntegrator();
00036
00040 virtual ~RKSuiteIntegrator() { if(dworkarray) { delete[] dworkarray; dworkarray=0; } }
00041
00042 void preIntegrate(MBSim::DynamicSystemSolver& system);
00043 void subIntegrate(MBSim::DynamicSystemSolver& system, double tStop);
00044 void postIntegrate(MBSim::DynamicSystemSolver& system);
00045
00046
00047 void setMethod(int method_) {method = method_;}
00048 void setrTol(double rTol_) {rTol = rTol_;}
00049 void setThreshold(const fmatvec::Vec &thres_) {thres = thres_;}
00050 void setThreshold(double thres_) {thres = fmatvec::Vec(1,fmatvec::INIT,thres_);}
00051 void setInitialStepSize(double dt0_) {dt0 = dt0_;}
00052
00053
00054
00055
00056 virtual void integrate(MBSim::DynamicSystemSolver& system);
00057 virtual void initializeUsingXML(xercesc::DOMElement *element);
00058
00059
00060 private:
00061
00062 static void fzdot(double* t, double* z_, double* zd_);
00063
00064 static int zSize;
00065
00066 int method;
00068 fmatvec::Vec thres;
00070 double rTol;
00072 double dt0;
00073
00074
00075 int ndworkarray, messages, integrationSteps;
00076 double t, tPlot, s0, time;
00077 double * dworkarray;
00078 fmatvec::Vec z, zdGot, zMax;
00079
00080 std::ofstream integPlot;
00081
00082 };
00083
00084 }
00085
00086 #endif