3#include "PlanarAcousticSolver.h"
5tarch::logging::Log tutorials::exahype2::acoustic::PlanarAcousticSolver::_log(
6 "tutorials::exahype2::acoustic::PlanarAcousticSolver"
9void tutorials::exahype2::acoustic::PlanarAcousticSolver::initialCondition(
10 [[maybe_unused]]
double*
const NOALIAS Q,
11 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& x,
12 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& h,
13 [[maybe_unused]]
const bool gridIsConstructed
16 const double val = cos(-std::numbers::pi * (x[0] + x[1]));
18 Q[Shortcuts::v + 0] = val;
19 Q[Shortcuts::v + 1] = val;
21 constexpr double K0 = 4.0;
22 constexpr double rho = 1.0;
25 const double kr = std::sqrt(2 * K0 * rho);
26 Q[Shortcuts::p] = kr * val;
29void tutorials::exahype2::acoustic::PlanarAcousticSolver::boundaryConditions(
30 [[maybe_unused]]
const double*
const NOALIAS Qinside,
31 [[maybe_unused]]
double*
const NOALIAS Qoutside,
32 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& x,
33 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& h,
34 [[maybe_unused]]
const double t,
35 [[maybe_unused]]
const int normal
41double tutorials::exahype2::acoustic::PlanarAcousticSolver::maxEigenvalue(
42 [[maybe_unused]]
const double*
const NOALIAS Q,
43 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& x,
44 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& h,
45 [[maybe_unused]]
const double t,
46 [[maybe_unused]]
const double dt,
47 [[maybe_unused]]
const int normal
49 constexpr double K0 = 4.0;
50 constexpr double rho = 1.0;
51 const double c = std::sqrt(4.0 / rho);
55void tutorials::exahype2::acoustic::PlanarAcousticSolver::flux(
56 [[maybe_unused]]
const double*
const NOALIAS Q,
57 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& x,
58 [[maybe_unused]]
const tarch::la::Vector<DIMENSIONS, double>& h,
59 [[maybe_unused]]
const double t,
60 [[maybe_unused]]
const double dt,
61 [[maybe_unused]]
const int normal,
62 [[maybe_unused]]
double*
const NOALIAS F
64 constexpr double K0 = 4.0;
65 constexpr double rho = 1.0;
69 F[Shortcuts::p] =
K0 * Q[Shortcuts::v + normal];
70 F[Shortcuts::v + 0] = Q[Shortcuts::p] /
rho;
71 F[Shortcuts::v + 1] = 0.0;
74 F[Shortcuts::p] =
K0 * Q[Shortcuts::v + normal];
75 F[Shortcuts::v + 0] = 0.0;
76 F[Shortcuts::v + 1] = Q[Shortcuts::p] /
rho;