5from .ReconstructPatchWithHalo
import ReconstructPatchWithHalo
11 ReconstructPatchWithHalo plus a functor invoked once the reconstruction
12 (into reconstructed_patch) is done - @see ReconstructPatchWithHalo for the
13 reconstruction itself, which this class does not repeat. The functor gets
14 access to the reconstructed data (oldQWithHalo, aliasing
15 reconstructed_patch's own accessor - no separate scratch array is
16 allocated) and writes its result into patch's own accessor (newQ).
18 If you want to swap the functor, please replace self.functor_implementation,
19 and ensure that all external references (text replacements) are already
20 resolved. Consult _add_action_set_entries_to_dictionary() for details.
28 functor_implementation,
30 add_assertions_to_halo_exchange = True,
31 additional_includes = ""
35 patch, patch_overlap, reconstructed_patch, guard, add_assertions_to_halo_exchange, additional_includes:
36 @see ReconstructPatchWithHalo.
38 ## Functor_implementation
40 The functor implementation is a plain C/C++
42 - If you want to use brackets in your implementation, please use double brackets {{ }} as
43 the template system otherwise gets confused.
44 - The following C++ variables are defined:
49 Both are plain double pointers.
52 super(ReconstructPatchAndApplyFunctor,self).
__init__(
53 patch, patch_overlap, reconstructed_patch, guard, add_assertions_to_halo_exchange, additional_includes
61 Befill dictionary - @see ReconstructPatchWithHalo._add_action_set_entries_to_dictionary(),
62 which this calls first. On top of that, this one also resolves the
63 functor implementation (CELL_FUNCTOR_IMPLEMENTATION).
65 Please note that we do not replace entries in the functor implementation:
66 The overall code created by this action set consists of different parts
67 realised as different templates. The templates are subject to a text
68 replacement system and then are concatenated. One of the things that is
69 replaced within the templates is the actual functor implementation
70 (CELL_FUNCTOR_IMPLEMENTATION). If this one contains again free parameters,
71 it is your responsibility to first resolve those parameters, and then to
72 reset the functor in this routine.
74 If you want to replace the functor, you can hence either first call this
75 routine and then change d["CELL_FUNCTOR_IMPLEMENTATION"] or you set
76 self.functor_implementation and then you call this routine, i.e. the
85 return __name__.replace(
".py",
"").replace(
".",
"_")
88 _Template_TouchCellFirstTime_Core =
"""
89 double* newQ = {CELL_ACCESSOR}.value;
90 {CELL_FUNCTOR_IMPLEMENTATION}
96 if operation_name==ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
ReconstructPatchWithHalo plus a functor invoked once the reconstruction (into reconstructed_patch) is...
_add_action_set_entries_to_dictionary(self, d)
Befill dictionary -.
__init__(self, patch, patch_overlap, reconstructed_patch, functor_implementation, guard="true", add_assertions_to_halo_exchange=True, additional_includes="")
patch, patch_overlap, reconstructed_patch, guard, add_assertions_to_halo_exchange,...
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
str _Template_TouchCellFirstTime_Core
get_action_set_name(self)
Return unique action set name.
Reconstruct a cell patch together with its halo into a separate, already-declared reconstructed_patch...
_add_action_set_entries_to_dictionary(self, d)
Befill dictionary.
str _Template_TouchCellFirstTime_Fill_Halos
str _Template_TouchCellFirstTime_Preamble
str _Template_TouchCellFirstTime_Epilogue
str _Template_TouchCellFirstTime_Fill_Patch
Action set (reactions to events)