|
Peano
|
Finite Volumes with a Rusanov Riemann solver and explicit Euler time stepping, realised over a block-structured mesh. More...


Public Member Functions | |
| __init__ (self, Solver solver, int patch_size, int overlap=1, float cfl_constant=0.9, "toolbox.blockstructured.api.InterpolateHangingFaces.Scheme" interpolation=toolbox.blockstructured.api.InterpolateHangingFaces.Scheme.Linear, "toolbox.blockstructured.api.RestrictHangingFaces.Scheme" restriction=toolbox.blockstructured.api.RestrictHangingFaces.Scheme.Averaging, float min_volume_size=None, float max_volume_size=None) | |
| The constructor memorises the attributes. | |
| str | kernel_function_name (self) |
| Name of the generated time step kernel. | |
| str | max_eigenvalue_kernel_function_name (self) |
| Name of the generated kernel which determines the maximum eigenvalue over a patch. | |
| Solver.MeshAdaptation | create_default_mesh_adaptation (self) |
| The Finite Volume schemes adapt the mesh and balance the load through exahype2.api.fv.AdaptMeshAndBalanceLoad by default. | |
| construct_output (self, exahype2_project, peano_project, time_step, add_global_tasks=True) | |
| Has to be implemented by subclass. | |
| "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. | |
Data Fields | |
| min_volume_size = min_volume_size | |
| max_volume_size = max_volume_size | |
| interpolation = interpolation | |
| restriction = restriction | |
| patch_size = patch_size | |
| halo_size = overlap | |
| overlap = overlap | |
| kernel_namespace = None | |
| max_eigenvalue_kernel_call = None | |
| cfl_constant = cfl_constant | |
Private Member Functions | |
| __create_data_structures (self) | |
| Create the mesh data structures (a Finite Volume patch per cell, plus the face-based overlap patches used to reconstruct its halo) this numerical scheme requires. | |
| __add_data_to_repository (self, peano_project) | |
| Consult page_exahype_programmers_guide_new_solver for some information how this routine fits to the typical workflow when we introduce a new solver. | |
Additional Inherited Members | |
| 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 |
Finite Volumes with a Rusanov Riemann solver and explicit Euler time stepping, realised over a block-structured mesh.
Definition at line 207 of file RusanovWithExplicitEuler.py.
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.__init__ | ( | self, | |
| Solver | solver, | ||
| int | patch_size, | ||
| int | overlap = 1, | ||
| float | cfl_constant = 0.9, | ||
| "toolbox.blockstructured.api.InterpolateHangingFaces.Scheme" | interpolation = toolbox.blockstructured.api.InterpolateHangingFaces.Scheme.Linear, | ||
| "toolbox.blockstructured.api.RestrictHangingFaces.Scheme" | restriction = toolbox.blockstructured.api.RestrictHangingFaces.Scheme.Averaging, | ||
| float | min_volume_size = None, | ||
| float | max_volume_size = None ) |
The constructor memorises the attributes.
However, it does not do this within this class, but it adds the important properties straight to the solver, so anybody else working against this solver knows about the properties introduced by the numerical scheme.
patch_size: int Number of Finite Volumes per axis within one patch (i.e. within one mesh cell).
overlap: int Number of Finite Volumes the halo layer reconstructed around a patch - from the neighbouring patches' faces - is wide.
cfl_constant: float Safety factor the admissible time step size (
interpolation: toolbox.blockstructured.api.InterpolateHangingFaces.Scheme How the scheme initialises the halo of a fine patch next to a coarser patch on an adaptive mesh. Whenever the time step 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.
restriction: toolbox.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.
min_volume_size: float The time step asks for a refinement of a cell only if its volumes are at least of this size (exahype2.api.blockstructured.DynamicMeshRefinement). None (the default) does not bound the refinement.
max_volume_size: float The time step asks for an erase, i.e. coarsening, of a cell only if the volumes of the coarser cell would be strictly smaller than this size. None (the default) does not bound the coarsening.
On a regular mesh, there are no hanging faces, and the two schemes are never used. The fluxes along a face between a coarse and a fine patch are not corrected, i.e. the scheme is not exactly conservative on adaptive meshes.
Definition at line 215 of file RusanovWithExplicitEuler.py.
References __init__().
Referenced by __init__().


|
private |
Consult page_exahype_programmers_guide_new_solver for some information how this routine fits to the typical workflow when we introduce a new solver.
Definition at line 423 of file RusanovWithExplicitEuler.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, _solver, exahype2.api.fv.actionsets.InsertPatchInterior.InsertPatchInterior.overlap, overlap, 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, and patch_size.
Referenced by construct_output(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.construct_output(), and exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.construct_output().

|
private |
Create the mesh data structures (a Finite Volume patch per cell, plus the face-based overlap patches used to reconstruct its halo) this numerical scheme requires.
Ported from the legacy exahype2.solvers.fv.FV.create_data_structures(): one peano4.api.datamodel.Patch of patch_size^d Finite Volumes per mesh cell (_patch), plus a halo-augmented copy of it (_patch_with_halo, (patch_size+2*overlap)^d,
Two pieces of the legacy method are deliberately not ported yet:
Definition at line 325 of file RusanovWithExplicitEuler.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, _solver, exahype2.api.fv.actionsets.InsertPatchInterior.InsertPatchInterior.overlap, overlap, 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, and patch_size.
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.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.
| add_global_tasks | bool 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 from exahype2.api.Solver.Solver.NumericalScheme.
Reimplemented in 20_additional-solver-steps.RusanovWithDensityFloor, and manipulate-solver-steps-illustrations.RusanovWithPostprocessing.
Definition at line 499 of file RusanovWithExplicitEuler.py.
References __add_data_to_repository(), _generator, construct_output(), and kernel_namespace.
Referenced by construct_output().


| Solver.MeshAdaptation exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.create_default_mesh_adaptation | ( | self | ) |
The Finite Volume schemes adapt the mesh and balance the load through exahype2.api.fv.AdaptMeshAndBalanceLoad by default.
Reimplemented from exahype2.api.Solver.Solver.NumericalScheme.
Definition at line 488 of file RusanovWithExplicitEuler.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, and _solver.
| "toolbox.blockstructured.api.RestrictHangingFaces" exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.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. Besides the time step, this is the projection at the end of the setup (exahype2.api.fv.SetupSimulationOverRegularGrid). The task has to write all of _patch_overlap_update, as averaging clears it first.
Definition at line 513 of file RusanovWithExplicitEuler.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, _solver, exahype2.api.blockstructured.AdaptMeshAndBalanceLoad.AdaptMeshAndBalanceLoad.restriction, and restriction.
| str exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.kernel_function_name | ( | self | ) |
Name of the generated time step kernel.
It carries the solver name, as do the kernels/<SolverName>_rusanov*.h files holding it, so two solvers' kernels do not clash.
Definition at line 308 of file RusanovWithExplicitEuler.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, and _solver.
Referenced by exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__construct_kernel_call(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__create_time_step_functions(), and exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.construct_output().

| str exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.max_eigenvalue_kernel_function_name | ( | self | ) |
Name of the generated kernel which determines the maximum eigenvalue over a patch.
It is a kernel of its own, i.e. the time step kernel does not return any eigenvalue (exahype2.api.fv.actionsets.ComputeMaxEigenvalue).
Definition at line 317 of file RusanovWithExplicitEuler.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, and _solver.
Referenced by exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__create_time_step_functions(), and exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.construct_output().

| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.cfl_constant = cfl_constant |
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.halo_size = overlap |
Definition at line 297 of file RusanovWithExplicitEuler.py.
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.interpolation = interpolation |
Definition at line 293 of file RusanovWithExplicitEuler.py.
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.kernel_namespace = None |
Definition at line 301 of file RusanovWithExplicitEuler.py.
Referenced by exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__create_kernels(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__create_time_step_functions(), construct_output(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.construct_output(), and exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.construct_output().
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.max_eigenvalue_kernel_call = None |
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.max_volume_size = max_volume_size |
Definition at line 292 of file RusanovWithExplicitEuler.py.
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.min_volume_size = min_volume_size |
Definition at line 291 of file RusanovWithExplicitEuler.py.
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.overlap = overlap |
Definition at line 298 of file RusanovWithExplicitEuler.py.
Referenced by __add_data_to_repository(), __create_data_structures(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__create_data_structures(), and exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.construct_output().
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.patch_size = patch_size |
Definition at line 296 of file RusanovWithExplicitEuler.py.
Referenced by __add_data_to_repository(), exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__add_data_to_repository(), __create_data_structures(), exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.__create_data_structures(), exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.__create_data_structures(), and exahype2.api.fv.RusanovWithOptimisticExplicitEuler.RusanovWithOptimisticExplicitEuler.construct_output().
| exahype2.api.fv.RusanovWithExplicitEuler.RusanovWithExplicitEuler.restriction = restriction |
Definition at line 294 of file RusanovWithExplicitEuler.py.
Referenced by create_restriction_of_hanging_faces(), and exahype2.api.rkfd4.CentralDifferencesWithRungeKutta.CentralDifferencesWithRungeKutta.create_restriction_of_hanging_faces().