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
11 Apply a functor to the reconstructed halos of a cell and write the result into the cell's patch
13 The action set hooks into touchCellFirstTime(). It does not reconstruct
14 anything: the halos have been filled by earlier tasks (@ref
15 toolbox.blockstructured.api.ReconstructPatchWithHalo). The functor, a
18 - oldQWithHalo: a double* to the reconstructed primary variables;
19 - oldDerivativesWithHalo: a double* to the reconstructed derivative
20 variables (the previous values of newQ, with halo);
21 - newQ: a double* to the patch which the functor writes;
22 - marker: the cell marker.
29 primary_variables_with_halo,
30 derivative_variables_with_halo,
31 functor_implementation: str,
33 additional_includes: str =
"",
37 @param patch: peano4.api.datamodel.Patch
38 The patch which the functor writes (newQ).
40 @param primary_variables_with_halo: peano4.api.datamodel.Patch
41 The reconstructed patch behind oldQWithHalo.
43 @param derivative_variables_with_halo: peano4.api.datamodel.Patch
44 The reconstructed patch behind oldDerivativesWithHalo.
46 @param functor_implementation: str
50 C++ boolean expression, evaluated per cell in touchCellFirstTime.
52 @param additional_includes: str
53 Includes that the snippet needs.
56 super().
__init__(descend_invocation_order=1, parallel=
False)
71 return " return std::vector< peano4::grid::GridControlEvent >();\n"
74 return __name__.replace(
".py",
"").replace(
".",
"_")
80 if operation_name != ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
83 [[maybe_unused]] double* oldQWithHalo = fineGridCell{self._primary.name}.value;
84 [[maybe_unused]] double* oldDerivativesWithHalo = fineGridCell{self._derivatives.name}.value;
85 double* newQ = fineGridCell{self._patch.name}.value;
90 if operation_name == ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
Apply a functor to the reconstructed halos of a cell and write the result into the cell's patch.
get_action_set_name(self)
Return unique action set name.
get_attributes(self)
Return attributes as copied and pasted into the generated class.
get_body_of_createGridControlEventsForNextTraversal(self)
Return the grid control events that this action set wants to trigger.
get_guard_of_operation(self, operation_name)
Return the guard of an operation.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_destructor_body(self)
__init__(self, patch, primary_variables_with_halo, derivative_variables_with_halo, str functor_implementation, str guard="true", str additional_includes="")
get_constructor_body(self)
Define a tailored constructor body.
user_should_modify_template(self)
Is the user allowed to modify the output.
get_includes(self)
Return include statements that you need.
Action set (reactions to events).