36#if CHASTE_SUNDIALS_VERSION >= 60000
40#include <nvector/nvector_serial.h>
41#include <sundials/sundials_types.h>
42#include "CvodeContextManager.hpp"
44CvodeContextManager::CvodeContextManager()
46#if CHASTE_SUNDIALS_VERSION >= 70000
47 SUNContext_Create(SUN_COMM_NULL, &mSundialsContext);
49 SUNContext_Create(NULL, &mSundialsContext);
53CvodeContextManager::~CvodeContextManager()
55 SUNContext_Free(&mSundialsContext);
58std::shared_ptr<CvodeContextManager> CvodeContextManager::Instance()
68 static thread_local std::shared_ptr<CvodeContextManager> p_instance(
new CvodeContextManager());
72SUNContext& CvodeContextManager::GetSundialsContext()
74 assert(mSundialsContext);
75 return mSundialsContext;