Unverified Commit 93fd33aa authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1507 from athomps/yarray

Back-porting of Zombie SNAP improvements
parents 6536399f 4d7d3a5d
Loading
Loading
Loading
Loading
+13 −23
Original line number Diff line number Diff line
@@ -24,12 +24,7 @@ twojmax = band limit for bispectrum components (non-negative integer) :l
R_1, R_2,... = list of cutoff radii, one for each type (distance units) :l
w_1, w_2,... = list of neighbor weights, one for each type  :l
zero or more keyword/value pairs may be appended :l
keyword = {diagonal} or {rmin0} or {switchflag} or {bzeroflag} or {quadraticflag} :l
  {diagonal} value = {0} or {1} or {2} or {3}
     {0} = all j1, j2, j <= twojmax, j2 <= j1
     {1} = subset satisfying j1 == j2
     {2} = subset satisfying j1 == j2 == j3
     {3} = subset satisfying j2 <= j1 <= j
keyword = {rmin0} or {switchflag} or {bzeroflag} or {quadraticflag} :l
  {rmin0} value = parameter in distance to angle conversion (distance units)
  {switchflag} value = {0} or {1}
     {0} = do not use switching function
@@ -44,7 +39,7 @@ keyword = {diagonal} or {rmin0} or {switchflag} or {bzeroflag} or {quadraticflag

[Examples:]

compute b all sna/atom 1.4 0.99363 6 2.0 2.4 0.75 1.0 diagonal 3 rmin0 0.0
compute b all sna/atom 1.4 0.99363 6 2.0 2.4 0.75 1.0 rmin0 0.0
compute db all sna/atom 1.4 0.95 6 2.0 1.0
compute vb all sna/atom 1.4 0.95 6 2.0 1.0 :pre

@@ -151,7 +146,7 @@ The argument {rfac0} and the optional keyword {rmin0} define the
linear mapping from radial distance to polar angle {theta0} on the
3-sphere.

The argument {twojmax} and the keyword {diagonal} define which
The argument {twojmax} defines which
bispectrum components are generated. See section below on output for a
detailed explanation of the number of bispectrum components and the
ordered in which they are listed.
@@ -192,24 +187,19 @@ command that includes all pairs in the neighbor list.
Compute {sna/atom} calculates a per-atom array, each column
corresponding to a particular bispectrum component.  The total number
of columns and the identity of the bispectrum component contained in
each column depend on the values of {twojmax} and {diagonal}, as
each column depend of the value of {twojmax}, as
described by the following piece of python code:

for j1 in range(0,twojmax+1):
    if(diagonal==2):
        print j1/2.,j1/2.,j1/2.
    elif(diagonal==1):
        for j in range(0,min(twojmax,2*j1)+1,2):
            print j1/2.,j1/2.,j/2.
    elif(diagonal==0):
        for j2 in range(0,j1+1):
            for j in range(j1-j2,min(twojmax,j1+j2)+1,2):
                print j1/2.,j2/2.,j/2.
    elif(diagonal==3):
    for j2 in range(0,j1+1):
        for j in range(j1-j2,min(twojmax,j1+j2)+1,2):
            if (j>=j1): print j1/2.,j2/2.,j/2. :pre

NOTE: the {diagonal} keyword allowing other possible choices
for the number of bispectrum components was removed in 2019, 
since all potentials use the value of 3, corresponding to the
above set of bispectrum components.

Compute {snad/atom} evaluates a per-atom array. The columns are
arranged into {ntypes} blocks, listed in order of atom type {I}.  Each
block contains three sub-blocks corresponding to the {x}, {y}, and {z}
@@ -259,7 +249,7 @@ package"_Build_package.html doc page for more info.

[Default:]

The optional keyword defaults are {diagonal} = 0, {rmin0} = 0,
The optional keyword defaults are {rmin0} = 0,
{switchflag} = 1, {bzeroflag} = 1, {quadraticflag} = 0,

:line
+5 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ where {B_k^i} is the {k}-th bispectrum component of atom {i},
and {beta_k^alpha_i} is the corresponding linear coefficient
that depends on {alpha_i}, the SNAP element of atom {i}. The
number of bispectrum components used and their definitions
depend on the values of {twojmax} and {diagonalstyle}
depend on the value of {twojmax}
defined in the SNAP parameter file described below.
The bispectrum calculation is described in more detail
in "compute sna/atom"_compute_sna_atom.html.
@@ -125,14 +125,13 @@ This line is followed by {ncoeff} coefficients, one per line.
The SNAP parameter file can contain blank and comment lines (start
with #) anywhere. Each non-blank non-comment line must contain one
keyword/value pair. The required keywords are {rcutfac} and
{twojmax}. Optional keywords are {rfac0}, {rmin0}, {diagonalstyle},
{twojmax}. Optional keywords are {rfac0}, {rmin0},
{switchflag}, and {bzeroflag}.

The default values for these keywords are

{rfac0} = 0.99363
{rmin0} = 0.0
{diagonalstyle} = 3
{switchflag} = 0
{bzeroflag} = 1
{quadraticflag} = 1 :ul
@@ -144,6 +143,9 @@ If {quadraticflag} is set to 1, then the SNAP energy expression includes the qua
The SNAP element file should contain {K}({K}+1)/2 additional coefficients
for each element, the upper-triangular elements of alpha.

NOTE: The previously used {diagonalstyle} keyword was removed in 2019,
since all known SNAP potentials use the default value of 3.

:line

[Mixing, shift, table, tail correction, restart, rRESPA info]:
+0 −1
Original line number Diff line number Diff line
@@ -10,6 +10,5 @@ twojmax 6

rfac0 0.99363
rmin0 0
diagonalstyle 3
bzeroflag 0
quadraticflag 0
+0 −1
Original line number Diff line number Diff line
@@ -8,6 +8,5 @@ twojmax 8

rfac0 0.99363
rmin0 0
diagonalstyle 3
bzeroflag 0
quadraticflag 0
+1 −17
Original line number Diff line number Diff line
@@ -85,9 +85,6 @@ void PairSNAPKokkos<DeviceType>::init_style()
  if (force->newton_pair == 0)
    error->all(FLERR,"Pair style SNAP requires newton pair on");

  if (diagonalstyle != 3)
    error->all(FLERR,"Must use diagonal style = 3 with pair snap/kk");

  // irequest = neigh request made by parent class

  neighflag = lmp->kokkos->neighflag;
@@ -343,23 +340,12 @@ void PairSNAPKokkos<DeviceType>::coeff(int narg, char **arg)
  Kokkos::deep_copy(d_coeffelem,h_coeffelem);
  Kokkos::deep_copy(d_map,h_map);

  // deallocate non-kokkos sna

  if (sna) {
    for (int tid = 0; tid<nthreads; tid++)
      delete sna[tid];
    delete [] sna;
    sna = NULL;
  }

  // allocate memory for per OpenMP thread data which
  // is wrapped into the sna class

  snaKK = SNAKokkos<DeviceType>(rfac0,twojmax,
                  diagonalstyle,use_shared_arrays,
                  rmin0,switchflag,bzeroflag);
    //if (!use_shared_arrays)
  snaKK.grow_rij(nmax);
  snaKK.grow_rij(0);
  snaKK.init();
}

@@ -667,8 +653,6 @@ double PairSNAPKokkos<DeviceType>::memory_usage()
  int n = atom->ntypes+1;
  bytes += n*n*sizeof(int);
  bytes += n*n*sizeof(double);
  bytes += 3*nmax*sizeof(double);
  bytes += nmax*sizeof(int);
  bytes += (2*ncoeffall)*sizeof(double);
  bytes += (ncoeff*3)*sizeof(double);
  bytes += snaKK.memory_usage();
Loading