[lammps-users] Which global variable stores box boundaries?

Hi Lammps users and developers,

I am trying to use python to call lammps. The box boundaries (xlo,xhi,ylo,yhi…) and atoms’ coordinates will be changed by python and be put back to lammps.
I have figured out the coordinates in library.cpp, but cannot find where to put the box information. I am thinking it could be somewhere in lmp->input-> .

Can anyone help me? Thank you in advance.

The domain class stores all the box info. But if
you just arbitrarily change the box dimensions, there
are lots of other related things you would have to do.
If you don't LAMMPS will be confused and probably crash.


Hi Steve,

I want to minimize the box of a solid state system according to virial stress by steepest descent or quickman. So if I update the box and atoms’ coordinates, is it the same as giving LAMMPS a new geometry configuration without anything else changing in the input file?

Thank you.

Seems some functions are only called at initialization. Probably I need to restart LAMMPS every time updating the box.

Have you tried fix box/relax? It will work with various min_styles,
though not quickmin.
But it does work with sd and cg.

If you're wanting to drive this externally, changing the box between minimizes,
its do-able, but you will need to call other initialization routines that depend
on the box, and insure that you don't lose atoms, esp in parallel. I would look
at other fixes that change the box size/shape and see what they do, like
fix box/relax or fix deform or fix npt.