I'm having trouble with pair_style table placing two different tables
in the same table file. I've included an example with 3 particles.
The first particle is a container whose position is fixed at the
origin. The other particles are trapped inside of it. I use
pair_style table to describe the interaction between those two
particles and the container particle:
pair_coeff 1 2 table table_container.dat CH_H0_475
pair_coeff 1 3 table table_container.dat CH_H0
The first table is an attractive interaction. Particle 2 should be
attracted to he wall.
The second table is repulsive. Particle 3 should be repelled away
from the wall.
However this is not what happened. When I run the simulation both
particles (2 and 3) stick to the wall.
(See attached figure.
You can also tell that something bad is going on using "pair_write":
pair_write 1 2 1001 r 0.00000000001 5.05 test_container_C-B.dat C-B 0 0
pair_write 1 3 1001 r 0.00000000001 5.05 test_container_C-L.dat C-L 0 0
These two commands print out the same table.)
The work-around is easy (use two different table files).
If that's what we should do, that's fine, (but please change the docs
to warn users).
I don't think there is an error in my table file.
But if there is, it would be better to have LAMMPS report it.
(I found a bug in dihedral_hybrid.cpp, and will post a fix for it later today.)
Cheers!
Andrew
P.S.
As you can tell from this example, the particles can get arbitrarily
close to zero. I've been using using a radius of "0.00000000001" as
my first entry in the table to work around the requirement that radius
(separation distance between two particles) must be strictly positive.
It's not a big deal, but ff you are going to make modifications to
pair_table.cpp, can you change it to allow two particles to have a
separation-distance of zero? (Would a check for if (r<rtiny) (to
prevent divide-by-zero) slow down the code too much? If you don't
want to allow this, it's not a big deal.)
README.TXT (405 Bytes)

run.in.nvt (1.86 KB)
system.data (292 Bytes)
table_container.dat (98.6 KB)