SystemIntegrator< FP, Integrands > Class Template Reference

CPP API: mio::SystemIntegrator< FP, Integrands > Class Template Reference
mio::SystemIntegrator< FP, Integrands > Class Template Reference

Integrate a system of equations over time. More...

#include <integrator.h>

Public Types

using Core = IntegratorCore< FP, Integrands... >
 

Public Member Functions

Eigen::Ref< Eigen::VectorX< FP > > advance (const Integrands &... fs, const FP tmax, FP &dt, TimeSeries< FP > &results)
 Advance the integrator. More...
 
SystemIntegratoroperator= (const SystemIntegrator &other)
 
void set_integrator_core (std::unique_ptr< Core > &&core)
 Change the IntegratorCore used for integration. More...
 
 SystemIntegrator (const SystemIntegrator &other)
 
 SystemIntegrator (std::unique_ptr< Core > &&core)
 Create an integrator for a specific IVP. More...
 
std::unique_ptr< Corem_core
 Access the IntegratorCore used for integration. More...
 
bool m_is_adaptive
 Access the IntegratorCore used for integration. More...
 
Coreget_integrator_core ()
 Access the IntegratorCore used for integration. More...
 
const Coreget_integrator_core () const
 Access the IntegratorCore used for integration. More...
 

Detailed Description

template<typename FP, class... Integrands>
class mio::SystemIntegrator< FP, Integrands >

Integrate a system of equations over time.

Template Parameters
FPA floating point type, e.g. double.
IntegrandsOne or more function types used for defining the right hand side of a system of equations. How multiple Integrands are combined depends on the IntegratorCore implementation.

Member Typedef Documentation

◆ Core

template<typename FP , class... Integrands>
using mio::SystemIntegrator< FP, Integrands >::Core = IntegratorCore<FP, Integrands...>

Constructor & Destructor Documentation

◆ SystemIntegrator() [1/2]

template<typename FP , class... Integrands>
mio::SystemIntegrator< FP, Integrands >::SystemIntegrator ( std::unique_ptr< Core > &&  core)
inline

Create an integrator for a specific IVP.

Parameters
[in]coreImplements the solver.

◆ SystemIntegrator() [2/2]

template<typename FP , class... Integrands>
mio::SystemIntegrator< FP, Integrands >::SystemIntegrator ( const SystemIntegrator< FP, Integrands > &  other)
inline

Member Function Documentation

◆ advance()

template<typename FP , class... Integrands>
Eigen::Ref<Eigen::VectorX<FP> > mio::SystemIntegrator< FP, Integrands >::advance ( const Integrands &...  fs,
const FP  tmax,
FP &  dt,
TimeSeries< FP > &  results 
)
inline

Advance the integrator.

Parameters
[in]fsIntegrands passed to the integrator, e.g. a wrapper for get_derivatives.
[in]tmaxTime end point. Must be greater than results.get_last_time().
[in,out]dtInitial integration step size. May be changed by the IntegratorCore.
[in,out]resultsList of results. Must contain at least one time point. The last entry is used as initial time and value. A new entry is added for each integration step.
Returns
A reference to the last value in the results time series.

◆ get_integrator_core() [1/2]

template<typename FP , class... Integrands>
Core& mio::SystemIntegrator< FP, Integrands >::get_integrator_core ( )
inline

Access the IntegratorCore used for integration.

Returns
A reference to the IntegratorCore used for integration.

◆ get_integrator_core() [2/2]

template<typename FP , class... Integrands>
const Core& mio::SystemIntegrator< FP, Integrands >::get_integrator_core ( ) const
inline

Access the IntegratorCore used for integration.

Returns
A reference to the IntegratorCore used for integration.

◆ operator=()

template<typename FP , class... Integrands>
SystemIntegrator& mio::SystemIntegrator< FP, Integrands >::operator= ( const SystemIntegrator< FP, Integrands > &  other)
inline

◆ set_integrator_core()

template<typename FP , class... Integrands>
void mio::SystemIntegrator< FP, Integrands >::set_integrator_core ( std::unique_ptr< Core > &&  core)
inline

Change the IntegratorCore used for integration.

Parameters
coreThe new IntegratorCore.

Member Data Documentation

◆ m_core

template<typename FP , class... Integrands>
std::unique_ptr<Core> mio::SystemIntegrator< FP, Integrands >::m_core
private

Access the IntegratorCore used for integration.

Returns
A reference to the IntegratorCore used for integration.

◆ m_is_adaptive

template<typename FP , class... Integrands>
bool mio::SystemIntegrator< FP, Integrands >::m_is_adaptive
private

Access the IntegratorCore used for integration.

Returns
A reference to the IntegratorCore used for integration.