#include <AMReX_SundialsIntegrator.H>
Public Member Functions | |
SundialsIntegrator () | |
SundialsIntegrator (const T &S_data, const amrex::Real time=0.0) | |
void | initialize (const T &S_data, const amrex::Real time=0.0) |
virtual | ~SundialsIntegrator () |
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. | |
void | evolve (T &S_out, const amrex::Real time_out) override |
Evolve the current (internal) integrator state to time_out. | |
void | time_interpolate (const T &, const T &, amrex::Real, T &) override |
void | map_data (std::function< void(T &)>) override |
![]() | |
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_parameters () |
void | SetupRK (amrex::Real time, N_Vector y_data) |
void | SetupMRI (amrex::Real time, N_Vector y_data) |
void | unpack_vector (N_Vector y_data, amrex::Vector< amrex::MultiFab > &S_data) |
N_Vector | wrap_data (amrex::Vector< amrex::MultiFab > &S_data) |
N_Vector | copy_data (const amrex::Vector< amrex::MultiFab > &S_data) |
void | unpack_vector (N_Vector y_data, amrex::MultiFab &S_data) |
N_Vector | wrap_data (amrex::MultiFab &S_data) |
N_Vector | copy_data (const amrex::MultiFab &S_data) |
Private Attributes | |
std::string | type = "ERK" |
std::string | method = "DEFAULT" |
std::string | method_e = "DEFAULT" |
std::string | method_i = "DEFAULT" |
std::string | fast_type = "ERK" |
std::string | fast_method = "DEFAULT" |
bool | use_ark = false |
bool | use_mri = false |
SundialsUserData | udata |
::sundials::Context | sunctx |
void * | arkode_mem = nullptr |
SUNLinearSolver | LS = nullptr |
void * | arkode_fast_mem = nullptr |
MRIStepInnerStepper | fast_stepper = nullptr |
SUNLinearSolver | fast_LS = nullptr |
Additional Inherited Members | |
![]() | |
std::function< void(T &rhs, T &state, const amrex::Real time)> | Rhs |
Rhs is the right-hand-side function the integrator will use. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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) | |
amrex::Real | time_step |
Current integrator time step size (Real) | |
amrex::Real | previous_time_step |
Step size of the last completed step (Real) | |
bool | use_adaptive_fast_time_step = false |
Flag to enable/disable adaptive time stepping at the fast time scale in multirate methods (bool) | |
amrex::Real | fast_time_step |
Current integrator fast time scale time step size with multirate methods (Real) | |
amrex::Long | num_steps = 0 |
Number of integrator time steps (Long) | |
int | max_steps = 500 |
Max number of internal steps before an error is returned (Long) | |
amrex::Real | rel_tol = 1.0e-4 |
Relative tolerance for adaptive time stepping (Real) | |
amrex::Real | abs_tol = 1.0e-9 |
Absolute tolerance for adaptive time stepping (Real) | |
amrex::Real | fast_rel_tol = 1.0e-4 |
Relative tolerance for adaptive time stepping at the fast time scale (Real) | |
amrex::Real | fast_abs_tol = 1.0e-9 |
Absolute tolerance for adaptive time stepping at the fast time scale (Real) | |
|
private |
|
inline |
|
inline |
|
inlinevirtual |
|
inlineoverridevirtual |
Take a single time step from (time, S_old) to (time + dt, S_new) with the given step size.
Implements amrex::IntegratorBase< T >.
|
inlineprivate |
|
inlineprivate |
|
inlineoverridevirtual |
Evolve the current (internal) integrator state to time_out.
Implements amrex::IntegratorBase< T >.
|
inline |
|
inlineprivate |
|
inlineoverridevirtual |
Implements amrex::IntegratorBase< T >.
|
inlineprivate |
|
inlineprivate |
|
inlineoverridevirtual |
Implements amrex::IntegratorBase< T >.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |