I have found a bug in lammps and was able to fix it. I did not know how
to submit the change so I post it here.
Bug description: The size of a region changes abnormally when change_box
is used with triclinic regions and shrink-wrapped boundary conditions.
For example, if the boundary conditions are 's p p', the length of the
region along the x direction will shrink to 1 after change_box is called.
Fix: as mentioned in a comment in domain.cpp, reset_box() can only be
applied if the atom coordinates are in lamda space. This was not the
case here. This was easy to fix. Here is the diff output for
< if (domain->nonperiodic == 2) domain->reset_box();