4 #include "pism/stressbalance/blatter/verification/manufactured_solutions.hh"
22 double x2 = pow(x1, 2);
23 double x3 = pow(M_PI, 2);
24 double x4 = pow(M_PI, 3);
25 double x5 = pow(M_PI, 4);
27 double x7 = pow(x6, 2);
28 double x8 = pow(2, 2.0/3.0)*B*exp((1.0/3.0)*x)/pow(x2*(4*x3 + 1 + 4*M_PI) + x7*(16*x3 - 8*M_PI + 4), 4.0/3.0);
30 -1.0/3.0*x6*x8*(x2*(6*x3 + 20*x4 + 72*x5 - 2 + 3*M_PI) + x7*(-48*x3 + 32*x4 + 96*x5 - 8 + 36*M_PI)),
31 -1.0/6.0*x1*x8*(x2*(-12*x3 + 136*x4 + 192*x5 - 18*M_PI - 1) + x7*(96*x3 - 128*x4 + 384*x5 - 24*M_PI - 4))
38 -4*A*pow(alpha, 3)*pow(
g, 3)*pow(
rho, 3)*pow(x, 3)*(-pow(H, 4) + pow(-alpha*pow(x, 2) + s_0 - z, 4)) + 2*H*alpha*
g*
rho*x/beta,
44 double phi_1 = alpha*pow(x, 2) - s_0 + z;
45 double phi_2 = 4*A*pow(alpha, 3)*pow(
g, 3)*pow(
rho, 3)*x;
46 double phi_3 = 4*pow(phi_1, 5)*pow(phi_2, 2)*pow(x, 3);
47 double phi_4 = -2*H*alpha*
g*
rho/beta + 8*alpha*pow(phi_1, 3)*phi_2*pow(x, 3) + 3*phi_2*x*(-pow(H, 4) + pow(phi_1, 4));
48 double phi_5 = 48*pow(alpha, 2)*pow(phi_1, 2)*phi_2*pow(x, 4) + 56*alpha*pow(phi_1, 3)*phi_2*pow(x, 2) + 6*phi_2*(-pow(H, 4) + pow(phi_1, 4));
49 double mu = (1.0/2.0)/cbrt(A*phi_1*phi_3*x + A*pow(phi_4, 2));
52 (16.0/3.0)*A*pow(mu, 4)*(-6*pow(phi_1, 3)*phi_2*phi_3*pow(x, 3) - 18*pow(phi_1, 2)*phi_2*pow(phi_4, 2)*pow(x, 2) - 6*phi_1*phi_3*phi_5*x + 24*phi_3*phi_4*(2*alpha*pow(x, 2) + phi_1) - 2*pow(phi_4, 2)*phi_5),
58 double phi_1 = alpha*pow(x, 2) - s_0 + z;
59 double phi_2 = 4*A*pow(alpha, 3)*pow(
g, 3)*pow(
rho, 3)*x;
60 double phi_3 = 4*pow(phi_1, 5)*pow(phi_2, 2)*pow(x, 3);
61 double phi_4 = -2*H*alpha*
g*
rho/beta + 8*alpha*pow(phi_1, 3)*phi_2*pow(x, 3) + 3*phi_2*x*(-pow(H, 4) + pow(phi_1, 4));
62 double mu = (1.0/2.0)/cbrt(A*phi_1*phi_3*x + A*pow(phi_4, 2));
63 double n_x = -2*alpha*x/sqrt(4*pow(alpha, 2)*pow(x, 2) + 1);
64 double n_z = -1/sqrt(4*pow(alpha, 2)*pow(x, 2) + 1);
67 2*H*alpha*
g*
rho*x - beta*phi_2*pow(x, 2)*(-pow(H, 4) + pow(phi_1, 4)) - 4*mu*n_x*phi_4 - 4*mu*n_z*pow(phi_1, 3)*phi_2*pow(x, 2),
73 double phi_1 = alpha*pow(x, 2) - s_0 + z;
74 double phi_2 = 4*A*pow(alpha, 3)*pow(
g, 3)*pow(
rho, 3)*x;
75 double phi_3 = 4*pow(phi_1, 5)*pow(phi_2, 2)*pow(x, 3);
76 double phi_4 = -2*H*alpha*
g*
rho/beta + 8*alpha*pow(phi_1, 3)*phi_2*pow(x, 3) + 3*phi_2*x*(-pow(H, 4) + pow(phi_1, 4));
77 double mu = (1.0/2.0)/cbrt(A*phi_1*phi_3*x + A*pow(phi_4, 2));
78 double n_x = 2*alpha*x/sqrt(4*pow(alpha, 2)*pow(x, 2) + 1);
79 double n_z = pow(4*pow(alpha, 2)*pow(x, 2) + 1, -1.0/2.0);
82 -4*mu*n_x*phi_4 - 4*mu*n_z*pow(phi_1, 3)*phi_2*pow(x, 2),
90 (1.0/2.0)*
L*
g*z*(rho_i - rho_w)*sin(M_PI*x/
L)/(M_PI*B),
99 -
g*x0*z*(rho_i - rho_w)*sin(x*x0),
107 (1.0/4.0)*
L*
g*(rho_i - rho_w)*sin(M_PI*x/
L)/M_PI,
115 -1.0/4.0*
L*
g*(rho_i - rho_w)*sin(M_PI*x/
L)/M_PI,
122 double C_1 = 1.0/R_0;
123 double C_2 = (1.0/2.0)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
124 double h0 = C_0*pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 3.0/7.0);
125 double h_x = -4.0/7.0*C_0*pow(C_1, 4.0/3.0)*cbrt(x)/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
127 -C_2*pow(h_x, 3)*(pow(
h0, 4) - pow(
h0 - z, 4)),
134 double C_1 = 1.0/R_0;
135 double C_2 = (1.0/2.0)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
136 double h0 = C_0*pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 3.0/7.0);
137 double h_x = -4.0/7.0*C_0*pow(C_1, 4.0/3.0)*cbrt(x)/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
138 double h_xx = (4.0/147.0)*C_0*pow(C_1, 4.0/3.0)*(16*pow(C_1, 4.0/3.0)*pow(x, 2.0/3.0)/(pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) - 1) - 7/pow(x, 2.0/3.0))/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
139 double h_xxx = -8.0/3087.0*C_0*(-168*pow(C_1, 8.0/3.0)/(cbrt(x)*(pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) - 1)) - 49*pow(C_1, 4.0/3.0)/pow(x, 5.0/3.0) + 352*pow(C_1, 4)*x/pow(pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) - 1, 2))/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
140 double u_x = -C_2*pow(h_x, 3)*(4*pow(
h0, 3)*h_x - 4*h_x*pow(
h0 - z, 3)) - 3*C_2*pow(h_x, 2)*h_xx*(pow(
h0, 4) - pow(
h0 - z, 4));
141 double u_z = -4*C_2*pow(h_x, 3)*pow(
h0 - z, 3);
142 double u_xx = -C_2*pow(h_x, 3)*(4*pow(
h0, 3)*h_xx + 12*pow(
h0, 2)*pow(h_x, 2) - 12*pow(h_x, 2)*pow(
h0 - z, 2) - 4*h_xx*pow(
h0 - z, 3)) - 6*C_2*pow(h_x, 2)*h_xx*(4*pow(
h0, 3)*h_x - 4*h_x*pow(
h0 - z, 3)) - 3*C_2*pow(h_x, 2)*h_xxx*(pow(
h0, 4) - pow(
h0 - z, 4)) - 6*C_2*h_x*pow(h_xx, 2)*(pow(
h0, 4) - pow(
h0 - z, 4));
143 double u_xz = -12*C_2*pow(h_x, 4)*pow(
h0 - z, 2) - 12*C_2*pow(h_x, 2)*h_xx*pow(
h0 - z, 3);
144 double u_zz = 12*C_2*pow(h_x, 3)*pow(
h0 - z, 2);
146 2*B*u_x*(-2.0/3.0*u_x*u_xx - 1.0/6.0*u_xz*u_z)/pow(pow(u_x, 2) + (1.0/4.0)*pow(u_z, 2), 4.0/3.0) + 2*B*u_xx/cbrt(pow(u_x, 2) + (1.0/4.0)*pow(u_z, 2)) + (1.0/2.0)*B*u_z*(-2.0/3.0*u_x*u_xz - 1.0/6.0*u_z*u_zz)/pow(pow(u_x, 2) + (1.0/4.0)*pow(u_z, 2), 4.0/3.0) + (1.0/2.0)*B*u_zz/cbrt(pow(u_x, 2) + (1.0/4.0)*pow(u_z, 2)),
153 double C_1 = 1.0/R_0;
154 double C_2 = (1.0/2.0)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
155 double h0 = C_0*pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 3.0/7.0);
156 double h_x = -4.0/7.0*C_0*pow(C_1, 4.0/3.0)*cbrt(x)/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
157 double h_xx = (4.0/147.0)*C_0*pow(C_1, 4.0/3.0)*(16*pow(C_1, 4.0/3.0)*pow(x, 2.0/3.0)/(pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) - 1) - 7/pow(x, 2.0/3.0))/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
158 double u_x = -C_2*pow(h_x, 3)*(4*pow(
h0, 3)*h_x - 4*h_x*pow(
h0 - z, 3)) - 3*C_2*pow(h_x, 2)*h_xx*(pow(
h0, 4) - pow(
h0 - z, 4));
159 double u_z = -4*C_2*pow(h_x, 3)*pow(
h0 - z, 3);
161 2*pow(2, 2.0/3.0)*B*u_x/cbrt(4*pow(u_x, 2) + pow(u_z, 2)),
168 double C_1 = 1.0/R_0;
169 double C_2 = (1.0/2.0)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
170 double h0 = C_0*pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 3.0/7.0);
172 double h_x = -4.0/7.0*C_0*pow(C_1, 4.0/3.0)*cbrt(x)/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
173 double h_xx = (4.0/147.0)*C_0*pow(C_1, 4.0/3.0)*(16*pow(C_1, 4.0/3.0)*pow(x, 2.0/3.0)/(pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) - 1) - 7/pow(x, 2.0/3.0))/pow(-pow(C_1, 4.0/3.0)*pow(x, 4.0/3.0) + 1, 4.0/7.0);
174 double u_x = -C_2*pow(h_x, 3)*(4*pow(
h0, 3)*h_x - 4*h_x*pow(
h0 - z, 3)) - 3*C_2*pow(h_x, 2)*h_xx*(pow(
h0, 4) - pow(
h0 - z, 4));
176 -2*B*h_x*u_x/(sqrt(pow(h_x, 2) + 1)*cbrt(pow(u_x, 2))),
184 -4.0/7.0*pow(H_0, 2)*
g*rho_i*cbrt(x)/(pow(R_0, 8.0/7.0)*pow(pow(R_0, 4.0/3.0) - pow(x, 4.0/3.0), 1.0/7.0)),
190 double C = (1.0/8.0)*pow(alpha, 3)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
191 return pow(4*
C*x/Q_0 + pow(H_0, -4), -1.0/4.0);
195 double C = (1.0/8.0)*pow(alpha, 3)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
196 double thickness = pow(4*
C*x/Q_0 + pow(H_0, -4), -1.0/4.0);
204 double C = (1.0/8.0)*pow(alpha, 3)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
205 double thickness = pow(4*
C*x/Q_0 + pow(H_0, -4), -1.0/4.0);
207 2*B*cbrt(
C)*thickness,
213 double C = (1.0/8.0)*pow(alpha, 3)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
214 double thickness = pow(4*
C*x/Q_0 + pow(H_0, -4), -1.0/4.0);
216 2*B*pow(
C, 4.0/3.0)*alpha*pow(thickness, 6)/sqrt(pow(
C, 2)*pow(alpha, 2)*pow(thickness, 10) + pow(Q_0, 2)),
222 double C = (1.0/8.0)*pow(alpha, 3)*pow(
g, 3)*pow(rho_i, 3)/pow(B, 3);
223 double thickness = pow(4*
C*x/Q_0 + pow(H_0, -4), -1.0/4.0);
224 return 2*B*pow(
C, 4.0/3.0)*pow(thickness, 7)*(alpha - 1)/(Q_0*sqrt(pow(
C, 2)*pow(thickness, 10)*pow(alpha - 1, 2) + pow(Q_0, 2)));
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
double blatter_xz_vanderveen_beta(double x, double alpha, double H_0, double Q_0, double rho_i, double g, double B)
Vector2d blatter_xy_source(double x, double y, double B)
Vector2d blatter_xz_cfbc_source(double x, double z, double L, double rho_i, double rho_w, double g)
double blatter_xz_vanderveen_thickness(double x, double alpha, double H_0, double Q_0, double rho_i, double g, double B)
Vector2d blatter_xz_cfbc_base(double x, double L, double rho_i, double rho_w, double g)
Vector2d blatter_xz_vanderveen_source_lateral(double x, double alpha, double H_0, double Q_0, double rho_i, double g, double B)
Vector2d blatter_xz_source_surface(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_vanderveen_source_surface(double x, double alpha, double H_0, double Q_0, double rho_i, double g, double B)
Vector2d blatter_xz_halfar_source_lateral(double x, double z, double H_0, double R_0, double rho_i, double g, double B)
Vector2d blatter_xz_halfar_source(double x, double z, double H_0, double R_0, double rho_i, double g, double B)
Vector2d blatter_xz_vanderveen_exact(double x, double alpha, double H_0, double Q_0, double rho_i, double g, double B)
Vector2d blatter_xz_halfar_exact(double x, double z, double H_0, double R_0, double rho_i, double g, double B)
Vector2d blatter_xz_halfar_source_surface(double x, double H_0, double R_0, double rho_i, double g, double B)
Vector2d blatter_xz_cfbc_exact(double x, double z, double B, double L, double rho_i, double rho_w, double g)
Vector2d blatter_xz_source(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_exact(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_source_bed(double x, double z, double A, double rho, double g, double s_0, double alpha, double H, double beta)
Vector2d blatter_xz_halfar_source_base(double x, double H_0, double R_0, double rho_i, double g, double B)
Vector2d blatter_xy_exact(double x, double y)
Vector2d blatter_xz_cfbc_surface(double x, double L, double rho_i, double rho_w, double g)