[lammps-users] Using multi keyword in neighbor and comm_modify commands

Dear Lammps Community,

I have a heterogenous FENE polymer chain model immersed in a heterogeneous WCA (LJ) fluid (4 different atom types). The LJ particle sigmas range from 0.5 to 5.0, so I want to use multi style in neighbor and multi keyword in comm_modify to increase performance.

Based on what I realized from the doc about the multi option, this algorithm groups particles based on their sizes (not based on the original atoms types defined in Lammps) into a series of collections or types; for instance, if a chain monomer (atom type 1) and a fluid particle (atom type 3) have the same size, they are assigned to the same collection or type in the multi algorithm*.* Is my understanding correct? I also want to use the multi and cutoff/multi keywords in comm_modify for communication. The doc recommends that a ghost cutoff > neighbor cutoff is used in systems similar to mine (that satisfies the first two example given in the doc after reduce/cutoff explanation), but I do not know how to properly set ghost cutoff.

Given my understanding is correct, Is setting “ghost cutoff=1.5*the largest pair cutoff diameter in a collection” good?

variable cutoff11 equal 11.122462 # small monomers in the FENE chain
variable cutoff22 equal 5
1.122462 # large monomers in the FENE chain
variable cutoff33 equal 11.122462 # # small beads in the WCA fluid
variable cutoff44 equal 0.5
1.122462 # large beads in the WCA fluid

neighbor 0.3 multi
neigh_modify delay 0 every 1 check yes collection/type 3 1 2 3*

variable gfactor equal 0.5 # This is a factor for increasing ghost cutoff
variable gskin1 equal {cutoff11}+(1+{gfactor})
variable gskin2 equal {cutoff22}+(1+{gfactor})
variable gskin3 equal {cutoff33}+(1+{gfactor}) # since cutoff33 is always larger than cutoff44
comm_modify mode multi cutoff/multi 1 {gskin1} cutoff/multi 2 {gskin2} cutoff/multi 3 ${gskin3}

Thank you in advance for your help.

there is a discussion of the communication patterns and neighborlist build concepts in the new LAMMPS paper and adapted versions of those sections in the programmer guide section of the manual: https://docs.lammps.org/Developer_parallel.html

Hello Amir,

By default, LAMMPS will actually create one collection for each atom type – which happens to be the same setup you manually specified in your script. LAMMPS does not automatically look at interaction distances or identify whether two atom types have similar ‘sizes’. If you want to combine type 1 and type 3 into a single collection, you can alternatively specify:

neigh_modify collection/type 2 1,3 2

This creates 2 collections, one with types 1 and 3 and the other with just type 2. Benchmarking your specific simulation is the best way to determine which option is more efficient.

Assuming your cutoff variables correspond to the actual pair cutoffs, your comm_modify command will set the ghost cutoff to the same type pair cutoff +1.5 not *1.5 (maybe a typo?). However if your specified cutoff is smaller than the neighbor cutoff, LAMMPS will just use the neighbor list cutoff to ensure the neighbor list doesn’t miss ghost atoms that weren’t communicated.

Hope this helps.