Peano
applications::exahype2::ccz4 Namespace Reference

Namespaces

 internal
 

Data Structures

class  CCZ4
 

Functions

static void ncp (double *BgradQ, const double *const Q, const double *const gradQSerialised, const int normal, const int CCZ4LapseType, const double CCZ4ds, const double CCZ4c, const double CCZ4e, const double CCZ4f, const double CCZ4bs, const double CCZ4sk, const double CCZ4xi, const double CCZ4mu, const double CCZ4SO)
 
static void source (double *S, const double *const Q, const int CCZ4LapseType, const double CCZ4ds, const double CCZ4c, const double CCZ4e, const double CCZ4f, const double CCZ4bs, const double CCZ4sk, const double CCZ4xi, const double CCZ4itau, const double CCZ4eta, const double CCZ4k1, const double CCZ4k2, const double CCZ4k3, const double CCZ4SO)
 The source term is one out of two terms that we use in our CCZ4 formulation. More...
 
static double maxEigenvalue (const double *const Q, int normal, const double CCZ4e, const double CCZ4ds, const double CCZ4GLMc, const double CCZ4GLMd)
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void enforceCCZ4constraints (double *NOALIAS newQ)
 A postprocessing routine which pushes the volume solution back into the area of the CCZ4 constraints. More...
 
void enforceCCZ4constraints (const double *NOALIAS oldQ, double *NOALIAS dQdt, double timeStepSize)
 Anticipate Euler step and correct dQdt such that outcome does fulfill constraints. More...
 
static void ncp (double *BgradQ, const double *const Q, const double *const gradQSerialised, const int normal, const int CCZ4LapseType, const double CCZ4ds, const double CCZ4c, const double CCZ4e, const double CCZ4f, const double CCZ4bs, const double CCZ4sk, const double CCZ4xi, const double CCZ4mu, const double CCZ4SO)
 
static void source (double *S, const double *const Q, const int CCZ4LapseType, const double CCZ4ds, const double CCZ4c, const double CCZ4e, const double CCZ4f, const double CCZ4bs, const double CCZ4sk, const double CCZ4xi, const double CCZ4itau, const double CCZ4eta, const double CCZ4k1, const double CCZ4k2, const double CCZ4k3, const double CCZ4SO)
 The source term is one out of two terms that we use in our CCZ4 formulation. More...
 
static double maxEigenvalue (const double *const Q, int normal, const double CCZ4e, const double CCZ4ds, const double CCZ4GLMc, const double CCZ4GLMd)
 
void gaugeWave (double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &x, double t)
 
void diagonal_gaugeWave (double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &x, double t)
 
void linearWave (double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &X, double t)
 
void flat (double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &X, double t)
 
void ApplyTwoPunctures (double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &X, double t, TP::TwoPunctures *tp, bool low_res)
 
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. More...
 
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)
 

Function Documentation

◆ admconstraints()

void applications::exahype2::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.

Definition at line 133 of file CCZ4Kernels.cpp.

References euler::j, and euler::u.

◆ ApplyTwoPunctures()

void applications::exahype2::ccz4::ApplyTwoPunctures ( double *NOALIAS  Q,
const tarch::la::Vector< DIMENSIONS, double > &  X,
double  t,
TP::TwoPunctures tp,
bool  low_res 
)

◆ diagonal_gaugeWave()

void applications::exahype2::ccz4::diagonal_gaugeWave ( double *NOALIAS  Q,
const tarch::la::Vector< DIMENSIONS, double > &  x,
double  t 
)

< Amplitude of the wave, B in the note

Definition at line 54 of file InitialValues.cpp.

References create-plots::H, CSVConvert::pi, acoustic::t, and ModeCalc::x.

Referenced by applications::exahype2::ccz4::CCZ4::initialCondition().

Here is the caller graph for this function:

◆ enforceCCZ4constraints() [1/2]

void applications::exahype2::ccz4::enforceCCZ4constraints ( const double *NOALIAS  oldQ,
double *NOALIAS  dQdt,
double  timeStepSize 
)

Anticipate Euler step and correct dQdt such that outcome does fulfill constraints.

Definition at line 13 of file CCZ4Kernels.cpp.

References enforceCCZ4constraints(), and timeStepSize.

Here is the call graph for this function:

◆ enforceCCZ4constraints() [2/2]

void applications::exahype2::ccz4::enforceCCZ4constraints ( double *NOALIAS  newQ)

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.

