if obsfwd.E()[0] > 1e299:
        print("bad calculation at Lambda = ", Lambda)

    for i, u in enumerate(strains):

        if i == 0:

            strain = None

        else:

            strain = str(u)

        psi = PsiData(scan=scan,
                      loadsuf=loadsuf,
                      savesuf=savesuf,
                      strain=strain)

        ax.plot(psi.r(),
                psi.psi(),
                '-',
                color=colors[i],
                label=rf"$\epsilon={u:.3}$")

    ax.set_xlabel(r"$r$")
    ax.set_ylabel(r"$\psi(r)$")
    ax.legend(frameon=False)
    fig.subplots_adjust(left=0.2, right=0.8, bottom=0.1, top=0.95, hspace=0.05)
    fig.savefig(obsfwd.observable_sname("psivsr-vsstrain", plot_format="pdf"))

    plt.show()
Ejemplo n.º 2
0
        scan['\\omega'] = omega
        scan['\\Lambda'] = Lambda

        for j, u in enumerate(strains_for[type]):

            if j == 0:

                strain = None

            else:

                strain = str(u)

            psi = PsiData(scan=scan,
                          loadsuf=loadsuf,
                          savesuf=savesuf,
                          strain=strain,
                          name=names_for[type])

            ax[j].plot(psi.r() / q * 1000,
                       psi.psi(),
                       '-',
                       color=colors[i],
                       label=rf"$\tilde{{\sigma}}=\num{{{stresses[j]:.2e}}}$")

    for i, stress in enumerate(stresses):

        ax[i].legend(frameon=False)
        ax[i].set_ylabel(r'$\psi(\tilde{r})$' + ' (' + r'$\si{\radian}$' + ')')
        if (i == 3):
            ax[i].set_xlabel(r'$\tilde{r}$' + ' (' + r'$\si{\nano\meter}$' +
Ejemplo n.º 3
0
loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]
savesuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega"]

markertypes = ['--', '-.']

for i, gamma in enumerate(gammas):

    scan = {}
    scan['\\gamma_s'] = gamma
    scan['k_{24}'] = k24
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    psistuff = PsiData(scan=scan,
                       loadsuf=loadsuf,
                       savesuf=savesuf,
                       name=f"psivsr",
                       sfile_format="pdf")

    rs = psistuff.r()
    psis = psistuff.psi()

    print(2 / (rs[-1] * rs[-1]) * simps(rs * psis, rs))

    ax1.plot(rs / rs[-1],
             psis,
             markertypes[i],
             label=rf'$\gamma={gamma}$',
             lw=2)

ax1.set_xlabel(r'$r/R$', fontsize=10)
Ejemplo n.º 4
0
scan['\\gamma_s'] = gamma
scan['k_{24}'] = k24
scan['\\Lambda'] = Lambda
scan['\\omega'] = omega

loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

for i, pre in enumerate(["", "frustrated"]):

    if pre == "":
        label = "linear"
    else:
        label = pre

    psistuff = PsiData(scan=scan,
                       loadsuf=loadsuf,
                       savesuf=loadsuf,
                       name=f"{pre}psivsr")

    rs = psistuff.r()
    psis = psistuff.psi()

    observablestuff = ObservableData(scan=scan,
                                     loadsuf=loadsuf,
                                     savesuf=loadsuf,
                                     name=f"{pre}observables")

    R = observablestuff.R()
    print(R)
    eta = observablestuff.eta()

    dband = 2 * np.pi / eta
Ejemplo n.º 5
0
        # read in file name info
        rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=savesuf)
        
        # create a class to do calculations with current parameters in scan.
        run = SingleRun(rp,scan_dir=scan_dir,executable=executable,strain=strain)

        # run C executable.
        run.run_exe()

        # move file written by C executable from temporary data path to true data path
        run.mv_file(f'observables')

        run.mv_file('psivsr',strain=strain)

        psistuff = PsiData(scan=scan,loadsuf=loadsuf,savesuf=savesuf,name=f"psivsr",
                           strain=strain)

        rs = psistuff.r()
        psis = psistuff.psi()

        psiav = simps(integrand(rs,psis),rs)

        run.remove_file(fname="psivsr",strain=strain)

        # load the final values of E, R, eta, delta, and surface twist.
        Ei,Ri,etai,deltai,surftwisti = run.get_all_observables('observables',str2float=True)

        if i == 0:

            # again, if the strain is zero, then I have just determined the equilibrium
            # inverse d band spacing, which I now need to set (and do so below).
    types = ['linear', 'frustrated']

    axins = {}

    axins['linear'] = fig.add_axes([0.25, 0.45, 0.1, 0.1], projection='polar')

    axins['frustrated'] = fig.add_axes([0.5, 0.37, 0.25, 0.25],
                                       projection='polar')

    for i, type in enumerate(types):

        psistuff = PsiData(scan=scan,
                           loadsuf=loadsuf,
                           savesuf=savesuf,
                           name=f"psivsr_{type}",
                           loadfilepath=loadfilepath,
                           datfile=datfile,
                           sfile_format="pdf")

        observablestuff = ObservableData(scan=scan,
                                         loadsuf=loadsuf,
                                         savesuf=loadsuf,
                                         name=f"observables_{type}",
                                         loadfilepath=loadfilepath,
                                         datfile=datfile)

        R = observablestuff.R()

        fibrilstrain = FibrilStrain(psistuff,
                                    observablestuff,