|
Peano
|
A set of auxiliary variables of a solver. More...

Data Structures | |
| class | Mode |
| Where the values of a set live and whether they change. More... | |
Public Member Functions | |
| __init__ (self, str name, Dict[str, int] variables, "AuxiliaryVariables.Mode" mode=Mode.STATIONARY_ON_FACES, str data_name=None) | |
| str | name (self) |
| "AuxiliaryVariables.Mode" | mode (self) |
| Whether the values sit on the faces, and whether they change after the setup. | |
| str | data_name (self) |
| Name of the generated data. | |
| int | size (self) |
| Total number of entries of the set, i.e. | |
| Dict[str, int] | variables (self) |
| Dict[str, int] | variable_positions (self) |
| Position of each named variable within the set. | |
| owner (self) | |
| The solver which initialises the set, i.e. | |
| str | argument_name (self) |
| Name of the argument of the PDE terms. | |
| bool | halo_is_held_through_stages (self) |
| Whether the halo has to be reconstructed in the first stage of a time step only. | |
| str | delta_argument_name (self) |
| Name of the argument behind deltaQ. | |
| List[str] | variable_names_per_entry (self) |
| One name per entry of the set, qualified by the set's name. | |
| str | variables_declaration (self) |
| C++ struct which hosts the positions of the variables within the set. | |
| create_data_structures (self, int patch_size, int overlap, grid_selector) | |
| Create the cell and face data of the set. | |
| add_to_datamodel (self, peano_project) | |
| Register the data with the project (once, even if the set is shared). | |
| str | __str__ (self) |
Data Fields | |
| peano4.api.datamodel.Patch | patch = None |
| peano4.api.datamodel.Patch | patch_overlap_current_time_step = None |
| peano4.api.datamodel.Patch | patch_overlap_update = None |
Static Public Attributes | |
| str | RECONSTRUCTION_TASK_NAME = "Reconstruct auxiliary variables {}" |
Protected Attributes | |
| str | _name = name |
| Dict[str, int] | _variables = dict(variables) |
| dict | _positions = {} |
| _size = offset | |
| _owner = None | |
| "AuxiliaryVariables.Mode" | _mode = mode |
| tuple | _data_name |
| _patch_size = None | |
| _overlap = None | |
| _added_to = set() | |
A set of auxiliary variables of a solver.
Auxiliary variables are quantities such as the sea floor, a mesh distortion or a density which live in every Finite Volume (or Finite Difference point) next to the unknowns, but which are not evolved by the PDE. A solver can have an arbitrary number of such sets, each of them vector-valued, e.g. ten bathymetry entries and another five entries describing a mesh distortion. Each set is held by its own cell data object, i.e. its own patch, rather than by the patch of the unknowns.
Create a set with a name and a dictionary which maps the names of the parameters onto their multiplicities,
bathymetry = exahype2.api.AuxiliaryVariables("Bathymetry", {"b": 1})
and attach it to a solver via exahype2.api.Solver.add_auxiliary_variables(). The name is also the name of a struct within the generated abstract solver, so you can write bathymetry[Bathymetry.b] in your C++ code.
Every PDE term of a solver with auxiliary variables receives, directly behind each Q (and each deltaQ), one pointer per attached set. The pointers come in the order in which the sets have been attached. The pointer is named after the set (first letter in lower case), the pointers behind deltaQ carry the prefix delta. For the set above and the flux, the signature therefore reads
flux(const double* Q, const double* bathymetry, const Vector& x, int normal, double* F)
and the signature of the non-conservative product is
nonconservativeProduct(Q, bathymetry, deltaQ, deltaBathymetry, x, ...)
Solvers without auxiliary variables keep their original signatures.
The first solver a set is attached to owns it. Only the owner's initPointWisely() receives the set as writable argument and initialises it. Further solvers can attach the same set object. They share the data, i.e. they do not hold an additional copy, and initPointWisely() sees the set as const.
Besides periodic boundaries, the halo layer of the volumes at the domain boundary is not available for auxiliary variables.
Definition at line 14 of file AuxiliaryVariables.py.
| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.__init__ | ( | self, | |
| str | name, | ||
| Dict[str, int] | variables, | ||
| "AuxiliaryVariables.Mode" | mode = Mode.STATIONARY_ON_FACES, | ||
| str | data_name = None ) |
| name | str Name of the set. Has to be a valid C++ identifier starting with a capital letter. It feeds into the names of the data structures, the name of the struct which hosts the positions of the variables within the set, and - with a lower-case first letter - into the name of the arguments in the PDE term signatures. |
| variables | dict Maps the name of each parameter onto its multiplicity. |
| mode | AuxiliaryVariables.Mode Whether the values also sit on the faces and whether they change after the setup. Defaults to STATIONARY_ON_FACES. See AuxiliaryVariables.Mode. |
| data_name | str Name of the generated data (patch and face overlaps). Defaults to the name of the set plus "AuxiliaryVariables". |
Definition at line 119 of file AuxiliaryVariables.py.
| str exahype2.api.AuxiliaryVariables.AuxiliaryVariables.__str__ | ( | self | ) |
Definition at line 343 of file AuxiliaryVariables.py.
Referenced by peano4.api.toolbox.particles.postprocessing.ParticleVTUReader.VTUParticleSet.__repr__().

| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.add_to_datamodel | ( | self, | |
| peano_project ) |
Register the data with the project (once, even if the set is shared).
Definition at line 334 of file AuxiliaryVariables.py.
References _added_to, patch, patch_overlap_current_time_step, and patch_overlap_update.
| str exahype2.api.AuxiliaryVariables.AuxiliaryVariables.argument_name | ( | self | ) |
Name of the argument of the PDE terms.
Definition at line 219 of file AuxiliaryVariables.py.
References 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, and _name.
| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.create_data_structures | ( | self, | |
| int | patch_size, | ||
| int | overlap, | ||
| grid_selector ) |
Create the cell and face data of the set.
The routine is idempotent, as a set may be shared by several solvers: the first call creates the data, any further call checks that the numerical schemes of the solvers agree on the patch size and halo.
| patch_size | int Number of volumes per axis within a patch. |
| overlap | int Width of the halo layer. |
| grid_selector | peano4.api.toolbox.GridSelector Selects the mesh entities which hold data. |
Definition at line 268 of file AuxiliaryVariables.py.
References _data_name, _overlap, _patch_size, _size, patch, patch_overlap_current_time_step, and patch_overlap_update.
Referenced by solvers.aderdg.ADERDG.ADERDG.add_kernel_optimisations(), solvers.fv.FV.FV.auxiliary_variables(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.auxiliary_variables(), solvers.fv.FV.FV.interpolation(), solvers.fv.FV.FV.overlap(), solvers.fv.FV.FV.patch_size(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.postprocess_updated_cell(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.postprocess_updated_cell_after_final_linear_combination(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.postprocess_updated_cell_after_Runge_Kutta_step(), solvers.aderdg.ADERDG.ADERDG.postprocess_updated_patch(), solvers.fv.FV.FV.postprocess_updated_patch(), solvers.aderdg.ADERDG.ADERDG.preprocess_reconstructed_patch(), solvers.fv.FV.FV.preprocess_reconstructed_patch(), solvers.fv.FV.FV.restriction(), solvers.aderdg.ADERDG.ADERDG.set_implementation(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.set_implementation(), solvers.aderdg.ADERDG.ADERDG.switch_storage_scheme(), solvers.fv.FV.FV.switch_storage_scheme(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.switch_storage_scheme(), solvers.fv.FV.FV.unknowns(), and solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns().

| str exahype2.api.AuxiliaryVariables.AuxiliaryVariables.data_name | ( | self | ) |
Name of the generated data.
Definition at line 195 of file AuxiliaryVariables.py.
References _data_name.
| str exahype2.api.AuxiliaryVariables.AuxiliaryVariables.delta_argument_name | ( | self | ) |
Name of the argument behind deltaQ.
Definition at line 238 of file AuxiliaryVariables.py.
References 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, and _name.
| bool exahype2.api.AuxiliaryVariables.AuxiliaryVariables.halo_is_held_through_stages | ( | self | ) |
Whether the halo has to be reconstructed in the first stage of a time step only.
True for AuxiliaryVariables.Mode.STATIONARY_THROUGHOUT_TIME_STEPS_ON_FACES.
Definition at line 224 of file AuxiliaryVariables.py.
References _mode.
| "AuxiliaryVariables.Mode" exahype2.api.AuxiliaryVariables.AuxiliaryVariables.mode | ( | self | ) |
Whether the values sit on the faces, and whether they change after the setup.
Definition at line 190 of file AuxiliaryVariables.py.
References _mode.
| str exahype2.api.AuxiliaryVariables.AuxiliaryVariables.name | ( | self | ) |
Definition at line 186 of file AuxiliaryVariables.py.
References 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, and _name.
Referenced by exagrype.api.CCZ4SolverBase.CCZ4SolverBase._insert_constraint_enforcement(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._tasks_of_this_solver(), and exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.create_task_graph().

| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.owner | ( | self | ) |
The solver which initialises the set, i.e.
the first one it was attached to
Definition at line 214 of file AuxiliaryVariables.py.
References _owner.
| int exahype2.api.AuxiliaryVariables.AuxiliaryVariables.size | ( | self | ) |
Total number of entries of the set, i.e.
the sum of all multiplicities
Definition at line 200 of file AuxiliaryVariables.py.
References _size.
| List[str] exahype2.api.AuxiliaryVariables.AuxiliaryVariables.variable_names_per_entry | ( | self | ) |
One name per entry of the set, qualified by the set's name.
A variable of multiplicity k yields k names with an index.
Definition at line 242 of file AuxiliaryVariables.py.
References _variables.
| Dict[str, int] exahype2.api.AuxiliaryVariables.AuxiliaryVariables.variable_positions | ( | self | ) |
Position of each named variable within the set.
Definition at line 209 of file AuxiliaryVariables.py.
References _positions.
| Dict[str, int] exahype2.api.AuxiliaryVariables.AuxiliaryVariables.variables | ( | self | ) |
Definition at line 205 of file AuxiliaryVariables.py.
References _variables.
| str exahype2.api.AuxiliaryVariables.AuxiliaryVariables.variables_declaration | ( | self | ) |
C++ struct which hosts the positions of the variables within the set.
Definition at line 257 of file AuxiliaryVariables.py.
References _positions.
|
protected |
Definition at line 183 of file AuxiliaryVariables.py.
Referenced by add_to_datamodel().
|
protected |
Definition at line 173 of file AuxiliaryVariables.py.
Referenced by create_data_structures(), and data_name().
|
protected |
Definition at line 172 of file AuxiliaryVariables.py.
Referenced by halo_is_held_through_stages(), peano4.api.toolbox.particles.postprocessing.ParticleVTUReader.ParticleVTUReader.load(), and mode().
|
protected |
Definition at line 155 of file AuxiliaryVariables.py.
Referenced by api.Tree.Tree.__str__(), exahype2.api.Solver.Solver.__str__(), solvers.aderdg.ADERDG.ADERDG.__str__(), solvers.api.Solver.Solver.__str__(), solvers.elliptic.AMRMarker.AMRMarker.__str__(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.__str__(), solvers.fv.FV.FV.__str__(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.__str__(), solvers.fv.EnclaveTasking.EnclaveTasking._enclave_task_name(), solvers.aderdg.ADERDG.ADERDG._generate_kernels(), solvers.aderdg.ADERDG.ADERDG._init_dictionary_with_default_parameters(), solvers.fv.FV.FV._init_dictionary_with_default_parameters(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._init_dictionary_with_default_parameters(), solvers.aderdg.ADERDG.ADERDG._interpolate_face_data_default_guard(), solvers.aderdg.SingleSweep.SingleSweep._interpolate_face_data_default_guard(), solvers.aderdg.ADERDG.ADERDG._load_cell_data_default_guard(), solvers.fv.FV.FV._load_cell_data_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._load_cell_data_default_guard(), solvers.aderdg.ADERDG.ADERDG._load_face_data_default_guard(), solvers.fv.FV.FV._load_face_data_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._load_face_data_default_guard(), solvers.aderdg.ADERDG.ADERDG._provide_cell_data_to_compute_kernels_default_guard(), solvers.fv.FV.FV._provide_cell_data_to_compute_kernels_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._provide_cell_data_to_compute_kernels_default_guard(), solvers.aderdg.ADERDG.ADERDG._provide_face_data_to_compute_kernels_default_guard(), solvers.fv.FV.FV._provide_face_data_to_compute_kernels_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._provide_face_data_to_compute_kernels_default_guard(), solvers.aderdg.SingleSweep.SingleSweep._restrict_face_data_default_guard(), solvers.aderdg.ADERDG.ADERDG._store_boundary_data_default_guard(), solvers.aderdg.ADERDG.ADERDG._store_cell_data_default_guard(), solvers.fv.FV.FV._store_cell_data_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._store_cell_data_default_guard(), solvers.aderdg.ADERDG.ADERDG._store_face_data_default_guard(), solvers.fv.FV.FV._store_face_data_default_guard(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._store_face_data_default_guard(), exahype2.api.Solver.Solver._unknown_identifier(), solvers.aderdg.ADERDG.ADERDG._unknown_identifier(), solvers.elliptic.AMRMarker.AMRMarker._unknown_identifier(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells._unknown_identifier(), solvers.fv.FV.FV._unknown_identifier(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._unknown_identifier(), solvers.fv.FV.FV.add_actions_to_checkpoint_solution(), solvers.fv.EnclaveTasking.EnclaveTasking.add_actions_to_create_grid(), solvers.fv.EnclaveTasking.EnclaveTasking.add_actions_to_init_grid(), solvers.aderdg.ADERDG.ADERDG.add_actions_to_plot_solution(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.add_actions_to_plot_solution(), solvers.fv.FV.FV.add_actions_to_plot_solution(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.add_actions_to_plot_solution(), solvers.fv.EnclaveTasking.EnclaveTasking.add_entries_to_text_replacement_dictionary(), solvers.rkdg.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking.add_entries_to_text_replacement_dictionary(), api.solvers.CollocatedLowOrderDiscretisation.CollocatedLowOrderDiscretisation.add_implementation_files_to_project(), api.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.add_implementation_files_to_project(), solvers.aderdg.ADERDG.ADERDG.add_implementation_files_to_project(), solvers.api.CollocatedDLinearDiscretisationWithPointJacobi.CollocatedDLinearDiscretisationWithPointJacobi.add_implementation_files_to_project(), solvers.api.CollocatedMG.CollocatedMG.add_implementation_files_to_project(), solvers.api.ContinuousGalerkinDiscretisationGaussLobattoWithBlockJacobi.ContinuousGalerkinDiscretisationGaussLobattoWithBlockJacobi.add_implementation_files_to_project(), solvers.elliptic.AMRMarker.AMRMarker.add_to_Peano4_datamodel(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.add_to_Peano4_datamodel(), api.solvers.CollocatedLowOrderDiscretisation.CollocatedLowOrderDiscretisation.add_to_plot(), argument_name(), solvers.aderdg.SingleSweep.SingleSweep.create_action_sets(), solvers.fv.rusanov.LocalTimeStepWithEnclaveTasking.LocalTimeStepWithEnclaveTasking.create_action_sets(), solvers.fv.rusanov.SubcyclingAdaptiveTimeStepWithEnclaveTasking.SubcyclingAdaptiveTimeStepWithEnclaveTasking.create_action_sets(), solvers.fv.rusanov.SubcyclingFixedTimeStep.SubcyclingFixedTimeStep.create_action_sets(), solvers.fv.rusanov.SubcyclingFixedTimeStepWithEnclaveTasking.SubcyclingFixedTimeStepWithEnclaveTasking.create_action_sets(), solvers.rkdg.SeparateSweeps.SeparateSweeps.create_action_sets(), solvers.fv.SingleSweep.SingleSweep.create_data_structures(), delta_argument_name(), 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.rkdg.RungeKuttaDG.RungeKuttaDG.get_name_of_global_instance(), exahype2.api.Solver.Solver.get_name_of_solver_class(), api.solvers.Solver.Solver.name(), name(), exahype2.api.Solver.Solver.name(), solvers.api.Solver.Solver.name(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.name(), solvers.fv.FV.FV.name(), api.solvers.Solver.Solver.typename(), and solvers.api.Solver.Solver.typename().
|
protected |
Definition at line 182 of file AuxiliaryVariables.py.
Referenced by solvers.fv.FV.FV.__str__(), solvers.fv.FV.FV._init_dictionary_with_default_parameters(), create_data_structures(), solvers.fv.FV.FV.overlap(), and solvers.fv.FV.FV.overlap().
|
protected |
Definition at line 167 of file AuxiliaryVariables.py.
Referenced by owner().
|
protected |
Definition at line 181 of file AuxiliaryVariables.py.
Referenced by solvers.fv.FV.FV.__str__(), create_data_structures(), solvers.fv.FV.FV.create_readme_descriptor(), solvers.fv.FV.FV.get_coarsest_number_of_finite_volumes(), solvers.fv.FV.FV.get_finest_number_of_finite_volumes(), solvers.fv.FV.FV.get_max_number_of_spacetree_levels(), solvers.fv.FV.FV.get_min_number_of_spacetree_levels(), solvers.fv.FV.FV.patch_size(), and solvers.fv.FV.FV.patch_size().
|
protected |
Definition at line 157 of file AuxiliaryVariables.py.
Referenced by variable_positions(), and variables_declaration().
|
protected |
Definition at line 166 of file AuxiliaryVariables.py.
Referenced by create_data_structures(), and size().
|
protected |
Definition at line 156 of file AuxiliaryVariables.py.
Referenced by variable_names_per_entry(), and variables().
| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.patch = None |
Definition at line 178 of file AuxiliaryVariables.py.
Referenced by add_to_datamodel(), and create_data_structures().
| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.patch_overlap_current_time_step = None |
Definition at line 179 of file AuxiliaryVariables.py.
Referenced by add_to_datamodel(), and create_data_structures().
| exahype2.api.AuxiliaryVariables.AuxiliaryVariables.patch_overlap_update = None |
Definition at line 180 of file AuxiliaryVariables.py.
Referenced by add_to_datamodel(), and create_data_structures().
|
static |
Definition at line 76 of file AuxiliaryVariables.py.