[lammps-users] How can I calculate the RDF for the COMs of user-defined atom-groups?

Hello all,

My problem is about calculation of rdf for a group of center of mass of user-defined atom groups. i.e.
Each atom-group provides one COM, and I need the rdf of these COMs. This can be related to
more generalized cases, such as the rdf of dummy atoms associated with a group of atoms in some way.

To my knowledge about lammps, rdf fix allows to calculate rdf based on atom groups. But I can’t see
an easy way to use dummy atom with this fix. One possible solution is to put some particles/atoms into
the system and decouple them from the REAL particles and the thermostat. Then update the positions of these dummy
particles manually while the position of real atoms being changed. Finally apply fix rdf to these dummy
particles.

However, there are some things uncertain to me.

  1. Should I manually handle the PBC for these dummy particles? E.g. the real atoms associating with
    a dummy particle can be wrapped into another side of the simulation box when they flee away , should I have to
    ensure all dummy atoms also be wrapped into the simulation box by hand? Does this handled correctly by
    fix rdf when I use dummy particles?

  2. Is there a better way to achieve this without using ‘real’ dummy particles? E.g. I see we can easily obtain
    COM by the group function xcm(ID) of variable or com fix. How can I use these available variables with
    ‘fix rdf’ directly(without really putting particles into the system)? It will be very convenient and powerful if
    lammps supports using a group of variables as parameter for some ‘computes’ and ‘fixes’ in addition to group-ID.
    (something like ‘fix ID var-group-ID rdf…’) Or allows to define some variables in memory as a normal ‘atom-group’.
    This will save a lot of energy on designing and constructing some tricky model systems, since people can really
    ‘design’ a new model system on the fly based on some computed data.

I have to say I’m not quite familiar with lammps yet. So the questions or suggestion may be stupid. Please
leave me some advice or solution if you can. Thanks in advance!

link

link,

Please see my response below, interspersed among your questions as highlighted text.

My problem is about calculation of rdf for a group of center of mass of user-defined atom groups. i.e.
Each atom-group provides one COM, and I need the rdf of these COMs. This can be related to more generalized cases, such as the rdf of dummy atoms associated with a group of atoms in some way.

If I understand your question correctly, you are misunderstanding what fix rdf does with the group that the user specifies. Fix rdf cares nothing about the group’s COM. Rather, if an atom is not part of the group given, it is not included in the rdf calculation. If you really need an rdf based on a group’s COM, you’ll need to write your own fix or post-processing code to do so.

To my knowledge about lammps, rdf fix allows to calculate rdf based on atom groups. But I can’t see
an easy way to use dummy atom with this fix. One possible solution is to put some particles/atoms into
the system and decouple them from the REAL particles and the thermostat. Then update the positions of these dummy particles manually while the position of real atoms being changed. Finally apply fix rdf to these dummy particles.

It isn’t entirely clear to me what you mean by dummy particles. If you mean particles that have no interaction with the “real” particles and are not thermostatted with the real particles, LAMMPS can certainly do this. And LAMMPS would take care of the PBCs for the dummy particles too. And fix rdf could be set to gather rdf profiles between the real and dummy particles.

However, there are some things uncertain to me.

  1. Should I manually handle the PBC for these dummy particles? E.g. the real atoms associating with
    a dummy particle can be wrapped into another side of the simulation box when they flee away , should I have to ensure all dummy atoms also be wrapped into the simulation box by hand? Does this handled correctly by fix rdf when I use dummy particles?

I’d recommend not changing any source code if at all possible. I think that you can do what you’re wanting just fine, without any changes to the LAMMPS source code. Simply have LAMMPS track the dummy particles along with the real particles, but thermostat them separately and turn off all interactions between real and dummy particles. Perhaps you’ll also turn off interactions between dummy particles with other dummy particles.

You might want to look at the DPD and COLLOID packages (and others?), along with their documentation, that may do something similar to what you want.

  1. Is there a better way to achieve this without using ‘real’ dummy particles?

Probably. But it isn’t clear to me exactly what you’re trying to achieve. Check out the packages that I mentioned above. You might also consider doing what you want outside of LAMMPS as a post-process, with your own post-processing code.

E.g. I see we can easily obtain COM by the group function xcm(ID) of variable or com fix. How can I use these available variables with ‘fix rdf’ directly(without really putting particles into the system)? It will be very convenient and powerful if lammps supports using a group of variables as parameter for some ‘computes’ and ‘fixes’ in addition to group-ID. (something like ‘fix ID var-group-ID rdf…’) Or allows to define some variables in memory as a normal ‘atom-group’. This will save a lot of energy on designing and constructing some tricky model systems, since people can really ‘design’ a new model system on the fly based on some computed data.

LAMMPS does support the use of variables that can be fed into fix commands. Sounds like you’re requesting dynamic group definitions. Such a thing could potentially be done in a loop that included redefining the group and the rdf fix.

I have to say I’m not quite familiar with lammps yet. So the questions or suggestion may be stupid. Please leave me some advice or solution if you can. Thanks in advance!

LAMMPS’s user’s manual is really quite good, so that is a good place to start searching for answers. Good luck.

http://lammps.sandia.gov/doc/Manual.html

Paul