4template <
class T,
class Shortcuts,
int NumberOfUnknowns,
int NumberOfAuxiliaryVariables>
6 const T*
const NOALIAS QL,
7 const T*
const NOALIAS QR,
8 const tarch::la::Vector<DIMENSIONS, double>& x,
9 const tarch::la::Vector<DIMENSIONS, double>& h,
16 ShallowWater::flux<T, Shortcuts, NumberOfUnknowns>(QL, x, h, t, dt, normal, FL);
17 ShallowWater::flux<T, Shortcuts, NumberOfUnknowns>(QR, x, h, t, dt, normal, FR);
19 landslide::flux<T, Shortcuts>(QL, x, h, t, dt, normal, FL);
20 landslide::flux<T, Shortcuts>(QR, x, h, t, dt, normal, FR);
22 const auto smax{std::fmax(
24 ShallowWater::maxEigenvalue<T, Shortcuts>(QL, x, h, t, dt, normal),
25 ShallowWater::maxEigenvalue<T, Shortcuts>(QR, x, h, t, dt, normal)
28 landslide::maxEigenvalue<T, Shortcuts>(QL, x, h, t, dt, normal),
29 landslide::maxEigenvalue<T, Shortcuts>(QR, x, h, t, dt, normal)
32 const auto N{NumberOfAuxiliaryVariables + NumberOfUnknowns};
35 double DeltaQ[N] = {};
36 for (
int i = 0; i < NumberOfUnknowns; ++i) {
37 Qavg[i] = 0.5 * (QL[i] + QR[i]);
38 DeltaQ[i] = QR[i] - QL[i];
39 FL[i] = 0.5 * (FL[i] + FR[i] - smax * DeltaQ[i]);
43 for (
int i = NumberOfUnknowns; i < N; ++i) {
44 Qavg[i] = 0.5 * (QL[i] + QR[i]);
45 DeltaQ[i] = QR[i] - QL[i];
48 double ncp[NumberOfUnknowns] = {};
49 ShallowWater::nonconservativeProduct<T, Shortcuts, NumberOfUnknowns>(Qavg, DeltaQ, x, h, t, dt, normal, ncp);
50 landslide::nonconservativeProduct<T, Shortcuts>(Qavg, DeltaQ, x, h, t, dt, normal, ncp);
51 for (
int i = 0; i < NumberOfUnknowns; ++i) {
52 FL[i] += 0.5 * ncp[i];
53 FR[i] -= 0.5 * ncp[i];
57 if (QL[Shortcuts::lsh] > hThreshold) {
60 std::sqrt(QL[Shortcuts::lshu] * QL[Shortcuts::lshu] + QL[Shortcuts::lshv] * QL[Shortcuts::lshv])
62 sL = 2.0 *
g * momentumL * invXi / (hL * hL);
66 if (QL[Shortcuts::lsh] > hThreshold) {
69 std::sqrt(QR[Shortcuts::lshu] * QR[Shortcuts::lshu] + QR[Shortcuts::lshv] * QR[Shortcuts::lshv])
71 sR = 2.0 *
g * momentumR * invXi / (hR * hR);
74 return std::fmax(smax, h[normal] * std::fmax(sL, sR));
static GPU_CALLABLE_METHOD double rusanovRiemannSolverFV(const T *const NOALIAS QL, const T *const NOALIAS QR, const tarch::la::Vector< DIMENSIONS, double > &x, const tarch::la::Vector< DIMENSIONS, double > &h, const double t, const double dt, const int normal, T *const NOALIAS FL, T *const NOALIAS FR)