6#include "ddc_alias_inline_functions.hpp"
7#include "ddc_aliases.hpp"
8#include "ddc_helper.hpp"
9#include "itimestepper.hpp"
10#include "vector_field_common.hpp"
35 class ExecSpace = Kokkos::DefaultExecutionSpace>
50 IdxRange
const m_idx_range;
60 explicit RK2(IdxRange idx_range) : m_idx_range(idx_range) {}
78 ExecSpace
const& exec_space,
86 FieldMem y_prime_alloc(m_idx_range);
97 dy_calculator(k1, get_const_field(y));
101 y_update(y_prime, get_const_field(k1), 0.5 * dt);
104 dy_calculator(k2, get_const_field(y_prime));
108 y_update(y, get_const_field(k2), dt);
See DerivFieldMemImplementation.
Definition derivative_field.hpp:10
See DerivFieldImplementation.
Definition derivative_field.hpp:20
The superclass from which all timestepping methods inherit.
Definition itimestepper.hpp:23
typename FieldMem::discrete_domain_type IdxRange
The type of the index range on which the values of the function are defined.
Definition itimestepper.hpp:46
typename DerivFieldMem::span_type DerivField
The type of the derivatives of the function being evolved.
Definition itimestepper.hpp:56
typename DerivFieldMem::view_type DerivConstField
The constant type of the derivatives values of the function being evolved.
Definition itimestepper.hpp:59
typename FieldMem::span_type ValField
The type of the values of the function being evolved.
Definition itimestepper.hpp:50
void update(ValField y, double dt, std::function< void(DerivField, ValConstField)> dy_calculator) const
Carry out one step of the timestepping scheme.
Definition itimestepper.hpp:78
void copy(ValField copy_to, ValConstField copy_from) const
Make a copy of the values of the function being evolved.
Definition itimestepper.hpp:147
typename FieldMem::view_type ValConstField
The constant type of the values of the function being evolved.
Definition itimestepper.hpp:53
A class which provides an implementation of a second-order Runge-Kutta method.
Definition rk2.hpp:37
RK2(IdxRange idx_range)
Create a RK2 object.
Definition rk2.hpp:60
typename DerivFieldMem::view_type DerivConstField
The constant type of the derivatives values of the function being evolved.
Definition itimestepper.hpp:59
typename FieldMem::span_type ValField
The type of the values of the function being evolved.
Definition itimestepper.hpp:50
typename FieldMem::view_type ValConstField
The constant type of the values of the function being evolved.
Definition itimestepper.hpp:53
void update(ExecSpace const &exec_space, ValField y, double dt, std::function< void(DerivField, ValConstField)> dy_calculator, std::function< void(ValField, DerivConstField, double)> y_update) const final
Carry out one step of the Runge-Kutta scheme.
Definition rk2.hpp:77