37#if CHASTE_SUNDIALS_VERSION >= 60000
41#include <nvector/nvector_serial.h>
42#include <sundials/sundials_types.h>
43#include "CvodeContextManager.hpp"
45CvodeContextManager::CvodeContextManager()
47#if CHASTE_SUNDIALS_VERSION >= 70000
48 SUNContext_Create(SUN_COMM_NULL, &mSundialsContext);
50 SUNContext_Create(NULL, &mSundialsContext);
54CvodeContextManager::~CvodeContextManager()
56 SUNContext_Free(&mSundialsContext);
59std::shared_ptr<CvodeContextManager> CvodeContextManager::Instance()
69 static thread_local std::shared_ptr<CvodeContextManager> p_instance(
new CvodeContextManager());
73SUNContext& CvodeContextManager::GetSundialsContext()
75 assert(mSundialsContext);
76 return mSundialsContext;