def __init__(self,xaxis=None,scan_dir="",datfile="data/input.dat",scan={}, loadsuf=["K_{33}","k_{24}","\\Lambda", "\\omega","\\gamma_s"], savesuf=["K_{33}","k_{24}","\\Lambda", "\\omega","\\gamma_s"], name= "observables",loadfilepath="data", savefilepath="results"): ReadParams.__init__(self,datfile=datfile, scan=scan,loadsuf=loadsuf,savesuf=savesuf) self.xaxis = xaxis self.scan_dir = scan_dir self.name = name self.loadfilepath = loadfilepath self.savefilepath = savefilepath if os.path.isfile(self.observables_fname()): self.data = np.loadtxt(self.observables_fname()) self.file_exists = True else: if self.name != "dummy": print("could not find a file by the name of ", self.observables_fname()) self.file_exists = False return
def __init__( self, xaxis=None, scan_dir="", datfile="data/input.dat", scan={}, loadsuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], savesuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], name="Evst"): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.xaxis = xaxis self.scan_dir = scan_dir self.name = name if os.path.isfile(self.fname()): self.data = np.loadtxt(self.fname()) self.file_exists = True else: print("could not find a file by the name of ", self.fname()) self.file_exists = False return
def __init__(self, scan_dir="", datfile="data/input.dat", scan={}, loadsuf=[ "K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s" ], savesuf=[ "K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s" ], sfile_format=".pdf"): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.sfile_format = sfile_format self.scan_dir = scan_dir self.data = np.loadtxt(self.psivsr_fname()) return
def __init__(self,scan_dir="",scan={}, loadsuf=["K_{33}","k_{24}","\\Lambda", "\\omega","\\gamma_s"], savesuf=["K_{33}","k_{24}","\\Lambda", "\\omega","\\gamma_s"], sfile_format="pdf",obsname = "observables", datfile="data/input.dat",psiname = "psivsr", psiloadfilepath="data",obsloadfilepath="data", psisavefilepath="results",obssavefilepath="results"): ReadParams.__init__(self,datfile=datfile, scan=scan,loadsuf=loadsuf,savesuf=savesuf) self.obsdata = ObservableData(scan=scan,loadsuf=loadsuf,savesuf=savesuf, datfile=datfile,loadfilepath=obsloadfilepath, savefilepath=obssavefilepath, scan_dir=scan_dir,name=obsname) self.psidata = PsiData(scan=scan,loadsuf=loadsuf,savesuf=savesuf, datfile=datfile,loadfilepath=psiloadfilepath, savefilepath=obssavefilepath, scan_dir = scan_dir,name=psiname) self.scan_dir=scan_dir self.sfile_format=sfile_format self.i_R_c = self.find_R_c_index() return
def __init__( self, scan_dir="", datfile="data/input.dat", scan={}, loadsuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], savesuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], sfile_format=".pdf", loadfilepath="data", savefilepath="results", name="psivsr", strain=None): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.sfile_format = sfile_format self.scan_dir = scan_dir self.name = name self.strain = strain self.loadfilepath = loadfilepath self.savefilepath = savefilepath self.data = np.loadtxt(self.psivsr_fname()) return
def __init__(self, scan={}, datfile="data/input.dat", loadsuf=[ "R_avg0", "sigma_R0", "R_eq", "volFrac_0", "beta", "chi_0" ], savesuf=[ "R_avg0", "sigma_R0", "R_eq", "volFrac_0", "beta", "chi_0" ], name="chi_vs_t", loadfilepath="data", savefilepath="results"): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.name = name self.loadfilepath = loadfilepath self.savefilepath = savefilepath if os.path.isfile(self.file_name()): self.data = np.loadtxt(self.file_name()) self.overlap = False elif os.path.isfile(self.file_name(overlap=True)): self.data = np.loadtxt(self.file_name(overlap=True)) print(f"Found file {self.file_name()}, but drops are overlapping!") self.overlap = True else: self.data = None print(f"Could not find file {self.file_name()}") self.overlap = False return
def __init__( self, scan={}, tmp_path="../../../tmp_data/", scan_dir="", executable="../../../bin/full4var_onerun", strain=None, loadsuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], savesuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], datfile="data/input.dat", valgrind=False, valFLAG=None): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.tmp_path = tmp_path self.executable = executable self.scan_dir = scan_dir self.strain = strain self.valgrind = valgrind self.valFLAG = valFLAG return
def __init__(self, xaxis=None, scan_dir="", datfile="data/input.dat", scan={}, loadsuf=[ "K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s" ], savesuf=[ "K_{33}", "k_{24}", "\\Lambda", "d_0", "\\omega", "\\gamma_s" ]): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.xaxis = xaxis self.scan_dir = scan_dir self.data = np.loadtxt(self.observables_fname()) return
def __init__(self, tmp_path="../../../tmp_data/", scan={}, datfile="data/input.dat", loadsuf=[ "R_avg0", "sigma_R0", "R_eq", "volFrac_0", "beta", "chi_0" ], savesuf=[ "R_avg0", "sigma_R0", "R_eq", "volFrac_0", "beta", "chi_0" ], executable="../../../bin/3d-gaussian-ic"): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.tmp_path = tmp_path self.executable = executable
def __init__( self, tmp_path="../../../tmp_data/", datfile="data/input.dat", scan={}, loadsuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], savesuf=["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"], name="observables", loadfilepath="data", params=None, executable="../../../bin/double_well_scan"): ReadParams.__init__(self, datfile=datfile, scan=scan, loadsuf=loadsuf, savesuf=savesuf) self.tmp_path = tmp_path self.executable = executable return
def single_E_calc(gamma, scan, scan_dir, fwd_ic, bwd_ic): loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"] savesuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega"] scan['\\gamma_s'] = str(gamma) ic_dict = {} if scan_dir == "scanforward": ic_dict = fwd_ic elif scan_dir == "scanbackward": ic_dict = bwd_ic scan['Rguess'] = str(ic_dict['Rguess0']) scan['Rupper'] = str(ic_dict['Rupper0']) scan['Rlower'] = str(ic_dict['Rlower0']) scan['etaguess'] = str(ic_dict['etaguess0']) scan['etaupper'] = str(ic_dict['etaupper0']) scan['etalower'] = str(ic_dict['etalower0']) scan['deltaguess'] = str(ic_dict['deltaguess0']) scan['deltaupper'] = str(ic_dict['deltaupper0']) scan['deltalower'] = str(ic_dict['deltalower0']) # 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) # run C executable. run.run_exe() # 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) run.concatenate_observables(["\\gamma_s"]) return Ei, Ri, etai, deltai
def single_E_calc(gamma, scan, loadsuf, savesuf, scan_dir): scan['\\gamma_s'] = str(gamma) if scan_dir == "scanforward": Rguess0 = 0.044 Rlower0 = 0.04 Rupper0 = 0.05 etaguess0 = 6.29 etalower0 = 6.3 etaupper0 = 6.287 deltaguess0 = 0.74 deltalower0 = 0.72 deltaupper0 = 0.8 else: Rguess0 = 1.5 Rlower0 = 1.0 Rupper0 = 2.0 etaguess0 = 6.4 etalower0 = 6.38 etaupper0 = 6.42 deltaguess0 = 0.815 deltalower0 = 0.813 deltaupper0 = 0.816 scan['Rguess'] = str(Rguess0) scan['Rupper'] = str(Rupper0) scan['Rlower'] = str(Rlower0) scan['etaguess'] = str(etaguess0) scan['etaupper'] = str(etaupper0) scan['etalower'] = str(etalower0) scan['deltaguess'] = str(deltaguess0) scan['deltaupper'] = str(deltaupper0) scan['deltalower'] = str(deltalower0) # 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) # run C executable. run.run_exe() # 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) run.concatenate_observables(["\\gamma_s"]) return Ei, Ri
markers = ["o-","v-","^-","<-",">-"] for i,R_avg0 in enumerate(R_avg0s): scan['R_avg0'] = str(R_avg0) scan['chi_0'] = chi_0(R_avg0) for j,sigma in enumerate(sigmas): scan['sigma_R0'] = str(sigma) rp = ReadParams(scan=scan,datfile=datfile) ts = rp.list_of_t_vals() Ns = np.empty([len(ts)],float) for i_t,t in enumerate(ts): ld = LoadData(name=f"radius_{i_t}",scan=scan,savesuf=savesuf, loadfilepath=loadfilepath,datfile=datfile) Rs = ld.data[:,1] Ns[i_t] = Rs.size
scan = {} markers = ["o-", "v-", "^-", "<-", ">-"] for i, R_avg0 in enumerate(R_avg0s): scan['R_avg0'] = str(R_avg0) scan['chi_0'] = chi_0(R_avg0) for j, sigma in enumerate(sigmas): scan['sigma_R0'] = str(sigma) rp = ReadParams(scan=scan) ts = rp.list_of_t_vals() Ns = np.empty([len(ts)], float) for i_t, t in enumerate(ts): ld = LoadData(name=f"radius_{i_t}", scan=scan, savesuf=savesuf) Rs = ld.data[:, 1] Ns[i_t] = Rs.size axarr.flat[i].plot(ts, Ns,
scan['\\omega'] = '20.0' scan['k_{24}'] = k24 loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"] savesuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega"] scan_dir = "scantmp" i = len(gammas) - 1 while (i >= 0): gamma = gammas[i] scan['\\gamma_s'] = str(gamma) # read in file name info rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf, datfile=datfile) # create a class to do calculations with current parameters in scan. run = SingleRun(rp, scan_dir=scan_dir, tmp_path=tmp_path) # run C executable. run.run_exe() # 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)
def single_E_calc(gamma,scan,loadsuf,savesuf,scan_dir): scan['\\gamma_s'] = str(gamma) k240 = 0.33 k24 = float(scan['k_{24}']) t = (k24-k240)/k240 if scan_dir == "scanforward": #Rguess0 = 0.045 #Rupper0 = 0.6 #Rlower0 = 0.4 Rguess0 = lower_Rguess(t) Rupper0 = Rguess0*1.1 Rlower0 = Rguess0*0.9 etaguess0 = 6.295 etalower0 = 6.29 etaupper0 = 6.3 deltaguess0 = 0.8 deltalower0 = 0.799 deltaupper0 = 0.805 else: #Rguess0 = 0.7 #Rupper0 = 0.9 #Rlower0 = 0.6 Rguess0 = upper_Rguess(t) Rupper0 = Rguess0*1.1 Rlower0 = Rguess0*0.9 etaguess0 = 6.34 etalower0 = 6.32 etaupper0 = 6.36 deltaguess0 = 0.813 deltalower0 = 0.808 deltaupper0 = 0.816 scan['Rguess'] = str(Rguess0) scan['Rupper'] = str(Rupper0) scan['Rlower'] = str(Rlower0) scan['etaguess'] = str(etaguess0) scan['etaupper'] = str(etaupper0) scan['etalower'] = str(etalower0) scan['deltaguess'] = str(deltaguess0) scan['deltaupper'] = str(deltaupper0) scan['deltalower'] = str(deltalower0) # 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) # run C executable. run.run_exe() # 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) run.concatenate_observables(["\\gamma_s"]) return Ei,Ri
colors = sns.color_palette() savesuf = ["K_{33}","k_{24}","d_0","\\gamma_s"] loadsuf = ["K_{33}","k_{24}","d_0","\\omega","\\gamma_s"] omegas = np.linspace(0,30,num=31,endpoint=True) for i,omega in enumerate(omegas): scan['\\omega']=str(omega) rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=savesuf) obs = PlotObservables(["\\Lambda"],rp) print(omega) for j,observable in enumerate(observable_list): index = obs.ylabelstr_to_column(observable) array_store[observable][i,:] = obs.data[:,index] xlabel = r'$3\Lambda=\omega$' for observable in observable_list:
configure_fig_settings() colors = sns.color_palette() colors = [colors[1], colors[2]] scan = {} scan['\\Lambda'] = str(Lambda) scan['\\omega'] = str(omega) scan['K_{33}'] = str(K33) loadsuf = ["K_{33}", "\\Lambda", "\\omega"] savesuf = ["K_{33}", "\\Lambda", "\\omega"] rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf) suff = rp.write_suffix() fw_coexist = np.loadtxt(f"results/_fwd_coexist_{suff}.txt") bw_coexist = np.loadtxt(f"results/_bkwd_coexist_{suff}.txt") gammas = fw_coexist[:, 0] observables_list = ["k24", "E", "R", "eta", "delta", "psi(R)"] for i, observable in enumerate(observables_list): fig = plt.figure() fig.set_size_inches(width, height)