1""" This file is part of the ExaGRyPE project. For conditions of distribution and
2 use, please see the copyright notice at www.peano-framework.org
5from typing
import Dict, Union
9from .CCZ4SolverBase
import CCZ4SolverBase
15 Solver for the Einstein equations in the first-order CCZ4 formulation
17 The solver is a plain exahype2.api.Solver with the 58 CCZ4 unknowns and
18 the PDE terms of CCZ4 pre-registered. All terms delegate to the
19 ExaGRyPE library (configure Peano with --enable-exagrype):
21 - the non-conservative product to exagrype::ccz4::ncpFirstOrder(),
22 plus the advection terms if the numerical scheme does not add them
23 (@ref exagrype.api.CCZ4SolverBase.CCZ4SolverBase.ncp_adds_advection());
24 it is registered only when the solver is realised,
25 - the volumetric source to exagrype::ccz4::sourceFirstOrder(),
26 - the maximum eigenvalue to exagrype::ccz4::maxEigenvalue().
28 The solver has no initial condition. Add one as for any other solver,
29 e.g. a routine of exagrype.api.initialvalues via add_pde_term().
31 CCZ4 has no conservative flux. You still have to assign a numerical
32 scheme, a grid construction and (optionally) a plotter, exactly as for
33 any other exahype2.api.Solver, and to add the solver to an
34 exahype2.api.Project. The project has to be three-dimensional: the
35 generated solver class refuses to compile otherwise.
39 - The fourth-order Finite Differences of the production runs are
40 available through exahype2.api.rkfd4, i.e. pass a
41 CentralDifferencesWithRungeKutta as numerical scheme. They have no
42 artificial dissipation. exagrype.api.FD4WithKODissipation is the same
43 scheme with a Kreiss-Oliger dissipation on top. Unlike the legacy
44 ExaGRyPE, neither supports adaptive mesh refinement yet.
45 - The solution is pushed back onto the CCZ4 constraints
46 (exagrype::ccz4::enforceCCZ4constraints()) only if you switch it on
47 via enforce_ccz4_constraint(). Without it, long runs drift away from
48 the constraint surface.
49 - The advection terms @f$ \\beta^k \\partial _k Q @f$ of all
50 unknowns besides the metric, the lapse, the shift and phi (whose
51 advection is part of the algebraic source) are added either by the
52 fourth-order Finite Differences, if you select their kernel
53 CentralDifferencesWithLopsidedAdvection with ADVECTION_VELOCITY and
54 advected_quantities(), or by the non-conservative product
55 with central differences otherwise. The Finite Volumes of
56 exahype2.api.fv add none of them, i.e. they evolve CCZ4 without
58 (@ref exagrype.api.CCZ4SolverBase.CCZ4SolverBase.ncp_adds_advection()).
59 - Black holes are limited to a single one
60 (exagrype.api.initialvalues.single_black_hole()). Tracers and the
61 ADM/Psi4 postprocessing are not available yet. The second-order
62 formulation is exagrype.api.FOSOCCZ4Solver.
87 The 58 unknowns of the first-order CCZ4 formulation in the order the
88 kernels in exagrype::ccz4 expect them: 25 primary entries (up to phi)
89 followed by the 33 first derivatives. Kex is the trace of the extrinsic
90 curvature, whereas K holds the six entries of the trace-free conformal
98 parameters: Dict[str, Union[int, float]] =
None,
102 Create a first-order CCZ4 solver
105 Name of the solver (@ref exahype2.api.Solver).
107 @param parameters: Dict[str, Union[int, float]]
108 CCZ4 parameters that differ from DefaultParameters, e.g.
109 {"CCZ4k1": 0.0}. Keys which are not in DefaultParameters are
110 rejected, as they most likely are typos.
116 """! The secondary entries follow the 25 primary ones"""
118 ::exagrype::ccz4::ncpFirstOrder(
119 BTimesDeltaQ, BTimesDeltaQ + 25,
122 normal, CCZ4LapseType, CCZ4c, CCZ4e, CCZ4f, CCZ4b, CCZ4s, CCZ4mu
128 tarch::memset(S, 0, {sum(self.Unknowns.values())} * sizeof(double));
129 ::exagrype::ccz4::sourceFirstOrder(
132 CCZ4LapseType, CCZ4c, CCZ4e, CCZ4f, CCZ4b, CCZ4s, CCZ4itau, CCZ4eta, CCZ4k1, CCZ4k2, CCZ4k3
Everything the first-order and the second-order CCZ4 solvers share.
Solver for the Einstein equations in the first-order CCZ4 formulation.
__init__(self, str name, Dict[str, Union[int, float]] parameters=None)
Create a first-order CCZ4 solver.
str _source_implementation(self)
C++ which calls the source term kernel.
str _ncp_implementation(self)
The secondary entries follow the 25 primary ones.