mbsim  4.0.0
MBSim Kernel
MBSim::BoostOdeintDOS< DOS > Class Template Reference

#include <boost_odeint_integrator.h>

Inheritance diagram for MBSim::BoostOdeintDOS< DOS >:
[legend]

Public Member Functions

void integrate () override
 start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first. More...
 
void preIntegrate () override
 
void subIntegrate (double tSamplePoint) override
 
void postIntegrate () override
 
void setInitialStepSize (double dt0_)
 Set initial step size.
 
template<typename H = DOS, typename = EnableIfControlled<H>>
void setAbsoluteTolerance (double aTol_)
 Set absolute tolerance.
 
template<typename H = DOS, typename = EnableIfControlled<H>>
void setRelativeTolerance (double rTol_)
 Set relative tolerance.
 
template<typename H = DOS, typename = EnableIfControlled<H>>
void setMaximumStepSize (double dtMax_)
 Set maximum step size.
 
void initializeUsingXML (xercesc::DOMElement *element) override
 initialize integrator More...
 
- Public Member Functions inherited from MBSim::RootFindingIntegrator
void setRootFindingAccuracy (double dtRoot_)
 Define the root-finding accuracy.
 
void setPlotOnRoot (bool b)
 Define wether to trigger a plot before and after each found root.
 
void setToleranceForPositionConstraints (double gMax_)
 Set the maximum allowed position drift.
 
void setToleranceForVelocityConstraints (double gdMax_)
 Set the maximum allowed velocity drift.
 
double getToleranceForPositionConstraints ()
 Get the maximum allowed position drift.
 
double getToleranceForVelocityConstraints ()
 Get the maximum allowed velocity drift.
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 initialize integrator More...
 
- Public Member Functions inherited from MBSim::Integrator
 Integrator ()
 constructor
 
 ~Integrator () override=default
 destructor
 
void setStartTime (double tStart_)
 
void setEndTime (double tEnd_)
 
void setPlotStepSize (double dtPlot_)
 
void setInitialState (const fmatvec::Vec &z0_)
 
double getStartTime () const
 
double getEndTime () const
 
double getPlotStepSize () const
 
const fmatvec::Vec & getInitialState () const override
 
void execute () override
 start solving the dynamic system set by setSystem. More...
 
virtual void integrate ()=0
 start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first. More...
 
void integrate (MBSim::DynamicSystemSolver &sys)
 Convinent function: call setSystem(&sys) and integrate()
 
void debugInit ()
 
virtual void preIntegrate ()
 
virtual void subIntegrate (double tStop)
 
virtual void postIntegrate ()
 
void initializeUsingXML (xercesc::DOMElement *element) override
 initialize integrator More...
 
- Public Member Functions inherited from MBSim::Solver
 Solver ()
 constructor
 
 ~Solver () override=default
 destructor
 
void throwError (const std::string &msg) const
 
virtual void execute ()=0
 start solving the dynamic system set by setSystem. More...
 
virtual void postprocessing ()
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
virtual const fmatvec::Vec & getInitialState () const =0
 
void setSystem (DynamicSystemSolver *s)
 
MBSim::DynamicSystemSolvergetSystem ()
 
const MBXMLUtils::DOMEvalExceptiongetDOMEvalError () const
 

Protected Types

template<typename H >
using EnableIfControlled = typename std::enable_if< std::is_base_of< boost::numeric::odeint::controlled_stepper_tag, typename H::UnderlayingStepperCategory >::value >::type
 

Protected Member Functions

void zd (const typename DOS::state_type &z, typename DOS::state_type &zd, const double t)
 
void jac (const typename DOS::state_type &z, boost::numeric::ublas::matrix< double > &jac, const double t, typename DOS::state_type &ft)
 
- Protected Member Functions inherited from MBSim::RootFindingIntegrator
bool signChangedWRTsvLast (const fmatvec::Vec &svStepEnd) const
 

Protected Attributes

const std::function< void(const typename DOS::state_type &, typename DOS::state_type &, const double)> zdFunc {bind(&BoostOdeintDOS<DOS>::zd, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)}
 
