Peano
Loading...
Searching...
No Matches
TestUtils.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#include <vector>
6
7#include "tarch/la/Vector.h"
9
12
13namespace exahype2 {
14 namespace dg {
15 namespace tests{
16
17 constexpr double QuadratureNodes1dP1[] = { 0.21132486540518713,0.7886751345948129 };
18 constexpr double QuadratureNodes1dP2[] = { 0.1127016653792583,0.5,0.8872983346207417};
19
20 constexpr double DerivativeOperatorLagrangeP3[] = {
21 -6.6640004727045631938153746887110173702239990234375,9.7203088313703940315235740854404866695404052734375,-4.21756469699035818621268845163285732269287109375,1.161256338324529568950538305216468870639801025390625,
22 -1.5151152295984677831341969067580066621303558349609375,-0.7688287844464174458636307463166303932666778564453125,2.941340462561433444221847821609117090702056884765625,-0.6573964485165488813578349436284042894840240478515625,
23 0.65739644851654832624632263105013407766819000244140625,-2.941340462561433444221847821609117090702056884765625,0.768828784446416335640606121160089969635009765625,1.515115229598468449268011681851930916309356689453125,
24 -1.161256338324528680772118605091236531734466552734375,4.21756469699035729803426875150762498378753662109375,-9.720308831370392255166734685190021991729736328125,6.66400047270456497017221408896148204803466796875};
25
26 constexpr double BasisFunctionValuesLeftP0[] = {
27 1.0
28 };
29 constexpr double BasisFunctionValuesLeftP3[] = {
30 1.5267881254572663873858573424513451755046844482421875,-0.8136324494869271450880887641687877476215362548828125,
31 0.40076152031165046540905905203544534742832183837890625,-0.11391719628198997138479597879268112592399120330810546875};
32
33 /*
34 * Contains implementations of the functions required to test the dg implementation
35 * for euler equations.
36 */
37 void eulerFlux(
38 const double * __restrict__ Q,
40 double t,
41 double dt,
42 int normal,
43 double * __restrict__ F
44 );
45
46 void eulerSource(
47 const double * __restrict__ Q,
49 double t,
50 double dt,
51 double * __restrict__ S
52 );
53
54 double eulerEigenvalue(
55 const double * __restrict__ Q,
57 double t,
58 double dt,
59 int normal
60 );
61
63 const double * __restrict__ Qinside,
64 double * __restrict__ Qoutside,
66 double t,
67 double dt,
68 int normal
69 );
70
71 void eulerInitial(
72 double * __restrict__ Q,
73 int node=0
74 );
75
76 void elasticInitial(
77 double * __restrict__ Q
78 );
79
80 void elasticFlux(
81 const double * __restrict__ Q,
83 double t,
84 double dt,
85 int normal,
86 double * __restrict__ F
87 );
88
89 void elasticSource(
90 const double * __restrict__ Q,
92 double t,
93 double dt,
94 double * __restrict__ S
95 );
96
97 double elasticEigenvalue(
98 const double * __restrict__ Q,
100 double t,
101 double dt,
102 int normal
103 );
104
106 const double * __restrict__ Qinside,
107 double * __restrict__ Qoutside,
109 double t,
110 double dt,
111 int normal
112 );
113
114 void elasticNonConservativeProduct( const double * __restrict__ Q,
115 const double * __restrict__ deltaQ,
116 const tarch::la::Vector<Dimensions,double>& faceCentre,
117 double t,
118 double dt,
119 int normal,
120 double * __restrict__ BgradQ
121 );
122
123
124 // test boundary condition function to check whether applying boundary conditions works
126 const double * __restrict__ Qinside,
127 double * __restrict__ Qoutside,
129 double t,
130 double dt,
131 int normal
132 );
133
134
136 const double * __restrict__ Qinside,
137 double * __restrict__ Qoutside,
139 double t,
140 double dt,
141 int normal
142 );
143
144
145 double testEigenvalue(
146 const double * __restrict__ Q,
148 double t,
149 double dt,
150 int normal
151 );
152 }
153 }
154}
Definition dg.py:1
constexpr double QuadratureNodes1dP2[]
Definition TestUtils.h:18
void elasticInitial(double *__restrict__ Q)
Definition TestUtils.cpp:95
constexpr double BasisFunctionValuesLeftP3[]
Definition TestUtils.h:29
double eulerEigenvalue(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
Definition TestUtils.cpp:38
constexpr double BasisFunctionValuesLeftP0[]
Definition TestUtils.h:26
void elasticFlux(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F)
constexpr double QuadratureNodes1dP1[]
Definition TestUtils.h:17
double elasticEigenvalue(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
void secondTestBoundaryConditions(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
constexpr double DerivativeOperatorLagrangeP3[]
Definition TestUtils.h:20
void elasticSource(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, double *__restrict__ S)
void eulerBoundaryConditions(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
Definition TestUtils.cpp:69
void eulerFlux(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F)
Definition TestUtils.cpp:3
void elasticBoundaryConditions(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
void testBoundaryConditions(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
double testEigenvalue(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal)
void eulerInitial(double *__restrict__ Q, int node=0)
Definition TestUtils.cpp:84
void elasticNonConservativeProduct(const double *__restrict__ Q, const double *__restrict__ deltaQ, const tarch::la::Vector< Dimensions, double > &faceCentre, double t, double dt, int normal, double *__restrict__ BgradQ)
void eulerSource(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, double *__restrict__ S)
Definition TestUtils.cpp:24
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13
Simple vector class.
Definition Vector.h:150