Skip to content

Commit

Permalink
Merge pull request #230 from TheoChem-VU/190-spin-polarized-adf-calcu…
Browse files Browse the repository at this point in the history
…lations-should-not-use-a-dftb-initial-hessian

Check job pre-run function
  • Loading branch information
YHordijk authored May 9, 2024
2 parents 8a4bb8f + b7b1edc commit 411856a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tcutility/job/adf.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ def symmetry(self, group: str):
'''
self.settings.input.adf.Symmetry = group

def _check_job(self):
# if we have spinpolarization we do not want to use DFTB to calculate the initial hessian
if self.settings.input.adf.SpinPolarization != 0 and self.settings.input.ams.GeometryOptimization.InitialHessian.Type == 'CalculateWithFastEngine':
# we simply remove it from the geometryoptimization block
self.settings.input.ams.GeometryOptimization.pop('InitialHessian', None)


class ADFFragmentJob(ADFJob):
def __init__(self, *args, **kwargs):
Expand Down
7 changes: 7 additions & 0 deletions src/tcutility/job/ams.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ def _setup_job(self):
if not self._molecule:
self.settings.input.ams.system.GeometryFile = self._molecule_path

# sometimes we have to check if a job is able to run or requires some special consideration
# those types of checks should be defined in _check_job
self._check_job()

# we will use plams to write the input and runscript
sett = self.settings.as_plams_settings()
job = plams.AMSJob(name=self.name, molecule=self._molecule, settings=sett)
Expand All @@ -207,6 +211,9 @@ def _setup_job(self):

return True

def _check_job(self):
...

@property
def output_mol_path(self):
'''
Expand Down

0 comments on commit 411856a

Please sign in to comment.