Dear Lammps users,
I’m having trouble preventing fix deform from resetting to the original box length when doing multiple runs.
I want to deform the box at rate which is constant within a run, but different between runs. Since the fix needs both box deformation length and velocity, I calculate the deformation length within a run from the velocity and the size of the box at the beginning of each run.
I first have the commands:
variable mylen equal lx # Get length of box in x direction
variable mylenstart equal ${mylen} # Record starting length (constant)
variable boxpos equal v_l0+(v_currenttime-v_t0)*v_boxvel #t0 is the time at the beginning of each run
fix boxstretch all deform 1 x variable v_boxpos v_boxvel units box remap none
and then I run with
run 100 start 0 stop 300 post no
variable l0 equal {mylen}-{mylenstart} # Length of the box at the end of the run
run 100 start 0 stop 300 pre no post no
variable l0 equal {mylen}-{mylenstart}
run 100 start 0 stop 300 pre no
but “mylen” gets reset to the original box length at the beginning of every run. I’ve tried this with the “every” command too (which would be more useful) with the same result. According to the manual page it should be possible to deform constantly over multiple runs, so I wonder what I’m missing?
Any advice is greatly appreciated.
Thank you.
James