fig_x, fig_y = JupyterPlots()

    prefix = 'data/'

    roundoff = 5e-6

    fp = int(sys.argv[1])

    fdump = prefix + f'dump_{fp}.lammpstrj'

    if os.path.isfile(fdump + '.pkl'):
        dumpdata = load_obj(fdump, pstatus=True)
    else:
        duf = DumpFile(fdump, voronoi_flag=False, cg_flag=False)
        dumpdata = duf.read_dump()
        save_obj(dumpdata, fdump, pstatus=True)

    fig, axarr = plt.subplots(6, sharex=True, figsize=[fig_x, fig_y * 6])
    N = len(dumpdata)
    ncount = N

    atom_num = 2
    fxs = np.empty([ncount], float)
    fys = np.empty([ncount], float)
    xs = np.empty([ncount], float)
    ys = np.empty([ncount], float)

    muxs = np.empty([ncount], float)
    muys = np.empty([ncount], float)

    for i, data in enumerate(dumpdata[:ncount + 1]):
示例#2
0
        else:

            Ds = np.empty([len(rhos)], float)
            Derrs = np.empty([len(rhos)], float)

            for j, rho in enumerate(rhos):

                flog = prefix + f'log_{fp}_{rho}.lammps.log'
                ll = LogLoader(flog, remove_chunk=0, merge_data=True)

                ts = ll.data['Step']
                MSD = ll.data['c_mymsdd[4]']

                Ds[j], Derrs[j], yint = thermo.compute_Deff(ts, MSD)

            save_obj([Ds, Derrs], pkl_name, pstatus=True)
            print(Ds, Derrs)

        print(thermo.ideal_Deff(fp))
        ax.errorbar(rhos,
                    Ds / thermo.ideal_Deff(fp),
                    yerr=Derrs / thermo.ideal_Deff(fp),
                    fmt='-o',
                    color=colors[i],
                    label=rf'$f^P={fp}$')

    ax.set_ylabel(r'$D_{\mathrm{eff}}$')
    ax.set_xlabel(r'$\rho$')
    ax.set_yscale('log')
    #ax.set_xscale('log')
    ax.legend()
            Ps = np.empty([len(rhos)], float)
            Perrs = np.empty([len(rhos)], float)

            for j, rho in enumerate(rhos):

                flog = prefix + f'log_{fp}_{rho}.lammps.log'
                ll = LogLoader(flog, remove_chunk=0, merge_data=True)

                ts = ll.data['Step']
                Press = ll.data['c_press']

                P_cuts = Press[ts > tcut]
                Ps[j] = np.mean(P_cuts)
                Perrs[j] = np.std(P_cuts) / np.sqrt(len(P_cuts))

            save_obj([Ps, Perrs], pkl_name, pstatus=True)

        ax.errorbar(rhos,
                    Ps,
                    yerr=Perrs,
                    fmt='-o',
                    color=colors[i],
                    label=rf'$f^P={fp}$')

    ax.set_ylabel(r'$P$')
    ax.set_xlabel(r'$\rho$')
    #ax.set_yscale('log')
    #ax.set_xscale('log')
    ax.legend()

    fig.subplots_adjust(left=0.25)
    rho = sys.argv[1]

    fps = np.array([0, 1, 5, 10, 20, 40, 60, 80, 100])

    load_prefix = 'raw_data/'

    save_prefix = 'pickled_data/'

    for fp in fps:

        fname = f'dump_{fp}_{rho}.lammpstrj'

        dfile = DumpFile(load_prefix + fname)

        data = dfile.read_dump(pstatus=True, min_step=1000000)
        save_obj(data, save_prefix + fname)

        ret_o = {}
        calculate_items(ret_o,
                        data,
                        min_neigh=4,
                        cutoff=1.5,
                        MAXnb=100,
                        nbins=2000,
                        nbinsq=50,
                        Pe=10,
                        rho_0=0.60)

        dc_name = save_prefix + f'ret_o_{fp}_{rho}'

        save_obj(ret_o, dc_name)