def view_osz(self): path = '.' if self.value.value == 'EV curve': path = glob.glob('voldep/volume_*')[0] print(path) Bash.execute("emacs {0}/OSZICAR".format(path))
def conv2poscar(cif_file, out_path): """ A cif file convert to POSCAR """ cif_file = os.path.normpath(cif_file) cmd = 'cif2cell -p vasp -f {0} -o {1}/POSCAR --no-reduce \ --vasp-print-species --vasp-cartesian-lattice-vectors \ --vasp-format=5'.format(cif_file, out_path) Bash.execute(cmd)
def execute(self): if self.value == 'EV curve': Bash.execute("batch_run.sh 100") else: Bash.execute("qsub run.sh") top = tk.Toplevel() f = tk.Frame(top) f.pack() label = tk.Label(f, text="{0} calculation started !".format(self.value)) label.pack() btn = tk.Button(f, text="OK", command=top.destroy) btn.pack()
def relax(path, num, vaspcmd): """ judgeの結果がTrueの場合終了 それ以外はOSZICAR, OUTCARを保管してVASPを再実行 """ for i in range(0, num): judge = judge_oszicar(path) if judge: break else: shutil.copyfile('OUTCAR', "out.relax.{0}".format(i)) shutil.copyfile('OSZICAR', "osz.relax.{0}".format(i)) shutil.copyfile('CONTCAR', 'POSCAR') print("Start re-calculation.") Bash.execute(vaspcmd)
def set_single(self): Bash.execute("vaspy prep_all") Bash.execute("sed -e 's/ISPIN = 2/ISPIN = 1/g' INCAR_static > INCAR") Bash.execute("sed -i 's/LCHARG = .FALSE./LCHAG = .TRUE./g' INCAR") shutil.copyfile('KPOINTS_relax', 'KPOINTS') shutil.copyfile('Calc/run_std.sh', 'run.sh') self.value = "single" self.label.configure(text=self.getText())
def set_EV(self, vrange): # Bash.execute("rm -r voldep") Bash.execute("vaspy prep_all") Bash.execute("rm list_run") Bash.execute( "vasp_voldep.py range_percent --range_list {0[0]} {0[1]} {0[2]}".format(vrange)) shutil.copyfile('Calc/run_voldep_enshu.sh', 'run_voldep.sh') self.value = "EV curve" self.label.configure(text=self.getText()) top = tk.Toplevel() f = tk.Frame(top) f.pack() label = tk.Label(f, text="Series of calculations were prepared !") label.pack() btn = tk.Button(f, text="OK", command=top.destroy) btn.pack()
def plot_voldep(self): # Bash.execute("calc_murnaghan.py get --fig") Bash.execute('calc_murnaghan.py get --fig --show --wo_mag')
def draw_band(self): Bash.execute("vasp_plot.py band_nonmag --save")
def view_bz(self): Bash.execute("vasp_kpoints.py view_bz")
def set_band(self): Bash.execute("vaspy prep_all") Bash.execute("sed -e 's/ISPIN = 2/ISPIN = 1/g' INCAR_dos > INCAR") self.value = "band" shutil.copyfile('Calc/run_band_enshu.sh', 'run.sh') self.label.configure(text=self.getText())
def edit_incar(self): Bash.execute("emacs INCAR")
def vesta(self): Bash.execute("VESTA POSCAR")
def edit_poscar(self): Bash.execute("emacs POSCAR")