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.EvaluateRightHandSide,
20 which overwrites the slot, within the same task. @ref
21 exagrype.api.FD4WithKODissipation arranges this.
26 self, solver, stage: int, sigma: float, quantities: List[int], guard: str
30 @param solver: exahype2.api.Solver
31 Has to have an exagrype.api.FD4WithKODissipation as numerical
35 Number of the Runge-Kutta stage, starting with zero.
38 Scaling of the dissipation.
40 @param quantities: List[int]
41 Indices of the unknowns which are subject to the dissipation.
44 C++ boolean expression, evaluated per cell in touchCellFirstTime.
56 != peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
59 scheme = self.
_solver.numerical_scheme
61 unknowns = self.
_solver.unknowns
62 quantities =
", ".join(str(quantity)
for quantity
in self.
quantities)
64 static_assert(Dimensions == 3, "The Kreiss-Oliger dissipation of ExaGRyPE is three-dimensional only");
65 constexpr int dissipativeQuantities[] = {{ {quantities} }};
66 ::exagrype::ccz4::addKreissOligerDissipation(
67 fineGridCell{self._solver._patch_with_halo.name}.value,
68 fineGridCell{self._solver._rhs_estimates.name}.value + {self.stage * unknowns * n * n * n},
73 {self._solver.auxiliary_variables},
75 dissipativeQuantities,
76 {len(self.quantities)}
83 == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
89 return super().
get_includes() +
'\n#include "exagrype/ccz4/Kernels.h"\n'
92 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.