Пример #1
0
ticks = np.linspace(minv, maxv, 3)
ax.tick_params(**tick_options)
ax.text(0.05,
        0.95,
        'a',
        transform=ax.transAxes,
        fontsize=13,
        fontweight='bold',
        va='top')
c = ax.tricontourf(x, y, t, v, levels=levels, cmap=plt.get_cmap(cmap))
cbar = plt.colorbar(c, ticks=ticks, pad=0.05, orientation="horizontal")
cbar.ax.set_xlabel(r'${B^2}$ (Pa $m^{-1}$ yr)')

ax = fig.add_subplot(232)
ax.set_aspect('equal')
v = alpha_sigma.compute_vertex_values(mesh)
minv = np.min(v)
maxv = np.max(v)
levels = np.linspace(minv, maxv, numlev)
ticks = np.linspace(minv, maxv, 3)
ax.tick_params(**tick_options)
ax.text(0.05,
        0.95,
        'b',
        transform=ax.transAxes,
        fontsize=13,
        fontweight='bold',
        va='top')
c = ax.tricontourf(x, y, v, levels=levels, cmap=plt.get_cmap(cmap))
cbar = plt.colorbar(c,
                    ticks=ticks,
Пример #2
0
        vr_file = str(next((run_dir / 'output').glob("*vr.h5")))
        hdf5data = HDF5File(MPI.comm_world, vr_file, 'r')
        hdf5data.read(eigenfunc, f'v/vector_{k}')

        sind = j + 1 + i * 4
        ax = fig.add_subplot(2, 4, sind)
        ax.text(0.05,
                0.95,
                labels[sind - 1],
                transform=ax.transAxes,
                fontsize=13,
                fontweight='bold',
                va='top')

        ax.set_aspect('equal')
        v = np.abs(eigenfunc.compute_vertex_values(mesh))
        minv = np.min(v)
        maxv = np.max(v)
        levels = np.linspace(minv, maxv, numlev)
        ticks = np.linspace(minv, maxv, 3)
        ax.tick_params(**tick_options)

        c = ax.tricontourf(x,
                           y,
                           t,
                           v,
                           levels=levels,
                           cmap=plt.get_cmap(cmap_div))
        cbar = plt.colorbar(c, ticks=ticks, pad=0.05, orientation="vertical")

fig = plt.gcf()
Пример #3
0
    else:
        Qp = fice_mesh.get_periodic_space(params, mesh, dim=1)

    dQ = Function(Qp)

    x = mesh.coordinates()[:, 0]
    y = mesh.coordinates()[:, 1]
    t = mesh.cells()

    hdffile = str(next(outdir.glob("*dQ_ts.h5")))
    hdf5data = HDF5File(MPI.comm_world, hdffile, 'r')
    hdf5data.read(dQ, f'dQ/vector_{n_sens}')

    ax = fig.add_subplot(1, 2, i + 1)
    ax.set_aspect('equal')
    v = dQ.compute_vertex_values(mesh)
    minv = np.min(v)
    maxv = np.max(v)
    mmv = np.max([np.abs(minv), np.abs(maxv)])
    levels = np.linspace(-mmv, mmv, numlev)
    ticks = np.linspace(-mmv, mmv, 3)
    ax.tick_params(**tick_options)
    ax.text(0.05,
            0.95,
            'ab'[i],
            transform=ax.transAxes,
            fontsize=13,
            fontweight='bold',
            va='top')
    c = ax.tricontourf(x, y, t, v, levels=levels, cmap=plt.get_cmap(cmap_div))
    cbar = plt.colorbar(c,