neighbors, force cutoff

Hi Lammps-users,

The neighbor command lets you set the skin distance. The skin distance +
force cutoff distance gives the radius for the neighbor list of atom i.

I have 2 questions if someone could help clarify this for me:
1) Where is the force cutoff calculated and how is it called in the
neighbor.cpp? For example, in pair_tersoff.cpp is this the cutmax
variable? How is the force cutoff communicated to the rest of the lammps
package?

2) I notice that pair_airebo has a different approach to constructing
neighborlists from pair_tersoff. The AIREBO approach gets the neighbors
and the second nearest neighbors including ghost atoms by looping over
allnum. The tersoff approach gets neighbors by looping over inum.

Hypothetically, if you wanted to get the second nearest neighbors
including ghost atoms, couldn't you just loop over jnum if the skin is
large enough to include second nearest neighbors, or am I missing
something? Would there be any performance difference?

Thanks for your help,
John

Comments below.

Steve

Hi Lammps-users,

The neighbor command lets you set the skin distance. The skin distance +
force cutoff distance gives the radius for the neighbor list of atom i.

I have 2 questions if someone could help clarify this for me:
1) Where is the force cutoff calculated and how is it called in the
neighbor.cpp? For example, in pair_tersoff.cpp is this the cutmax
variable? How is the force cutoff communicated to the rest of the lammps
package?

Different pair styles do this differently. For many
of them, you define the cutoff in the pair_style or
pair_coeff commands, e.g. pair_style lj/cut. Some define
cutoffs in their parameter files. Eam is this way, also
Tersoff if I recall.

2) I notice that pair_airebo has a different approach to constructing
neighborlists from pair_tersoff. The AIREBO approach gets the neighbors
and the second nearest neighbors including ghost atoms by looping over
allnum. The tersoff approach gets neighbors by looping over inum.

Hypothetically, if you wanted to get the second nearest neighbors
including ghost atoms, couldn't you just loop over jnum if the skin is
large enough to include second nearest neighbors, or am I missing
something? Would there be any performance difference?

Manybody potentials such as AIREBO require different kinds
of neighbors. Some require neighbors of ghost atoms. LAMMPS
does this behind the scenes in different ways. The "skin" is
almost never large enough to encompass extra neighbors.
Typically it is 1 Angstrom or less (in real or metal units). Anything
larger becomes quite inefficient -> too many neighbors to check
that end up too far away.