fix ave/spatial error

For the “origin” parameter of the fix/ave spatial command I tried to use one of the components of a previous center of mass compute, by typing, c_center_of_mass_compute[1].

However, I get the error,

ERROR: Expected floating point parameter in input script or data file (…/fix_ave_spatial.cpp:78)

When I use the value 0.0 for the “origin” it works.

Is this a bug, or are output from computes not allowed to be used as the “origin” in fix ave/spatial?

This is also for runs on an older version of lammps, lammps/2013.07, which I have no control over.

I was trying to get the average x, and y coordinates of the atoms in groups from the center of mass of each respective group.

v/r,

dc.

10-2-cnt-radial_analysis_v2.lmp (4.01 KB)

For the "origin" parameter of the fix/ave spatial command I tried to use one
of the components of a previous center of mass compute, by typing,
c_center_of_mass_compute[1].

However, I get the error,

ERROR: Expected floating point parameter in input script or data file
(../fix_ave_spatial.cpp:78)

When I use the value 0.0 for the "origin" it works.

Is this a bug, or are output from computes not allowed to be used as the
"origin" in fix ave/spatial?

not as such. the arguments of origin have to be constant. you can try
defining a variable and then use immediate variable expansion via $
(not v_). the command will then see a number and it should work, if
the compute is still accessible and current.

axel.

For the “origin” parameter of the fix/ave spatial command I tried to use one of the components of a previous center of >mass compute, by typing, c_center_of_mass_compute[1].

You can’t use that syntax c_foo for substituting a compute’s
value in any command, unless the doc page for the command

explicitly says that it is allowed.

But you can do it like Axel says.

Steve