You said the molecule you are immobilizing is hydrophobic. If you can
approximate it as completely charge-free (all atoms have charge 0),
then I suspect that the WARNING message about long-range
electrostatics and fix rigid can be ignored. However I doubt this
applies to your molecule.
I have read in some locations that for the NPT ensemble, a “neigh_modify"
command is *required* to turn off force calculations between immobilized
That might have been me who said that.
First of all, if you are running NVT simulations, then it does not
matter. (In that case, we all agree that there's no need to use
"neigh_modify exclude" or "fix rigid".) As Axel said, running NVT
If you are running NPT simulations, then it is not clear.
Several people have tried using "fix setforce immobile_group 0 0 0"
without success. (Me too.) Using neigh_modify exclude seemed to be
necessary in my case. In my case I had enormous repulsive Lennard
Jones interactions between immobile particles which were dominating
the virial. Using "neigh_modify exclude" was one way to turn those
forces off which helped a lot. (I also found "fix rigid" useful.)
I recommend you try it both ways, with and without "neigh_modify
exclude", and also with and without "fix rigid". (Let us know what
works best! If you actually get "fix setforce" to work, let us know
-------------- history -------------
There was some controversy regarding how to run simulations of
immobilized objects in LAMMPS in NPT conditions. In spite of Steve
and Trung patiently listening and trying to convince me otherwise, I
was advocating that people use both "neigh_modify exclude" and "fix
rigid" on the group of atoms you wish to immobilize.
Under NPT conditions, Trung and I ran some tests in 2011. We both
agreed that "neigh_modify exclude" was necessary. However, when I
tried it, my results suggested that "fix rigid" on the immobile atoms
seemed to do a slightly better job of preserving the volume of the
simulation, before and after immobilization.
These test results are shown here in these 4 plots:
(Trung's approach which does not use "fix rigid" is the blue curve.
My approach which is identical except that it uses "fix rigid" is the
green curve. Both approaches use "neigh_modify exclude".)
However the "fix rigid" command has changed since 2011. So everything
I am saying could be irrelevant. That's why I suggest trying it
yourself and see which way works best.
Here is a long list of posts on this topic: