System is not charge neutral, net charge = 100

Dear Lammps Users,
I was trying to minimize my initial system and while doing so, I stumbled upon this warning " System is not charge neutral, net charge = 100 " I checked the total charge using variable equal command it is indeed coming out to be neutral. What I don’t understand is how it has picked up net charge = 100?

One more thing, I’m not able to make sense of “estimated absolute RMS force accuracy” & “estimated relative force accuracy” they seem to be too low. Is the geometry of my initial system too bad? What could be the reason?

LAMMPS (23 Jun 2022 - Update 1)
Reading data file ...
  orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  2 by 1 by 4 MPI processor grid
  reading atoms ...
  1008 atoms
  scanning bonds ...
  2 = max bonds/atom
  scanning angles ...
  3 = max angles/atom
  reading bonds ...
  1467 bonds
  reading angles ...
  2846 angles
Finding 1-2 1-3 1-4 neighbors ...
  special bond factors lj:    0        1        1       
  special bond factors coul:  0        1        1       
     3 = max # of 1-2 neighbors
     3 = max # of special neighbors
  special bonds CPU = 0.000 seconds
  read_data CPU = 0.010 seconds
WARNING: Ignoring 'compress yes' for molecular system (../delete_atoms.cpp:140)
Deleted 4 atoms, new total = 1004
Deleted 9 bonds, new total = 1458
Deleted 24 angles, new total = 2822
Created 100 atoms
  using lattice units in orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  create_atoms CPU = 0.000 seconds
Created 100 atoms
  using lattice units in orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  create_atoms CPU = 0.000 seconds
Created 100 atoms
  using lattice units in orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  create_atoms CPU = 0.000 seconds
Created 100 atoms
  using lattice units in orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  create_atoms CPU = 0.000 seconds
Created 100 atoms
  using lattice units in orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  create_atoms CPU = 0.000 seconds
Setting atom values ...
  200 settings made for charge
Setting atom values ...
  200 settings made for charge
Setting atom values ...
  100 settings made for charge
Resetting atom IDs ...
PPPM initialization ...
WARNING: System is not charge neutral, net charge = 100 (../kspace.cpp:327)
  using 12-bit tables for long-range coulomb (../kspace.cpp:342)
  G vector (1/distance) = 0.53224709
  grid = 60 60 150
  stencil order = 5
  estimated absolute RMS force accuracy = 0.00012031676
  estimated relative force accuracy = 0.00012031676
  using double precision KISS FFT
  3d grid and FFT values/proc = 97825 68400
Generated 0 of 10 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 4.9
  ghost atom cutoff = 4.9
  binsize = 2.45, bins = 25 25 82
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair lj/cut/coul/long, perpetual
      attributes: half, newton on
      pair build: half/bin/newton
      stencil: half/bin/3d
      bin: standard
Finding 1-2 1-3 1-4 neighbors ...
  special bond factors lj:    0        1        1       
  special bond factors coul:  0        1        1       
     3 = max # of 1-2 neighbors
     3 = max # of special neighbors
  special bonds CPU = 0.001 seconds
Reading data file ...
  orthogonal box = (-6.04 -4.86 -100) to (53.94 54.44 100)
  2 by 1 by 4 MPI processor grid
  reading atoms ...
  100 atoms
  scanning bonds ...
  1 = max bonds/atom
  scanning angles ...
  1 = max angles/atom
  reading bonds ...
  99 bonds
  reading angles ...
  98 angles
Finding 1-2 1-3 1-4 neighbors ...
  special bond factors lj:    0        1        1       
  special bond factors coul:  0        1        1       
     3 = max # of 1-2 neighbors
     3 = max # of special neighbors
  special bonds CPU = 0.000 seconds
  read_data CPU = 0.003 seconds
1004 atoms in group carbon
200 atoms in group cl
200 atoms in group k
100 atoms in group counter
100 atoms in group polymer
1004 atoms in group gcar
200 atoms in group gnegative
200 atoms in group gpositive
100 atoms in group gcounter
100 atoms in group gpoly
24 atoms in group gright
24 atoms in group gleft
917 atoms in group gmid
21 atoms in group gtop
21 atoms in group gbot
97 atoms in group gmovep
3 atoms in group gstill
400 atoms in group gions
500 atoms in group gcions
600 atoms in group gcp
595 atoms in group gcp2
1516 atoms in group g1
1512 atoms in group g2
1016 atoms in group g3
Changing box ...
  orthogonal box = (-2.228024 -4.86 -100) to (50.12096 54.44 100)
Changing box ...
  orthogonal box = (-2.228024 -1 -100) to (50.12096 50.630001 100)
PPPM initialization ...
  using 12-bit tables for long-range coulomb (../kspace.cpp:342)
  G vector (1/distance) = 0.55114466
  grid = 60 60 160
  stencil order = 5
  estimated absolute RMS force accuracy = 0.00010245694
  estimated relative force accuracy = 0.00010245694
  using double precision KISS FFT
  3d grid and FFT values/proc = 102375 72000
