Peano
Loading...
Searching...
No Matches
20_additional-solver-steps.RungeKuttaWithDensityFloor Class Reference

Runge-Kutta Finite Differences which insert the density floor after each stage. More...

Inheritance diagram for 20_additional-solver-steps.RungeKuttaWithDensityFloor:
Collaboration diagram for 20_additional-solver-steps.RungeKuttaWithDensityFloor:

Public Member Functions

 construct_output (self, exahype2_project, peano_project, time_step, add_global_tasks=True)
 Add the data to the Peano 4 project, generate the kernels and add the tasks of one Runge-Kutta step to time_step.
Public Member Functions inherited from exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta
int halo_size (self)
 Width of the halo.
 __init__ (self, Solver solver, int patch_size, int rk_order, float time_step_size=None, float cfl_constant=0.5, "CentralDifferencesWithRungeKutta.RightHandSideKernel" right_hand_side_kernel=RightHandSideKernel.CentralDifferences, advection_velocity=None, advected_quantities=None, float min_volume_size=None, float max_volume_size=None, "toolbox.blockstructured.api.InterpolateHangingFaces.Scheme" interpolation=toolbox.blockstructured.api.InterpolateHangingFaces.Scheme.Linear, "toolbox.blockstructured.api.RestrictHangingFaces.Scheme" restriction=toolbox.blockstructured.api.RestrictHangingFaces.Scheme.Averaging)
 The constructor memorises the attributes and creates the data structures.
int overlap (self)
 Width of the halo, i.e.
int rk_order (self)
bool has_adaptive_time_step_size (self)
str right_hand_side_kernel_name (self)
 Name of the generated right-hand side kernel.
str max_eigenvalue_kernel_name (self)
Solver.MeshAdaptation create_default_mesh_adaptation (self)
 The finite differences adapt the mesh and balance the load through exahype2.api.rkfd4.AdaptMeshAndBalanceLoad by default.
"toolbox.blockstructured.api.RestrictHangingFaces" create_restriction_of_hanging_faces (self)
 Action set which restricts the projected fine data from the hanging faces onto the coarse faces.
Public Member Functions inherited from exahype2.api.Solver.Solver.NumericalScheme
 __init__ (self, "Solver" solver)
 wrap_task_graph_in_load_balancing_and_amr_tasks (self, time_step)
 Embed the time step's task graph into the global load balancing and AMR tasks.

Additional Inherited Members

Data Fields inherited from exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta
 interpolation = interpolation
 restriction = restriction
 right_hand_side_kernel = right_hand_side_kernel
 advection_velocity = resolve_quantities(solver, advection_velocity)
 advected_quantities = resolve_quantities(solver, advected_quantities)
 patch_size = patch_size
 The task must not run before the final roll over of the time step: Roll overs such as the Sommerfeld boundary treatment need the valid current time step size, which this task replaces (see adrs/0001-time-step-size-after-roll-over.md).
 min_volume_size = min_volume_size
 max_volume_size = max_volume_size
 butcher_tableau = ButcherTableau(rk_order)
 time_step_size = time_step_size
 cfl_constant = cfl_constant
 kernel_namespace = None
 max_eigenvalue_kernel_call = None
 has_adaptive_time_step_size
 The task must not run before the final roll over of the time step: Roll overs such as the Sommerfeld boundary treatment need the valid current time step size, which this task replaces (see adrs/0001-time-step-size-after-roll-over.md).
 rk_order
Static Public Attributes inherited from exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta
int HALO_SIZE = 2
 Width of the halo.
Static Public Attributes inherited from exahype2.api.Solver.Solver.NumericalScheme
str DYNAMIC_MESH_REFINEMENT_TASK_NAME = "Dynamic mesh refinement and load balancing"
 Name of the last task of each time step without the solver's name as prefix, i.e.
Protected Member Functions inherited from exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta
 _right_hand_side_action_sets (self, stage, cell_guard)
 Action sets of the task which evaluates the right-hand side of one stage.
 _patches (self)
 All patches of this numerical scheme, i.e.
Protected Attributes inherited from exahype2.api.Solver.Solver.NumericalScheme
 _solver = solver
Solver.NumericalScheme.NumericalSchemeGenerator _generator = None

Detailed Description

Runge-Kutta Finite Differences which insert the density floor after each stage.

Definition at line 148 of file 20_additional-solver-steps.py.

Member Function Documentation

◆ construct_output()

