Skip to content
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

VASP doesn't save stresses to HDF when run on ISIF=2 (default) #354

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

pmrv
Copy link
Contributor

@pmrv pmrv commented Sep 9, 2021

I'm running some VASP calculations and would like to have the full stress tensor after the (static) calculation. I've checked that my OUTCAR does contain the information. (Let me know if you need an example, github doesn't let me upload tar archives).

I've traced the code and it seems we do parse the stresses, but then only save the averaged pressure. I've modified that code in this PR to save also the stress to the log_dict, which I thought should be enough to get it into HDF5, but from my quick testing that doesn't seem to be the case.

Any ideas where to put this so it works?

@coveralls
Copy link

coveralls commented Sep 9, 2021

Pull Request Test Coverage Report for Build 1341110897

  • 2 of 3 (66.67%) changed or added relevant lines in 2 files are covered.
  • 451 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+1.5%) to 69.769%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_atomistics/vasp/base.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/atomistics/structure/strain.py 1 97.09%
pyiron_atomistics/init.py 1 98.0%
pyiron_atomistics/atomistics/job/structurecontainer.py 17 74.39%
pyiron_atomistics/atomistics/structure/factory.py 20 76.8%
pyiron_atomistics/atomistics/master/murnaghan.py 32 72.15%
pyiron_atomistics/sphinx/base.py 99 82.07%
pyiron_atomistics/lammps/interactive.py 137 35.44%
pyiron_atomistics/atomistics/structure/atoms.py 144 73.95%
Totals Coverage Status
Change from base Build 1212254905: 1.5%
Covered Lines: 11410
Relevant Lines: 16354

💛 - Coveralls

@@ -2017,6 +2017,7 @@ def collect(self, directory=os.getcwd(), sorted_indices=None):
raise VaspCollectError("Error in parsing OUTCAR")
log_dict["energy_tot"] = self.outcar.parse_dict["energies"]
log_dict["temperature"] = self.outcar.parse_dict["temperatures"]
log_dict["stresses"] = self.outcar.parse_dict["stresses"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is inside an elif statement, this segment of the code would work only when vasprun files are absent. You would need to put this in if statement block:

@pmrv
Copy link
Contributor Author

pmrv commented Sep 10, 2021

This works, but the pressures come out in units of kB. I'll have to check first how to convert.

@samwaseda
Copy link
Member

Just for me to understand: Is stress a per-atom quantity? Or is it simply meant to be pressure with the opposite sign?

@pmrv
Copy link
Contributor Author

pmrv commented Sep 10, 2021

Just for me to understand: Is stress a per-atom quantity? Or is it simply meant to be pressure with the opposite sign?

Here stress is the full tensor in voigt notation, what is saved as pressures is the average stress.

@samwaseda
Copy link
Member

Here stress is the full tensor in voigt notation, what is saved as pressures is the average stress.

OH! That's a suuuuuuuuuper questionable definition. At least it's not compatible with the LAMMPS definition at all. What's actually behind the idea of having the average pressure in the first place, instead of having nothing or the full tensor?

@pmrv
Copy link
Contributor Author

pmrv commented Sep 23, 2021

@sudarsan-surendralal Are you aware of anyone in our group that extensively uses VASP "pressures" via pyiron? I'd like the output of lammps and vasp to be consistent, which in this case would be saving the full 3x3 matrix under "pressures". For know I can leave the field in VASP untouched, but it'd be good to identify a time window after which we can make the breaking change "stress" -> "pressures".

@sudarsan-surendralal
Copy link
Member

@sudarsan-surendralal Are you aware of anyone in our group that extensively uses VASP "pressures" via pyiron? I'd like the output of lammps and vasp to be consistent, which in this case would be saving the full 3x3 matrix under "pressures". For know I can leave the field in VASP untouched, but it'd be good to identify a time window after which we can make the breaking change "stress" -> "pressures".

Sorry, I'm not aware if anyone uses pressures from VASP (maybe @jan-janssen). I'm not too familiar with the definitions of stress and pressure in the context of DFT simulations but I remember reading (from this book) that the definitions are not that straightforward at least wrt. LAMMPS. I have the feeling that this needs to be discussed in our developers meeting or even in a purely scientific meeting since there could be non-pyiron users who have a better idea.

@stale
Copy link

stale bot commented Oct 8, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 8, 2021
@stale stale bot removed the stale label Oct 14, 2021
@stale
Copy link

stale bot commented Oct 28, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 28, 2021
@pmrv pmrv removed the stale label Oct 29, 2021
@pmrv
Copy link
Contributor Author

pmrv commented Oct 29, 2021

I'll merge this today as-is and work around the inconsistent naming on my end for a while, but we should be this on the radar.

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.

None yet

4 participants