Peano
Loading...
Searching...
No Matches
solvers.rkdg.SeparateSweeps.SeparateSweeps Class Reference

Probably the simplest solver you could think off. More...

Inheritance diagram for solvers.rkdg.SeparateSweeps.SeparateSweeps:
Collaboration diagram for solvers.rkdg.SeparateSweeps.SeparateSweeps:

Public Member Functions

 __init__ (self, name, rk_order, polynomial_basis, number_of_face_projections, unknowns, auxiliary_variables, min_cell_h, max_cell_h, plot_grid_properties, pde_terms_without_state)
 The super call invokes the creation of the data sets, where the guards have to be known already.
 create_data_structures (self)
 First, call the superclass' create_data_structures() to ensure that all the data structures are in place.
 create_action_sets (self)
 We invoke the superclass which creates all the action sets, and then we set the appropriate guards.
Public Member Functions inherited from solvers.rkdg.RungeKuttaDG.RungeKuttaDG
 __init__ (self, name, rk_order, polynomial_basis, FaceProjections face_projections, unknowns, auxiliary_variables, min_cell_h, max_cell_h, plot_grid_properties, bool pde_terms_without_state, baseline_action_set_descend_invocation_order=0)
 Constructor of the Runge-Kutta Discontinuous Galerkin solver.
 __str__ (self)
 get_min_number_of_spacetree_levels (self, domain_size)
 get_max_number_of_spacetree_levels (self, domain_size)
 get_coarsest_number_of_cells (self, domain_size)
 get_finest_number_of_cells (self, domain_size)
 create_readme_descriptor (self, domain_offset, domain_size)
 user_action_set_includes (self)
 Add further includes to this property, if your action sets require some additional routines from other header files.
 user_solver_includes (self)
 Add further includes to this property, if your solver requires some additional routines from other header files.
 add_user_action_set_includes (self, value)
 Add further includes to this property, if your action sets require some additional routines from other header files.
 add_user_solver_includes (self, value)
 Add further includes to this property, if your solver requires some additional routines from other header files.
 get_name_of_global_instance (self)
 add_to_Peano4_datamodel (self, datamodel, verbose)
 Add all required data to the Peano4 project's datamodel so it is properly built up.
 add_use_data_statements_to_Peano4_solver_step (self, step)
 Tell Peano what data to move around.
 add_actions_to_init_grid (self, step)
 Add the action sets to the grid initialisation.
 add_actions_to_create_grid (self, step, evaluate_refinement_criterion)
 set_plot_description (self, description)
 Use this one to set a description within the output patch file that tells the vis solver what the semantics of the entries are.
 add_actions_to_plot_solution (self, step, output_path)
 Dump snapshot of solution.
 add_actions_to_perform_time_step (self, step)
 The tricky part here is that we have to get the order right.
 add_entries_to_text_replacement_dictionary (self, d)
 add_implementation_files_to_project (self, namespace, output, dimensions, subdirectory="")
 The ExaHyPE project will call this operation when it sets up the overall environment.
 set_solver_constants (self, datastring)
 add_solver_constants (self, datastring)
 unknowns (self)
 auxiliary_variables (self)
 unknowns (self, value)
 auxiliary_variables (self, value)
 number_of_Runge_Kutta_steps (self)
 set_implementation (self, flux=None, ncp=None, eigenvalues=None, boundary_conditions=None, refinement_criterion=None, initial_conditions=None, source_term=None, point_source=None, additional_action_set_includes="", additional_user_includes="")
 If you pass in User_Defined, then the generator will create C++ stubs that you have to befill manually.
 postprocess_updated_cell_after_Runge_Kutta_step (self)
 postprocess_updated_cell_after_final_linear_combination (self)
 postprocess_updated_cell_after_Runge_Kutta_step (self, kernel)
 Define a postprocessing routine over the data.
 postprocess_updated_cell_after_final_linear_combination (self, kernel)
 Define a postprocessing routine over the data.
 switch_storage_scheme (self, Storage cell_data_storage, Storage face_data_storage)
 By default, we hold all data on the call stacks.

Protected Attributes

