- 3.0.2 core module.
ct::core::MaxStepsEventHandler< STATE_DIM > Class Template Reference

Event handler to kill a (variable step) Integrator after doing too many steps. More...

#include <MaxStepsEventHandler.h>

Inheritance diagram for ct::core::MaxStepsEventHandler< STATE_DIM >:
ct::core::EventHandler< STATE_DIM >

Public Types

typedef ct::core::StateVector< STATE_DIM > State_T
 

Public Member Functions

 MaxStepsEventHandler (const size_t &maxStepsPerSec=std::numeric_limits< size_t >::max())
 default constructor More...
 
virtual ~MaxStepsEventHandler ()
 destructor More...
 
virtual bool callOnSubsteps () override
 
virtual void reset () override
 resets the number of steps taken More...
 
virtual bool checkEvent (const State_T &state, const double &t) override
 checks if number of steps is exceeded More...
 
virtual void handleEvent (const State_T &state, const double &t) override
 throws a std::runtime_error to terminate the integration More...
 
void setMaxNumSteps (size_t maxNumSteps)
 set maximum number of steps More...
 
- Public Member Functions inherited from ct::core::EventHandler< STATE_DIM >
 EventHandler ()
 Default constructor. More...
 
virtual ~EventHandler ()
 destructor More...
 
virtual bool checkEvent (const StateVector< STATE_DIM, double > &state, const double &t)=0
 check if an event has happened More...
 
virtual void handleEvent (const StateVector< STATE_DIM, double > &state, const double &t)=0
 handle the event More...
 

Detailed Description

template<size_t STATE_DIM>
class ct::core::MaxStepsEventHandler< STATE_DIM >

Event handler to kill a (variable step) Integrator after doing too many steps.

Checks the number of steps that a variable step Integrator has taken and kills it if exceeded

Template Parameters
STATE_DIMstate vector size

Member Typedef Documentation

◆ State_T

template<size_t STATE_DIM>
typedef ct::core::StateVector<STATE_DIM> ct::core::MaxStepsEventHandler< STATE_DIM >::State_T

Constructor & Destructor Documentation

◆ MaxStepsEventHandler()

template<size_t STATE_DIM>
ct::core::MaxStepsEventHandler< STATE_DIM >::MaxStepsEventHandler ( const size_t &  maxStepsPerSec = std::numeric_limits<size_t>::max())
inline

default constructor

Parameters
maxStepsPerSecallowed number of steps

◆ ~MaxStepsEventHandler()

template<size_t STATE_DIM>
virtual ct::core::MaxStepsEventHandler< STATE_DIM >::~MaxStepsEventHandler ( )
inlinevirtual

destructor

Member Function Documentation

◆ callOnSubsteps()

template<size_t STATE_DIM>
virtual bool ct::core::MaxStepsEventHandler< STATE_DIM >::callOnSubsteps ( )
inlineoverridevirtual

◆ reset()

template<size_t STATE_DIM>
virtual void ct::core::MaxStepsEventHandler< STATE_DIM >::reset ( )
inlineoverridevirtual

resets the number of steps taken

Implements ct::core::EventHandler< STATE_DIM >.

◆ checkEvent()

template<size_t STATE_DIM>
virtual bool ct::core::MaxStepsEventHandler< STATE_DIM >::checkEvent ( const State_T state,
const double &  t 
)
inlineoverridevirtual

checks if number of steps is exceeded

Parameters
statecurrent state (gets ignored)
tcurrent time (gets ignored)
Returns
true if number of steps higher than maximum allowed number

◆ handleEvent()

template<size_t STATE_DIM>
virtual void ct::core::MaxStepsEventHandler< STATE_DIM >::handleEvent ( const State_T state,
const double &  t 
)
inlineoverridevirtual

throws a std::runtime_error to terminate the integration

◆ setMaxNumSteps()

template<size_t STATE_DIM>
void ct::core::MaxStepsEventHandler< STATE_DIM >::setMaxNumSteps ( size_t  maxNumSteps)
inline

set maximum number of steps

Parameters
maxNumStepsmaximum number of steps allowed

The documentation for this class was generated from the following file: