[lammps-users] regularized Coulomb

Dear ALL,

I try to make MD simulations for small plasmas with ionization in LAMMPS. I have a problem with Coulomb potential and want to regularize it for example as 1/sqrt(r+a). I don’t know C++, but I tried to change the line in pair_coul_cut.cpp

rsq = delxdelx + delydely + delzdelz; to rsq = delxdelx + delydely + delzdelz+0.1;

Then I tried to check which is the result, made LAMMPS again and used pair_write. It looks like nothing changed.

What should I do to change a potential and forces in such a way?

Dear ALL,
I try to make MD simulations for small plasmas with ionization in LAMMPS. I
have a problem with Coulomb potential and want to regularize it for example
as 1/sqrt(r+a). I don't know C++, but I tried to change the line in
pair_coul_cut.cpp

rsq = delx*delx + dely*dely + delz*delz; to rsq = delx*delx + dely*dely +
delz*delz+0.1;
Then I tried to check which is the result, made LAMMPS again and used
pair_write. It looks like nothing changed.

that is because when you use pair_write,
lammps uses the Pair::single() method to compute force and energy
for a specific pair of atom positions, whereas during regular MD it
uses the Pair::compute() method to loop over all pairs in a domain
via the neighbor lists.

axel.

please always keep the mailing list in cc when replying.

Dear Alex,
Thank you for the fast reply,
I am sorry but I did not fully understand,
Is that means that in real MD simulation it would use the changed
potential?

yes.

you should see a difference in energy when doing run 0
with the original and the modified code. to make those
comparisons easy, you should make a copy of the .cpp
and .h files under a new name, similarly rename the class,
and all its member, so that you can swap between the
two styles without having to have two binaries.

the manual has a whole section dedicated to how to adapt
and extend the code to your needs.
http://lammps.sandia.gov/doc/Section_modify.html

you should have a really good look at that (and then
perhaps a little chat with somebody locally that knows
how c++ classes work to give you some more pointers
where you need to modify what).

cheers,
    axel.