|
Peano
|
Namespaces | |
| namespace | internal |
| namespace | tests |
Functions | |
| void | ncpFirstOrder (double *BgradQ, double *BgradQaux, const double *const Q, const double *const Qaux, const double *const gradQ, const double *const gradQaux, const int normal, const int CCZ4LapseType, const double CCZ4c, const double CCZ4e, const double CCZ4f, const int CCZ4b, const int CCZ4s, const double CCZ4mu) |
| Non-conservative product of the first-order CCZ4 formulation. | |
| void | ncpSecondOrder (double *BgradQ, const double *const Q, const double *const Qaux, const double *const gradQ, const double *const gradQaux, const int normal, const int CCZ4LapseType, const double CCZ4c, const double CCZ4e, const double CCZ4f, const int CCZ4b, const int CCZ4s, const double CCZ4mu) |
| Second-order variant of ncpFirstOrder(): updates the 25 primary entries only. | |
| void | sourceFirstOrder (double *S, double *Saux, const double *const Q, const double *const Qaux, const int CCZ4LapseType, const double CCZ4c, const double CCZ4e, const double CCZ4f, const int CCZ4b, const int CCZ4s, const double CCZ4itau, const double CCZ4eta, const double CCZ4k1, const double CCZ4k2, const double CCZ4k3) |
| The source term is one out of two terms that we use in our CCZ4 formulation. | |
| void | sourceSecondOrder (double *S, const double *const Q, const double *const Qaux, const int CCZ4LapseType, const double CCZ4c, const double CCZ4e, const double CCZ4f, const int CCZ4b, const int CCZ4s, const double CCZ4itau, const double CCZ4eta, const double CCZ4k1, const double CCZ4k2, const double CCZ4k3) |
| Second-order variant of sourceFirstOrder(): updates the 25 primary entries only. | |
| void | maxEigenvalue (const double *const Q, int normal, const double CCZ4e, const double CCZ4GLMc, const double CCZ4GLMd, double *maxEigenvalue) |
| void | admconstraints (double *constraints, const double *const Q, const double *const gradQSerialised) |
| This is a postprocessing routine to monitor if the physical constraints are fulfilled. | |
| void | ThetaOutputNCP (double *NCPterm, const double *const Q, const double *const gradQSerialised, int normal) |
| A temporary test function, to output Hamilton constraint related term in theta, 1 terms: RPlusTwoNablaZNCP. | |
| void | TestingOutput (double *terms, const double *const Q, const double *const gradQSerialised) |
| A temporary test function, to output some testing values 0,1 entries: Hamilton constraint related term in theta, 2 terms: RPlusTwoNablaZSrc, pure Src 2-10 entry: no-symmetry version of R_ij. | |
| void | Psi4Calc (double *Psi4, const double *const Q, const double *const gradQSerialised, double *coor) |
| This function is for the calculation of psi4, a quantity related to gravitional wave. | |
| void | enforceCCZ4constraints (double *__restrict__ Q) |
| A postprocessing routine which pushes the volume solution back into the area of the CCZ4 constraints. | |
| void | enforceCCZ4constraintsOfEvolvedVariables (double *__restrict__ Q) |
| The part of enforceCCZ4constraints() which only touches the first 25 unknowns. | |
| void | addKreissOligerDissipation (const double *__restrict__ QWithHalo, double *__restrict__ rightHandSide, const tarch::la::Vector< 3, double > &patchSize, int numberOfGridCellsPerPatchPerAxis, int haloSize, int unknowns, int auxiliaryVariables, double sigma, const int *quantities, int numberOfQuantities) |
| Add the Kreiss-Oliger dissipation of a patch to its right-hand side. | |
| void | recomputeAuxiliaryVariablesFD4_4thOrder (::exahype2::CellData< double, double > &patchData, int numberOfGridCellsPerPatchPerAxis, int haloSize, int unknowns, int auxiliaryVariables) |
| Recompute auxiliary variables for FD4 scheme with a 4th order scheme. | |
| void | recomputeAuxiliaryVariablesFD4_centralDifferences (::exahype2::CellData< double, double > &patchData, int numberOfGridCellsPerPatchPerAxis, int haloSize, int unknowns, int auxiliaryVariables) |
| void | recomputeAuxiliaryVariablesFD4_leftDifferences (::exahype2::CellData< double, double > &patchData, int numberOfGridCellsPerPatchPerAxis, int haloSize, int unknowns, int auxiliaryVariables) |
| void | recomputeAuxiliaryVariablesFD4_rightDifferences (::exahype2::CellData< double, double > &patchData, int numberOfGridCellsPerPatchPerAxis, int haloSize, int unknowns, int auxiliaryVariables) |
| void | reconstructFirstDerivativesFD4 (const double *__restrict__ primaryVariablesWithHalo, const tarch::la::Vector< Dimensions, double > &patchSize, int numberOfGridCellsPerPatchPerAxis, int haloSize, double *__restrict__ firstDerivatives) |
| Reconstruct the 33 first derivatives of the 25 evolved CCZ4 unknowns. | |
| void | reconstructFirstDerivativesCentralDifferences (const double *__restrict__ primaryVariablesWithHalo, const tarch::la::Vector< Dimensions, double > &patchSize, int numberOfGridCellsPerPatchPerAxis, int haloSize, double *__restrict__ firstDerivatives) |
| Reconstruct the 33 first derivatives with second-order central differences. | |
| void exagrype::ccz4::addKreissOligerDissipation | ( | const double *__restrict__ | QWithHalo, |
| double *__restrict__ | rightHandSide, | ||
| const tarch::la::Vector< 3, double > & | patchSize, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | unknowns, | ||
| int | auxiliaryVariables, | ||
| double | sigma, | ||
| const int * | quantities, | ||
| int | numberOfQuantities ) |
Add the Kreiss-Oliger dissipation of a patch to its right-hand side.
The routine adds
\( \frac{\sigma}{64 \Delta x_d} (Q_{i-3} - 6 Q_{i-2} + 15 Q_{i-1} - 20 Q_i + 15 Q_{i+1} - 6 Q_{i+2} + Q_{i+3}) \)
per axis d to the right-hand side of each grid cell i of a patch, i.e. a sixth-order dissipation term which damps oscillations on the scale of the grid cells. \( \Delta x_d \) is the patch size along d divided by the number of grid cells per axis. The term is added to the selected quantities only, all other entries of the right-hand side remain unchanged.
The routine is the dissipation which the legacy fourth-order Finite Differences of ExaHyPE built into their kernels. These kernels have been removed. The Finite Differences of exahype2.api.rkfd4 have no dissipation. exagrype.api.FD4WithKODissipation invokes this routine after their right-hand side kernel, within each Runge-Kutta stage.
Both arrays are stored lexicographically in AoS format, i.e. all quantities of one grid cell are stored together, and the first axis runs fastest. The stencil reaches three grid cells into the halo, i.e. haloSize has to be at least three.
| QWithHalo | Input of the Runge-Kutta stage with its halo, i.e. (numberOfGridCellsPerPatchPerAxis+2*haloSize)^3 grid cells with unknowns+auxiliaryVariables entries each. |
| rightHandSide | Right-hand side of the stage without halo, i.e. numberOfGridCellsPerPatchPerAxis^3 grid cells with unknowns entries each. The routine adds the dissipation to it. |
| patchSize | Size of the patch, i.e. of the mesh cell. |
| quantities | Indices of the unknowns which are subject to the dissipation. Each index has to be smaller than unknowns. |
| numberOfQuantities | Number of entries of quantities. |
| void exagrype::ccz4::admconstraints | ( | double * | constraints, |
| const double *const | Q, | ||
| const double *const | gradQSerialised ) |
This is a postprocessing routine to monitor if the physical constraints are fulfilled.
Used in python script.
| void exagrype::ccz4::enforceCCZ4constraints | ( | double *__restrict__ | Q | ) |
A postprocessing routine which pushes the volume solution back into the area of the CCZ4 constraints.
This is a local operation that we can invoke after each time step per volume.
It works on the full set of 58 unknowns of the first-order formulation. It first calls enforceCCZ4constraintsOfEvolvedVariables() and then additionally makes the derivatives of the conformal metric trace-free.
| void exagrype::ccz4::enforceCCZ4constraintsOfEvolvedVariables | ( | double *__restrict__ | Q | ) |
The part of enforceCCZ4constraints() which only touches the first 25 unknowns.
These are the unknowns that the second-order formulation evolves (exagrype.api.FOSOCCZ4Solver). The routine gives the conformal metric the determinant one, makes the extrinsic curvature trace-free and bounds the lapse and phi from below. The derivatives of the metric, i.e. entries 37 to 54, are reconstructed from the metric in the second-order formulation and hence cannot violate any constraint on their own.
| void exagrype::ccz4::maxEigenvalue | ( | const double *const | Q, |
| int | normal, | ||
| const double | CCZ4e, | ||
| const double | CCZ4GLMc, | ||
| const double | CCZ4GLMd, | ||
| double * | maxEigenvalue ) |
References maxEigenvalue().
Referenced by maxEigenvalue().


