Skip to content

Commit

Permalink
call get forces in run dft method
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpvandermause committed Oct 26, 2024
1 parent 9f275ca commit 64ad84a
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 64ad84a

Please sign in to comment.