37#ifndef _CVODEADAPTOR_HPP_
38#define _CVODEADAPTOR_HPP_
42#include <boost/serialization/base_object.hpp>
45#include "AbstractIvpOdeSolver.hpp"
46#include "OdeSolution.hpp"
49#include <cvode/cvode.h>
50#include <nvector/nvector_serial.h>
52#if CHASTE_SUNDIALS_VERSION >= 30000
53#include <sunlinsol/sunlinsol_dense.h>
54#include <sunmatrix/sunmatrix_dense.h>
57#if CHASTE_SUNDIALS_VERSION >= 70000
59#define realtype sunrealtype
68#if CHASTE_SUNDIALS_VERSION >= 70000
69void CvodeErrorHandler(
int errorCode,
const char* module,
const char* function,
70 const char* message, SUNErrCode errCode,
void* pData, SUNContext sunContext);
72void CvodeErrorHandler(
int errorCode,
const char* module,
const char* function,
73 char* message,
void* pData);
84 std::vector<realtype>*
pY;
126 template <
class Archive>
127 void serialize(Archive& archive,
const unsigned int version)
129 archive& boost::serialization::base_object<AbstractIvpOdeSolver>(*
this);
174#if CHASTE_SUNDIALS_VERSION >= 30000
176 SUNMatrix mpSundialsDenseMatrix;
178 SUNLinearSolver mpSundialsLinearSolver;
198 std::vector<double>& rInitialY,
199 double startTime,
double maxStep);
225 CvodeAdaptor(
double relTol = 1e-4,
double absTol = 1e-6);
240 void SetTolerances(
double relTol = 1e-4,
double absTol = 1e-6);
300 std::vector<double>& rYValues,
304 double timeSampling);
317 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