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

use pyiron-internal is_skewed #63

Merged
merged 5 commits into from
Feb 5, 2021
Merged

use pyiron-internal is_skewed #63

merged 5 commits into from
Feb 5, 2021

Conversation

samwaseda
Copy link
Member

Certain fixes in LAMMPS do not work with fix orthogonal etc., which used to work before (essentially before this commit). As I didn't really see how to check whether LAMMPS sees triclinic or orthogonal from pyiron, I decided to implement it inside pyiron. Hopefully this one is acceptable...

@jan-janssen
Copy link
Member

But is this the same? For example in the case when we do a monte carlo simulation in combination with minimising each step. Then all cells in pyiron are orthogonal while the cells inside LAMMPS are not.

@jan-janssen
Copy link
Member

Certain fixes in LAMMPS do not work with fix orthogonal etc.,

Can you provide some examples what does not work?

@samwaseda
Copy link
Member Author

samwaseda commented Feb 3, 2021

But is this the same? For example in the case when we do a monte carlo simulation in combination with minimising each step. Then all cells in pyiron are orthogonal while the cells inside LAMMPS are not.

That's not true. If the pyiron cell is orthogonal, then we use change_box all ortho, in which case it's not allowed to become triclinic. I don't see a problem with changing this, but it's unrelated to this PR.

@jan-janssen
Copy link
Member

You are right, still I would be interested what fails. As I thought orthogonal boxes are the default for most cases.

@samwaseda
Copy link
Member Author

You are right, still I would be interested what fails. As I thought orthogonal boxes are the default for most cases.

It's actually the callback function. If you are really really interested I can try to think of an easy example, but that's gonna probably still be somewhat cumbersome (both to create one and to read it)...

@samwaseda
Copy link
Member Author

But actually it's maybe anyway time to think about making simple examples for callback functions, so I'm gonna make one anyway.

@samwaseda samwaseda requested review from jan-janssen, liamhuber and pmrv and removed request for jan-janssen February 3, 2021 15:47
@@ -1948,6 +1948,25 @@ def get_voronoi_volume(self):
return self._analyse.pyscal_voronoi_volume()
get_voronoi_volume.__doc__ = Analyse.pyscal_voronoi_volume.__doc__

def is_skewed(self, tolerance=1.0e-8):
Copy link
Contributor

Choose a reason for hiding this comment

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

This should work, but isn't it more straightforward to check the dot product between cell vectors? Your reasoning is documented though, so I don't mind too much.

Copy link
Member Author

Choose a reason for hiding this comment

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

Uh that's a good point. I don't have a strong opinion about it. The only one thing is that I want to insist on making tolerance a dimensionless value, in which case the computational cost is probably very much the same. If other people prefer dot product I can also change it.

@coveralls
Copy link

coveralls commented Feb 4, 2021

Pull Request Test Coverage Report for Build 536671936

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 64.762%

Totals Coverage Status
Change from base Build 533925843: 0.05%
Covered Lines: 10597
Relevant Lines: 16363

💛 - Coveralls

@samwaseda
Copy link
Member Author

I found out that actually it was not the callback function that causes the problem, but apparently pressure=0 is not compatible with the old implementation. So the following lines failed:

job = pr.create_job('Lammps', 'md')
job.structure = pr.create_ase_bulk('Al', cubic=True)
job.calc_md(temperature=300, pressure=0)
job.interactive_open()
job.run()
job.run()
job.interactive_close()

And with this PR this problem was fixed.

With this, I guess it's clear to everyone that this PR is indispensable.

@samwaseda
Copy link
Member Author

And since I promised @jan-janssen , here's a super simple notebook for callback:

callback.ipynb.txt

Copy link
Member

@jan-janssen jan-janssen left a comment

Choose a reason for hiding this comment

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

Looks good to me

@samwaseda samwaseda merged commit a7e5458 into master Feb 5, 2021
@samwaseda samwaseda deleted the lammps_skewed branch February 5, 2021 08:26
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.

4 participants