Skip to content

CP2K forces parser in new 2025 format#538

Merged
atztogo merged 1 commit intophonopy:developfrom
ladyteam:develop
Apr 13, 2025
Merged

CP2K forces parser in new 2025 format#538
atztogo merged 1 commit intophonopy:developfrom
ladyteam:develop

Conversation

@ladyteam
Copy link
Contributor

Check of CP2K force files version is based on header and footer strings 'FORCES| Atomic forces', 'FORCES| Total atomic force'. If both persist we consider the calculations were made using CP2K 2025 version and above.
The forces are parsed using 'FORCES| Atom x' magic word passed to iter_collect_forces() function.
The function parse_set_of_forces now check the version and call parse_set_of_forces2025 or parse_set_of_forces2024 depending is the forces are in new or old format. More strings in code but looks safer in case developers of CP2K decide to change force file format again in 2026.

@atztogo atztogo merged commit 90e74b6 into phonopy:develop Apr 13, 2025
1 of 6 checks passed
@atztogo
Copy link
Member

atztogo commented Apr 13, 2025

The test failure doesn't come from this PR.

Thanks @ladyteam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants