1""" This file is part of the ExaGRyPE project. For conditions of distribution and
2 use, please see the copyright notice at www.peano-framework.org
14 Add the Kreiss-Oliger dissipation to the right-hand side of one Runge-Kutta stage
16 The action set reads the input of the stage with its halo
17 (solver._patch_with_halo) and adds the dissipation to the stage's slot
18 of solver._rhs_estimates via exagrype::ccz4::addKreissOligerDissipation().
19 It has to run after exahype2.api.rkfd4.actionsets.EvaluateRungeKuttaRightHandSide,
20 which overwrites the slot. As every action set of the scheme has a task of
21 its own, the dissipation task depends on the evaluation task. @ref
22 exagrype.api.FD4WithKODissipation arranges this.
26 TASK_NAME =
"Add Kreiss-Oliger dissipation"
27 """! Name of the task which hosts the action set (@ref exahype2.api.rkfd4.CentralDifferencesWithRungeKutta) """
30 self, solver, stage: int, sigma: float, quantities: List[int], guard: str
34 @param solver: exahype2.api.Solver
35 Has to have an exagrype.api.FD4WithKODissipation as numerical
39 Number of the Runge-Kutta stage, starting with zero.
42 Scaling of the dissipation.
44 @param quantities: List[int]
45 Indices of the unknowns which are subject to the dissipation.
48 C++ boolean expression, evaluated per cell in touchCellFirstTime.
60 != peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
63 scheme = self.
_solver.numerical_scheme
65 unknowns = self.
_solver.unknowns
66 quantities =
", ".join(str(quantity)
for quantity
in self.
quantities)
68 static_assert(Dimensions == 3, "The Kreiss-Oliger dissipation of ExaGRyPE is three-dimensional only");
69 constexpr int dissipativeQuantities[] = {{ {quantities} }};
70 ::exagrype::ccz4::addKreissOligerDissipation(
71 fineGridCell{self._solver._patch_with_halo.name}.value,
72 fineGridCell{self._solver._rhs_estimates.name}.value + {self.stage * unknowns * n * n * n},
79 dissipativeQuantities,
80 {len(self.quantities)}
87 == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
93 return super().
get_includes() +
'\n#include "exagrype/ccz4/Kernels.h"\n'
96 return __name__.replace(
".py",
"").replace(
".",
"_")
Add the Kreiss-Oliger dissipation to the right-hand side of one Runge-Kutta stage.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
__init__(self, solver, int stage, float sigma, List[int] quantities, str guard)
get_guard_of_operation(self, operation_name)
Return the guard of an operation.
get_includes(self)
The includes cover the kernels the numerical scheme generates (exahype2.api.rkfd4....
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
Base class of the action sets of exahype2.api.rkfd4 which work against the solver.