23template <
bool useFlux,
bool useNCP,
bool useMM,
typename SolverType>
25 const double*
const QL,
const double*
const QR,
30 const int direction) {
44 constexpr int numberOfVariables = SolverType::NumberOfVariables;
46 constexpr int numberOfParameters = SolverType::NumberOfParameters;
47 constexpr int numberOfData = numberOfVariables+numberOfParameters;
49 constexpr int basisSize = SolverType::Order+1;
50 constexpr int basisSize2 = basisSize*basisSize;
51 constexpr int order = basisSize - 1;
55 double QavL[numberOfData] = {0.0};
56 double QavR[numberOfData] = {0.0};
57 kernels::riemannsolvers::util::averageRiemannInputs<basisSize,numberOfData>(
59 kernels::riemannsolvers::util::averageRiemannInputs<basisSize,numberOfData>(
63 const double maxHyperbolicEigenvalueL =
solver.maxEigenvalue(QavL, faceCentre,
dx, t, dt, direction);
64 const double maxHyperbolicEigenvalueR =
solver.maxEigenvalue(QavR, faceCentre,
dx, t, dt, direction);
65 const double smax = std::max(maxHyperbolicEigenvalueL, maxHyperbolicEigenvalueR);
67 double Qdiff[numberOfData] = {0.0};
68 double Qavg[numberOfData] = {0.0};
70 idx2 idx_2d(Dimensions, numberOfVariables);
72 double flux[numberOfVariables];
74 double ncp[numberOfVariables] = {0.0};
76 for(
int l = 0; l < numberOfData; l++) {
77 Qavg[l] = 0.5 * (QavR[l] + QavL[l]);
82 for(
int l = numberOfVariables; l < numberOfData; l++) {
87 idx3 idx_FLR(basisSize,basisSize, numberOfVariables);
88 idx3 idx_QLR(basisSize,basisSize, numberOfData);
90 std::fill_n (FL, basisSize2 * numberOfVariables, 0.0);
91 std::fill_n (FR, basisSize2 * numberOfVariables, 0.0);
92 for (
int i = 0;
i < basisSize;
i++) {
93 for (
int j = 0;
j < basisSize;
j++) {
94 for(
int l = 0 ; l< numberOfVariables ; l++){
95 Qdiff[l] = 0.5 * (QR[idx_QLR(i,
j, l)] - QL[idx_QLR(i ,
j, l)]);
100 solver.nonconservativeProduct(
115 for(
int l=0; l < numberOfVariables; l++) {
116 FL[idx_FLR(i,
j, l)] +=
ncp[l];
117 FR[idx_FLR(i,
j, l)] +=
ncp[l];
138 for(
int l=0; l < numberOfVariables; l++) {
139 FL[idx_FLR(i,
j, l)] +=
flux[l];
140 FR[idx_FLR(i,
j, l)] +=
flux[l];
144 for(
int l=0; l < numberOfVariables; l++) {
145 FL[idx_FLR(i,
j, l)] -= smax*Qdiff[l];
146 FR[idx_FLR(i,
j, l)] += smax*Qdiff[l];
And from this we can write down f$ nabla phi_i nabla phi_i dx but since we are constructing matrix let s investigate the f$ j
we integrate over each cell and then take the sum across each of the cells We also consider the terms that enter the f$ so we are integrating with f$ phi_k phi_k dx
void riemannSolverLinear(SolverType &solver, double *FL, double *FR, const double *const QL, const double *const QR, const double t, const double dt, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &dx, const int direction)
This file is part of the ExaHyPE project.