10template <
class T,
class Shortcuts,
int NumberOfUnknowns,
int NumberOfAuxiliaryVariables>
12 const T*
const NOALIAS Q,
13 const tarch::la::Vector<DIMENSIONS, double>& x,
14 const tarch::la::Vector<DIMENSIONS, double>& h,
19 namespace constants = ::applications::exahype2::ShallowWater;
22 for (std::size_t n = 0; n < NumberOfUnknowns; n++) {
27 if (Q[Shortcuts::h] <= constants::hThreshold) {
31 const auto xCoord =
x(0);
32 const auto yCoord =
x(1);
37 S[Shortcuts::hu] = applications::exahype2::ShallowWater::coriolisForce::constant<constants::corriolis_param>()
39 S[Shortcuts::hv] = -applications::exahype2::ShallowWater::coriolisForce::constant<constants::corriolis_param>()
45 constants::manning_param>(Q[Shortcuts::h], Q[Shortcuts::hu], Q[Shortcuts::hv])
49 constants::manning_param>(Q[Shortcuts::h], Q[Shortcuts::hu], Q[Shortcuts::hv])
53 auto wrapperAtmosphericPressure = [](
const auto x,
const auto y,
const auto t) {
56 constants::speed_pressure,
57 constants::period_pressure,
58 constants::background_pressure>(
x,
y, t);
63 / constants::water_density;
65 / constants::water_density;
static auto atmosphericPressure(const auto x, const auto y, const auto t)
Computes the pressure field p(x, y, t) following the Jörn test-case logic.
static auto manningFriction(const auto h, const auto hu, const auto hv)
Computes the Manning bottom friction.
static GPU_CALLABLE_METHOD void sourceTerm(const T *const NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &x, const tarch::la::Vector< DIMENSIONS, double > &h, const double t, const double dt, T *const NOALIAS S)
static auto partialX(auto f, const auto x, const auto y, const auto t)
Approximates the partial derivative ∂f/∂x of a function f(x, y, t) using central differences.
static auto partialY(auto f, const auto x, const auto y, const auto t)
Approximates the partial derivative ∂f/∂y of a function f(x, y, t) using central differences.