Block-Structured AMR Software Framework
amrex::RKIntegrator< T > Class Template Reference

#include <AMReX_RKIntegrator.H>

Inheritance diagram for amrex::RKIntegrator< T >:
amrex::IntegratorBase< T >

Public Member Functions

 RKIntegrator ()
 
 RKIntegrator (const T &S_data, const amrex::Real time=0.0)
 
void initialize (const T &S_data, const amrex::Real time=0.0)
 
virtual ~RKIntegrator ()
 
amrex::Real advance (T &S_old, T &S_new, amrex::Real time, const amrex::Real dt) override
 Take a single time step from (time, S_old) to (time + dt, S_new) with the given step size. More...
 
void evolve (T &S_out, const amrex::Real time_out) override
 Evolve the current (internal) integrator state to time_out. More...
 
void time_interpolate (const T &, const T &S_old, amrex::Real timestep_fraction, T &data) override
 
void map_data (std::function< void(T &)> Map) override
 
- Public Member Functions inherited from amrex::IntegratorBase< T >
 IntegratorBase ()=default
 
 IntegratorBase (const T &)
 
virtual ~IntegratorBase ()=default
 
void set_rhs (std::function< void(T &, T &, const amrex::Real)> F)
 
void set_imex_rhs (std::function< void(T &, T &, const amrex::Real)> Fi, std::function< void(T &, T &, const amrex::Real)> Fe)
 
void set_fast_rhs (std::function< void(T &, T &, const amrex::Real)> F)
 
void set_post_stage_action (std::function< void(T &, amrex::Real)> A)
 
void set_post_step_action (std::function< void(T &, amrex::Real)> A)
 
void set_post_fast_stage_action (std::function< void(T &, amrex::Real)> A)
 
void set_post_fast_step_action (std::function< void(T &, amrex::Real)> A)
 
amrex::Real get_time_step ()
 
void set_time_step (amrex::Real dt)
 
void set_adaptive_step ()
 
void set_fast_time_step (amrex::Real dt)
 
void set_adaptive_fast_step ()
 
void set_max_steps (int steps)
 
void set_tolerances (amrex::Real rtol, amrex::Real atol)
 
void set_fast_tolerances (amrex::Real rtol, amrex::Real atol)
 

Private Types

using BaseT = IntegratorBase< T >
 

Private Member Functions

void initialize_preset_tableau ()
 
void initialize_parameters ()
 
void initialize_stages (const T &S_data, const amrex::Real time)
 

Private Attributes

ButcherTableauTypes tableau_type
 
int number_nodes
 
amrex::Vector< amrex::Vector< amrex::Real > > tableau
 
amrex::Vector< amrex::Real > weights
 
amrex::Vector< amrex::Real > nodes
 
amrex::Vector< amrex::Real > extended_weights
 
amrex::Vector< std::unique_ptr< T > > F_nodes
 
amrex::Vector< std::unique_ptr< T > > S_current
 
amrex::Real time_current
 

Additional Inherited Members

- Protected Attributes inherited from amrex::IntegratorBase< T >
std::function< void(T &rhs, T &state, const amrex::Real time)> Rhs
 Rhs is the right-hand-side function the integrator will use. More...
 
std::function< void(T &rhs, T &state, const amrex::Real time)> RhsIm
 RhsIm is the implicit right-hand-side function an ImEx integrator will use. More...
 
std::function< void(T &rhs, T &state, const amrex::Real time)> RhsEx
 RhsEx is the explicit right-hand-side function an ImEx integrator will use. More...
 
std::function< void(T &rhs, T &state, const amrex::Real time)> RhsFast
 RhsFast is the fast timescale right-hand-side function a multirate integrator will use. More...
 
std::function< void(T &, amrex::Real)> post_stage_action
 The post_stage_action function is called by the integrator on the computed stage just after it is computed. More...
 
std::function< void(T &, amrex::Real)> post_step_action
 The post_step_action function is called by the integrator on the computed state just after it is computed. More...
 
std::function< void(T &, amrex::Real)> post_fast_stage_action
 The post_stage_action function is called by the integrator on the computed stage just after it is computed. More...
 
std::function< void(T &, amrex::Real)> post_fast_step_action
 The post_step_action function is called by the integrator on the computed state just after it is computed. More...
 
bool use_adaptive_time_step = false
 Flag to enable/disable adaptive time stepping in single rate methods or at the slow time scale in multirate methods (bool) More...
 
amrex::Real time_step
 Current integrator time step size (Real) More...
 
