3from .AbstractFVActionSet
import AbstractFVActionSet
11 Update a Finite Volume patch (solver._patch) from its halo-augmented
12 reconstruction (solver._patch_with_halo, see
13 toolbox.blockstructured.api.ReconstructPatchWithHalo) by applying the
14 solver's numerical scheme (Rusanov flux, explicit Euler time stepping)
17 Global time stepping: all cells share one time stamp and time step
18 size, which are taken from the solver (getMinTimeStamp() and
19 getMinTimeStepSize()) rather than from per-cell bookkeeping.
21 The compute kernel returns the maximum eigenvalue over the patch it has
22 just updated. The action set stores it in the cell data
23 solver._max_eigenvalue. exahype2.api.fv.actionsets.ComputeGlobalCFLCondition
24 reduces these values in a subsequent mesh traversal and derives the
25 next time step size from them.
29 def __init__(self, solver, guard, max_eigenvalue=None):
32 @param solver: exahype2.api.Solver
33 Has to have solver._patch, solver._patch_with_halo and
34 solver._max_eigenvalue set - @see
35 exahype2.api.fv.RusanovWithExplicitEuler.
38 C++ boolean expression, evaluated per cell in touchCellFirstTime,
39 guarding whether that cell's patch is updated. Typically the
40 output of the solver's grid_selector (@see
41 peano4.api.toolbox.GridSelector).
43 @param max_eigenvalue: peano4.api.datamodel.DaStGen2
44 The cell data the maximum eigenvalue goes into (first entry).
45 Defaults to solver._max_eigenvalue.
48 AbstractFVActionSet.__init__(self, solver)
50 self.
_max_eigenvalue = max_eigenvalue
if max_eigenvalue
is not None else solver._max_eigenvalue
54 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
56 double timeStamp = repositories::{self._solver.get_name_of_global_instance()}.getMinTimeStamp();
57 double timeStepSize = repositories::{self._solver.get_name_of_global_instance()}.getMinTimeStepSize();
58 ::exahype2::CellData patchData(fineGridCell{self._solver._patch_with_halo.name}.value, marker.x(), marker.h(), timeStamp, timeStepSize, fineGridCell{self._solver._patch.name}.value);
59 {self._solver.compute_kernel_call}
61 fineGridCell{self._max_eigenvalue.name}.setMaxEigenvalue( 0, patchData.maxEigenvalue[0] );
66 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
71 return __name__.replace(
".py",
"").replace(
".",
"_")
Update a Finite Volume patch (solver._patch) from its halo-augmented reconstruction (solver....
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
__init__(self, solver, guard, max_eigenvalue=None)
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
get_guard_of_operation(self, operation_name)
Return the guard of an operation.