Peano
Loading...
Searching...
No Matches
exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta Class Reference

Fourth-order central Finite Differences with explicit Runge-Kutta time stepping, realised over a block-structured mesh. More...

Inheritance diagram for exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta:
Collaboration diagram for exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta:

Data Structures

class  RightHandSideKernel
 The kernels which evaluate the right-hand side,. More...

Public Member Functions

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.
 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.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.

Data Fields

 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

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

 _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.

Private Member Functions

 __create_data_structures (self)
 Create the mesh data structures this numerical scheme requires.
 __add_max_eigenvalue_reduction (self)
 Let the generated abstract solver class host the maximum eigenvalue of a time step.
 __add_data_to_repository (self, peano_project)
 Add the data from __create_data_structures() to the Peano 4 project and configure their generators.
 __create_kernels (self, peano4_project)
 Translate the DSLHyPE kernels into C++.
 __construct_kernel_call (self, function_name, additional_arguments)
 Construct the call of a generated kernel.

Additional Inherited Members

Protected Attributes inherited from exahype2.api.Solver.Solver.NumericalScheme
 _solver = solver
Solver.NumericalScheme.NumericalSchemeGenerator _generator = None

Detailed Description

Fourth-order central Finite Differences with explicit Runge-Kutta time stepping, realised over a block-structured mesh.

Each mesh cell hosts a patch of patch_size^d grid cells. The unknowns sit in the grid cells' centres. The scheme evaluates the right-hand side of

\( \\partial _t Q = F(Q) \)

through fourth-order central differences (exahype2.api.rkfd4.FD4Kernels), and integrates in time with the explicit Runge-Kutta scheme from exahype2.api.rungekutta.ButcherTableau. The stencils reach two grid cells into the neighbouring patches, i.e. the halo is HALO_SIZE=2 grid cells wide:

The script central-differences-with-runge-kutta-illustrations.py next to this file generates the illustrations of this page.

Usage

The scheme plugs into an exahype2.api.Solver like the Finite Volumes of exahype2.api.fv, but with the grid construction and the plotter of exahype2.api.rkfd4:

