12 Copy patch_overlap_update - the face overlap
13 exahype2.api.fv.actionsets.ProjectPatchOntoFaces has just written the
14 latest projection into - onto patch_overlap_current_time_step, the
15 persistent face data toolbox.blockstructured.api.ReconstructPatchWithHalo
16 reads from to rebuild a patch's halo. Both halves of the face overlap
17 (left and right, relative to the face's normal) are copied in full,
18 unconditionally subject only to guard.
20 Ported and substantially slimmed down from the legacy
21 exahype2.solvers.fv.actionsets.RollOverUpdatedFace: that version
22 additionally rolled a third ("old") buffer over and gated each half
23 of the copy on a per-half "updated" flag read from a face label -
24 neither the third buffer nor the face label exist yet in the new
25 exahype2.api's data structures (@see
26 exahype2.api.fv.RusanovWithExplicitEuler.__create_data_structures(),
27 which creates exactly solver._patch_overlap_current_time_step and
28 solver._patch_overlap_update, and nothing else on the face side).
32 TemplateHandleFace = jinja2.Template(
"""
33 const int normal = marker.getSelectedFaceNumber() % Dimensions;
35 logTraceInWith2Arguments( "touchFaceLastTime(...)---RollOverUpdatedFace", marker.toString(), normal );
37 ::exahype2::fv::copyHalfOfHalo(
43 {{UPDATE_ACCESSOR}}.value,
44 {{CURRENT_TIME_STEP_ACCESSOR}}.value
46 ::exahype2::fv::copyHalfOfHalo(
52 {{UPDATE_ACCESSOR}}.value,
53 {{CURRENT_TIME_STEP_ACCESSOR}}.value
56 logTraceOut( "touchFaceLastTime(...)---RollOverUpdatedFace" );
59 def __init__(self, patch_overlap_current_time_step, patch_overlap_update, guard, includes):
62 patch_overlap_current_time_step: peano4.api.datamodel.Patch
63 The persistent face overlap to roll patch_overlap_update into -
64 @see exahype2.api.fv.RusanovWithExplicitEuler.
66 patch_overlap_update: peano4.api.datamodel.Patch
67 The face overlap exahype2.api.fv.actionsets.ProjectPatchOntoFaces
68 has just written the latest projection into - @see
69 exahype2.api.fv.RusanovWithExplicitEuler. Its dim[1] is assumed to
70 equal the cell patch's dofs-per-axis, i.e. patch_overlap_update
71 and patch_overlap_current_time_step have to be face-associated
72 overlaps of a cell patch in the sense of
73 exahype2.api.fv.actionsets.ProjectPatchOntoFaces.
76 C++ boolean expression, evaluated per face in touchFaceLastTime,
77 guarding whether that face's overlap is rolled over.
80 Additional includes this action set's generated code needs -
81 callers typically pass solver._get_default_includes() +
82 solver.user_solver_includes.
85 super().
__init__(descend_invocation_order=1, parallel=
False)
88 self.
d[
"GUARD"] = guard
89 self.
d[
"UNKNOWNS"] = str(patch_overlap_update.no_of_unknowns)
90 self.
d[
"DOFS_PER_AXIS"] = str(patch_overlap_update.dim[1])
91 self.
d[
"OVERLAP"] = str(int(patch_overlap_update.dim[0] / 2))
92 self.
d[
"UPDATE_ACCESSOR"] =
"fineGridFace" + patch_overlap_update.name
93 self.
d[
"CURRENT_TIME_STEP_ACCESSOR"] =
"fineGridFace" + patch_overlap_current_time_step.name
97 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_FACE_LAST_TIME:
102 if operation_name == peano4.api.solversteps.ActionSet.OPERATION_TOUCH_FACE_LAST_TIME:
103 return self.
d[
"GUARD"]
107 return __name__.replace(
".py",
"").replace(
".",
"_")
116#include "exahype2/fv/PatchUtils.h"
Copy patch_overlap_update - the face overlap exahype2.api.fv.actionsets.ProjectPatchOntoFaces has jus...
get_includes(self)
Return include statements that you need.
__init__(self, patch_overlap_current_time_step, patch_overlap_update, guard, includes)
patch_overlap_current_time_step: peano4.api.datamodel.Patch The persistent face overlap to roll patch...
user_should_modify_template(self)
Is the user allowed to modify the output.
get_action_set_name(self)
Return unique action set name.
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.
Action set (reactions to events)