fix adapt triggers at every 'run' command

In my current simulations, I have two species of particles. The 1-1 and
2-2 interactions are coul/long, but the 1-2 interaction is a
hybrid/overlay potential that is the Coulomb potential *minus* a Debye
potential. I define the pair interactions by

  pair style hybrid/overlay coul/long \{cutf\} coul/debye {alf} ${cutf}
  pair coeff * * coul/long
  pair coeff 1 2 coul/debye
  fix soft all adapt 0 pair coul/debye scale 1 2 v_neg1 scale yes reset

The variable v_neg1 is just -1 stored in a variable. From past
experience, this approach works as intended to create the potential

  v12(r) = q1q2/r (1 - exp(-\alpha r))

My question comes from recent simulations where my input script contains
multiple "run" commands. Schematically, the this part of the input file
looks like

  run 500
  fix kick all addforce 0 0 v_perturb every 1
  run 1
  unfix kick
  run 1000

When I look at the total energy of the system, it *instantaneously
drops* at time step 500, then increases between 500 and 501 (due to the
perturbation) and then again instantaneously drops at 501. I speculate
that the second and third "run" invocations are re-applying the fix
adapt that sets the sign of the overlay for the 1-2 interaction. This is
corroborated by visualizing the simulation, in which some particles
"slingshot" when the (small) perturbation is applied.

I thought the point of the "reset no" keyword was to prevent fix adapt
from getting reapplied? Is my understanding wrong? I am using

Nathaniel Shaffer
University of Iowa
Physics & Astronomy

From the manual:

“Depending on the value of the reset keyword, attributes changed by this fix will or will not be reset back to their original values at the end of a simulation. Even if reset is specified as yes, a restart file written during a simulation will contain the modified settings.”

If you don’t want to invoke fix adapt in the second run, you have to unfix it. Alternatively, you may try (I haven’t tested it) setting “reset” flag to “yes”, so fix adapt will change the sign in every run, but it will always be changed from the starting value.



Hi Michal,

Switching from "reset no" to "reset yes" seems to resolve the issue --
no more funny spikes in TotEng due to slingshots. From this, I infer
that LAMMPS treats each invocation of "run" as a distinct simulation, at
least with respect to applying "fix adapt". Didn't know that.