3from ...AuxiliaryVariables
import code_to_assemble_kernel_input
6from .AbstractRKFD4ActionSet
import AbstractRKFD4ActionSet
12 Store the maximum eigenvalue over all grid cells of a patch
14 The action set runs after the final linear combination of a Runge-Kutta
15 step, i.e. it sees the solution of the next time step in solver._patch.
16 It stores the maximum eigenvalue in the cell data solver._max_eigenvalue.
17 It does nothing else: the reduction over the cells is a task of its own
18 (@ref exahype2.api.rkfd4.actionsets.ReduceMaxEigenvalue), and
19 exahype2.api.rkfd4.actionsets.ComputeTimeStepSize derives the next time
20 step size from its outcome. Why: The eigenvalue per cell stays available
21 for others, and the cell update, the eigenvalue and the reduction are
22 independent steps of the task graph that the compiler can overlap.
29 @param solver: exahype2.api.Solver
30 Has to have an exahype2.api.rkfd4.CentralDifferencesWithRungeKutta
31 with adaptive time stepping as numerical scheme, which has already
32 constructed its kernel calls.
35 C++ boolean expression, evaluated per cell in touchCellFirstTime.
38 AbstractRKFD4ActionSet.__init__(self, solver)
44 != peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
47 instance = self.
_solver.get_name_of_global_instance()
48 unknowns = f
"fineGridCell{self._solver._patch.name}.value"
50 {code_to_assemble_kernel_input(self._solver, "kernelIn", unknowns, 0, lambda auxiliary: f"fineGridCell{auxiliary.patch.name}.value")}
51 ::exahype2::CellData patchData(
52 {"kernelIn.data()" if self._solver.auxiliary_variables else unknowns},
55 repositories::{instance}.getMinTimeStamp(),
56 repositories::{instance}.getMinTimeStepSize(),
57 fineGridCell{self._solver._patch.name}.value
59 {self._solver.numerical_scheme.max_eigenvalue_kernel_call}
60 fineGridCell{self._solver._max_eigenvalue.name}.setMaxEigenvalue( 0, patchData.maxEigenvalue[0] );
66 == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
72 return __name__.replace(
".py",
"").replace(
".",
"_")
Base class of the action sets of exahype2.api.rkfd4 which work against the solver.
Store the maximum eigenvalue over all grid cells of a patch.
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...
__init__(self, solver, guard)