23 #include <gsl/gsl_math.h>
24 #include "pism/verification/tests/exactTestsABCD.h"
26 #define SperA 31556926.0
30 const double L = 750000.0;
31 const double M0 = 0.3 /
SperA;
32 const double g = 9.81;
33 const double rho = 910.0;
35 const double A = 1.0E-16/
SperA;
37 const double Gamma = 2 * pow(
rho *
g,
n) * A / (
n+2);
44 C = pow(pow(2.0,
n - 1) * M0 / Gamma, 1.0 / m);
45 *H =
C * pow(pow(
L, p) - pow(r, p),
n / m);
63 int exactB_old(
const double t,
const double r,
double *
H,
double *
M) {
65 double alpha, beta, t0, Rmargin;
66 const double n = 3.0,
H0 = 3600.0, R0=750000.0;
75 Rmargin=R0*pow(t/t0,beta);
77 *
H =
H0 * pow(t/t0,-alpha)
78 * pow(1.0-pow(pow(t/t0,-beta)*(r/R0), (
n+1)/
n),
n/(2*
n+1));
94 int exactC_old(
const double t,
const double r,
double *
H,
double *
M) {
95 double lambda, alpha, beta, t0, Rmargin;
96 const double n = 3.0,
H0 = 3600.0, R0=750000.0;
104 Rmargin=R0*pow(t/t0,beta);
106 *
H =
H0 * pow(t/t0,-alpha)
107 * pow(1.0-pow(pow(t/t0,-beta)*(r/R0), (
n+1)/
n),
n/(2*
n+1));
112 *
M = (lambda/t)* (*
H);
114 Rmargin=R0*pow(0.1*
SperA/t0,beta);
131 int exactD_old(
const double t,
const double rin,
double *
H,
double *
M) {
134 const double H0=3600.0;
135 const double L=750000.0;
137 const double Tp=5000.0*
SperA;
138 const double Cp=200.0;
142 const double rho=910.0;
144 const double A=1.0E-16/
SperA;
148 double Gamma, power, s, lamhat, f, Hs, temp,
C, Ms, df, ddf,
chi, dchi,
149 ddchi,
c1, dHs, ddHs, dH, ddH, divterms, Mc;
157 if (r < 0.01) r = 0.01;
160 Gamma = 2 * pow(
rho *
g,
n) * A / (
n+2);
165 lamhat = (1+1/
n)*s - (1/
n) + pow(1-s,1+1/
n) - pow(s,1+1/
n);
166 if ((r>0.3*
L) && (r<0.9*
L)) f = pow(cos(M_PI*(r-0.6*
L)/(0.6*
L)) ,2.0);
168 Hs = (
H0 / pow(1-1/
n,power)) * pow(lamhat,power);
169 *
H = Hs + Cp * sin(2.0*M_PI*t/Tp) * f;
172 temp = pow(s,1/
n) + pow(1-s,1/
n) - 1;
173 C = Gamma * pow(
H0,2*
n+2) / pow(2.0 *
L * (1-1/
n),
n);
174 Ms = (
C/r) * pow(temp,
n-1)
175 * (2*pow(s,1/
n) + pow(1-s,(1/
n)-1) * (1 - 2*s) - 1);
178 if ((r>0.3*
L) && (r<0.9*
L)) {
179 df = -(M_PI/(0.6*
L)) * sin(M_PI*(r-0.6*
L)/(0.3*
L));
180 ddf = -(M_PI*M_PI/(0.18*
L*
L)) * cos(M_PI*(r-0.6*
L)/(0.3*
L));
181 chi = (4.0/3.0)*s - 1.0/3.0 + pow(1-s,4.0/3.0) - pow(s,4.0/3.0);
182 dchi = -(4.0/(3.0*
L)) * (pow(s,1.0/3.0) + pow(1-s,1.0/3.0) - 1);
183 ddchi = -(4.0/(9.0*
L*
L)) * (pow(s,-2.0/3.0) - pow(1-s,-2.0/3.0));
184 c1 = (3.0*
H0) / (8.0*pow(2.0/3.0,3.0/8.0));
185 dHs =
c1 * pow(
chi,-5.0/8.0) * dchi;
186 ddHs =
c1 * ((-5.0/8.0) * pow(
chi,-13.0/8.0) * dchi * dchi
187 + pow(
chi,-5.0/8.0) * ddchi);
188 dH = dHs + Cp * sin(2.0*M_PI*t/Tp) * df;
189 ddH = ddHs + Cp * sin(2.0*M_PI*t/Tp) * ddf;
190 divterms = Gamma * pow(*
H,4.) * dH * dH
191 * ((1.0/r) * (*
H) * dH + 5.0 * dH * dH + 3.0 * (*H) * ddH);
192 Mc = (2.0*M_PI*Cp/Tp) * cos(2.0*M_PI*t/Tp) * f - Ms - divterms;
int exactD_old(const double t, const double rin, double *H, double *M)
int exactB_old(const double t, const double r, double *H, double *M)
struct TestABCDParameters exactB(const double t, const double r)
struct TestABCDParameters exactD(const double t, const double r)
int exactC_old(const double t, const double r, double *H, double *M)
int exactA_old(const double r, double *H, double *M)
struct TestABCDParameters exactA(double r)
struct TestABCDParameters exactC(const double t, const double r)
Germ chi(unsigned int k, const QuadPoint &pt)
Linear basis functions on the interval [-1, -1].