3from .AbstractFVActionSet
import AbstractFVActionSet
11 Update the patch interior of a Finite Volume patch
13 Counterpart of exahype2.api.fv.actionsets.UpdateCell which updates only
14 the patch interior, i.e. the patch without its shell (@see
15 exahype2.api.fv.RusanovWithOptimisticExplicitEuler). The update of the
16 patch interior does not need any halo data. The action set hence reads
17 the patch solver._patch rather than its halo-augmented reconstruction,
18 invokes the patch interior compute kernel, and writes the result into
19 solver._patch_interior.
21 The maximum eigenvalue of the patch interior goes into the third entry
22 of solver._max_eigenvalue_and_time_step_sizes. The second entry holds the estimated time
23 step size (@see exahype2.api.fv.actionsets.SpawnTaskToUpdateCellInterior).
27 def __init__(self, solver, guard, time_step_size=None, time_stamp=None, input=None):
30 @param solver: exahype2.api.Solver
31 Has to have solver._patch, solver._patch_interior,
32 solver._max_eigenvalue_and_time_step_sizes and
33 solver.compute_kernel_call_on_patch_interior set - @see
34 exahype2.api.fv.RusanovWithOptimisticExplicitEuler.
37 C++ boolean expression, evaluated per cell in touchCellFirstTime,
38 guarding whether that cell's patch interior is updated.
40 @param time_step_size: str
41 C++ expression for the time step size the patch interior is
42 advanced by. Defaults to the solver's getMinTimeStepSize().
44 @param time_stamp: str
45 C++ expression for the time stamp the patch interior update
46 starts from. Defaults to the solver's getMinTimeStamp().
49 C++ expression for the patch the update reads. Defaults to the
53 AbstractFVActionSet.__init__(self, solver)
61 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
63 if time_step_size
is None:
64 time_step_size = f
"repositories::{self._solver.get_name_of_global_instance()}.getMinTimeStepSize()"
66 if time_stamp
is None:
67 time_stamp = f
"repositories::{self._solver.get_name_of_global_instance()}.getMinTimeStamp()"
70 input = f
"fineGridCell{self._solver._patch.name}.value"
73 double timeStamp = {time_stamp};
74 double timeStepSize = {time_step_size};
75 ::exahype2::CellData patchData({input}, marker.x(), marker.h(), timeStamp, timeStepSize, fineGridCell{self._solver._patch_interior.name}.value);
76 {self._solver.compute_kernel_call_on_patch_interior}
77 fineGridCell{self._solver._max_eigenvalue_and_time_step_sizes.name}.setMaxEigenvalue( 2, patchData.maxEigenvalue[0] );
83 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
88 return __name__.replace(
".py",
"").replace(
".",
"_")
Update the patch interior of a Finite Volume patch.
__init__(self, solver, guard, time_step_size=None, time_stamp=None, input=None)
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_guard_of_operation(self, operation_name)
Return the guard of an operation.
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...