3from .AbstractRKFD4ActionSet
import AbstractRKFD4ActionSet
12 Fill a patch's initial condition, one grid cell at a time, by calling
13 the solver's exahype2.api.InitPointWisely PDE term once per grid cell
14 with that grid cell's centre.
16 The Finite Differences of @ref exahype2.api.rkfd4 are cell-centred, i.e.
17 each patch hosts patch_size^d grid cells and the unknowns are located at
18 their centres. The action set is a copy of
19 exahype2.api.fv.actionsets.InitialCondition, which places the unknowns
20 in the very same way, as rkfd4 does not depend on the Finite Volume
23 Checkpoint-restart support has deliberately not been ported: it relies
24 on Solver attributes that do not exist in the new exahype2.api yet.
31 @param solver: exahype2.api.Solver
32 Has to have an InitPointWisely PDE term registered - @ref
33 exahype2.api.rkfd4.SetupSimulationOverRegularGrid asserts this
34 before it attaches an instance of this action set.
37 C++ boolean expression, evaluated per cell, guarding whether the
38 initial condition is (re)written for that cell.
41 AbstractRKFD4ActionSet.__init__(self, solver)
49 == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
52 "NUMBER_OF_GRID_CELLS_PER_AXIS": self.
_solver.numerical_scheme.patch_size,
53 "NUMBER_OF_UNKNOWNS": self.
_solver.unknowns,
54 "NUMBER_OF_AUXILIARY_VARIABLES": self.
_solver.auxiliary_variables,
55 "UNKNOWN_IDENTIFIER": self.
_solver._unknown_identifier(),
56 "SOLVER_INSTANCE": self.
_solver.get_name_of_global_instance(),
65 == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
71 return __name__.replace(
".py",
"").replace(
".",
"_")
73 TemplateInitialCondition =
"""
74 logTraceIn( "touchCellFirstTime(...)---InitialCondition" );
75 parallelDfor( gridCell, {{NUMBER_OF_GRID_CELLS_PER_AXIS}} ) {
76 int index = peano4::utils::dLinearised(gridCell,{{NUMBER_OF_GRID_CELLS_PER_AXIS}}) * ({{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}});
77 repositories::{{SOLVER_INSTANCE}}.initPointWisely(
78 ::exahype2::fd::getGridCellCentre( marker.x(), marker.h(), {{NUMBER_OF_GRID_CELLS_PER_AXIS}}, gridCell),
79 fineGridCell{{UNKNOWN_IDENTIFIER}}.value + index
83 logTraceOut( "touchCellFirstTime(...)---InitialCondition" );
Base class of the action sets of exahype2.api.rkfd4 which work against the solver.
Fill a patch's initial condition, one grid cell at a time, by calling the solver's exahype2....
__init__(self, solver, guard)
str TemplateInitialCondition
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...
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.