solver.numerical_scheme = exahype2.api.rkfd4.CentralDifferencesWithRungeKutta(solver, patch_size=9, rk_order=4)
solver.grid_construction = exahype2.api.rkfd4.SetupSimulationOverRegularGrid(solver, volume_size=0.01)
solver.plotter = exahype2.api.rkfd4.PlotAsVTKFile(solver, time_in_between_plots=0.1)
Fourth-order central Finite Differences with explicit Runge-Kutta time stepping, realised over a bloc...
Plotting counterpart of the fourth-order Finite Differences with Runge-Kutta time stepping (exahype2....
Setup phase of the fourth-order Finite Differences with Runge-Kutta time stepping (exahype2....

The solver can have a Flux, a NonconservativeProduct and a VolumetricSource. It needs an InitPointWisely term, a MaxEigenvalue term unless the time step size is fixed, and either a DirichletBoundaryConditions or a SommerfeldBoundaryConditions term unless all axes are periodic (exahype2.api.blockstructured.BoundaryConditions.get_boundary_conditions()). Sommerfeld conditions also require a MaxEigenvalue term, and a Butcher tableau whose stage time stamps do not decrease. Convergence Tests (Euler Equations) demonstrates fourth-order convergence for the Euler equations.

Extending the scheme

The scheme has no artificial dissipation. Subclasses can add further terms to the right-hand side:

  • _right_hand_side_action_sets() returns the action sets of the task which evaluates the right-hand side of one stage. Subclasses can append action sets which add their terms to the stage's estimate. They run after the right-hand side kernel, within the same task.
  • Subclasses which need wider stencils override HALO_SIZE.

exagrype.api.FD4WithKODissipation adds the Kreiss-Oliger dissipation this way.

Right-hand side kernels

The constructor's argument right_hand_side_kernel selects how the scheme evaluates the right-hand side (CentralDifferencesWithRungeKutta.RightHandSideKernel):

  • CentralDifferences: all derivatives through fourth-order central differences (exahype2.api.rkfd4.FD4Kernels). This is the default.
  • CentralDifferencesWithLopsidedAdvection: the central differences plus advection terms \( v_d \\partial _d Q_q \), which a separate kernel discretises through lopsided (upwind-biased) fourth-order stencils (exahype2.fd.addLopsidedAdvection()). The kernel runs after the central differences within each Runge-Kutta stage. You specify the velocity v, which has to be part of Q, and the advected quantities q. The PDE terms of the solver must not contain these advection terms themselves. As the lopsided stencils reach three grid cells into the neighbouring patches, the halo is three grid cells wide.

Data flow

__create_data_structures() documents the data per mesh cell and face. Per time step, the scheme runs through the Runge-Kutta stages k=0,...,s-1. Stage k

  1. reconstructs its input \( Y_k \) with a halo (solver._patch_with_halo). The interior is solver._patch for the first stage and solver._stage_input for all others, the halo is taken from the faces (solver._patch_overlap_current_time_step);
  2. evaluates the right-hand side \( K_k = F(Y_k) \) and stores it in the stage's slot of solver._rhs_estimates;
  3. computes the input of the next stage \( Y_{k+1} = Q^n + \\Delta t \\sum _{j \\leq k} a_{k+1,j} K_j \) into solver._stage_input and projects it onto the faces, so the neighbours can reconstruct their halo from it in the next stage.

The last stage computes \( Q^{n+1} = Q^n + \\Delta t \\sum _k b_k K_k \) instead, i.e. it overwrites solver._patch, and projects the new solution onto the faces, where the first stage of the next time step picks it up.

As the reconstruction of a stage reads the face data the previous stage has written, the task graph compiler maps each stage onto a mesh traversal of its own (peano4.api.taskgraph.compiler.FuseSteps). For a second-order Runge-Kutta scheme with Dirichlet boundary conditions, the time step's task graph reads:

The boundary values are evaluated at the time stamp of the respective stage, i.e. at \( t^n + c_k \\Delta t \). Otherwise, the scheme would drop to first order along the boundary.

Time step sizes

If you pass a time_step_size, the scheme uses this fixed time step size. Otherwise, it derives the time step size from the maximum eigenvalue of the solution after each time step through the CFL condition with cfl_constant (exahype2.api.rkfd4.actionsets.ComputeTimeStepSize). This requires a MaxEigenvalue PDE term, with or without state.

Definition at line 94 of file CentralDifferencesWithRungeKutta.py.

Constructor & Destructor Documentation

◆ __init__()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__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.

It does not add the data to the solver's Peano 4 project yet, but it assigns them to the solver, so anybody else working against this solver, such as the grid construction or the plotter, finds them there.

Parameters
solverexahype2.api.Solver The solver this numerical scheme realises.
patch_sizeint Number of grid cells per axis within one patch, i.e. within one mesh cell. Has to be at least HALO_SIZE, as the projection onto the faces takes the HALO_SIZE outermost layers of the patch.
rk_orderint Order of the Runge-Kutta scheme, i.e. its number of stages. Has to be between one and four, exahype2.api.rungekutta.ButcherTableau.
time_step_sizefloat or None Fixed time step size. If None, the time step size is adaptive.
cfl_constantfloat CFL constant for adaptive time step sizes. It scales the time step size h / (d lambda_max), with h the grid cell size, d the dimension and lambda_max the maximum eigenvalue. Ignored if time_step_size is set. Fourth-order central differences with the classic fourth-order Runge-Kutta scheme are stable up to roughly two for linear advection without dissipation, so 0.5 is a conservative default.
right_hand_side_kernelCentralDifferencesWithRungeKutta.RightHandSideKernel The kernel which evaluates the right-hand side,
See also
the class documentation.
Parameters
advection_velocitystr or List[str or int] or None Only for CentralDifferencesWithLopsidedAdvection: the entries of Q which hold the advection velocity, one per dimension. Pass the name of a variable with one entry per dimension (e.g. "shift" for exagrype.api.FOCCZ4Solver), or a list of names or indices. The velocity may be an auxiliary variable.
advected_quantitiesList[str or int] or None Only for CentralDifferencesWithLopsidedAdvection: the unknowns which are advected, as names of variables or indices of entries,
See also
exahype2.api.rkfd4.Quantities.resolve_quantities().
Parameters
min_volume_sizefloat The time step asks for a refinement of a cell only if its grid cells are at least of this size (exahype2.api.blockstructured.DynamicMeshRefinement). None (the default) does not bound the refinement.
max_volume_sizefloat The time step asks for an erase, i.e. coarsening, of a cell only if the grid cells of the coarser cell would be strictly smaller than this size. None (the default) does not bound the coarsening.
interpolationtoolbox.blockstructured.api.InterpolateHangingFaces.Scheme How the scheme initialises the halo of a fine patch next to a coarser patch on an adaptive mesh. Whenever a Runge-Kutta stage reconstructs the halo of a fine cell, it interpolates the data of the adjacent coarse face onto the fine cell's hanging face (toolbox.blockstructured.api.InterpolateHangingFaces). The default is linear interpolation.
restrictiontoolbox.blockstructured.api.RestrictHangingFaces.Scheme How the scheme hands the data of fine patches over to an adjacent coarser patch. Whenever the fine cells project their data onto their faces, the scheme restricts the data of the hanging faces onto the coarse face (toolbox.blockstructured.api.RestrictHangingFaces). The default is averaging.

On a regular mesh, there are no hanging faces, and the two schemes are never used. At resolution transitions, the halo of a fine patch is only as accurate as the interpolation, i.e. the scheme drops to low order there.

Definition at line 234 of file CentralDifferencesWithRungeKutta.py.

References __init__().

Referenced by __init__().

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

Member Function Documentation

◆ __add_data_to_repository()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__add_data_to_repository ( self,
peano_project )
private

Add the data from __create_data_structures() to the Peano 4 project and configure their generators.

Only _patch_overlap_current_time_step is exchanged between ranks, and only on the faces the solver's grid selector holds for. The task graph compiler uses, loads and stores data only where the solver's grid selector holds, too (peano4.api.datamodel.DoF).

Definition at line 631 of file CentralDifferencesWithRungeKutta.py.

References _patches(), exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, _solver, exagrype.api.FD4WithKODissipation.FD4WithKODissipation.HALO_SIZE, HALO_SIZE, has_adaptive_time_step_size, exagrype.api.scalarfield.FiniteVolumesInnerCoupling._FiniteVolumes.patch_size, exagrype.api.scalarfield.InnerCouplingGenerator.InnerCouplingGenerator.patch_size, exagrype.api.scalarfield.RungeKuttaFD4InnerCoupling._RungeKuttaFD4.patch_size, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement.patch_size, exahype2.api.fv.actionsets.ComputeGlobalCFLCondition.ComputeGlobalCFLCondition.patch_size, exahype2.api.fv.actionsets.InsertPatchInterior.InsertPatchInterior.patch_size, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.patch_size, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.patch_size, exahype2.api.rkfd4.actionsets.ComputeTimeStepSize.ComputeTimeStepSize.patch_size, and patch_size.

Referenced by construct_output().

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

◆ __add_max_eigenvalue_reduction()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__add_max_eigenvalue_reduction ( self)
private

Let the generated abstract solver class host the maximum eigenvalue of a time step.

The class collects the maximum over all patches and threads. This is a reduction over the whole mesh, hence it belongs to the solver and not to a cell. Reading and resetting it is one operation, as the patches contribute in a different traversal than the one that derives the time step size from it.

Definition at line 573 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, and _solver.

◆ __construct_kernel_call()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__construct_kernel_call ( self,
function_name,
additional_arguments )
private

Construct the call of a generated kernel.

The kernel takes a exahype2.CellData called patchData, the additional arguments and one functor per PDE term the solver has, in the order flux, nonconservativeProduct, volumetricSource, maxEigenvalue (see __create_kernels()). Each functor forwards to the solver instance.

If PDE terms are registered both with and without state, the generated code asks cellCanUseStatelessPDETerms() before it invokes the kernel, and hands over the stateless variants if it returns true. This logic is a copy of the one of exahype2.api.fv, as rkfd4 does not depend on the Finite Volume package.

Parameters
function_namestr Unqualified name of the kernel.
additional_arguments[str] C++ expressions passed after patchData.

Definition at line 841 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, and _solver.

Referenced by construct_output().

Here is the caller graph for this function:

◆ __create_data_structures()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__create_data_structures ( self)
private

Create the mesh data structures this numerical scheme requires.

All of them are assigned to self._solver rather than self, so the solver's grid construction and plotter, as well as the action sets, find them there:

  • _patch: the solution \( Q^n \), i.e. patch_size^d grid cells per mesh cell, with the unknowns and the auxiliary variables per grid cell.
  • _stage_input: the input \( Y_k \) of the next Runge-Kutta stage, with the same layout as _patch. It is written at the end of one stage and read by the next one.
  • _patch_with_halo: the input of the current Runge-Kutta stage with its halo, i.e. (patch_size+2*HALO_SIZE)^d grid cells, reconstructed from _patch or _stage_input and the faces (see toolbox.blockstructured.api.ReconstructPatchWithHalo). It is logically temporary.
  • _rhs_estimates: the right-hand side estimates \( K_k \) of all rk_order stages. They hold the unknowns only, as the auxiliary variables do not evolve in time. The estimates of the stages are stored one after the other, i.e. as rk_order patches of patch_size^d grid cells each. This is why the first dimension is rk_order*patch_size.
  • _patch_overlap_current_time_step: the face data the halo is reconstructed from, i.e. 2*HALO_SIZE layers along the face's normal. The face data are exchanged between ranks.
  • _patch_overlap_update: the projection of the patches onto the faces which the current sweep accumulates (exahype2.api.rkfd4.actionsets.ProjectPatchOntoFaces). It is rolled over into _patch_overlap_current_time_step once complete (exahype2.api.rkfd4.actionsets.RollOverUpdatedFace).
  • _max_eigenvalue: only with adaptive time step sizes. One double per cell, named after the solver followed by MaxEigenvalue. It holds the maximum eigenvalue of the patch after the last time step. It is modelled via DaStGen2 as array of cardinality one on the heap (peano4.api.dastgen2.Peano4SmartPointerDoubleArray). A task of its own reduces it into the generated abstract solver class (reduceMaxEigenvalue()), and the global time step size computation reads and resets the outcome (getAndResetMaxEigenvalue()). It thus works on this global datum only, i.e. it is a task that acts at the end of the time step (peano4.api.taskgraph.Task.Task.GridEntity).

All patches use smart pointers (peano4.api.datamodel.PatchToDoubleArrayWithSmartPointer), like the Finite Volumes of exahype2.api.fv. The legacy exahype2.solvers.rkfd.CellCenteredFiniteDifferences held a third face overlap with the data of the previous time step. It is required for AMR and local time stepping only, so we do not create it.

Definition at line 472 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, _solver, exagrype.api.FD4WithKODissipation.FD4WithKODissipation.HALO_SIZE, HALO_SIZE, exagrype.api.scalarfield.FiniteVolumesInnerCoupling._FiniteVolumes.patch_size, exagrype.api.scalarfield.InnerCouplingGenerator.InnerCouplingGenerator.patch_size, exagrype.api.scalarfield.RungeKuttaFD4InnerCoupling._RungeKuttaFD4.patch_size, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement.patch_size, exahype2.api.fv.actionsets.ComputeGlobalCFLCondition.ComputeGlobalCFLCondition.patch_size, exahype2.api.fv.actionsets.InsertPatchInterior.InsertPatchInterior.patch_size, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.patch_size, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.patch_size, exahype2.api.rkfd4.actionsets.ComputeTimeStepSize.ComputeTimeStepSize.patch_size, patch_size, exagrype.api.scalarfield.RungeKuttaFD4InnerCoupling._RungeKuttaFD4.rk_order, and rk_order.

◆ __create_kernels()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__create_kernels ( self,
peano4_project )
private

Translate the DSLHyPE kernels into C++.

The kernels end up in the kernels/ subdirectory of output_directory:

  • {SolverName}_fd4_2d.h/.cpph and {SolverName}_fd4_3d.h/.cpph hold the right-hand side (exahype2.api.rkfd4.FD4Kernels).
  • {SolverName}_fd4_eigenvalue_2d.h/.cpph and {SolverName}_fd4_eigenvalue_3d.h/.cpph hold the maximum eigenvalue over a patch. They exist only with adaptive time step sizes.
  • {SolverName}_fd4.h includes the variants for the dimension the code is compiled for.
  • rungekutta_linear_combination.h/.cpph holds the linear combination of the Runge-Kutta estimates (exahype2.api.rungekutta.LinearCombination).

Calling this function is delayed until all PDE term information is provided, as the kernels contain only the PDE terms the solver has.

Definition at line 703 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, _solver, has_adaptive_time_step_size, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.kernel_namespace, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.kernel_namespace, kernel_namespace, max_eigenvalue_kernel_name(), and right_hand_side_kernel_name().

Referenced by construct_output().

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

◆ _patches()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta._patches ( self)
protected

All patches of this numerical scheme, i.e.

all data besides the maximum eigenvalue.

Definition at line 617 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, and _solver.

Referenced by __add_data_to_repository().

Here is the caller graph for this function:

◆ _right_hand_side_action_sets()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta._right_hand_side_action_sets ( self,
stage,
cell_guard )
protected

Action sets of the task which evaluates the right-hand side of one stage.

The task reads solver._patch_with_halo, i.e. the stage's input with its halo, and writes the stage's slot of solver._rhs_estimates. By default, it holds one action set, which invokes the fourth-order Finite Differences kernel. Subclasses can append action sets which add further terms to the estimate. The action sets of one task run one after the other, in the order of the list. For the kernel CentralDifferencesWithLopsidedAdvection, the list holds the lopsided advection as second action set.

Parameters
stageint Number of the Runge-Kutta stage, starting with zero.
cell_guardstr C++ boolean expression, evaluated per cell.
Returns
List[peano4.api.solversteps.ActionSet]

Reimplemented in exagrype.api.FD4WithKODissipation.FD4WithKODissipation.

Definition at line 431 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, _solver, and right_hand_side_kernel.

◆ construct_output()

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.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.Solver.Solver.NumericalScheme.

Reimplemented in 20_additional-solver-steps.RungeKuttaWithDensityFloor.

Definition at line 979 of file CentralDifferencesWithRungeKutta.py.

References exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.__add_data_to_repository(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__add_data_to_repository(), __add_data_to_repository(), exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator.__construct_kernel_call(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__construct_kernel_call(), __construct_kernel_call(), __create_kernels(), exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, _solver, advection_velocity, butcher_tableau, has_adaptive_time_step_size, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.kernel_namespace, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.kernel_namespace, kernel_namespace, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.max_eigenvalue_kernel_call, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.max_eigenvalue_kernel_call, max_eigenvalue_kernel_call, max_eigenvalue_kernel_name(), and right_hand_side_kernel_name().

Here is the call graph for this function:

◆ create_default_mesh_adaptation()

Solver.MeshAdaptation exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.create_default_mesh_adaptation ( self)

The finite differences adapt the mesh and balance the load through exahype2.api.rkfd4.AdaptMeshAndBalanceLoad by default.

Reimplemented from exahype2.api.Solver.Solver.NumericalScheme.

Definition at line 946 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, and _solver.

◆ create_restriction_of_hanging_faces()

"toolbox.blockstructured.api.RestrictHangingFaces" exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.create_restriction_of_hanging_faces ( self)

Action set which restricts the projected fine data from the hanging faces onto the coarse faces.

Every task which projects the solution onto the faces has to host this action set, so the faces between coarse and fine patches hold consistent data afterwards. The task has to write all of _patch_overlap_update, as averaging clears it first.

Definition at line 957 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, _solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad.restriction, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.restriction, and restriction.

◆ halo_size()

int exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.halo_size ( self)

Width of the halo.

Alias of HALO_SIZE, as the generic parts of exahype2.api expect this name.

Definition at line 222 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation.HALO_SIZE, and HALO_SIZE.

◆ has_adaptive_time_step_size()

bool exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.has_adaptive_time_step_size ( self)

◆ max_eigenvalue_kernel_name()

str exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.max_eigenvalue_kernel_name ( self)

Definition at line 428 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, and _solver.

Referenced by __create_kernels(), and construct_output().

Here is the caller graph for this function:

◆ overlap()

int exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.overlap ( self)

Width of the halo, i.e.

number of grid cells each face holds per adjacent patch. Always HALO_SIZE.

Definition at line 403 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation.HALO_SIZE, and HALO_SIZE.

◆ right_hand_side_kernel_name()

str exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.right_hand_side_kernel_name ( self)

Name of the generated right-hand side kernel.

It carries the solver name, as do the kernels/{SolverName}_fd4*.h files holding it, so two solvers' kernels do not clash.

Definition at line 419 of file CentralDifferencesWithRungeKutta.py.

References exagrype.api.FD4WithKODissipation.FD4WithKODissipation._solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.blockstructured.ConsumeRefinementRequests.ConsumeRefinementRequests._solver, exahype2.api.blockstructured.DynamicMeshRefinement.DynamicMeshRefinement._solver, exahype2.api.blockstructured.LoadCheckpoint._LoadPatchesFromCheckpoint._solver, exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint._solver, exahype2.api.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet._solver, exahype2.api.fv.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.fv.actionsets.DiscardPatchInterior.DiscardPatchInterior._solver, exahype2.api.fv.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, exahype2.api.fv.PlotAsVTKFile.PlotAsVTKFile._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler._solver, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEulerGenerator._solver, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler._solver, exahype2.api.fv.SetupSimulationOverRegularGrid.SetupSimulationOverRegularGrid._solver, exahype2.api.fv.SetupSimulationWithUserCodedRefinementCriterion.SetupSimulationWithUserCodedRefinementCriterion._solver, exahype2.api.fv.WriteCheckpoint.WriteCheckpoint._solver, exahype2.api.rkfd4.actionsets.AbstractRKFD4ActionSet.AbstractRKFD4ActionSet._solver, exahype2.api.rkfd4.actionsets.ApplyDirichletBoundaryConditions.ApplyDirichletBoundaryConditions._solver, exahype2.api.rkfd4.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad._solver, and _solver.

Referenced by __create_kernels(), and construct_output().

Here is the caller graph for this function:

◆ rk_order()

int exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.rk_order ( self)

Definition at line 411 of file CentralDifferencesWithRungeKutta.py.

References butcher_tableau.

Field Documentation

◆ advected_quantities

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.advected_quantities = resolve_quantities(solver, advected_quantities)

◆ advection_velocity

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.advection_velocity = resolve_quantities(solver, advection_velocity)

Definition at line 367 of file CentralDifferencesWithRungeKutta.py.

Referenced by construct_output().

◆ butcher_tableau

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.butcher_tableau = ButcherTableau(rk_order)

Definition at line 393 of file CentralDifferencesWithRungeKutta.py.

Referenced by construct_output(), and rk_order().

◆ cfl_constant

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.cfl_constant = cfl_constant

Definition at line 395 of file CentralDifferencesWithRungeKutta.py.

◆ HALO_SIZE

int exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.HALO_SIZE = 2
static

Width of the halo.

Subclasses with wider stencils override it.

Definition at line 219 of file CentralDifferencesWithRungeKutta.py.

Referenced by __add_data_to_repository(), __create_data_structures(), halo_size(), and overlap().

◆ has_adaptive_time_step_size

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.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).

Definition at line 562 of file CentralDifferencesWithRungeKutta.py.

Referenced by __add_data_to_repository(), __create_kernels(), and construct_output().

◆ interpolation

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.interpolation = interpolation

Definition at line 330 of file CentralDifferencesWithRungeKutta.py.

◆ kernel_namespace

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.kernel_namespace = None

Definition at line 398 of file CentralDifferencesWithRungeKutta.py.

Referenced by __create_kernels(), and construct_output().

◆ max_eigenvalue_kernel_call

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.max_eigenvalue_kernel_call = None

Definition at line 399 of file CentralDifferencesWithRungeKutta.py.

Referenced by construct_output().

◆ max_volume_size

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.max_volume_size = max_volume_size

Definition at line 392 of file CentralDifferencesWithRungeKutta.py.

◆ min_volume_size

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.min_volume_size = min_volume_size

Definition at line 391 of file CentralDifferencesWithRungeKutta.py.

◆ patch_size

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.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).

Definition at line 385 of file CentralDifferencesWithRungeKutta.py.

Referenced by __add_data_to_repository(), and __create_data_structures().

◆ restriction

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.restriction = restriction

◆ right_hand_side_kernel

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.right_hand_side_kernel = right_hand_side_kernel

Definition at line 356 of file CentralDifferencesWithRungeKutta.py.

Referenced by _right_hand_side_action_sets().

◆ rk_order

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.rk_order

Definition at line 1132 of file CentralDifferencesWithRungeKutta.py.

Referenced by __create_data_structures().

◆ time_step_size

exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.time_step_size = time_step_size

Definition at line 394 of file CentralDifferencesWithRungeKutta.py.

Referenced by has_adaptive_time_step_size().


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