Peano
Loading...
Searching...
No Matches
exahype2.api.Solver.Solver.NumericalScheme Class Reference

The concrete discretisation (Finite Volumes, ADER-DG, ...) realised by a Solver. More...

Inheritance diagram for exahype2.api.Solver.Solver.NumericalScheme:
Collaboration diagram for exahype2.api.Solver.Solver.NumericalScheme:

Data Structures

class  NumericalSchemeGenerator
 Specify which versions of a numerical scheme should be generated here. More...

Public Member Functions

 __init__ (self, "Solver" solver)
 construct_output (self, exahype2_project, peano_project, time_step, add_global_tasks=True)
 Has to be implemented by subclass.
 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.
"Solver.MeshAdaptation" create_default_mesh_adaptation (self)
 The mesh adaptation a solver uses if the user does not assign one to solver.mesh_adaptation.

Static Public Attributes

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

 _solver = solver
Solver.NumericalScheme.NumericalSchemeGenerator _generator = None

Detailed Description

The concrete discretisation (Finite Volumes, ADER-DG, ...) realised by a Solver.

Abstract - concrete solvers have to provide a subclass that implements construct_output().

Definition at line 60 of file Solver.py.

Constructor & Destructor Documentation

◆ __init__()

exahype2.api.Solver.Solver.NumericalScheme.__init__ ( self,
"Solver" solver )
Parameters
solverexahype2.api.Solver The solver which the scheme discretises.

Definition at line 75 of file Solver.py.

Member Function Documentation

◆ construct_output()

exahype2.api.Solver.Solver.NumericalScheme.construct_output ( self,
exahype2_project,
peano_project,
time_step,
add_global_tasks = True )

Has to be implemented by subclass.

time_step: peano4.api.taskgraph.Graph The task graph of the surrounding exahype2_project's time stepping phase, so the numerical scheme can add its own tasks into it.

Parameters
add_global_tasksbool Whether the scheme adds the tasks that belong to the mesh as a whole rather than to the solver: it switches the load balancing off at the begin of the time step, and its last task evaluates the adaptivity criterion and switches the load balancing on again. If set, the scheme adds these tasks by calling wrap_task_graph_in_load_balancing_and_amr_tasks() as its very last step. A host that couples several solvers passes False, as it wraps the concatenated graph itself.

Reimplemented in 20_additional-solver-steps.RungeKuttaWithDensityFloor, 20_additional-solver-steps.RusanovWithDensityFloor, exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler, exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta, and manipulate-solver-steps-illustrations.RusanovWithPostprocessing.

Definition at line 86 of file Solver.py.

◆ create_default_mesh_adaptation()

"Solver.MeshAdaptation" exahype2.api.Solver.Solver.NumericalScheme.create_default_mesh_adaptation ( self)

The mesh adaptation a solver uses if the user does not assign one to solver.mesh_adaptation.

Returns
Solver.MeshAdaptation or None The default returns None, i.e. the solver does not contribute to the mesh adaptation phase.

Reimplemented in exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler, exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler, and exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.

Definition at line 205 of file Solver.py.

◆ wrap_task_graph_in_load_balancing_and_amr_tasks()

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

The routine adds two tasks to time_step:

  • {SolverName}_Disable load balancing: switches the load balancing off throughout the time step. All tasks of the graph that do not depend on anything else wait for it.
  • {SolverName}_Dynamic mesh refinement and load balancing (DYNAMIC_MESH_REFINEMENT_TASK_NAME): evaluates the adaptivity criterion if the solver has one, i.e. it collects the refine and erase requests for the mesh adaptation phase, and then switches the load balancing on again and informs it that the time step has finished. It waits for all tasks of the graph that nothing else waits for. Global tasks do not count: The task runs last in the step, so no other task may wait for it.

The tasks pick up whatever is in time_step when the routine is called. Consequently, construct_output() calls it last if its flag add_global_tasks is set, i.e. after all tasks of the scheme have been added. A coupling that merges the graphs of several solvers (Coupling different solvers) calls it on the merged graph instead.

