plot_MilleFEuiIle.py

plot_MilleFEuiIle.compute_streamlines(ax, v, points, vel_max, fig, font_size, i)

Computes (and plots) streamlines for the velocity field by performing forward and backward trajectory integration. Initial position of the points is prescribed as an equidistant distribution at y = 2 km.

# --- Starting points for streamlines computation ---
length = 200e3
num_points = 50
points = []
for i in range(1, num_points):
    if (i != int(num_points/2.0)):
        points.append([length/num_points*i, 2e3])

The parameter length represents the length of the domain and num_points is the number of the points along the line.

Tip

Custom initial position of the can be simply redefined.

plot_MilleFEuiIle.extract_cell_data(mesh, function, index)

Reads a scalar value in the center of a cell with given index.

plot_MilleFEuiIle.initialize(name, i)

Initializes dolfin function spaces.

plot_MilleFEuiIle.load(name, i, *args)

Loads the HDF5 data from "data_" + name + "/HDF5/data.h5"

plot_MilleFEuiIle.load_comp_tracers(ax, name, i, data)

Loads tracers and plots them based on their composition. See plot_comp_tracers in plot_demo*.py

The composition number, color and opacity are specified as follows

plot_comp_tracers = [[2, "orange", 0.25], [1, "lightskyblue", 0.25]]
plot_MilleFEuiIle.load_melt_tracers(ax, name, labels, fig, font_size, i)

Loads tracers and plots them based on their melt content. See plot_melt_tracers in plot_demo*.py Only tracers with nonzero amount of melt are plotted. Adds a separate colorbar for the melt content.

plot_MilleFEuiIle.mesh2triang(mesh)

Creates a triangulation object.

plot_MilleFEuiIle.plot_scalar(ax, fig, function, mesh, labels, x_range, z_range, font_size, type, plot_HDF5_data)

Plots a scalar function from the HDF5 file, a colorbar, and labels.

plot_MilleFEuiIle.plot_time(ax, directories, column, labelname, colors, styles)

Plots data with respect to time.

plot_MilleFEuiIle.plot_trajectory(ax, name, ID, sim_step, tail, tail_length)

Plots trajectories of individual tracers from "data_" + name + "/tracers/trajectories/. See plot_trajectories in plot_demo*.py

The tracers’ IDs and colors are then specified as follows:

plot_trajectories = [["a", "white"], ["b", "aqua"], ["c", "violet"], ["d", "yellow"], ["e", "lawngreen"]]

Attention

The tracers need to be defined already in m_parameters.py of the simulation.

plot_MilleFEuiIle.scalebar(axis, length, sbar_length, corner_offset, fs)

Plots a scale bar.