def print_thickness(args): "Print the code computing the ice thickness" print_header("blatter_xz_vanderveen_thickness", args, return_type="double") print_var(C0(), C) print_footer(H_exact)
def print_exact(args): print_header("blatter_xz_vanderveen_exact", args) h0 = sp.var("thickness") print_var(C0(), C) print_var(H_exact, h0) print_footer(u_exact.subs(H, h0), v_exact)
def print_basal_beta(args): "Print the code computing basal sliding coefficient" beta = basal_beta() print_header("blatter_xz_vanderveen_beta", args, return_type="double") h0 = sp.var("thickness") print_var(C0(), C) print_var(H_exact, h0) print_footer(beta.subs(H, h0))
def print_source_surface(args): "Print the code computing the extra term at the top surface" f_top, _ = surface_bc() print_header("blatter_xz_vanderveen_source_surface", args) h0 = sp.var("thickness") print_var(C0(), C) print_var(H_exact, h0) print_footer(f_top.subs(H, h0), 0.0)
def print_source_lateral(args): "Print the code computing the extra term at the right boundary" f_lat, _ = source_lateral() print_header("blatter_xz_vanderveen_source_lateral", args) h0 = sp.var("thickness") print_var(C0(), C) print_var(H_exact, h0) print_footer(f_lat.subs(H, h0), 0.0)
def print_exact(args): u0, v0 = u_exact() u0 = u0.subs(subs) print_header("blatter_xz_halfar_exact", args) for key, value in constants().items(): print_var(value, key) print_var(H(x), h0) print_var(H(x).diff(x), h_x) print_footer(u0, v0)
def print_source(args): f, _ = source_term(eta(u, v, 3), u, v) f = f.subs(subs) u0, _ = u_exact() U_x = u0.diff(x) U_z = u0.diff(z) print_header("blatter_xz_halfar_source", args) for key, value in constants().items(): print_var(value, key) print_var(H(x), h0) print_var(H(x).diff(x), h_x) print_var(H(x).diff(x, 2), h_xx) print_var(H(x).diff(x, 3), h_xxx) print_var(U_x.subs(subs), u_x) print_var(U_z.subs(subs), u_z) print_var(U_x.diff(x).subs(subs), u_xx) print_var(U_x.diff(z).subs(subs), u_xz) print_var(U_z.diff(z).subs(subs), u_zz) print_footer(f, 0.0)
def print_source_lateral(args): "Print the code computing the extra term at the right boundary" f_lat, _ = lateral_bc(u, v) f_lat = f_lat.subs(subs).factor() u0, _ = u_exact() U_x = u0.diff(x).subs(subs) U_z = u0.diff(z).subs(subs) print_header("blatter_xz_halfar_source_lateral", args) for key, value in constants().items(): print_var(value, key) print_var(H(x), h0) print_var(H(x).diff(x), h_x) print_var(H(x).diff(x, 2), h_xx) print_var(U_x, u_x) print_var(U_z, u_z) print_footer(f_lat, 0.0)
def print_source_surface(args): "Print the code computing the extra term at the top surface" f_top = surface_bc(u, v, h) # take advantage of the fact that u_z = 0 at z = h f_top = f_top.subs(subs).subs(u_z, 0) u0, _ = u_exact() U_x = u0.diff(x).subs(subs) print_header("blatter_xz_halfar_source_surface", args) for key, value in constants().items(): print_var(value, key) print_var(H(x), h0) print_var(h0, z) print_var(H(x).diff(x), h_x) print_var(H(x).diff(x, 2), h_xx) print_var(U_x, u_x) print_footer(f_top, 0.0)