atom-based entity fail to update through library interface

Dear friends,

I am trying to use library interface to update atom-based entities like coordinate and types. However, I am unable to do so. I am using 16Feb16 version.

Based on the COUPLE example in the lammps package, first I assign values to an array named xarray of length natoms, then

lammps_scatter_atoms(lmp, “x”, 1, 3, xarray)

then I immediately call

lammps_gather_atoms(lmp, “x”, 1, 3, xarray)

and check the values of xarray. The xarray values are not the values I initially assigned.

Can anyone help me with this? Thanks,

Too little info. Why don’t you debug by having LAMMPS

dump the atom coords after you scatter.

You can also find example Python scripts in python/examples

that use the scatter lib function.

Steve