How to move a group of atoms as expected with gradient?

Hi there,
I want to move a group of atoms (not all atoms) in my model according to there initial position.
Specifically, let X be the initial x-coords of atoms in group A. I want to move the atoms to x=1/2*X^2 after, say, 5 loop steps. Following each loop step, the position of group A is held and the whole system is relaxed.

I try to use 'fix move variable ’ as follows:

  1. define the initial position X
    variable X atom $(x)
  2. define the volecty per loop step
    `variable V atom 1/2*v_X^2
  3. move group A through fix move
    fix mov A move NULL NULL NULL v_V NULL NULL

But encountered error at 1) like

ERROR: Atom vector in equal-style variable formula (src/variable.cpp:4645)
Last command: variable pap atom $(x)

I was wondering if my plane is feasible, and how to store the initial position of group A so that they won’t chanbe with time.

Any suggest would be appreciated.

Best,
HC6.

Try fix store/state command β€” LAMMPS documentation

1 Like

Thank so much for your reply. It helps a lot!