Skip to content

Commit

Permalink
Added pbc's as a instance attribute of Pynta. Fixed few places in cod…
Browse files Browse the repository at this point in the history
…e to make sure the pbc's match what the user sets as the input.
  • Loading branch information
tdprice-858 committed Mar 22, 2024
1 parent 7cd4d9c commit ec91f83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pynta/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def run_harmonically_forced_xtb_no_pbc(atoms,atom_bond_potentials,site_bond_pote

target = atoms.cell[0][:2] + atoms.cell[1][:2]

og_pbc = atoms.pbc # Need to apply original pbc's on atoms object (depends on QC software)

site_poss = []
site_inds = []
site_mols = []
Expand Down Expand Up @@ -302,7 +304,7 @@ def run_harmonically_forced_xtb_no_pbc(atoms,atom_bond_potentials,site_bond_pote

outadslab = slab + newad

outadslab.pbc = (True,True,False)
outadslab.pbc = og_pbc

return outadslab,Eharm,Fharm

Expand Down
6 changes: 3 additions & 3 deletions pynta/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self,path,rxns_file,surface_type,metal,label,launchpad_path=None,fw

if software.lower() == 'vasp':
self.pbc = (True,True,True)

if software_kwargs_gas:
self.software_kwargs_gas = software_kwargs_gas
else:
Expand Down Expand Up @@ -131,7 +131,7 @@ def generate_slab(self,skip_launch=False):
a = self.a
#construct slab with optimial lattice constant
slab = slab_type(self.metal,self.repeats,a,self.vacuum)
slab.pbc = (True, True, False)
slab.pbc = self.pbc
write(os.path.join(self.path,"slab_init.xyz"),slab)
self.slab_path = os.path.join(self.path,"slab.xyz")
if self.software != "XTB":
Expand Down Expand Up @@ -252,7 +252,7 @@ def generate_initial_adsorbate_guesses(self,skip_structs=False):
ads,mol_to_atoms_map = get_adsorbate(mol)
if len(surf_sites) == 0:
if not skip_structs:
ads.pbc = (True,True,False)
ads.pbc = self.pbc
ads.center(vacuum=10)
structures[sm] = [ads]
gratom_to_molecule_atom_maps[sm] = {val:key for key,val in mol_to_atoms_map.items()}
Expand Down

0 comments on commit ec91f83

Please sign in to comment.