00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _RUNGEKUTTAFEHLBERGIVPODESOLVER_HPP_
00030 #define _RUNGEKUTTAFEHLBERGIVPODESOLVER_HPP_
00031
00032 #include "ChasteSerialization.hpp"
00033 #include <boost/serialization/base_object.hpp>
00034
00035 #include "AbstractOneStepIvpOdeSolver.hpp"
00036
00049 class RungeKuttaFehlbergIvpOdeSolver : public AbstractIvpOdeSolver
00050 {
00051 friend class TestRungeKuttaFehlbergIvpOdeSolver;
00052
00053 private:
00055 friend class boost::serialization::access;
00062 template<class Archive>
00063 void serialize(Archive & archive, const unsigned int version)
00064 {
00065
00066 archive & boost::serialization::base_object<AbstractIvpOdeSolver>(*this);
00067 }
00068
00069
00070
00071
00072
00073
00074 double m1932o2197;
00075 double m7200o2197;
00076 double m7296o2197;
00077 double m12o13;
00078 double m439o216;
00079 double m3680o513;
00080 double m845o4104;
00081 double m8o27;
00082 double m3544o2565;
00083 double m1859o4104;
00084 double m1o360;
00085 double m128o4275;
00086 double m2197o75240;
00087 double m2o55;
00088 double m25o216;
00089 double m1408o2565;
00090 double m2197o4104;
00092 std::vector<double> mError;
00094 std::vector<double> mk1;
00095 std::vector<double> mk2;
00096 std::vector<double> mk3;
00097 std::vector<double> mk4;
00098 std::vector<double> mk5;
00099 std::vector<double> mk6;
00100 std::vector<double> myk2;
00101 std::vector<double> myk3;
00102 std::vector<double> myk4;
00103 std::vector<double> myk5;
00104 std::vector<double> myk6;
00106 protected:
00107
00122 void InternalSolve(OdeSolution& rSolution,
00123 AbstractOdeSystem* pAbstractOdeSystem,
00124 std::vector<double>& rCurrentYValues,
00125 std::vector<double>& rWorkingMemory,
00126 double startTime,
00127 double endTime,
00128 double maxTimeStep,
00129 double minTimeStep,
00130 double tolerance,
00131 bool outputSolution);
00132
00143 void CalculateNextYValue(AbstractOdeSystem* pAbstractOdeSystem,
00144 double timeStep,
00145 double time,
00146 std::vector<double>& rCurrentYValues,
00147 std::vector<double>& rNextYValues);
00148
00159 void AdjustStepSize(double& rCurrentStepSize,
00160 const double& rError,
00161 const double& rTolerance,
00162 const double& rMaxTimeStep,
00163 const double& rMinTimeStep);
00164
00165 public:
00166
00170 RungeKuttaFehlbergIvpOdeSolver();
00171
00192 OdeSolution Solve(AbstractOdeSystem* pAbstractOdeSystem,
00193 std::vector<double>& rYValues,
00194 double startTime,
00195 double endTime,
00196 double timeStep,
00197 double ignoredSamplingTime);
00198
00214 void Solve(AbstractOdeSystem* pAbstractOdeSystem,
00215 std::vector<double>& rYValues,
00216 double startTime,
00217 double endTime,
00218 double timeStep);
00219
00220 };
00221
00222 #include "SerializationExportWrapper.hpp"
00223 CHASTE_CLASS_EXPORT(RungeKuttaFehlbergIvpOdeSolver)
00224
00225 #endif //_RUNGEKUTTAFEHLBERGIVPODESOLVER_HPP_