Skip to content

Commit

Permalink
Merge pull request #40 from robinzyb/devel
Browse files Browse the repository at this point in the history
temporarily disable the parser for `-1.stress`
  • Loading branch information
robinzyb authored Feb 5, 2024
2 parents f9299f4 + beed863 commit ba5f7e4
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 2 deletions.
10 changes: 9 additions & 1 deletion cp2kdata/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,15 @@ def parse_md(self):
stress_file_list = glob.glob(
os.path.join(self.path_prefix, "*.stress"))
if stress_file_list:
self.stress_tensor_list = parse_md_stress(stress_file_list[0])
print(
f"cp2kdata found a stress file: {stress_file_list[0]}"
"But the parser for stress is not supported yet"
)
#TODO: the unit of stress is bar in -1.stress file, but not GPa in the output file
#TODO: however, covert bar to GPa is not consistent with the output file!
#TODO: check this latter
#self.stress_tensor_list = parse_md_stress(stress_file_list[0])
self.stress_tensor_list = None
else:
print(
f"Parsing Stress from the CP2K output/log file: {self.filename}")
Expand Down
65 changes: 65 additions & 0 deletions docs/dpdata_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ Currently, `CP2KData` supports two formats for use with `dpdata`:
print(dp)
```

Recommended Setups in the input of `ENERGY_FORCE` calculation.
```shell
&FORCE_EVAL
# if stress tensor is not need to computed, comment out the below line.
STRESS_TENSOR ANALYTICAL
&PRINT
&FORCES ON
&END FORCES
# if stress tensor is not need to computed, comment out the below line
&STRESS_TENSOR ON
# if stress tensor is not need to computed, comment out the below line
&END STRESS_TENSOR
&END PRINT
&END FORCE_EVAL
```

2. `cp2kdata/md` format for parsing `MD` outputs.

Example for parsing `MD` outputs:
Expand All @@ -27,5 +43,54 @@ Currently, `CP2KData` supports two formats for use with `dpdata`:
dp = dpdata.LabeledSystem(cp2kmd_dir, cp2k_output_name=cp2kmd_output_name, fmt="cp2kdata/md")
print(dp)
```
Recommended Setups in the input of `MD` calculation.

```shell
@SET frequency 100
&FORCE_EVAL
# if stress tensor is not need to computed, comment out the below line.
STRESS_TENSOR ANALYTICAL d
&PRINT
# if stress tensor is not need to computed, comment out the below line
&STRESS_TENSOR ON
# if stress tensor is not need to computed, comment out the below line
&EACH
# if stress tensor is not need to computed, comment out the below line
MD ${frequency}
# if stress tensor is not need to computed, comment out the below line
&END EACH
# if stress tensor is not need to computed, comment out the below line
&END STRESS_TENSOR
&END PRINT
&END FORCE_EVAL
&MOTION
&MD
&PRINT
&ENERGY
&EACH
MD ${frequency}
&END EACH
&END ENERGY
&END PRINT
&END MD
&PRINT
&CELL
&EACH
MD ${frequency}
&END EACH
&END CELL
&FORCES
&EACH
MD ${frequency}
&END EACH
&END FORCES
&TRAJECTORY
&EACH
MD ${frequency}
&END EACH
&END TRAJECTORY
&END PRINT
&END MOTION
```

These examples demonstrate how to use `Cp2kData` with `dpdata` to parse and work with data from CP2K simulations in the specified formats.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "Cp2kData"
version = "0.6.4"
version = "0.6.5"
description = "A Small Package to Postprocess Cp2k Output"
authors = [
{name = "Yongbin Zhuang", email = "robinzhuang@outlook.com"}
Expand Down
File renamed without changes.

0 comments on commit ba5f7e4

Please sign in to comment.