20_additional-solver-steps.RungeKuttaWithDensityFloor.construct_output ( self,
exahype2_project,
peano_project,
time_step,
add_global_tasks = True )

Add the data to the Peano 4 project, generate the kernels and add the tasks of one Runge-Kutta step to time_step.

Parameters
add_global_tasksbool If False, the scheme adds neither the task that switches the load balancing off nor the last task that evaluates the adaptivity criterion and switches the load balancing on again,
See also
exahype2.api.Solver.Solver.NumericalScheme.construct_output().

Per stage k, the time step holds the following tasks (see the class documentation for the data flow). Every task holds exactly one action set, with the exception of the reconstruction of the unknowns, which also holds the interpolation onto the hanging faces, and the reconstruction of several sets of auxiliary variables. This is deliberate: the task graph compiler runs the action sets of independent tasks in parallel only if each task holds one action set (peano4.api.taskgraph.compiler.FuseSteps). Where the scheme needs several action sets in a row, it hence creates a chain of tasks. If several solvers share a task graph, their chains overlap.

  • {SolverName}_Disable load balancing: switches the load balancing off throughout the time step. Added last by wrap_task_graph_in_load_balancing_and_amr_tasks(), which makes all tasks without predecessor wait for it.
  • {SolverName}_Apply Dirichlet BCs stage k: sets the ghost grid cells along the domain boundary for Dirichlet boundary conditions. The task does not exist if all axes are periodic, or for Sommerfeld boundary conditions, which advance the ghost grid cells within the roll over of the projection onto the faces.
  • {SolverName}_Reconstruct stage k: interpolates the coarse face data onto the hanging faces and reconstructs the stage's input with its halo. Interpolation is no task of its own.
  • {SolverName}_Reconstruct auxiliary variables stage k: reconstructs the halos of the auxiliary variables. Exists only if the solver has auxiliary variables. Sets which are stationary throughout the time step (exahype2.api.AuxiliaryVariables.Mode.STATIONARY_THROUGHOUT_TIME_STEPS_ON_FACES) have this task in the first stage only: The right-hand-side tasks hold their halo as persistent cell data until the last stage discards it.
  • {SolverName}_Evaluate Runge-Kutta right hand side stage k. Where the right-hand side has further terms (_right_hand_side_action_sets()), each term adds a task behind it, e.g. {SolverName}_Add lopsided advection stage k.
  • {SolverName}_Prepare stage k+1, or {SolverName}_Complete time step after the last stage: computes the linear combination of the estimates. Prepare stage k+1 is tagged with exahype2.api.Solver.IntermediateSolutionUpdateTag, Complete time step with exahype2.api.Solver.SolutionUpdateTaskTag, i.e. postprocessing such as the enforcement of constraints can be inserted directly after them (see page_exahype2_solver_manipulate_solver_steps).
  • {SolverName}_Compute max eigenvalue: determines the maximum eigenvalue of the new solution. Exists after the last stage for adaptive time stepping only.
  • {SolverName}_Project stage k+1 onto faces, or {SolverName}_Project solution onto faces after the last stage: projects the outcome of the linear combination onto the faces and restricts the hanging faces onto the coarse faces.
  • {SolverName}_Roll over stage k+1 faces, or {SolverName}_Roll over solution faces. The projection (with the restriction) and the roll over share the update patch, which is temporary, i.e. they rely on the task graph compiler to fuse them into one mesh traversal. Only the roll over writes the face data of the current time step, but the projection declares it, and the roll over declares it as temporary. If the roll over declared it, the projection would not conflict with the reconstruction, which reads the faces. The compiler would then fuse them into the traversal of the previous stage, and only the roll over would start a new traversal. The update patch does not survive such a split, and the roll over reads uninitialised data (observed as NaNs in the next stage's input). The fused traversal merges the qualifiers back into the one of the projection.

After the last stage, {SolverName}_Compute time step size determines the time step size of the next time step and advances the solver's time stamp. {SolverName}_Dynamic mesh refinement and load balancing finally evaluates the adaptivity criterion if the solver has one (exahype2.api.blockstructured.create_dynamic_mesh_refinement_action_set.create_dynamic_mesh_refinement_action_set()), switches the load balancing on again and informs it that the time step has finished.

Reimplemented from exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.

Definition at line 151 of file 20_additional-solver-steps.py.

References construct_output(), and 20_additional-solver-steps.insert_density_floor().

Referenced by construct_output().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: