Skip to content

Commit

Permalink
Added the standard results for drivers
Browse files Browse the repository at this point in the history
* Added the standard results -- energy, gradients, and model -- that can be written
  to Results.json for drivers like Structure Step and Thermochemistry Step.
  • Loading branch information
paulsaxe committed Oct 20, 2024
1 parent 18227b2 commit 0d84a6c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions dftbplus_step/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
19 changes: 18 additions & 1 deletion dftbplus_step/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -164,7 +181,7 @@
"type": "float",
},
"forces": {
"calculation": ["optimization"],
"calculation": ["energy", "optimization"],
"description": "The forces on the atoms",
"dimensionality": [3, "natoms"],
"type": "float",
Expand Down

0 comments on commit 0d84a6c

Please sign in to comment.