amrex::Real previous_time_step
 Step size of the last completed step (Real) More...
 
bool use_adaptive_fast_time_step = false
 Flag to enable/disable adaptive time stepping at the fast time scale in multirate methods (bool) More...
 
amrex::Real fast_time_step
 Current integrator fast time scale time step size with multirate methods (Real) More...
 
amrex::Long num_steps = 0
 Number of integrator time steps (Long) More...
 
int max_steps = 500
 Max number of internal steps before an error is returned (Long) More...
 
amrex::Real rel_tol = 1.0e-4
 Relative tolerance for adaptive time stepping (Real) More...
 
amrex::Real abs_tol = 1.0e-9
 Absolute tolerance for adaptive time stepping (Real) More...
 
amrex::Real fast_rel_tol = 1.0e-4
 Relative tolerance for adaptive time stepping at the fast time scale (Real) More...
 
amrex::Real fast_abs_tol = 1.0e-9
 Absolute tolerance for adaptive time stepping at the fast time scale (Real) More...
 

Member Typedef Documentation

◆ BaseT

template<class T >
using amrex::RKIntegrator< T >::BaseT = IntegratorBase<T>
private

Constructor & Destructor Documentation

◆ RKIntegrator() [1/2]

template<class T >
amrex::RKIntegrator< T >::RKIntegrator ( )
inline

◆ RKIntegrator() [2/2]

template<class T >
amrex::RKIntegrator< T >::RKIntegrator ( const T &  S_data,
const amrex::Real  time = 0.0 
)
inline

◆ ~RKIntegrator()

template<class T >
virtual amrex::RKIntegrator< T >::~RKIntegrator ( )
inlinevirtual

Member Function Documentation

◆ advance()

template<class T >
amrex::Real amrex::RKIntegrator< T >::advance ( T &  S_old,
T &  S_new,
amrex::Real  time,
const amrex::Real  dt 
)
inlineoverridevirtual

Take a single time step from (time, S_old) to (time + dt, S_new) with the given step size.

Implements amrex::IntegratorBase< T >.

◆ evolve()

template<class T >
void amrex::RKIntegrator< T >::evolve ( T &  S_out,
const amrex::Real  time_out 
)
inlineoverridevirtual

Evolve the current (internal) integrator state to time_out.

Implements amrex::IntegratorBase< T >.

◆ initialize()

template<class T >
void amrex::RKIntegrator< T >::initialize ( const T &  S_data,
const amrex::Real  time = 0.0 
)
inline

◆ initialize_parameters()

template<class T >
void amrex::RKIntegrator< T >::initialize_parameters ( )
inlineprivate

◆ initialize_preset_tableau()

template<class T >
void amrex::RKIntegrator< T >::initialize_preset_tableau ( )
inlineprivate

◆ initialize_stages()

template<class T >
void amrex::RKIntegrator< T >::initialize_stages ( const T &  S_data,
const amrex::Real  time 
)
inlineprivate

◆ map_data()

template<class T >
void amrex::RKIntegrator< T >::map_data ( std::function< void(T &)>  Map)
inlineoverridevirtual

◆ time_interpolate()

template<class T >
void amrex::RKIntegrator< T >::time_interpolate ( const T &  ,
const T &  S_old,
amrex::Real  timestep_fraction,
T &  data 
)
inlineoverridevirtual

Member Data Documentation

◆ extended_weights

template<class T >
amrex::Vector<amrex::Real> amrex::RKIntegrator< T >::extended_weights
private

◆ F_nodes

template<class T >
amrex::Vector<std::unique_ptr<T> > amrex::RKIntegrator< T >::F_nodes
private

◆ nodes

template<class T >
amrex::Vector<amrex::Real> amrex::RKIntegrator< T >::nodes
private

◆ number_nodes

template<class T >
int amrex::RKIntegrator< T >::number_nodes
private

◆ S_current

template<class T >
amrex::Vector<std::unique_ptr<T> > amrex::RKIntegrator< T >::S_current
private

◆ tableau

template<class T >
amrex::Vector<amrex::Vector<amrex::Real> > amrex::RKIntegrator< T >::tableau
private

◆ tableau_type

template<class T >
ButcherTableauTypes amrex::RKIntegrator< T >::tableau_type
private

◆ time_current

template<class T >
amrex::Real amrex::RKIntegrator< T >::time_current
private

◆ weights

template<class T >
amrex::Vector<amrex::Real> amrex::RKIntegrator< T >::weights
private

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