3from .AbstractADERDGActionSet
import AbstractADERDGActionSet
6import peano4.solversteps
10 _Template_InitialCondition =
"""
12 logTraceIn("touchCellFirstTime(...)---InitialCondition");
13 int linearisedIndex = 0;
15 {% if INITIALISE_PATCHES is sameas True %}
16 repositories::{{SOLVER_INSTANCE}}.initialCondition(
17 fineGridCell{{UNKNOWN_IDENTIFIER}}.value,
21 {{GRID_IS_CONSTRUCTED}}
24 dfor(index, {{ORDER}} + 1) {
25 repositories::{{SOLVER_INSTANCE}}.initialCondition(
26 fineGridCell{{UNKNOWN_IDENTIFIER}}.value + linearisedIndex,
27 ::exahype2::dg::getQuadraturePoint(
31 repositories::{{SOLVER_INSTANCE}}.Order + 1,
32 kernels::{{SOLVER_NAME}}::Quadrature<{{SOLUTION_STORAGE_PRECISION}}>::nodes
36 {{GRID_IS_CONSTRUCTED}}
38 linearisedIndex += {{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}};
43 constexpr int SpaceBasisSize = {{ORDER+1}} * {{ORDER+1}} * {{NUMBER_OF_UNKNOWNS+NUMBER_OF_AUXILIARY_VARIABLES}};
45 constexpr int SpaceBasisSize = {{ORDER+1}} * {{ORDER+1}} * {{ORDER+1}} * {{NUMBER_OF_UNKNOWNS+NUMBER_OF_AUXILIARY_VARIABLES}};
48 std::copy_n(fineGridCell{{UNKNOWN_IDENTIFIER}}.value, SpaceBasisSize, fineGridCell{{UNKNOWN_IDENTIFIER}}_old.value);
50 {% if USE_POINT_SOURCE %}
51 repositories::{{SOLVER_INSTANCE}}.initPointSourceLocations(repositories::{{SOLVER_INSTANCE}}.pointSourceLocation);
54 const double timeStamp = 0.0;
55 const double timeStepSize = 0.0;
56 {{SOLUTION_STORAGE_PRECISION}}* luh = fineGridCell{{UNKNOWN_IDENTIFIER}}.value;
57 {{COMPUTE_NEW_TIME_STEP_SIZE}}
59 // Relevant for tracing et al which kicks in if and only if cell has been updated
60 fineGridCell{{SOLVER_NAME}}CellLabel.setHasUpdated(true);
62 logTraceOut("touchCellFirstTime(...)---InitialCondition");
66 def __init__(self, solver, guard, grid_is_constructed):
67 super(InitialCondition, self).
__init__(solver)
76 == peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
79 self.
_solver._init_dictionary_with_default_parameters(d)
80 self.
_solver.add_entries_to_text_replacement_dictionary(d)
81 d[
"PREDICATE"] = self.
_guard
88 return __name__.replace(
".py",
"").replace(
".",
"_")
99 +
"""/MaxScaledEigenvalue.h"
__init__(self, solver, guard, grid_is_constructed)
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
str _Template_InitialCondition
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_includes(self)
Return include statements that you need.