c = row["$c$"]
        fig7_spectra(
            paths_sim[short_name],
            fig,
            ax,
            Fr,
            c,
            t_start=tmin,
            run_nb=run_nb,
            n_colors=len(df),
        )


if __name__ == "__main__":
    sns.set_palette("cubehelix", 3)
    matplotlib_rc(11)
    path_fig = exit_if_figure_exists(__file__)
    set_figsize(7, 3)
    fig, ax = pl.subplots(1, 2, sharex=True, sharey=True)

    df_w = load_df("df_w")
    df_3840 = df_w[df_w["$n$"] == 3840]
    df_7680 = df_w[df_w["$n$"] == 7680]

    sns.set_palette("cubehelix", 5)
    plot_df(df_3840, fig, ax[0])
    sns.set_palette("cubehelix", 3)
    plot_df(df_7680, fig, ax[1])

    for ax1 in ax:
        ax1.set_ylim(1e-2, 1e2)
            fig,
            ax_b,
            tmin=tmin,
            run_nb=run_nb,
            key_var=("uy", "ux"),
            cache=test_mode,
            ax_inset=ax_inset,
            n_colors=len(df),
        )
        if test_mode:
            break
        # fig12_atm(fig, ax_b)


if __name__ == "__main__":
    matplotlib_rc(fontsize=fontsize)
    path_fig = exit_if_figure_exists(__file__)
    set_figsize(5, 4)
    fig, ax = pl.subplots(2, 2, sharey=False, sharex=False)

    df_w = load_df("df_w")
    df_3840 = df_w[df_w["$n$"] == 3840]
    df_7680 = df_w[df_w["$n$"] == 7680]

    ax_inset3 = None  # _ax_inset(fig, '$r/L_f$', 0.325, 0.362)
    ax_inset7 = None  # _ax_inset(fig, '$r:/L_f$', 0.775, 0.362)

    sns.set_palette("cubehelix", 5)
    plot_df(df_3840, fig, ax[:, 0], ax_inset3)
    sns.set_palette("cubehelix", 3)
    plot_df(df_7680, fig, ax[:, 1], ax_inset7)
Exemplo n.º 3
0
#!/usr/bin/env python
import os
import getpass
from pathlib import Path

import matplotlib.pyplot as plt

from fluidsim.util.console import profile as pf
from fluiddyn.util import modification_date

from base import matplotlib_rc, titles, curdir

save = True
force_make = False  # ; force_make = True
matplotlib_rc() if save else matplotlib_rc(dpi=150)
textprops = dict(fontsize=10, family="monospace")
figx = 5  # 9  # 20 / 2.54
figy = 2.1  # 2  # 6 / 2.54

root = Path("/tmp") / getpass.getuser() / "fluidsim-bench-results" / "profiles"
if not os.path.exists(str(root)):
    raise FileNotFoundError("Run sync.py")

patterns2d = [
    (root / "beskow_1024x1024/").glob("*np=1_*fftw2d*"),
    (root / "beskow_1024x1024/").glob("*np=8*fftwmpi2d*"),
]

patterns3d = [
    (root / "beskow_128x128x128/").glob("*np=1_*fftw3d*"),
    (root / "beskow_128x128x128/").glob("*np=8*fftwmpi3d*"),
import matplotlib.pyplot as plt
from base import matplotlib_rc
from paths import load_df, exit_if_figure_exists
from base_fig_energy import plot_energy

matplotlib_rc(fontsize=10)
path_fig = exit_if_figure_exists(__file__)
df_w = load_df("df_lap")
fig, ax = plt.subplots(1, 2, figsize=(6.5, 3))
plot_energy(df_w,
            fig,
            ax,
            N=[960, 1920, 2880, 3840, 7680],
            C=[10, 20, 40, 100, 200])
fig.tight_layout()
fig.savefig(path_fig)
fig.savefig(path_fig.replace(".png", ".pdf"))
Exemplo n.º 5
0
#!/usr/bin/env python

from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np

import bench_analysis as ba
from base import matplotlib_rc
from sync import path_fluidsim_bench_results

matplotlib_rc()
save = True
root = Path(path_fluidsim_bench_results) / 'benchmarks'
# pattern2d = root.glob('beskow_1024x1024')
pattern2d = sorted(root.glob('beskow_?0??x????'))
pattern3d = sorted(root.glob('beskow_*x*x*'))[::-1]


def increase_lims(ax, fac=2):
    fac = np.array([1 / fac, fac])
    xlim = np.array(ax.get_xlim()) * fac
    ylim = np.array(ax.get_ylim()) * fac
    ax.set_xlim(*xlim)
    ax.set_ylim(*ylim)


def plot_fig(pattern, solver, output_file=None, exclude=[]):
    fig, axes = plt.subplots(1, 2)
    ax0, ax1 = axes.ravel()
    markers = ("x", ".")
    for ipath, path_dir in enumerate(pattern):
            paths_sim[run],
            fig,
            ax,
            eps,
            Fr,
            tmin=tmin,
            run_nb=run_nb,
            n_colors=len(df),
            **kwargs,
        )
        if "test" in kwargs and kwargs["test"] and run_nb == 1:
            break


if __name__ == "__main__":
    matplotlib_rc(fontsize=9)

    path_fig = exit_if_figure_exists(__file__)
    fig, ax = plt.subplots(3, 2, figsize=(5, 6), sharex=True, sharey=False)
    # ax[0,0].set_title('$n=3840$')
    # ax[0,1].set_title('$n=7680$')
    for row in range(3):
        set_share_axes(ax[row, :], sharey=True)
    set_share_axes(ax, sharex=True)
    df_w = load_df("df_w")
    df_3840 = df_w[df_w["$n$"] == 3840]
    df_7680 = df_w[df_w["$n$"] == 7680]

    sns.set_palette("cubehelix", 5)
    plot_df(df_3840, fig, ax[:, 0])
    sns.set_palette("cubehelix", 3)