Ejemplo n.º 1
0
def print_code(header=False):
    if header:
        declare(name="blatter_xy_exact", args=["x", "y"])
        declare(name="blatter_xy_source", args=["x", "y", "B"])
        return

    u0, v0 = exact()
    f_u, f_v = source_term(eta(u0, v0, 3), u0, v0)

    def cleanup(expr):
        return expr.factor().collect([sin(2 * pi * y), cos(2 * pi * y)])

    define(u0, v0, name="blatter_xy_exact", args=["x", "y"])
    define(cleanup(f_u),
           cleanup(f_v),
           name="blatter_xy_source",
           args=["x", "y", "B"])
Ejemplo n.º 2
0
def print_code(header=False):
    constants = ["H_0", "R_0", "rho_i", "g", "B"]
    coords = ["x", "z"]

    if header:
        declare(name="blatter_xz_halfar_exact", args=coords + constants)
        declare(name="blatter_xz_halfar_source", args=coords + constants)
        declare(name="blatter_xz_halfar_source_lateral",
                args=coords + constants)
        declare(name="blatter_xz_halfar_source_surface",
                args=["x"] + constants)
        declare(name="blatter_xz_halfar_source_base", args=["x"] + constants)
        return

    print_exact(coords + constants)
    print_source(coords + constants)
    print_source_lateral(coords + constants)
    print_source_surface(["x"] + constants)
    print_source_base(["x"] + constants)
Ejemplo n.º 3
0
def print_code(header=False):
    args = ["x", "alpha", "H_0", "Q_0", "rho_i", "g", "B"]

    if header:
        declare(name="blatter_xz_vanderveen_thickness",
                args=args,
                return_type="double")
        declare(name="blatter_xz_vanderveen_exact", args=args)
        declare(name="blatter_xz_vanderveen_source_lateral", args=args)
        declare(name="blatter_xz_vanderveen_source_surface", args=args)
        declare(name="blatter_xz_vanderveen_beta",
                args=args,
                return_type="double")
        return

    print_thickness(args)
    print_exact(args)
    print_source_lateral(args)
    print_source_surface(args)
    print_basal_beta(args)
Ejemplo n.º 4
0
def print_code(header=False):
    "Print all the code needed by the XZ verification test"
    args = ["x", "z", "A", "rho", "g", "s_0", "alpha", "H", "beta"]

    if header:
        declare(name="blatter_xz_exact", args=args)
        declare(name="blatter_xz_source", args=args)
        declare(name="blatter_xz_source_bed", args=args)
        declare(name="blatter_xz_source_surface", args=args)
        return

    print_exact(args)
    print_source(args)
    print_source_bed(args)
    print_source_surface(args)
Ejemplo n.º 5
0
def print_code(header=False):
    args = ["x", "z", "B", "L", "rho_i", "rho_w", "g"]
    source_args = ["x", "z", "L", "rho_i", "rho_w", "g"]
    surface_args = ["x", "L", "rho_i", "rho_w", "g"]
    if header:
        declare(name="blatter_xz_cfbc_exact", args=args)
        declare(name="blatter_xz_cfbc_source", args=source_args)
        declare(name="blatter_xz_cfbc_surface", args=surface_args)
        declare(name="blatter_xz_cfbc_base", args=surface_args)
        return

    u0, v0 = exact()
    define(u0, v0, name="blatter_xz_cfbc_exact", args=args)

    f_u, f_v = source_term(eta(u0, v0, n), u0, v0)
    define(f_u, f_v, name="blatter_xz_cfbc_source", args=source_args)

    f_s = surface_bc()
    define(f_s, S(0), name="blatter_xz_cfbc_surface", args=surface_args)
    define(-f_s, S(0), name="blatter_xz_cfbc_base", args=surface_args)