Skip to content

Commit

Permalink
Allow 1 atom functionalizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgt16-LANL committed Sep 25, 2024
1 parent 290632b commit 7e7b375
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions architector/io_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1833,8 +1833,12 @@ def functionalize_3D(self,
self.ase_atoms.set_positions(mol_coords)

# rotate functional group to +z
r = Rot.align_vectors(np.array([[0.,0.,1.]]*len(funct_coords)), funct_coords)#.reshape(1,-1))
funct_coords = r[0].apply(funct_coords) + np.array((0.,0.,2.)) # Move to 2
if len(funct_coords) > 1:
r = Rot.align_vectors(np.array([[0.,0.,1.]]*len(funct_coords)), funct_coords)#.reshape(1,-1))
funct_coords = r[0].apply(funct_coords) + np.array((0.,0.,2.)) # Move to 2
else:
funct_coords = np.array((0.,0.,2.)).reshape(1, -1) # Move to 2


funct_mol.ase_atoms.set_positions(funct_coords)

Expand Down Expand Up @@ -1945,8 +1949,11 @@ def functionalize_3D(self,
self.ase_atoms.set_positions(mol_coords)

# rotate functional group to +z
r = Rot.align_vectors(np.array([[0.,0.,1.]]*len(funct_coords)), funct_coords)
funct_coords = r[0].apply(funct_coords) + np.array((0.,0.,2.)) # Move to 2
if len(funct_coords) > 1:
r = Rot.align_vectors(np.array([[0.,0.,1.]]*len(funct_coords)), funct_coords)#.reshape(1,-1))
funct_coords = r[0].apply(funct_coords) + np.array((0.,0.,2.)) # Move to 2
else:
funct_coords = np.array((0.,0.,2.)).reshape(1,-1) # Move to 2

funct_mol.ase_atoms.set_positions(funct_coords)

Expand Down

0 comments on commit 7e7b375

Please sign in to comment.