-
Notifications
You must be signed in to change notification settings - Fork 874
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
Fix lattice velocities formatting #3433
Conversation
pymatgen/io/vasp/inputs.py
Outdated
@@ -545,7 +547,8 @@ def get_str(self, direct: bool = True, vasp4_compatible: bool = False, significa | |||
lines.append("Lattice velocities and vectors") | |||
lines.append(" 1") | |||
for v in self.lattice_velocities: | |||
lines.append(" ".join(format_str.format(i) for i in v)) | |||
# vasp is strict about the format when reading this quantity | |||
lines.append(" ".join(f" {i: .7E}" for i in v)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If VASP is strict about this, could you add a test that checks for the right float precision?
Hi @janosh, I added a check on the format of the produced POSCAR. It should be noted that in this case it just checks that the format is equivalent to the one written from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gpetretto! 👍
Summary
This PR fixes a problem in #3428 that I encountered while performing some more tests with NpT MD simulations: in the case of lattice velocities VASP seems to be strict in the format when reading the POSCAR. After some tests it seems that this should be the best format to allow the correct parsing of this quantity in VASP.
Sorry for the error in the previous PR.