Adding a new interatomic force field

Hi there,

I’m new to LAMMPS and I’d like some orientation to add a new force field. Reading the
LAMMPS Developer Guide I understood I should implement a fix, however, reading the
online documentation (http://lammps.sandia.gov/doc/Section_modify.html), I came
accross the sentence

“In LAMMPS, a "fix" is any operation that is computed during timestepping that alters
some property of the system. Essentially everything that happens during a simulation
besides force computation, [...]”

and now I’m not sure.

The idea is to add new contributions to the interatomic force filed, considering also
their contribution to the total potential energy. Everything a function of position.

It seemed at first that fix addforce was what I need. According to the documentation
(http://lammps.sandia.gov/doc/fix_addforce.html):

"[...] Thus it is easy to specify a spatially-dependent force field with optional time-
dependence as well."

In the foce calculation I'll be considering, a procedure of self-consistency will be
used, so I think I'll also need to be able to repeat timesteps.

What should I be looking for in LAMMPS to implement my modifications?

Any help appretiated.

Gustavo

Hi there,

I’m new to LAMMPS and I’d like some orientation to add a new force field.

what kind of force field? is it similar to any of the existing ones?
usually you don't need to do any modifications, just assemble the
necessary styles and assign parameters.

Reading the
LAMMPS Developer Guide I understood I should implement a fix, however,

no. a fix may be needed to do some additional work related to a
specific pair style, but not the entire force field.
pairwise interactions are done in pair styles, bond (i.e. fixed
particle pair) interactions in bond styles, angle (fixed particle
triplet) interactions in angle styles and so on.

reading the
online documentation (http://lammps.sandia.gov/doc/Section_modify.html), I
came
accross the sentence

“In LAMMPS, a "fix" is any operation that is computed during timestepping
that alters
some property of the system. Essentially everything that happens during a
simulation
besides force computation, [...]”

and now I’m not sure.

The idea is to add new contributions to the interatomic force filed,
considering also
their contribution to the total potential energy. Everything a function of
position.

absolute or relative position?

It seemed at first that fix addforce was what I need. According to the
documentation
(http://lammps.sandia.gov/doc/fix_addforce.html):

"[...] Thus it is easy to specify a spatially-dependent force field with
optional time-
dependence as well."

that is

In the foce calculation I'll be considering, a procedure of self-consistency
will be
used, so I think I'll also need to be able to repeat timesteps.

hmmm.. how come. so far, the only location where this kind of thing is
done would be in the charge equilibration.

What should I be looking for in LAMMPS to implement my modifications?

perhaps, you should start by running some simulations with the
existing potential classes so you get a better feeling for how things
work in LAMMPS. from your inquiry it appears that you don't have that
yet, and thus you are leading yourself down the wrong road.

axel.

Thank you for your response, Axel.

First of all, sorry for the odd line breaks.

What we're trying to do here is to implement polarization, in the lines of what is
found in, e.g., ref. [1].

When I said function of position, I should've said function of the distance between
ions. I need to calculate the induced electric dipole moments. For that, I need to
calculate the electric field and here enters the required self-consistency of the thing,
which, I presume, will require that I redo timesteps.

The short range "Morse-Stretch" contribution is already implemented in LAMMPS,
so I'll be using it.

Can you recommend me a strategy for that?

Thanks again.

[1]http://dx.doi.org/10.1103/PhysRevB.81.134108 (http://arxiv.org/abs/0911.5311).

Thank you for your response, Axel.

First of all, sorry for the odd line breaks.

What we're trying to do here is to implement polarization, in the lines of
what is found in, e.g., ref. [1].

oh, another one.
you are the 3rd or 4th person i came across that wants to implement
this model of polarizability into LAMMPS.

When I said function of position, I should've said function of the distance
between
ions. I need to calculate the induced electric dipole moments. For that, I
need to
calculate the electric field and here enters the required self-consistency
of the thing,
which, I presume, will require that I redo timesteps.

not necessarily. please have a look at the QEQ package, that
implements several variants to charge equilibration, i.e. a less
sophisticated approach to include polarizability. all you need to do
is to redo the electrostatic part of the force computation (real space
and kspace). this could indeed be done as a new time integration
style, but it may be sufficient to do it as a fix which then calls
specialize versions of the "compute" methods of the respective pair
and kspace styles. see for example the COMB pair style.

The short range "Morse-Stretch" contribution is already implemented in
LAMMPS,
so I'll be using it.

Can you recommend me a strategy for that?

what you are trying to do is fairly non-trivial, so - like it already
mentioned - you first need to familiarize yourself with LAMMPS much
more. trying to do anything without a solid understanding of the flow
of control and other inner workings of LAMMPS will lead to disaster
and lots of wasted time and effort.

axel.

Also, the COMB3 potential in LAMMPS does
polarization, so you may want to look at that.

Steve