Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the standard results for drivers #40

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading