Pair_style smoothed LJ

Hello All,
I would like to perform a simulation of a system particles interaction via a smoothed LJ potential. the potential has two extra terms compared with the original one.

LJ_smooth= 4e((s/r)^12-(s/r)^6) + 4e(c0+c2(r/s)^2) for r<rc

I am looking for a pair_style command that let me introduce this potential. It seems it is different from potentials considered in pair_style LJ/smooth commands, and a hybrid pair_style is needed. how can add the polynomial part?
Could you please guide me with this?

Fatima

Pair style hybrid will not help you much with this. You would need pair style hybrid/overlay but since there is no ready to use pair style for the second part this doesn’t really help. Thus your options are:

  • implement a custom pair style in C++ that implements the entire potential
  • create tables and use pair style table
  • implement a custom pair style in python using pair style python
    (this is slow, but simpler to debug and you can use the pair_write command to generate tables for pair style table and that will be much faster and you avoid problems with not creating tables correctly).

thank you for your command.
I will try your suggestion.

Hi,
Following your comment, I would like to implement a custom pair style in c++. Could you please help me by letting me know how can I get access to examples of a custom pair style or even known pairs style c++ code applied in Lammps that can help me?
And, I would be thankful if you inform me whether it is possible to modify LJ/cut potential code in Lammps directly so that it turns into my case?

The LAMMPS manual has extensive documentation on modifying and extending it. It is not recommended to modify a standard pair style, as that will break LAMMPS for other use cases, but rather make a copy under a new name and modify that.