Skip to content

Commit

Permalink
Merge pull request #144 from TheoChem-VU/114-add-support-for-pesscan-…
Browse files Browse the repository at this point in the history
…calculations-in-ams

114 add support for pesscan calculations in ams
  • Loading branch information
YHordijk authored Feb 29, 2024
2 parents d4e1208 + c892ff6 commit d6097fc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/tcutility/job/ams.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,44 @@ def IRC(self, direction: str = 'both', hess_file: str = None, step_size: float =
self.add_postscript(tcutility.job.postscripts.clean_workdir)
self.add_postscript(tcutility.job.postscripts.write_converged_geoms)

def PESScan(self, distances: list = None, angles: list = None, dihedrals: list = None, sumdists: list = None, difdists: list = None, npoints: int = 10):
'''
Set the task of the job to potential energy surface scan (PESScan).
Args:
distances: sequence of tuples or lists containing ``[atom_index1, atom_index2, start, end]``.
Atom indices start at 1. Distances are given in |angstrom|.
angles: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, start, end]``.
Atom indices start at 1. Angles are given in degrees
dihedrals: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, atom_index4, start, end]``.
Atom indices start at 1. Angles are given in degrees
sumdists: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, atom_index4, start, end]``.
Atom indices start at 1. Sum of distances is given in |angstrom|.
difdists: sequence of tuples or lists containing ``[atom_index1, atom_index2, atom_index3, atom_index4, start, end]``.
Atom indices start at 1. Difference of distances is given in |angstrom|.
npoints: the number of PES points to optimize.
.. note::
Currently we only support generating settings for 1-dimensional PESScans.
We will add support for N-dimensional PESScans later.
'''
self._task = 'PESScan'
self.settings.input.ams.task = 'PESScan'
self.settings.input.ams.PESScan.ScanCoordinate.nPoints = npoints
if distances is not None:
self.settings.input.ams.PESScan.ScanCoordinate.Distance = [" ".join([str(x) for x in dist]) for dist in distances]
if angles is not None:
self.settings.input.ams.PESScan.ScanCoordinate.Angle = [" ".join([str(x) for x in ang]) for ang in angles]
if dihedrals is not None:
self.settings.input.ams.PESScan.ScanCoordinate.Dihedral = [" ".join([str(x) for x in dihedral]) for dihedral in dihedrals]
if sumdists is not None:
self.settings.input.ams.PESScan.ScanCoordinate.SumDist = [" ".join([str(x) for x in dist]) for dist in sumdists]
if difdists is not None:
self.settings.input.ams.PESScan.ScanCoordinate.DifDist = [" ".join([str(x) for x in dist]) for dist in difdists]

self.add_postscript(tcutility.job.postscripts.clean_workdir)
self.add_postscript(tcutility.job.postscripts.write_converged_geoms)

def vibrations(self, enable: bool = True, NegativeFrequenciesTolerance: float = -5):
'''
Set the calculation of vibrational modes.
Expand Down

0 comments on commit d6097fc

Please sign in to comment.