36#include "AbstractOneStepIvpOdeSolver.hpp"
37#include "TimeStepper.hpp"
42 std::vector<double>& rYValues,
49 assert(endTime > startTime);
50 assert(timeStep > 0.0);
51 assert(timeSampling >= timeStep);
56 EXCEPTION(
"(Solve with sampling) Stopping event is true for initial condition");
58 TimeStepper stepper(startTime, endTime, timeSampling);
64 solutions.
rGetTimes().push_back(startTime);
94 std::vector<double>& rYValues,
100 assert(endTime > startTime);
101 assert(timeStep > 0.0);
106 EXCEPTION(
"(Solve without sampling) Stopping event is true for initial condition");
116 std::vector<double>& rYValues,
117 std::vector<double>& rWorkingMemory,
127 bool curr_is_curr =
false;
133 curr_is_curr = !curr_is_curr;
138 curr_is_curr ? rYValues : rWorkingMemory,
139 curr_is_curr ? rWorkingMemory : rYValues);
142 curr_is_curr ? rWorkingMemory : rYValues) ==
true)
151 rYValues.assign(rWorkingMemory.begin(), rWorkingMemory.end());
#define EXCEPTION(message)
bool mStoppingEventOccurred
virtual bool CalculateStoppingEvent(double time, const std::vector< double > &rY)
virtual void CalculateNextYValue(AbstractOdeSystem *pAbstractOdeSystem, double timeStep, double time, std::vector< double > &rCurrentYValues, std::vector< double > &rNextYValues)=0
virtual OdeSolution Solve(AbstractOdeSystem *pAbstractOdeSystem, std::vector< double > &rYValues, double startTime, double endTime, double timeStep, double timeSampling)
virtual void InternalSolve(AbstractOdeSystem *pAbstractOdeSystem, std::vector< double > &rCurrentYValues, std::vector< double > &rWorkingMemory, double startTime, double endTime, double timeStep)
std::vector< double > mWorkingMemory
boost::shared_ptr< const AbstractOdeSystemInformation > GetSystemInformation() const
unsigned GetNumberOfStateVariables() const
std::string GetIdentifier() const
void SetNumberOfTimeSteps(unsigned numTimeSteps)
std::vector< std::vector< double > > & rGetSolutions()
std::vector< double > & rGetTimes()
void SetSolverName(std::string solverName)
void SetOdeSystemInformation(boost::shared_ptr< const AbstractOdeSystemInformation > pOdeSystemInfo)
unsigned GetTotalTimeStepsTaken() const
void AdvanceOneTimeStep()
double GetNextTime() const
unsigned EstimateTimeSteps() const