24 #include <gsl/gsl_math.h>
25 #include "pism/verification/tests/exactTestsIJ.h"
27 #define secpera 31556926.0
37 const double L = 40e3;
38 const double aspect = 0.05;
39 const double h0 = aspect *
L;
40 const double theta = atan(0.001);
41 const double rho = 910,
g = 9.81;
42 const double f =
rho *
g *
h0 * tan(theta);
44 const double W = pow(m+1.0,1.0/m) *
L;
45 const double B = 3.7e8;
48 const double s = fabs(y/
L);
50 double C0, C1, C2, C3, C4, z1, z2, z3, z4;
52 result.
tauc = f * pow(s,m);
56 result.
bed = - x * tan(theta);
60 C0 = 2.0 * pow(f / (B *
h0),3.0) * pow(
L,4.0);
62 C1 = pow(m + 1.0, 4.0/m);
66 z1 = (pow(s,4.0) - C1) / 4.0;
67 z2 = (pow(s,m+4.0) - C2) / ((m+1.0) * (m+4.0));
68 z3 = (pow(s,2.0*m+4.0) - C3) / ((m+1.0)*(m+1.0) * (2.0*m+4.0));
69 z4 = (pow(s,3.0*m+4.0) - C4) / (pow((m+1.0),3.0) * (3.0*m+4.0));
71 result.
u = - C0 * (z1 - 3.0 * z2 + 3.0 * z3 - z4);
85 const double L = 300.0e3;
86 const double H0 = 500.0;
89 const double nu0 = 30.0 * 1.0e6 *
secpera;
91 const double rho_sw = 1028.0;
92 const double g = 9.81;
94 const double my_gamma[3][3] = {{1.0854, 0.108, 0.0027},
95 {0.402 , 0.04 , 0.001 },
96 {0.0402, 0.004, 0.0001}};
97 const double A =
L / (4.0 * M_PI);
98 double uu = 0.0, vv = 0.0, denom, trig, kx, ly, B;
101 result.H =
H0 * (1.0 + 0.4 * cos(M_PI * x /
L)) * (1.0 + 0.1 * cos(M_PI * y /
L));
102 result.nu = (nu0 *
H0) / result.H;
103 for (
k=-2;
k<=2;
k++) {
104 for (l=-2; l<=2; l++) {
105 if ((
k != 0) || (l != 0)) {
106 denom = (double)(
k *
k + l * l);
107 kx = (double)(
k) * M_PI * x /
L;
108 ly = (double)(l) * M_PI * y /
L;
109 trig = cos(kx) * sin(ly) + sin(kx) * cos(ly);
110 B = (A / denom) * (
C * my_gamma[abs(
k)][abs(l)]) * trig;
111 uu += B * (double)(
k);
112 vv += B * (double)(l);
struct TestJParameters exactJ(const double x, const double y)
struct TestIParameters exactI(const double m, const double x, const double y)