If works on the full set of unknowns of the first-order formulation

Referenced by enforceCCZ4constraints().

Here is the caller graph for this function:

◆ flat()

void applications::exahype2::ccz4::flat ( double *NOALIAS  Q,
const tarch::la::Vector< DIMENSIONS, double > &  X,
double  t 
)

Definition at line 119 of file InitialValues.cpp.

Referenced by applications::exahype2::ccz4::CCZ4::initialCondition().

Here is the caller graph for this function:

◆ gaugeWave()

void applications::exahype2::ccz4::gaugeWave ( double *NOALIAS  Q,
const tarch::la::Vector< DIMENSIONS, double > &  x,
double  t 
)
  • * This file is automatically created by Peano. I need it to interact with
    • * the Python API, i.e. to read out data set there.

< Amplitude of the wave

Definition at line 21 of file InitialValues.cpp.

References CSVConvert::pi, acoustic::t, and ModeCalc::x.

Referenced by applications::exahype2::ccz4::CCZ4::initialCondition().

Here is the caller graph for this function:

◆ linearWave()

void applications::exahype2::ccz4::linearWave ( double *NOALIAS  Q,
const tarch::la::Vector< DIMENSIONS, double > &  X,
double  t 
)

< Amplitude of the wave, should be very small to keep linearized.

Definition at line 93 of file InitialValues.cpp.

References CSVConvert::pi, acoustic::t, and TestEllipsoidProjection::X.

Referenced by applications::exahype2::ccz4::CCZ4::initialCondition().

Here is the caller graph for this function:

◆ maxEigenvalue() [1/2]

static double applications::exahype2::ccz4::maxEigenvalue ( const double *const  Q,
int  normal,
const double  CCZ4e,
const double  CCZ4ds,
const double  CCZ4GLMc,
const double  CCZ4GLMd 
)
static
Todo:
Han

◆ maxEigenvalue() [2/2]

static double applications::exahype2::ccz4::maxEigenvalue ( const double *const  Q,
int  normal,
const double  CCZ4e,
const double  CCZ4ds,
const double  CCZ4GLMc,
const double  CCZ4GLMd 
)
static

◆ ncp() [1/2]

static void applications::exahype2::ccz4::ncp ( double *  BgradQ,
const double *const  Q,
const double *const  gradQSerialised,
const int  normal,
const int  CCZ4LapseType,
const double  CCZ4ds,
const double  CCZ4c,
const double  CCZ4e,
const double  CCZ4f,
const double  CCZ4bs,
const double  CCZ4sk,
const double  CCZ4xi,
const double  CCZ4mu,
const double  CCZ4SO 
)
static
See also
source() for a discussion of annotations.

◆ ncp() [2/2]

static void applications::exahype2::ccz4::ncp ( double *  BgradQ,
const double *const  Q,
const double *const  gradQSerialised,
const int  normal,
const int  CCZ4LapseType,
const double  CCZ4ds,
const double  CCZ4c,
const double  CCZ4e,
const double  CCZ4f,
const double  CCZ4bs,
const double  CCZ4sk,
const double  CCZ4xi,
const double  CCZ4mu,
const double  CCZ4SO 
)
static
See also
source() for a discussion of annotations.

◆ Psi4Calc()

void applications::exahype2::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.

Definition at line 377 of file CCZ4Kernels.cpp.

References CSVConvert::coor, euler::j, and TP::Z4VectorShortcuts::Theta.

◆ recomputeAuxiliaryVariablesFD4_4thOrder()

void applications::exahype2::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 59 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 applications::exahype2::ccz4::internal::recomputeAuxiliaryVariablesFD4_4thOrder_LoopBody() realises the normal stencil

[1 -8 0 8 -1]

scaled with \( \frac{1}{12h} \). There is a fundamental problem with this variant which is worth mentioning: To evaluate this stencil, we need a halo layer of at least two. For a given haloSize, we can never update the outermost two layers of the code.

Shortcomings

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.

Parameters
patchDataHost 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.
numberOfGridCellsPerPatchPerAxisHas to be at least 3, as the halo is also at least three. More general, has to be bigger or equal to haloSize.
haloSizeHas to be at least 3.
unknownsTypically 59, but can be bigger if you hold additional quantities within the PDE.
auxiliaryVariablesTypically 0.
See also
applications::exahype2::ccz4::internal::recomputeAuxiliaryVariablesFD4_4thOrder_LoopBody()

Definition at line 155 of file SecondOrderAuxiliaryVariablesReconstruction.cpp.

References applications::exahype2::ccz4::internal::recomputeAuxiliaryVariablesFD4_4thOrder_LoopBody(), euler::unknowns, ModeCalc::x, and csv_to_plot::y.

Here is the call graph for this function:

◆ recomputeAuxiliaryVariablesFD4_centralDifferences()

void applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_centralDifferences ( ::exahype2::CellData< double, double > &  patchData,
int  numberOfGridCellsPerPatchPerAxis,
int  haloSize,
int  unknowns,
int  auxiliaryVariables 
)

Definition at line 104 of file SecondOrderAuxiliaryVariablesReconstruction.cpp.

References euler::unknowns.

◆ recomputeAuxiliaryVariablesFD4_leftDifferences()

void applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_leftDifferences ( ::exahype2::CellData< double, double > &  patchData,
int  numberOfGridCellsPerPatchPerAxis,
int  haloSize,
int  unknowns,
int  auxiliaryVariables 
)

Definition at line 121 of file SecondOrderAuxiliaryVariablesReconstruction.cpp.

References euler::unknowns.

◆ recomputeAuxiliaryVariablesFD4_rightDifferences()

void applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_rightDifferences ( ::exahype2::CellData< double, double > &  patchData,
int  numberOfGridCellsPerPatchPerAxis,
int  haloSize,
int  unknowns,
int  auxiliaryVariables 
)

Definition at line 138 of file SecondOrderAuxiliaryVariablesReconstruction.cpp.

References euler::unknowns.

◆ source() [1/2]

static void applications::exahype2::ccz4::source ( double *  S,
const double *const  Q,
const int  CCZ4LapseType,
const double  CCZ4ds,
const double  CCZ4c,
const double  CCZ4e,
const double  CCZ4f,
const double  CCZ4bs,
const double  CCZ4sk,
const double  CCZ4xi,
const double  CCZ4itau,
const double  CCZ4eta,
const double  CCZ4k1,
const double  CCZ4k2,
const double  CCZ4k3,
const double  CCZ4SO 
)
static

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 also want to use it on the GPU, and we want to vectorise over it aggressively. To make this work, we have to inline the function plus ensure that the interna of the function are not vectorised before we inline the routine.

So we first declare it as simd and then we also say explicitly that it should be inlined. In my opinion, the inlining should imply that we wanna use it as SIMD, but my guess is that the simd statement ensures that the compiler doesn't prematurely vectorise.

See also
ncp()

◆ source() [2/2]

static void applications::exahype2::ccz4::source ( double *  S,
const double *const  Q,
const int  CCZ4LapseType,
const double  CCZ4ds,
const double  CCZ4c,
const double  CCZ4e,
const double  CCZ4f,
const double  CCZ4bs,
const double  CCZ4sk,
const double  CCZ4xi,
const double  CCZ4itau,
const double  CCZ4eta,
const double  CCZ4k1,
const double  CCZ4k2,
const double  CCZ4k3,
const double  CCZ4SO 
)
static

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 also want to use it on the GPU, and we want to vectorise over it aggressively. To make this work, we have to inline the function plus ensure that the interna of the function are not vectorised before we inline the routine.

So we first declare it as simd and then we also say explicitly that it should be inlined. In my opinion, the inlining should imply that we wanna use it as SIMD, but my guess is that the simd statement ensures that the compiler doesn't prematurely vectorise.

See also
ncp()

Referenced by applications::exahype2::ccz4::internal::recomputeAuxiliaryVariablesFD4_centralDifferences_LoopBody(), applications::exahype2::ccz4::internal::recomputeAuxiliaryVariablesFD4_leftDifferences_LoopBody(), applications::exahype2::ccz4::internal::recomputeAuxiliaryVariablesFD4_rightDifferences_LoopBody(), applications::exahype2::ccz4::CCZ4::sourceTerm(), and benchmarks::exahype2::ccz4::CCZ4::sourceTerm().

Here is the caller graph for this function:

◆ TestingOutput()

void applications::exahype2::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.

Definition at line 679 of file CCZ4Kernels.cpp.

References euler::j, and euler::u.

◆ ThetaOutputNCP()

void applications::exahype2::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.

Definition at line 956 of file CCZ4Kernels.cpp.

References euler::j, and euler::u.