3from .AbstractFVActionSet
import AbstractFVActionSet
4from .DiscardPatchInterior
import wait_for_patch_interior_update, WAIT_INCLUDES
12 Insert the patch interior into the patch
14 Copies solver._patch_interior, i.e. the result of
15 exahype2.api.fv.actionsets.UpdateCellInterior, into the patch interior
16 of solver._patch. The patch
17 then is the updated patch of the whole cell, so
18 exahype2.api.fv.actionsets.ComputeMaxEigenvalue can determine its
19 maximum eigenvalue (@see
20 exahype2.api.fv.RusanovWithOptimisticExplicitEuler).
22 If the patch interior is updated by a task (@see
23 exahype2.api.fv.actionsets.SpawnTaskToUpdateCellInterior), the action
24 set first waits for this task.
28 def __init__(self, solver, patch_size, overlap, guard, task_number=None):
31 @param solver: exahype2.api.Solver
32 Has to have solver._patch, solver._patch_interior and
33 solver._max_eigenvalue_and_time_step_sizes set - @see
34 exahype2.api.fv.RusanovWithOptimisticExplicitEuler.
36 @param patch_size: int
37 Number of Finite Volumes per axis within one patch.
40 Thickness of the shell, i.e. the patch interior has
41 patch_size-2*overlap Finite Volumes per axis.
44 C++ boolean expression, evaluated per cell in touchCellFirstTime,
45 guarding whether that cell's patch interior is inserted.
47 @param task_number: peano4.api.datamodel.DaStGen2
48 Cell data holding the number of the task updating the patch
49 interior. If given, the action set waits for this task before it
50 copies the patch interior. None if the patch interior is not
54 AbstractFVActionSet.__init__(self, solver)
62 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
63 unknowns = self.
_solver.unknowns
68 dfor(interiorVolume,{interior_size}) {{
69 tarch::la::Vector<Dimensions,int> patchVolume = interiorVolume + tarch::la::Vector<Dimensions,int>({self.overlap});
70 int interiorVolumeSerialised = peano4::utils::dLinearised(interiorVolume,{interior_size});
71 int patchVolumeSerialised = peano4::utils::dLinearised(patchVolume,{self.patch_size});
72 for (int j=0; j<{unknowns}; j++) {{
73 fineGridCell{self._solver._patch.name}.value[patchVolumeSerialised*{unknowns}+j] = fineGridCell{self._solver._patch_interior.name}.value[interiorVolumeSerialised*{unknowns}+j];
80 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
86#include "peano4/utils/Loop.h"
89 result += WAIT_INCLUDES
93 return __name__.replace(
".py",
"").replace(
".",
"_")
Insert the patch interior into the patch.
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...
__init__(self, solver, patch_size, overlap, guard, task_number=None)
get_guard_of_operation(self, operation_name)
Return the guard of an operation.
get_includes(self)
Return include statements that you need.