Skip to content

Commit

Permalink
ensure vib calculations for gas phase species do not specify indices
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Feb 15, 2024
1 parent 59c0e6a commit 9852eb1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pynta/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,13 @@ def setup_adsorbates(self,initial_guess_finished=False):
constraints = ["freeze up to {}".format(self.freeze_ind)]
else:
constraints = ["freeze up to "+str(self.nslab)]
vib_constraints = ["freeze up to "+str(self.nslab)]
else: #gas phase
big_slab_ads = structure
target_site_num = None #no slab so can't run site analysis
software_kwargs = deepcopy(self.software_kwargs_gas)
constraints = []
vib_constraints = []
if len(big_slab_ads) == 1 and self.software == "Espresso": #monoatomic species
software_kwargs["command"] = software_kwargs["command"].replace("< PREFIX.pwi > PREFIX.pwo","-ndiag 1 < PREFIX.pwi > PREFIX.pwo")
try:
Expand Down Expand Up @@ -361,7 +363,7 @@ def setup_adsorbates(self,initial_guess_finished=False):
optfws2.append(fwopt2)

vib_obj_dict = {"software": self.software, "label": adsname, "software_kwargs": software_kwargs,
"constraints": ["freeze up to "+str(self.nslab)]}
"constraints": vib_constraints}

cfw = collect_firework(xyzs,True,["vibrations_firework"],[vib_obj_dict],["vib.json"],[],parents=optfws2,label=adsname)
self.adsorbate_fw_dict[adsname] = optfws2
Expand Down Expand Up @@ -393,6 +395,7 @@ def setup_adsorbates(self,initial_guess_finished=False):
if target_site_num == 0:
software_kwargs = deepcopy(self.software_kwargs_gas)
constraints = []
vib_constraints = []
if len(mol.atoms) == 1 and self.software == "Espresso": #monoatomic species
software_kwargs["command"] = software_kwargs["command"].replace("< PREFIX.pwi > PREFIX.pwo","-ndiag 1 < PREFIX.pwi > PREFIX.pwo")
else:
Expand All @@ -401,6 +404,7 @@ def setup_adsorbates(self,initial_guess_finished=False):
constraints = ["freeze up to {}".format(self.freeze_ind)]
else:
constraints = ["freeze up to "+str(self.nslab)]
vib_constraints = ["freeze up to "+str(self.nslab)]
xyz = os.path.join(prefix_path,str(prefix)+".xyz")
init_path = os.path.join(prefix_path,prefix+"_init.xyz")
assert os.path.exists(init_path), init_path
Expand All @@ -420,7 +424,7 @@ def setup_adsorbates(self,initial_guess_finished=False):
optfws2.append(fwopt2)

vib_obj_dict = {"software": self.software, "label": ad, "software_kwargs": software_kwargs,
"constraints": ["freeze up to "+str(self.nslab)]}
"constraints": vib_constraints}

cfw = collect_firework(xyzs,True,["vibrations_firework"],[vib_obj_dict],["vib.json"],[True,False],parents=optfws2,label=ad,allow_fizzled_parents=False)
self.adsorbate_fw_dict[ad] = optfws2
Expand Down

0 comments on commit 9852eb1

Please sign in to comment.