About the cutsq array in lammps

Dear lammps users,
Hi. In LAMMPS source files such as “pair_lj_cut.cpp" and “pair_dpd.cpp”, the array cutsq is used but is not computed in the same file. This array is clearly the square of the array cut. My question is that if I were writing my own pair style, and the total pairwise force consists of two different forces with different cutoff radius, the pair_coeff would need two different cutoff radius (e.g. cut1 and cut2) inputed. In this situation what would the values of the array cutsq be?
Thanks for your comment in advance.

Chao-jie
July 15, 2016

Dear lammps users,
Hi. In LAMMPS source files such as “pair_lj_cut.cpp" and “pair_dpd.cpp”, the
array cutsq is used but is not computed in the same file. This array is

indeed. the value of cutsq is computed in Pair::init() in the file pair.cpp

clearly the square of the array cut. My question is that if I were writing
my own pair style, and the total pairwise force consists of two different
forces with different cutoff radius, the pair_coeff would need two different
cutoff radius (e.g. cut1 and cut2) inputed. In this situation what would
the values of the array cutsq be?

the larger of the two. it is based on the cutoff value returned by
PairYourStyle::init_one()
please have a look at the source of pair style lj/cut/coul/cut, which
also has two cutoffs.

axel.

This solves my problem, thank you very much, Axel.