|
Peano
|
Solver for the Einstein equations in the first-order CCZ4 formulation. More...


Data Structures | |
| class | EnforceCCZ4Constraint |
| When to push the solution back onto the algebraic CCZ4 constraints. More... | |
Public Member Functions | |
| __init__ (self, str name, Dict[str, Union[int, float]] parameters=None, exahype2.api.InitPointWisely initial_condition=None) | |
| Create a CCZ4 solver. | |
| List[str] | lopsided_advection_quantities (self) |
| The unknowns whose advection terms exagrype::ccz4::ncp() omits. | |
| enforce_ccz4_constraint (self, "CCZ4Solver.EnforceCCZ4Constraint" value) | |
| Set when the solver pushes the solution back onto the CCZ4 constraints. | |
| generate_solver_realisation (self, exahype2_project, peano_project, setup_simulation, time_step, plot, mesh_adaptation) | |
| Create the solver's task graphs and insert the constraint enforcement. | |
| Dict[str, Union[int, float]] | parameters (self) |
| The CCZ4 parameters the solver is generated with (read-only copy). | |
Public Member Functions inherited from exahype2.api.Solver.Solver | |
| str | __str__ (self) |
| str | name (self) |
| Unique solver name. | |
| "Solver.NumericalScheme" | numerical_scheme (self) |
| numerical_scheme (self, "Solver.NumericalScheme" value) | |
| List["Solver.Plotter"] | plotters (self) |
| All plotters of the solver, in the order they have been added. | |
| add_plotter (self, "Solver.Plotter" plotter) | |
| Add a plotter to the solver. | |
| "Solver.Plotter" | plotter (self) |
| Shorthand for solvers with at most one plotter. | |
| plotter (self, "Solver.Plotter" value) | |
| int | unknowns (self) |
| int | auxiliary_variables (self) |
| str | user_solver_includes (self) |
| Add further includes to this property, if your solver requires some additional routines from other header files. | |
| add_user_solver_includes (self, str value) | |
| Add further includes to this property, if your solver requires some additional routines from other header files. | |
| set_solver_constants (self, str datastring) | |
| add_solver_constants (self, str datastring) | |
| List[str] | variable_names_per_entry (self) |
| One name per entry of Q, i.e. | |
| str | get_name_of_global_instance (self) |
| List[PDETerm] | pde_terms (self) |
| All PDE terms (flux, eigenvalues, ...) registered with this solver, in registration order. | |
| bool | requires_user_class (self) |
| True iff at least one PDE term has no implementation. | |
| str | get_name_of_solver_class (self) |
| Name of the C++ class the solver repository instantiates: <SolverName> if requires_user_class, Abstract<SolverName> otherwise. | |
| add_pde_term (self, PDETerm term) | |
| Register a PDE term with this solver, or replace the one already registered under the same name and statelessness. | |
| remove_pde_term (self, str name, bool stateless=False) | |
| Remove a previously registered PDE term by name and statelessness. | |
| PDETerm | get_pde_term (self, str name, bool stateless=False) |
| Look up a previously registered PDE term by name and statelessness. | |
| add_abstract_solver_attribute (self, str declaration) | |
| Add a raw C++ member attribute declaration to the generated Abstract<SolverName> class (. | |
| add_abstract_solver_method (self, str declaration, Callable[[str], str] definition_generator) | |
| Add a raw C++ method to the generated Abstract<SolverName> class: declaration goes into the class body (public section), verbatim. | |
| str | create_readme_descriptor (self, domain_offset, domain_size) |
| Return a human-readable description of this solver instance, to be embedded into the generated project's README. | |
Data Fields | |
| name | |
| user_solver_includes | |
Data Fields inherited from exahype2.api.Solver.Solver | |
| solver_generator | |
| pde_terms | |
| True iff at least one PDE term has no implementation. | |
| mesh_adaptation | |
| Turn this solver specification into a task graph and create the required C++ kernels/stubs. | |
Static Public Attributes | |
| Unknowns | |
| dict | DefaultParameters |
| str | ADVECTION_VELOCITY = "shift" |
Static Public Attributes inherited from exahype2.api.Solver.Solver | |
| str | SolutionUpdateTaskTag = "exahype2.api.Solver.SolutionUpdateTaskTag" |
| Tag of all tasks which write a new solution. | |
| str | IntermediateSolutionUpdateTag = "exahype2.api.Solver.IntermediateSolutionUpdateTag" |
| Tag of all tasks which write an intermediate solution. | |
Protected Member Functions | |
| _tasks_of_this_solver (self, time_step, tag) | |
| Tasks of time_step which carry tag and belong to this solver, as the graph holds the tasks of all solvers. | |
| _insert_constraint_enforcement (self, time_step, anchors, patch) | |
| Insert the enforcement of the CCZ4 constraints after anchors. | |
Protected Member Functions inherited from exahype2.api.Solver.Solver | |
| int | _register_variables (self, VariableSpecification variables, int offset) |
| Translate a plain int or a name-to-multiplicity dict into a total variable count, and - for the dict case - add each name's position within Q to _variable_positions. | |
| str | _get_default_includes (self) |
| Includes every generated action set can rely on being available, regardless of which action sets a concrete discretisation (e.g. | |
| str | _unknown_identifier (self) |
| _add_wants_to_plot_to_solver (self) | |
| Add wantsToPlot() to the solver's C++ class: It holds if any of the solver's plotters is active (exahype2.api.Solver.Solver.Plotter). | |
| _add_checkpoint_meta_data_to_solver (self) | |
| Override exahype2::Solver::toCheckpointMetaData() in the solver's C++ class such that it also writes the attributes added through add_abstract_solver_attribute(), e.g. | |
Static Protected Member Functions | |
| str | _ncp_implementation () |
| The Finite Volume kernels hand over the jump deltaQ along one normal, the fourth-order Finite Differences of exahype2.api.rkfd4 the derivative along one normal times the mesh width, whereas exagrype::ccz4::ncp() expects the gradient along all three directions. | |
| str | _source_implementation () |
| str | _max_eigenvalue_implementation () |
Protected Attributes | |
| _enforce_ccz4_constraint | |
| One task after all writers of the new solution: The optimistic Finite Volumes write it in one of two tasks, depending on the cell. | |
| _parameters | |
| _patch | |
| One task after all writers of the new solution: The optimistic Finite Volumes write it in one of two tasks, depending on the cell. | |
Protected Attributes inherited from exahype2.api.Solver.Solver | |
| _name | |
| Create solver. | |
| _unknowns | |
| _auxiliary_variables | |
| _user_solver_includes | |
| _solver_constants | |
| _numerical_scheme | |
| _plotters | |
| All plotters of the solver, in the order they have been added. | |
Solver for the Einstein equations in the first-order CCZ4 formulation.
The solver is a plain exahype2.api.Solver with the 59 CCZ4 unknowns and the PDE terms of CCZ4 pre-registered. All terms delegate to the ExaGRyPE library (configure Peano with –enable-exagrype):
Definition at line 16 of file CCZ4Solver.py.
| exagrype.api.CCZ4Solver.CCZ4Solver.__init__ | ( | self, | |
| str | name, | ||
| Dict[str, Union[int, float]] | parameters = None, |
||
| exahype2.api.InitPointWisely | initial_condition = None |
||
| ) |
Create a CCZ4 solver.
| name | str Name of the solver, |
| parameters | Dict[str, Union[int, float]] CCZ4 parameters that differ from DefaultParameters, e.g. {"CCZ4k1": 0.0}. Keys which are not in DefaultParameters are rejected, as they most likely are typos. |
| initial_condition | exahype2.api.InitPointWisely Initial condition. Defaults to exagrype.api.initialvalues.gauge_wave(). Pass any other routine from exagrype.api.initialvalues, or your own exahype2.api.InitPointWisely. |
Reimplemented from exahype2.api.Solver.Solver.
Definition at line 148 of file CCZ4Solver.py.
References exagrype.api.CCZ4Solver.CCZ4Solver.__init__(), and exagrype.api.CCZ4Solver.CCZ4Solver.Unknowns.
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.__init__().


|
protected |
Insert the enforcement of the CCZ4 constraints after anchors.
The routine creates a task which applies exagrype::ccz4::enforceCCZ4constraints() to each volume or grid point of patch, and inserts it directly after all anchors via peano4.api.taskgraph.Graph.insert_after(). The anchors' successors, e.g. the projection onto the faces, hence see the constrained data only. The task uses the solver's cell guard: If several anchors write patch, each cell is updated by one of them, and the task runs once per cell after all of them.
| time_step | peano4.api.taskgraph.Graph The time stepping task graph which holds the anchors. |
| anchors | List[peano4.api.taskgraph.Task] The tasks which write patch. If the list is empty, the routine does nothing. |
| patch | peano4.api.datamodel.Patch The cell data which the anchors write, i.e. the solution or a stage input. |
Definition at line 403 of file CCZ4Solver.py.
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.generate_solver_realisation().

|
staticprotected |
Definition at line 489 of file CCZ4Solver.py.
|
staticprotected |
The Finite Volume kernels hand over the jump deltaQ along one normal, the fourth-order Finite Differences of exahype2.api.rkfd4 the derivative along one normal times the mesh width, whereas exagrype::ccz4::ncp() expects the gradient along all three directions.
We hence embed the jump into an otherwise empty gradient.
Definition at line 459 of file CCZ4Solver.py.
Referenced by solvers.rkdg.RungeKuttaDG.RungeKuttaDG.__str__(), solvers.aderdg.ADERDG.ADERDG._init_dictionary_with_default_parameters(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._init_dictionary_with_default_parameters(), solvers.aderdg.AbstractSolverDeclarations.AbstractSolverDeclarations.create_abstract_solver_user_declarations(), solvers.aderdg.AbstractSolverDefinitions.AbstractSolverDefinitions.create_abstract_solver_user_definitions(), solvers.aderdg.SolverDeclarations.SolverDeclarations.create_solver_user_declarations(), solvers.aderdg.SolverDefinitions.SolverDefinitions.create_solver_user_definitions(), solvers.aderdg.ADERDG.ADERDG.set_implementation(), solvers.fv.musclhancock.GlobalAdaptiveTimeStep.GlobalAdaptiveTimeStep.set_implementation(), solvers.fv.musclhancock.GlobalFixedTimeStep.GlobalFixedTimeStep.set_implementation(), solvers.fv.rusanov.GlobalAdaptiveTimeStep.GlobalAdaptiveTimeStep.set_implementation(), solvers.fv.rusanov.GlobalAdaptiveTimeStepWithEnclaveTasking.GlobalAdaptiveTimeStepWithEnclaveTasking.set_implementation(), solvers.fv.rusanov.GlobalFixedTimeStep.GlobalFixedTimeStep.set_implementation(), solvers.fv.rusanov.GlobalFixedTimeStepWithEnclaveTasking.GlobalFixedTimeStepWithEnclaveTasking.set_implementation(), solvers.fv.rusanov.LocalTimeStepWithEnclaveTasking.LocalTimeStepWithEnclaveTasking.set_implementation(), solvers.fv.rusanov.SubcyclingAdaptiveTimeStepWithEnclaveTasking.SubcyclingAdaptiveTimeStepWithEnclaveTasking.set_implementation(), solvers.fv.rusanov.SubcyclingFixedTimeStep.SubcyclingFixedTimeStep.set_implementation(), solvers.fv.rusanov.SubcyclingFixedTimeStepWithEnclaveTasking.SubcyclingFixedTimeStepWithEnclaveTasking.set_implementation(), and solvers.rkdg.RungeKuttaDG.RungeKuttaDG.set_implementation().

|
staticprotected |
Definition at line 482 of file CCZ4Solver.py.
|
protected |
Tasks of time_step which carry tag and belong to this solver, as the graph holds the tasks of all solvers.
Definition at line 392 of file CCZ4Solver.py.
References solvers.aderdg.kernels.Gemms.Gemms.name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.name(), solvers.fv.FV.FV.name(), convert::data::Variable.name, dastgen2.attributes.Attribute.Attribute.name(), dastgen2.DataModel.DataModel.name(), exagrype.api.CCZ4Solver.CCZ4Solver.name, exahype2.api.PDETerm.PDETerm.name, exahype2.api.Solver.Solver.Plotter.name, exahype2.api.Solver.Solver.name(), exaparty.api.particle.AlgorithmStep.AlgorithmStep.name, exaparty.api.particle.Particle.Particle.name, exaparty.api.particle.tests.DisappearingParticleTest.DisappearingParticleTest.name, exaparty.api.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.name, solvers.api.Solver.Solver.name(), api.solvers.Solver.Solver.name(), peano4.api.datamodel.DoF.DoF.name, peano4.api.solversteps.Step.Step.name, peano4.api.solversteps.UserActionSet.UserActionSet.name, peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationActionSet.name, peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationSubmodel.name, peano4.api.taskgraph.Task.Task.name, peano4.api.toolbox.particles.Particle.Particle.name, test_derive_load_store_compute_flag._FakeSubmodel.name, test_fuse_steps._FakeActionSet.name, test_fuse_steps._FakeSubmodel.name, test_propagate_use_statements._FakeSubmodel.name, and test_task_groups._FakeActionSet.name.
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.generate_solver_realisation().


| exagrype.api.CCZ4Solver.CCZ4Solver.enforce_ccz4_constraint | ( | self, | |
| "CCZ4Solver.EnforceCCZ4Constraint" | value | ||
| ) |
Set when the solver pushes the solution back onto the CCZ4 constraints.
By default, the solver does not enforce the constraints. If you switch the enforcement on, generate_solver_realisation() inserts a task which applies exagrype::ccz4::enforceCCZ4constraints() to each volume or grid point after each tagged solution update of the numerical scheme.
| value | CCZ4Solver.EnforceCCZ4Constraint No, OnlyFinalSolution or IntermediateSteps. |
Definition at line 269 of file CCZ4Solver.py.
References exagrype.api.CCZ4Solver.CCZ4Solver._enforce_ccz4_constraint.
| exagrype.api.CCZ4Solver.CCZ4Solver.generate_solver_realisation | ( | self, | |
| exahype2_project, | |||
| peano_project, | |||
| setup_simulation, | |||
| time_step, | |||
| plot, | |||
| mesh_adaptation | |||
| ) |
Create the solver's task graphs and insert the constraint enforcement.
The routine first calls the superclass, which lets the grid construction, the numerical scheme and the plotter add their tasks. If the constraint enforcement is switched on (enforce_ccz4_constraint()), it afterwards inserts the enforcement after each tagged solution update of the numerical scheme. Which patch a tagged task writes and which guard it uses depends on the scheme, so the routine distinguishes the schemes explicitly (Manipulate an existing solver's steps (e.g. inserting additional sweeps)). It raises an exception for any other scheme.
All insertions work on the patch which the tagged tasks write and use the cell guard:
The scheme's log of the time stepping graph does not show the enforcement. With TEXT or VISUALISATION logging, the routine hence logs the graph once more.
Reimplemented from exahype2.api.Solver.Solver.
Definition at line 291 of file CCZ4Solver.py.
References exagrype.api.CCZ4Solver.CCZ4Solver._enforce_ccz4_constraint, exagrype.api.CCZ4Solver.CCZ4Solver._insert_constraint_enforcement(), exagrype.api.CCZ4Solver.CCZ4Solver._tasks_of_this_solver(), ScenarioFactory.createScenario(), exagrype.api.CCZ4Solver.CCZ4Solver.generate_solver_realisation(), exahype2.api.Solver.Solver.numerical_scheme(), and exahype2.api.Solver.Solver.numerical_scheme().
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.generate_solver_realisation().


| List[str] exagrype.api.CCZ4Solver.CCZ4Solver.lopsided_advection_quantities | ( | self | ) |
The unknowns whose advection terms exagrype::ccz4::ncp() omits.
exagrype::ccz4::ncp() is invoked with its advection switched off. The unknowns returned are those whose advection terms \( \\beta^k \\partial _k Q \) hence have to be added by the numerical scheme, e.g. via
These are all unknowns besides the conformal metric G, the lapse, the shift, phi and K0: The advection terms of the metric, the lapse, the shift and phi are part of the algebraic source (exagrype::ccz4::source()), which expresses them through the auxiliary unknowns, i.e. the first derivatives. K0 does not evolve.
The advection of b and of the derivatives of the shift (dxShift, dyShift, dzShift) is scaled with CCZ4bs and CCZ4sk. If either of them is zero, the routine leaves these unknowns out.
The equation of b couples the advection of b and of Ghat (the unknown Z): Its advection terms are CCZ4sk * (CCZ4xi * beta^k d_k Ghat + CCZ4bs * (beta^k d_k b - beta^k d_k Ghat)). A kernel which advects each quantity on its own, i.e. adds beta^k d_k b to b, reproduces this only for CCZ4xi=1, CCZ4bs=1 and CCZ4sk=1. This is the case for the default CCZ4xi and the moving puncture setups with CCZ4bs=CCZ4sk=1.
Definition at line 223 of file CCZ4Solver.py.
References exagrype.api.CCZ4Solver.CCZ4Solver._parameters, and exagrype.api.CCZ4Solver.CCZ4Solver.Unknowns.
| Dict[str, Union[int, float]] exagrype.api.CCZ4Solver.CCZ4Solver.parameters | ( | self | ) |
The CCZ4 parameters the solver is generated with (read-only copy).
Definition at line 452 of file CCZ4Solver.py.
References exagrype.api.CCZ4Solver.CCZ4Solver._parameters.
|
protected |
One task after all writers of the new solution: The optimistic Finite Volumes write it in one of two tasks, depending on the cell.
One task after each stage, as the stages run one after the other
Definition at line 174 of file CCZ4Solver.py.
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.enforce_ccz4_constraint(), and exagrype.api.CCZ4Solver.CCZ4Solver.generate_solver_realisation().
|
protected |
Definition at line 176 of file CCZ4Solver.py.
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.lopsided_advection_quantities(), and exagrype.api.CCZ4Solver.CCZ4Solver.parameters().
|
protected |
One task after all writers of the new solution: The optimistic Finite Volumes write it in one of two tasks, depending on the cell.
Definition at line 372 of file CCZ4Solver.py.
Referenced by solvers.fv.FV.FV._init_dictionary_with_default_parameters(), solvers.fv.FV.FV.add_actions_to_checkpoint_solution(), solvers.fv.FV.FV.add_actions_to_plot_solution(), ccz4.CCZ4Solver.add_Psi4W(), solvers.fv.FV.FV.add_to_Peano4_datamodel(), solvers.fv.FV.FV.add_use_data_statements_to_Peano4_solver_step(), and api.ApplyPointWiselyToPatch.ApplyPointWiselyToPatch.get_body_of_operation().
|
static |
Definition at line 140 of file CCZ4Solver.py.
|
static |
Definition at line 113 of file CCZ4Solver.py.
| exagrype.api.CCZ4Solver.CCZ4Solver.name |
Definition at line 432 of file CCZ4Solver.py.
Referenced by solvers.aderdg.kernels.Gemms.Gemms.__repr__(), test_derive_load_store_compute_flag._FakeSubmodel.__repr__(), test_propagate_use_statements._FakeSubmodel.__repr__(), exaparty.api.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.__setup_algorithm_steps(), exaparty.api.particle.AlgorithmStep.AlgorithmStep.__str__(), exahype2.api.Solver.Solver.Plotter._add_time_interval_bookkeeping_to_solver(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4Solver.CCZ4Solver._tasks_of_this_solver(), peano4.api.datamodel.DoF.DoF.additional_load_and_store_arguments_for_other_dof(), exaparty.api.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), exahype2.api.Solver.Solver.Plotter.create_finish_call(), exahype2.api.Solver.Solver.Plotter.create_is_active_predicate(), peano4.api.solversteps.UserActionSet.UserActionSet.get_action_set_name(), peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationActionSet.get_action_set_name(), test_fuse_steps._FakeActionSet.get_action_set_name(), peano4.api.datamodel.DoF.DoF.get_full_qualified_type(), peano4.api.datamodel.DoF.DoF.get_logical_type_name(), peano4.api.solversteps.Step.Step.get_observer_class_name(), dastgen2.attributes.Enumeration.Enumeration.get_to_string(), and exaparty.api.particle.Particle.Particle.readme_descriptor().
|
static |
Definition at line 85 of file CCZ4Solver.py.
Referenced by exagrype.api.CCZ4Solver.CCZ4Solver.__init__(), and exagrype.api.CCZ4Solver.CCZ4Solver.lopsided_advection_quantities().
| exagrype.api.CCZ4Solver.CCZ4Solver.user_solver_includes |
Definition at line 446 of file CCZ4Solver.py.
Referenced by solvers.fv.FV.FV._init_dictionary_with_default_parameters(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG._init_dictionary_with_default_parameters(), solvers.fv.EnclaveTasking.EnclaveTasking.add_implementation_files_to_project(), solvers.rkdg.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking.add_implementation_files_to_project(), solvers.aderdg.ADERDG.ADERDG.add_user_solver_includes(), solvers.aderdg.ADERDG.ADERDG.get_user_solver_includes(), and solvers.aderdg.ADERDG.ADERDG.set_implementation().