Peano
Loading...
Searching...
No Matches
exagrype.api.FD4WithKODissipation.FD4WithKODissipation Class Reference

Fourth-order Finite Differences with Kreiss-Oliger dissipation. More...

Inheritance diagram for exagrype.api.FD4WithKODissipation.FD4WithKODissipation:
Collaboration diagram for exagrype.api.FD4WithKODissipation.FD4WithKODissipation:

Public Member Functions

 __init__ (self, exahype2.api.Solver solver, int patch_size, int rk_order, float kreiss_oliger_sigma, List[Union[str, int]] quantities=None, float time_step_size=None, float cfl_constant=0.5, exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel right_hand_side_kernel=exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel.CentralDifferences, advection_velocity=None, advected_quantities=None)
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.
 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

 kreiss_oliger_sigma = kreiss_oliger_sigma
tuple dissipative_quantities
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

Protected Member Functions

 _right_hand_side_action_sets (self, stage, cell_guard)
 The plain right-hand side of the superclass, followed by the dissipation.
Protected Member Functions inherited from exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta
 _patches (self)
 All patches of this numerical scheme, i.e.

Additional Inherited Members

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 Attributes inherited from exahype2.api.Solver.Solver.NumericalScheme
 _solver = solver
Solver.NumericalScheme.NumericalSchemeGenerator _generator = None

Detailed Description

Fourth-order Finite Differences with Kreiss-Oliger dissipation.

The numerical scheme is exahype2.api.rkfd4.CentralDifferencesWithRungeKutta plus a Kreiss-Oliger dissipation of sixth order on top: Per Runge-Kutta stage, it first evaluates the plain fourth-order right-hand side and then adds

\( \\frac{\\sigma}{64 \\Delta x_d} (Q_{i-3} - 6 Q_{i-2} + 15 Q_{i-1} - 20 Q_i + 15 Q_{i+1} - 6 Q_{i+2} + Q_{i+3}) \)

per axis d to the selected quantities (exagrype.api.actionsets.AddKreissOligerDissipation). Both kernels read the same stage input, i.e. the outcome is the right-hand side with dissipation. The dissipation stencil reaches three grid cells into the neighbouring patches, so the scheme widens the halo from two to three grid cells. Everything else is inherited.

To use the dissipation, replace the numerical scheme of a solver:

solver.numerical_scheme = exagrype.api.FD4WithKODissipation(solver, patch_size=9, rk_order=4, kreiss_oliger_sigma=8.0)
solver.grid_construction = exahype2.api.rkfd4.SetupSimulationOverRegularGrid(solver, volume_size=0.04)
solver.plotter = exahype2.api.rkfd4.PlotAsVTKFile(solver, time_in_between_plots=0.1)
Fourth-order Finite Differences with Kreiss-Oliger dissipation.
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 grid construction and the plotter remain those of exahype2.api.rkfd4. The legacy ExaGRyPE runs used kreiss_oliger_sigma=8.0. The scheme is three-dimensional only, as it relies on exagrype.ccz4.addKreissOligerDissipation().

Definition at line 13 of file FD4WithKODissipation.py.

Constructor & Destructor Documentation

◆ __init__()

exagrype.api.FD4WithKODissipation.FD4WithKODissipation.__init__ ( self,
exahype2.api.Solver solver,
int patch_size,
int rk_order,
float kreiss_oliger_sigma,
List[Union[str, int]] quantities = None,
float time_step_size = None,
float cfl_constant = 0.5,
exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel right_hand_side_kernel = exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel.CentralDifferences,
advection_velocity = None,
advected_quantities = None )
Parameters
solverexahype2.api.Solver The solver this numerical scheme realises.
patch_sizeint Number of grid cells per axis within one patch. Has to be at least HALO_SIZE=3.
rk_orderint Order of the Runge-Kutta scheme, i.e. its number of stages.
kreiss_oliger_sigmafloat Scaling of the Kreiss-Oliger dissipation. Has to be non-negative.
quantitiesList[str or int] or None The unknowns which are subject to the dissipation. None, the default, selects all unknowns. A string is the name of an unknown as passed to the solver (e.g. "lapse" or "G" for exagrype.api.FOCCZ4Solver) and selects all of its entries. An int is the index of one entry of the unknowns. Auxiliary variables do not evolve in time and hence cannot be selected.
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.
right_hand_side_kernelexahype2.api.rkfd4.CentralDifferencesWithRungeKutta.RightHandSideKernel The kernel which evaluates the right-hand side before the dissipation is added,
See also
exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.
Parameters
advection_velocitystr or List[str or int] or None Only for lopsided advection,
See also
exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.
Parameters
advected_quantitiesList[str or int] or None Only for lopsided advection,
See also
exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.

Definition at line 49 of file FD4WithKODissipation.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

◆ _right_hand_side_action_sets()

exagrype.api.FD4WithKODissipation.FD4WithKODissipation._right_hand_side_action_sets ( self,
stage,
cell_guard )
protected

The plain right-hand side of the superclass, followed by the dissipation.

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

Definition at line 127 of file FD4WithKODissipation.py.

References _right_hand_side_action_sets().

Referenced by _right_hand_side_action_sets().

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

Field Documentation

◆ dissipative_quantities

exagrype.api.FD4WithKODissipation.FD4WithKODissipation.dissipative_quantities
Initial value:
= (
list(range(solver.unknowns))
if quantities is None
else exahype2.api.rkfd4.Quantities.resolve_quantities(solver, quantities)
)

Definition at line 121 of file FD4WithKODissipation.py.

◆ kreiss_oliger_sigma

exagrype.api.FD4WithKODissipation.FD4WithKODissipation.kreiss_oliger_sigma = kreiss_oliger_sigma

Definition at line 120 of file FD4WithKODissipation.py.


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