Peano
|
Namespaces | |
namespace | average |
namespace | fluxaverage |
namespace | internal |
namespace | laxfriedrichs |
namespace | rusanov |
namespace | tests |
Data Structures | |
struct | PointSource |
Typedefs | |
typedef std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F) | Flux) |
Flux functor. | |
typedef std::function< void(const double *__restrict__ Q, const double *__restrict__ dQdx, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F) | NonConservativeProduct) |
typedef std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, double *__restrict__ S) | Source) |
Source functor. | |
typedef std::function< std::vector< PointSource >(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &cellCentre, const tarch::la::Vector< Dimensions, double > &h, double t, double dt) | PointSources) |
This is the only routine within the DG framework which accepts the dimensions of the underlying cell rather than only a point. | |
typedef std::function< double(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal) | MaxEigenvalue) |
typedef std::function< void(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, int normal) | BoundaryConditions) |
Functions | |
void | applyBoundaryConditions (std::function< void(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal) > boundaryCondition, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &cellSize, double t, double dt, int order, int unknowns, int auxiliaryVariables, int faceNumber, const double *__restrict__ quadraturePoints, double *__restrict__ Q) |
Apply boundary conditions. | |
void | cellIntegral_patchwise_in_situ_GaussLegendre_functors (::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, Flux flux, NonConservativeProduct nonconservativeProduct, Source source, PointSources pointSources, const double *__restrict__ QuadratureNodes1d, const double *__restrict__ MassMatrixDiagonal1d, const double *__restrict__ StiffnessMatrix1d, const double *__restrict__ DerivativeOperator1d, bool evaluateFlux, bool evaluateNonconservativeProduct, bool evaluateSource, bool evaluatePointSources) |
template<typename Solver , int order, int unknowns, int auxiliaryVariables> | |
void | cellIntegral_patchwise_in_situ_GaussLegendre (::exahype2::CellData< double, double > &cellData, bool evaluateFlux, bool evaluateNonconservativeProduct, bool evaluateSource, bool evaluatePointSources) |
void | multiplyWithInvertedMassMatrix_GaussLegendre (::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, const double *__restrict__ MassMatrixDiagonal1d) |
Final step of DG algorithm. | |
void | reduceMaxEigenvalue_patchwise_functors (::exahype2::CellData< double, double > &cellData, const int order, const int unknowns, const int auxiliaryVariables, MaxEigenvalue maxEigenvalue, const double *__restrict__ QuadratureNodes1d) |
Compute the maximum eigenvalues over a sequence of cells and store the result in the respective CellData entry. | |
template<typename T > | |
tarch::la::Vector< Dimensions, double > | getQuadraturePoint (const tarch::la::Vector< Dimensions, double > &cellCentre, const tarch::la::Vector< Dimensions, double > &cellSize, const tarch::la::Vector< Dimensions, int > &index, int polynomialOrder, const T *__restrict__ quadraturePoints) |
Construct location of a quadrature point. | |
double | getQuadratureWeight (const tarch::la::Vector< 3, double > &cellSize, const tarch::la::Vector< 3, int > &index, const double *__restrict__ quadratureWeights) |
Compute integral over shape function over cell defined by index. | |
int | getNodesPerCell (int nodesPerAxis) |
The number of nodes in a cell is basically the input to the power of d. | |
tarch::la::Vector< Dimensions, int > | getStrides (int nodesPerAxis) |
tarch::la::Vector< Dimensions, int > | getIndex (int node, tarch::la::Vector< Dimensions, int > strides) |
int | cellIndexToHullIndex (const tarch::la::Vector< Dimensions, int > &indexCell, const int direction, const int orientation, const int nodesPerAxis) |
void | computeGradient (const double *__restrict__ const QCell, const double *__restrict__ const derivativeOperator, const double invDx, const int nodesPerAxis, const int strideQ, const int scalarIndex, double *__restrict__ gradQ) |
void | subtractCell (double *__restrict__ QOut, const double *__restrict__ Qsubstract, const int order, const int unknowns, const int auxiliaryVariables) |
std::string | plotCell (const double *__restrict__ Q, const int order, const int unknowns, const int auxiliaryVariables) |
std::string | plotFace (const double *__restrict__ Q, const int order, const int unknowns, const int auxiliaryVariables, int normal, int numberOfQuantitiesProjectedOntoFace) |
template<typename QStoreType > | |
QStoreType | evaluatePolynomial (const peano4::datamanagement::CellMarker &marker, int order, const double *__restrict__ QuadratureNodes1d, int unknownsPerDoF, const QStoreType *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, int unknown) |
Evaluate the DG polynomial. | |
void | copyOneSideOfFaceProjection (int unknownsPlusAuxiliaryVariables, int order, int numberOfProjectedQuantities, int normal, int isRightFaceHalf, const double *__restrict__ srcQ, double *__restrict__ destQ) |
Delegate to PatchUtils of the Finite Volume scheme. | |
void | interpolateRiemannSolution (const peano4::datamanagement::FaceMarker &marker, int order, int unknowns, const double *__restrict__ InterpolationMatrix1d, const double *__restrict__ coarseGridFaceQ, double *__restrict__ fineGridFaceQ) |
void | restrictAndAccumulateProjectedFacePolynomial (const peano4::datamanagement::FaceMarker &marker, int order, int numberOfProjectedQuantities, int unknowns, int auxiliaryVariables, const double *__restrict__ RestrictionMatrix1d, const double *__restrict__ fineGridFaceQ, double *__restrict__ coarseGridFaceQ) |
Counterpart of interpolateRiemannSolution(). | |
void | projectVolumetricDataOntoFaces (const double *__restrict__ cellQ, int order, int unknowns, int auxiliaryVariables, const double *const __restrict__ BasisFunctionValuesLeft, double *const __restrict__ faceQLeft, double *const __restrict__ faceQRight, double *const __restrict__ faceQBottom, double *const __restrict__ faceQUp) |
Take polynomial within cell and project it onto the faces. | |
void | clearSolutionProjection (int order, int unknowns, int auxiliaryVariables, int numberOfProjectedQuantities, double *__restrict__ faceQ) |
Set the whole solution projection on the face from left and right to zero. | |
void | clearRiemannResult (int order, int unknowns, double *__restrict__ faceQ) |
void | projectVolumetricDataOntoFaces (const double *__restrict__ cellQ, int order, int unknowns, int auxiliaryVariables, const double *const __restrict__ BasisFunctionValuesLeft, double *const __restrict__ faceQLeft, double *const __restrict__ faceQRight, double *const __restrict__ faceQBottom, double *const __restrict__ faceQUp, double *const __restrict__ faceQFront, double *const __restrict__ faceQBack) |
3d counterpart to other projectVolumetricDataOntoFaces() variant. | |
void | projectVolumetricDataAndGradientOntoFaces (const double *__restrict__ cellQ, int order, int unknowns, int auxiliaryVariables, const double *const __restrict__ BasisFunctionValuesLeft, double *const __restrict__ faceQLeft, double *const __restrict__ faceQRight, double *const __restrict__ faceQBottom, double *const __restrict__ faceQUp) |
void | projectVolumetricDataAndGradientOntoFaces (const double *__restrict__ cellQ, int order, int unknowns, int auxiliaryVariables, const double *const __restrict__ BasisFunctionValuesLeft, double *const __restrict__ faceQLeft, double *const __restrict__ faceQRight, double *const __restrict__ faceQBottom, double *const __restrict__ faceQUp, double *const __restrict__ faceQFront, double *const __restrict__ faceQBack) |
3d counterpart to other projectVolumetricDataOntoFaces() variant. | |
void | integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre (const double *const __restrict__ faceQLeft, const double *const __restrict__ faceQRight, const double *const __restrict__ faceQBottom, const double *const __restrict__ faceQUp, int order, int unknowns, const int auxiliaryVariables, const tarch::la::Vector< 2, double > &cellSize, const double *const __restrict__ BasisFunctionValuesLeft, const double *__restrict__ MassMatrixDiagonal1d, double *__restrict__ cellQ) |
Given a numerical flux at the various faces, this computes and adds the Riemann integral of this flux to the nodes of the cell. | |
void | integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre (const double *const __restrict__ faceQLeft, const double *const __restrict__ faceQRight, const double *const __restrict__ faceQBottom, const double *const __restrict__ faceQUp, const double *const __restrict__ faceQFront, const double *const __restrict__ faceQBack, int order, int unknowns, const int auxiliaryVariables, const tarch::la::Vector< 3, double > &cellSize, const double *const __restrict__ BasisFunctionValuesLeft, const double *__restrict__ MassMatrixDiagonal1d, double *__restrict__ cellQ) |
3D counterpart of integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre() | |
template<typename Particle , int SourceIndex, int DestIndex> | |
void | projectValueOntoParticle (const peano4::datamanagement::CellMarker &marker, int order, const double *__restrict__ QuadratureNodes1d, int unknownsPerDoF, const double *__restrict__ Q, Particle &particle) |
Project one quantity from the patch data onto the particle. | |
template<typename Particle , typename QStoreType > | |
void | projectAllValuesOntoParticle (const peano4::datamanagement::CellMarker &marker, int order, const double *__restrict__ QuadratureNodes1d, int unknownsPerDoF, const QStoreType *__restrict__ Q, Particle &particle) |
Take all values of the unknown field Q and project them onto the particle. | |
typedef std::function< void( const double * __restrict__ Qinside, double * __restrict__ Qoutside, const tarch::la::Vector<Dimensions,double>& x, double t, int normal ) exahype2::dg::BoundaryConditions) |
Definition at line 109 of file Functors.h.
typedef std::function< void( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& x, double t, double dt, int normal, double * __restrict__ F ) exahype2::dg::Flux) |
Flux functor.
This functor defines the signature of the flux evaluation.
If you use a template compute kernel,
The finite volume flux accepts a volume size h as well. For DG, we do not pass an h, as we actually work point-wisely: the flux is evaluated in integration points and then scales an underlying shape function. So there's no need for any spatial averaging, e.g.
Definition at line 44 of file Functors.h.
typedef std::function< double( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& x, double t, double dt, int normal ) exahype2::dg::MaxEigenvalue) |
Definition at line 95 of file Functors.h.
typedef std::function< void( const double * __restrict__ Q, const double * __restrict__ dQdx, const tarch::la::Vector<Dimensions,double>& x, double t, double dt, int normal, double * __restrict__ F ) exahype2::dg::NonConservativeProduct) |
Definition at line 54 of file Functors.h.
typedef std::function< std::vector<PointSource>( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& cellCentre, const tarch::la::Vector<Dimensions,double>& h, double t, double dt ) exahype2::dg::PointSources) |
This is the only routine within the DG framework which accepts the dimensions of the underlying cell rather than only a point.
Definition at line 87 of file Functors.h.
typedef std::function< void( const double * __restrict__ Q, const tarch::la::Vector<Dimensions,double>& x, double t, double dt, double * __restrict__ S ) exahype2::dg::Source) |
Source functor.
This functor defines the signature of the source evaluation.
The finite volume source accepts a volume size h as well. For DG, we do not pass an h, as we actually work point-wisely: the source is evaluated in integration points and then scales an underlying shape function. So there's no need for any spatial averaging, e.g.
Definition at line 75 of file Functors.h.
void exahype2::dg::applyBoundaryConditions | ( | std::function< void(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal) > | boundaryCondition, |
const tarch::la::Vector< Dimensions, double > & | faceCentre, | ||
const tarch::la::Vector< Dimensions, double > & | cellSize, | ||
double | t, | ||
double | dt, | ||
int | order, | ||
int | unknowns, | ||
int | auxiliaryVariables, | ||
int | faceNumber, | ||
const double *__restrict__ | quadraturePoints, | ||
double *__restrict__ | Q ) |
Apply boundary conditions.
Assumes we solely have the solution projected on the face.
faceNumber | The number of the face relativ from the cell that recognises that its face is called for the first time. So it is a number from [0,2d-1] according to Peano's standard face enumeration scheme. See grid::datatraversal::FaceEnumerator for more details. |
quadNodes | quadraturePoints of the integration/quadrature points along a 1d unit interval. The array consequently has order+1 entries from (0,1). You can scale them with the actual cell width (cellSize) to fit it to a cell, and you can multiply is component-wisely with the quadrature point of interest to get a 2d or 3d coordinate. This is straightforward, as we employ Cartesian meshes, i.e. coordinates can be constructed via a tensor product approach. |
Definition at line 12 of file BoundaryConditions.cpp.
References _log, dfore, logTraceInWith3Arguments, and logTraceOut.
int exahype2::dg::cellIndexToHullIndex | ( | const tarch::la::Vector< Dimensions, int > & | indexCell, |
const int | direction, | ||
const int | orientation, | ||
const int | nodesPerAxis ) |
Definition at line 71 of file DGUtils.cpp.
void exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre | ( | ::exahype2::CellData< double, double > & | cellData, |
bool | evaluateFlux, | ||
bool | evaluateNonconservativeProduct, | ||
bool | evaluateSource, | ||
bool | evaluatePointSources ) |
Definition at line 11 of file CellIntegral.cpph.
References assertion, exahype2::CellData< inType, outType >::cellCentre, exahype2::CellData< inType, outType >::cellSize, dfor, exahype2::CellData< inType, outType >::dt, getNodesPerCell(), getQuadraturePoint(), exahype2::CellData< inType, outType >::numberOfCells, exahype2::CellData< inType, outType >::QIn, exahype2::CellData< inType, outType >::QOut, exahype2::CellData< inType, outType >::t, and tarch::la::volume().
void exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors | ( | ::exahype2::CellData< double, double > & | cellData, |
const int | order, | ||
const int | unknowns, | ||
const int | auxiliaryVariables, | ||
Flux | flux, | ||
NonConservativeProduct | nonconservativeProduct, | ||
Source | source, | ||
PointSources | pointSources, | ||
const double *__restrict__ | QuadratureNodes1d, | ||
const double *__restrict__ | MassMatrixDiagonal1d, | ||
const double *__restrict__ | StiffnessMatrix1d, | ||
const double *__restrict__ | DerivativeOperator1d, | ||
bool | evaluateFlux, | ||
bool | evaluateNonconservativeProduct, | ||
bool | evaluateSource, | ||
bool | evaluatePointSources ) |
Definition at line 7 of file CellIntegral.cpp.
References assertion, exahype2::CellData< inType, outType >::cellCentre, exahype2::CellData< inType, outType >::cellSize, dfor, exahype2::CellData< inType, outType >::dt, getNodesPerCell(), getQuadraturePoint(), exahype2::CellData< inType, outType >::numberOfCells, exahype2::CellData< inType, outType >::QIn, exahype2::CellData< inType, outType >::QOut, exahype2::CellData< inType, outType >::t, and tarch::la::volume().
Referenced by exahype2::dg::average::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::fluxaverage::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::laxfriedrichs::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::rusanov::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::tests::CellIntegralTest::runEulerOrder2OnStationarySetup(), and exahype2::dg::tests::CellIntegralTest::runEulerOrder4OnStationarySetup().
Definition at line 153 of file Riemann.cpp.
References clearSolutionProjection().
void exahype2::dg::clearSolutionProjection | ( | int | order, |
int | unknowns, | ||
int | auxiliaryVariables, | ||
int | numberOfProjectedQuantities, | ||
double *__restrict__ | faceQ ) |
Set the whole solution projection on the face from left and right to zero.
numberOfProjectedQUantities | Equals one if we project only the solution to the face, it equals two if we project both the solution and the gradient or the F-extrapolation, and so forth. |
Definition at line 137 of file Riemann.cpp.
Referenced by clearRiemannResult().
void exahype2::dg::computeGradient | ( | const double *__restrict__ const | QCell, |
const double *__restrict__ const | derivativeOperator, | ||
const double | invDx, | ||
const int | nodesPerAxis, | ||
const int | strideQ, | ||
const int | scalarIndex, | ||
double *__restrict__ | gradQ ) |
Definition at line 110 of file DGUtils.cpp.
References getIndex(), and getStrides().
Referenced by exahype2::dg::tests::DGUtilsTest::testComputeGradientOnConstantSolution().
void exahype2::dg::copyOneSideOfFaceProjection | ( | int | unknownsPlusAuxiliaryVariables, |
int | order, | ||
int | numberOfProjectedQuantities, | ||
int | normal, | ||
int | isRightFaceHalf, | ||
const double *__restrict__ | srcQ, | ||
double *__restrict__ | destQ ) |
Delegate to PatchUtils of the Finite Volume scheme.
Definition at line 4 of file DGUtils.cpp.
References exahype2::fv::copyHalfOfHalo().
QStoreType exahype2::dg::evaluatePolynomial | ( | const peano4::datamanagement::CellMarker & | marker, |
int | order, | ||
const double *__restrict__ | QuadratureNodes1d, | ||
int | unknownsPerDoF, | ||
const QStoreType *__restrict__ | Q, | ||
const tarch::la::Vector< Dimensions, double > & | x, | ||
int | unknown ) |
Evaluate the DG polynomial.
Evaluate the Lagrangian polynomial within the cell specified by marker in one point. Return the value unknown within this interpolated point.
We loop with a d-dimensional for loop over all quadrature points within the cell. Each iteration of this loop over currentDoF evalutes the impact of the polynomial anchored at currentDoF onto the position of interest. To find out what this polynomial looks like, we have to loop over all quadrature points again, besides those guys that coincide in one coordinate with the shape function at currentDoF. This inner loop over quadraturePoint exploits the fact that the Lagrange polynomials are constructed through a product over terms, while the overall d-dimensional shape function results from a tensor product. Therefore, we can evaluate the shape function over one big loop multiplying the enumerator and denominator.
Once the shape function's value at point x is evaluated, we multiple it with the actual weight of this function. The outcome is added to the result, as we work with a standard nodal basis.
marker | Marker that specifies the cell, i.e. its size and offset. |
order | Order of the polynomial. |
QuadratureNodes1d | Arrangement of the quadrature points on the 1d unit interval, i.e. from 0 to 1. |
unknownsPerDoF | Total number of unknowns within a degree of freedom. Shoudl incorporate the number of material parameters. |
Q | Pointer to data stored as AoS. The size of this data field is \( (order+1)^d \cdot unknownsPerDoF \). |
x | Point of interest where the overall polynomial solution is to be evaluated. |
unknown | Unknown of interest. |
Definition at line 3 of file DGUtils.cpph.
References dfor, and peano4::utils::dLinearised().
Referenced by projectAllValuesOntoParticle(), projectValueOntoParticle(), exahype2::dg::tests::DGUtilsTest::testEvaluatePolynomialOrder1(), and exahype2::dg::tests::DGUtilsTest::testEvaluatePolynomialOrder2().
tarch::la::Vector< Dimensions, int > exahype2::dg::getIndex | ( | int | node, |
tarch::la::Vector< Dimensions, int > | strides ) |
Definition at line 55 of file DGUtils.cpp.
Referenced by computeGradient(), and exahype2::dg::tests::DGUtilsTest::testGetIndex().
The number of nodes in a cell is basically the input to the power of d.
The argument nodesPerAxis is typically the order plus one.
Definition at line 39 of file DGUtils.cpp.
Referenced by cellIntegral_patchwise_in_situ_GaussLegendre(), cellIntegral_patchwise_in_situ_GaussLegendre_functors(), subtractCell(), exahype2::dg::tests::DGUtilsTest::testComputeGradientOnConstantSolution(), exahype2::dg::tests::DGUtilsTest::testGetIndex(), and exahype2::dg::tests::RiemannTest::testProjectVolumetricDataOntoFacesForConstantSolutionOrder3().
tarch::la::Vector< Dimensions, double > exahype2::dg::getQuadraturePoint | ( | const tarch::la::Vector< Dimensions, double > & | cellCentre, |
const tarch::la::Vector< Dimensions, double > & | cellSize, | ||
const tarch::la::Vector< Dimensions, int > & | index, | ||
int | polynomialOrder, | ||
const T *__restrict__ | quadraturePoints ) |
Construct location of a quadrature point.
Given the centre of a cell as well as the size of this cell plus the index of a quadrature point, the underlying polynomial order and the 1d spacing of the points on the reference element, this function computes the spatial position of a quadrature node.
For example if there are 2 points in each dimension, located at [0.25,0.75] in 1d, then for a 2d cell with center 0.5 and size 1 [i.e. ranging from [0,0] to [1,1], there would be four nodes specified with indexes 0 to 3 and respective positions [0.25,0.25], [0.25,0.75], [0.75,0.25] and [0.75,0.75]
polynomialOrder | order of the underlying polynomial, this specifies the number of quadraturePoints in each direction as order+1 |
quadraturePoints | 1d quadrature points over unit interval. This array has polynomialOrder+1 entries. See the documentation of the Python class exaype2.solvers.LagrangeBasis (use search field in the webpage generated by doxygen). |
Definition at line 33 of file DGUtils.cpph.
References tarch::la::multiplyComponents().
Referenced by cellIntegral_patchwise_in_situ_GaussLegendre(), cellIntegral_patchwise_in_situ_GaussLegendre_functors(), and reduceMaxEigenvalue_patchwise_functors().
double exahype2::dg::getQuadratureWeight | ( | const tarch::la::Vector< 3, double > & | cellSize, |
const tarch::la::Vector< 3, int > & | index, | ||
const double *__restrict__ | quadratureWeights ) |
Compute integral over shape function over cell defined by index.
cellSize | Size of the cell hosting the polygonials. This vector determines the scaling, i.e. the \( h^d \) factor, of the outcome. |
index | Determine the quadrature point within the cell that is to be evaluated. |
quadratureWeights | Array of the weights of a 1d shape function, i.e. the outcome of the 1d integral. As we work with a tensor product approach, we can evaluate each direction independently. |
Definition at line 25 of file DGUtils.cpp.
Referenced by benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallDG::addDensity().
tarch::la::Vector< Dimensions, int > exahype2::dg::getStrides | ( | int | nodesPerAxis | ) |
Definition at line 47 of file DGUtils.cpp.
Referenced by computeGradient(), and exahype2::dg::tests::DGUtilsTest::testGetIndex().
void exahype2::dg::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre | ( | const double *const __restrict__ | faceQLeft, |
const double *const __restrict__ | faceQRight, | ||
const double *const __restrict__ | faceQBottom, | ||
const double *const __restrict__ | faceQUp, | ||
const double *const __restrict__ | faceQFront, | ||
const double *const __restrict__ | faceQBack, | ||
int | order, | ||
int | unknowns, | ||
const int | auxiliaryVariables, | ||
const tarch::la::Vector< 3, double > & | cellSize, | ||
const double *const __restrict__ | BasisFunctionValuesLeft, | ||
const double *__restrict__ | MassMatrixDiagonal1d, | ||
double *__restrict__ | cellQ ) |
3D counterpart of integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre()
The routine relies on a left-handed coordinate system. So we have a cube with a left and a right face. Those are the faxes 0 and 3 (=0+Dimensions). Their normal points along the x axis. Next, we have bottom and top face, as they have a normal along the y axis and y is the second coordinate axis. Finally, we handle the front and the back face. They are the faces 2 and 2+Dimensions=5. The front face comes first, as we work with a left-handed coordinate system, i.e. the normal points into the screen.
Definition at line 389 of file Riemann.cpp.
References dfor.
void exahype2::dg::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre | ( | const double *const __restrict__ | faceQLeft, |
const double *const __restrict__ | faceQRight, | ||
const double *const __restrict__ | faceQBottom, | ||
const double *const __restrict__ | faceQUp, | ||
int | order, | ||
int | unknowns, | ||
const int | auxiliaryVariables, | ||
const tarch::la::Vector< 2, double > & | cellSize, | ||
const double *const __restrict__ | BasisFunctionValuesLeft, | ||
const double *__restrict__ | MassMatrixDiagonal1d, | ||
double *__restrict__ | cellQ ) |
Given a numerical flux at the various faces, this computes and adds the Riemann integral of this flux to the nodes of the cell.
The code is a nested for loop, i.e. a 2d Cartesian loop. Per loop body, we add the results from left, right, bottom and top.
Computes this flux for a 2-dimensional cell
cellQ | the current solution, expected to be the solution already updated with local contributions. (See Euler.h) |
faceQX | This should contain a value for the numerical flux at each node along the corresponding face. This is typically computed by a Riemann solver such as a Rusanov solver. |
BasisFunctionValuesLeft (respectively Right): as the name implies, this is the numerical value of the basis function value evaluated at the left node in 1 dimension. This has a part in determining how much the value at the boundary influences the value at a given node. Note that the Basis function values on the right side are symmetric to those on the left side, so the BasisFunctionValuesLeft are also used there. | |
quadratureWeights | quadrature weight of the given quadrature node 1 dimension |
Definition at line 332 of file Riemann.cpp.
References dfor.
Referenced by exahype2::dg::average::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), exahype2::dg::fluxaverage::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), exahype2::dg::laxfriedrichs::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), exahype2::dg::rusanov::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), exahype2::dg::average::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), exahype2::dg::fluxaverage::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), exahype2::dg::laxfriedrichs::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre(), and exahype2::dg::rusanov::integrateOverRiemannSolutionsAndAddToVolume_GaussLegendre().
void exahype2::dg::interpolateRiemannSolution | ( | const peano4::datamanagement::FaceMarker & | marker, |
int | order, | ||
int | unknowns, | ||
const double *__restrict__ | InterpolationMatrix1d, | ||
const double *__restrict__ | coarseGridFaceQ, | ||
double *__restrict__ | fineGridFaceQ ) |
Core ingredient to this routine is the interpolation matrix. I describes how to interpolate a 1d polynomial over the unit interval into the three subcell polynomials. Consequently, the matrix points to three matrices. One for the left, one for the middle, one for the right subcell.
Each matrix accepts the order+1 values at the quadrature points as input, i.e. each matrix has order+1 columns. Each matrix returns the the output for one quadrature point at the chosen subcell. So each matrix has order+1 rows.
In the example above, we work with polynomials of order three. We hence have four quadrature points.
In the example above, the weights in c1, c2, c3 and c4 span a polynomial (blue). InterpolationMatrix1d points to \( 3 \cdot 4^2 \) entries. If we want to know the interpolated value for f31, we have to pick the third matrix (matrix index 2 as we start counting at zero), then take the first row of this matrix, and multiply its four entries with c1, c2, c3, c4.
All entries in all faces are enumerated lexicographically, i.e. from left to right, bottom-up, and always first along the x-axis, then y, then z.
I first construct a face enumerator. So I don't really have to care about the serialisation of the dofs anymore. This is all done by the enumerator.
Next, I compute the total number of unknowns (doubles) in the fine grid face and set them all to zero. From now on, I can accumulate the result. There is a factor of 2 in the calculation of the total number of unknowns. It results from the fact that I have a left and a right projection.
The main part of the routine is a nested loop, where I run over all combinations of input and output dofs. Again, these are three loops nested, as I always have left and right.
Per combination, I have to compute the d-1-dimensional tensor product over the interpolation matrix. For 2d, this degenerates to a simple lookup.
We run over the d-1-dimensional dofs of both coarse and fine grid face. For a 2d simulation, we hence run over a one-dimensional thing. The interpolation and restriction matrices in ExaHyPE are written down as 1d operators, as any dimension then results from a tensor-product approach.
So in 2d, we can only count which index in the coarse and fine grid face we are currently handling and thus effectively run through the interpolation matrix row by row and column by column. In 3d, where the face is actually a 2d object, this does not work. Here, the row and column indices are defined by the entry along one direction and d-1 entries have to be multiplied (tensor product). So effectively, we have to map the dof counter for coarse and fine first to the indices of a 1d projection operator.
numberOfProjectedQuantities | This is one if we only project the solution. It is two if we project the solution and the F-value or the solution and itsgradient along the normal. |
Definition at line 10 of file Riemann.cpp.
References assertion, assertion2, and dfore.
void exahype2::dg::multiplyWithInvertedMassMatrix_GaussLegendre | ( | ::exahype2::CellData< double, double > & | cellData, |
const int | order, | ||
const int | unknowns, | ||
const int | auxiliaryVariables, | ||
const double *__restrict__ | MassMatrixDiagonal1d ) |
Final step of DG algorithm.
This is the final step of any DG algorithm step, i.e. any Runge-Kutta step. Consult dg.h for a clearer explanation.
fineGridCell{{UNKNOWN_IDENTIFIER}}RhsEstimatessubject to some shifts.
This particular routine assumes that the mass matrix is a diagonal. Therefore, the inversion is trivial: We iterate over all degrees of freedom. This is a d-dimensional for loop (dfor). Per dof, we compute the diagonal, and every unknown then is scaled by the inverse of this diagonal.
Definition at line 258 of file CellIntegral.cpp.
References assertion, exahype2::CellData< inType, outType >::cellSize, dfor, exahype2::CellData< inType, outType >::numberOfCells, and exahype2::CellData< inType, outType >::QOut.
Referenced by exahype2::dg::average::multiplyWithInvertedMassMatrix_GaussLegendre(), exahype2::dg::fluxaverage::multiplyWithInvertedMassMatrix_GaussLegendre(), exahype2::dg::laxfriedrichs::multiplyWithInvertedMassMatrix_GaussLegendre(), and exahype2::dg::rusanov::multiplyWithInvertedMassMatrix_GaussLegendre().
std::string exahype2::dg::plotCell | ( | const double *__restrict__ | Q, |
const int | order, | ||
const int | unknowns, | ||
const int | auxiliaryVariables ) |
Definition at line 160 of file DGUtils.cpp.
Referenced by exahype2::dg::tests::CellIntegralTest::runEulerOrder2OnStationarySetup(), and exahype2::dg::tests::CellIntegralTest::runEulerOrder4OnStationarySetup().
std::string exahype2::dg::plotFace | ( | const double *__restrict__ | Q, |
const int | order, | ||
const int | unknowns, | ||
const int | auxiliaryVariables, | ||
int | normal, | ||
int | numberOfQuantitiesProjectedOntoFace ) |
Definition at line 176 of file DGUtils.cpp.
void exahype2::dg::projectAllValuesOntoParticle | ( | const peano4::datamanagement::CellMarker & | marker, |
int | order, | ||
const double *__restrict__ | QuadratureNodes1d, | ||
int | unknownsPerDoF, | ||
const QStoreType *__restrict__ | Q, | ||
Particle & | particle ) |
Take all values of the unknown field Q and project them onto the particle.
In this context, we assume that the tracer's number of entries and the unknowns plus the auxiliary variables have the same total count.
Definition at line 27 of file Tracer.cpph.
References assertion, and evaluatePolynomial().
void exahype2::dg::projectValueOntoParticle | ( | const peano4::datamanagement::CellMarker & | marker, |
int | order, | ||
const double *__restrict__ | QuadratureNodes1d, | ||
int | unknownsPerDoF, | ||
const double *__restrict__ | Q, | ||
Particle & | particle ) |
Project one quantity from the patch data onto the particle.
marker | Cell marker describing the cell's geometric/spatial properties. |
voxelsPerAxis | Describe patch. We assume that the pathch has not halo. |
unknownsPerVoxel | |
Q | Voxel field, i.e. actual patch data. Has the dimensions \( voxelsPerAxis^d \cdot unknownsPerVoxel \). |
particleX | Position of particle. |
unknown | Which unknown from data field to pick. |
Definition at line 5 of file Tracer.cpph.
References evaluatePolynomial().
void exahype2::dg::projectVolumetricDataAndGradientOntoFaces | ( | const double *__restrict__ | cellQ, |
int | order, | ||
int | unknowns, | ||
int | auxiliaryVariables, | ||
const double *const __restrict__ | BasisFunctionValuesLeft, | ||
double *const __restrict__ | faceQLeft, | ||
double *const __restrict__ | faceQRight, | ||
double *const __restrict__ | faceQBottom, | ||
double *const __restrict__ | faceQUp ) |
Definition at line 302 of file Riemann.cpp.
References assertionMsg.
void exahype2::dg::projectVolumetricDataAndGradientOntoFaces | ( | const double *__restrict__ | cellQ, |
int | order, | ||
int | unknowns, | ||
int | auxiliaryVariables, | ||
const double *const __restrict__ | BasisFunctionValuesLeft, | ||
double *const __restrict__ | faceQLeft, | ||
double *const __restrict__ | faceQRight, | ||
double *const __restrict__ | faceQBottom, | ||
double *const __restrict__ | faceQUp, | ||
double *const __restrict__ | faceQFront, | ||
double *const __restrict__ | faceQBack ) |
3d counterpart to other projectVolumetricDataOntoFaces() variant.
Definition at line 316 of file Riemann.cpp.
References assertionMsg.
void exahype2::dg::projectVolumetricDataOntoFaces | ( | const double *__restrict__ | cellQ, |
int | order, | ||
int | unknowns, | ||
int | auxiliaryVariables, | ||
const double *const __restrict__ | BasisFunctionValuesLeft, | ||
double *const __restrict__ | faceQLeft, | ||
double *const __restrict__ | faceQRight, | ||
double *const __restrict__ | faceQBottom, | ||
double *const __restrict__ | faceQUp ) |
Take polynomial within cell and project it onto the faces.
2 3 0 1 2 3 [ o o ] 2 3 0 1 [ o o ] 0 1 2 3 0 1
Each individual face is ordered lexicographically. So we go from left to right, and we always start closest to the origin or the coordinate system if we interpret the cell as the unit square.
The sketch above illustrates the ordering of the four faces for a p=1 discretisation where we have two dofs per direction per face per side.
cellQ | Pointer to cell data. The array has the size \( unknowns \times (order+1)^d\). |
order | Integer greater or equal to 0. The number of nodes in each dimension will be equal to order+1 |
BasisFunctionValuesLeft | Array of size order+1 which clarifies (in 1d) how to project the order+1 quadrature weights onto a value on the left face. For Gauss Lobatto, this is a trivial array (you can read out the value directly from the leftmost quadrature point, but for any other basis, you need a linear combination of all the quadrature points in the cell. |
faceQLeft | Left unknowns. This array hosts \( 2 \times (order+1)^(d-1) * unknowns\) values, as it holds the (projected) values from the left side of the face and those from the right. The ordering of these values is lexicographic, i.e. the first unknowns entries are those at the bottom of the vertical face from the left adjacent cell. The next unknowns entries are those at the bottom of the face from the right adjacent cell. The next are then again left, then right, then left and so on. This function will fill the right values since the current cell is to the right of its own left face. |
faceQBottom | Bottom unknowns. See faceQLeft. Again, we order lexicographically. This time, the first half of the entries are those from the adjacent cell below. The remaining entries are the projections from above. |
Definition at line 167 of file Riemann.cpp.
References exahype2::volumeIndex().
Referenced by exahype2::dg::tests::RiemannTest::testProjectVolumetricDataOntoFacesForConstantSolutionOrder0(), and exahype2::dg::tests::RiemannTest::testProjectVolumetricDataOntoFacesForConstantSolutionOrder3().
void exahype2::dg::projectVolumetricDataOntoFaces | ( | const double *__restrict__ | cellQ, |
int | order, | ||
int | unknowns, | ||
int | auxiliaryVariables, | ||
const double *const __restrict__ | BasisFunctionValuesLeft, | ||
double *const __restrict__ | faceQLeft, | ||
double *const __restrict__ | faceQRight, | ||
double *const __restrict__ | faceQBottom, | ||
double *const __restrict__ | faceQUp, | ||
double *const __restrict__ | faceQFront, | ||
double *const __restrict__ | faceQBack ) |
3d counterpart to other projectVolumetricDataOntoFaces() variant.
Definition at line 221 of file Riemann.cpp.
References exahype2::volumeIndex().
void exahype2::dg::reduceMaxEigenvalue_patchwise_functors | ( | ::exahype2::CellData< double, double > & | cellData, |
const int | order, | ||
const int | unknowns, | ||
const int | auxiliaryVariables, | ||
MaxEigenvalue | maxEigenvalue, | ||
const double *__restrict__ | QuadratureNodes1d ) |
Compute the maximum eigenvalues over a sequence of cells and store the result in the respective CellData entry.
Definition at line 197 of file CellIntegral.cpp.
References assertion, exahype2::CellData< inType, outType >::cellCentre, exahype2::CellData< inType, outType >::cellSize, dfor, exahype2::CellData< inType, outType >::dt, getQuadraturePoint(), exahype2::CellData< inType, outType >::maxEigenvalue, exahype2::CellData< inType, outType >::numberOfCells, exahype2::CellData< inType, outType >::QOut, and exahype2::CellData< inType, outType >::t.
void exahype2::dg::restrictAndAccumulateProjectedFacePolynomial | ( | const peano4::datamanagement::FaceMarker & | marker, |
int | order, | ||
int | numberOfProjectedQuantities, | ||
int | unknowns, | ||
int | auxiliaryVariables, | ||
const double *__restrict__ | RestrictionMatrix1d, | ||
const double *__restrict__ | fineGridFaceQ, | ||
double *__restrict__ | coarseGridFaceQ ) |
Counterpart of interpolateRiemannSolution().
The restriction matrix has exactly the same form as the interpolation matrix. However, this time we multiply the corresponding row of the submatrix with a weight from the fine grid.
The image below illustrates the same example as used in interpolateRiemannSolution():
Different to the interpolation, we pick one of the three submatrices of RestrictionMatrix1d, compute the c1, c2, c3 and c4 values and then add them to the coarse representation. The interpolation can overwrite.
Different to the interpolation, we only restrict one half of the face and not both. The interpolation can set both sides, as it overwrites a hanging face (or a new one). When we restrict, we know that a persistent coarse grid face might already hold some projected solution. We are interested in the other half. If we accumulate both, we'd add the interpolated value (or any other rubbish) again to the one face part which had been valid before.
Definition at line 69 of file Riemann.cpp.
References assertion, assertion2, assertionEquals, and dfore.
void exahype2::dg::subtractCell | ( | double *__restrict__ | QOut, |
const double *__restrict__ | Qsubstract, | ||
const int | order, | ||
const int | unknowns, | ||
const int | auxiliaryVariables ) |
Definition at line 141 of file DGUtils.cpp.
References getNodesPerCell().