Skip to content

Commit

Permalink
Merge pull request #423 from mir-group/jon/fix-run-dft
Browse files Browse the repository at this point in the history
call get forces in run dft method
  • Loading branch information
jonpvandermause authored Oct 26, 2024
2 parents cb26d90 + 64ad84a commit 94a5f55
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions flare/learners/otf.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,32 +585,7 @@ def run_dft(self):
# avoid duplicating a previous DFT calculation
self.dft_calc.reset()
self.atoms.calc = self.dft_calc

# Calculate DFT energy, forces, and stress.
# Note that ASE and QE stresses differ by a minus sign.
if "forces" in self.dft_calc.implemented_properties:
if "forces" in self.atoms.calc.results:
forces = self.atoms.get_forces()
else:
forces = None
else:
forces = None

if "stress" in self.dft_calc.implemented_properties:
if "stress" in self.atoms.calc.results:
stress = self.atoms.get_stress()
else:
stress = None
else:
stress = None

if "energy" in self.dft_calc.implemented_properties:
if "energy" in self.atoms.calc.results:
energy = self.atoms.get_potential_energy()
else:
energy = None
else:
energy = None
self.atoms.get_forces()

# write wall time of DFT calculation
self.dft_count += 1
Expand Down

0 comments on commit 94a5f55

Please sign in to comment.