10 This class plugs into the first access to a face and copies the data over
12 patch_overlap_in: peano4.api.datamodel.Patch
13 Patch data associated with cell.
15 patch_overlap_out: peano4.api.datamodel.Patch
16 Patch data associated with faces.
18 invoke_in_touch_first: Boolean
19 If you set this one to True, then I do the copying in touchFaceFirstTime.
20 Otherwise, I do it in touchFaceLastTime
23 Predicate to determine when to invoke this thing. Pass in
24 true if you wanna be it called always
29 def __init__(self,patch_overlap_in,patch_overlap_out,invoke_in_touch_first,guard="",additional_includes=""):
30 super(BackupPatchOverlap,self).
__init__(descend_invocation_order=1,parallel=
False)
32 self.
d[
"UNKNOWNS" ] = str(patch_overlap_in.no_of_unknowns)
33 self.
d[
"DOFS_PER_AXIS" ] = str(patch_overlap_in.dim[1])
34 self.
d[
"OVERLAP" ] = str(int(patch_overlap_in.dim[0]/2))
35 self.
d[
"FACES_ACCESSOR_IN" ] =
"fineGridFace" + patch_overlap_in.name
36 self.
d[
"FACES_ACCESSOR_OUT" ] =
"fineGridFace" + patch_overlap_out.name
37 self.
d[
"GUARD_PREDICATE" ] = guard
44 self.
d[
"GUARD_PREDICATE" ] = guard
56 return " return std::vector< peano4::grid::GridControlEvent >();\n"
60 return __name__.replace(
".py",
"").replace(
".",
"_")
68 logTraceInWith3Arguments( "--backup patch overlap from {FACES_ACCESSOR_IN} into {FACES_ACCESSOR_OUT}--(...)", marker.toString(), {FACES_ACCESSOR_OUT}.value, {FACES_ACCESSOR_IN}.value );
70 dfore(k,{DOFS_PER_AXIS},0,0) {{
71 for (int i=0; i<{OVERLAP}*2; i++) {{
72 for (int j=0; j<{UNKNOWNS}; j++) {{
73 // assertion4( {FACES_ACCESSOR_IN}.value[counter]=={FACES_ACCESSOR_IN}.value[counter], k,i,j, marker.toString() );
74 {FACES_ACCESSOR_OUT}.value[counter] = {FACES_ACCESSOR_IN}.value[counter];
79 logTraceOutWith1Argument( "--backup patch overlap from {FACES_ACCESSOR_IN} into {FACES_ACCESSOR_OUT}--(...)", {FACES_ACCESSOR_IN}.value[0] );
96 return self.
d[
"GUARD_PREDICATE" ]
98 return self.
d[
"GUARD_PREDICATE" ]
108#include "peano4/utils/Loop.h"
This class plugs into the first access to a face and copies the data over.
get_constructor_body(self)
Define a tailored constructor body.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
set_guard_predicate(self, guard)
get_guard_of_operation(self, operation_name)
Return the guard of an operation.
get_body_of_createGridControlEventsForNextTraversal(self)
Return the grid control events that this action set wants to trigger.
get_includes(self)
Return include statements that you need.
get_action_set_name(self)
Return unique action set name.
user_should_modify_template(self)
Is the user allowed to modify the output.
get_attributes(self)
Return attributes as copied and pasted into the generated class.
__init__(self, patch_overlap_in, patch_overlap_out, invoke_in_touch_first, guard="", additional_includes="")
get_destructor_body(self)
Action set (reactions to events)