From 0d84a6c1d7cb293dadefc4ded56b573d5d50a54b Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Sun, 20 Oct 2024 17:46:58 -0400 Subject: [PATCH] Added the standard results for drivers * Added the standard results -- energy, gradients, and model -- that can be written to Results.json for drivers like Structure Step and Thermochemistry Step. --- HISTORY.rst | 4 ++++ dftbplus_step/base.py | 10 ++++++++++ dftbplus_step/metadata.py | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 94bf2ae..0b2a883 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,10 @@ ======= History ======= +2024.10.20 -- Added the standard results for drivers + * Added the standard results -- energy, gradients, and model -- that can be written + to Results.json for drivers like Structure Step and Thermochemistry Step. + 2024.7.30 -- Fix: the Docker build needed updating for changes in SEAMM 2024.7.29 -- Bugfix: initial version of dftbplus.ini diff --git a/dftbplus_step/base.py b/dftbplus_step/base.py index dfec092..7e9f35a 100644 --- a/dftbplus_step/base.py +++ b/dftbplus_step/base.py @@ -669,6 +669,16 @@ def parse_results(self, lines): except StopIteration: pass + # Create the standard properties needed for energy, gradients, etc. + property_data["energy"] = property_data["total_energy"] + property_data["energy,units"] = "e_H" + if "forces" in property_data: + property_data["gradients"] = [ + [-v for v in row] for row in property_data["forces"] + ] + property_data["gradients,units"] = "E_h/Å" + property_data["model"] = self.model + return property_data def run(self, current_input): diff --git a/dftbplus_step/metadata.py b/dftbplus_step/metadata.py index ea478b9..4d03b4d 100644 --- a/dftbplus_step/metadata.py +++ b/dftbplus_step/metadata.py @@ -7,6 +7,23 @@ """Properties that DFTB+ produces, depending on the type of calculation. """ metadata["results"] = { + "energy": { + "description": "electronic energy", + "dimensionality": "scalar", + "type": "float", + "units": "E_h", + }, + "gradients": { + "description": "gradients on the atoms", + "dimensionality": [3, "n_atoms"], + "type": "float", + "units": "E_h/Å", + }, + "model": { + "description": "The model string", + "dimensionality": "scalar", + "type": "string", + }, "total_energy": { "calculation": [ "energy", @@ -164,7 +181,7 @@ "type": "float", }, "forces": { - "calculation": ["optimization"], + "calculation": ["energy", "optimization"], "description": "The forces on the atoms", "dimensionality": [3, "natoms"], "type": "float",