str _initialisation_sweep_guard
str _first_iteration_after_initialisation_guard
list _primary_sweeps_of_Runge_Kutta_step_on_cell
list _secondary_sweeps_of_Runge_Kutta_step_on_cell
list _primary_sweeps_of_Runge_Kutta_step_on_face
list _secondary_sweeps_of_Runge_Kutta_step_on_face
str _any_primary_sweep_of_a_Runge_Kutta_step_on_cell = " or ".join( self._primary_sweeps_of_Runge_Kutta_step_on_cell )
str _any_secondary_sweep_of_a_Runge_Kutta_step_on_cell = " or ".join( self._secondary_sweeps_of_Runge_Kutta_step_on_cell )
str _any_primary_sweep_of_a_Runge_Kutta_step_on_face = " or ".join( self._primary_sweeps_of_Runge_Kutta_step_on_face )
str _any_secondary_sweep_of_a_Runge_Kutta_step_on_face = " or ".join( self._secondary_sweeps_of_Runge_Kutta_step_on_face )
Protected Attributes inherited from solvers.rkdg.RungeKuttaDG.RungeKuttaDG
 _name = name
 _rk_order = rk_order
 _basis = polynomial_basis
 _face_projections = face_projections
str _volumetric_compute_kernel_call = "#error Please set the solver property _volumetric_compute_kernel_call in the Python class"
str _volumetric_compute_kernel_call_stateless = "#error Please set the solver property _volumetric_compute_kernel_call_stateless in the Python class"
tuple _Riemann_compute_kernel_call
tuple _Riemann_compute_kernel_call_stateless
 _pde_terms_without_state = pde_terms_without_state
str _add_solver_contributions_call = "#error Please set the solver property _add_solver_contributions_call in the Python class"
str _multiply_with_inverted_mass_matrix_call = "#error Please set the solver property _multiply_with_inverted_mass_matrix_call in the Python class"
str _kernel_namespace = "#error Please set the solver property _kernel_namespace in the Python class"
bool _use_var_shortcut = False
list _variable_names = []
list _variable_pos = [0]
 _unknowns = sum(unknowns.values())
 _auxiliary_variables = sum(auxiliary_variables.values())
 _min_cell_h = min_cell_h
 _max_cell_h = max_cell_h
 _plot_grid_properties = plot_grid_properties
str _solver_constants = ""
str _user_action_set_includes = ""
str _user_solver_includes = ""
 _solver_template_file_class_name = None
tuple _action_set_postprocess_solution = None
tuple _action_set_preprocess_solution = None
bool _compute_eigenvalue = False
str _compute_time_step_size = None
 _compute_new_time_step_size = None
str _preprocess_cell = ""
str _postprocess_updated_cell_after_Runge_Kutta_step = ""
str _postprocess_updated_cell_after_final_linear_combination = ""
 _flux_implementation = None
 _ncp_implementation = None
 _eigenvalues_implementation = None
 _source_term_implementation = None
 _point_sources_implementation = None
 _boundary_conditions_implementation = PDETerms.User_Defined_Implementation
 _refinement_criterion_implementation = PDETerms.Empty_Implementation
 _initial_conditions_implementation = PDETerms.User_Defined_Implementation
str _abstract_solver_user_declarations = ""
str _abstract_solver_user_definitions = ""
str _solver_user_declarations = ""
str _solver_user_definitions = ""
str _start_time_step_implementation = ""
str _finish_time_step_implementation = ""
str _constructor_implementation = ""
 _cell_data_storage = Storage.CallStack
 _face_data_storage = Storage.CallStack
 _baseline_action_set_descend_invocation_order = baseline_action_set_descend_invocation_order
 _current_time_step
 _rhs_estimates
 _linear_combination_of_estimates
 _estimate_projection
 _old_solution_projection
 _Riemann_solution
 _cell_label = exahype2.grid.create_cell_label(self._name)
 _face_label = exahype2.grid.create_face_label(self._name)
tuple _action_set_initial_conditions
tuple _action_set_initial_conditions_for_grid_construction
 _action_set_AMR
tuple _action_set_AMR_commit_without_further_analysis
tuple _action_set_AMR_throughout_grid_construction
tuple _action_set_linear_combination_of_estimates
 _action_set_project_linear_combination_onto_faces
tuple _action_set_solve_volume_integral
tuple _action_set_handle_boundary
tuple _action_set_solve_Riemann_problem
tuple _action_set_add_volume_and_face_solution
 _action_set_compute_final_linear_combination_and_project_solution_onto_faces
 _action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement
 _action_set_update_face_label = exahype2.grid.UpdateFaceLabel(self._name)
 _action_set_update_cell_label = exahype2.grid.UpdateCellLabel(self._name)

Additional Inherited Members

Data Fields inherited from solvers.rkdg.RungeKuttaDG.RungeKuttaDG
str plot_description = ""
 select_dofs_to_print = None
Protected Member Functions inherited from solvers.rkdg.RungeKuttaDG.RungeKuttaDG
 _query_fine_grid_cell_in_action_set_if_it_holds_solution (self)
 _provide_cell_data_to_compute_kernels_default_guard (self)
 _provide_face_data_to_compute_kernels_default_guard (self)
 _store_cell_data_default_guard (self)
 Extend the guard via ands only.
 _load_cell_data_default_guard (self)
 Extend the guard via ands only.
 _store_face_data_default_guard (self)
 Extend the guard via ands only.
 _load_face_data_default_guard (self)
 Extend the guard via ands only.
 _unknown_identifier (self)
 _get_default_includes (self)
 _init_dictionary_with_default_parameters (self, d)
 This one is called by all algorithmic steps before I invoke add_entries_to_text_replacement_dictionary().

Detailed Description

Probably the simplest solver you could think off.

We run over the grid twice per Runge-Kutta step. In the first step, we compute the linear reconstruction, project this one onto the faces and also compute the volumetric prediction. In the second step, we solve the Riemann problem and add it to the prediction.

In the attribute terminology, we call the two runs over the grid sweeps, i.e., we work with two grid sweeps per Runge-Kutta step.

Definition at line 14 of file SeparateSweeps.py.

Constructor & Destructor Documentation

◆ __init__()

solvers.rkdg.SeparateSweeps.SeparateSweeps.__init__ ( self,
name,
rk_order,
polynomial_basis,
number_of_face_projections,
unknowns,
auxiliary_variables,
min_cell_h,
max_cell_h,
plot_grid_properties,
pde_terms_without_state )

The super call invokes the creation of the data sets, where the guards have to be known already.

So we bring those guys forward and then call the superclass constructor.

Definition at line 26 of file SeparateSweeps.py.

Member Function Documentation

◆ create_action_sets()

solvers.rkdg.SeparateSweeps.SeparateSweeps.create_action_sets ( self)

We invoke the superclass which creates all the action sets, and then we set the appropriate guards.

  • _action_set_update_face_label - can be done always
  • _action_set_update_cell_label - can be done always
  • _action_set_linear_combination_of_estimates - primary sweeps only, as these kick off the Runge-Kutta step.
  • _action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement - primary only, as the secondary step is a sole clean-up
  • _action_set_project_linear_combination_onto_faces - only required in primary sweep. In the secondary, we collect the results together, i.e., we don't immediately need the boundary data anymore.
  • _action_set_solve_volume_integral - only done in the primary sweep.
  • _action_set_handle_boundary - only in secondary sweep, as we now have access to the left and right face data and hence can invoke the Riemann solver.
  • _action_set_solve_Riemann_problem - secondary sweep. See discussion of previous item.
  • _action_set_add_volume_and_face_solution - secondary sweep. The Riemann solve plugs into the first touch of a face in the secondary sweep, so now we can sum up the solutions.
  • _action_set_compute_final_linear_combination_and_project_solution_onto_faces - very last secondary sweep.
  • _action_set_AMR - very last secondary sweep, i.e., after we have the final solution.
  • _action_set_postprocess_solution - same as for item above.

:: Guards around linear combination of estimates

We rely on the action set LinearCombination as it is initialised in the superclass. So the only thing we have to do is to ensure that the linear combination over the estimates is computed if and only if this is required. For the separate sweeps, we compute the linear combinations if the cell holds data, i.e., is on the finest level, and if it is the primary of the two sweeps which realise a RK step, i.e., the one where we later on project onto the faces.

Reimplemented from solvers.rkdg.RungeKuttaDG.RungeKuttaDG.

Reimplemented in solvers.rkdg.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking.

Definition at line 112 of file SeparateSweeps.py.

References solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_add_volume_and_face_solution, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_compute_final_linear_combination_and_project_solution_onto_faces, solvers.aderdg.ADERDG.ADERDG._action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement, solvers.fv.FV.FV._action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement, solvers.aderdg.ADERDG.ADERDG._action_set_handle_boundary, solvers.fv.FV.FV._action_set_handle_boundary, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_handle_boundary, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_linear_combination_of_estimates, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_project_linear_combination_onto_faces, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_solve_Riemann_problem, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._action_set_solve_volume_integral, api.solvers.Solver.Solver._name, api.Tree.Tree._name, dastgen2.attributes.Attribute.Attribute._name, dastgen2.attributes.BooleanArray.BooleanArray._name, dastgen2.attributes.Enumeration.Enumeration._name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling._name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling._name, exagrype.api.FOSOSolver.FOSOSolver._name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling._name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling._name, exahype2.api.AuxiliaryVariables.AuxiliaryVariables._name, exahype2.api.dslhype.SyntaxTree.Construction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromDotProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromExisting._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromFunction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromMatrixVectorProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromOperation._name, exahype2.api.dslhype.SyntaxTree.MemoryAllocation._name, exahype2.api.dslhype.SyntaxTree.MemoryDeallocation._name, exahype2.api.Solver.Solver._name, mghype::matrixfree::solvers::Solver._name, peano4.api.dastgen2.Peano4DoubleArray.Peano4DoubleArray._name, peano4.api.dastgen2.Peano4IntegerArray.Peano4IntegerArray._name, peano4.api.dastgen2.Peano4SmartPointerDoubleArray.Peano4SmartPointerDoubleArray._name, peano4::RunMultipleSteps._name, solvers.aderdg.ADERDG.ADERDG._name, solvers.api.Solver.Solver._name, solvers.elliptic.AMRMarker.AMRMarker._name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells._name, solvers.fv.EnclaveTasking.EnclaveTasking._name, solvers.fv.FV.FV._name, solvers.limiting.PosterioriLimiting.PosterioriLimiting._name, solvers.limiting.StaticLimiting.StaticLimiting._name, solvers.rkdg.RungeKuttaDG.RungeKuttaDG._name, tarch::services::ServiceRepository::ServiceEntry._name, _primary_sweeps_of_Runge_Kutta_step_on_cell, _primary_sweeps_of_Runge_Kutta_step_on_face, _secondary_sweeps_of_Runge_Kutta_step_on_cell, _secondary_sweeps_of_Runge_Kutta_step_on_face, solvers.aderdg.ADERDG.ADERDG._store_cell_data_default_guard(), solvers.fv.FV.FV._store_cell_data_default_guard(), solvers.limiting.PosterioriLimiting.PosterioriLimiting._store_cell_data_default_guard(), solvers.limiting.StaticLimiting.StaticLimiting._store_cell_data_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._store_cell_data_default_guard(), create_action_sets(), exahype2.api.Solver.Solver.get_name_of_global_instance(), solvers.aderdg.ADERDG.ADERDG.get_name_of_global_instance(), solvers.elliptic.AMRMarker.AMRMarker.get_name_of_global_instance(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.get_name_of_global_instance(), solvers.fv.FV.FV.get_name_of_global_instance(), solvers.limiting.PosterioriLimiting.PosterioriLimiting.get_name_of_global_instance(), solvers.limiting.StaticLimiting.StaticLimiting.get_name_of_global_instance(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.get_name_of_global_instance(), and solvers.rkdg.RungeKuttaDG.RungeKuttaDG.number_of_Runge_Kutta_steps().

Referenced by create_action_sets().

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

◆ create_data_structures()

Field Documentation

◆ _any_primary_sweep_of_a_Runge_Kutta_step_on_cell

str solvers.rkdg.SeparateSweeps.SeparateSweeps._any_primary_sweep_of_a_Runge_Kutta_step_on_cell = " or ".join( self._primary_sweeps_of_Runge_Kutta_step_on_cell )
protected

Definition at line 67 of file SeparateSweeps.py.

◆ _any_primary_sweep_of_a_Runge_Kutta_step_on_face

str solvers.rkdg.SeparateSweeps.SeparateSweeps._any_primary_sweep_of_a_Runge_Kutta_step_on_face = " or ".join( self._primary_sweeps_of_Runge_Kutta_step_on_face )
protected

Definition at line 70 of file SeparateSweeps.py.

Referenced by create_data_structures().

◆ _any_secondary_sweep_of_a_Runge_Kutta_step_on_cell

str solvers.rkdg.SeparateSweeps.SeparateSweeps._any_secondary_sweep_of_a_Runge_Kutta_step_on_cell = " or ".join( self._secondary_sweeps_of_Runge_Kutta_step_on_cell )
protected

Definition at line 68 of file SeparateSweeps.py.

◆ _any_secondary_sweep_of_a_Runge_Kutta_step_on_face

str solvers.rkdg.SeparateSweeps.SeparateSweeps._any_secondary_sweep_of_a_Runge_Kutta_step_on_face = " or ".join( self._secondary_sweeps_of_Runge_Kutta_step_on_face )
protected

Definition at line 71 of file SeparateSweeps.py.

Referenced by create_data_structures().

◆ _first_iteration_after_initialisation_guard

str solvers.rkdg.SeparateSweeps.SeparateSweeps._first_iteration_after_initialisation_guard
protected
Initial value:
= "(" + \
"repositories::" + self.get_name_of_global_instance() + ".getSolverState()==" + self._name + "::SolverState::TimeStepAfterGridInitialisation or " + \
"repositories::" + self.get_name_of_global_instance() + ".getSolverState()==" + self._name + "::SolverState::PlottingAfterGridInitialisation" + \
")"

Definition at line 48 of file SeparateSweeps.py.

◆ _initialisation_sweep_guard

str solvers.rkdg.SeparateSweeps.SeparateSweeps._initialisation_sweep_guard
protected
Initial value:
= "(" + \
"repositories::" + self.get_name_of_global_instance() + ".getSolverState()==" + self._name + "::SolverState::GridInitialisation" + \
")"

Definition at line 45 of file SeparateSweeps.py.

◆ _primary_sweeps_of_Runge_Kutta_step_on_cell

list solvers.rkdg.SeparateSweeps.SeparateSweeps._primary_sweeps_of_Runge_Kutta_step_on_cell
protected
Initial value:
= [
"{} and repositories::{}.getSolverState()=={}::SolverState::ProjectOnFacesAndComputeVolumeIntegralOfStep{}".format(self._store_cell_data_default_guard(),self.get_name_of_global_instance(),self._name,step) for step in range(0,self.number_of_Runge_Kutta_steps())
]

Definition at line 53 of file SeparateSweeps.py.

Referenced by create_action_sets(), and create_data_structures().

◆ _primary_sweeps_of_Runge_Kutta_step_on_face

list solvers.rkdg.SeparateSweeps.SeparateSweeps._primary_sweeps_of_Runge_Kutta_step_on_face
protected
Initial value:
= [
"{} and repositories::{}.getSolverState()=={}::SolverState::ProjectOnFacesAndComputeVolumeIntegralOfStep{}".format(self._store_face_data_default_guard(),self.get_name_of_global_instance(),self._name,step) for step in range(0,self.number_of_Runge_Kutta_steps())
]

Definition at line 60 of file SeparateSweeps.py.

Referenced by create_action_sets().

◆ _secondary_sweeps_of_Runge_Kutta_step_on_cell

list solvers.rkdg.SeparateSweeps.SeparateSweeps._secondary_sweeps_of_Runge_Kutta_step_on_cell
protected
Initial value:
= [
"{} and repositories::{}.getSolverState()=={}::SolverState::SolveRiemannProblemAndAddToVolumeIntegralOfStep{}".format(self._store_cell_data_default_guard(),self.get_name_of_global_instance(),self._name,step) for step in range(0,self.number_of_Runge_Kutta_steps())
]

Definition at line 56 of file SeparateSweeps.py.

Referenced by create_action_sets().

◆ _secondary_sweeps_of_Runge_Kutta_step_on_face

list solvers.rkdg.SeparateSweeps.SeparateSweeps._secondary_sweeps_of_Runge_Kutta_step_on_face
protected
Initial value:
= [
"{} and repositories::{}.getSolverState()=={}::SolverState::SolveRiemannProblemAndAddToVolumeIntegralOfStep{}".format(self._store_face_data_default_guard(),self.get_name_of_global_instance(),self._name,step) for step in range(0,self.number_of_Runge_Kutta_steps())
]

Definition at line 63 of file SeparateSweeps.py.

Referenced by create_action_sets().


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