[lammps-users] Apply separately 2body and 3body

Dear All,

We have implemented a two + three-body force field with long range
interaction (2-body = LJ, 3-body = Stillinger-Weber) under the framework
of SW, with greatly appreciated help from Aiden P. Thompson. One
drawback is that it takes the LJ from the force field file, just like
the SW, and hence computes the 3-body force field for all triplets in
the configuration. This makes the code run very slow. Is there a smart
way of computing the 2-body for all types of pairs and the 3-body for
only a selected numbers of triplets of types, like (Si-O-Si, O-Si-O,
Al-O-Al, Al-O-Si, O-Al-O) in an alumino silicate glass? This would be
possible if Lammps allowed users to add force fields for the same type,
like in dl_poly or Gulp.

Help is desperately needed.

Thanks,
Adama

Adama,

You could set up a three-body neighbor list along the lines of a two-body neighbor list. That should speed up things significantly. These lists would be updated every so often (on the order of every 20 timesteps or so).

Pieter

We have implemented a two + three-body force field with long range
interaction (2-body = LJ, 3-body = Stillinger-Weber) under the framework
of SW, with greatly appreciated help from Aiden P. Thompson. One
drawback is that it takes the LJ from the force field file, just like
the SW, and hence computes the 3-body force field for all triplets in
the configuration. This makes the code run very slow. Is there a smart
way of computing the 2-body for all types of pairs and the 3-body for
only a selected numbers of triplets of types, like (Si-O-Si, O-Si-O,
Al-O-Al, Al-O-Si, O-Al-O) in an alumino silicate glass?

Yes. You just need to write a code, that does what you want. If you
want to make the program run as fast as possible, it may be a good
idea to write a less general code, i.e. the pair potential that is
specific for your case.
I implemented a potential that is similar to S-W. Two most important
optimizations were:
- using spline interpolation for 2-body part of the potential (in my
case 2-body force was computationally expensive, but I think DL_POLY
does it for all 2-body potentials)
- making a separate neighbour list for 3-body part of the potential.
In my case three-body cut-off is about 2.5 times smaller than 2-body
cut-off, and I also have 3-body forces only for some triplets of
atoms, so double loop over all 2-body neighbors was slowing down the
calculations significantly.
[I just read Pieter's reply. I'm doing what he wrote, but I'm
updating three-body neighbor list every step.]
HTH

This would be
possible if Lammps allowed users to add force fields for the same type,
like in dl_poly or Gulp.

I don't understand this.

Marcin

PS.
please do not attach a dozen of completely unrelated messages to your question.

Marcin,

I don't think you would have to update the neighbor list every step if you
adhere to the skin principle. You can do a local check on the extent of
movement of your particles in your list with respect to their position upon
its last build, in line with the two-body list. It might make things a bit
faster for you.

Pieter

Yes, I'd have to implement it to see how much faster it is. I think
the difference would be small, because I'm building 3-body neighbor
list using 2-body NL, so it is quite fast.

Thanks,
Marcin

Marcin,

I can see that might be true because a three-body lists consists of nested two-body lists. Memory might become an issue when your systems get largeā€¦

Pieter