[lammps-users] what does the single() function do in pair.h file?

Hello,Steve!

I try to add a new potential to lammps. After I add my potential file, lammps could run successfully. But I have some doubts about the single() function in pair.h file, where my sub-pair_style class derived from. Whether the single() calculate the i-j pair with the all other atoms exit or regardless of the other atoms,that is we should treat the i-j pair in single() just as the isolated piar or the one within all pairs it contains.

Because I need to calculate a kind of embeded potential. As you know it involves not only the pair we concerned,but also its neighbors. Could you explain it for me?

Thanks. |

The single() func is meant to calc the energy/force of I interacting with J,
i.e. a true pair interaction. Most all the pair_styles that compute true pairwise interactions
define it. Most that compute manybody interactions do not. So it’s up to you.
If you do not define it, you should be sure to set single_enable = 0
in your constructor, so that LAMMPS will flag an error if you try
to call that function.

Steve

Thanks for your response.

And I have another problem. When I run lammps with my potential, the first step is all right, but the next turn out to be something wrong which I cannot solve. Here is parts of my output :

Total # of neighbors = 58000
Ave neighs/atom = 29
Neighbor list builds = 0
Dangerous builds = 0
WARNING: Resetting reneighboring criteria during minimization
Setting up minimization …
Memory usage per processor = 2.58065 Mbytes
Step Temp E_pair E_mol TotEng Press
0 0 -7962.7444 0 -7962.7444 -83445235
1 0 nan 0 nan nan
Loop time of 8.60989 on 1 procs for 1 steps with 2000 atoms

Why the total energy and pressure in the second step is all nan??? What the possible causes of it?

11年3月14日,周一, Steve Plimpton <sjplimp@…24…> 写道:

On step 0 your pressures look bad, which means
your force is bad, which will lead to bad energies on
subsequent steps. I suggest you debug the code
you have written. No one else is going to be able
to help you with that.

Steve