12#ifndef TIME_INTEGRATOR_H
13#define TIME_INTEGRATOR_H
17#include <unordered_map>
20#include <Kokkos_Core.hpp>
31static const std::unordered_map<std::string, TimeIntegratorType> TIME_INTEGRATOR_TYPES = {
37static const std::unordered_map<TimeIntegratorType, std::string> TIME_INTEGRATOR_NAMES = {
92 std::vector<State> & solution_vec,
93 std::vector<State> & rhs_vec,
106 std::vector<State> & solution_vec,
107 std::vector<State> & rhs_vec,
115 std::vector<State> & solution_vec,
116 std::vector<State> & rhs_vec,
128 std::vector<State> & solution_vec,
129 std::vector<State> & rhs_vec,
Definition time_integrator.h:102
FE()
Definition time_integrator.cpp:49
void take_step(const rtype t, const rtype dt, std::vector< State > &solution_vec, std::vector< State > &rhs_vec, const RHSFunction &calc_rhs, const rtype *dt_device=nullptr) override
Advance solution_vec[0] from time t by dt.
Definition time_integrator.cpp:55
Definition time_integrator.h:111
RK4()
Definition time_integrator.cpp:65
void take_step(const rtype t, const rtype dt, std::vector< State > &solution_vec, std::vector< State > &rhs_vec, const RHSFunction &calc_rhs, const rtype *dt_device=nullptr) override
Advance solution_vec[0] from time t by dt.
Definition time_integrator.cpp:71
Three-stage, third-order strong-stability-preserving Runge-Kutta (Shu & Osher 1988).
Definition time_integrator.h:124
SSPRK3()
Definition time_integrator.cpp:101
void take_step(const rtype t, const rtype dt, std::vector< State > &solution_vec, std::vector< State > &rhs_vec, const RHSFunction &calc_rhs, const rtype *dt_device=nullptr) override
Advance solution_vec[0] from time t by dt.
Definition time_integrator.cpp:107
Definition time_integrator.h:73
uint8_t n_solution_vectors
Definition time_integrator.h:98
TimeIntegratorType get_type() const
Definition time_integrator.h:77
virtual ~TimeIntegrator()=default
uint8_t get_n_solution_vectors() const
Definition time_integrator.h:78
uint8_t n_rhs_vectors
Definition time_integrator.h:99
virtual void take_step(const rtype t, const rtype dt, std::vector< State > &solution_vec, std::vector< State > &rhs_vec, const RHSFunction &calc_rhs, const rtype *dt_device=nullptr)=0
Advance solution_vec[0] from time t by dt.
uint8_t get_n_rhs_vectors() const
Definition time_integrator.h:79
TimeIntegratorType type
Definition time_integrator.h:97
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
float rtype
Definition common_typedef.h:39
Conservative state: the flow block and the species partial densities.
Conservative state of every cell: the flow block and the partial densities of a mixture's species....
Definition state.h:56
void axpby(const rtype a, const State &x, const rtype b, const State &y, const rtype *a_device=nullptr)
y = a * x + b * y, on both blocks of the state.
Definition time_integrator.cpp:15
std::function< void(State solution, State rhs, rtype t)> RHSFunction
Definition time_integrator.h:43
TimeIntegratorType
Definition time_integrator.h:25
KOKKOS_INLINE_FUNCTION void dt_scales(const rtype dt, rtype *scales)
The multiples of dt that the integrators use, as take_step's device dt_scales holds them.
Definition time_integrator.h:59
DtScale
Index of each multiple of dt in the device array of take_step's dt_scales.
Definition time_integrator.h:55
@ DT_THIRD
Definition time_integrator.h:55
@ DT
Definition time_integrator.h:55
@ DT_HALF
Definition time_integrator.h:55
@ N_DT_SCALES
Definition time_integrator.h:55
@ DT_SIXTH
Definition time_integrator.h:55
void lerp(const rtype a, const State &x, const State &y)
y = (1 - a) y + a x as y + a (x - y), on both blocks of the state: unlike axpby with rounded weights ...
Definition time_integrator.cpp:30