37 #ifndef _ABSTRACTCVODESYSTEM_HPP_
38 #define _ABSTRACTCVODESYSTEM_HPP_
48 #include "OdeSolution.hpp"
49 #include "AbstractParameterisedSystem.hpp"
55 #include <boost/serialization/split_member.hpp>
56 #include <boost/serialization/vector.hpp>
60 #include <nvector/nvector_serial.h>
61 #include <sundials/sundials_dense.h>
64 #if CHASTE_SUNDIALS_VERSION >= 20400
65 #define CHASTE_CVODE_DENSE_MATRIX DlsMat
67 #define CHASTE_CVODE_DENSE_MATRIX DenseMat
122 friend class TestAbstractCvodeSystem;
124 friend class boost::serialization::access;
131 template<
class Archive>
132 void save(Archive & archive,
const unsigned int version)
const
147 archive & state_vars;
174 template<
class Archive>
175 void load(Archive & archive,
const unsigned int version)
187 std::vector<double> state_vars;
188 archive & state_vars;
191 std::vector<double> parameters;
192 archive & parameters;
194 std::vector<std::string> param_names;
195 archive & param_names;
210 BOOST_SERIALIZATION_SPLIT_MEMBER()
239 void CvodeError(
int flag, const
char * msg, const
double& rTime);
328 CHASTE_CVODE_DENSE_MATRIX jacobian,
331 EXCEPTION(
"No analytic Jacobian has been defined for this system.");
407 void Solve(realtype tStart,
503 #endif //_ABSTRACTCVODESYSTEM_HPP_
504 #endif // CHASTE_CVODE
double GetAbsoluteTolerance()
void SetMinimalReset(bool minimalReset)
void SetTolerances(double relTol=1e-5, double absTol=1e-7)
std::vector< double > MakeStdVec(N_Vector v)
bool GetUseAnalyticJacobian() const
#define CLASS_IS_ABSTRACT(T)
void RecordStoppingPoint(double stopTime)
#define EXCEPTION(message)
double mLastInternalStepSize
void SetupCvode(N_Vector initialConditions, realtype tStart, realtype maxDt)
void load(Archive &archive, const unsigned int version)
bool mUseAnalyticJacobian
bool HasAnalyticJacobian() const
virtual void EvaluateAnalyticJacobian(long int N, realtype time, N_Vector y, N_Vector ydot, CHASTE_CVODE_DENSE_MATRIX jacobian, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)
void SetForceReset(bool autoReset)
virtual void EvaluateYDerivatives(realtype time, const N_Vector y, N_Vector ydot)=0
void SetMaxSteps(long int numSteps)
double GetRelativeTolerance()
OdeSolution Solve(realtype tStart, realtype tEnd, realtype maxDt, realtype tSamp)
N_Vector mLastSolutionState
void CopyFromStdVector(const std::vector< double > &rSrc, VECTOR &rDest)
void CheckParametersOnLoad(const std::vector< double > &rParameters, const std::vector< std::string > &rParameterNames)
unsigned mNumberOfStateVariables
void CvodeError(int flag, const char *msg, const double &rTime)
void ForceUseOfNumericalJacobian(bool useNumericalJacobian=true)
void save(Archive &archive, const unsigned int version) const
bool mHasAnalyticJacobian
const std::vector< std::string > & rGetParameterNames() const