[lammps-users] modifying pair interactions using addforce

Hi,

I was just wondering: while one can always write a new pair style in lammps, is it possible to include a modification of an existing pair style (like adding an extra term perhaps) by using an “addforce” command together with an appropriate “compute pair/local” and accessing nearest neighbor distances. Has anyone here tried this out? This may be a simpler option than writing C++ code !! Should there be a performance degradation once done in this way? Will this computation be automatically parallelized?

All the best
Surajit

Anything is possible, but I'm not clear how you
expect the fix addforce command to do anything
pairwise. It simply adds a force to each atom,
and doesn't look at pairs. You could write a new
fix that looped over atoms and their neighbors (like
a pair style does) and added a force to each pair.
It would be parallel. But that's essentially a pair
style. Also you would lose the machinery in a
pair style that does the energy and virial correctly.

Steve