Exemplo n.º 1
0
        # move file written by C executable from temporary data path to true data path
        run.mv_file('observables')

        # 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 (Ei > 0.1 * FAILED_E):

            # if the energy calculation fails, this will be true.
            print('hi')
            # remove current file with observables for the current Lambda value that are higher than
            # the delta = 0 energy.
            print(Ei)
            run.remove_file("observables")

            for j, Lambda in enumerate(Lambdas[i:]):

                # write the remaining values of observables as those corresponding to the delta = 0
                # case, as non-zero d-band produces a higher energy fibril.
                scan['\\Lambda'] = str(Lambda)
                rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)
                run = SingleRun(rp, scan_dir=scan_dir)
                run.write_observables(E0, R0, eta0, delta0, surftwist0,
                                      "\\Lambda")

            break

        if np.isnan(Ri) or Ri <= 0:
Exemplo n.º 2
0
        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).

            eta_eq = etai
            R_eq = Ri

        run.concatenate_observables(None, externalparam=[u, psiav])