ICAMS/calphy

Add support for non-orthogonal simulation cells

Closed this issue · 5 comments

When running calphy with a non orthogonal lattice the structure will get artificial surfaces, because pyscals system.to_file() messes up the structure by writing an orthogonal box with wrong dimensions to the file. When looking at the structure with all atoms wrapped into the box an artifical surface is created.

Replicate:

import pyscal.core as pc
import ase.build

Zr = ase.build.bulk("Zr").repeat(15)
sys = pc.System()
sys.read_inputfile(Zr, format="ase")
sys.to_file("Test.dump")

Look at the resulting "Test.dump"

@Leimeroth This seems to me more a bug on pyscal side. I will raise an issue there (transfer does not seem to be possible).

On the calphy side, this is a know restriction atm. Even if pyscal does not have an issue with non-orthogonal boxes, calphy uses commands such as change_box assuming that the box is orthogonal. Therefore for it to be really correct, one needs to go through and fix all the underlying commands. I do not see any as such with it, but I do think it would be easier to convert the non-orthogonal box into an orthogonal one.

Is there a simple way to get orthogonal supercells from complicated structures?
Also I think it would be good to implement a simple check whether the input lattice is orthogonal when a structure is specified using a file, because right now calphy silently outputs wrong numbers for the free energy instead of failing

You can try this, but not super sure if everything would work as intended.

I also started a new issue #59

You can try this, but not super sure if everything would work as intended.

Works for simple models, but crashes due to memory issues when many repeats are necessary to find a structure

closed in #58