4from .AbstractRungeKuttaDGActionSet
import AbstractRungeKuttaDGActionSet
14 Solve the actual Riemann problem and add stuff back to the solution.
16 See the discussion of RungeKuttaDG for a discussion regarding the individual
21 {% for PREDICATE_NO in range(0,PREDICATES|length) %}
22 if ({{PREDICATES[PREDICATE_NO]}}) {
23 // no support for local time stepping or subcycling
25 assertionNumericalEquals2(
26 {{FACE_METADATA_ACCESSOR}}.getOldTimeStamp(0),
27 {{FACE_METADATA_ACCESSOR}}.getOldTimeStamp(1),
28 {{FACE_METADATA_ACCESSOR}}.toString(),
33 // Doesn't make a difference if we pick left or right
34 const double timeStampOldSolution = {{FACE_METADATA_ACCESSOR}}.getOldTimeStamp(0);
37 // double timeStepSize
38 {{COMPUTE_TIME_STEP_SIZE}}
40 const double timeStamp = timeStampOldSolution + {{BUTCHER_TABLEAU_RELATIVE_TIME_STEP_SIZES[PREDICATE_NO]}} * timeStepSize;
42 assertion5( tarch::la::greaterEquals( timeStepSize, 0.0 ), timeStamp, timeStepSize, timeStampOldSolution, {{FACE_METADATA_ACCESSOR}}.toString(), marker.toString() );
43 assertion5( tarch::la::greaterEquals( timeStamp, 0.0 ), timeStamp, timeStepSize, timeStampOldSolution, {{FACE_METADATA_ACCESSOR}}.toString(), marker.toString() );
45 const double* __restrict__ QIn = fineGridFace{{UNKNOWN_IDENTIFIER}}EstimateProjection.value;
46 double* __restrict__ QOut = fineGridFace{{UNKNOWN_IDENTIFIER}}RiemannSolution.value;
48 ::exahype2::dg::{{KERNEL_NAMESPACE}}::{{RIEMANN_COMPUTE_KERNEL_CALL}}
56 guard_project: String (C++ code)
57 Predicate which controls if the solution is actually projected.
59 guard_safe_old_time_step: String (C++ code)
60 Predicate which controls if the projection should be copied into
61 the old solution and the time step should also be moved over.
63 super(SolveRiemannProblem,self).
__init__(solver)
71 raise Exception(
"Guards are not initialised")
77 if new_guards!=[]
and len(new_guards)!=self.
_solver.number_of_Runge_Kutta_steps():
78 raise Exception(
"Expect one guard per Runge Kutta step. Have {} steps but got guards {}".format(solver.number_of_Runge_Kutta_steps(),guards) )
84 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_FACE_FIRST_TIME:
86 self.
_solver._init_dictionary_with_default_parameters(d)
87 self.
_solver.add_entries_to_text_replacement_dictionary(d)
89 d[
"BUTCHER_TABLEAU_RELATIVE_TIME_STEP_SIZES" ] = self.
_butcher_tableau.time_step_sizes()
90 d[
"FACE_METADATA_ACCESSOR" ] =
"fineGridFace" + self.
_solver._face_label.name
97 return __name__.replace(
".py",
"").replace(
".",
"_")
101 return super(SolveRiemannProblem,self).
get_includes() +
"""
102#include "exahype2/dg/rusanov/Rusanov.h"
Solve the actual Riemann problem and add stuff back to the solution.
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.
__init__(self, solver)
guard_project: String (C++ code) Predicate which controls if the solution is actually projected.
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...