Generated 0 of 10 mixed pair_coeff terms from arithmetic mixing rule
Setting up cg style minimization ...
  Unit style    : lj
  Current step  : 0
Per MPI rank memory allocation (min/avg/max) = 19.11 | 19.21 | 19.45 Mbytes
   Step          Temp          E_pair         E_mol          TotEng         Press     
         0   0.2334685      13546.881      8.4807628      13555.712      160.82539    
      1000   0.2334685     -0.05865352     0.14719725     0.43852814     0.00055982023
Loop time of 119.848 on 8 procs for 1000 steps with 1604 atoms

98.7% CPU use with 8 MPI tasks x no OpenMP threads

Minimization stats:
  Stopping criterion = max iterations
  Energy initial, next-to-last, final = 
      13555.3617637139 0.0885840599875491 0.0885437295034541
  Force two-norm initial, final = 6.6860196e+08 9.1834272
  Force max component initial, final = 4.2201969e+08 1.9281637
  Final line search alpha, max atom move = 0.012476214 0.024056184
  Iterations, force evaluations = 1000 1981

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 0.026485   | 0.21159    | 0.43755    |  31.7 |  0.18
Bond    | 0.0070498  | 0.065725   | 0.13038    |  20.4 |  0.05
Kspace  | 118.97     | 119.27     | 119.52     |   1.9 | 99.52
Neigh   | 0.066244   | 0.071282   | 0.077214   |   1.5 |  0.06
Comm    | 0.079118   | 0.10795    | 0.14064    |   7.1 |  0.09
Output  | 4.0129e-05 | 4.2255e-05 | 5.5743e-05 |   0.0 |  0.00
Modify  | 0.018069   | 0.021414   | 0.027532   |   2.3 |  0.02
Other   |            | 0.0963     |            |       |  0.08

Nlocal:          200.5 ave         355 max          53 min
Histogram: 2 1 1 0 0 0 0 1 2 1
Nghost:          337.5 ave         677 max          49 min
Histogram: 3 1 0 0 0 0 0 1 1 2
Neighs:        1991.25 ave        4543 max          27 min
Histogram: 3 1 0 0 0 0 0 2 1 1

Total # of neighbors = 15930
Ave neighs/atom = 9.9314214
Ave special neighs/atom = 1.9413965
Neighbor list builds = 287
Dangerous builds = 0
Total wall time: 0:01:59

How exactly did you do that? And where in the input.

The warning shows before the second read_data command, but not after. That is a pretty strong hint of where the warning is coming from. But without access to your inputs and data files one can only guess.

What should it be? Again, without knowing what is in your input deck, it is impossible to make a proper assessment of the situation.

Dear Axel,

So, I wrote these lines after the second read_data:

group  carbon type 1
group  cl type 2
group  k  type 3
group  counter type 4
group  polymer type 5

variable qcarbon equal charge(carbon)
variable qcl equal charge(cl)
variable qk equal charge(k)
variable qcounter equal charge(counter)
variable qpolymer equal charge(polymer)

print "Charge on Carbon = ${qcarbon}"
print "Charge on Cl =  ${qcl}"
print "Charge on K = ${qk}"
print "Charge on Counterions =  ${qcounter}"
print "Charge on Polymer =  ${qpolymer}"

And i got this as a result:

Charge on Carbon = 0
Charge on Cl =  -200
Charge on K = 200
Charge on Counterions =  100
Charge on Polymer =  -100

I apologise for not being clearly explaining. So, I’m trying to translocate a polymer via a graphene sheet. My system contains 1004 carbon atoms in graphene sheet(generated via VMD topo tools). 200 +ve beads (K+), 200 -ve beads(Cl-), 100 bead negatively charged polymer and 100 its counter ion beads. In the below attached script I’m trying to minimise the initial geometry I have created.

polymer.txt (7.0 KB)
polymer.lmp (5.3 KB)
param.lammps (1.2 KB)
data3bp.txt (127.0 KB)

After looking at your input deck, I do not understand what you are concerned about:

  • there is no warning about a charged system after the second read_data command where you add a charge of -100. Before that command your system is not neutral, so the warning is correct.
  • you are asking for a pppm convergence of 1.0e-4 and that is what the output reports.

You are getting what you are asking for.

1 Like

I understand what you are saying however my concern was to confirm whether things that I intend to get and things which, indeed, I was getting were, or rather should be, close or not? As you have said countless times on this forum itself, “just because one’s simulation is running that doesn’t mean one is getting correct results; one can only deduce that something drastic isn’t happening.”

Well, for that kind of confirmation, the burden of proof is on you not the forum. It should be inconsequential if somebody here gives you an approval or not. What matters is that you carefully observe and check yourself and compare what you are inputting with what the simulation does. You are the person that ultimately has to take the responsibility for what you do and what results you present. A statement like ‘somebody on the MatSci forum said that this was OK’ is not going to give your work much credit.

1 Like

I will keep this mind. Thanks Axel.