|
Peano
|
Namespaces | |
| namespace | internal |
Typedefs | |
| typedef std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &gridCellX, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, double *__restrict__ AlgeSrc) > | Source |
| typedef std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, int normal, double *__restrict__ F) > | Flux |
| typedef std::function< void(const double *__restrict__ Q, const double *__restrict__ deltaQ, const tarch::la::Vector< Dimensions, double > &gridCellX, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, int normal, double *__restrict__ DiffSrc) > | NonconservativeProduct |
| typedef std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &gridCellX, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, int normal, double *__restrict__ maxEigen) > | MaxEigenvalue |
| The max eigenvalue is used if and only if you have adaptive time stepping. | |
Functions | |
| void | addCentralAdvection (const double *__restrict__ Q, const double *__restrict__ deltaQ, double *__restrict__ BTimesDeltaQ, int normal, const int *velocity, const int *quantities, int numberOfQuantities) |
| Add advection terms discretised through central differences to a non-conservative product. | |
| void | reduceMaxEigenvalue_patchwise_functors (::exahype2::CellData< double, double > &patchData, int numberOfGridCellsPerPatchPerAxis, int overlap, int unknowns, int auxiliaryVariables, MaxEigenvalue maxEigenvalue) |
| void | addLopsidedAdvection (const double *__restrict__ QWithHalo, double *__restrict__ rightHandSide, const tarch::la::Vector< Dimensions, double > &patchSize, int numberOfGridCellsPerPatchPerAxis, int haloSize, int unknowns, int auxiliaryVariables, const int *velocity, const int *quantities, int numberOfQuantities) |
| Add advection terms discretised through lopsided stencils to the right-hand side of a patch. | |
| static tarch::la::Vector< 2, double > | getGridCellSize (const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis) |
| static tarch::la::Vector< 3, double > | getGridCellSize (const tarch::la::Vector< 3, double > &h, int numberOfGridCellsPerPatchPerAxis) |
| static tarch::la::Vector< 2, double > | getGridFaceSize (const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis) |
| static tarch::la::Vector< 3, double > | getGridFaceSize (const tarch::la::Vector< 3, double > &h, int numberOfGridCellsPerPatchPerAxis) |
| static tarch::la::Vector< 2, double > | getGridCellCentre (const tarch::la::Vector< 2, double > &x, const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis, const tarch::la::Vector< 2, int > &index) |
| In ExaHyPE's Finite Volume setup, a cell hosts a patch of Finite Volumes. | |
| static tarch::la::Vector< 3, double > | getGridCellCentre (const tarch::la::Vector< 3, double > &x, const tarch::la::Vector< 3, double > &h, int numberOfGridCellsPerPatchPerAxis, const tarch::la::Vector< 3, int > &index) |
| static tarch::la::Vector< 2, double > | getGridFaceCentre (const tarch::la::Vector< 2, double > &x, const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis, int overlap, int normal, const tarch::la::Vector< 2, int > &index) |
| static tarch::la::Vector< 3, double > | getGridFaceCentre (const tarch::la::Vector< 3, double > &x, const tarch::la::Vector< 3, double > &h, int numberOfGridCellsPerPatchPerAxis, int overlap, int normal, const tarch::la::Vector< 3, int > &index) |
| std::string | plotGridCell (const double *__restrict__ Q, int unknowns) |
| Helper routine that I need in the log statements. | |
| void | validatePatch (const double *__restrict__ Q, int unknowns, int auxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, const std::string &location="", bool triggerNonCriticalAssertion=true, double *minValues=nullptr, double *maxValues=nullptr) |
| Just runs over the patch and ensures that no entry is non or infinite. | |
| std::string | plotPatch (const double *__restrict__ Q, int unknowns, int auxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, bool prettyPrint=false) |
| Plot patch. | |
| std::string | plotPatchOverlap (const double *__restrict__ Q, int unknowns, int auxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, int normal, bool prettyPrint=false) |
Variables | |
| constexpr int | PickAllEntriesFromOutputVector = -1 |
| typedef std::function< void( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& faceCentre, const tarch::la::Vector<Dimensions,double>& gridCellH, double t, double dt, int normal, double * __restrict__ F ) > exahype2::fd::Flux |
Definition at line 30 of file Functors.h.
| typedef std::function< void( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& gridCellX, const tarch::la::Vector<Dimensions,double>& gridCellH, double t, double dt, int normal, double* __restrict__ maxEigen ) > exahype2::fd::MaxEigenvalue |
The max eigenvalue is used if and only if you have adaptive time stepping.
Definition at line 54 of file Functors.h.
| typedef std::function< void( const double * __restrict__ Q, const double * __restrict__ deltaQ, const tarch::la::Vector<Dimensions,double>& gridCellX, const tarch::la::Vector<Dimensions,double>& gridCellH, double t, double dt, int normal, double * __restrict__ DiffSrc ) > exahype2::fd::NonconservativeProduct |
Definition at line 41 of file Functors.h.
| typedef std::function< void( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& gridCellX, const tarch::la::Vector<Dimensions,double>& gridCellH, double t, double dt, double * __restrict__ AlgeSrc ) > exahype2::fd::Source |
Definition at line 20 of file Functors.h.
| void exahype2::fd::addCentralAdvection | ( | const double *__restrict__ | Q, |
| const double *__restrict__ | deltaQ, | ||
| double *__restrict__ | BTimesDeltaQ, | ||
| int | normal, | ||
| const int * | velocity, | ||
| const int * | quantities, | ||
| int | numberOfQuantities ) |
Add advection terms discretised through central differences to a non-conservative product.
Many PDEs carry advection terms
\( \partial _t Q_q = \ldots + \sum _d v_d \partial _d Q_q \)
with a velocity v which is part of the solution itself, such as the shift in the Einstein equations. These terms are linear in the derivative of the advected entry, i.e. they are a non-conservative product \( B(Q) \cdot \nabla Q \) with \( B = -v_d \) on the diagonal of the advected entries. The routine adds them to the non-conservative product along one normal, which the right-hand side kernels of the Finite Differences (exahype2.api.rkfd4.FD4Kernels) hand the derivative along this normal, computed with their central differences:
\( (B \cdot \Delta Q)_q \mathrel{-}= v_{normal} \Delta Q_q \)
for each selected quantity q. The velocity is taken from the point itself.
This is the counterpart of addLopsidedAdvection(), which adds the same terms with lopsided stencils to the right-hand side of a whole patch. A solver uses either of the two for a quantity, never both, and the PDE terms of the solver must not contain these advection terms themselves. Both routines take the velocity and the quantities in the same form, so a solver can hand the same lists to either of them (exagrype.api.CCZ4SolverBase is an example, see src/exagrype/ccz4/adrs/0003-the-solver-picks-who-adds-the-advection.md).
The routine handles one normal per call, as the right-hand side kernels call the non-conservative product once per normal. If the non-conservative product receives all normals at once one day, it has to sum over them.
| Q | The unknowns of the point. |
| deltaQ | The derivative of the unknowns along normal, times the mesh width, as the non-conservative product receives it. |
| BTimesDeltaQ | The non-conservative product along normal, which the routine adds the advection terms to. |
| normal | Axis along which deltaQ is given. |
| velocity | Indices of the Dimensions entries of Q which hold the velocity components. |
| quantities | Indices of the advected entries of Q. |
| numberOfQuantities | Number of entries of quantities. |
| void exahype2::fd::addLopsidedAdvection | ( | const double *__restrict__ | QWithHalo, |
| double *__restrict__ | rightHandSide, | ||
| const tarch::la::Vector< Dimensions, double > & | patchSize, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | unknowns, | ||
| int | auxiliaryVariables, | ||
| const int * | velocity, | ||
| const int * | quantities, | ||
| int | numberOfQuantities ) |
Add advection terms discretised through lopsided stencils to the right-hand side of a patch.
Many PDEs carry advection terms
\( \partial _t Q_q = \ldots + \sum _d v_d \partial _d Q_q \)
with a velocity v which is part of the solution itself, such as the shift in the Einstein equations. Central differences treat these terms like any other derivative. Numerical relativity codes discretise them with lopsided (upwind-biased) fourth-order stencils instead,
\( \partial _d Q_i \approx \frac{-3 Q_{i-1} - 10 Q_i + 18 Q_{i+1} - 6 Q_{i+2} + Q_{i+3}}{12 \Delta x_d} \)
for \( v_d > 0 \), and the mirrored stencil for \( v_d \leq 0 \). For a positive velocity, the solution travels towards smaller coordinates, i.e. its information comes from the right, and the stencil reaches further into this direction. The stencils are fourth-order accurate.
The routine adds \( v_d \partial _d Q_q \) for each axis d and each selected quantity q to the right-hand side of each grid cell of a patch. The PDE terms of the solver must hence not contain these advection terms themselves. The velocity is taken from the grid cell itself.
exahype2.api.rkfd4.CentralDifferencesWithRungeKutta invokes this routine after its right-hand side kernel within each Runge-Kutta stage, if the user selects the kernel CentralDifferencesWithLopsidedAdvection.
Both arrays are stored lexicographically in AoS format, i.e. all entries of one grid cell are stored together, and the first axis runs fastest. The stencils reach 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)^d grid cells with unknowns+auxiliaryVariables entries each. |
| rightHandSide | Right-hand side of the stage without halo, i.e. numberOfGridCellsPerPatchPerAxis^d grid cells with unknowns entries each. The routine adds the advection terms to it. |
| patchSize | Size of the patch, i.e. of the mesh cell. |
| velocity | Indices of the Dimensions entries of Q which hold the velocity components. They may also refer to auxiliary variables. |
| quantities | Indices of the unknowns which are advected. Each index has to be smaller than unknowns. |
| numberOfQuantities | Number of entries of quantities. |
|
static |
In ExaHyPE's Finite Volume setup, a cell hosts a patch of Finite Volumes.
When we iterate over these volumes, we typically have to know the centre of the volume.
I use this routine in a lot of the loops that have to be vectorised. Therefore, it is absolutely essential that the compiler can inline them. Inlining works properly with most compilers if and only if the definition is available in the header. This is the reason why this implementation ended up here and not in the cpp file.
| x | Centre of the cell |
| h | Size of the cell |
| index | Index of Finite Volume (in lexicographic ordering) |
Definition at line 77 of file PatchUtils.h.
|
static |
Definition at line 89 of file PatchUtils.h.
|
static |
Definition at line 22 of file PatchUtils.h.
|
static |
Definition at line 32 of file PatchUtils.h.
|
static |
Definition at line 101 of file PatchUtils.h.
|
static |
Definition at line 115 of file PatchUtils.h.
|
static |
Definition at line 42 of file PatchUtils.h.
|
static |
Definition at line 52 of file PatchUtils.h.
| std::string exahype2::fd::plotGridCell | ( | const double *__restrict__ | Q, |
| int | unknowns ) |
Helper routine that I need in the log statements.
Applies to AoS data only.
| std::string exahype2::fd::plotPatch | ( | const double *__restrict__ | Q, |
| int | unknowns, | ||
| int | auxiliaryVariables, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| bool | prettyPrint = false ) |
Plot patch.
Usually used for debugging.
Assumes all data are held as AoS.
| std::string exahype2::fd::plotPatchOverlap | ( | const double *__restrict__ | Q, |
| int | unknowns, | ||
| int | auxiliaryVariables, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| int | normal, | ||
| bool | prettyPrint = false ) |
| void exahype2::fd::reduceMaxEigenvalue_patchwise_functors | ( | ::exahype2::CellData< double, double > & | patchData, |
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | overlap, | ||
| int | unknowns, | ||
| int | auxiliaryVariables, | ||
| MaxEigenvalue | maxEigenvalue ) |
| void exahype2::fd::validatePatch | ( | const double *__restrict__ | Q, |
| int | unknowns, | ||
| int | auxiliaryVariables, | ||
| int | numberOfGridCellsPerPatchPerAxis, | ||
| int | haloSize, | ||
| const std::string & | location = "", | ||
| bool | triggerNonCriticalAssertion = true, | ||
| double * | minValues = nullptr, | ||
| double * | maxValues = nullptr ) |
Just runs over the patch and ensures that no entry is non or infinite.
In ExaHyPE, we primarily work with split approaches. That is, diagonal halo entries are never initialised properly: We can copy over the face-connected data, but we lack information through the diagonals. This routine takes this into account when it validates the entries.
Assumes all data are held as AoS.
| location | String that tells system from where this routine got called |
| minValues | Is either a nullptr or it points to a double array with exactly unknowns+auxiliaryVariables entries |
|
constexpr |
Definition at line 17 of file LoopBody.h.