4from .AbstractRungeKuttaDGActionSet
import AbstractRungeKuttaDGActionSet
14 PreprocessSolution differs from other action sets, as I only create it once. See
15 FV.create_action_sets(). Once the instance does exist, you can tailor it. But you
16 can also completely overwrite it.
20 super(EmptyPreprocessSolution,self).
__init__(solver)
32 return __name__.replace(
".py",
"").replace(
".",
"_")
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 The postprocessing plugs into touch cell last time. It is the last action set added
46 by the default implementation. Therefore, it is the first action set of which
47 touchCellLastTime() is called. The reason why I plug into the leaving of the cell
48 is that some solvers may add further action sets to the solve. Enclave tasking for
49 example adds the merger as additional action set. These action sets plug into
50 touchCellFirstTime() - and consequently their first time is called after the
51 postprocessing's first time. By making the postprocessing use touchCellLastTime(),
52 I ensure that any additional action set added by a subclass can still precede the
57 super(DoFWisePreprocessSolution,self).
__init__(solver)
66 Add a code snippet which is applied to each and every point. You have the following
67 variables which are well-defined:
69 - value: Is a pointer to the current finite volume's data
70 - x: A tarch::la::Vector over doubles
71 - marker.h(): A tarch::la::Vector over doubles
74 operation_per_point: String
80 {{COMPUTE_TIME_STEP_SIZE}}
81 const double timeStamp = fineGridCell{{SOLVER_NAME}}CellLabel.getTimeStamp();
84 not marker.hasBeenRefined()
88 logTraceIn( "touchCellFirstTime(...)" );
90 ::exahype2::enumerator::AoSLexicographicEnumerator enumerator(
94 {{NUMBER_OF_UNKNOWNS}},
95 {{NUMBER_OF_AUXILIARY_VARIABLES}}
97 dfor( index, {{DG_ORDER}}+1 ) {
98 double* values = fineGridCell{{UNKNOWN_IDENTIFIER}}.value + enumerator(0,index,0);
99 auto x = ::exahype2::dg::getQuadraturePoint(
100 marker.x(), marker.h(), index, repositories::{{SOLVER_INSTANCE}}.DGOrder, repositories::{{SOLVER_INSTANCE}}.QuadraturePoints1d
102 """ + operation_per_point +
"""
104 logTraceOut( "touchCellFirstTime(...)" );
113 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_LAST_TIME:
115 self.
_solver._init_dictionary_with_default_parameters(d)
116 self.
_solver.add_entries_to_text_replacement_dictionary(d)
117 d[
"PREDICATE" ] = jinja2.Template(self.
guard, undefined=jinja2.DebugUndefined).render(**d)
118 result = jinja2.Template(self.
_compute_kernel, undefined=jinja2.DebugUndefined).render(**d)
124 return __name__.replace(
".py",
"").replace(
".",
"_")
128 return super(DoFWisePreprocessSolution,self).
get_includes() +
"""
129#include "exahype2/enumerator/AoSLexicographicEnumerator.h"
140 super(CellWisePreprocessSolution,self).
__init__(solver)
148 Add a code snippet which is applied to each and every point. You have the following
149 variables which are well-defined:
151 - value: Is a pointer to the current finite volume's data
152 - x: A tarch::la::Vector over doubles
153 - marker.h(): A tarch::la::Vector over doubles
156 operation_per_point: String
162 {{COMPUTE_TIME_STEP_SIZE}}
163 const double timeStamp = fineGridCell{{SOLVER_NAME}}CellLabel.getTimeStamp();
166 not marker.hasBeenRefined()
170 logTraceIn( "touchCellFirstTime(...)" );
172 """ + operation_per_cell +
"""
174 logTraceOut( "touchCellFirstTime(...)" );
183 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_LAST_TIME:
185 self.
_solver._init_dictionary_with_default_parameters(d)
186 self.
_solver.add_entries_to_text_replacement_dictionary(d)
187 d[
"PREDICATE" ] = jinja2.Template(self.
guard, undefined=jinja2.DebugUndefined).render(**d)
188 result = jinja2.Template(self.
_compute_kernel, undefined=jinja2.DebugUndefined).render(**d)
194 return __name__.replace(
".py",
"").replace(
".",
"_")
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_cell)
Add a code snippet which is applied to each and every point.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
__init__(self, solver)
solver: RungeKuttaDG Reference to creating class
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: RungeKuttaDG Reference to creating class
add_postprocessing_kernel(self, operation_per_point)
Add a code snippet which is applied to each and every point.
get_includes(self)
Return include statements that you need.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
PreprocessSolution differs from other action sets, as I only create it once.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
__init__(self, solver)
solver: RungeKuttaDG 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...