Peano
Loading...
Searching...
No Matches
exahype2.api.rkfd4.FD4Kernels Namespace Reference

Functions

"void" rightHandSideWithFD42D ("::exahype2::CellData<double, double>&" patchData)
 DSLHyPE kernels of the fourth-order Finite Differences.
 
"void" rightHandSideWithFD43D ("::exahype2::CellData<double, double>&" patchData)
 
"void" maxEigenvalueOverPatch2D ("::exahype2::CellData<double, double>&" patchData)
 
"void" maxEigenvalueOverPatch3D ("::exahype2::CellData<double, double>&" patchData)
 

Function Documentation

◆ maxEigenvalueOverPatch2D()

"void" exahype2.api.rkfd4.FD4Kernels.maxEigenvalueOverPatch2D ( "::exahype2::CellData<double, double>&"  patchData)

Definition at line 131 of file FD4Kernels.py.

◆ maxEigenvalueOverPatch3D()

"void" exahype2.api.rkfd4.FD4Kernels.maxEigenvalueOverPatch3D ( "::exahype2::CellData<double, double>&"  patchData)

Definition at line 144 of file FD4Kernels.py.

◆ rightHandSideWithFD42D()

"void" exahype2.api.rkfd4.FD4Kernels.rightHandSideWithFD42D ( "::exahype2::CellData<double, double>&"  patchData)

DSLHyPE kernels of the fourth-order Finite Differences.

The functions below are never executed as Python. DSLHyPE parses their source (exahype2.api.dslhype.Parser) and translates them into C++ (exahype2.api.rkfd4.CentralDifferencesWithRungeKutta). They hence refer to symbols the parser sets rather than Python imports:

  • Template parameters: NC (grid cells per axis within a patch), H (halo size, at least two), NumberOfUnknowns, NumberOfAuxiliaryVariables.
  • Functors for the non-stateless code: flux, nonconservativeProduct, volumetricSource, maxEigenvalue. An if over a functor's name holds if and only if the solver has the corresponding PDE term.

Do not add comments within the functions: DSLHyPE parses the comments, too, and gets confused by comments which mention the names of variables.

Right-hand side

rightHandSideWithFD42D() and rightHandSideWithFD43D() evaluate the right-hand side

\( \partial _t Q = - \nabla \cdot F(Q) - \sum _d B_d(Q) \partial _d Q + S(Q) \)

over a patch with a halo of H grid cells (patchData.QIn) and write it into patchData.QOut, which holds the unknowns only. They do not scale with the time step size nor add the old solution, as the outcome is one estimate of a Runge-Kutta scheme.

  • The divergence of the flux and the derivatives in the non-conservative product use the fourth-order central difference \( \partial _x f_i \approx (f_{i-2} - 8 f_{i-1} + 8 f_{i+1} - f_{i+2}) / (12 \Delta x) \). The mesh width is the cell size h over NC.
  • The non-conservative product is handed deltaQ, i.e. the derivative of all unknowns and auxiliary variables times the mesh width, exactly like the Finite Volumes of exahype2.api.fv hand over the jump across a face.
  • The stencils reach two grid cells into the neighbouring patches, i.e. they need a halo H of at least two. The kernels are written for an arbitrary halo H, so subclasses of the numerical scheme can add wider stencils (exagrype.api.FD4WithKODissipation).
  • The PDE terms are handed the patch centre and the patch size rather than the grid cell's centre and size, as DSLHyPE has no notion of the individual grid cell's position. The Finite Volume kernels of exahype2.api.fv share this simplification.

The functions replace the legacy timeStepWithFD4() of exahype2.solvers.rkfd.fd4, which was three-dimensional only, passed deltaQ instead of the non-conservative product along x into the update, and had a (commented out) Kreiss-Oliger dissipation built in. There is no dissipation in these kernels anymore: exagrype.api.FD4WithKODissipation adds it as a separate kernel on top.

Maximum eigenvalue

maxEigenvalueOverPatch2D() and maxEigenvalueOverPatch3D() reduce the maximum eigenvalue over all grid cells of a patch without halo (patchData.QIn) into patchData.maxEigenvalue. The adaptive time stepping derives the next time step size from it.

Definition at line 63 of file FD4Kernels.py.

◆ rightHandSideWithFD43D()

"void" exahype2.api.rkfd4.FD4Kernels.rightHandSideWithFD43D ( "::exahype2::CellData<double, double>&"  patchData)

Definition at line 94 of file FD4Kernels.py.