|
using | IdxRange = typename FieldMem::discrete_domain_type |
| The type of the index range on which the values of the function are defined.
|
|
using | ValField = typename FieldMem::span_type |
| The type of the values of the function being evolved.
|
|
using | ValConstField = typename FieldMem::view_type |
| The constant type of the values of the function being evolved.
|
|
using | DerivField = typename DerivFieldMem::span_type |
| The type of the derivatives of the function being evolved.
|
|
using | DerivConstField = typename DerivFieldMem::view_type |
| The constant type of the derivatives values of the function being evolved.
|
|
|
void | update (ValField y, double dt, std::function< void(DerivField, ValConstField)> dy_calculator) const |
| Carry out one step of the timestepping scheme. More...
|
|
void | update (ExecSpace const &exec_space, ValField y, double dt, std::function< void(DerivField, ValConstField)> dy_calculator) const |
| Carry out one step of the timestepping scheme. More...
|
|
virtual 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 =0 |
| Carry out one step of the timestepping scheme. More...
|
|
template<class FieldType , class FuncType , std::size_t n_args> |
void | assemble_field_k_total (ExecSpace const &exec_space, FieldType k_total, FuncType func, std::array< FieldType, n_args > k_arr) const |
| Calculate func(k_arr[0], k_arr[1], ...) when FieldType is a Field (ddc::ChunkSpan). More...
|
|
template<class FieldType , class FuncType , std::size_t n_args> |
void | assemble_vector_field_k_total (ExecSpace const &exec_space, FieldType k_total, FuncType func, std::array< FieldType, n_args > k_arr) const |
| Calculate func(k_arr[0], k_arr[1], ...) when FieldType is a VectorField. More...
|
|
template<class FieldMem, class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
class ITimeStepper< FieldMem, DerivFieldMem, ExecSpace >
The superclass from which all timestepping methods inherit.
The class exposes three update functions which are used to carry out one step of the chosen timestepping method to solve an ODE of the form: \(\partial_t y(t) = f(t, y(t)) \),
template<class FieldMem , class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
Carry out one step of the timestepping scheme.
This function is a wrapper around the update function below. The values of the function are updated using the trivial method $f += df * dt$. This is the standard method however some cases may need a more complex update function which is why the more explicit method is also provided.
- Parameters
-
[in,out] | y | The value(s) which should be evolved over time defined on each of the dimensions at each point of the index range. |
[in] | dt | The time step over which the values should be evolved. |
[in] | dy_calculator | The function describing how the derivative of the evolve function is calculated. |
template<class FieldMem , class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
Carry out one step of the timestepping scheme.
This function is a wrapper around the update function below. The values of the function are updated using the trivial method $f += df * dt$. This is the standard method however some cases may need a more complex update function which is why the more explicit method is also provided.
- Parameters
-
[in] | exec_space | The space on which the function is executed (CPU/GPU). |
[in,out] | y | The value(s) which should be evolved over time defined on each of the dimensions at each point of the index range. |
[in] | dt | The time step over which the values should be evolved. |
[in] | dy_calculator | The function describing how the derivative of the evolve function is calculated. |
template<class FieldMem , class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
template<class DerivFieldType , class Idx , class... DDims>
static KOKKOS_FUNCTION void ITimeStepper< FieldMem, DerivFieldMem, ExecSpace >::fill_k_total |
( |
DerivFieldType |
k_total, |
|
|
Idx |
i, |
|
|
Coord< DDims... > |
new_val |
|
) |
| |
|
inlinestaticprotected |
A method to fill an element of a vector field.
- Parameters
-
[out] | k_total | The vector field that will be filled. |
[in] | i | The index where the vector field should be filled. |
[in] | new_val | The coordinate that should be saved to the vector field. |
template<class FieldMem , class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
template<class FuncType , class... T>
A method to assemble multiple derivative fields into one.
This method is responsible for choosing how this is done depending on the type of the derivative field.
- Parameters
-
[in] | exec_space | The space (CPU/GPU) where the calculation should be executed. |
[out] | k_total | The field to be filled with the combined derivative fields. |
[in] | func | A function which combines an element from each of the derivative fields. |
[in] | k | The derivative fields being combined. |
template<class FieldMem , class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
template<class FieldType , class FuncType , std::size_t n_args>
void ITimeStepper< FieldMem, DerivFieldMem, ExecSpace >::assemble_field_k_total |
( |
ExecSpace const & |
exec_space, |
|
|
FieldType |
k_total, |
|
|
FuncType |
func, |
|
|
std::array< FieldType, n_args > |
k_arr |
|
) |
| const |
|
inline |
Calculate func(k_arr[0], k_arr[1], ...) when FieldType is a Field (ddc::ChunkSpan).
This function should be private but is public due to Cuda restrictions.
- Parameters
-
[in] | exec_space | The space (CPU/GPU) where the calculation should be executed. |
[out] | k_total | The field to be filled with the combined derivative fields. |
[in] | func | A function which combines an element from each of the derivative fields. |
[in] | k_arr | The derivative fields being combined. |
template<class FieldMem , class DerivFieldMem = FieldMem, class ExecSpace = Kokkos::DefaultExecutionSpace>
template<class FieldType , class FuncType , std::size_t n_args>
void ITimeStepper< FieldMem, DerivFieldMem, ExecSpace >::assemble_vector_field_k_total |
( |
ExecSpace const & |
exec_space, |
|
|
FieldType |
k_total, |
|
|
FuncType |
func, |
|
|
std::array< FieldType, n_args > |
k_arr |
|
) |
| const |
|
inline |
Calculate func(k_arr[0], k_arr[1], ...) when FieldType is a VectorField.
This function should be private but is public due to Cuda restrictions.
- Parameters
-
[in] | exec_space | The space (CPU/GPU) where the calculation should be executed. |
[out] | k_total | The field to be filled with the combined derivative fields. |
[in] | func | A function which combines an element from each of the derivative fields. |
[in] | k_arr | The derivative fields being combined. |