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);
59CvodeContextManager* CvodeContextManager::Instance()
62 static thread_local std::unique_ptr<CvodeContextManager> instance = std::unique_ptr<CvodeContextManager>(
new CvodeContextManager());
63 return instance.get();
66SUNContext& CvodeContextManager::GetSundialsContext()
68 assert(mSundialsContext);
69 return mSundialsContext;