RungeKuttaFehlbergIvpOdeSolver.hpp
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
00030
00031
00032
00033
00034
00035
00036 #ifndef _RUNGEKUTTAFEHLBERGIVPODESOLVER_HPP_
00037 #define _RUNGEKUTTAFEHLBERGIVPODESOLVER_HPP_
00038
00039 #include "ChasteSerialization.hpp"
00040 #include <boost/serialization/base_object.hpp>
00041
00042 #include "AbstractOneStepIvpOdeSolver.hpp"
00043
00056 class RungeKuttaFehlbergIvpOdeSolver : public AbstractIvpOdeSolver
00057 {
00058 friend class TestRungeKuttaFehlbergIvpOdeSolver;
00059
00060 private:
00062 friend class boost::serialization::access;
00069 template<class Archive>
00070 void serialize(Archive & archive, const unsigned int version)
00071 {
00072
00073 archive & boost::serialization::base_object<AbstractIvpOdeSolver>(*this);
00074 }
00075
00076
00077
00078
00079
00080
00081 double m1932o2197;
00082 double m7200o2197;
00083 double m7296o2197;
00084 double m12o13;
00085 double m439o216;
00086 double m3680o513;
00087 double m845o4104;
00088 double m8o27;
00089 double m3544o2565;
00090 double m1859o4104;
00091 double m1o360;
00092 double m128o4275;
00093 double m2197o75240;
00094 double m2o55;
00095 double m25o216;
00096 double m1408o2565;
00097 double m2197o4104;
00099 std::vector<double> mError;
00101 std::vector<double> mk1;
00102 std::vector<double> mk2;
00103 std::vector<double> mk3;
00104 std::vector<double> mk4;
00105 std::vector<double> mk5;
00106 std::vector<double> mk6;
00107 std::vector<double> myk2;
00108 std::vector<double> myk3;
00109 std::vector<double> myk4;
00110 std::vector<double> myk5;
00111 std::vector<double> myk6;
00113 protected:
00114
00129 void InternalSolve(OdeSolution& rSolution,
00130 AbstractOdeSystem* pAbstractOdeSystem,
00131 std::vector<double>& rCurrentYValues,
00132 std::vector<double>& rWorkingMemory,
00133 double startTime,
00134 double endTime,
00135 double maxTimeStep,
00136 double minTimeStep,
00137 double tolerance,
00138 bool outputSolution);
00139
00150 void CalculateNextYValue(AbstractOdeSystem* pAbstractOdeSystem,
00151 double timeStep,
00152 double time,
00153 std::vector<double>& rCurrentYValues,
00154 std::vector<double>& rNextYValues);
00155
00166 void AdjustStepSize(double& rCurrentStepSize,
00167 const double& rError,
00168 const double& rTolerance,
00169 const double& rMaxTimeStep,
00170 const double& rMinTimeStep);
00171
00172 public:
00173
00177 RungeKuttaFehlbergIvpOdeSolver();
00178
00199 OdeSolution Solve(AbstractOdeSystem* pAbstractOdeSystem,
00200 std::vector<double>& rYValues,
00201 double startTime,
00202 double endTime,
00203 double timeStep,
00204 double ignoredSamplingTime);
00205
00221 void Solve(AbstractOdeSystem* pAbstractOdeSystem,
00222 std::vector<double>& rYValues,
00223 double startTime,
00224 double endTime,
00225 double timeStep);
00226
00227 };
00228
00229 #include "SerializationExportWrapper.hpp"
00230 CHASTE_CLASS_EXPORT(RungeKuttaFehlbergIvpOdeSolver)
00231
00232 #endif //_RUNGEKUTTAFEHLBERGIVPODESOLVER_HPP_