From ec91f833527336a0fec6df40c2ac1e3cecfb8ae1 Mon Sep 17 00:00:00 2001 From: tdprice-858 <> Date: Wed, 30 Aug 2023 18:46:02 -0700 Subject: [PATCH] Added pbc's as a instance attribute of Pynta. Fixed few places in code to make sure the pbc's match what the user sets as the input. --- pynta/calculator.py | 4 +++- pynta/main.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pynta/calculator.py b/pynta/calculator.py index 81d4e351..5f446325 100644 --- a/pynta/calculator.py +++ b/pynta/calculator.py @@ -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 = [] @@ -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 diff --git a/pynta/main.py b/pynta/main.py index 6adbb266..861d6145 100644 --- a/pynta/main.py +++ b/pynta/main.py @@ -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: @@ -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": @@ -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()}