4from .AbstractFVActionSet
import AbstractFVActionSet
12 PreprocessSolution differs from other action sets, as I only create it once. See
13 FV.create_action_sets(). Once the instance does exist, you can tailor it. But you
14 can also completely overwrite it.
18 AbstractFVActionSet.__init__(self,solver)
30 return __name__.replace(
".py",
"").replace(
".",
"_")
39 Run over solution volume by volume
41 PreprocessSolution differs from other action sets, as I only create it once. See
42 FV.create_action_sets(). Once the instance does exist, you can tailor it. But you
43 can also completely overwrite it.
45 See also FV.postprocess_updated_patch(self, kernel) for a discussion what options
46 ExaHyPE offers for postprocessing. This volume-wise postprocessing might be too
47 heavy-weight for some applications.
49 The postprocessing plugs into touch cell last time. It is the last action set added
50 by the default implementation. Therefore, it is the first action set of which
51 touchCellLastTime() is called. The reason why I plug into the leaving of the cell
52 is that some solvers may add further action sets to the solve. Enclave tasking for
53 example adds the merger as additional action set. These action sets plug into
54 touchCellFirstTime() - and consequently their first time is called after the
55 postprocessing's first time. By making the postprocessing use touchCellLastTime(),
56 I ensure that any additional action set added by a subclass can still precede the
62 AbstractFVActionSet.__init__(self,solver)
71 Add a code snippet which is applied to each and every point. You have the following
72 variables which are well-defined:
74 - value: Is a pointer to the current finite volume's data
75 - volumeX: A tarch::la::Vector over doubles
76 - volumeH: A tarch::la::Vector over doubles
79 operation_per_point: String
85 {{COMPUTE_TIME_STEP_SIZE}}
86 const double timeStamp = fineGridCell{{SOLVER_NAME}}CellLabel.getTimeStamp();
89 not marker.hasBeenRefined()
93 logTraceIn( "touchCellFirstTime(...)" );
96 dfor( volume, {{NUMBER_OF_VOLUMES_PER_AXIS}} ) {
97 double* value = fineGridCell{{UNKNOWN_IDENTIFIER}}.value + index;
98 auto volumeX = ::exahype2::fv::getVolumeCentre( marker.x(), marker.h(), {{NUMBER_OF_VOLUMES_PER_AXIS}}, volume);
99 auto volumeH = ::exahype2::fv::getVolumeSize( marker.h(), {{NUMBER_OF_VOLUMES_PER_AXIS}});
101 """ + operation_per_point +
"""
103 index += {{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}};
105 logTraceOut( "touchCellFirstTime(...)" );
114 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_LAST_TIME:
116 self.
_solver._init_dictionary_with_default_parameters(d)
117 self.
_solver.add_entries_to_text_replacement_dictionary(d)
118 d[
"PREDICATE" ] = jinja2.Template(self.
guard, undefined=jinja2.DebugUndefined).render(**d)
119 result = jinja2.Template(self.
_compute_kernel, undefined=jinja2.DebugUndefined).render(**d)
125 return __name__.replace(
".py",
"").replace(
".",
"_")
PreprocessSolution differs from other action sets, as I only create it once.
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
__init__(self, solver)
solver: ADERDG Reference to creating class
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
Run over solution volume by volume.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
__init__(self, solver)
solver: ADERDG Reference to creating class
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
add_postprocessing_kernel(self, operation_per_point)
Add a code snippet which is applied to each and every point.