Schemes that do not own a mesh override the routine with an empty one.

Parameters
time_steppeano4.api.taskgraph.Graph The graph to wrap. It receives the two tasks.

Definition at line 108 of file Solver.py.

Field Documentation

◆ _generator

Solver.NumericalScheme.NumericalSchemeGenerator exahype2.api.Solver.Solver.NumericalScheme._generator = None
protected

Definition at line 83 of file Solver.py.

◆ _solver

exahype2.api.Solver.Solver.NumericalScheme._solver = solver
protected

Definition at line 82 of file Solver.py.

Referenced by solvers.fv.EnclaveTasking.UpdateCell._add_action_set_entries_to_dictionary(), solvers.fv.SingleSweep.UpdateCell._add_action_set_entries_to_dictionary(), exahype2.api.Solver.Solver.Plotter._add_time_interval_bookkeeping_to_solver(), exahype2.api.Solver.Solver.Plotter.create_finish_call(), exahype2.api.Solver.Solver.Plotter.create_is_active_predicate(), solvers.rkdg.actionsets.AdaptivityCriterion.AdaptivityCriterion.event_lifetime(), solvers.aderdg.actionsets.AdaptivityCriterion.AdaptivityCriterion.get_body_of_operation(), solvers.aderdg.actionsets.Correction.Correction.get_body_of_operation(), solvers.aderdg.actionsets.DynamicAMR.DynamicAMR.get_body_of_operation(), solvers.aderdg.actionsets.HandleBoundary.HandleBoundary.get_body_of_operation(), solvers.aderdg.actionsets.InitialCondition.InitialCondition.get_body_of_operation(), solvers.aderdg.actionsets.PostprocessSolution.CellWisePostprocessSolution.get_body_of_operation(), solvers.aderdg.actionsets.PostprocessSolution.DoFWisePostprocessSolution.get_body_of_operation(), solvers.aderdg.actionsets.PostprocessSolution.EmptyPostprocessSolution.get_body_of_operation(), solvers.aderdg.actionsets.Prediction.Prediction.get_body_of_operation(), solvers.fv.actionsets.AdaptivityCriterion.AdaptivityCriterion.get_body_of_operation(), solvers.fv.actionsets.InitialCondition.InitialCondition.get_body_of_operation(), solvers.fv.actionsets.PostprocessSolution.VolumeWisePostprocessSolution.get_body_of_operation(), solvers.fv.actionsets.PreprocessSolution.VolumeWisePreprocessSolution.get_body_of_operation(), solvers.fv.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.get_body_of_operation(), solvers.fv.EnclaveTasking.MergeEnclaveTaskOutcome.get_body_of_operation(), solvers.limiting.actionsets.CopyAndConvertPatch.CopyAndConvertPatch.get_body_of_operation(), solvers.limiting.actionsets.SaveNewCellData.SaveNewCellData.get_body_of_operation(), solvers.limiting.actionsets.SpreadLimiterStatus.SpreadLimiterStatus.get_body_of_operation(), solvers.limiting.actionsets.VerifyTroubledness.VerifyTroubledness.get_body_of_operation(), solvers.rkdg.actionsets.AdaptivityCriterion.AdaptivityCriterion.get_body_of_operation(), solvers.rkdg.actionsets.AddVolumeAndFaceSolution.AddVolumeAndFaceSolution.get_body_of_operation(), solvers.rkdg.actionsets.ComputeFinalLinearCombination.ComputeFinalLinearCombination.get_body_of_operation(), solvers.rkdg.actionsets.DynamicAMR.DynamicAMR.get_body_of_operation(), solvers.rkdg.actionsets.HandleBoundary.HandleBoundary.get_body_of_operation(), solvers.rkdg.actionsets.InitialCondition.InitialCondition.get_body_of_operation(), solvers.rkdg.actionsets.LinearCombinationOfEstimates.LinearCombinationOfEstimates.get_body_of_operation(), solvers.rkdg.actionsets.PostprocessSolution.CellWisePostprocessSolution.get_body_of_operation(), solvers.rkdg.actionsets.PostprocessSolution.DoFWisePostprocessSolution.get_body_of_operation(), solvers.rkdg.actionsets.PreprocessSolution.CellWisePreprocessSolution.get_body_of_operation(), solvers.rkdg.actionsets.PreprocessSolution.DoFWisePreprocessSolution.get_body_of_operation(), solvers.rkdg.actionsets.ProjectLinearCombinationOfEstimatesOntoFaces.ProjectLinearCombinationOfEstimatesOntoFaces.get_body_of_operation(), solvers.rkdg.actionsets.SolveRiemannProblem.SolveRiemannProblem.get_body_of_operation(), solvers.rkdg.actionsets.SolveVolumeIntegral.SolveVolumeIntegral.get_body_of_operation(), solvers.rkdg.SeparateSweepsWithEnclaveTasking.MergeEnclaveTaskOutcome.get_body_of_operation(), solvers.fv.actionsets.InitialCondition.InitialCondition.get_body_of_prepareTraversal(), solvers.aderdg.actionsets.AbstractADERDGActionSet.AbstractADERDGActionSet.get_includes(), solvers.aderdg.actionsets.Correction.Correction.get_includes(), solvers.aderdg.actionsets.DynamicAMR.DynamicAMR.get_includes(), solvers.aderdg.actionsets.HandleBoundary.HandleBoundary.get_includes(), solvers.aderdg.actionsets.InitialCondition.InitialCondition.get_includes(), solvers.aderdg.actionsets.PostprocessSolution.DoFWisePostprocessSolution.get_includes(), solvers.aderdg.actionsets.PostprocessSolution.EmptyPostprocessSolution.get_includes(), solvers.aderdg.actionsets.Prediction.Prediction.get_includes(), solvers.fv.actionsets.AbstractFVActionSet.AbstractFVActionSet.get_includes(), solvers.fv.actionsets.InitialCondition.InitialCondition.get_includes(), solvers.fv.EnclaveTasking.UpdateCell.get_includes(), solvers.fv.SingleSweep.UpdateCell.get_includes(), solvers.limiting.actionsets.AbstractLimiterActionSet.AbstractLimiterActionSet.get_includes(), solvers.limiting.actionsets.CopyAndConvertPatch.CopyAndConvertPatch.get_includes(), solvers.limiting.actionsets.SaveNewCellData.SaveNewCellData.get_includes(), solvers.limiting.actionsets.VerifyTroubledness.VerifyTroubledness.get_includes(), solvers.rkdg.actionsets.AbstractRungeKuttaDGActionSet.AbstractRungeKuttaDGActionSet.get_includes(), solvers.rkdg.actionsets.SolveVolumeIntegral.SolveVolumeIntegral.get_includes(), solvers.rkdg.actionsets.AddVolumeAndFaceSolution.AddVolumeAndFaceSolution.guards(), solvers.rkdg.actionsets.DynamicAMR.DynamicAMR.guards(), solvers.rkdg.actionsets.HandleBoundary.HandleBoundary.guards(), solvers.rkdg.actionsets.LinearCombinationOfEstimates.LinearCombinationOfEstimates.guards(), solvers.rkdg.actionsets.ProjectLinearCombinationOfEstimatesOntoFaces.ProjectLinearCombinationOfEstimatesOntoFaces.guards(), solvers.rkdg.actionsets.SolveRiemannProblem.SolveRiemannProblem.guards(), and solvers.rkdg.actionsets.SolveVolumeIntegral.SolveVolumeIntegral.guards().

◆ DYNAMIC_MESH_REFINEMENT_TASK_NAME

str exahype2.api.Solver.Solver.NumericalScheme.DYNAMIC_MESH_REFINEMENT_TASK_NAME = "Dynamic mesh refinement and load balancing"
static

Name of the last task of each time step without the solver's name as prefix, i.e.

the task is called {SolverName}_ followed by this string. It evaluates the adaptivity criterion and re-enables and informs the load balancing.

Definition at line 73 of file Solver.py.


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