51 solver: exahype2.api.Solver,
54 kreiss_oliger_sigma: float,
55 quantities: List[Union[str, int]] =
None,
56 time_step_size: float =
None,
57 cfl_constant: float = 0.5,
58 right_hand_side_kernel: exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel = exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel.CentralDifferences,
59 advection_velocity=
None,
60 advected_quantities=
None,
64 @param solver: exahype2.api.Solver
65 The solver this numerical scheme realises.
67 @param patch_size: int
68 Number of grid cells per axis within one patch. Has to be at least
72 Order of the Runge-Kutta scheme, i.e. its number of stages.
74 @param kreiss_oliger_sigma: float
75 Scaling of the Kreiss-Oliger dissipation. Has to be non-negative.
77 @param quantities: List[str or int] or None
78 The unknowns which are subject to the dissipation. None, the
79 default, selects all unknowns. A string is the name of an unknown
80 as passed to the solver (e.g. "lapse" or "G" for exagrype.api.CCZ4Solver)
81 and selects all of its entries. An int is the index of one entry
82 of the unknowns. Auxiliary variables do not evolve in time and
83 hence cannot be selected.
85 @param time_step_size: float or None
86 Fixed time step size. If None, the time step size is adaptive.
88 @param cfl_constant: float
89 CFL constant for adaptive time step sizes.
91 @param right_hand_side_kernel: exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel
92 The kernel which evaluates the right-hand side before the
93 dissipation is added, @see
94 exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.
96 @param advection_velocity: str or List[str or int] or None
97 Only for lopsided advection, @see
98 exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.
100 @param advected_quantities: List[str or int] or None
101 Only for lopsided advection, @see
102 exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.
109 time_step_size=time_step_size,
110 cfl_constant=cfl_constant,
111 right_hand_side_kernel=right_hand_side_kernel,
112 advection_velocity=advection_velocity,
113 advected_quantities=advected_quantities,
115 if kreiss_oliger_sigma < 0.0:
117 f
"Solver {solver.name}: kreiss_oliger_sigma has to be non-negative, "
118 f
"but got {kreiss_oliger_sigma}"
122 list(range(solver.unknowns))
123 if quantities
is None
124 else exahype2.api.rkfd4.Quantities.resolve_quantities(solver, quantities)