Average force due to portion of interaction

Hi all,

I’m trying to calculate the average force on an atom due to portion of its interaction with atoms along z-direction that are at a distance of ‘h’ and beyond, i.e. the interaction due to (rc - h) interactions in z-direction. What I can think of now, is to define two groups:

  1. “group 1”: The group of atoms that I’m after finding the force on them. This group should be dynamic and is based on a block region with a small enough width to satisfy spatial resolution while wide enough also to include a descent number of atoms for a more reliable average.

  2. “group 2”: This includes all the atoms at a distance >= h from the center of the block region of “group 1”. This is also a dynamic group assigned to that region.

Then using “compute 1 group1 group/group group2” I could get all the force on group1 atoms due to group 2 while dividing by the instantaneous number of atoms in “group 1” to get an average force on each atom. Then averaging over simulation time to obtain an average value of the force on an atom due to its (rc - h) portion of its interaction in z-direction.
However, profiling for a wide range of h that is 0<= h <= rc and with region with fine width would require defining so many regions. Also if “group 1” is taken to be, let’s say, near the top edge of a periodic box, then I can’t define a region for “group 2” as it’ll fall out of the original box (image id =0) while region command is only applicable to a box in wrapped coordinate, so I don’t know how to handle that.

I would highly appreciate it you could share your experience in this regard and help me if there are better ways to handle this case.

Cheers,
Kasra.

I can’t think of anything better than what you outline.

I suggest you also calculate it by post-processing

so you can be sure you are doing it correctly.

There is no other current way in LAMMPS to calcalate

the forces just between 2 sets of atoms other than

compute group/group. If you want to do that between

many different sets, then you need many different groups.

Also note that compute group/group only works for

forces within the neighbor list cutoff.

I suppose the new chunking capability could be used

to write a compute that calculated force between 1 chunk

and each of N other chunks. As an alternative to groups.

Steve

Thanks a lot Steve. My concern was actually a large number of region and groups that I have to define using what I explained so I thought maybe there is a shortcut to that. I’ll look into chunk, it seems as potent choice for me.

Best,
Kasra.