3from .AbstractFVActionSet
import AbstractFVActionSet
5from ...AuxiliaryVariables
import (
6 code_to_assemble_kernel_input,
7 code_to_allocate_kernel_output,
8 code_to_copy_back_kernel_output,
16 Update a Finite Volume patch (solver._patch) from its halo-augmented
17 reconstruction (solver._patch_with_halo, see
18 toolbox.blockstructured.api.ReconstructPatchWithHalo) by applying the
19 solver's numerical scheme (Rusanov flux, explicit Euler time stepping)
22 Global time stepping: all cells share one time stamp and time step
23 size, which are taken from the solver (getMinTimeStamp() and
24 getMinTimeStepSize()) rather than from per-cell bookkeeping.
26 The kernel does not return any eigenvalue: exahype2.api.fv.actionsets.ComputeMaxEigenvalue
27 determines it in a task of its own, and
28 exahype2.api.fv.actionsets.ComputeGlobalCFLCondition derives the next
29 time step size from it.
36 @param solver: exahype2.api.Solver
37 Has to have solver._patch and
38 solver._patch_with_halo set - @see
39 exahype2.api.fv.RusanovWithExplicitEuler.
42 C++ boolean expression, evaluated per cell in touchCellFirstTime,
43 guarding whether that cell's patch is updated. Typically the
44 output of the solver's grid_selector (@see
45 peano4.api.toolbox.GridSelector).
48 AbstractFVActionSet.__init__(self, solver)
53 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
55 unknowns_in = f
"fineGridCell{solver._patch_with_halo.name}.value"
56 unknowns_out = f
"fineGridCell{solver._patch.name}.value"
57 has_parameters = len(solver.auxiliary_variables) > 0
58 kernel_in =
"kernelIn.data()" if has_parameters
else unknowns_in
59 kernel_out =
"kernelOut.data()" if has_parameters
else unknowns_out
61 double timeStamp = repositories::{solver.get_name_of_global_instance()}.getMinTimeStamp();
62 double timeStepSize = repositories::{solver.get_name_of_global_instance()}.getMinTimeStepSize();
63 {code_to_assemble_kernel_input(solver, "kernelIn", unknowns_in, solver.numerical_scheme.halo_size)}
64 {code_to_allocate_kernel_output(solver, "kernelOut")}
65 ::exahype2::CellData patchData({kernel_in}, marker.x(), marker.h(), timeStamp, timeStepSize, {kernel_out});
66 {solver.compute_kernel_call}
67 {code_to_copy_back_kernel_output(solver, "kernelOut", unknowns_out)}
73 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
78 return __name__.replace(
".py",
"").replace(
".",
"_")
Update a Finite Volume patch (solver._patch) from its halo-augmented reconstruction (solver....
__init__(self, solver, guard)
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...
get_guard_of_operation(self, operation_name)
Return the guard of an operation.