Three body terms in tersoff/zbl implementation

Dear LAMMPS community,

I have searched online, but could not find the answer to my question. Still, I hope this topic is not redundant with an already existing one.

As I wanted to understand how the coupling between tersoff and ZBL is implemented in the pair tersoff/zbl LAMMPS command, and especially how the three body terms are handled, I read through the pair_tersoff_zbl.cpp file. I was surprised to find no trace of three body terms, namely zeta or b_ij terms as they are called in the pair_tersoff.cpp file.
The three-body parameters lambda_3, powern, powerm, beta, c, d and gamma are read from the potential file but not used.
My understanding is thus that the tersoff/zbl potential only includes two-body repulsive and attractive terms. However, on the pair_tersoff_zbl html page there is nothing indicating that the three body “bond-order” term b_ij is discarded when tersoff is coupled to zbl. I guess there is something I am missing, but I do not understand what.

I would really appreciate some help on this point, thanks in advance !

Best regards


If you look at pair_tersoff_zbl.h (the header file, not cpp file) you will see that PairTersoffZBL inherits from PairTersoff (line 27). In other words PairTersoffZBL is a specialisation of PairTersoff, which overrides some functions (see the override keywords?) but inherits everything else, including those terms you couldn’t find in the cpp.

1 Like

That understanding is incorrect.

You are disregarding that LAMMPS’ code design makes use of C++ classes, inheritance, compositing, and specifically polymorphism. Please see 4.3. Code design — LAMMPS documentation for a minimal introduction and a proper C++ text book for the gory details.

Thanks to both of you for your quick reply !