Commit 4a80df3a authored by Steve Plimpton's avatar Steve Plimpton
Browse files

more neighbor list changes, some new options

parent cb982f2f
Loading
Loading
Loading
Loading
+43 −10
Original line number Diff line number Diff line
@@ -10,21 +10,27 @@ compute rdf command :h3

[Syntax:]

compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ... :pre
compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ... keyword/value ... :pre

ID, group-ID are documented in "compute"_compute.html command
rdf = style name of this compute command
Nbin = number of RDF bins
itypeN = central atom type for Nth RDF histogram (see asterisk form below)
jtypeN = distribution atom type for Nth RDF histogram (see asterisk form below) :ul
ID, group-ID are documented in "compute"_compute.html command :ulb,l
rdf = style name of this compute command :l
Nbin = number of RDF bins :l
itypeN = central atom type for Nth RDF histogram (see asterisk form below) :l
jtypeN = distribution atom type for Nth RDF histogram (see asterisk form below) :l

zero or more keyword/value pairs may be appended :l
keyword = {cutoff} :l
  {cutoff} value = Rcut
    Rcut = cutoff distance for RDF computation (distance units) :pre
:ule

[Examples:]

compute 1 all rdf 100
compute 1 all rdf 100 1 1
compute 1 all rdf 100 * 3
compute 1 all rdf 100 * 3 cutoff 5.0
compute 1 fluid rdf 500 1 1 1 2 2 1 2 2
compute 1 fluid rdf 500 1*3 2 5 *10 :pre
compute 1 fluid rdf 500 1*3 2 5 *10 cutoff 3.5 :pre

[Description:]

@@ -32,7 +38,8 @@ Define a computation that calculates the radial distribution function
(RDF), also called g(r), and the coordination number for a group of
particles.  Both are calculated in histogram form by binning pairwise
distances into {Nbin} bins from 0.0 to the maximum force cutoff
defined by the "pair_style"_pair_style.html command.  The bins are of
defined by the "pair_style"_pair_style.html command or the cutoff
distance {Rcut} specified via the {cutoff} keyword.  The bins are of
uniform size in radial distance.  Thus a single bin encompasses a thin
shell of distances in 3d and a thin ring of distances in 2d.

@@ -52,6 +59,30 @@ the dump file. The rerun script can use a
"special_bonds"_special_bonds.html command that includes all pairs in
the neighbor list.

By default the RDF is computed out to the maximum force cutoff defined
by the "pair_style"_pair_style.html command.  If the {cutoff} keyword
is used, then the RDF is computed accurately out to the {Rcut} > 0.0
distance specified.

NOTE: Normally, you should only use the {cutoff} keyword if no pair
style is defined, e.g. the "rerun"_rerun.html command is being used to
post-process a dump file of snapshots.  Or if you really want the RDF
for distances beyond the pair_style force cutoff and cannot easily
post-process a dump file to calculate it.  This is because using the
{cutoff} keyword incurs extra computation and possibly communication,
which may slow down your simulation.  If you specify a {Rcut} <= force
cutoff, you will force an additional neighbor list to be built at
every timestep this command is invoked (or every reneighboring
timestep, whichever is less frequent), which is inefficent.  LAMMPS
will warn you if this is the case.  If you specify a {Rcut} > force
cutoff, you must insure ghost atom information out to {Rcut} + {skin}
is communicated, via the "comm_modify cutoff"_comm_modify.html
command, else the RDF computation cannot be performed, and LAMMPS will
give an error message.  The {skin} value is what is specified with the
"neighbor"_neighbor.html command.  In this case, you are forcing a
large neighbor list to be built just for the RDF computation, and
extra communication to be performed every timestep.

The {itypeN} and {jtypeN} arguments are optional.  These arguments
must come in pairs.  If no pairs are listed, then a single histogram
is computed for g(r) between all atom types.  If one or more pairs are
@@ -153,4 +184,6 @@ change from zero to one at the location of the spike in g(r).

"fix ave/time"_fix_ave_time.html

[Default:] none
[Default:]

The keyword defaults are cutoff = 0.0 (use the pairwise force cutoff).
+3 −3
Original line number Diff line number Diff line
@@ -95,8 +95,8 @@ void PairGranHertzHistory::compute(int eflag, int vflag)
  ilist = list->ilist;
  numneigh = list->numneigh;
  firstneigh = list->firstneigh;
  firsttouch = list->listgranhistory->firstneigh;
  firstshear = list->listgranhistory->firstdouble;
  firsttouch = list->listhistory->firstneigh;
  firstshear = list->listhistory->firstdouble;

  // loop over neighbors of my atoms

@@ -407,7 +407,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,

  int jnum = list->numneigh[i];
  int *jlist = list->firstneigh[i];
  double *allshear = list->listgranhistory->firstdouble[i];
  double *allshear = list->listhistory->firstdouble[i];

  for (int jj = 0; jj < jnum; jj++) {
    neighprev++;
+6 −8
Original line number Diff line number Diff line
@@ -137,8 +137,8 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
  ilist = list->ilist;
  numneigh = list->numneigh;
  firstneigh = list->firstneigh;
  firsttouch = listgranhistory->firstneigh;
  firstshear = listgranhistory->firstdouble;
  firsttouch = listhistory->firstneigh;
  firstshear = listhistory->firstdouble;

  // loop over neighbors of my atoms

@@ -403,13 +403,11 @@ void PairGranHookeHistory::init_style()
  // need a granular neigh list and optionally a granular history neigh list

  int irequest = neighbor->request(this,instance_me);
  neighbor->requests[irequest]->half = 0;
  neighbor->requests[irequest]->gran = 1;
  neighbor->requests[irequest]->size = 1;
  if (history) {
    irequest = neighbor->request(this,instance_me);
    neighbor->requests[irequest]->id = 1;
    neighbor->requests[irequest]->half = 0;
    neighbor->requests[irequest]->granhistory = 1;
    neighbor->requests[irequest]->history = 1;
    neighbor->requests[irequest]->dnum = 3;
  }

@@ -510,7 +508,7 @@ void PairGranHookeHistory::init_style()
void PairGranHookeHistory::init_list(int id, NeighList *ptr)
{
  if (id == 0) list = ptr;
  else if (id == 1) listgranhistory = ptr;
  else if (id == 1) listhistory = ptr;
}

/* ----------------------------------------------------------------------
@@ -706,7 +704,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,

  int jnum = list->numneigh[i];
  int *jlist = list->firstneigh[i];
  double *allshear = list->listgranhistory->firstdouble[i];
  double *allshear = list->listhistory->firstdouble[i];

  for (int jj = 0; jj < jnum; jj++) {
    neighprev++;
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ void FixQEqReaxKokkos<DeviceType>::init()
    neighbor->requests[irequest]->half = 0;
  } else { //if (neighflag == HALF || neighflag == HALFTHREAD)
    neighbor->requests[irequest]->fix = 1;
    neighbor->requests[irequest]->pair = 0;
    neighbor->requests[irequest]->full = 0;
    neighbor->requests[irequest]->half = 1;
    neighbor->requests[irequest]->ghost = 1;
+0 −1
Original line number Diff line number Diff line
@@ -602,7 +602,6 @@ void PairVashishtaKokkos<DeviceType>::init_style()
  if (neighflag == FULL || neighflag == HALF || neighflag == HALFTHREAD) {
    neighbor->requests[irequest]->full = 1;
    neighbor->requests[irequest]->half = 0;
    neighbor->requests[irequest]->full_cluster = 0;
    if (neighflag == FULL)
      neighbor->requests[irequest]->ghost = 1;
    else
Loading