13 TestCase (
"exahype2::dg::tests::DGUtilsTest") {
19 testMethod( testComputeGradientOnConstantSolution );
31 dummyEvent.
setX( {0.4,0.6} );
32 dummyEvent.
setH( {0.2,0.2} );
33 double Q0[] = {1.2,1.2,1.2,1.2};
37 dummyEvent.
setX( {0.4,0.6,0.8} );
38 dummyEvent.
setH( {0.2,0.2,0.2} );
39 double Q0[] = {1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2};
77 dummyEvent.
setX( {0.4,0.6} );
78 dummyEvent.
setH( {0.2,0.2} );
79 double Q0[] = { 1.2, 1.2, 1.2,
85 dummyEvent.
setX( {0.4,0.6,0.8} );
86 dummyEvent.
setH( {0.2,0.2,0.2} );
87 double Q0[] = { 1.2, 1.2, 1.2,
129 const int nodesPerAxis = order+1;
135 validateEquals(strides[Dimensions-1], std::pow(nodesPerAxis,Dimensions-1));
138 for(
int i=0; i<Dimensions; i++){
143 for(
int i=0; i<Dimensions; i++){
152 const int nodesPerAxis = order+1;
156 double cellQin[2*nodesPerCell];
157 double gradientValues[2*Dimensions];
158 for(
int i=0; i<2*nodesPerCell; i++){
162 for(
int node=0; node<nodesPerCell; node++){
172 for(
int var=0; var<Dimensions; var++){
#define testMethod(name)
Run a test method and check for errors.
#define validateNumericalEquals(actualValue, validValue)
#define validateNumericalEqualsWithParams1(actualValue, validValue, param0)
#define validateEquals(actualValue, validValue)
void run() override
This routine is triggered by the TestCaseCollection.
void testComputeGradientOnConstantSolution()
void testEvaluatePolynomialOrder1()
void testEvaluatePolynomialOrder2()
constexpr double QuadratureNodes1dP2[]
constexpr double QuadratureNodes1dP1[]
constexpr double DerivativeOperatorLagrangeP3[]
tarch::la::Vector< Dimensions, int > getStrides(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)
tarch::la::Vector< Dimensions, int > getIndex(int node, tarch::la::Vector< Dimensions, int > strides)
int getNodesPerCell(int nodesPerAxis)
The number of nodes in a cell is basically the input to the power of d.
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.
std::string toString() const
void setX(const tarch::la::Vector< Dimensions, double > &value)
void setH(const tarch::la::Vector< Dimensions, double > &value)