compute displace/atom from new atom position

Hello All,

I've been trying to make this work for awhile. I'd like to compute
the displacement of atoms from a new position (after an "event" has
occured). In looking through the mail list, I found mention of people
using the following commands to do exactly this:

fix position all coord/original
compute disp all displace/atom position

It seems this functionality has been lost? Trying something similar with
fix position all store/state 0 xu yu zu
compute disp all displace/atom

while not throwing out any errors, seems to have no effect. In
particular, when the fix is reran later in the script, the compute
appears to use the original starting coordinates to calculate the
displacement, instead of the new positions that were (hopefully)
stored by the fix.

Any and all help is appreciated!


LAMMPS version: 1Feb14

There is no fix coord/original in current LAMMPS.

It would not have done what you are asking.

The compute displace/atom command does the following.
At the point in the input script when the command is issued,

it stores the current atom coords as “initial”. An any subsequent time

(e.g. during a run) when some other fix or output requests

the current displacement, that compute calculates it relative
to the initial coords.

I’m unclear how you are going to detect an “event”. Will
it happen in between short runs? If so, you can
do an uncompute and re-issue the same compute displace/atom
command and it will store the new current coords as “initial”.


Thanks. I am using short runs (~100 timesteps), inside a loop with a
conditional statement to "reset" the initial coordinates of the
displace compute.

I'll try the uncompute and re-compute the displacement trick. What I
have working currently is just a manual calculation of the
displacement inside lammps using a variable. Perhaps the
uncompute/re-compute method is faster.


You can also look at fix store/state which
can be invoked from your script whenever you
wish. You could use it once with N = 100,
if that is your fixed freq, and it will update
its stored coords. To do it randomly (say with
an infrequent event), you could use N = 0
and re-invoke the fix with the same ID and group.

Unlike computes, you then don’t need to unfix.

The new one will just replace the old one and
store the current coords. Either of these would
work with your variable which could reference that
fix and compute a displacement.