Currently, ReturnData has a number of protected data members that are used as temporary storage for model quantities during collecting the output data. It's currently rather intransparent which values are used when. They also waste some memory.
I'd suggest to remove them and rather pass SimulationState through a couple of functions.
Another motivation for their removal is to get all sundials objects out of ReturnData, so we don't have to worry about managing SUNContext outside of runAmiciSimulation with sundials>=6.0.
Currently, ReturnData has a number of protected data members that are used as temporary storage for model quantities during collecting the output data. It's currently rather intransparent which values are used when. They also waste some memory. I'd suggest to remove them and rather pass
SimulationState
through a couple of functions.