|
Peano
|
First-order CCZ4 and an Euler fluid, coupled only at the begin and the end of each time step. More...
Public Member Functions | |
| __init__ (self, str ccz4_name="CCZ4", str euler_name="Euler") | |
| Create the two solvers and the auxiliary variables through which they see each other. | |
| str | name (self) |
| solvers (self) | |
| The solvers the project has to register; exahype2.api.Project.add_solver() asks for them. | |
| generate_solver_realisation (self, exahype2_project, peano_project, setup_simulation, time_step, plot, mesh_adaptation) | |
| Realise both solvers, couple their time stepping graphs, and add the outcome to the project's graphs. | |
Data Fields | |
| ccz4 = FOCCZ4Solver(ccz4_name) | |
| euler = Euler(euler_name) | |
| euler_auxiliary_copies | |
| ccz4_auxiliary_copies | |
| name | |
| solvers | |
Static Public Attributes | |
| str | EULER_AUXILIARY_COPIES_NAME = "EulerFields" |
| str | CCZ4_AUXILIARY_COPIES_NAME = "CCZ4Fields" |
| str | PREP_TASK_NAME = "Prepare auxiliary variables from {}" |
| str | SYNCHRONISE_TASK_NAME = "Synchronise time step sizes" |
Protected Member Functions | |
| _couple (self, exahype2_project, peano_project, time_step) | |
| Add the preamble and the final task around the concatenated graphs. | |
| _create_prep_task (self, time_step, source_solver, target_solver, auxiliary_copies) | |
| Create the task that fills the auxiliary variables of one solver with the solution of the other one. | |
Protected Attributes | |
| str | _name = f"{ccz4_name}With{euler_name}" |
First-order CCZ4 and an Euler fluid, coupled only at the begin and the end of each time step.
The class hosts one exagrype.api.FOCCZ4Solver (ccz4) and one exagrype.api.euler.Euler (euler). Add the host, not its solvers, to the project. The coupling is additive and affects the begin and the end of a time step only. In between, the solvers are independent, i.e. each solver brings its own numerical scheme and the schemes can differ in their time stepping, patch size and halo. Assign them to the solvers as for any other solver:
coupled = exagrype.api.CCZ4WithEuler_OuterAdditiveCoupling() coupled.ccz4.numerical_scheme = exahype2.api.rkfd4.CentralDifferencesWithRungeKutta(coupled.ccz4, 8, rk_order=4) coupled.euler.numerical_scheme = exahype2.api.fv.RusanovWithExplicitEuler(coupled.euler, 17)
The host sets no initial conditions. Add them to the solvers as to any other solver:
coupled.ccz4.add_pde_term(exagrype.api.initialvalues.gauge_wave())
(Euler brings a smooth wave by default.)
If you prefer one numerical scheme for the whole compound, use the coupling per stage instead (Coupling different solvers).
Each solver reads all variables of the other one as auxiliary variables: ccz4 holds the set EulerFields (5 entries, resolved on the patch of CCZ4), euler holds the set CCZ4Fields (58 entries, resolved on the patch of Euler). The sets are read-only for the solvers, but they sit on the faces, and they change from time step to time step. The solvers hold no persistent copy of the fields of the other solver, i.e. the sets are temporary in the sense that they are overwritten at the begin of each time step. They do not change within a time step (exahype2.api.AuxiliaryVariables.Mode.STATIONARY_THROUGHOUT_TIME_STEPS_ON_FACES), i.e. the Runge-Kutta scheme of CCZ4 reconstructs the halo of the Euler fields in its first stage only and holds it through the later stages.
The time step graph of the host is the concatenation of the graphs of the two solvers, preceded and followed by tasks of the host:
The two prep tasks run in parallel. Both solver graphs wait for both prep tasks, i.e. the arrows into the solver graphs end at the first tasks of each graph, and the arrows out of them start at their last tasks. Load balancing and dynamic mesh refinement wrap the whole picture.
The synchronisation takes the minimum of the two time step sizes, as this is the conservative choice: the common step then respects the CFL condition of both solvers.
The restriction sits in the prep task although the mesh of the benchmark is regular. The prep task is the one place that writes new face data, and restriction belongs to the writer (exahype2.api.adrs). It facilitates overlapping domain decomposition and flux-preserving interpolation, which this class does not use.
The coupling is bi-directional in the data, but a solver only sees the state of the other one at the begin of the time step. Neither the Einstein equations nor the Euler equations make use of the data yet: the PDE terms ignore the auxiliary variables unless you overwrite them.
CCZ4 owns the load balancing and the dynamic mesh refinement.
Definition at line 15 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.__init__ | ( | self, | |
| str | ccz4_name = "CCZ4", | ||
| str | euler_name = "Euler" ) |
Create the two solvers and the auxiliary variables through which they see each other.
The coupling happens at the begin and at the end of the time step only, so the numerical schemes of the solvers remain flexible.
| ccz4_name | str Name of the CCZ4 solver. |
| euler_name | str Name of the Euler solver. |
Definition at line 120 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
|
protected |
Add the preamble and the final task around the concatenated graphs.
| exahype2_project | exahype2.api.Project The project that hosts the system. |
| peano_project | peano4.api.Project The Peano project that the exahype2 project assembles. |
| time_step | peano4.api.taskgraph.Graph The concatenation of the time step graphs of both solvers. It receives the new tasks. All its source tasks are first tasks of a solver, and all its sink tasks (but the global ones) are last tasks of a solver. |
Definition at line 212 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
References _create_prep_task(), ccz4, ccz4_auxiliary_copies, euler, euler_auxiliary_copies, and SYNCHRONISE_TASK_NAME.