const std::function< void(const typename DOS::state_type &, boost::numeric::ublas::matrix< double > &c, const double, typename DOS::state_type &)> jacFunc
 
const BoostOdeintHelper::BoostOdeintSystem< typename DOS::SystemCategory, decltype(zdFunc), decltype(jacFunc)> boostOdeintSystem {zdFunc, jacFunc}
 
std::unique_ptr< DOS > dos
 
double dt0 {1e-10}
 
double aTol {1e-6}
 
double rTol {1e-6}
 
double dtMax {0.1}
 
double tPlot
 
size_t plotSample
 
DOS::state_type zTemp
 
fmatvec::Vec zDisturbed
 
size_t nrSteps
 
size_t nrRHS
 
size_t nrJacs
 
size_t nrPlots
 
size_t nrSVs
 
size_t nrRoots
 
size_t nrDriftCorr
 
- Protected Attributes inherited from MBSim::RootFindingIntegrator
double dtRoot {1e-10}
 
bool plotOnRoot {false}
 
double gMax {-1}
 
double gdMax {-1}
 
fmatvec::Vec svLast
 
bool shift {false}
 
- Protected Attributes inherited from MBSim::Integrator
double tStart {0.}
 start, end, plot time
 
double tEnd {1.}
 
double dtPlot {1e-4}
 
fmatvec::Vec z0
 initial state
 
std::string name
 name of integrator
 
- Protected Attributes inherited from MBSim::Solver
MBSim::DynamicSystemSolversystem
 dynamic system
 
MBXMLUtils::DOMEvalException domEvalError
 Special XML helper variable.
 

Static Protected Attributes

static constexpr bool isControlled
 

Detailed Description

template<typename DOS>
class MBSim::BoostOdeintDOS< DOS >

Integrator based on any Boost odeint dense output stepper. DOS must conform to the following concept:

  • must be a valid boost odeint dense output stepper
  • SystemCategory must be a typedef of either ExplicitSystemTag or ImplicitSystemTag
  • UnderlayingStepperCategory must be a typedef of the underlaying stepper category
  • DOS(double aTol, double rTol, double dtMax) must be a valid constructor

Member Function Documentation

◆ initializeUsingXML()

template<typename DOS >
void MBSim::BoostOdeintDOS< DOS >::initializeUsingXML ( xercesc::DOMElement *  element)
overridevirtual

initialize integrator

Parameters
XMLdescription

Reimplemented from MBSim::RootFindingIntegrator.

◆ integrate()

template<typename DOS >
void MBSim::BoostOdeintDOS< DOS >::integrate ( )
overridevirtual

start the integration of the system set by setSystem. Each class implemeting this function should call debugInit first.

Implements MBSim::Integrator.

◆ postIntegrate()

template<typename DOS >
void MBSim::BoostOdeintDOS< DOS >::postIntegrate
overridevirtual

Reimplemented from MBSim::Integrator.

◆ preIntegrate()

template<typename DOS >
void MBSim::BoostOdeintDOS< DOS >::preIntegrate
overridevirtual

Reimplemented from MBSim::Integrator.

◆ subIntegrate()

template<typename DOS >
void MBSim::BoostOdeintDOS< DOS >::subIntegrate ( double  tSamplePoint)
overridevirtual

Reimplemented from MBSim::Integrator.

Member Data Documentation

◆ isControlled

template<typename DOS >
constexpr bool MBSim::BoostOdeintDOS< DOS >::isControlled
staticconstexprprotected
Initial value:
{std::is_base_of<boost::numeric::odeint::controlled_stepper_tag,
typename DOS::UnderlayingStepperCategory>::value}

◆ jacFunc

template<typename DOS >
const std::function<void(const typename DOS::state_type&, boost::numeric::ublas::matrix<double>&c, const double, typename DOS::state_type&)> MBSim::BoostOdeintDOS< DOS >::jacFunc
protected
Initial value:
{bind(&BoostOdeintDOS<DOS>::jac, this, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::placeholders::_4)}

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