[lammps-users] bond/angle/dihedral/improper "table"

Hi David,

I have implemented tabulated potentials in lammps for bond and nonbond
interactions.
It's not available in lammps release, but as Steve said it's really easy
to achieve.

If you just want to know how to start, I can briefly tell you what I've
done. Because
the tabulated potentials I implemented are highly integrated with a
coarse-graining
package which might be meaningless to you.

Before you start, just study a little of the source for "pair_style
table". There you will
find the tabulated potential is read and prepared in "Pairtable::coeff"
method. This function
will be called when pair_coeff is executed. It's a good time to read in
your tabulated data.
Then you have to implement the "compute" method for your pair_style and
maybe also
"single" method, in which you should use the read tabulated data to
calculate energy
to accumulate forces. That's all.

But there are some things you should pay a little attention. First,
as always emphasized by
the author, you should take care of the code parallelism , i.e. the
computing balance among
CPUs (do not run a heavy computation on a single node, instead, spread
it). Second, your
tabulated data could be read by the server node the broadcast to the all
nodes (see
pair_style table). This may speed up the I/O part if you have a huge
tabulated data file. Next,
you have to implement some algorithms to streamline the use of your
tabulated data. In my case,
I made a base class for all the tabulated potentials, since they are
quite similar in data structure
and usage. Then implement some interpolation and table lookup methods,
such as spline.
It the original tabulated data has enough density, I found the simplest
linear interpolation it good
and fast.

Good luck.
li
http://SimuWorld.linkka.com (a good place to talk about molecular
simulation in Chinese)