diff --git a/cp2kdata/output.py b/cp2kdata/output.py index 59b697b..4f91631 100644 --- a/cp2kdata/output.py +++ b/cp2kdata/output.py @@ -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}") diff --git a/docs/dpdata_plugin.md b/docs/dpdata_plugin.md index 62a6799..efa86a7 100644 --- a/docs/dpdata_plugin.md +++ b/docs/dpdata_plugin.md @@ -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: @@ -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. diff --git a/pyproject.toml b/pyproject.toml index 3cd666d..40fd416 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"} diff --git a/tests/test_dpdata/v2022.1/aimd/deepmd/set.000/virial.npy b/tests/test_dpdata/v2022.1/aimd/virial.npy similarity index 100% rename from tests/test_dpdata/v2022.1/aimd/deepmd/set.000/virial.npy rename to tests/test_dpdata/v2022.1/aimd/virial.npy diff --git a/tests/test_dpdata/v7.1/aimd_virial/deepmd/set.000/virial.npy b/tests/test_dpdata/v7.1/aimd_virial/virial.npy similarity index 100% rename from tests/test_dpdata/v7.1/aimd_virial/deepmd/set.000/virial.npy rename to tests/test_dpdata/v7.1/aimd_virial/virial.npy