示例#1
0
文件: main.py 项目: fangohr/nmag-src
def plot_scalar_field(
    field,
    dof_name,
    filename,
    plot_order=1,
    plot_edges=True,
    scaling=[-6.0, 7.0, 40.0, 40.0],
    color_scheme=[(-2.0, [0.2, 0.2, 1.0]), (0.0, [0.8, 0.8, 0.8]), (2.0, [1.0, 0.2, 0.2])],
):
    ocaml.plot_scalar_field(field, dof_name, filename, color_scheme, plot_order, plot_edges, scaling)
    return None
示例#2
0
def plot_scalar_field(field,
                      dof_name,
                      filename,
                      plot_order=1,
                      plot_edges=True,
                      scaling=[-6.0, 7.0, 40.0, 40.0],
                      color_scheme=[(-2.0, [0.2, 0.2, 1.0]),
                                    (0.0, [0.8, 0.8, 0.8]),
                                    (2.0, [1.0, 0.2, 0.2])]):
    ocaml.plot_scalar_field(field, dof_name, filename, color_scheme,
                            plot_order, plot_edges, scaling)
    return None
示例#3
0
                           [the_field_sigma, field_J], [])
    return the_field_sigma


update_sigma(field_sigma)

ocaml.plot_scalar_field(
    last_field_phi[0],
    "phi",
    "/tmp/mesh-phi-initial.ps",
    # Simple color scheme:
    # [(-1.2,[0.0,0.0,0.0]),(1.2,[1.0,1.0,1.0])],
    # More elaborate color scheme - the trick is to include surface lines...
    [
        (-0.5, [0.1, 0.1, 0.4]),
        (-0.333333, [0.2, 1.0, 0.2]),
        (-0.166666, [0.1, 0.1, 0.4]),
        (0.0, [0.2, 1.0, 0.2]),
        (0.166666, [0.1, 0.1, 0.4]),
        (0.333333, [0.2, 1.0, 0.2]),
        (0.5, [0.1, 0.1, 0.4]),
    ],
    2,  # plot order
    1,  # plot edges?
    [-6.0, 7.0, 40.0, 40.0])

#                        [(-0.6,[0.1,0.1,0.4]),
#                         (-0.5,[0.2,1.0,0.2]),
#                         (-0.4,[0.1,0.1,0.4]),
#                         (-0.3,[0.2,1.0,0.2]),
#                         (-0.2,[0.1,0.1,0.4]),
示例#4
0
    recompute_conductivity([h_x, h_y, sigma0, alpha], [the_field_sigma, field_J], [])
    return the_field_sigma


update_sigma(field_sigma)

ocaml.plot_scalar_field(
    last_field_phi[0],
    "phi",
    "/tmp/mesh-phi-initial.ps",
    # Simple color scheme:
    # [(-1.2,[0.0,0.0,0.0]),(1.2,[1.0,1.0,1.0])],
    # More elaborate color scheme - the trick is to include surface lines...
    [
        (-0.5, [0.1, 0.1, 0.4]),
        (-0.333333, [0.2, 1.0, 0.2]),
        (-0.166666, [0.1, 0.1, 0.4]),
        (0.0, [0.2, 1.0, 0.2]),
        (0.166666, [0.1, 0.1, 0.4]),
        (0.333333, [0.2, 1.0, 0.2]),
        (0.5, [0.1, 0.1, 0.4]),
    ],
    2,  # plot order
    1,  # plot edges?
    [-6.0, 7.0, 40.0, 40.0],
)


#                        [(-0.6,[0.1,0.1,0.4]),
#                         (-0.5,[0.2,1.0,0.2]),
#                         (-0.4,[0.1,0.1,0.4]),
#                         (-0.3,[0.2,1.0,0.2]),