Skip to content

Commit f753552

Browse files
committed
小更新
修复能量提取不是最后一步的bug,增加POTCAR原子后缀功能(实际上使用需求较少)
1 parent 87ef605 commit f753552

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/VASPStuEnergyManager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def energy_extract(self,xvi_items):
5959

6060
for index, info in enumerate(data):
6161
info = info.strip()
62-
if info.startswith("energy without entropy"):
62+
if info.startswith("energy without entropy"):
6363
info_ = info
64-
energy = info_.split("energy without entropy =")[1].split("energy")[0]
64+
energy = info_.split("energy without entropy =")[1].split("energy")[0]
6565
xvi.energy = energy
6666
except:
6767
traceback.print_exc()

src/submit_job_onserver.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -541,15 +541,16 @@ def main_generate_POSCAR_and_output(self):
541541

542542
class CollectOtherRunFiles(object):
543543

544-
def __init__(self, other_run_file_dir, base_POTCAR_dir, output_info):
544+
def __init__(self, other_run_file_dir, base_POTCAR_dir, output_info,POTCAR_suffix):
545545

546546
self.other_file_dir = other_run_file_dir
547547
self.base_POTCAR_dir = base_POTCAR_dir
548548
self.output_info = output_info
549-
549+
self.POTCAR_suffix = POTCAR_suffix
550550
self.copy_all_other_run_files_aim_path()
551551
self.get_POTCAR()
552552

553+
553554
def copy_all_other_run_files_aim_path(self):
554555
all_base_files = []
555556
for i in os.listdir(self.other_file_dir):
@@ -569,7 +570,7 @@ def get_POTCAR(self):
569570
element_info = self.output_info[i]["atom_info"]
570571
POTCAR_paths = []
571572
for element in element_info:
572-
POTCAR_paths.append(self.base_POTCAR_dir + "/%s/POTCAR" % element)
573+
POTCAR_paths.append(self.base_POTCAR_dir + "/%s/POTCAR" % (element+self.POTCAR_suffix))
573574
aim_paths = " ".join(POTCAR_paths)
574575

575576
cmd_print_and_run("cat %s > %s" % (aim_paths, self.output_info[i]["aim_file_dir"] + "/POTCAR"))
@@ -618,7 +619,7 @@ def job_submit(self, path):
618619

619620

620621
def server_submit(xsd_files, base_xsd_dir, base_run_files,job_submit_command, base_POTCAR_dir, info_dir, TF_condition_func,project_type,
621-
base_fort188_path=None,debug_mode=True):
622+
base_fort188_path=None,debug_mode=True,POTCAR_suffix=""):
622623
a = XSD_Extract(xsd_files=xsd_files,
623624
base_xsd_dir=base_xsd_dir,
624625
base_POSCAR_dir=base_run_files,
@@ -633,7 +634,7 @@ def server_submit(xsd_files, base_xsd_dir, base_run_files,job_submit_command, ba
633634
output_info = a.main_generate_POSCAR_and_output()
634635

635636
a = CollectOtherRunFiles(other_run_file_dir=base_run_files, base_POTCAR_dir=base_POTCAR_dir,
636-
output_info=output_info)
637+
output_info=output_info,POTCAR_suffix=POTCAR_suffix)
637638

638639
b = JobSubmit(output_info=output_info, info_dir=info_dir,
639640
job_submit_command=job_submit_command,
@@ -661,7 +662,14 @@ def server_submit(xsd_files, base_xsd_dir, base_run_files,job_submit_command, ba
661662
base_run_files = info["remote_base_file_dir"]
662663
info_dir = base_xsd_dir
663664
job_submit_command = info["job_submit_command"]
664-
# 这里fort.188就在这个base file目录之下,只是判断是否需要transition state
665+
666+
try:
667+
POTCAR_suffix = info["POTCAR_suffix"]
668+
except KeyError:
669+
POTCAR_suffix = ""
670+
671+
672+
# 这里fort.188就在这个base file目录之下,只是判断是否需要transition state
665673
project_type = info["project_type"]
666674
print(info["project_type"])
667675
if info["project_type"] == "TS_fort_188":
@@ -685,6 +693,7 @@ def server_submit(xsd_files, base_xsd_dir, base_run_files,job_submit_command, ba
685693
base_fort188_path=base_fort188_path,
686694
debug_mode=debug_mode,
687695
project_type=project_type,
688-
job_submit_command =job_submit_command
696+
job_submit_command =job_submit_command,
697+
POTCAR_suffix = POTCAR_suffix
689698

690699
)

0 commit comments

Comments
 (0)