# if the energy calculation fails, this will be true. print('hi') # remove current file with observables for the current gamma value that are higher than # the delta = 0 energy. print(Ei) run.remove_file("observables") for j, gamma in enumerate(gammas[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['\\gamma_s'] = str(gamma) rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf) run = SingleRun(rp, scan_dir=scan_dir) run.write_observables(E0, R0, eta0, delta0, surftwist0, "\\gamma_s") break if (np.isnan(Ri) or Ri <= 0) and gamma > 0.15: # if Ri is infinite, then the calculation failed. # Retry it with a different initial guess. print("Ri is NAN, trying again with Rguess = 1.0") # remove the current observables file, so that a new one can be written. run.remove_file("observables") if abs(float(scan['Rguess']) - 1.0) > 1e-10: Ri = 1.0 else:
# 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: # if Ri is infinite, then the calculation failed. # Retry it with a different initial guess. print("Ri is NAN, trying again with Rguess = 1.0") # remove the current observables file, so that a new one can be written. run.remove_file("observables") if abs(float(scan['Rguess']) - 1.0) > 1e-10: Ri = 1.0 else:
# 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(Ei, Ri, etai, deltai, surftwisti, "\\Lambda", modulus=modulusi) break if np.isnan(Ri) or Ri <= 0: # if Ri is infinite, then the calculation failed. # Retry it with a different initial guess. print("Ri is NAN, trying again with Rguess = 1.0") # remove the current observables file, so that a new one can be written. run.remove_file("observables")