37#ifndef _CVODEADAPTOR_HPP_
38#define _CVODEADAPTOR_HPP_
43#include <boost/serialization/base_object.hpp>
46#include "AbstractIvpOdeSolver.hpp"
47#include "CvodeContextManager.hpp"
48#include "OdeSolution.hpp"
51#include <cvode/cvode.h>
52#include <nvector/nvector_serial.h>
54#if CHASTE_SUNDIALS_VERSION >= 30000
55#include <sunlinsol/sunlinsol_dense.h>
56#include <sunmatrix/sunmatrix_dense.h>
59#if CHASTE_SUNDIALS_VERSION >= 70000
61#define realtype sunrealtype
70#if CHASTE_SUNDIALS_VERSION >= 70000
71void CvodeErrorHandler(
int errorCode,
const char* module,
const char* function,
72 const char* message, SUNErrCode errCode,
void* pData, SUNContext sunContext);
74void CvodeErrorHandler(
int errorCode,
const char* module,
const char* function,
75 char* message,
void* pData);
86 std::vector<realtype>*
pY;
128 template <
class Archive>
129 void serialize(Archive& archive,
const unsigned int version)
131 archive& boost::serialization::base_object<AbstractIvpOdeSolver>(*
this);
143#if CHASTE_SUNDIALS_VERSION >= 60000
148 std::shared_ptr<CvodeContextManager> mpSundialsContextManager;
184#if CHASTE_SUNDIALS_VERSION >= 30000
186 SUNMatrix mpSundialsDenseMatrix;
188 SUNLinearSolver mpSundialsLinearSolver;
208 std::vector<double>& rInitialY,
209 double startTime,
double maxStep);
235 CvodeAdaptor(
double relTol = 1e-4,
double absTol = 1e-6);
250 void SetTolerances(
double relTol = 1e-4,
double absTol = 1e-6);
310 std::vector<double>& rYValues,
314 double timeSampling);
327 std::vector<double>& rYValues,
gcov doesn't like this file...
#define CHASTE_CLASS_EXPORT(T)
double GetAbsoluteTolerance()
void CvodeError(int flag, const char *msg)
void SetMinimalReset(bool minimalReset)
void serialize(Archive &archive, const unsigned int version)
N_Vector mLastSolutionState
void SetMaxSteps(long int numSteps)
void SetForceReset(bool autoReset)
void CheckForStoppingEvents()
OdeSolution Solve(AbstractOdeSystem *pOdeSystem, std::vector< double > &rYValues, double startTime, double endTime, double maxStep, double timeSampling)
double mLastInternalStepSize
friend class boost::serialization::access
void RecordStoppingPoint(double stopTime, N_Vector yEnd)
void SetupCvode(AbstractOdeSystem *pOdeSystem, std::vector< double > &rInitialY, double startTime, double maxStep)
double GetRelativeTolerance()
void SetTolerances(double relTol=1e-4, double absTol=1e-6)
AbstractOdeSystem * pSystem
std::vector< realtype > * pY