|
protected |
Create the task that fills the auxiliary variables of one solver with the solution of the other one.
auxiliary copies (auxiliary_copies) of the target solver (copy, with auxiliary variables auxiliary_copies of the target solver (copy, with interpolation if the patches differ in size), projects them onto the faces, restricts them on hanging faces, and rolls the faces over. It is added to time_step, but no dependencies are set: the caller wires it. It is the one place that writes new face data.
| time_step | peano4.api.taskgraph.Graph Receives the task. |
| source_solver | exahype2.api.Solver Provides the data. |
| target_solver | exahype2.api.Solver Holds the auxiliary variables. |
| auxiliary_copies | exahype2.api.AuxiliaryVariables The auxiliary variables of the target solver. |
Definition at line 264 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
References PREP_TASK_NAME.
Referenced by _couple().

| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.generate_solver_realisation | ( | self, | |
| exahype2_project, | |||
| peano_project, | |||
| setup_simulation, | |||
| time_step, | |||
| plot, | |||
| mesh_adaptation ) |
Realise both solvers, couple their time stepping graphs, and add the outcome to the project's graphs.
The arguments are those of exahype2.api.Solver.generate_solver_realisation(). Both solvers are realised without global tasks. The load balancing and the dynamic mesh refinement wrap the coupled time step graph afterwards, through the scheme of CCZ4.
Definition at line 163 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
| str exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.name | ( | self | ) |
Definition at line 155 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
References dastgen2.attributes.Attribute.Attribute._name, dastgen2.attributes.BooleanArray.BooleanArray._name, dastgen2.attributes.Enumeration.Enumeration._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().

| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.solvers | ( | self | ) |
The solvers the project has to register; exahype2.api.Project.add_solver() asks for them.
Definition at line 159 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
|
protected |
Definition at line 152 of file CCZ4WithEuler_OuterAdditiveCoupling.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(), exahype2.api.AuxiliaryVariables.AuxiliaryVariables.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(), exahype2.api.AuxiliaryVariables.AuxiliaryVariables.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(), 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.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().
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.ccz4 = FOCCZ4Solver(ccz4_name) |
Definition at line 135 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by _couple(), exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.create_task_graph(), exagrype.api.FOSOSolver.FOSOSolver.numerical_scheme(), exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.partner_task_names(), solvers(), exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling.solvers(), exagrype.api.FOSOSolver.FOSOSolver.solvers(), exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling.solvers(), and exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling.solvers().
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.ccz4_auxiliary_copies |
Definition at line 144 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by _couple().
|
static |
Definition at line 113 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.euler = Euler(euler_name) |
Definition at line 136 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by _couple(), solvers(), and exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling.solvers().
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.euler_auxiliary_copies |
Definition at line 138 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by _couple().
|
static |
Definition at line 111 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.name |
Definition at line 181 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by solvers.aderdg.kernels.Gemms.Gemms.__init__(), 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.Particle.Particle._dependency_checks_modify_steps(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._insert_constraint_enforcement(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._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(), exaparty.api.particle.tests.DisappearingParticleTest.DisappearingParticleTest.algorithm_steps(), exaparty.api.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.algorithm_steps(), exahype2.api.dslhype2.Expressions.Variable.convert_indices_to_integers(), exahype2.api.dslhype2.Expressions.Variable.convert_integers_to_indices(), exahype2.api.Solver.Solver.Plotter.create_finish_call(), exahype2.api.Solver.Solver.Plotter.create_is_active_predicate(), exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.create_task_graph(), 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(), exahype2.api.dslhype2.Expressions.Variable.get_name(), peano4.api.solversteps.Step.Step.get_observer_class_name(), dastgen2.attributes.Enumeration.Enumeration.get_to_string(), exahype2.api.dslhype2.Expressions.Variable.get_type(), exahype2.api.dslhype2.Expressions.Variable.get_value(), and exaparty.api.particle.Particle.Particle.readme_descriptor().
|
static |
Definition at line 115 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by _create_prep_task(), and exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling._create_prep_task().
| exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.solvers |
Definition at line 183 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
|
static |
Definition at line 117 of file CCZ4WithEuler_OuterAdditiveCoupling.py.
Referenced by _couple(), and exagrype.api.scalarfield.InnerCouplingGenerator.InnerCouplingGenerator.construct_output().