| void exagrype::ccz4::ncpFirstOrder | ( | double * | BgradQ, |
| double * | BgradQaux, | ||
| const double *const | Q, | ||
| const double *const | Qaux, | ||
| const double *const | gradQ, | ||
| const double *const | gradQaux, | ||
| const int | normal, | ||
| const int | CCZ4LapseType, | ||
| const double | CCZ4c, | ||
| const double | CCZ4e, | ||
| const double | CCZ4f, | ||
| const int | CCZ4b, | ||
| const int | CCZ4s, | ||
| const double | CCZ4mu ) |
Non-conservative product of the first-order CCZ4 formulation.
The 58 entries of CCZ4 (see First-order CCZ4) are handed over as two pointers: one to the 25 primary entries (indices 0 to 24) and one to the 33 secondary entries (indices 25 to 57, i.e. the derivatives of the lapse, the shift, the metric and phi). The first-order formulation stores them contiguously and passes Q and Q+25. The second-order formulation (exagrype.api.FOSOCCZ4Solver) reconstructs the secondary entries from the primary ones and hence stores them in separate memory, namely in its auxiliary variables. The same split applies to all other arguments below which hold CCZ4 entries.
The first-order and the second-order variant share one implementation in Kernels.cpp (a template over the formulation), so the physics is identical. The second-order variant omits the advection terms and the terms of the secondary entries which the first-order formulation needs, and it only writes the 25 primary entries of its result.
Neither variant holds the advection terms \( \beta^k \partial_k Q_q \) which need the derivative of the advected entry q itself, and none must ever do so: Either the numerical scheme adds them with lopsided stencils, or the solver appends them with the central differences of the scheme (exahype2::fd::addCentralAdvection()). Both add the terms of the entries which exagrype.api.CCZ4SolverBase.advected_quantities() names, i.e. this list is the only place that defines them. A kernel that held one of these terms would add it a second time. The rationale is written down in src/exagrype/ccz4/adrs/0003-the-solver-picks-who-adds-the-advection.md. The non-shifting shift (CCZ4b=0) is the one exception: the advection of Ghat in the equation of b is no advection of b itself, and the kernel adds it (see below).
| BgradQ | The 25 primary entries of the result. |
| BgradQaux | The 33 secondary entries of the result (first-order variant only). |
| Q | The 25 primary entries of the solution. |
| Qaux | The 33 secondary entries of the solution. |
| gradQ | The derivative of the 25 primary entries along normal. |
| gradQaux | The derivative of the 33 secondary entries along normal. |
| normal | Axis along which the derivatives are given. |
| CCZ4b | Integer switch: variant of the Gamma driver. 1 is the shifting shift, 0 the non-shifting shift (see below). |
| CCZ4s | Integer switch: 1 evolves the shift (Gamma driver), 0 freezes it. |
The Gamma driver reads \( \partial_t \beta^i = s ( b \beta^k B_k^i + f b^i ) \), \( \partial_t b^i = s ( \partial_t \hat\Gamma^i - \eta b^i + b ( \beta^k \partial_k b^i - \beta^k \partial_k \hat\Gamma^i ) ) \) and \( \partial_t B_j^i = s ( b ( \beta^k \partial_k B_j^i + B_k^i B_j^k ) + f \partial_j b^i ) \) plus the constraint terms with CCZ4mu. Here, s is CCZ4s and the factor b (without an index) is CCZ4b. With b=1, all three equations hold their advection terms (shifting shift). With b=0, none does (non-shifting shift). The time derivative of \( \hat\Gamma^i \) in the second equation is the complete one, i.e. it comprises the advection of \( \hat\Gamma^i \). As the kernels leave this advection to the numerical scheme or the solver, the non-conservative product adds it to the equation of \( b^i \) for b=0. The third equation is the derivative of the first one, which is why b also switches off the product of the derivatives of the shift (src/exagrype/ccz4/adrs/0002-ccz4b-selects-the-shifting-or-the-non-shifting-shift.md).
The slicing condition is \( \partial_t \alpha = -\alpha^2 g(\alpha) (K - 2 c \Theta) \), i.e. there is no offset K0 for the trace of the extrinsic curvature, and K0 is no entry of CCZ4. The former parameters CCZ4ds and CCZ4xi are fixed to one. The rationale is written down in src/exagrype/ccz4/adrs/0001-ccz4-has-58-entries-and-integer-switches.md.
| void exagrype::ccz4::ncpSecondOrder | ( | double * | BgradQ, |
| const double *const | Q, | ||
| const double *const | Qaux, | ||
| const double *const | gradQ, | ||
| const double *const | gradQaux, | ||
| const int | normal, | ||
| const int | CCZ4LapseType, | ||
| const double | CCZ4c, | ||
| const double | CCZ4e, | ||
| const double | CCZ4f, | ||
| const int | CCZ4b, | ||
| const int | CCZ4s, | ||
| const double | CCZ4mu ) |
Second-order variant of ncpFirstOrder(): updates the 25 primary entries only.
| void exagrype::ccz4::Psi4Calc | ( | double * | Psi4, |
| const double *const | Q, | ||
| const double *const | gradQSerialised, | ||
| double * | coor ) |
This function is for the calculation of psi4, a quantity related to gravitional wave.
Not used yet.
| void exagrype::ccz4::recomputeAuxiliaryVariablesFD4_4thOrder | ( | ::exahype2::CellData< double, double > & | patchData, |
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | unknowns, | ||
| int | auxiliaryVariables ) |
Recompute auxiliary variables for FD4 scheme with a 4th order scheme.
We are given a patch as well as the number of mesh cells per axis within this patch. I also parameterise over the unknowns and the auxiliaryVariables. By default, we'd expect 58 and 0 here, but we want to routine to work for augmented systems, too.
The reconstruction uses a 4th order Finite Difference scheme. The implementation in exagrype::ccz4::internal::recomputeAuxiliaryVariablesFD4_4thOrder_LoopBody() realises the normal stencil
scaled with \( \frac{1}{12h} \). There is a fundamental problem with this variant which is worth mentioning: To evaluate this stencil, we need two further layers around every grid cell whose derivatives we want. As we also need the derivatives one layer outside of the patch (the fluxes and ncps on the patch's faces need them on both sides), the halo has to be at least three. For a given haloSize, we can never update the outermost two layers of the code.
As we use a fourth order scheme, we need two neighbours around each point to construct the outcome. That means, when we are given a patch with size 3 (left illustation above), we effectively can only calculate the auxiliary variables within the patch (green) and the first halo layer around it (brownish). This is illustrated to the right.
There's one further complexity: we usually do not have the digonal values in ExaHyPE. What we really get is not the illustration above to the left but the one in the centre. The diagonal blocks hold garbage. As a consequence, the auxiliary data in the brown data layer to the right is not properly computed. In the left brown layer, only the x-derivatives are properly reconstructed. The y-derivatives contain garbage.
| patchData | Host the actual patch data. For this function, we only have to ensure that the QIn (data plus halo) are properly set, and that the patch size in patchData is correct. All the other (meta data) properties have no influence and can hold any data. |
| numberOfGridCellsPerPatchPerAxis | Has to be at least 3, as the halo is also at least three. More general, has to be bigger or equal to haloSize. |
| haloSize | Has to be at least 3. |
| unknowns | Typically 58, but can be bigger if you hold additional quantities within the PDE. |
| auxiliaryVariables | Typically 0. |
| void exagrype::ccz4::recomputeAuxiliaryVariablesFD4_centralDifferences | ( | ::exahype2::CellData< double, double > & | patchData, |
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | unknowns, | ||
| int | auxiliaryVariables ) |
| void exagrype::ccz4::recomputeAuxiliaryVariablesFD4_leftDifferences | ( | ::exahype2::CellData< double, double > & | patchData, |
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | unknowns, | ||
| int | auxiliaryVariables ) |
| void exagrype::ccz4::recomputeAuxiliaryVariablesFD4_rightDifferences | ( | ::exahype2::CellData< double, double > & | patchData, |
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | unknowns, | ||
| int | auxiliaryVariables ) |
| void exagrype::ccz4::reconstructFirstDerivativesCentralDifferences | ( | const double *__restrict__ | primaryVariablesWithHalo, |
| const tarch::la::Vector< Dimensions, double > & | patchSize, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| double *__restrict__ | firstDerivatives ) |
Reconstruct the 33 first derivatives with second-order central differences.
Same contract as reconstructFirstDerivativesFD4(), but the stencil is \( [-1\ 0\ 1]/(2h) \) (recomputeAuxiliaryVariablesFD4_centralDifferences()). It reaches one layer out only, so a halo of one grid cell suffices. This is what the Finite Volumes (overlap one) of exagrype.api.FOSOCCZ4Solver use: the derivatives of the halo layer are not computed here but exchanged via the faces, as they are computed by the neighbouring cell.
| primaryVariablesWithHalo | See reconstructFirstDerivativesFD4(). |
| patchSize | See reconstructFirstDerivativesFD4(). |
| numberOfGridCellsPerPatchPerAxis | See reconstructFirstDerivativesFD4(). |
| haloSize | Has to be at least one. |
| firstDerivatives | See reconstructFirstDerivativesFD4(). |
| void exagrype::ccz4::reconstructFirstDerivativesFD4 | ( | const double *__restrict__ | primaryVariablesWithHalo, |
| const tarch::la::Vector< Dimensions, double > & | patchSize, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| double *__restrict__ | firstDerivatives ) |
Reconstruct the 33 first derivatives of the 25 evolved CCZ4 unknowns.
This is the entry point of exagrype.api.FOSOReconstructionSolver. The second-order solver evolves the first 25 of the 58 CCZ4 entries (conformal metric, extrinsic curvature, ..., phi); the remaining 33 entries are the first derivatives of the lapse, shift, metric and phi. This routine computes these derivatives (entries 25 to 57) of one cell from the 25 evolved unknowns with their halo.
The routine is a thin wrapper around recomputeAuxiliaryVariablesFD4_4thOrder(), i.e. the fourth-order stencil \( [1\ -8\ 0\ 8\ -1]/(12h) \). That routine expects the 58 entries per grid cell interleaved, and a halo of at least three. The wrapper assembles such a buffer, calls the routine and copies the derivatives of the cell's own grid cells back.
The halo of three is required, as the routine also evaluates the derivatives one layer outside of the cell: To evaluate the flux and the non-conservative product on a face of the cell, we need the derivatives left and right of the face, and the stencil reaches two further layers out.
| primaryVariablesWithHalo | The 25 evolved unknowns per grid cell of the cell with its halo, i.e. (numberOfGridCellsPerPatchPerAxis+2*haloSize)^3 grid cells in the layout of a reconstructed patch (peano4::utils::dLinearised()). |
| patchSize | Extent of the cell (without halo). |
| numberOfGridCellsPerPatchPerAxis | Grid cells per axis within the cell. |
| haloSize | Has to be at least three. |
| firstDerivatives | Output, 33 entries per grid cell of the cell (without halo) in the layout of a patch. Entry k corresponds to entry 25+k of the 58 CCZ4 unknowns. |
| void exagrype::ccz4::sourceFirstOrder | ( | double * | S, |
| double * | Saux, | ||
| const double *const | Q, | ||
| const double *const | Qaux, | ||
| const int | CCZ4LapseType, | ||
| const double | CCZ4c, | ||
| const double | CCZ4e, | ||
| const double | CCZ4f, | ||
| const int | CCZ4b, | ||
| const int | CCZ4s, | ||
| const double | CCZ4itau, | ||
| const double | CCZ4eta, | ||
| const double | CCZ4k1, | ||
| const double | CCZ4k2, | ||
| const double | CCZ4k3 ) |
The source term is one out of two terms that we use in our CCZ4 formulation.
As it is used within the compute kernel, we want to vectorise over it aggressively, hence the simd annotation.
Q and Qaux are the primary and the secondary entries as documented for ncpFirstOrder(). S and Saux are the right-hand side for the two groups.
| void exagrype::ccz4::sourceSecondOrder | ( | double * | S, |
| const double *const | Q, | ||
| const double *const | Qaux, | ||
| const int | CCZ4LapseType, | ||
| const double | CCZ4c, | ||
| const double | CCZ4e, | ||
| const double | CCZ4f, | ||
| const int | CCZ4b, | ||
| const int | CCZ4s, | ||
| const double | CCZ4itau, | ||
| const double | CCZ4eta, | ||
| const double | CCZ4k1, | ||
| const double | CCZ4k2, | ||
| const double | CCZ4k3 ) |
Second-order variant of sourceFirstOrder(): updates the 25 primary entries only.
| void exagrype::ccz4::TestingOutput | ( | double * | terms, |
| const double *const | Q, | ||
| const double *const | gradQSerialised ) |
A temporary test function, to output some testing values 0,1 entries: Hamilton constraint related term in theta, 2 terms: RPlusTwoNablaZSrc, pure Src 2-10 entry: no-symmetry version of R_ij.
| void exagrype::ccz4::ThetaOutputNCP | ( | double * | NCPterm, |
| const double *const | Q, | ||
| const double *const | gradQSerialised, | ||
| int | normal ) |
A temporary test function, to output Hamilton constraint related term in theta, 1 terms: RPlusTwoNablaZNCP.