Is hybrid/overlay needed to exclude uncharged particles from Coulomb calculations?

Hello,

I’ve developed a model that has charged LJ ions as well as uncharged LJ solvent particles. Will I need to utilize the hybrid/overlay pair style so that solvent particles are not included in the coulomb calculations or is LAMMPS smart enough to exclude zero-charged particles? Could this logic be added to the code?

Thanks for your insight,

Brian

brian,

Hello,

I've developed a model that has charged LJ ions as well as uncharged LJ
solvent particles. Will I need to utilize the hybrid/overlay pair style so
that solvent particles are not included in the coulomb calculations or is
LAMMPS smart enough to exclude zero-charged particles? Could this logic be
added to the code?

nope. LAMMPS will not exclude those particles unless you
have a very, very small number of charged particles.

for as long as you use similar cutoffs, you'll be best off
with using zero charged particles and pair style that
handles charges throughout. the only place where you
are able to speed up things are in PPPM. lammps-icms
has a kspace_style pppm/cg that compiles a list of
charged particles and then loops over them only.
that will get me around 10% speedup for %5 charged
particles.

the only way i saw benefits from doing things differently
in the pair interactions is when you want to use a different
(larger) coulomb cutoff to get better parallel scaling.

then you have to overlay coul/long with lj/cut and
use neighbor list style multi and communicate multi.
this way, you can then crank up the coulomb cutoff
and fiddle with the pppm parameters until you reach
the performance optimum. ...and you can push it
even further with OpenMP enabled pair styles (this
is what we are using to the maximum performance
for our coarse grain MD simulations with 4-8%
charged particles on the big cray XT5 machines.

axel.

If you just use lj/cut/coul/whatever, a particle with
charge 0.0 will contribute 0.0 as it should. The only
issue is efficiency (calculating with zeroes). But as
Axel said that isn't a big win. Neither would pair hybrid be.

So I would just try it and see what you get.

Steve

Thanks guys. Only 0.5% of my system is charged particles (200 charged, ~44,000 uncharged) so it really is a toss up as to what will happen like you guys are saying. I’ll just have to run it and see.

Thanks,

Brian

brian,

Thanks guys. Only 0.5% of my system is charged particles (200 charged,
~44,000 uncharged) so it really is a toss up as to what will happen like you
guys are saying. I'll just have to run it and see.

if you need long-range electrostatics on that,
you should definitely go for using hybrid overlay
and the pppm/cg kspace style.

i am copying an example input below for an
coarse grain SDS surfactant monolayer input.

this kind of setup benefits a _lot_ from OpenMP or GPU.
GPU is particularly interesting, since the GPU non-bonded
kernels can run at the same time as the kspace and bonded.
since non-bonded on the GPU is fairly fast, performance is
often determined by the performance of pppm and here
the charged atom list optimization in pppm/cg is a big win.
i've seen 20% speedup vs. pppm and more.

...and again, you can accelerate kspace even more by
playing with the real space cutoff for coulomb. the multi
neighborlist style handles this very efficiently.

good luck,
    axel.

# lammps input script

units real
dimension 3
atom_style full
processors * * 1

read_data DATA.FILE

pair_style hybrid/overlay cg/cmm/omp 15.0 coul/long/omp 25.0
bond_style harmonic
angle_style cg/cmm
special_bonds lj/coul 0.0 0.0 1.0

mass 1 96.0576 # SO4
mass 2 42.0804 # CM
mass 3 43.0883 # CT
mass 4 77.0342 # SOD
mass 5 54.0460 # W

pair_coeff 1 1 coul/long/omp # SO4 SO4
pair_coeff 1 4 coul/long/omp # SO4 SOD
pair_coeff 4 4 coul/long/omp # SOD SOD
pair_coeff 1 1 cg/cmm/omp lj9_6 0.7000 4.3210 # SO4 SO4
pair_coeff 1 2 cg/cmm/omp lj9_6 0.3830 4.4135 # SO4 CM
pair_coeff 1 3 cg/cmm/omp lj9_6 0.4050 4.4530 # SO4 CT
pair_coeff 1 4 cg/cmm/omp lj12_4 1.1000 4.1000 # SO4 SOD
pair_coeff 1 5 cg/cmm/omp lj12_4 1.1000 4.1000 # SO4 W
pair_coeff 2 2 cg/cmm/omp lj9_6 0.4200 4.5060 # CM CM
pair_coeff 2 3 cg/cmm/omp lj9_6 0.4440 4.5455 # CT CM
pair_coeff 2 4 cg/cmm/omp lj12_4 0.3400 4.4385 # SOD CM
pair_coeff 2 5 cg/cmm/omp lj12_4 0.3400 4.4385 # W CM
pair_coeff 3 3 cg/cmm/omp lj9_6 0.4690 4.5850 # CT CT
pair_coeff 3 4 cg/cmm/omp lj12_4 0.3600 4.4780 # SOD CT
pair_coeff 3 5 cg/cmm/omp lj12_4 0.3600 4.4780 # W CT
pair_coeff 4 4 cg/cmm/omp lj12_4 0.3500 4.3710 # SOD SOD
pair_coeff 4 5 cg/cmm/omp lj12_4 0.8950 4.3710 # SOD W
pair_coeff 5 5 cg/cmm/omp lj12_4 0.8950 4.3710 # W W

bond_coeff 1 11.0000 3.6300 # SO4 CM
bond_coeff 2 6.1600 3.6400 # CM CM
bond_coeff 3 6.1600 3.6500 # CM CT

angle_coeff 1 1.1000 178.0000 lj9_6 0.3830 4.4135 # SO4 CM CM
angle_coeff 2 1.1900 173.0000 lj9_6 0.4200 4.5060 # CM CM CM
angle_coeff 3 1.1900 175.0000 lj9_6 0.4440 4.5455 # CM CM CT

replicate 8 8 1

group charged type 1 4
atom_modify first charged

kspace_style pppm/cg 0.00001
kspace_modify order 3

communicate multi
neighbor 2.0 multi
neigh_modify delay 4 every 2 check yes

timestep 10.0

fix 1 all nvt temp 310.0 310.0 100.0 drag 0.1

thermo_style custom step pe temp evdwl ecoul spcpu
thermo 500

velocity all create 325.0 63443

run 10000