3from ...AuxiliaryVariables
import code_to_assemble_kernel_input
6from .AbstractRKFD4ActionSet
import AbstractRKFD4ActionSet
12 Evaluate the right-hand side of one Runge-Kutta stage over a patch
14 The action set hands the input of the stage with its halo
15 (solver._patch_with_halo) to the fourth-order Finite Differences kernel
16 (@ref exahype2.api.rkfd4.FD4Kernels) and lets it write the right-hand
17 side into the stage's slot of solver._rhs_estimates. The kernel sees
18 the time stamp of the stage, i.e. @f$ t^n + c_k \\Delta t @f$, and the
19 time step size of the whole Runge-Kutta step.
21 Global time stepping: the time stamp and the time step size are those
22 of the solver (getMinTimeStamp() and getMinTimeStepSize()).
29 @param solver: exahype2.api.Solver
30 Has to have an exahype2.api.rkfd4.CentralDifferencesWithRungeKutta
31 as numerical scheme which has already constructed its kernel call,
32 i.e. solver.compute_kernel_call.
35 Number of the Runge-Kutta stage, starting with zero.
38 C++ boolean expression, evaluated per cell in touchCellFirstTime.
41 AbstractRKFD4ActionSet.__init__(self, solver)
48 != peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
51 scheme = self.
_solver.numerical_scheme
53 unknowns = self.
_solver.unknowns
54 relative_time_step_size = scheme.butcher_tableau.relative_time_step_sizes()[
57 instance = self.
_solver.get_name_of_global_instance()
59 const double timeStepSize = repositories::{instance}.getMinTimeStepSize();
60 const double timeStamp = repositories::{instance}.getMinTimeStamp() + {relative_time_step_size!r} * timeStepSize;
62 double* estimate = fineGridCell{self._solver._rhs_estimates.name}.value + {self.stage * unknowns * n * n};
64 double* estimate = fineGridCell{self._solver._rhs_estimates.name}.value + {self.stage * unknowns * n * n * n};
66 {code_to_assemble_kernel_input(self._solver, "kernelIn", f"fineGridCell{self._solver._patch_with_halo.name}.value", scheme.HALO_SIZE)}
67 ::exahype2::CellData patchData({"kernelIn.data()" if self._solver.auxiliary_variables else f"fineGridCell{self._solver._patch_with_halo.name}.value"}, marker.x(), marker.h(), timeStamp, timeStepSize, estimate);
68 {self._solver.compute_kernel_call}
74 == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
80 return __name__.replace(
".py",
"").replace(
".",
"_")
Base class of the action sets of exahype2.api.rkfd4 which work against the solver.
Evaluate the right-hand side of one Runge-Kutta stage over a patch.
__init__(self, solver, stage, guard)
get_guard_of_operation(self, operation_name)
Return the guard of an operation.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...