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);
34 auto projectionFunctionForward = [](
const auto lon,
const auto lat) {
36 constants::aeaEllipsoidA,
37 constants::aeaEllipsoidE,
38 constants::aeaStdParallel1,
39 constants::aeaStdParallel2,
41 constants::aeaLat0>(lon, lat);
44 auto projectionFunctionInverse = [](
const auto x,
const auto y) {
46 constants::aeaEllipsoidA,
47 constants::aeaEllipsoidE,
48 constants::aeaStdParallel1,
49 constants::aeaStdParallel2,
51 constants::aeaLat0>(
x,
y);
54 const auto [lonCoord, latCoord] = projectionFunctionInverse(xCoord, yCoord);
59 S[Shortcuts::hu] = applications::exahype2::ShallowWater::coriolisForce::sphere<constants::coriolis_omega>(latCoord)
61 S[Shortcuts::hv] = -applications::exahype2::ShallowWater::coriolisForce::sphere<constants::coriolis_omega>(latCoord)
67 constants::manning_param>(Q[Shortcuts::h], Q[Shortcuts::hu], Q[Shortcuts::hv])
71 constants::manning_param>(Q[Shortcuts::h], Q[Shortcuts::hu], Q[Shortcuts::hv])
75 auto wrapperAtmosphericPressure =
76 [projectionFunctionInverse, projectionFunctionForward](
const auto x,
const auto y,
const auto t) {
81 constants::pointLatB>(
x,
y, t, projectionFunctionForward, projectionFunctionInverse);
86 / constants::water_density;
88 / constants::water_density;
static auto atmosphericPressure(const auto x, const auto y, const auto t, auto projectionFunctionForward, auto projectionFunctionInverse)
Computes the moving atmospheric pressure disturbance for the Gulf of Mexico test case.
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.
static auto forward(const auto lonDeg, const auto latDeg)
static auto inverse(const auto x, const auto y)
Inverts the Albers Equal-Area Conic projection for WGS_1984 and returns the geographic coordinates (l...