-
Notifications
You must be signed in to change notification settings - Fork 28
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
Addition of an atomic forces parser #144
Comments
No problem, I just fixed it. It was enough to delete the spaces in front of the first I believe the Cp2kToolsParser, that has been introduced recently (#133), might be able to do that. @dev-zero could you please confirm? In case it is not, a PR would be welcome (we can discuss the implementation details here). In case it is - I can just release a new version of the plugin. |
@yakutovicha yes, the https://github.com/cp2k/cp2k-output-tools used by the Cp2kToolsParser can parse forces as of v0.4.0. |
and what you get is this (following the somewhat verbose nested-dict approach): "forces": {
"atomic": {
"per_atom": [
{
"atom": 1,
"element": "Si",
"kind": 1,
"x": 0.0,
"y": 0.0,
"z": 0.0
},
{
"atom": 2,
"element": "Si",
"kind": 1,
"x": 0.0,
"y": 1e-08,
"z": 1e-08
},
{
"atom": 3,
"element": "Si",
"kind": 1,
"x": 1e-08,
"y": 1e-08,
"z": 0.0
},
{
"atom": 4,
"element": "Si",
"kind": 1,
"x": 1e-08,
"y": 0.0,
"z": 1e-08
},
{
"atom": 5,
"element": "Si",
"kind": 1,
"x": -1e-08,
"y": -1e-08,
"z": -1e-08
},
{
"atom": 6,
"element": "Si",
"kind": 1,
"x": -1e-08,
"y": -1e-08,
"z": -1e-08
},
{
"atom": 7,
"element": "Si",
"kind": 1,
"x": -1e-08,
"y": -1e-08,
"z": -1e-08
},
{
"atom": 8,
"element": "Si",
"kind": 1,
"x": -1e-08,
"y": -1e-08,
"z": -1e-08
}
],
"sum": {
"norm": 0.0,
"x": -0.0,
"y": -0.0,
"z": -0.0
},
"unit": "a.u."
}
}, |
Yeah, that works quite well! I guess with that output working it becomes more a matter of whether you all (@yakutovicha @dev-zero) deem it useful to have an ArrayData node to represent the atomic forces as an output of the CP2K calculation? I personally do, it's slightly more included within the aiida-cp2k package (in that it doesn't need the |
@sshepherd637 the cp2k-output-tools package is pulled in by aiida-cp2k already. Storing the retrieved data as an ArrayData node in addition to the nested dict is of course an option. |
@dev-zero |
I have been using this AiiDA plugin for a while as it's basically a necessity for the amount of similar calculations I run, to that end because I need the atomic forces of the calculation output and retrievable, I have created an additional parsing function to parse any atomic forces output by the calculation if the run type is 'ENERGY/FORCE'. It then saves those forces to an ArrayData node called
atomic_forces
.It's formatted quite simply, so if anyone can think of anything else required within the rough example I've given here (note the titles are not included within the actual array, but shown here to help explain):
and so on, etc etc...
The output units within the array are the units specified within the output file.
Just something I've been using for a bit now, and after cleaning it up slightly, think it might be useful to have here as a tracked array of the forces.
Edit: I can't quite seem the get the table formatting to work with markdown, but I'm sure you get the idea
The text was updated successfully, but these errors were encountered: