center of mass for dynamic group wanted

Hi all:
For some reason I need to calculate the center of mass for a dynamic group, can someone give me some suggestions how to implement it? Currently it is not work in the lammps version. Thanks.

Hi all:
For some reason I need to calculate the center of mass for a dynamic group,
can someone give me some suggestions how to implement it? Currently it is
not work in the lammps version. Thanks.

please take note of the following two things:

- posting from a yahoo e-mail address makes certain that a large
number of lammps-users subscribers will not see your e-mails, as they
will be automatically filed as spam for all people with gmail accounts
unless they set up a specific filter to no do that.

- posting e-mails about things that supposedly don't work, without
mentioning the exact version of LAMMPS and the platform it is run on
as well as without providing a simple input deck that easily
reproduces the alleged issue, will make it less likely that somebody
will track this down. if you want help, you have to make it easy and
little effort to validate your claims.

axel.

In what scenario does it not work?

If you have a variable that computes the COM of a group,

via one of the group functions, and you invoke that

variable on a specific timestep, I think it will just use

the definition of the group that is current at that timestep.

So if the group is dynamic, it will use the current set of

atoms in the group.

Steve

Thanks. It worked in this way. Previouly I tried to use “compute com” but it does not work. Thank you!

Compute com is nothing but a wrapper on the same group

commands that variables call, so I don’t know

why it would be any different.

Steve

steve,

i’ve been reminding this person repeatedly, that it is not very helpful to make vague statements about things in LAMMPS not working without providing any simple way to reproduce these observations. obviously, some people understand how to properly report problems and to help having issues resolved the right way (and for everybody else), and others don’t and only care about themselves…

pity,
axel.

Thanks Steve.
But the following code show that group variable give the correct com but the “compute dd com” just gives some weird wrong numbers. Maybe there is something wrong here…

compute 1 all pe/atom
compute 2 all reduce sum c_1
thermo_style custom step temp pe c_2
run 0
variable eatom atom “c_1 > -3.0”

group dd dynamic all var eatom

Thanks Steve.
But the following code show that group variable give the correct com but
the "compute dd com" just gives some weird wrong numbers. Maybe there is
something wrong here...

​it is *extremely* annoying, that you post such incomplete and vague
​pieces of input and thus making looking into these things a needlessly
tedious and laborious task. you are not making any friends here.

yes, there is indeed a problem with compute com. there are a few more
computes with similar issues. i have identified them and implemented a
solution.

axel.