tdiffusion_nd.mac - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
 (HTM) git clone git://src.adamsgaard.dk/pism
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       tdiffusion_nd.mac (706B)
       ---
            1 /* pure diffusion, Neumann at the base and Dirichlet at the surface */
            2 T(t) := exp(-(lambda*alpha)^2*t);
            3 Z(z) := A*sin(lambda*(L - z)) + B*cos(lambda*(L - z));
            4 v(z,t) := T(t) * Z(z);
            5 
            6 phi(z) := U[L] + Q[0] * (z - L);
            7 u(z,t) := v(z,t) + phi(z);
            8 
            9 B : 0;
           10 lambda : %pi / (2 * L);
           11 
           12 /* Check that T satisfies its equation */
           13 eq_T : diff(T(t), t) + (lambda*alpha)^2 * T(t) = 0;
           14 
           15 /* Check that Z satisfies its equation */
           16 eq_Z : diff(Z(z), z, 2) + lambda^2 * Z(z) = 0;
           17 
           18 /* Check that u(x,t) satisfies the PDE */
           19 eq: diff(u(x,t),t) = alpha^2 * diff(u(x,t),x,2);
           20 lhs(eq) - rhs(eq), expand;
           21 
           22 /* Check that du/dx = Q[0] at x = 0 */
           23 ux_0 : subst([x = 0], diff(u(x,t), x));
           24 
           25 /* Check that u(L,t) = U[L] */
           26