change_box with triclinic box

Dear all,

I'm using change_box command with triclinic box. Everything is fine
when I expand the box but when I try to shrink I get an error that
'triclinic box skew is too large'. I know what this error means but
the thing is that my xy tilt does not exceed lx. I varied the tilt to
very small values but there is still this error. I don't understand
why it happens during shrinking. Could anyone help with that?

please, find files attached.

Thank you,
Manana

ffield.reax.Al (21.7 KB)

al_control (514 Bytes)

in.changebox (1002 Bytes)

Manana,

The problem is, your cell is hexagonal, putting it right on the
official limit for the xy tilt factor, so you are at the mercy of
machine round-off. LAMMPS is perfectly capable of handling boxes that
exceed this limit. It just becomes inefficient. Hence, for fix npt,
there is an extra padding amount #define DELTAFLIP 0.1 that allows the
tilt to exceed the official limit by a small amount. Attached is a
version of domain.cpp that does the same thing. Let me know how it
works.

Aidan

domain.cpp (45.9 KB)

Hello Aidan,

Yes, it worked perfectly. I thought about round-off issue. I noticed round-off problems in my other calculations, and cure I had found was to take say, 0.999999 instead of 1.0. I don’t know if it was the right solution but it worked, not in present case though. Puzzle for me is that I also tried to specify the xy tilt which was considerably smaller than lx/2. But I was still getting error and only in case of shrinking.

Anyway, new domain.cpp solved the problem.

Best wishes,
Manana