From ea9c1002fed3261274eeac0769b165a2f27fcea2 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 11 Oct 2019 17:51:19 -0600 Subject: [PATCH 001/172] Created placeholders for ComputeGrid and ComputeSNAGrid classes --- src/compute_grid.cpp | 186 ++++++++++++++++++++++++++ src/compute_grid.h | 69 ++++++++++ src/compute_sna_grid.cpp | 277 +++++++++++++++++++++++++++++++++++++++ src/compute_sna_grid.h | 75 +++++++++++ 4 files changed, 607 insertions(+) create mode 100644 src/compute_grid.cpp create mode 100644 src/compute_grid.h create mode 100644 src/compute_sna_grid.cpp create mode 100644 src/compute_sna_grid.h diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp new file mode 100644 index 0000000000..c67d72160b --- /dev/null +++ b/src/compute_grid.cpp @@ -0,0 +1,186 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "compute_grid.h" +#include +#include +#include "atom.h" +#include "update.h" +#include "modify.h" +#include "domain.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +enum{ONCE,NFREQ,EVERY}; + +/* ---------------------------------------------------------------------- */ + +ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : + Compute(lmp, narg, arg), + idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL) +{ + if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command"); + + array_flag = 1; + size_array_cols = 3; + size_array_rows = 0; + size_array_rows_variable = 1; + extarray = 0; + + // ID of compute chunk/atom + + int n = strlen(arg[3]) + 1; + idchunk = new char[n]; + strcpy(idchunk,arg[3]); + + init(); + + // chunk-based data + + nchunk = 1; + maxchunk = 0; + allocate(); + + firstflag = massneed = 1; +} + +/* ---------------------------------------------------------------------- */ + +ComputeGrid::~ComputeGrid() +{ + delete [] idchunk; + memory->destroy(massproc); + memory->destroy(masstotal); + memory->destroy(com); + memory->destroy(comall); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeGrid::init() +{ + int icompute = modify->find_compute(idchunk); + if (icompute < 0) + error->all(FLERR,"Chunk/atom compute does not exist for compute com/chunk"); + cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + if (strcmp(cchunk->style,"chunk/atom") != 0) + error->all(FLERR,"Compute com/chunk does not use chunk/atom compute"); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeGrid::setup() +{ + // one-time calculation of per-chunk mass + // done in setup, so that ComputeChunkAtom::setup() is already called + + if (firstflag && cchunk->idsflag == ONCE) { + compute_array(); + firstflag = massneed = 0; + } +} + +/* ---------------------------------------------------------------------- */ + +void ComputeGrid::compute_array() +{ + int index; + double massone; + double unwrap[3]; + + invoked_array = update->ntimestep; + + // compute chunk/atom assigns atoms to chunk IDs + // extract ichunk index vector from compute + // ichunk = 1 to Nchunk for included atoms, 0 for excluded atoms + + nchunk = cchunk->setup_chunks(); + cchunk->compute_ichunk(); + int *ichunk = cchunk->ichunk; + + if (nchunk > maxchunk) allocate(); + size_array_rows = nchunk; + + // zero local per-chunk values + + for (int i = 0; i < nchunk; i++) + com[i][0] = com[i][1] = com[i][2] = 0.0; + if (massneed) + for (int i = 0; i < nchunk; i++) massproc[i] = 0.0; + + // compute COM for each chunk + + double **x = atom->x; + int *mask = atom->mask; + int *type = atom->type; + imageint *image = atom->image; + double *mass = atom->mass; + double *rmass = atom->rmass; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + index = ichunk[i]-1; + if (index < 0) continue; + if (rmass) massone = rmass[i]; + else massone = mass[type[i]]; + domain->unmap(x[i],image[i],unwrap); + com[index][0] += unwrap[0] * massone; + com[index][1] += unwrap[1] * massone; + com[index][2] += unwrap[2] * massone; + if (massneed) massproc[index] += massone; + } + + MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world); + if (massneed) + MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world); + + for (int i = 0; i < nchunk; i++) { + if (masstotal[i] > 0.0) { + comall[i][0] /= masstotal[i]; + comall[i][1] /= masstotal[i]; + comall[i][2] /= masstotal[i]; + } else comall[i][0] = comall[i][1] = comall[i][2] = 0.0; + } +} + +/* ---------------------------------------------------------------------- + free and reallocate per-chunk arrays +------------------------------------------------------------------------- */ + +void ComputeGrid::allocate() +{ + memory->destroy(massproc); + memory->destroy(masstotal); + memory->destroy(com); + memory->destroy(comall); + maxchunk = nchunk; + memory->create(massproc,maxchunk,"com/chunk:massproc"); + memory->create(masstotal,maxchunk,"com/chunk:masstotal"); + memory->create(com,maxchunk,3,"com/chunk:com"); + memory->create(comall,maxchunk,3,"com/chunk:comall"); + array = comall; +} + +/* ---------------------------------------------------------------------- + memory usage of local data +------------------------------------------------------------------------- */ + +double ComputeGrid::memory_usage() +{ + double bytes = (bigint) maxchunk * 2 * sizeof(double); + bytes += (bigint) maxchunk * 2*3 * sizeof(double); + return bytes; +} diff --git a/src/compute_grid.h b/src/compute_grid.h new file mode 100644 index 0000000000..cece7050de --- /dev/null +++ b/src/compute_grid.h @@ -0,0 +1,69 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS + +ComputeStyle(grid,ComputeGrid) + +#else + +#ifndef LMP_COMPUTE_GRID_H +#define LMP_COMPUTE_GRID_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeGrid : public Compute { + public: + char *idchunk; // fields accessed by other classes + double *masstotal; + + ComputeGrid(class LAMMPS *, int, char **); + ~ComputeGrid(); + void init(); + void setup(); + void compute_array(); + + void lock_enable(); + void lock_disable(); + int lock_length(); + void lock(class Fix *, bigint, bigint); + void unlock(class Fix *); + + double memory_usage(); + + private: + int nchunk,maxchunk; + int firstflag,massneed; + + double *massproc; + double **com,**comall; + + void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +*/ diff --git a/src/compute_sna_grid.cpp b/src/compute_sna_grid.cpp new file mode 100644 index 0000000000..58f7e9fc38 --- /dev/null +++ b/src/compute_sna_grid.cpp @@ -0,0 +1,277 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "compute_sna_grid.h" +#include +#include +#include "sna.h" +#include "atom.h" +#include "update.h" +#include "modify.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "force.h" +#include "pair.h" +#include "comm.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; + +ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : + Compute(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), + radelem(NULL), wjelem(NULL) +{ + double rmin0, rfac0; + int twojmax, switchflag, bzeroflag; + radelem = NULL; + wjelem = NULL; + + int ntypes = atom->ntypes; + int nargmin = 6+2*ntypes; + + if (narg < nargmin) error->all(FLERR,"Illegal compute sna/grid command"); + + // default values + + rmin0 = 0.0; + switchflag = 1; + bzeroflag = 1; + quadraticflag = 0; + + // offset by 1 to match up with types + + memory->create(radelem,ntypes+1,"sna/grid:radelem"); + memory->create(wjelem,ntypes+1,"sna/grid:wjelem"); + + rcutfac = atof(arg[3]); + rfac0 = atof(arg[4]); + twojmax = atoi(arg[5]); + + for(int i = 0; i < ntypes; i++) + radelem[i+1] = atof(arg[6+i]); + for(int i = 0; i < ntypes; i++) + wjelem[i+1] = atof(arg[6+ntypes+i]); + + // construct cutsq + + double cut; + cutmax = 0.0; + memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid:cutsq"); + for(int i = 1; i <= ntypes; i++) { + cut = 2.0*radelem[i]*rcutfac; + if (cut > cutmax) cutmax = cut; + cutsq[i][i] = cut*cut; + for(int j = i+1; j <= ntypes; j++) { + cut = (radelem[i]+radelem[j])*rcutfac; + cutsq[i][j] = cutsq[j][i] = cut*cut; + } + } + + // process optional args + + int iarg = nargmin; + + while (iarg < narg) { + if (strcmp(arg[iarg],"rmin0") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + rmin0 = atof(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"switchflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + switchflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"bzeroflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + bzeroflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"quadraticflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + quadraticflag = atoi(arg[iarg+1]); + iarg += 2; + } else error->all(FLERR,"Illegal compute sna/grid command"); + } + + snaptr = new SNA(lmp,rfac0,twojmax, + rmin0,switchflag,bzeroflag); + + ncoeff = snaptr->ncoeff; + size_peratom_cols = ncoeff; + if (quadraticflag) size_peratom_cols += (ncoeff*(ncoeff+1))/2; + peratom_flag = 1; + + nmax = 0; + sna = NULL; +} + +/* ---------------------------------------------------------------------- */ + +ComputeSNAGrid::~ComputeSNAGrid() +{ + memory->destroy(sna); + memory->destroy(radelem); + memory->destroy(wjelem); + memory->destroy(cutsq); + delete snaptr; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeSNAGrid::init() +{ + if (force->pair == NULL) + error->all(FLERR,"Compute sna/grid requires a pair style be defined"); + + if (cutmax > force->pair->cutforce) + error->all(FLERR,"Compute sna/grid cutoff is longer than pairwise cutoff"); + + // need an occasional full neighbor list + + int irequest = neighbor->request(this,instance_me); + neighbor->requests[irequest]->pair = 0; + neighbor->requests[irequest]->compute = 1; + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + neighbor->requests[irequest]->occasional = 1; + + int count = 0; + for (int i = 0; i < modify->ncompute; i++) + if (strcmp(modify->compute[i]->style,"sna/grid") == 0) count++; + if (count > 1 && comm->me == 0) + error->warning(FLERR,"More than one compute sna/grid"); + snaptr->init(); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeSNAGrid::init_list(int /*id*/, NeighList *ptr) +{ + list = ptr; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeSNAGrid::compute_pergrid() +{ + invoked_peratom = update->ntimestep; + + // grow sna array if necessary + + if (atom->nmax > nmax) { + memory->destroy(sna); + nmax = atom->nmax; + memory->create(sna,nmax,size_peratom_cols,"sna/grid:sna"); + array_atom = sna; + } + + // invoke full neighbor list (will copy or build if necessary) + + neighbor->build_one(list); + + const int inum = list->inum; + const int* const ilist = list->ilist; + const int* const numneigh = list->numneigh; + int** const firstneigh = list->firstneigh; + int * const type = atom->type; + + // compute sna for each atom in group + // use full neighbor list to count atoms less than cutoff + + double** const x = atom->x; + const int* const mask = atom->mask; + + for (int ii = 0; ii < inum; ii++) { + const int i = ilist[ii]; + if (mask[i] & groupbit) { + + const double xtmp = x[i][0]; + const double ytmp = x[i][1]; + const double ztmp = x[i][2]; + const int itype = type[i]; + const double radi = radelem[itype]; + const int* const jlist = firstneigh[i]; + const int jnum = numneigh[i]; + + // insure rij, inside, and typej are of size jnum + + snaptr->grow_rij(jnum); + + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff + + int ninside = 0; + for (int jj = 0; jj < jnum; jj++) { + int j = jlist[jj]; + j &= NEIGHMASK; + + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + if (rsq < cutsq[itype][jtype] && rsq>1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = (radi+radelem[jtype])*rcutfac; + ninside++; + } + } + + snaptr->compute_ui(ninside); + snaptr->compute_zi(); + snaptr->compute_bi(); + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + sna[i][icoeff] = snaptr->blist[icoeff]; + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bi = snaptr->blist[icoeff]; + + // diagonal element of quadratic matrix + + sna[i][ncount++] = 0.5*bi*bi; + + // upper-triangular elements of quadratic matrix + + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + sna[i][ncount++] = bi*snaptr->blist[jcoeff]; + } + } + } else { + for (int icoeff = 0; icoeff < size_peratom_cols; icoeff++) + sna[i][icoeff] = 0.0; + } + } +} + +/* ---------------------------------------------------------------------- + memory usage +------------------------------------------------------------------------- */ + +double ComputeSNAGrid::memory_usage() +{ + double bytes = nmax*size_peratom_cols * sizeof(double); // sna + bytes += snaptr->memory_usage(); // SNA object + + return bytes; +} + diff --git a/src/compute_sna_grid.h b/src/compute_sna_grid.h new file mode 100644 index 0000000000..f85d9679cc --- /dev/null +++ b/src/compute_sna_grid.h @@ -0,0 +1,75 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS + +ComputeStyle(sna/grid,ComputeSNAGrid) + +#else + +#ifndef LMP_COMPUTE_SNA_GRID_H +#define LMP_COMPUTE_SNA_GRID_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeSNAGrid : public Compute { + public: + ComputeSNAGrid(class LAMMPS *, int, char **); + ~ComputeSNAGrid(); + void init(); + void init_list(int, class NeighList *); + void compute_grid(); + double memory_usage(); + + private: + int nmax; + int ncoeff; + double **cutsq; + class NeighList *list; + double **sna; + double rcutfac; + double *radelem; + double *wjelem; + class SNA* snaptr; + double cutmax; + int quadraticflag; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Compute sna/grid requires a pair style be defined + +Self-explanatory. + +E: Compute sna/grid cutoff is longer than pairwise cutoff + +Self-explanatory. + +W: More than one compute sna/grid + +Self-explanatory. + +*/ From 762ecf8f0e5bb8fb146bb7ef42bd80e9a4e7f9e1 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sat, 19 Oct 2019 17:03:19 -0600 Subject: [PATCH 002/172] Completed serial version with PBC, but incorrect --- src/compute_grid.cpp | 255 +++++++++++++++++++++++---------------- src/compute_grid.h | 45 ++++--- src/compute_sna_grid.cpp | 166 +++++++++++++------------ src/compute_sna_grid.h | 8 +- 4 files changed, 266 insertions(+), 208 deletions(-) diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index c67d72160b..d8c7eb3697 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -18,169 +18,218 @@ #include "update.h" #include "modify.h" #include "domain.h" +#include "force.h" #include "memory.h" #include "error.h" using namespace LAMMPS_NS; -enum{ONCE,NFREQ,EVERY}; - /* ---------------------------------------------------------------------- */ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), - idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL) + Compute(lmp, narg, arg) { - if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command"); + if (narg < 6) error->all(FLERR,"Illegal compute grid command"); array_flag = 1; - size_array_cols = 3; + size_array_cols = 0; size_array_rows = 0; - size_array_rows_variable = 1; - extarray = 0; + extarray = 1; - // ID of compute chunk/atom + int iarg0 = 3; + int iarg = iarg0; + if (strcmp(arg[iarg],"grid") == 0) { + if (iarg+4 > narg) error->all(FLERR,"Illegal compute grid command"); + nx = force->inumeric(FLERR,arg[iarg+1]); + ny = force->inumeric(FLERR,arg[iarg+2]); + nz = force->inumeric(FLERR,arg[iarg+3]); + if (nx <= 0 || ny <= 0 || nz <= 0) + error->all(FLERR,"All grid dimensions must be positive"); + iarg += 4; + } else error->all(FLERR,"Illegal compute grid command"); - int n = strlen(arg[3]) + 1; - idchunk = new char[n]; - strcpy(idchunk,arg[3]); + nargbase = iarg - iarg0; - init(); - - // chunk-based data - - nchunk = 1; - maxchunk = 0; - allocate(); - - firstflag = massneed = 1; + size_array_rows = nx*ny*nz; } /* ---------------------------------------------------------------------- */ ComputeGrid::~ComputeGrid() { - delete [] idchunk; - memory->destroy(massproc); - memory->destroy(masstotal); - memory->destroy(com); - memory->destroy(comall); } /* ---------------------------------------------------------------------- */ void ComputeGrid::init() { - int icompute = modify->find_compute(idchunk); - if (icompute < 0) - error->all(FLERR,"Chunk/atom compute does not exist for compute com/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; - if (strcmp(cchunk->style,"chunk/atom") != 0) - error->all(FLERR,"Compute com/chunk does not use chunk/atom compute"); } /* ---------------------------------------------------------------------- */ void ComputeGrid::setup() { - // one-time calculation of per-chunk mass - // done in setup, so that ComputeChunkAtom::setup() is already called + + // calculate grid layout - if (firstflag && cchunk->idsflag == ONCE) { - compute_array(); - firstflag = massneed = 0; + triclinic = domain->triclinic; + + if (triclinic == 0) { + prd = domain->prd; + boxlo = domain->boxlo; + } else { + prd = domain->prd_lamda; + boxlo = domain->boxlo_lamda; } + + double xprd = prd[0]; + double yprd = prd[1]; + double zprd = prd[2]; + + delxinv = nx/xprd; + delyinv = ny/yprd; + delzinv = nz/zprd; + + delx = 1.0/delxinv; + dely = 1.0/delyinv; + delz = 1.0/delzinv; + + // sufficient conditions for stencil bounding rcut + + // require |delz*mz|^2 <= rcut^2 + // require |dely*my|^2 <= rcut^2 + |delyz*mz_max|^2 + // require |delx*mx|^2 <= rcut^2 + |delxz*mz_max|^2 + |delxy*my_max|^2 + + double delxy = domain->xy/ny; + double delxz = domain->xz/nz; + double delyz = domain->yz/nz; + + if (!triclinic) { + mz = cutmax*delzinv + 1; + my = sqrt(cutmax*cutmax + pow(delyz*mz,2))*delyinv + 1; + mx = sqrt(cutmax*cutmax + pow(delxz*mz,2) + + pow(delxy*my,2))*delxinv + 1; + } else { + double delxinvtmp = nx/domain->xprd; + double delyinvtmp = ny/domain->yprd; + double delzinvtmp = nz/domain->zprd; + mz = cutmax*delzinvtmp + 1; + my = sqrt(cutmax*cutmax + pow(delyz*mz,2))*delyinvtmp + 1; + mx = sqrt(cutmax*cutmax + pow(delxz*mz,2) + + pow(delxy*my,2))*delxinvtmp + 1; + } + + printf("mx = %d\n",mx); + printf("my = %d\n",my); + printf("mz = %d\n",mz); + + // size global grid to accomodate periodic interactions + + nxfull = nx + 2*mx; + nyfull = ny + 2*my; + nzfull = nz + 2*mz; + nxyfull = nxfull * nyfull; + + printf("nxfull = %d\n",nxfull); + printf("nyfull = %d\n",nyfull); + printf("nzfull = %d\n",nzfull); + + x0full = boxlo[0] - mx*delx; + y0full = boxlo[1] - my*dely; + z0full = boxlo[2] - mz*delz; + + allocate(); } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + convert grid index to box coords +------------------------------------------------------------------------- */ -void ComputeGrid::compute_array() +void ComputeGrid::igridfull2x(int igrid, double *x) { - int index; - double massone; - double unwrap[3]; + int iz = igrid / nxyfull; + igrid -= iz*nxyfull; + int iy = igrid / nxfull; + igrid -= igrid*nxfull; + int ix = igrid; - invoked_array = update->ntimestep; + x[0] = x0full+ix*delx; + x[1] = y0full+iy*dely; + x[2] = z0full+iz*delz; - // compute chunk/atom assigns atoms to chunk IDs - // extract ichunk index vector from compute - // ichunk = 1 to Nchunk for included atoms, 0 for excluded atoms + if (triclinic) domain->lamda2x(x, x); - nchunk = cchunk->setup_chunks(); - cchunk->compute_ichunk(); - int *ichunk = cchunk->ichunk; +} - if (nchunk > maxchunk) allocate(); - size_array_rows = nchunk; +/* ---------------------------------------------------------------------- + gather global array from full grid +------------------------------------------------------------------------- */ - // zero local per-chunk values +void ComputeGrid::gather_global_array() +{ + int iarray; + memset(&array[0][0],0,size_array_rows*size_array_cols*sizeof(double)); - for (int i = 0; i < nchunk; i++) - com[i][0] = com[i][1] = com[i][2] = 0.0; - if (massneed) - for (int i = 0; i < nchunk; i++) massproc[i] = 0.0; + for (int igrid = 0; igrid < ngridfull; igrid++) { - // compute COM for each chunk + // inefficient, should exploit shared ix structure - double **x = atom->x; - int *mask = atom->mask; - int *type = atom->type; - imageint *image = atom->image; - double *mass = atom->mass; - double *rmass = atom->rmass; - int nlocal = atom->nlocal; - - for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) { - index = ichunk[i]-1; - if (index < 0) continue; - if (rmass) massone = rmass[i]; - else massone = mass[type[i]]; - domain->unmap(x[i],image[i],unwrap); - com[index][0] += unwrap[0] * massone; - com[index][1] += unwrap[1] * massone; - com[index][2] += unwrap[2] * massone; - if (massneed) massproc[index] += massone; - } - - MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world); - if (massneed) - MPI_Allreduce(massproc,masstotal,nchunk,MPI_DOUBLE,MPI_SUM,world); - - for (int i = 0; i < nchunk; i++) { - if (masstotal[i] > 0.0) { - comall[i][0] /= masstotal[i]; - comall[i][1] /= masstotal[i]; - comall[i][2] /= masstotal[i]; - } else comall[i][0] = comall[i][1] = comall[i][2] = 0.0; + iarray = igridfull2iarray(igrid); + for (int icol = 0; icol < size_array_cols; icol++) + array[iarray][icol] += gridfull[igrid][icol]; } } /* ---------------------------------------------------------------------- - free and reallocate per-chunk arrays + convert full grid index to compute array index + inefficient, should exploit shared ix structure +------------------------------------------------------------------------- */ + +int ComputeGrid::igridfull2iarray(int igrid) +{ + int iz = igrid / nxyfull; + igrid -= iz*nxyfull; + int iy = igrid / nxfull; + igrid -= igrid*nxfull; + int ix = igrid; + + ix -= mx; + iy -= my; + iz -= mz; + + while (ix < 0) ix += nx; + while (iy < 0) iy += ny; + while (iz < 0) iz += nz; + + while (ix >= nx) ix -= nx; + while (iy >= ny) iy -= ny; + while (iz >= nz) iz -= nz; + + int iarray = (iz * ny + iy) * nx + ix; + + return iarray; +} + +/* ---------------------------------------------------------------------- + free and reallocate arrays ------------------------------------------------------------------------- */ void ComputeGrid::allocate() { - memory->destroy(massproc); - memory->destroy(masstotal); - memory->destroy(com); - memory->destroy(comall); - maxchunk = nchunk; - memory->create(massproc,maxchunk,"com/chunk:massproc"); - memory->create(masstotal,maxchunk,"com/chunk:masstotal"); - memory->create(com,maxchunk,3,"com/chunk:com"); - memory->create(comall,maxchunk,3,"com/chunk:comall"); - array = comall; -} + ngridfull = nxfull*nyfull*nzfull; + // grow global array if necessary + + memory->destroy(array); + memory->create(array,size_array_rows,size_array_cols,"sna/grid:array"); + memory->create(gridfull,ngridfull,size_array_cols,"sna/grid:gridfull"); +} /* ---------------------------------------------------------------------- memory usage of local data ------------------------------------------------------------------------- */ double ComputeGrid::memory_usage() { - double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - return bytes; + int nbytes = 0; + return nbytes; } diff --git a/src/compute_grid.h b/src/compute_grid.h index cece7050de..61775186ff 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -11,12 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef COMPUTE_CLASS - -ComputeStyle(grid,ComputeGrid) - -#else - #ifndef LMP_COMPUTE_GRID_H #define LMP_COMPUTE_GRID_H @@ -26,36 +20,39 @@ namespace LAMMPS_NS { class ComputeGrid : public Compute { public: - char *idchunk; // fields accessed by other classes - double *masstotal; ComputeGrid(class LAMMPS *, int, char **); - ~ComputeGrid(); + virtual ~ComputeGrid(); void init(); void setup(); - void compute_array(); - - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + virtual void compute_array() = 0; double memory_usage(); + protected: + int nx, ny, nz; // grid dimensions + int nxfull, nyfull, nzfull; // grid dimensions with ghost points + int nxyfull; // nx_full*ny_full + int ngridfull; // number of full grid points + double **gridfull; // full grid points + int mx, my, mz; // cutmax stencil dimensions + int triclinic; // triclinic flag + double *boxlo, *prd; // box info (units real/ortho or reduced/tri) + double delxinv,delyinv,delzinv; // inverse grid spacing + double delx,dely,delz; // grid spacing + double x0full, y0full, z0full; // origin of full grid + int nargbase; // number of base class args + double cutmax; // largest cutoff distance + virtual void allocate(); + void igridfull2x(int, double*); // convert full grid point to coord + void gather_global_array(); // gather global array from full grid + int igridfull2iarray(int); // convert full grid index to compute array index + private: - int nchunk,maxchunk; - int firstflag,massneed; - - double *massproc; - double **com,**comall; - - void allocate(); }; } -#endif #endif /* ERROR/WARNING messages: diff --git a/src/compute_sna_grid.cpp b/src/compute_sna_grid.cpp index 58f7e9fc38..1f998ced9b 100644 --- a/src/compute_sna_grid.cpp +++ b/src/compute_sna_grid.cpp @@ -11,6 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#include "compute_grid.h" #include "compute_sna_grid.h" #include #include @@ -30,7 +31,7 @@ using namespace LAMMPS_NS; ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), + ComputeGrid(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), radelem(NULL), wjelem(NULL) { double rmin0, rfac0; @@ -38,6 +39,13 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : radelem = NULL; wjelem = NULL; + // skip over arguments used by base class + // so that argument positions are identical to + // regular per-atom compute + + arg += nargbase; + narg -= nargbase; + int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -58,6 +66,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : rcutfac = atof(arg[3]); rfac0 = atof(arg[4]); twojmax = atoi(arg[5]); + printf("rcutfac = %g rfac0 = %g twojmax = %d\n",rcutfac, rfac0, twojmax); for(int i = 0; i < ntypes; i++) radelem[i+1] = atof(arg[6+i]); @@ -73,6 +82,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : cut = 2.0*radelem[i]*rcutfac; if (cut > cutmax) cutmax = cut; cutsq[i][i] = cut*cut; + printf("i = %d cutsq[i][i] = %g\n",i,cutsq[i][i]); for(int j = i+1; j <= ntypes; j++) { cut = (radelem[i]+radelem[j])*rcutfac; cutsq[i][j] = cutsq[j][i] = cut*cut; @@ -84,6 +94,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { + printf("iarg = %d arg = %s\n",iarg, arg[iarg]); if (strcmp(arg[iarg],"rmin0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute sna/grid command"); @@ -105,18 +116,19 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : quadraticflag = atoi(arg[iarg+1]); iarg += 2; } else error->all(FLERR,"Illegal compute sna/grid command"); + } + printf("rmin0 = %g, bzeroflag = %d, quadraticflag = %d\n", + rmin0, bzeroflag, quadraticflag); + snaptr = new SNA(lmp,rfac0,twojmax, rmin0,switchflag,bzeroflag); ncoeff = snaptr->ncoeff; - size_peratom_cols = ncoeff; - if (quadraticflag) size_peratom_cols += (ncoeff*(ncoeff+1))/2; - peratom_flag = 1; - - nmax = 0; - sna = NULL; + size_array_cols = ncoeff; + if (quadraticflag) size_array_cols += (ncoeff*(ncoeff+1))/2; + array_flag = 1; } /* ---------------------------------------------------------------------- */ @@ -166,101 +178,101 @@ void ComputeSNAGrid::init_list(int /*id*/, NeighList *ptr) /* ---------------------------------------------------------------------- */ -void ComputeSNAGrid::compute_pergrid() +void ComputeSNAGrid::compute_array() { - invoked_peratom = update->ntimestep; + invoked_array = update->ntimestep; - // grow sna array if necessary +// // invoke full neighbor list (will copy or build if necessary) - if (atom->nmax > nmax) { - memory->destroy(sna); - nmax = atom->nmax; - memory->create(sna,nmax,size_peratom_cols,"sna/grid:sna"); - array_atom = sna; - } +// neighbor->build_one(list); - // invoke full neighbor list (will copy or build if necessary) +// const int inum = list->inum; +// const int* const ilist = list->ilist; +// const int* const numneigh = list->numneigh; +// int** const firstneigh = list->firstneigh; - neighbor->build_one(list); - - const int inum = list->inum; - const int* const ilist = list->ilist; - const int* const numneigh = list->numneigh; - int** const firstneigh = list->firstneigh; int * const type = atom->type; - // compute sna for each atom in group - // use full neighbor list to count atoms less than cutoff + // compute sna for each gridpoint double** const x = atom->x; const int* const mask = atom->mask; + const int ntotal = atom->nlocal + atom->nghost; - for (int ii = 0; ii < inum; ii++) { - const int i = ilist[ii]; - if (mask[i] & groupbit) { + printf("ngridfull = %d\n",ngridfull); + for (int igrid = 0; igrid < ngridfull; igrid++) { + printf("igrid = %d\n",igrid); + double rtmp[3]; + igridfull2x(igrid, rtmp); + const double xtmp = rtmp[0]; + const double ytmp = rtmp[1]; + const double ztmp = rtmp[2]; - const double xtmp = x[i][0]; - const double ytmp = x[i][1]; - const double ztmp = x[i][2]; - const int itype = type[i]; - const double radi = radelem[itype]; - const int* const jlist = firstneigh[i]; - const int jnum = numneigh[i]; + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff - // insure rij, inside, and typej are of size jnum + int ninside = 0; + for (int j = 0; j < ntotal; j++) { - snaptr->grow_rij(jnum); + // check that j is in comute group - // rij[][3] = displacements between atom I and those neighbors - // inside = indices of neighbors of I within cutoff - // typej = types of neighbors of I within cutoff + if (!(mask[j] & groupbit)) continue; - int ninside = 0; - for (int jj = 0; jj < jnum; jj++) { - int j = jlist[jj]; - j &= NEIGHMASK; + // insure rij, inside, and typej are of size jnum - const double delx = xtmp - x[j][0]; - const double dely = ytmp - x[j][1]; - const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; - int jtype = type[j]; - if (rsq < cutsq[itype][jtype] && rsq>1e-20) { - snaptr->rij[ninside][0] = delx; - snaptr->rij[ninside][1] = dely; - snaptr->rij[ninside][2] = delz; - snaptr->inside[ninside] = j; - snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = (radi+radelem[jtype])*rcutfac; - ninside++; - } + snaptr->grow_rij(ninside+1); + + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + if (rsq < cutsq[jtype][jtype] && rsq>1e-20) { + printf("ninside = %d\n",ninside); + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + ninside++; } + } - snaptr->compute_ui(ninside); - snaptr->compute_zi(); - snaptr->compute_bi(); - for (int icoeff = 0; icoeff < ncoeff; icoeff++) - sna[i][icoeff] = snaptr->blist[icoeff]; - if (quadraticflag) { - int ncount = ncoeff; - for (int icoeff = 0; icoeff < ncoeff; icoeff++) { - double bi = snaptr->blist[icoeff]; + snaptr->compute_ui(ninside); + snaptr->compute_zi(); + snaptr->compute_bi(); + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + sna[igrid][icoeff] = snaptr->blist[icoeff]; + printf("igrid = %d B0 = %g\n",igrid,sna[igrid][0]); + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bi = snaptr->blist[icoeff]; - // diagonal element of quadratic matrix + // diagonal element of quadratic matrix - sna[i][ncount++] = 0.5*bi*bi; + sna[igrid][ncount++] = 0.5*bi*bi; - // upper-triangular elements of quadratic matrix + // upper-triangular elements of quadratic matrix - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - sna[i][ncount++] = bi*snaptr->blist[jcoeff]; - } + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + sna[igrid][ncount++] = bi*snaptr->blist[jcoeff]; } - } else { - for (int icoeff = 0; icoeff < size_peratom_cols; icoeff++) - sna[i][icoeff] = 0.0; } } + gather_global_array(); +} + +/* ---------------------------------------------------------------------- + allocate array in base class and then set up pointers +------------------------------------------------------------------------- */ + +void ComputeSNAGrid::allocate() +{ + ComputeGrid::allocate(); + sna = gridfull; } /* ---------------------------------------------------------------------- @@ -269,7 +281,7 @@ void ComputeSNAGrid::compute_pergrid() double ComputeSNAGrid::memory_usage() { - double bytes = nmax*size_peratom_cols * sizeof(double); // sna + double bytes = size_array_rows*size_array_cols * sizeof(double); // grid bytes += snaptr->memory_usage(); // SNA object return bytes; diff --git a/src/compute_sna_grid.h b/src/compute_sna_grid.h index f85d9679cc..2bd18a915e 100644 --- a/src/compute_sna_grid.h +++ b/src/compute_sna_grid.h @@ -20,18 +20,19 @@ ComputeStyle(sna/grid,ComputeSNAGrid) #ifndef LMP_COMPUTE_SNA_GRID_H #define LMP_COMPUTE_SNA_GRID_H -#include "compute.h" +#include "compute_grid.h" namespace LAMMPS_NS { -class ComputeSNAGrid : public Compute { +class ComputeSNAGrid : public ComputeGrid { public: ComputeSNAGrid(class LAMMPS *, int, char **); ~ComputeSNAGrid(); void init(); void init_list(int, class NeighList *); - void compute_grid(); + void compute_array(); double memory_usage(); + void allocate(); private: int nmax; @@ -43,7 +44,6 @@ class ComputeSNAGrid : public Compute { double *radelem; double *wjelem; class SNA* snaptr; - double cutmax; int quadraticflag; }; From 8374280383487f86c1f69f437501e1a77c253e60 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 23 Oct 2019 18:46:28 -0600 Subject: [PATCH 003/172] Got a first pass working for ortho and tri grids --- examples/snap/in.grid | 71 +++++++++++++++++ examples/snap/in.grid.tri | 116 ++++++++++++++++++++++++++++ src/{ => SNAP}/compute_sna_grid.cpp | 0 src/{ => SNAP}/compute_sna_grid.h | 0 src/compute_grid.cpp | 56 ++++++++++---- src/compute_grid.h | 2 + 6 files changed, 231 insertions(+), 14 deletions(-) create mode 100644 examples/snap/in.grid create mode 100644 examples/snap/in.grid.tri rename src/{ => SNAP}/compute_sna_grid.cpp (100%) rename src/{ => SNAP}/compute_sna_grid.h (100%) diff --git a/examples/snap/in.grid b/examples/snap/in.grid new file mode 100644 index 0000000000..bec57dc9ff --- /dev/null +++ b/examples/snap/in.grid @@ -0,0 +1,71 @@ +# Demonstrate bispectrum computes + +# Initialize simulation + +variable nsteps index 0 +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 0 1 0 & + a3 0 0 1 & + basis 0 0 0 & + basis 0.5 0.5 0.5 & +# origin 0.25 0.25 0.25 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +# choose potential + +include Ta06A.snap + +# define grid compute and atom compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 0 + +compute b all sna/atom & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +# define output + +thermo_style custom step temp ke pe vol c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] +thermo_modify norm yes + +dump mydump_b all custom 1000 dump_b id c_b[*] + +# run + +run 0 + diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri new file mode 100644 index 0000000000..c02138f66a --- /dev/null +++ b/examples/snap/in.grid.tri @@ -0,0 +1,116 @@ +# Demonstrate bispectrum computes + +# Initialize simulation + +variable nsteps index 0 +variable nrep index 1 +variable a index 3.316 +variable ngrid index 4 + +variable ngridx equal 3*${ngrid} +variable ngridy equal 2*${ngrid} +variable ngridz equal 1*${ngrid} + +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 1 1 0 & + a3 1 1 1 & + basis 0 0 0 & + basis 0.0 0.0 0.5 & +# origin 0.25 0.25 0.25 + +box tilt large +region box prism 0 ${nx} 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +# choose potential + +include Ta06A.snap + +# define grid compute and atom compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 0 + +compute b all sna/atom & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +# define output + +thermo_style custom step temp ke pe vol & + c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] c_mygrid[9][1] & + c_mygrid[10][1] c_mygrid[11][1] c_mygrid[12][1] c_mygrid[13][1] c_mygrid[14][1] c_mygrid[15][1] c_mygrid[16][1] c_mygrid[17][1] c_mygrid[18][1] c_mygrid[19][1] & + c_mygrid[20][1] c_mygrid[21][1] c_mygrid[22][1] c_mygrid[23][1] c_mygrid[24][1] c_mygrid[25][1] c_mygrid[26][1] c_mygrid[27][1] c_mygrid[28][1] c_mygrid[29][1] & + c_mygrid[30][1] c_mygrid[31][1] c_mygrid[32][1] c_mygrid[33][1] c_mygrid[34][1] c_mygrid[35][1] c_mygrid[36][1] c_mygrid[37][1] c_mygrid[38][1] c_mygrid[39][1] & + c_mygrid[40][1] c_mygrid[41][1] c_mygrid[42][1] c_mygrid[43][1] c_mygrid[44][1] c_mygrid[45][1] c_mygrid[46][1] c_mygrid[47][1] c_mygrid[48][1] c_mygrid[49][1] & + c_mygrid[50][1] c_mygrid[51][1] c_mygrid[52][1] c_mygrid[53][1] c_mygrid[54][1] c_mygrid[55][1] c_mygrid[56][1] c_mygrid[57][1] c_mygrid[58][1] c_mygrid[59][1] & + c_mygrid[60][1] c_mygrid[61][1] c_mygrid[62][1] c_mygrid[63][1] c_mygrid[64][1] c_mygrid[65][1] c_mygrid[66][1] c_mygrid[67][1] c_mygrid[68][1] c_mygrid[69][1] & + c_mygrid[70][1] c_mygrid[71][1] c_mygrid[72][1] c_mygrid[73][1] c_mygrid[74][1] c_mygrid[75][1] c_mygrid[76][1] c_mygrid[77][1] c_mygrid[78][1] c_mygrid[79][1] & + c_mygrid[80][1] c_mygrid[81][1] c_mygrid[82][1] c_mygrid[83][1] c_mygrid[84][1] c_mygrid[85][1] c_mygrid[86][1] c_mygrid[87][1] c_mygrid[88][1] c_mygrid[89][1] & + c_mygrid[90][1] c_mygrid[91][1] c_mygrid[92][1] c_mygrid[93][1] c_mygrid[94][1] c_mygrid[95][1] c_mygrid[96][1] c_mygrid[97][1] c_mygrid[98][1] c_mygrid[99][1] & + c_mygrid[101][1] c_mygrid[102][1] c_mygrid[103][1] c_mygrid[104][1] c_mygrid[105][1] c_mygrid[106][1] c_mygrid[107][1] c_mygrid[108][1] c_mygrid[109][1] & + c_mygrid[110][1] c_mygrid[111][1] c_mygrid[112][1] c_mygrid[113][1] c_mygrid[114][1] c_mygrid[115][1] c_mygrid[116][1] c_mygrid[117][1] c_mygrid[118][1] c_mygrid[119][1] & + c_mygrid[120][1] c_mygrid[121][1] c_mygrid[122][1] c_mygrid[123][1] c_mygrid[124][1] c_mygrid[125][1] c_mygrid[126][1] c_mygrid[127][1] c_mygrid[128][1] c_mygrid[129][1] & + c_mygrid[130][1] c_mygrid[131][1] c_mygrid[132][1] c_mygrid[133][1] c_mygrid[134][1] c_mygrid[135][1] c_mygrid[136][1] c_mygrid[137][1] c_mygrid[138][1] c_mygrid[139][1] & + c_mygrid[140][1] c_mygrid[141][1] c_mygrid[142][1] c_mygrid[143][1] c_mygrid[144][1] c_mygrid[145][1] c_mygrid[146][1] c_mygrid[147][1] c_mygrid[148][1] c_mygrid[149][1] & + c_mygrid[150][1] c_mygrid[151][1] c_mygrid[152][1] c_mygrid[153][1] c_mygrid[154][1] c_mygrid[155][1] c_mygrid[156][1] c_mygrid[157][1] c_mygrid[158][1] c_mygrid[159][1] & + c_mygrid[160][1] c_mygrid[161][1] c_mygrid[162][1] c_mygrid[163][1] c_mygrid[164][1] c_mygrid[165][1] c_mygrid[166][1] c_mygrid[167][1] c_mygrid[168][1] c_mygrid[169][1] & + c_mygrid[170][1] c_mygrid[171][1] c_mygrid[172][1] c_mygrid[173][1] c_mygrid[174][1] c_mygrid[175][1] c_mygrid[176][1] c_mygrid[177][1] c_mygrid[178][1] c_mygrid[179][1] & + c_mygrid[180][1] c_mygrid[181][1] c_mygrid[182][1] c_mygrid[183][1] c_mygrid[184][1] c_mygrid[185][1] c_mygrid[186][1] c_mygrid[187][1] c_mygrid[188][1] c_mygrid[189][1] & + c_mygrid[190][1] c_mygrid[191][1] c_mygrid[192][1] c_mygrid[193][1] c_mygrid[194][1] c_mygrid[195][1] c_mygrid[196][1] c_mygrid[197][1] c_mygrid[198][1] c_mygrid[199][1] & + c_mygrid[201][1] c_mygrid[202][1] c_mygrid[203][1] c_mygrid[204][1] c_mygrid[205][1] c_mygrid[206][1] c_mygrid[207][1] c_mygrid[208][1] c_mygrid[209][1] & + c_mygrid[210][1] c_mygrid[211][1] c_mygrid[212][1] c_mygrid[213][1] c_mygrid[214][1] c_mygrid[215][1] c_mygrid[216][1] c_mygrid[217][1] c_mygrid[218][1] c_mygrid[219][1] & + c_mygrid[220][1] c_mygrid[221][1] c_mygrid[222][1] c_mygrid[223][1] c_mygrid[224][1] c_mygrid[225][1] c_mygrid[226][1] c_mygrid[227][1] c_mygrid[228][1] c_mygrid[229][1] & + c_mygrid[230][1] c_mygrid[231][1] c_mygrid[232][1] c_mygrid[233][1] c_mygrid[234][1] c_mygrid[235][1] c_mygrid[236][1] c_mygrid[237][1] c_mygrid[238][1] c_mygrid[239][1] & + c_mygrid[240][1] c_mygrid[241][1] c_mygrid[242][1] c_mygrid[243][1] c_mygrid[244][1] c_mygrid[245][1] c_mygrid[246][1] c_mygrid[247][1] c_mygrid[248][1] c_mygrid[249][1] & + c_mygrid[250][1] c_mygrid[251][1] c_mygrid[252][1] c_mygrid[253][1] c_mygrid[254][1] c_mygrid[255][1] c_mygrid[256][1] c_mygrid[257][1] c_mygrid[258][1] c_mygrid[259][1] & + c_mygrid[260][1] c_mygrid[261][1] c_mygrid[262][1] c_mygrid[263][1] c_mygrid[264][1] c_mygrid[265][1] c_mygrid[266][1] c_mygrid[267][1] c_mygrid[268][1] c_mygrid[269][1] & + c_mygrid[270][1] c_mygrid[271][1] c_mygrid[272][1] c_mygrid[273][1] c_mygrid[274][1] c_mygrid[275][1] c_mygrid[276][1] c_mygrid[277][1] c_mygrid[278][1] c_mygrid[279][1] & + c_mygrid[280][1] c_mygrid[281][1] c_mygrid[282][1] c_mygrid[283][1] c_mygrid[284][1] c_mygrid[285][1] c_mygrid[286][1] c_mygrid[287][1] c_mygrid[288][1] c_mygrid[289][1] & + c_mygrid[290][1] c_mygrid[291][1] c_mygrid[292][1] c_mygrid[293][1] c_mygrid[294][1] c_mygrid[295][1] c_mygrid[296][1] c_mygrid[297][1] c_mygrid[298][1] c_mygrid[299][1] & + c_mygrid[301][1] c_mygrid[302][1] c_mygrid[303][1] c_mygrid[304][1] c_mygrid[305][1] c_mygrid[306][1] c_mygrid[307][1] c_mygrid[308][1] c_mygrid[309][1] & + c_mygrid[310][1] c_mygrid[311][1] c_mygrid[312][1] c_mygrid[313][1] c_mygrid[314][1] c_mygrid[315][1] c_mygrid[316][1] c_mygrid[317][1] c_mygrid[318][1] c_mygrid[319][1] & + c_mygrid[320][1] c_mygrid[321][1] c_mygrid[322][1] c_mygrid[323][1] c_mygrid[324][1] c_mygrid[325][1] c_mygrid[326][1] c_mygrid[327][1] c_mygrid[328][1] c_mygrid[329][1] & + c_mygrid[330][1] c_mygrid[331][1] c_mygrid[332][1] c_mygrid[333][1] c_mygrid[334][1] c_mygrid[335][1] c_mygrid[336][1] c_mygrid[337][1] c_mygrid[338][1] c_mygrid[339][1] & + c_mygrid[340][1] c_mygrid[341][1] c_mygrid[342][1] c_mygrid[343][1] c_mygrid[344][1] c_mygrid[345][1] c_mygrid[346][1] c_mygrid[347][1] c_mygrid[348][1] c_mygrid[349][1] & + c_mygrid[350][1] c_mygrid[351][1] c_mygrid[352][1] c_mygrid[353][1] c_mygrid[354][1] c_mygrid[355][1] c_mygrid[356][1] c_mygrid[357][1] c_mygrid[358][1] c_mygrid[359][1] & + c_mygrid[360][1] c_mygrid[361][1] c_mygrid[362][1] c_mygrid[363][1] c_mygrid[364][1] c_mygrid[365][1] c_mygrid[366][1] c_mygrid[367][1] c_mygrid[368][1] c_mygrid[369][1] & + c_mygrid[370][1] c_mygrid[371][1] c_mygrid[372][1] c_mygrid[373][1] c_mygrid[374][1] c_mygrid[375][1] c_mygrid[376][1] c_mygrid[377][1] c_mygrid[378][1] c_mygrid[379][1] & + c_mygrid[380][1] c_mygrid[381][1] c_mygrid[382][1] c_mygrid[383][1] c_mygrid[384][1] + +thermo_modify norm yes + +dump mydump_b all custom 1000 dump_b id c_b[*] + +# run + +run 0 + diff --git a/src/compute_sna_grid.cpp b/src/SNAP/compute_sna_grid.cpp similarity index 100% rename from src/compute_sna_grid.cpp rename to src/SNAP/compute_sna_grid.cpp diff --git a/src/compute_sna_grid.h b/src/SNAP/compute_sna_grid.h similarity index 100% rename from src/compute_sna_grid.h rename to src/SNAP/compute_sna_grid.h diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index d8c7eb3697..ec969fd01f 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -34,7 +34,7 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : array_flag = 1; size_array_cols = 0; size_array_rows = 0; - extarray = 1; + extarray = 0; int iarg0 = 3; int iarg = iarg0; @@ -119,10 +119,6 @@ void ComputeGrid::setup() + pow(delxy*my,2))*delxinvtmp + 1; } - printf("mx = %d\n",mx); - printf("my = %d\n",my); - printf("mz = %d\n",mz); - // size global grid to accomodate periodic interactions nxfull = nx + 2*mx; @@ -130,10 +126,6 @@ void ComputeGrid::setup() nzfull = nz + 2*mz; nxyfull = nxfull * nyfull; - printf("nxfull = %d\n",nxfull); - printf("nyfull = %d\n",nyfull); - printf("nzfull = %d\n",nzfull); - x0full = boxlo[0] - mx*delx; y0full = boxlo[1] - my*dely; z0full = boxlo[2] - mz*delz; @@ -148,9 +140,9 @@ void ComputeGrid::setup() void ComputeGrid::igridfull2x(int igrid, double *x) { int iz = igrid / nxyfull; - igrid -= iz*nxyfull; + igrid -= iz * nxyfull; int iy = igrid / nxfull; - igrid -= igrid*nxfull; + igrid -= iy * nxfull; int ix = igrid; x[0] = x0full+ix*delx; @@ -161,14 +153,28 @@ void ComputeGrid::igridfull2x(int igrid, double *x) } +/* ---------------------------------------------------------------------- + copy local grid to global array +------------------------------------------------------------------------- */ + +void ComputeGrid::copy_local_grid() +{ + int igridfull; + for (int iarray = 0; iarray < size_array_rows; iarray++) { + igridfull = iarray2igridfull(iarray); + for (int icol = 0; icol < size_array_cols; icol++) + array[iarray][icol] = gridfull[igridfull][icol]; + } +} + /* ---------------------------------------------------------------------- gather global array from full grid ------------------------------------------------------------------------- */ void ComputeGrid::gather_global_array() { - int iarray; - memset(&array[0][0],0,size_array_rows*size_array_cols*sizeof(double)); + int iarray; + memset(&array[0][0],0,size_array_rows*size_array_cols*sizeof(double)); for (int igrid = 0; igrid < ngridfull; igrid++) { @@ -190,7 +196,7 @@ int ComputeGrid::igridfull2iarray(int igrid) int iz = igrid / nxyfull; igrid -= iz*nxyfull; int iy = igrid / nxfull; - igrid -= igrid*nxfull; + igrid -= iy*nxfull; int ix = igrid; ix -= mx; @@ -210,6 +216,28 @@ int ComputeGrid::igridfull2iarray(int igrid) return iarray; } +/* ---------------------------------------------------------------------- + convert compute array index to full grid index + inefficient, should exploit shared ix structure +------------------------------------------------------------------------- */ + +int ComputeGrid::iarray2igridfull(int iarray) +{ + int iz = iarray / (nx*ny); + iarray -= iz*(nx*ny); + int iy = iarray / nx; + iarray -= iy*nx; + int ix = iarray; + + ix += mx; + iy += my; + iz += mz; + + int igrid = (iz * nyfull + iy) * nxfull + ix; + + return igrid; +} + /* ---------------------------------------------------------------------- free and reallocate arrays ------------------------------------------------------------------------- */ diff --git a/src/compute_grid.h b/src/compute_grid.h index 61775186ff..bc757c37bc 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -46,7 +46,9 @@ class ComputeGrid : public Compute { virtual void allocate(); void igridfull2x(int, double*); // convert full grid point to coord void gather_global_array(); // gather global array from full grid + void copy_local_grid(); // copy local grid to global array int igridfull2iarray(int); // convert full grid index to compute array index + int iarray2igridfull(int); // convert compute array index to full grid index private: }; From 0fc325c98b2b4ffd8fb24cd53ce732221add6ac0 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 23 Oct 2019 18:56:21 -0600 Subject: [PATCH 004/172] Got a first pass working for ortho and tri grids --- src/SNAP/compute_sna_grid.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/SNAP/compute_sna_grid.cpp b/src/SNAP/compute_sna_grid.cpp index 1f998ced9b..26bd272d9f 100644 --- a/src/SNAP/compute_sna_grid.cpp +++ b/src/SNAP/compute_sna_grid.cpp @@ -66,7 +66,6 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : rcutfac = atof(arg[3]); rfac0 = atof(arg[4]); twojmax = atoi(arg[5]); - printf("rcutfac = %g rfac0 = %g twojmax = %d\n",rcutfac, rfac0, twojmax); for(int i = 0; i < ntypes; i++) radelem[i+1] = atof(arg[6+i]); @@ -82,7 +81,6 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : cut = 2.0*radelem[i]*rcutfac; if (cut > cutmax) cutmax = cut; cutsq[i][i] = cut*cut; - printf("i = %d cutsq[i][i] = %g\n",i,cutsq[i][i]); for(int j = i+1; j <= ntypes; j++) { cut = (radelem[i]+radelem[j])*rcutfac; cutsq[i][j] = cutsq[j][i] = cut*cut; @@ -94,7 +92,6 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - printf("iarg = %d arg = %s\n",iarg, arg[iarg]); if (strcmp(arg[iarg],"rmin0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute sna/grid command"); @@ -119,9 +116,6 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } - printf("rmin0 = %g, bzeroflag = %d, quadraticflag = %d\n", - rmin0, bzeroflag, quadraticflag); - snaptr = new SNA(lmp,rfac0,twojmax, rmin0,switchflag,bzeroflag); @@ -199,9 +193,12 @@ void ComputeSNAGrid::compute_array() const int* const mask = atom->mask; const int ntotal = atom->nlocal + atom->nghost; + // insure rij, inside, and typej are of size jnum + + snaptr->grow_rij(ntotal); + printf("ngridfull = %d\n",ngridfull); for (int igrid = 0; igrid < ngridfull; igrid++) { - printf("igrid = %d\n",igrid); double rtmp[3]; igridfull2x(igrid, rtmp); const double xtmp = rtmp[0]; @@ -215,21 +212,17 @@ void ComputeSNAGrid::compute_array() int ninside = 0; for (int j = 0; j < ntotal; j++) { - // check that j is in comute group + // check that j is in compute group if (!(mask[j] & groupbit)) continue; - // insure rij, inside, and typej are of size jnum - - snaptr->grow_rij(ninside+1); - const double delx = xtmp - x[j][0]; const double dely = ytmp - x[j][1]; const double delz = ztmp - x[j][2]; const double rsq = delx*delx + dely*dely + delz*delz; int jtype = type[j]; if (rsq < cutsq[jtype][jtype] && rsq>1e-20) { - printf("ninside = %d\n",ninside); + // printf("ninside = %d\n",ninside); snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; snaptr->rij[ninside][2] = delz; @@ -245,7 +238,7 @@ void ComputeSNAGrid::compute_array() snaptr->compute_bi(); for (int icoeff = 0; icoeff < ncoeff; icoeff++) sna[igrid][icoeff] = snaptr->blist[icoeff]; - printf("igrid = %d B0 = %g\n",igrid,sna[igrid][0]); + // printf("igrid = %d %g %g %g %d B0 = %g\n",igrid,xtmp,ytmp,ztmp,ninside,sna[igrid][0]); if (quadraticflag) { int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { @@ -262,7 +255,8 @@ void ComputeSNAGrid::compute_array() } } } - gather_global_array(); + // gather_global_array(); + copy_local_grid(); } /* ---------------------------------------------------------------------- From 5956908cfd2bbd097be8126cc4f062d5cc9cc519 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 23 Oct 2019 21:51:36 -0600 Subject: [PATCH 005/172] Added cols for coords --- examples/snap/in.grid | 6 ++- examples/snap/in.grid.tri | 78 +++++++++++++++++------------------ src/SNAP/compute_sna_grid.cpp | 6 +-- src/compute_grid.cpp | 41 +++++++++++++++++- src/compute_grid.h | 5 ++- 5 files changed, 90 insertions(+), 46 deletions(-) diff --git a/examples/snap/in.grid b/examples/snap/in.grid index bec57dc9ff..5293558fab 100644 --- a/examples/snap/in.grid +++ b/examples/snap/in.grid @@ -60,7 +60,11 @@ compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & # define output -thermo_style custom step temp ke pe vol c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] +thermo_style custom step temp ke pe vol & + c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] & + c_mygrid[1][2] c_mygrid[2][2] c_mygrid[3][2] c_mygrid[4][2] c_mygrid[5][2] c_mygrid[6][2] c_mygrid[7][2] c_mygrid[8][2] & + c_mygrid[1][3] c_mygrid[2][3] c_mygrid[3][3] c_mygrid[4][3] c_mygrid[5][3] c_mygrid[6][3] c_mygrid[7][3] c_mygrid[8][3] & + c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] thermo_modify norm yes dump mydump_b all custom 1000 dump_b id c_b[*] diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index c02138f66a..3c471d9b66 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -66,45 +66,45 @@ compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} & # define output thermo_style custom step temp ke pe vol & - c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] c_mygrid[9][1] & - c_mygrid[10][1] c_mygrid[11][1] c_mygrid[12][1] c_mygrid[13][1] c_mygrid[14][1] c_mygrid[15][1] c_mygrid[16][1] c_mygrid[17][1] c_mygrid[18][1] c_mygrid[19][1] & - c_mygrid[20][1] c_mygrid[21][1] c_mygrid[22][1] c_mygrid[23][1] c_mygrid[24][1] c_mygrid[25][1] c_mygrid[26][1] c_mygrid[27][1] c_mygrid[28][1] c_mygrid[29][1] & - c_mygrid[30][1] c_mygrid[31][1] c_mygrid[32][1] c_mygrid[33][1] c_mygrid[34][1] c_mygrid[35][1] c_mygrid[36][1] c_mygrid[37][1] c_mygrid[38][1] c_mygrid[39][1] & - c_mygrid[40][1] c_mygrid[41][1] c_mygrid[42][1] c_mygrid[43][1] c_mygrid[44][1] c_mygrid[45][1] c_mygrid[46][1] c_mygrid[47][1] c_mygrid[48][1] c_mygrid[49][1] & - c_mygrid[50][1] c_mygrid[51][1] c_mygrid[52][1] c_mygrid[53][1] c_mygrid[54][1] c_mygrid[55][1] c_mygrid[56][1] c_mygrid[57][1] c_mygrid[58][1] c_mygrid[59][1] & - c_mygrid[60][1] c_mygrid[61][1] c_mygrid[62][1] c_mygrid[63][1] c_mygrid[64][1] c_mygrid[65][1] c_mygrid[66][1] c_mygrid[67][1] c_mygrid[68][1] c_mygrid[69][1] & - c_mygrid[70][1] c_mygrid[71][1] c_mygrid[72][1] c_mygrid[73][1] c_mygrid[74][1] c_mygrid[75][1] c_mygrid[76][1] c_mygrid[77][1] c_mygrid[78][1] c_mygrid[79][1] & - c_mygrid[80][1] c_mygrid[81][1] c_mygrid[82][1] c_mygrid[83][1] c_mygrid[84][1] c_mygrid[85][1] c_mygrid[86][1] c_mygrid[87][1] c_mygrid[88][1] c_mygrid[89][1] & - c_mygrid[90][1] c_mygrid[91][1] c_mygrid[92][1] c_mygrid[93][1] c_mygrid[94][1] c_mygrid[95][1] c_mygrid[96][1] c_mygrid[97][1] c_mygrid[98][1] c_mygrid[99][1] & - c_mygrid[101][1] c_mygrid[102][1] c_mygrid[103][1] c_mygrid[104][1] c_mygrid[105][1] c_mygrid[106][1] c_mygrid[107][1] c_mygrid[108][1] c_mygrid[109][1] & - c_mygrid[110][1] c_mygrid[111][1] c_mygrid[112][1] c_mygrid[113][1] c_mygrid[114][1] c_mygrid[115][1] c_mygrid[116][1] c_mygrid[117][1] c_mygrid[118][1] c_mygrid[119][1] & - c_mygrid[120][1] c_mygrid[121][1] c_mygrid[122][1] c_mygrid[123][1] c_mygrid[124][1] c_mygrid[125][1] c_mygrid[126][1] c_mygrid[127][1] c_mygrid[128][1] c_mygrid[129][1] & - c_mygrid[130][1] c_mygrid[131][1] c_mygrid[132][1] c_mygrid[133][1] c_mygrid[134][1] c_mygrid[135][1] c_mygrid[136][1] c_mygrid[137][1] c_mygrid[138][1] c_mygrid[139][1] & - c_mygrid[140][1] c_mygrid[141][1] c_mygrid[142][1] c_mygrid[143][1] c_mygrid[144][1] c_mygrid[145][1] c_mygrid[146][1] c_mygrid[147][1] c_mygrid[148][1] c_mygrid[149][1] & - c_mygrid[150][1] c_mygrid[151][1] c_mygrid[152][1] c_mygrid[153][1] c_mygrid[154][1] c_mygrid[155][1] c_mygrid[156][1] c_mygrid[157][1] c_mygrid[158][1] c_mygrid[159][1] & - c_mygrid[160][1] c_mygrid[161][1] c_mygrid[162][1] c_mygrid[163][1] c_mygrid[164][1] c_mygrid[165][1] c_mygrid[166][1] c_mygrid[167][1] c_mygrid[168][1] c_mygrid[169][1] & - c_mygrid[170][1] c_mygrid[171][1] c_mygrid[172][1] c_mygrid[173][1] c_mygrid[174][1] c_mygrid[175][1] c_mygrid[176][1] c_mygrid[177][1] c_mygrid[178][1] c_mygrid[179][1] & - c_mygrid[180][1] c_mygrid[181][1] c_mygrid[182][1] c_mygrid[183][1] c_mygrid[184][1] c_mygrid[185][1] c_mygrid[186][1] c_mygrid[187][1] c_mygrid[188][1] c_mygrid[189][1] & - c_mygrid[190][1] c_mygrid[191][1] c_mygrid[192][1] c_mygrid[193][1] c_mygrid[194][1] c_mygrid[195][1] c_mygrid[196][1] c_mygrid[197][1] c_mygrid[198][1] c_mygrid[199][1] & - c_mygrid[201][1] c_mygrid[202][1] c_mygrid[203][1] c_mygrid[204][1] c_mygrid[205][1] c_mygrid[206][1] c_mygrid[207][1] c_mygrid[208][1] c_mygrid[209][1] & - c_mygrid[210][1] c_mygrid[211][1] c_mygrid[212][1] c_mygrid[213][1] c_mygrid[214][1] c_mygrid[215][1] c_mygrid[216][1] c_mygrid[217][1] c_mygrid[218][1] c_mygrid[219][1] & - c_mygrid[220][1] c_mygrid[221][1] c_mygrid[222][1] c_mygrid[223][1] c_mygrid[224][1] c_mygrid[225][1] c_mygrid[226][1] c_mygrid[227][1] c_mygrid[228][1] c_mygrid[229][1] & - c_mygrid[230][1] c_mygrid[231][1] c_mygrid[232][1] c_mygrid[233][1] c_mygrid[234][1] c_mygrid[235][1] c_mygrid[236][1] c_mygrid[237][1] c_mygrid[238][1] c_mygrid[239][1] & - c_mygrid[240][1] c_mygrid[241][1] c_mygrid[242][1] c_mygrid[243][1] c_mygrid[244][1] c_mygrid[245][1] c_mygrid[246][1] c_mygrid[247][1] c_mygrid[248][1] c_mygrid[249][1] & - c_mygrid[250][1] c_mygrid[251][1] c_mygrid[252][1] c_mygrid[253][1] c_mygrid[254][1] c_mygrid[255][1] c_mygrid[256][1] c_mygrid[257][1] c_mygrid[258][1] c_mygrid[259][1] & - c_mygrid[260][1] c_mygrid[261][1] c_mygrid[262][1] c_mygrid[263][1] c_mygrid[264][1] c_mygrid[265][1] c_mygrid[266][1] c_mygrid[267][1] c_mygrid[268][1] c_mygrid[269][1] & - c_mygrid[270][1] c_mygrid[271][1] c_mygrid[272][1] c_mygrid[273][1] c_mygrid[274][1] c_mygrid[275][1] c_mygrid[276][1] c_mygrid[277][1] c_mygrid[278][1] c_mygrid[279][1] & - c_mygrid[280][1] c_mygrid[281][1] c_mygrid[282][1] c_mygrid[283][1] c_mygrid[284][1] c_mygrid[285][1] c_mygrid[286][1] c_mygrid[287][1] c_mygrid[288][1] c_mygrid[289][1] & - c_mygrid[290][1] c_mygrid[291][1] c_mygrid[292][1] c_mygrid[293][1] c_mygrid[294][1] c_mygrid[295][1] c_mygrid[296][1] c_mygrid[297][1] c_mygrid[298][1] c_mygrid[299][1] & - c_mygrid[301][1] c_mygrid[302][1] c_mygrid[303][1] c_mygrid[304][1] c_mygrid[305][1] c_mygrid[306][1] c_mygrid[307][1] c_mygrid[308][1] c_mygrid[309][1] & - c_mygrid[310][1] c_mygrid[311][1] c_mygrid[312][1] c_mygrid[313][1] c_mygrid[314][1] c_mygrid[315][1] c_mygrid[316][1] c_mygrid[317][1] c_mygrid[318][1] c_mygrid[319][1] & - c_mygrid[320][1] c_mygrid[321][1] c_mygrid[322][1] c_mygrid[323][1] c_mygrid[324][1] c_mygrid[325][1] c_mygrid[326][1] c_mygrid[327][1] c_mygrid[328][1] c_mygrid[329][1] & - c_mygrid[330][1] c_mygrid[331][1] c_mygrid[332][1] c_mygrid[333][1] c_mygrid[334][1] c_mygrid[335][1] c_mygrid[336][1] c_mygrid[337][1] c_mygrid[338][1] c_mygrid[339][1] & - c_mygrid[340][1] c_mygrid[341][1] c_mygrid[342][1] c_mygrid[343][1] c_mygrid[344][1] c_mygrid[345][1] c_mygrid[346][1] c_mygrid[347][1] c_mygrid[348][1] c_mygrid[349][1] & - c_mygrid[350][1] c_mygrid[351][1] c_mygrid[352][1] c_mygrid[353][1] c_mygrid[354][1] c_mygrid[355][1] c_mygrid[356][1] c_mygrid[357][1] c_mygrid[358][1] c_mygrid[359][1] & - c_mygrid[360][1] c_mygrid[361][1] c_mygrid[362][1] c_mygrid[363][1] c_mygrid[364][1] c_mygrid[365][1] c_mygrid[366][1] c_mygrid[367][1] c_mygrid[368][1] c_mygrid[369][1] & - c_mygrid[370][1] c_mygrid[371][1] c_mygrid[372][1] c_mygrid[373][1] c_mygrid[374][1] c_mygrid[375][1] c_mygrid[376][1] c_mygrid[377][1] c_mygrid[378][1] c_mygrid[379][1] & - c_mygrid[380][1] c_mygrid[381][1] c_mygrid[382][1] c_mygrid[383][1] c_mygrid[384][1] + c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] c_mygrid[9][4] & + c_mygrid[10][4] c_mygrid[11][4] c_mygrid[12][4] c_mygrid[13][4] c_mygrid[14][4] c_mygrid[15][4] c_mygrid[16][4] c_mygrid[17][4] c_mygrid[18][4] c_mygrid[19][4] & + c_mygrid[20][4] c_mygrid[21][4] c_mygrid[22][4] c_mygrid[23][4] c_mygrid[24][4] c_mygrid[25][4] c_mygrid[26][4] c_mygrid[27][4] c_mygrid[28][4] c_mygrid[29][4] & + c_mygrid[30][4] c_mygrid[31][4] c_mygrid[32][4] c_mygrid[33][4] c_mygrid[34][4] c_mygrid[35][4] c_mygrid[36][4] c_mygrid[37][4] c_mygrid[38][4] c_mygrid[39][4] & + c_mygrid[40][4] c_mygrid[41][4] c_mygrid[42][4] c_mygrid[43][4] c_mygrid[44][4] c_mygrid[45][4] c_mygrid[46][4] c_mygrid[47][4] c_mygrid[48][4] c_mygrid[49][4] & + c_mygrid[50][4] c_mygrid[51][4] c_mygrid[52][4] c_mygrid[53][4] c_mygrid[54][4] c_mygrid[55][4] c_mygrid[56][4] c_mygrid[57][4] c_mygrid[58][4] c_mygrid[59][4] & + c_mygrid[60][4] c_mygrid[61][4] c_mygrid[62][4] c_mygrid[63][4] c_mygrid[64][4] c_mygrid[65][4] c_mygrid[66][4] c_mygrid[67][4] c_mygrid[68][4] c_mygrid[69][4] & + c_mygrid[70][4] c_mygrid[71][4] c_mygrid[72][4] c_mygrid[73][4] c_mygrid[74][4] c_mygrid[75][4] c_mygrid[76][4] c_mygrid[77][4] c_mygrid[78][4] c_mygrid[79][4] & + c_mygrid[80][4] c_mygrid[81][4] c_mygrid[82][4] c_mygrid[83][4] c_mygrid[84][4] c_mygrid[85][4] c_mygrid[86][4] c_mygrid[87][4] c_mygrid[88][4] c_mygrid[89][4] & + c_mygrid[90][4] c_mygrid[91][4] c_mygrid[92][4] c_mygrid[93][4] c_mygrid[94][4] c_mygrid[95][4] c_mygrid[96][4] c_mygrid[97][4] c_mygrid[98][4] c_mygrid[99][4] & + c_mygrid[101][4] c_mygrid[102][4] c_mygrid[103][4] c_mygrid[104][4] c_mygrid[105][4] c_mygrid[106][4] c_mygrid[107][4] c_mygrid[108][4] c_mygrid[109][4] & + c_mygrid[110][4] c_mygrid[111][4] c_mygrid[112][4] c_mygrid[113][4] c_mygrid[114][4] c_mygrid[115][4] c_mygrid[116][4] c_mygrid[117][4] c_mygrid[118][4] c_mygrid[119][4] & + c_mygrid[120][4] c_mygrid[121][4] c_mygrid[122][4] c_mygrid[123][4] c_mygrid[124][4] c_mygrid[125][4] c_mygrid[126][4] c_mygrid[127][4] c_mygrid[128][4] c_mygrid[129][4] & + c_mygrid[130][4] c_mygrid[131][4] c_mygrid[132][4] c_mygrid[133][4] c_mygrid[134][4] c_mygrid[135][4] c_mygrid[136][4] c_mygrid[137][4] c_mygrid[138][4] c_mygrid[139][4] & + c_mygrid[140][4] c_mygrid[141][4] c_mygrid[142][4] c_mygrid[143][4] c_mygrid[144][4] c_mygrid[145][4] c_mygrid[146][4] c_mygrid[147][4] c_mygrid[148][4] c_mygrid[149][4] & + c_mygrid[150][4] c_mygrid[151][4] c_mygrid[152][4] c_mygrid[153][4] c_mygrid[154][4] c_mygrid[155][4] c_mygrid[156][4] c_mygrid[157][4] c_mygrid[158][4] c_mygrid[159][4] & + c_mygrid[160][4] c_mygrid[161][4] c_mygrid[162][4] c_mygrid[163][4] c_mygrid[164][4] c_mygrid[165][4] c_mygrid[166][4] c_mygrid[167][4] c_mygrid[168][4] c_mygrid[169][4] & + c_mygrid[170][4] c_mygrid[171][4] c_mygrid[172][4] c_mygrid[173][4] c_mygrid[174][4] c_mygrid[175][4] c_mygrid[176][4] c_mygrid[177][4] c_mygrid[178][4] c_mygrid[179][4] & + c_mygrid[180][4] c_mygrid[181][4] c_mygrid[182][4] c_mygrid[183][4] c_mygrid[184][4] c_mygrid[185][4] c_mygrid[186][4] c_mygrid[187][4] c_mygrid[188][4] c_mygrid[189][4] & + c_mygrid[190][4] c_mygrid[191][4] c_mygrid[192][4] c_mygrid[193][4] c_mygrid[194][4] c_mygrid[195][4] c_mygrid[196][4] c_mygrid[197][4] c_mygrid[198][4] c_mygrid[199][4] & + c_mygrid[201][4] c_mygrid[202][4] c_mygrid[203][4] c_mygrid[204][4] c_mygrid[205][4] c_mygrid[206][4] c_mygrid[207][4] c_mygrid[208][4] c_mygrid[209][4] & + c_mygrid[210][4] c_mygrid[211][4] c_mygrid[212][4] c_mygrid[213][4] c_mygrid[214][4] c_mygrid[215][4] c_mygrid[216][4] c_mygrid[217][4] c_mygrid[218][4] c_mygrid[219][4] & + c_mygrid[220][4] c_mygrid[221][4] c_mygrid[222][4] c_mygrid[223][4] c_mygrid[224][4] c_mygrid[225][4] c_mygrid[226][4] c_mygrid[227][4] c_mygrid[228][4] c_mygrid[229][4] & + c_mygrid[230][4] c_mygrid[231][4] c_mygrid[232][4] c_mygrid[233][4] c_mygrid[234][4] c_mygrid[235][4] c_mygrid[236][4] c_mygrid[237][4] c_mygrid[238][4] c_mygrid[239][4] & + c_mygrid[240][4] c_mygrid[241][4] c_mygrid[242][4] c_mygrid[243][4] c_mygrid[244][4] c_mygrid[245][4] c_mygrid[246][4] c_mygrid[247][4] c_mygrid[248][4] c_mygrid[249][4] & + c_mygrid[250][4] c_mygrid[251][4] c_mygrid[252][4] c_mygrid[253][4] c_mygrid[254][4] c_mygrid[255][4] c_mygrid[256][4] c_mygrid[257][4] c_mygrid[258][4] c_mygrid[259][4] & + c_mygrid[260][4] c_mygrid[261][4] c_mygrid[262][4] c_mygrid[263][4] c_mygrid[264][4] c_mygrid[265][4] c_mygrid[266][4] c_mygrid[267][4] c_mygrid[268][4] c_mygrid[269][4] & + c_mygrid[270][4] c_mygrid[271][4] c_mygrid[272][4] c_mygrid[273][4] c_mygrid[274][4] c_mygrid[275][4] c_mygrid[276][4] c_mygrid[277][4] c_mygrid[278][4] c_mygrid[279][4] & + c_mygrid[280][4] c_mygrid[281][4] c_mygrid[282][4] c_mygrid[283][4] c_mygrid[284][4] c_mygrid[285][4] c_mygrid[286][4] c_mygrid[287][4] c_mygrid[288][4] c_mygrid[289][4] & + c_mygrid[290][4] c_mygrid[291][4] c_mygrid[292][4] c_mygrid[293][4] c_mygrid[294][4] c_mygrid[295][4] c_mygrid[296][4] c_mygrid[297][4] c_mygrid[298][4] c_mygrid[299][4] & + c_mygrid[301][4] c_mygrid[302][4] c_mygrid[303][4] c_mygrid[304][4] c_mygrid[305][4] c_mygrid[306][4] c_mygrid[307][4] c_mygrid[308][4] c_mygrid[309][4] & + c_mygrid[310][4] c_mygrid[311][4] c_mygrid[312][4] c_mygrid[313][4] c_mygrid[314][4] c_mygrid[315][4] c_mygrid[316][4] c_mygrid[317][4] c_mygrid[318][4] c_mygrid[319][4] & + c_mygrid[320][4] c_mygrid[321][4] c_mygrid[322][4] c_mygrid[323][4] c_mygrid[324][4] c_mygrid[325][4] c_mygrid[326][4] c_mygrid[327][4] c_mygrid[328][4] c_mygrid[329][4] & + c_mygrid[330][4] c_mygrid[331][4] c_mygrid[332][4] c_mygrid[333][4] c_mygrid[334][4] c_mygrid[335][4] c_mygrid[336][4] c_mygrid[337][4] c_mygrid[338][4] c_mygrid[339][4] & + c_mygrid[340][4] c_mygrid[341][4] c_mygrid[342][4] c_mygrid[343][4] c_mygrid[344][4] c_mygrid[345][4] c_mygrid[346][4] c_mygrid[347][4] c_mygrid[348][4] c_mygrid[349][4] & + c_mygrid[350][4] c_mygrid[351][4] c_mygrid[352][4] c_mygrid[353][4] c_mygrid[354][4] c_mygrid[355][4] c_mygrid[356][4] c_mygrid[357][4] c_mygrid[358][4] c_mygrid[359][4] & + c_mygrid[360][4] c_mygrid[361][4] c_mygrid[362][4] c_mygrid[363][4] c_mygrid[364][4] c_mygrid[365][4] c_mygrid[366][4] c_mygrid[367][4] c_mygrid[368][4] c_mygrid[369][4] & + c_mygrid[370][4] c_mygrid[371][4] c_mygrid[372][4] c_mygrid[373][4] c_mygrid[374][4] c_mygrid[375][4] c_mygrid[376][4] c_mygrid[377][4] c_mygrid[378][4] c_mygrid[379][4] & + c_mygrid[380][4] c_mygrid[381][4] c_mygrid[382][4] c_mygrid[383][4] c_mygrid[384][4] thermo_modify norm yes diff --git a/src/SNAP/compute_sna_grid.cpp b/src/SNAP/compute_sna_grid.cpp index 26bd272d9f..d9912cdc47 100644 --- a/src/SNAP/compute_sna_grid.cpp +++ b/src/SNAP/compute_sna_grid.cpp @@ -120,7 +120,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : rmin0,switchflag,bzeroflag); ncoeff = snaptr->ncoeff; - size_array_cols = ncoeff; + size_array_cols = size_array_cols_base + ncoeff; if (quadraticflag) size_array_cols += (ncoeff*(ncoeff+1))/2; array_flag = 1; } @@ -237,8 +237,8 @@ void ComputeSNAGrid::compute_array() snaptr->compute_zi(); snaptr->compute_bi(); for (int icoeff = 0; icoeff < ncoeff; icoeff++) - sna[igrid][icoeff] = snaptr->blist[icoeff]; - // printf("igrid = %d %g %g %g %d B0 = %g\n",igrid,xtmp,ytmp,ztmp,ninside,sna[igrid][0]); + sna[igrid][size_array_cols_base+icoeff] = snaptr->blist[icoeff]; + // printf("igrid = %d %g %g %g %d B0 = %g\n",igrid,xtmp,ytmp,ztmp,ninside,sna[igrid][size_array_cols_base+0]); if (quadraticflag) { int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index ec969fd01f..63e4a8c885 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -51,6 +51,7 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : nargbase = iarg - iarg0; size_array_rows = nx*ny*nz; + size_array_cols_base = 3; } /* ---------------------------------------------------------------------- */ @@ -131,6 +132,7 @@ void ComputeGrid::setup() z0full = boxlo[2] - mz*delz; allocate(); + assign_coords_array(); } /* ---------------------------------------------------------------------- @@ -153,6 +155,26 @@ void ComputeGrid::igridfull2x(int igrid, double *x) } +/* ---------------------------------------------------------------------- + convert array index to box coords +------------------------------------------------------------------------- */ + +void ComputeGrid::iarray2x(int iarray, double *x) +{ + int iz = iarray / (nx*ny); + iarray -= iz * (nx*ny); + int iy = iarray / nx; + iarray -= iy * nx; + int ix = iarray; + + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; + + if (triclinic) domain->lamda2x(x, x); + +} + /* ---------------------------------------------------------------------- copy local grid to global array ------------------------------------------------------------------------- */ @@ -162,11 +184,26 @@ void ComputeGrid::copy_local_grid() int igridfull; for (int iarray = 0; iarray < size_array_rows; iarray++) { igridfull = iarray2igridfull(iarray); - for (int icol = 0; icol < size_array_cols; icol++) + for (int icol = size_array_cols_base; icol < size_array_cols; icol++) array[iarray][icol] = gridfull[igridfull][icol]; } } +/* ---------------------------------------------------------------------- + copy coords to global array +------------------------------------------------------------------------- */ + +void ComputeGrid::assign_coords_array() +{ + double x[3]; + for (int iarray = 0; iarray < size_array_rows; iarray++) { + iarray2x(iarray,x); + array[iarray][0] = x[0]; + array[iarray][1] = x[1]; + array[iarray][2] = x[2]; + } +} + /* ---------------------------------------------------------------------- gather global array from full grid ------------------------------------------------------------------------- */ @@ -181,7 +218,7 @@ void ComputeGrid::gather_global_array() // inefficient, should exploit shared ix structure iarray = igridfull2iarray(igrid); - for (int icol = 0; icol < size_array_cols; icol++) + for (int icol = size_array_cols_base; icol < size_array_cols; icol++) array[iarray][icol] += gridfull[igrid][icol]; } } diff --git a/src/compute_grid.h b/src/compute_grid.h index bc757c37bc..1468f9ad91 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -33,7 +33,7 @@ class ComputeGrid : public Compute { int nx, ny, nz; // grid dimensions int nxfull, nyfull, nzfull; // grid dimensions with ghost points int nxyfull; // nx_full*ny_full - int ngridfull; // number of full grid points + int ngridfull; // number of full grid points double **gridfull; // full grid points int mx, my, mz; // cutmax stencil dimensions int triclinic; // triclinic flag @@ -43,10 +43,13 @@ class ComputeGrid : public Compute { double x0full, y0full, z0full; // origin of full grid int nargbase; // number of base class args double cutmax; // largest cutoff distance + int size_array_cols_base; // number of columns used for coords, etc. virtual void allocate(); void igridfull2x(int, double*); // convert full grid point to coord + void iarray2x(int, double*); // convert array point to coord void gather_global_array(); // gather global array from full grid void copy_local_grid(); // copy local grid to global array + void assign_coords_array(); // assign coords to global array int igridfull2iarray(int); // convert full grid index to compute array index int iarray2igridfull(int); // convert compute array index to full grid index From 59e3b4c5ba8b3de1d7f183a1cecb793b14886b99 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 24 Oct 2019 16:12:23 -0600 Subject: [PATCH 006/172] Fixed bug in lammps.py --- python/lammps.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/python/lammps.py b/python/lammps.py index 36cf2d2fdd..f23268cd60 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -399,14 +399,9 @@ class lammps(object): ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) return ptr if type == 2: - if style == 0: - self.lib.lammps_extract_compute.restype = POINTER(c_int) - ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) - return ptr[0] - else: - self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double)) - ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) - return ptr + self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double)) + ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) + return ptr return None # extract fix info From 2fa9e5fefb26f3e4540ed7dc6e4e1563e49432bc Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 24 Oct 2019 19:48:41 -0600 Subject: [PATCH 007/172] Completed brute force parallel implementation using MPI_Allreduce() --- src/SNAP/compute_sna_grid.cpp | 60 +++------- src/SNAP/compute_sna_grid.h | 4 - src/compute_grid.cpp | 220 ++++++++++------------------------ src/compute_grid.h | 26 ++-- 4 files changed, 93 insertions(+), 217 deletions(-) diff --git a/src/SNAP/compute_sna_grid.cpp b/src/SNAP/compute_sna_grid.cpp index d9912cdc47..a9f3b6c3fb 100644 --- a/src/SNAP/compute_sna_grid.cpp +++ b/src/SNAP/compute_sna_grid.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : - ComputeGrid(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), + ComputeGrid(lmp, narg, arg), cutsq(NULL), sna(NULL), radelem(NULL), wjelem(NULL) { double rmin0, rfac0; @@ -120,8 +120,9 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : rmin0,switchflag,bzeroflag); ncoeff = snaptr->ncoeff; - size_array_cols = size_array_cols_base + ncoeff; - if (quadraticflag) size_array_cols += (ncoeff*(ncoeff+1))/2; + nvalues = ncoeff; + if (quadraticflag) nvalues += (ncoeff*(ncoeff+1))/2; + size_array_cols = size_array_cols_base + nvalues; array_flag = 1; } @@ -165,26 +166,10 @@ void ComputeSNAGrid::init() /* ---------------------------------------------------------------------- */ -void ComputeSNAGrid::init_list(int /*id*/, NeighList *ptr) -{ - list = ptr; -} - -/* ---------------------------------------------------------------------- */ - void ComputeSNAGrid::compute_array() { invoked_array = update->ntimestep; -// // invoke full neighbor list (will copy or build if necessary) - -// neighbor->build_one(list); - -// const int inum = list->inum; -// const int* const ilist = list->ilist; -// const int* const numneigh = list->numneigh; -// int** const firstneigh = list->firstneigh; - int * const type = atom->type; // compute sna for each gridpoint @@ -197,13 +182,12 @@ void ComputeSNAGrid::compute_array() snaptr->grow_rij(ntotal); - printf("ngridfull = %d\n",ngridfull); - for (int igrid = 0; igrid < ngridfull; igrid++) { - double rtmp[3]; - igridfull2x(igrid, rtmp); - const double xtmp = rtmp[0]; - const double ytmp = rtmp[1]; - const double ztmp = rtmp[2]; + printf("ngrid = %d\n",ngrid); + for (int igrid = 0; igrid < ngrid; igrid++) { + if (!grid_local[igrid]) continue; + const double xtmp = grid[igrid][0]; + const double ytmp = grid[igrid][1]; + const double ztmp = grid[igrid][2]; // rij[][3] = displacements between atom I and those neighbors // inside = indices of neighbors of I within cutoff @@ -237,7 +221,7 @@ void ComputeSNAGrid::compute_array() snaptr->compute_zi(); snaptr->compute_bi(); for (int icoeff = 0; icoeff < ncoeff; icoeff++) - sna[igrid][size_array_cols_base+icoeff] = snaptr->blist[icoeff]; + grid[igrid][size_array_cols_base+icoeff] = snaptr->blist[icoeff]; // printf("igrid = %d %g %g %g %d B0 = %g\n",igrid,xtmp,ytmp,ztmp,ninside,sna[igrid][size_array_cols_base+0]); if (quadraticflag) { int ncount = ncoeff; @@ -246,27 +230,16 @@ void ComputeSNAGrid::compute_array() // diagonal element of quadratic matrix - sna[igrid][ncount++] = 0.5*bi*bi; + grid[igrid][size_array_cols_base+ncount++] = 0.5*bi*bi; // upper-triangular elements of quadratic matrix for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - sna[igrid][ncount++] = bi*snaptr->blist[jcoeff]; + grid[igrid][size_array_cols_base+ncount++] = bi*snaptr->blist[jcoeff]; } } } - // gather_global_array(); - copy_local_grid(); -} - -/* ---------------------------------------------------------------------- - allocate array in base class and then set up pointers -------------------------------------------------------------------------- */ - -void ComputeSNAGrid::allocate() -{ - ComputeGrid::allocate(); - sna = gridfull; + MPI_Allreduce(&grid[0][0],&gridall[0][0],ngrid*size_array_cols,MPI_DOUBLE,MPI_SUM,world); } /* ---------------------------------------------------------------------- @@ -275,9 +248,8 @@ void ComputeSNAGrid::allocate() double ComputeSNAGrid::memory_usage() { - double bytes = size_array_rows*size_array_cols * sizeof(double); // grid - bytes += snaptr->memory_usage(); // SNA object + double nbytes = snaptr->memory_usage(); // SNA object - return bytes; + return nbytes; } diff --git a/src/SNAP/compute_sna_grid.h b/src/SNAP/compute_sna_grid.h index 2bd18a915e..0242a2962b 100644 --- a/src/SNAP/compute_sna_grid.h +++ b/src/SNAP/compute_sna_grid.h @@ -29,16 +29,12 @@ class ComputeSNAGrid : public ComputeGrid { ComputeSNAGrid(class LAMMPS *, int, char **); ~ComputeSNAGrid(); void init(); - void init_list(int, class NeighList *); void compute_array(); double memory_usage(); - void allocate(); private: - int nmax; int ncoeff; double **cutsq; - class NeighList *list; double **sna; double rcutfac; double *radelem; diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 63e4a8c885..2f67d22182 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -50,7 +50,7 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : nargbase = iarg - iarg0; - size_array_rows = nx*ny*nz; + size_array_rows = ngrid = nx*ny*nz; size_array_cols_base = 3; } @@ -58,6 +58,8 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid::~ComputeGrid() { + memory->destroy(grid); + memory->destroy(grid_local); } /* ---------------------------------------------------------------------- */ @@ -78,9 +80,13 @@ void ComputeGrid::setup() if (triclinic == 0) { prd = domain->prd; boxlo = domain->boxlo; + sublo = domain->sublo; + subhi = domain->subhi; } else { prd = domain->prd_lamda; boxlo = domain->boxlo_lamda; + sublo = domain->sublo_lamda; + subhi = domain->subhi_lamda; } double xprd = prd[0]; @@ -95,78 +101,23 @@ void ComputeGrid::setup() dely = 1.0/delyinv; delz = 1.0/delzinv; - // sufficient conditions for stencil bounding rcut - - // require |delz*mz|^2 <= rcut^2 - // require |dely*my|^2 <= rcut^2 + |delyz*mz_max|^2 - // require |delx*mx|^2 <= rcut^2 + |delxz*mz_max|^2 + |delxy*my_max|^2 - - double delxy = domain->xy/ny; - double delxz = domain->xz/nz; - double delyz = domain->yz/nz; - - if (!triclinic) { - mz = cutmax*delzinv + 1; - my = sqrt(cutmax*cutmax + pow(delyz*mz,2))*delyinv + 1; - mx = sqrt(cutmax*cutmax + pow(delxz*mz,2) - + pow(delxy*my,2))*delxinv + 1; - } else { - double delxinvtmp = nx/domain->xprd; - double delyinvtmp = ny/domain->yprd; - double delzinvtmp = nz/domain->zprd; - mz = cutmax*delzinvtmp + 1; - my = sqrt(cutmax*cutmax + pow(delyz*mz,2))*delyinvtmp + 1; - mx = sqrt(cutmax*cutmax + pow(delxz*mz,2) - + pow(delxy*my,2))*delxinvtmp + 1; - } - - // size global grid to accomodate periodic interactions - - nxfull = nx + 2*mx; - nyfull = ny + 2*my; - nzfull = nz + 2*mz; - nxyfull = nxfull * nyfull; - - x0full = boxlo[0] - mx*delx; - y0full = boxlo[1] - my*dely; - z0full = boxlo[2] - mz*delz; - allocate(); - assign_coords_array(); + assign_grid_coords(); + assign_grid_local(); } /* ---------------------------------------------------------------------- - convert grid index to box coords + convert global array index to box coords ------------------------------------------------------------------------- */ -void ComputeGrid::igridfull2x(int igrid, double *x) +void ComputeGrid::grid2x(int igrid, double *x) { - int iz = igrid / nxyfull; - igrid -= iz * nxyfull; - int iy = igrid / nxfull; - igrid -= iy * nxfull; + int iz = igrid / (nx*ny); + igrid -= iz * (nx*ny); + int iy = igrid / nx; + igrid -= iy * nx; int ix = igrid; - x[0] = x0full+ix*delx; - x[1] = y0full+iy*dely; - x[2] = z0full+iz*delz; - - if (triclinic) domain->lamda2x(x, x); - -} - -/* ---------------------------------------------------------------------- - convert array index to box coords -------------------------------------------------------------------------- */ - -void ComputeGrid::iarray2x(int iarray, double *x) -{ - int iz = iarray / (nx*ny); - iarray -= iz * (nx*ny); - int iy = iarray / nx; - iarray -= iy * nx; - int ix = iarray; - x[0] = ix*delx; x[1] = iy*dely; x[2] = iz*delz; @@ -176,16 +127,43 @@ void ComputeGrid::iarray2x(int iarray, double *x) } /* ---------------------------------------------------------------------- - copy local grid to global array + check if grid point is local ------------------------------------------------------------------------- */ -void ComputeGrid::copy_local_grid() +int ComputeGrid::check_grid_local(int igrid) { - int igridfull; - for (int iarray = 0; iarray < size_array_rows; iarray++) { - igridfull = iarray2igridfull(iarray); - for (int icol = size_array_cols_base; icol < size_array_cols; icol++) - array[iarray][icol] = gridfull[igridfull][icol]; + double x[3]; + + int iz = igrid / (nx*ny); + igrid -= iz * (nx*ny); + int iy = igrid / nx; + igrid -= iy * nx; + int ix = igrid; + + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; + + int islocal = + x[0] >= sublo[0] && x[0] < subhi[0] && + x[1] >= sublo[1] && x[1] < subhi[1] && + x[2] >= sublo[2] && x[2] < subhi[2]; + + return islocal; +} + +/* ---------------------------------------------------------------------- + copy coords to global array +------------------------------------------------------------------------- */ + +void ComputeGrid::assign_grid_coords() +{ + double x[3]; + for (int igrid = 0; igrid < ngrid; igrid++) { + grid2x(igrid,x); + grid[igrid][0] = x[0]; + grid[igrid][1] = x[1]; + grid[igrid][2] = x[2]; } } @@ -193,101 +171,33 @@ void ComputeGrid::copy_local_grid() copy coords to global array ------------------------------------------------------------------------- */ -void ComputeGrid::assign_coords_array() +void ComputeGrid::assign_grid_local() { double x[3]; - for (int iarray = 0; iarray < size_array_rows; iarray++) { - iarray2x(iarray,x); - array[iarray][0] = x[0]; - array[iarray][1] = x[1]; - array[iarray][2] = x[2]; + for (int igrid = 0; igrid < ngrid; igrid++) { + if (check_grid_local(igrid)) + grid_local[igrid] = 1; + else { + grid_local[igrid] = 0; + memset(grid[igrid],0,size_array_cols); + } } } -/* ---------------------------------------------------------------------- - gather global array from full grid -------------------------------------------------------------------------- */ - -void ComputeGrid::gather_global_array() -{ - int iarray; - memset(&array[0][0],0,size_array_rows*size_array_cols*sizeof(double)); - - for (int igrid = 0; igrid < ngridfull; igrid++) { - - // inefficient, should exploit shared ix structure - - iarray = igridfull2iarray(igrid); - for (int icol = size_array_cols_base; icol < size_array_cols; icol++) - array[iarray][icol] += gridfull[igrid][icol]; - } -} - -/* ---------------------------------------------------------------------- - convert full grid index to compute array index - inefficient, should exploit shared ix structure -------------------------------------------------------------------------- */ - -int ComputeGrid::igridfull2iarray(int igrid) -{ - int iz = igrid / nxyfull; - igrid -= iz*nxyfull; - int iy = igrid / nxfull; - igrid -= iy*nxfull; - int ix = igrid; - - ix -= mx; - iy -= my; - iz -= mz; - - while (ix < 0) ix += nx; - while (iy < 0) iy += ny; - while (iz < 0) iz += nz; - - while (ix >= nx) ix -= nx; - while (iy >= ny) iy -= ny; - while (iz >= nz) iz -= nz; - - int iarray = (iz * ny + iy) * nx + ix; - - return iarray; -} - -/* ---------------------------------------------------------------------- - convert compute array index to full grid index - inefficient, should exploit shared ix structure -------------------------------------------------------------------------- */ - -int ComputeGrid::iarray2igridfull(int iarray) -{ - int iz = iarray / (nx*ny); - iarray -= iz*(nx*ny); - int iy = iarray / nx; - iarray -= iy*nx; - int ix = iarray; - - ix += mx; - iy += my; - iz += mz; - - int igrid = (iz * nyfull + iy) * nxfull + ix; - - return igrid; -} - /* ---------------------------------------------------------------------- free and reallocate arrays ------------------------------------------------------------------------- */ void ComputeGrid::allocate() { - ngridfull = nxfull*nyfull*nzfull; - // grow global array if necessary - memory->destroy(array); - memory->create(array,size_array_rows,size_array_cols,"sna/grid:array"); - memory->create(gridfull,ngridfull,size_array_cols,"sna/grid:gridfull"); + memory->destroy(grid); + memory->destroy(grid_local); + memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); + memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); + memory->create(grid_local,size_array_rows,"grid:grid_local"); + array = gridall; } /* ---------------------------------------------------------------------- memory usage of local data @@ -295,6 +205,8 @@ void ComputeGrid::allocate() double ComputeGrid::memory_usage() { - int nbytes = 0; + double nbytes = size_array_rows*size_array_cols * + sizeof(double); // grid + nbytes += size_array_rows*sizeof(int); // grid_local return nbytes; } diff --git a/src/compute_grid.h b/src/compute_grid.h index 1468f9ad91..a1c938db2e 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -31,28 +31,24 @@ class ComputeGrid : public Compute { protected: int nx, ny, nz; // grid dimensions - int nxfull, nyfull, nzfull; // grid dimensions with ghost points - int nxyfull; // nx_full*ny_full - int ngridfull; // number of full grid points - double **gridfull; // full grid points - int mx, my, mz; // cutmax stencil dimensions + int ngrid; // number of grid points + int nvalues; // number of values per grid point + double **grid; // global grid + double **gridall; // global grid summed over procs int triclinic; // triclinic flag double *boxlo, *prd; // box info (units real/ortho or reduced/tri) + double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) double delxinv,delyinv,delzinv; // inverse grid spacing double delx,dely,delz; // grid spacing - double x0full, y0full, z0full; // origin of full grid int nargbase; // number of base class args double cutmax; // largest cutoff distance int size_array_cols_base; // number of columns used for coords, etc. - virtual void allocate(); - void igridfull2x(int, double*); // convert full grid point to coord - void iarray2x(int, double*); // convert array point to coord - void gather_global_array(); // gather global array from full grid - void copy_local_grid(); // copy local grid to global array - void assign_coords_array(); // assign coords to global array - int igridfull2iarray(int); // convert full grid index to compute array index - int iarray2igridfull(int); // convert compute array index to full grid index - + int *grid_local; // local flag for each grid point + void allocate(); + void grid2x(int, double*); // convert grid point to coord + void assign_grid_coords(); // assign coords for grid + void assign_grid_local(); // set local flag for each grid point + int check_grid_local(int); // check if grid point is local private: }; From 651e9c63973809d1026faac942f84998dfe7ac74 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Tue, 19 May 2020 11:01:31 -0600 Subject: [PATCH 008/172] Initialized arrays to NULL --- src/compute_grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 2f67d22182..011dafa030 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) + Compute(lmp, narg, arg), grid(NULL), grid_local(NULL) { if (narg < 6) error->all(FLERR,"Illegal compute grid command"); From 4a261f396128a0d19beba082bd7f4ab6c54a1803 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sat, 23 May 2020 10:18:16 -0600 Subject: [PATCH 009/172] Added python example (!) and turned on switching function --- examples/snap/grid.py | 104 +++++++++++++++++++++++++++++++++++ examples/snap/in.grid | 9 ++- examples/snap/in.grid.python | 61 ++++++++++++++++++++ examples/snap/in.grid.tri | 82 +++++++++++++-------------- 4 files changed, 214 insertions(+), 42 deletions(-) create mode 100755 examples/snap/grid.py create mode 100644 examples/snap/in.grid.python diff --git a/examples/snap/grid.py b/examples/snap/grid.py new file mode 100755 index 0000000000..9fe88fd1b4 --- /dev/null +++ b/examples/snap/grid.py @@ -0,0 +1,104 @@ +#!/Users/athomps/miniconda3/bin/python3.7 +# +# An example of SNAP grid from LAMMPS Python interface +# +# https://lammps.sandia.gov/doc/Python_library.html + + +from lammps import lammps +import lammps_utils + +# define command line input variables + +ngridx = 2 +ngridy = 3 +ngridz = 4 +twojmax = 2 + +lmp_cmdargs = ["-echo","screen"] +lmp_cmdargs = lammps_utils.set_cmdlinevars(lmp_cmdargs, + { + "ngridx":ngridx, + "ngridy":ngridy, + "ngridz":ngridz, + "twojmax":twojmax + } + ) + +# launch LAMMPS instance + +lmp = lammps(cmdargs=lmp_cmdargs) + +# run LAMMPS input script + +lmp.file("in.grid.python") + +# get quantities from LAMMPS + +num_atoms = lmp.get_natoms() + +# set things not accessible from LAMMPS + +# first 3 cols are x, y, z, coords + +ncols0 = 3 + +# analytical relation + +ncoeff = (twojmax+2)*(twojmax+3)*(twojmax+4) +ncoeff = ncoeff // 24 # integer division +ncols = ncols0+ncoeff + +# get B_0 at position (0,0,0) in 4 different ways + +# 1. from comute sna/atom + +bptr = lmp.extract_compute("b", 1, 2) # 1 = per-atom data, 2 = array +print("b = ",bptr[0][0]) + +# 2. from compute sna/grid + +bgridptr = lmp.extract_compute("bgrid", 0, 2) # 0 = style global, 2 = type array +print("bgrid = ",bgridptr[0][3]) + +# 3. from Numpy array pointing to sna/atom array + +bptr_np = lammps_utils.extract_compute_np(lmp,"b",1,2,(num_atoms,ncoeff)) +print("b_np = ",bptr_np[0][0]) + +# 4. from Numpy array pointing to sna/grid array + +bgridptr_np = lammps_utils.extract_compute_np(lmp,"bgrid",0,2,(ngridz,ngridy,ngridx,ncols)) +print("bgrid_np = ",bgridptr_np[0][0][0][ncols0+0]) + +# print out the LAMMPS array to a file + +outfile = open("bgrid.dat",'w') +igrid = 0 +for iz in range(ngridz): + for iy in range(ngridy): + for ix in range(ngridx): + outfile.write("x, y, z = %g %g %g\n" % + (bgridptr[igrid][0], + bgridptr[igrid][1], + bgridptr[igrid][2])) + for icoeff in range(ncoeff): + outfile.write("%g " % bgridptr[igrid][ncols0+icoeff]) + outfile.write("\n") + igrid += 1 +outfile.close() + +# print out the Numpy array to a file + +outfile = open("bgrid_np.dat",'w') +for iz in range(ngridz): + for iy in range(ngridy): + for ix in range(ngridx): + outfile.write("x, y, z = %g %g %g\n" % + (bgridptr_np[iz][iy][ix][0], + bgridptr_np[iz][iy][ix][1], + bgridptr_np[iz][iy][ix][2])) + for icoeff in range(ncoeff): + outfile.write("%g " % bgridptr_np[iz][iy][ix][ncols0+icoeff]) + outfile.write("\n") +outfile.close() diff --git a/examples/snap/in.grid b/examples/snap/in.grid index 5293558fab..2702fccad1 100644 --- a/examples/snap/in.grid +++ b/examples/snap/in.grid @@ -46,7 +46,7 @@ variable wj equal 1 variable radelem equal 0.5 variable bzero equal 0 variable quad equal 0 -variable switch equal 0 +variable switch equal 1 compute b all sna/atom & ${rcutfac} ${rfac0} ${twojmax} ${radelem} & @@ -60,11 +60,16 @@ compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & # define output +# mygrid is ngrid by (3+nbis) = 8x8 thermo_style custom step temp ke pe vol & c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] & c_mygrid[1][2] c_mygrid[2][2] c_mygrid[3][2] c_mygrid[4][2] c_mygrid[5][2] c_mygrid[6][2] c_mygrid[7][2] c_mygrid[8][2] & c_mygrid[1][3] c_mygrid[2][3] c_mygrid[3][3] c_mygrid[4][3] c_mygrid[5][3] c_mygrid[6][3] c_mygrid[7][3] c_mygrid[8][3] & - c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] + c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] & + c_mygrid[1][5] c_mygrid[2][5] c_mygrid[3][5] c_mygrid[4][5] c_mygrid[5][5] c_mygrid[6][5] c_mygrid[7][5] c_mygrid[8][5] & + c_mygrid[1][6] c_mygrid[2][6] c_mygrid[3][6] c_mygrid[4][6] c_mygrid[5][6] c_mygrid[6][6] c_mygrid[7][6] c_mygrid[8][6] & + c_mygrid[1][7] c_mygrid[2][7] c_mygrid[3][7] c_mygrid[4][7] c_mygrid[5][7] c_mygrid[6][7] c_mygrid[7][7] c_mygrid[8][7] & + c_mygrid[1][8] c_mygrid[2][8] c_mygrid[3][8] c_mygrid[4][8] c_mygrid[5][8] c_mygrid[6][8] c_mygrid[7][8] c_mygrid[8][8] thermo_modify norm yes dump mydump_b all custom 1000 dump_b id c_b[*] diff --git a/examples/snap/in.grid.python b/examples/snap/in.grid.python new file mode 100644 index 0000000000..13fe6d0638 --- /dev/null +++ b/examples/snap/in.grid.python @@ -0,0 +1,61 @@ +# Demonstrate bispectrum per-atom and grid computes + +# Invoked from grid.py +# pass in values for ngridx, ngridy, ngridz, twojmax + +# Initialize simulation + +variable nsteps equal 0 +variable nrep equal 1 +variable a equal 3.316 + +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom ${a} a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +# define grid compute and atom compute + +group snapgroup type 1 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 1 + +compute b all sna/atom ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} + +compute bgrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} + +# create dummy potential for neighbor list + +variable rcutneigh equal 2.0*${rcutfac}*${radelem} +pair_style zero ${rcutneigh} +pair_coeff * * + +# define output + +thermo_style custom step temp ke pe vol c_bgrid[1][1] +thermo_modify norm yes + +dump mydump_b all custom 1000 dump_b id c_b[*] + +# run + +run 0 diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index 3c471d9b66..c984799e09 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -51,7 +51,7 @@ variable wj equal 1 variable radelem equal 0.5 variable bzero equal 0 variable quad equal 0 -variable switch equal 0 +variable switch equal 1 compute b all sna/atom & ${rcutfac} ${rfac0} ${twojmax} ${radelem} & @@ -65,46 +65,48 @@ compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} & # define output +# mygrid is ngrid by (3+nbis) = 384x8 + thermo_style custom step temp ke pe vol & - c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] c_mygrid[9][4] & - c_mygrid[10][4] c_mygrid[11][4] c_mygrid[12][4] c_mygrid[13][4] c_mygrid[14][4] c_mygrid[15][4] c_mygrid[16][4] c_mygrid[17][4] c_mygrid[18][4] c_mygrid[19][4] & - c_mygrid[20][4] c_mygrid[21][4] c_mygrid[22][4] c_mygrid[23][4] c_mygrid[24][4] c_mygrid[25][4] c_mygrid[26][4] c_mygrid[27][4] c_mygrid[28][4] c_mygrid[29][4] & - c_mygrid[30][4] c_mygrid[31][4] c_mygrid[32][4] c_mygrid[33][4] c_mygrid[34][4] c_mygrid[35][4] c_mygrid[36][4] c_mygrid[37][4] c_mygrid[38][4] c_mygrid[39][4] & - c_mygrid[40][4] c_mygrid[41][4] c_mygrid[42][4] c_mygrid[43][4] c_mygrid[44][4] c_mygrid[45][4] c_mygrid[46][4] c_mygrid[47][4] c_mygrid[48][4] c_mygrid[49][4] & - c_mygrid[50][4] c_mygrid[51][4] c_mygrid[52][4] c_mygrid[53][4] c_mygrid[54][4] c_mygrid[55][4] c_mygrid[56][4] c_mygrid[57][4] c_mygrid[58][4] c_mygrid[59][4] & - c_mygrid[60][4] c_mygrid[61][4] c_mygrid[62][4] c_mygrid[63][4] c_mygrid[64][4] c_mygrid[65][4] c_mygrid[66][4] c_mygrid[67][4] c_mygrid[68][4] c_mygrid[69][4] & - c_mygrid[70][4] c_mygrid[71][4] c_mygrid[72][4] c_mygrid[73][4] c_mygrid[74][4] c_mygrid[75][4] c_mygrid[76][4] c_mygrid[77][4] c_mygrid[78][4] c_mygrid[79][4] & - c_mygrid[80][4] c_mygrid[81][4] c_mygrid[82][4] c_mygrid[83][4] c_mygrid[84][4] c_mygrid[85][4] c_mygrid[86][4] c_mygrid[87][4] c_mygrid[88][4] c_mygrid[89][4] & - c_mygrid[90][4] c_mygrid[91][4] c_mygrid[92][4] c_mygrid[93][4] c_mygrid[94][4] c_mygrid[95][4] c_mygrid[96][4] c_mygrid[97][4] c_mygrid[98][4] c_mygrid[99][4] & - c_mygrid[101][4] c_mygrid[102][4] c_mygrid[103][4] c_mygrid[104][4] c_mygrid[105][4] c_mygrid[106][4] c_mygrid[107][4] c_mygrid[108][4] c_mygrid[109][4] & - c_mygrid[110][4] c_mygrid[111][4] c_mygrid[112][4] c_mygrid[113][4] c_mygrid[114][4] c_mygrid[115][4] c_mygrid[116][4] c_mygrid[117][4] c_mygrid[118][4] c_mygrid[119][4] & - c_mygrid[120][4] c_mygrid[121][4] c_mygrid[122][4] c_mygrid[123][4] c_mygrid[124][4] c_mygrid[125][4] c_mygrid[126][4] c_mygrid[127][4] c_mygrid[128][4] c_mygrid[129][4] & - c_mygrid[130][4] c_mygrid[131][4] c_mygrid[132][4] c_mygrid[133][4] c_mygrid[134][4] c_mygrid[135][4] c_mygrid[136][4] c_mygrid[137][4] c_mygrid[138][4] c_mygrid[139][4] & - c_mygrid[140][4] c_mygrid[141][4] c_mygrid[142][4] c_mygrid[143][4] c_mygrid[144][4] c_mygrid[145][4] c_mygrid[146][4] c_mygrid[147][4] c_mygrid[148][4] c_mygrid[149][4] & - c_mygrid[150][4] c_mygrid[151][4] c_mygrid[152][4] c_mygrid[153][4] c_mygrid[154][4] c_mygrid[155][4] c_mygrid[156][4] c_mygrid[157][4] c_mygrid[158][4] c_mygrid[159][4] & - c_mygrid[160][4] c_mygrid[161][4] c_mygrid[162][4] c_mygrid[163][4] c_mygrid[164][4] c_mygrid[165][4] c_mygrid[166][4] c_mygrid[167][4] c_mygrid[168][4] c_mygrid[169][4] & - c_mygrid[170][4] c_mygrid[171][4] c_mygrid[172][4] c_mygrid[173][4] c_mygrid[174][4] c_mygrid[175][4] c_mygrid[176][4] c_mygrid[177][4] c_mygrid[178][4] c_mygrid[179][4] & - c_mygrid[180][4] c_mygrid[181][4] c_mygrid[182][4] c_mygrid[183][4] c_mygrid[184][4] c_mygrid[185][4] c_mygrid[186][4] c_mygrid[187][4] c_mygrid[188][4] c_mygrid[189][4] & - c_mygrid[190][4] c_mygrid[191][4] c_mygrid[192][4] c_mygrid[193][4] c_mygrid[194][4] c_mygrid[195][4] c_mygrid[196][4] c_mygrid[197][4] c_mygrid[198][4] c_mygrid[199][4] & - c_mygrid[201][4] c_mygrid[202][4] c_mygrid[203][4] c_mygrid[204][4] c_mygrid[205][4] c_mygrid[206][4] c_mygrid[207][4] c_mygrid[208][4] c_mygrid[209][4] & - c_mygrid[210][4] c_mygrid[211][4] c_mygrid[212][4] c_mygrid[213][4] c_mygrid[214][4] c_mygrid[215][4] c_mygrid[216][4] c_mygrid[217][4] c_mygrid[218][4] c_mygrid[219][4] & - c_mygrid[220][4] c_mygrid[221][4] c_mygrid[222][4] c_mygrid[223][4] c_mygrid[224][4] c_mygrid[225][4] c_mygrid[226][4] c_mygrid[227][4] c_mygrid[228][4] c_mygrid[229][4] & - c_mygrid[230][4] c_mygrid[231][4] c_mygrid[232][4] c_mygrid[233][4] c_mygrid[234][4] c_mygrid[235][4] c_mygrid[236][4] c_mygrid[237][4] c_mygrid[238][4] c_mygrid[239][4] & - c_mygrid[240][4] c_mygrid[241][4] c_mygrid[242][4] c_mygrid[243][4] c_mygrid[244][4] c_mygrid[245][4] c_mygrid[246][4] c_mygrid[247][4] c_mygrid[248][4] c_mygrid[249][4] & - c_mygrid[250][4] c_mygrid[251][4] c_mygrid[252][4] c_mygrid[253][4] c_mygrid[254][4] c_mygrid[255][4] c_mygrid[256][4] c_mygrid[257][4] c_mygrid[258][4] c_mygrid[259][4] & - c_mygrid[260][4] c_mygrid[261][4] c_mygrid[262][4] c_mygrid[263][4] c_mygrid[264][4] c_mygrid[265][4] c_mygrid[266][4] c_mygrid[267][4] c_mygrid[268][4] c_mygrid[269][4] & - c_mygrid[270][4] c_mygrid[271][4] c_mygrid[272][4] c_mygrid[273][4] c_mygrid[274][4] c_mygrid[275][4] c_mygrid[276][4] c_mygrid[277][4] c_mygrid[278][4] c_mygrid[279][4] & - c_mygrid[280][4] c_mygrid[281][4] c_mygrid[282][4] c_mygrid[283][4] c_mygrid[284][4] c_mygrid[285][4] c_mygrid[286][4] c_mygrid[287][4] c_mygrid[288][4] c_mygrid[289][4] & - c_mygrid[290][4] c_mygrid[291][4] c_mygrid[292][4] c_mygrid[293][4] c_mygrid[294][4] c_mygrid[295][4] c_mygrid[296][4] c_mygrid[297][4] c_mygrid[298][4] c_mygrid[299][4] & - c_mygrid[301][4] c_mygrid[302][4] c_mygrid[303][4] c_mygrid[304][4] c_mygrid[305][4] c_mygrid[306][4] c_mygrid[307][4] c_mygrid[308][4] c_mygrid[309][4] & - c_mygrid[310][4] c_mygrid[311][4] c_mygrid[312][4] c_mygrid[313][4] c_mygrid[314][4] c_mygrid[315][4] c_mygrid[316][4] c_mygrid[317][4] c_mygrid[318][4] c_mygrid[319][4] & - c_mygrid[320][4] c_mygrid[321][4] c_mygrid[322][4] c_mygrid[323][4] c_mygrid[324][4] c_mygrid[325][4] c_mygrid[326][4] c_mygrid[327][4] c_mygrid[328][4] c_mygrid[329][4] & - c_mygrid[330][4] c_mygrid[331][4] c_mygrid[332][4] c_mygrid[333][4] c_mygrid[334][4] c_mygrid[335][4] c_mygrid[336][4] c_mygrid[337][4] c_mygrid[338][4] c_mygrid[339][4] & - c_mygrid[340][4] c_mygrid[341][4] c_mygrid[342][4] c_mygrid[343][4] c_mygrid[344][4] c_mygrid[345][4] c_mygrid[346][4] c_mygrid[347][4] c_mygrid[348][4] c_mygrid[349][4] & - c_mygrid[350][4] c_mygrid[351][4] c_mygrid[352][4] c_mygrid[353][4] c_mygrid[354][4] c_mygrid[355][4] c_mygrid[356][4] c_mygrid[357][4] c_mygrid[358][4] c_mygrid[359][4] & - c_mygrid[360][4] c_mygrid[361][4] c_mygrid[362][4] c_mygrid[363][4] c_mygrid[364][4] c_mygrid[365][4] c_mygrid[366][4] c_mygrid[367][4] c_mygrid[368][4] c_mygrid[369][4] & - c_mygrid[370][4] c_mygrid[371][4] c_mygrid[372][4] c_mygrid[373][4] c_mygrid[374][4] c_mygrid[375][4] c_mygrid[376][4] c_mygrid[377][4] c_mygrid[378][4] c_mygrid[379][4] & - c_mygrid[380][4] c_mygrid[381][4] c_mygrid[382][4] c_mygrid[383][4] c_mygrid[384][4] + c_mygrid[1][7] c_mygrid[2][7] c_mygrid[3][7] c_mygrid[4][7] c_mygrid[5][7] c_mygrid[6][7] c_mygrid[7][7] c_mygrid[8][7] c_mygrid[9][7] & + c_mygrid[10][7] c_mygrid[11][7] c_mygrid[12][7] c_mygrid[13][7] c_mygrid[14][7] c_mygrid[15][7] c_mygrid[16][7] c_mygrid[17][7] c_mygrid[18][7] c_mygrid[19][7] & + c_mygrid[20][7] c_mygrid[21][7] c_mygrid[22][7] c_mygrid[23][7] c_mygrid[24][7] c_mygrid[25][7] c_mygrid[26][7] c_mygrid[27][7] c_mygrid[28][7] c_mygrid[29][7] & + c_mygrid[30][7] c_mygrid[31][7] c_mygrid[32][7] c_mygrid[33][7] c_mygrid[34][7] c_mygrid[35][7] c_mygrid[36][7] c_mygrid[37][7] c_mygrid[38][7] c_mygrid[39][7] & + c_mygrid[40][7] c_mygrid[41][7] c_mygrid[42][7] c_mygrid[43][7] c_mygrid[44][7] c_mygrid[45][7] c_mygrid[46][7] c_mygrid[47][7] c_mygrid[48][7] c_mygrid[49][7] & + c_mygrid[50][7] c_mygrid[51][7] c_mygrid[52][7] c_mygrid[53][7] c_mygrid[54][7] c_mygrid[55][7] c_mygrid[56][7] c_mygrid[57][7] c_mygrid[58][7] c_mygrid[59][7] & + c_mygrid[60][7] c_mygrid[61][7] c_mygrid[62][7] c_mygrid[63][7] c_mygrid[64][7] c_mygrid[65][7] c_mygrid[66][7] c_mygrid[67][7] c_mygrid[68][7] c_mygrid[69][7] & + c_mygrid[70][7] c_mygrid[71][7] c_mygrid[72][7] c_mygrid[73][7] c_mygrid[74][7] c_mygrid[75][7] c_mygrid[76][7] c_mygrid[77][7] c_mygrid[78][7] c_mygrid[79][7] & + c_mygrid[80][7] c_mygrid[81][7] c_mygrid[82][7] c_mygrid[83][7] c_mygrid[84][7] c_mygrid[85][7] c_mygrid[86][7] c_mygrid[87][7] c_mygrid[88][7] c_mygrid[89][7] & + c_mygrid[90][7] c_mygrid[91][7] c_mygrid[92][7] c_mygrid[93][7] c_mygrid[94][7] c_mygrid[95][7] c_mygrid[96][7] c_mygrid[97][7] c_mygrid[98][7] c_mygrid[99][7] & + c_mygrid[101][7] c_mygrid[102][7] c_mygrid[103][7] c_mygrid[104][7] c_mygrid[105][7] c_mygrid[106][7] c_mygrid[107][7] c_mygrid[108][7] c_mygrid[109][7] & + c_mygrid[110][7] c_mygrid[111][7] c_mygrid[112][7] c_mygrid[113][7] c_mygrid[114][7] c_mygrid[115][7] c_mygrid[116][7] c_mygrid[117][7] c_mygrid[118][7] c_mygrid[119][7] & + c_mygrid[120][7] c_mygrid[121][7] c_mygrid[122][7] c_mygrid[123][7] c_mygrid[124][7] c_mygrid[125][7] c_mygrid[126][7] c_mygrid[127][7] c_mygrid[128][7] c_mygrid[129][7] & + c_mygrid[130][7] c_mygrid[131][7] c_mygrid[132][7] c_mygrid[133][7] c_mygrid[134][7] c_mygrid[135][7] c_mygrid[136][7] c_mygrid[137][7] c_mygrid[138][7] c_mygrid[139][7] & + c_mygrid[140][7] c_mygrid[141][7] c_mygrid[142][7] c_mygrid[143][7] c_mygrid[144][7] c_mygrid[145][7] c_mygrid[146][7] c_mygrid[147][7] c_mygrid[148][7] c_mygrid[149][7] & + c_mygrid[150][7] c_mygrid[151][7] c_mygrid[152][7] c_mygrid[153][7] c_mygrid[154][7] c_mygrid[155][7] c_mygrid[156][7] c_mygrid[157][7] c_mygrid[158][7] c_mygrid[159][7] & + c_mygrid[160][7] c_mygrid[161][7] c_mygrid[162][7] c_mygrid[163][7] c_mygrid[164][7] c_mygrid[165][7] c_mygrid[166][7] c_mygrid[167][7] c_mygrid[168][7] c_mygrid[169][7] & + c_mygrid[170][7] c_mygrid[171][7] c_mygrid[172][7] c_mygrid[173][7] c_mygrid[174][7] c_mygrid[175][7] c_mygrid[176][7] c_mygrid[177][7] c_mygrid[178][7] c_mygrid[179][7] & + c_mygrid[180][7] c_mygrid[181][7] c_mygrid[182][7] c_mygrid[183][7] c_mygrid[184][7] c_mygrid[185][7] c_mygrid[186][7] c_mygrid[187][7] c_mygrid[188][7] c_mygrid[189][7] & + c_mygrid[190][7] c_mygrid[191][7] c_mygrid[192][7] c_mygrid[193][7] c_mygrid[194][7] c_mygrid[195][7] c_mygrid[196][7] c_mygrid[197][7] c_mygrid[198][7] c_mygrid[199][7] & + c_mygrid[201][7] c_mygrid[202][7] c_mygrid[203][7] c_mygrid[204][7] c_mygrid[205][7] c_mygrid[206][7] c_mygrid[207][7] c_mygrid[208][7] c_mygrid[209][7] & + c_mygrid[210][7] c_mygrid[211][7] c_mygrid[212][7] c_mygrid[213][7] c_mygrid[214][7] c_mygrid[215][7] c_mygrid[216][7] c_mygrid[217][7] c_mygrid[218][7] c_mygrid[219][7] & + c_mygrid[220][7] c_mygrid[221][7] c_mygrid[222][7] c_mygrid[223][7] c_mygrid[224][7] c_mygrid[225][7] c_mygrid[226][7] c_mygrid[227][7] c_mygrid[228][7] c_mygrid[229][7] & + c_mygrid[230][7] c_mygrid[231][7] c_mygrid[232][7] c_mygrid[233][7] c_mygrid[234][7] c_mygrid[235][7] c_mygrid[236][7] c_mygrid[237][7] c_mygrid[238][7] c_mygrid[239][7] & + c_mygrid[240][7] c_mygrid[241][7] c_mygrid[242][7] c_mygrid[243][7] c_mygrid[244][7] c_mygrid[245][7] c_mygrid[246][7] c_mygrid[247][7] c_mygrid[248][7] c_mygrid[249][7] & + c_mygrid[250][7] c_mygrid[251][7] c_mygrid[252][7] c_mygrid[253][7] c_mygrid[254][7] c_mygrid[255][7] c_mygrid[256][7] c_mygrid[257][7] c_mygrid[258][7] c_mygrid[259][7] & + c_mygrid[260][7] c_mygrid[261][7] c_mygrid[262][7] c_mygrid[263][7] c_mygrid[264][7] c_mygrid[265][7] c_mygrid[266][7] c_mygrid[267][7] c_mygrid[268][7] c_mygrid[269][7] & + c_mygrid[270][7] c_mygrid[271][7] c_mygrid[272][7] c_mygrid[273][7] c_mygrid[274][7] c_mygrid[275][7] c_mygrid[276][7] c_mygrid[277][7] c_mygrid[278][7] c_mygrid[279][7] & + c_mygrid[280][7] c_mygrid[281][7] c_mygrid[282][7] c_mygrid[283][7] c_mygrid[284][7] c_mygrid[285][7] c_mygrid[286][7] c_mygrid[287][7] c_mygrid[288][7] c_mygrid[289][7] & + c_mygrid[290][7] c_mygrid[291][7] c_mygrid[292][7] c_mygrid[293][7] c_mygrid[294][7] c_mygrid[295][7] c_mygrid[296][7] c_mygrid[297][7] c_mygrid[298][7] c_mygrid[299][7] & + c_mygrid[301][7] c_mygrid[302][7] c_mygrid[303][7] c_mygrid[304][7] c_mygrid[305][7] c_mygrid[306][7] c_mygrid[307][7] c_mygrid[308][7] c_mygrid[309][7] & + c_mygrid[310][7] c_mygrid[311][7] c_mygrid[312][7] c_mygrid[313][7] c_mygrid[314][7] c_mygrid[315][7] c_mygrid[316][7] c_mygrid[317][7] c_mygrid[318][7] c_mygrid[319][7] & + c_mygrid[320][7] c_mygrid[321][7] c_mygrid[322][7] c_mygrid[323][7] c_mygrid[324][7] c_mygrid[325][7] c_mygrid[326][7] c_mygrid[327][7] c_mygrid[328][7] c_mygrid[329][7] & + c_mygrid[330][7] c_mygrid[331][7] c_mygrid[332][7] c_mygrid[333][7] c_mygrid[334][7] c_mygrid[335][7] c_mygrid[336][7] c_mygrid[337][7] c_mygrid[338][7] c_mygrid[339][7] & + c_mygrid[340][7] c_mygrid[341][7] c_mygrid[342][7] c_mygrid[343][7] c_mygrid[344][7] c_mygrid[345][7] c_mygrid[346][7] c_mygrid[347][7] c_mygrid[348][7] c_mygrid[349][7] & + c_mygrid[350][7] c_mygrid[351][7] c_mygrid[352][7] c_mygrid[353][7] c_mygrid[354][7] c_mygrid[355][7] c_mygrid[356][7] c_mygrid[357][7] c_mygrid[358][7] c_mygrid[359][7] & + c_mygrid[360][7] c_mygrid[361][7] c_mygrid[362][7] c_mygrid[363][7] c_mygrid[364][7] c_mygrid[365][7] c_mygrid[366][7] c_mygrid[367][7] c_mygrid[368][7] c_mygrid[369][7] & + c_mygrid[370][7] c_mygrid[371][7] c_mygrid[372][7] c_mygrid[373][7] c_mygrid[374][7] c_mygrid[375][7] c_mygrid[376][7] c_mygrid[377][7] c_mygrid[378][7] c_mygrid[379][7] & + c_mygrid[380][7] c_mygrid[381][7] c_mygrid[382][7] c_mygrid[383][7] c_mygrid[384][7] thermo_modify norm yes From 4bfb5051237421cdef4501f9a3edb23f52589629 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 25 May 2020 16:35:50 -0600 Subject: [PATCH 010/172] Added reviewer response doc --- src/ReviewerResponse.tex | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/ReviewerResponse.tex diff --git a/src/ReviewerResponse.tex b/src/ReviewerResponse.tex new file mode 100644 index 0000000000..e29d756d78 --- /dev/null +++ b/src/ReviewerResponse.tex @@ -0,0 +1,59 @@ +\pdfoutput=1 +\documentclass[onecolumn,prb,showpacs,aps,superscriptaddress]{revtex4-1} +%\documentclass[prb,showpacs,aps,superscriptaddress]{revtex4-1} + + +\usepackage[english]{babel} +\usepackage[ansinew]{inputenc} +\usepackage{times} +\usepackage{graphicx} +\usepackage{graphics} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{amsbsy} +\usepackage{dsfont} +\usepackage{epstopdf} +\usepackage{makeidx} +%\usepackage{subfigure} +\usepackage{color} +\usepackage{pgf} +\usepackage{bm} +\usepackage{tikz} +%\usepackage[normalem]{ulem} +\usepackage{graphicx} % needed for figures +\usepackage{dcolumn} % needed for some tables +\usepackage{bm} % for math +\usepackage{amssymb} % for math + + +\begin{document} + +{\bf Title Here} + + +\vspace{1cm} + +We thank the reviewers for their careful reading of the manuscript and their suggestions for improvement. We have updated the manuscript accordingly. Please see below for our detailed responses to the review comments. + +\vspace{2cm} + + +\textbf{\underline{Reviewer 1:}} +\begin{itemize} + \item \textbf{Review Comment 1:} Blah blah + \item \textbf{Author Reply 1:} Thank you for your review. We agree making the blha blah is a good idea. We added the following sentence to the Conclusions to address this point \\ + ``Blah blah'' + +\end{itemize} + +\textbf{\underline{Reviewer 2:}} +\begin{itemize} + \item \textbf{Review Comment 1:} Blah blah + \item \textbf{Author Reply 1:} Blah blah \\ + +\end{itemize} + +\end{document} + + From 4295dd2dbcc9aae860607e823c440169c1cc23ae Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 25 May 2020 17:09:32 -0600 Subject: [PATCH 011/172] Wrong number --- src/ReviewerResponse.tex | 59 ---------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/ReviewerResponse.tex diff --git a/src/ReviewerResponse.tex b/src/ReviewerResponse.tex deleted file mode 100644 index e29d756d78..0000000000 --- a/src/ReviewerResponse.tex +++ /dev/null @@ -1,59 +0,0 @@ -\pdfoutput=1 -\documentclass[onecolumn,prb,showpacs,aps,superscriptaddress]{revtex4-1} -%\documentclass[prb,showpacs,aps,superscriptaddress]{revtex4-1} - - -\usepackage[english]{babel} -\usepackage[ansinew]{inputenc} -\usepackage{times} -\usepackage{graphicx} -\usepackage{graphics} -\usepackage{amsmath} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsbsy} -\usepackage{dsfont} -\usepackage{epstopdf} -\usepackage{makeidx} -%\usepackage{subfigure} -\usepackage{color} -\usepackage{pgf} -\usepackage{bm} -\usepackage{tikz} -%\usepackage[normalem]{ulem} -\usepackage{graphicx} % needed for figures -\usepackage{dcolumn} % needed for some tables -\usepackage{bm} % for math -\usepackage{amssymb} % for math - - -\begin{document} - -{\bf Title Here} - - -\vspace{1cm} - -We thank the reviewers for their careful reading of the manuscript and their suggestions for improvement. We have updated the manuscript accordingly. Please see below for our detailed responses to the review comments. - -\vspace{2cm} - - -\textbf{\underline{Reviewer 1:}} -\begin{itemize} - \item \textbf{Review Comment 1:} Blah blah - \item \textbf{Author Reply 1:} Thank you for your review. We agree making the blha blah is a good idea. We added the following sentence to the Conclusions to address this point \\ - ``Blah blah'' - -\end{itemize} - -\textbf{\underline{Reviewer 2:}} -\begin{itemize} - \item \textbf{Review Comment 1:} Blah blah - \item \textbf{Author Reply 1:} Blah blah \\ - -\end{itemize} - -\end{document} - - From cf6570d81283a356915bd4379ca807837988ccc9 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 15:06:19 -0600 Subject: [PATCH 012/172] Tweaked comments in grid examples --- examples/snap/in.grid | 3 +++ examples/snap/in.grid.tri | 26 ++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/examples/snap/in.grid b/examples/snap/in.grid index 2702fccad1..44c42673e0 100644 --- a/examples/snap/in.grid +++ b/examples/snap/in.grid @@ -1,5 +1,8 @@ # Demonstrate bispectrum computes +# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should +# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273 + # Initialize simulation variable nsteps index 0 diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index c984799e09..fc71c3a43f 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -1,5 +1,15 @@ # Demonstrate bispectrum computes +# This triclinic cell has 6 times the volume of a single bcc cube +# and contains 12 atoms. It is a 3x2x1 supercell +# with each unit cell containing 2 atoms and the +# reduced lattice vectors are [1 0 0], [1 1 0], and [1 1 1]. +# The grid is listed in x-fastest order +# CORRECTNESS: thermo output for c_mygrid[*][7] should contain +# the same 2 values that appear in c_mygrid[*][7] for in.grid, +# 7.0663376 and 13.808803, corresponding to atom and insterstitial sites, +# respectively, and with occurrences 12 and 36, respectively. + # Initialize simulation variable nsteps index 0 @@ -11,13 +21,17 @@ variable ngridx equal 3*${ngrid} variable ngridy equal 2*${ngrid} variable ngridz equal 1*${ngrid} +variable nrepx equal 1*${nrep} +variable nrepy equal 1*${nrep} +variable nrepz equal 1*${nrep} + units metal # generate the box and atom positions using a BCC lattice -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} +variable nx equal ${nrepx} +variable ny equal ${nrepy} +variable nz equal ${nrepz} boundary p p p @@ -78,7 +92,7 @@ thermo_style custom step temp ke pe vol & c_mygrid[70][7] c_mygrid[71][7] c_mygrid[72][7] c_mygrid[73][7] c_mygrid[74][7] c_mygrid[75][7] c_mygrid[76][7] c_mygrid[77][7] c_mygrid[78][7] c_mygrid[79][7] & c_mygrid[80][7] c_mygrid[81][7] c_mygrid[82][7] c_mygrid[83][7] c_mygrid[84][7] c_mygrid[85][7] c_mygrid[86][7] c_mygrid[87][7] c_mygrid[88][7] c_mygrid[89][7] & c_mygrid[90][7] c_mygrid[91][7] c_mygrid[92][7] c_mygrid[93][7] c_mygrid[94][7] c_mygrid[95][7] c_mygrid[96][7] c_mygrid[97][7] c_mygrid[98][7] c_mygrid[99][7] & - c_mygrid[101][7] c_mygrid[102][7] c_mygrid[103][7] c_mygrid[104][7] c_mygrid[105][7] c_mygrid[106][7] c_mygrid[107][7] c_mygrid[108][7] c_mygrid[109][7] & + c_mygrid[100][7] c_mygrid[101][7] c_mygrid[102][7] c_mygrid[103][7] c_mygrid[104][7] c_mygrid[105][7] c_mygrid[106][7] c_mygrid[107][7] c_mygrid[108][7] c_mygrid[109][7] & c_mygrid[110][7] c_mygrid[111][7] c_mygrid[112][7] c_mygrid[113][7] c_mygrid[114][7] c_mygrid[115][7] c_mygrid[116][7] c_mygrid[117][7] c_mygrid[118][7] c_mygrid[119][7] & c_mygrid[120][7] c_mygrid[121][7] c_mygrid[122][7] c_mygrid[123][7] c_mygrid[124][7] c_mygrid[125][7] c_mygrid[126][7] c_mygrid[127][7] c_mygrid[128][7] c_mygrid[129][7] & c_mygrid[130][7] c_mygrid[131][7] c_mygrid[132][7] c_mygrid[133][7] c_mygrid[134][7] c_mygrid[135][7] c_mygrid[136][7] c_mygrid[137][7] c_mygrid[138][7] c_mygrid[139][7] & @@ -88,7 +102,7 @@ thermo_style custom step temp ke pe vol & c_mygrid[170][7] c_mygrid[171][7] c_mygrid[172][7] c_mygrid[173][7] c_mygrid[174][7] c_mygrid[175][7] c_mygrid[176][7] c_mygrid[177][7] c_mygrid[178][7] c_mygrid[179][7] & c_mygrid[180][7] c_mygrid[181][7] c_mygrid[182][7] c_mygrid[183][7] c_mygrid[184][7] c_mygrid[185][7] c_mygrid[186][7] c_mygrid[187][7] c_mygrid[188][7] c_mygrid[189][7] & c_mygrid[190][7] c_mygrid[191][7] c_mygrid[192][7] c_mygrid[193][7] c_mygrid[194][7] c_mygrid[195][7] c_mygrid[196][7] c_mygrid[197][7] c_mygrid[198][7] c_mygrid[199][7] & - c_mygrid[201][7] c_mygrid[202][7] c_mygrid[203][7] c_mygrid[204][7] c_mygrid[205][7] c_mygrid[206][7] c_mygrid[207][7] c_mygrid[208][7] c_mygrid[209][7] & + c_mygrid[200][7] c_mygrid[201][7] c_mygrid[202][7] c_mygrid[203][7] c_mygrid[204][7] c_mygrid[205][7] c_mygrid[206][7] c_mygrid[207][7] c_mygrid[208][7] c_mygrid[209][7] & c_mygrid[210][7] c_mygrid[211][7] c_mygrid[212][7] c_mygrid[213][7] c_mygrid[214][7] c_mygrid[215][7] c_mygrid[216][7] c_mygrid[217][7] c_mygrid[218][7] c_mygrid[219][7] & c_mygrid[220][7] c_mygrid[221][7] c_mygrid[222][7] c_mygrid[223][7] c_mygrid[224][7] c_mygrid[225][7] c_mygrid[226][7] c_mygrid[227][7] c_mygrid[228][7] c_mygrid[229][7] & c_mygrid[230][7] c_mygrid[231][7] c_mygrid[232][7] c_mygrid[233][7] c_mygrid[234][7] c_mygrid[235][7] c_mygrid[236][7] c_mygrid[237][7] c_mygrid[238][7] c_mygrid[239][7] & @@ -98,7 +112,7 @@ thermo_style custom step temp ke pe vol & c_mygrid[270][7] c_mygrid[271][7] c_mygrid[272][7] c_mygrid[273][7] c_mygrid[274][7] c_mygrid[275][7] c_mygrid[276][7] c_mygrid[277][7] c_mygrid[278][7] c_mygrid[279][7] & c_mygrid[280][7] c_mygrid[281][7] c_mygrid[282][7] c_mygrid[283][7] c_mygrid[284][7] c_mygrid[285][7] c_mygrid[286][7] c_mygrid[287][7] c_mygrid[288][7] c_mygrid[289][7] & c_mygrid[290][7] c_mygrid[291][7] c_mygrid[292][7] c_mygrid[293][7] c_mygrid[294][7] c_mygrid[295][7] c_mygrid[296][7] c_mygrid[297][7] c_mygrid[298][7] c_mygrid[299][7] & - c_mygrid[301][7] c_mygrid[302][7] c_mygrid[303][7] c_mygrid[304][7] c_mygrid[305][7] c_mygrid[306][7] c_mygrid[307][7] c_mygrid[308][7] c_mygrid[309][7] & + c_mygrid[300][7] c_mygrid[301][7] c_mygrid[302][7] c_mygrid[303][7] c_mygrid[304][7] c_mygrid[305][7] c_mygrid[306][7] c_mygrid[307][7] c_mygrid[308][7] c_mygrid[309][7] & c_mygrid[310][7] c_mygrid[311][7] c_mygrid[312][7] c_mygrid[313][7] c_mygrid[314][7] c_mygrid[315][7] c_mygrid[316][7] c_mygrid[317][7] c_mygrid[318][7] c_mygrid[319][7] & c_mygrid[320][7] c_mygrid[321][7] c_mygrid[322][7] c_mygrid[323][7] c_mygrid[324][7] c_mygrid[325][7] c_mygrid[326][7] c_mygrid[327][7] c_mygrid[328][7] c_mygrid[329][7] & c_mygrid[330][7] c_mygrid[331][7] c_mygrid[332][7] c_mygrid[333][7] c_mygrid[334][7] c_mygrid[335][7] c_mygrid[336][7] c_mygrid[337][7] c_mygrid[338][7] c_mygrid[339][7] & From 442585313c4e8c9ba03419987a44266412acaa33 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 15:11:14 -0600 Subject: [PATCH 013/172] Test --- examples/snap/in.grid.tri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index fc71c3a43f..da87774107 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -1,4 +1,4 @@ -# Demonstrate bispectrum computes +# Demonstrate bispectrum computes for triclinic cell # This triclinic cell has 6 times the volume of a single bcc cube # and contains 12 atoms. It is a 3x2x1 supercell From e102864c2dd9bf56b9a87808e98ac9b7042cff41 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 15:13:40 -0600 Subject: [PATCH 014/172] Test2 --- examples/snap/in.grid.tri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index da87774107..a5b2453c3b 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -1,6 +1,7 @@ # Demonstrate bispectrum computes for triclinic cell -# This triclinic cell has 6 times the volume of a single bcc cube +# This triclinic cell has 6 times the volume of the single +# unit cell used by in.grid # and contains 12 atoms. It is a 3x2x1 supercell # with each unit cell containing 2 atoms and the # reduced lattice vectors are [1 0 0], [1 1 0], and [1 1 1]. From 01475cb3a84005ddde51411c97c4f5f1eb353d71 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 15:35:59 -0600 Subject: [PATCH 015/172] Test3 --- examples/snap/in.grid.tri | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index a5b2453c3b..201f763eeb 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -131,3 +131,4 @@ dump mydump_b all custom 1000 dump_b id c_b[*] run 0 + From 39039d261f39966bad202ded3c5244065f323aa3 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 15:37:49 -0600 Subject: [PATCH 016/172] Test6 --- examples/snap/in.grid.tri | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index 201f763eeb..f375c18c42 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -132,3 +132,4 @@ dump mydump_b all custom 1000 dump_b id c_b[*] run 0 + From e17ace385ddc6d00a485c1c8fd04989526462d6f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 17:47:45 -0600 Subject: [PATCH 017/172] First pass at distributed memory for grid --- src/SNAP/compute_sna_grid.cpp | 93 +++++++------- src/compute_grid.cpp | 224 ++++++++++++++++++++-------------- src/compute_grid.h | 17 ++- 3 files changed, 194 insertions(+), 140 deletions(-) diff --git a/src/SNAP/compute_sna_grid.cpp b/src/SNAP/compute_sna_grid.cpp index a9f3b6c3fb..196819008c 100644 --- a/src/SNAP/compute_sna_grid.cpp +++ b/src/SNAP/compute_sna_grid.cpp @@ -182,66 +182,75 @@ void ComputeSNAGrid::compute_array() snaptr->grow_rij(ntotal); - printf("ngrid = %d\n",ngrid); - for (int igrid = 0; igrid < ngrid; igrid++) { - if (!grid_local[igrid]) continue; - const double xtmp = grid[igrid][0]; - const double ytmp = grid[igrid][1]; - const double ztmp = grid[igrid][2]; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + const int igrid = iz*(nx*ny) + iy*nx + ix; + const double xtmp = grid[igrid][0]; + const double ytmp = grid[igrid][1]; + const double ztmp = grid[igrid][2]; - // rij[][3] = displacements between atom I and those neighbors - // inside = indices of neighbors of I within cutoff - // typej = types of neighbors of I within cutoff + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff - int ninside = 0; - for (int j = 0; j < ntotal; j++) { + int ninside = 0; + for (int j = 0; j < ntotal; j++) { - // check that j is in compute group + // check that j is in compute group - if (!(mask[j] & groupbit)) continue; + if (!(mask[j] & groupbit)) continue; - const double delx = xtmp - x[j][0]; - const double dely = ytmp - x[j][1]; - const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; - int jtype = type[j]; - if (rsq < cutsq[jtype][jtype] && rsq>1e-20) { - // printf("ninside = %d\n",ninside); - snaptr->rij[ninside][0] = delx; - snaptr->rij[ninside][1] = dely; - snaptr->rij[ninside][2] = delz; - snaptr->inside[ninside] = j; - snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - ninside++; - } - } + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + if (rsq < cutsq[jtype][jtype] && rsq>1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + ninside++; + } + } - snaptr->compute_ui(ninside); - snaptr->compute_zi(); - snaptr->compute_bi(); - for (int icoeff = 0; icoeff < ncoeff; icoeff++) - grid[igrid][size_array_cols_base+icoeff] = snaptr->blist[icoeff]; - // printf("igrid = %d %g %g %g %d B0 = %g\n",igrid,xtmp,ytmp,ztmp,ninside,sna[igrid][size_array_cols_base+0]); - if (quadraticflag) { - int ncount = ncoeff; - for (int icoeff = 0; icoeff < ncoeff; icoeff++) { - double bi = snaptr->blist[icoeff]; + snaptr->compute_ui(ninside); + snaptr->compute_zi(); + snaptr->compute_bi(); + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + gridlocal[size_array_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bi = snaptr->blist[icoeff]; - // diagonal element of quadratic matrix + // diagonal element of quadratic matrix - grid[igrid][size_array_cols_base+ncount++] = 0.5*bi*bi; + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bi*bi; // upper-triangular elements of quadratic matrix for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - grid[igrid][size_array_cols_base+ncount++] = bi*snaptr->blist[jcoeff]; + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bi*snaptr->blist[jcoeff]; } } } + + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + const int igrid = iz*(nx*ny) + iy*nx + ix; + for (int j = 0; j < nvalues; j++) + grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; + } MPI_Allreduce(&grid[0][0],&gridall[0][0],ngrid*size_array_cols,MPI_DOUBLE,MPI_SUM,world); + } + /* ---------------------------------------------------------------------- memory usage ------------------------------------------------------------------------- */ diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 011dafa030..b16a51b739 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -21,13 +21,14 @@ #include "force.h" #include "memory.h" #include "error.h" +#include "comm.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), grid(NULL), grid_local(NULL) + Compute(lmp, narg, arg), grid(NULL), local_flags(NULL), gridlocal(NULL) { if (narg < 6) error->all(FLERR,"Illegal compute grid command"); @@ -59,7 +60,8 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid::~ComputeGrid() { memory->destroy(grid); - memory->destroy(grid_local); + memory->destroy(local_flags); + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); } /* ---------------------------------------------------------------------- */ @@ -72,7 +74,118 @@ void ComputeGrid::init() void ComputeGrid::setup() { - + + set_grid_global(); + set_grid_local(); + allocate(); + assign_coords(); + assign_local_flags(); +} + +/* ---------------------------------------------------------------------- + convert global array index to box coords +------------------------------------------------------------------------- */ + +void ComputeGrid::grid2x(int igrid, double *x) +{ + int iz = igrid / (nx*ny); + igrid -= iz * (nx*ny); + int iy = igrid / nx; + igrid -= iy * nx; + int ix = igrid; + + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; + + if (triclinic) domain->lamda2x(x, x); + +} + +/* ---------------------------------------------------------------------- + check if grid point is local +------------------------------------------------------------------------- */ + +int ComputeGrid::check_local(int igrid) +{ + double x[3]; + + int iz = igrid / (nx*ny); + igrid -= iz * (nx*ny); + int iy = igrid / nx; + igrid -= iy * nx; + int ix = igrid; + + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; + + int islocal = + x[0] >= sublo[0] && x[0] < subhi[0] && + x[1] >= sublo[1] && x[1] < subhi[1] && + x[2] >= sublo[2] && x[2] < subhi[2]; + + return islocal; +} + +/* ---------------------------------------------------------------------- + copy coords to global array +------------------------------------------------------------------------- */ + +void ComputeGrid::assign_coords() +{ + double x[3]; + for (int igrid = 0; igrid < ngrid; igrid++) { + grid2x(igrid,x); + grid[igrid][0] = x[0]; + grid[igrid][1] = x[1]; + grid[igrid][2] = x[2]; + } +} + +/* ---------------------------------------------------------------------- + copy coords to global array +------------------------------------------------------------------------- */ + +void ComputeGrid::assign_local_flags() +{ + double x[3]; + for (int igrid = 0; igrid < ngrid; igrid++) { + if (check_local(igrid)) + local_flags[igrid] = 1; + else { + local_flags[igrid] = 0; + memset(grid[igrid],0,size_array_cols); + } + } +} + +/* ---------------------------------------------------------------------- + free and reallocate arrays +------------------------------------------------------------------------- */ + +void ComputeGrid::allocate() +{ + // allocate arrays + + memory->destroy(grid); + memory->destroy(local_flags); + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); + memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); + memory->create(local_flags,size_array_rows,"grid:local_flags"); + memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, + nxlo,nxhi,"grid:gridlocal"); + array = gridall; +} + + +/* ---------------------------------------------------------------------- + set global grid +------------------------------------------------------------------------- */ + +void ComputeGrid::set_grid_global() +{ // calculate grid layout triclinic = domain->triclinic; @@ -100,105 +213,31 @@ void ComputeGrid::setup() delx = 1.0/delxinv; dely = 1.0/delyinv; delz = 1.0/delzinv; - - allocate(); - assign_grid_coords(); - assign_grid_local(); } /* ---------------------------------------------------------------------- - convert global array index to box coords + set local subset of grid that I own + n xyz lo/hi = 3d brick that I own (inclusive) ------------------------------------------------------------------------- */ -void ComputeGrid::grid2x(int igrid, double *x) +void ComputeGrid::set_grid_local() { - int iz = igrid / (nx*ny); - igrid -= iz * (nx*ny); - int iy = igrid / nx; - igrid -= iy * nx; - int ix = igrid; + // global indices of grid range from 0 to N-1 + // nlo,nhi = lower/upper limits of the 3d sub-brick of + // global grid that I own without ghost cells - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; + nxlo = static_cast (comm->xsplit[comm->myloc[0]] * nx); + nxhi = static_cast (comm->xsplit[comm->myloc[0]+1] * nx) - 1; - if (triclinic) domain->lamda2x(x, x); + nylo = static_cast (comm->ysplit[comm->myloc[1]] * ny); + nyhi = static_cast (comm->ysplit[comm->myloc[1]+1] * ny) - 1; + nzlo = static_cast (comm->zsplit[comm->myloc[2]] * nz); + nzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; + + ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); } -/* ---------------------------------------------------------------------- - check if grid point is local -------------------------------------------------------------------------- */ - -int ComputeGrid::check_grid_local(int igrid) -{ - double x[3]; - - int iz = igrid / (nx*ny); - igrid -= iz * (nx*ny); - int iy = igrid / nx; - igrid -= iy * nx; - int ix = igrid; - - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; - - int islocal = - x[0] >= sublo[0] && x[0] < subhi[0] && - x[1] >= sublo[1] && x[1] < subhi[1] && - x[2] >= sublo[2] && x[2] < subhi[2]; - - return islocal; -} - -/* ---------------------------------------------------------------------- - copy coords to global array -------------------------------------------------------------------------- */ - -void ComputeGrid::assign_grid_coords() -{ - double x[3]; - for (int igrid = 0; igrid < ngrid; igrid++) { - grid2x(igrid,x); - grid[igrid][0] = x[0]; - grid[igrid][1] = x[1]; - grid[igrid][2] = x[2]; - } -} - -/* ---------------------------------------------------------------------- - copy coords to global array -------------------------------------------------------------------------- */ - -void ComputeGrid::assign_grid_local() -{ - double x[3]; - for (int igrid = 0; igrid < ngrid; igrid++) { - if (check_grid_local(igrid)) - grid_local[igrid] = 1; - else { - grid_local[igrid] = 0; - memset(grid[igrid],0,size_array_cols); - } - } -} - -/* ---------------------------------------------------------------------- - free and reallocate arrays -------------------------------------------------------------------------- */ - -void ComputeGrid::allocate() -{ - // grow global array if necessary - - memory->destroy(grid); - memory->destroy(grid_local); - memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); - memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); - memory->create(grid_local,size_array_rows,"grid:grid_local"); - array = gridall; -} /* ---------------------------------------------------------------------- memory usage of local data ------------------------------------------------------------------------- */ @@ -207,6 +246,7 @@ double ComputeGrid::memory_usage() { double nbytes = size_array_rows*size_array_cols * sizeof(double); // grid - nbytes += size_array_rows*sizeof(int); // grid_local + nbytes += size_array_rows*sizeof(int); // local_flags + nbytes += size_array_cols*ngridlocal*sizeof(double); // gridlocal return nbytes; } diff --git a/src/compute_grid.h b/src/compute_grid.h index a1c938db2e..7e1a4d706b 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -30,11 +30,14 @@ class ComputeGrid : public Compute { double memory_usage(); protected: - int nx, ny, nz; // grid dimensions - int ngrid; // number of grid points + int nx, ny, nz; // global grid dimensions + int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive + int ngrid; // number of global grid points + int ngridlocal; // number of local grid points int nvalues; // number of values per grid point double **grid; // global grid double **gridall; // global grid summed over procs + double ****gridlocal; // local grid int triclinic; // triclinic flag double *boxlo, *prd; // box info (units real/ortho or reduced/tri) double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) @@ -43,12 +46,14 @@ class ComputeGrid : public Compute { int nargbase; // number of base class args double cutmax; // largest cutoff distance int size_array_cols_base; // number of columns used for coords, etc. - int *grid_local; // local flag for each grid point + int *local_flags; // local flag for each grid point void allocate(); void grid2x(int, double*); // convert grid point to coord - void assign_grid_coords(); // assign coords for grid - void assign_grid_local(); // set local flag for each grid point - int check_grid_local(int); // check if grid point is local + void assign_coords(); // assign coords for grid + void assign_local_flags(); // set local flag for each grid point + int check_local(int); // check if grid point is local + void set_grid_global(); // set global grid + void set_grid_local(); // set bounds for local grid private: }; From 4c22f094de1c0a5632c3514974f75bc6e2c85c78 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 2 Jul 2021 18:15:55 -0600 Subject: [PATCH 018/172] Minor tweak --- src/compute_grid.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index b16a51b739..1939dd544e 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -74,7 +74,6 @@ void ComputeGrid::init() void ComputeGrid::setup() { - set_grid_global(); set_grid_local(); allocate(); @@ -149,7 +148,6 @@ void ComputeGrid::assign_coords() void ComputeGrid::assign_local_flags() { - double x[3]; for (int igrid = 0; igrid < ngrid; igrid++) { if (check_local(igrid)) local_flags[igrid] = 1; From 07db7a40955ebb356ea16166985b1b296d1d8bb3 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 14 Jul 2021 13:35:05 -0600 Subject: [PATCH 019/172] Changed to different check_local() --- src/SNAP/compute_sna_grid.cpp | 6 +-- src/compute_grid.cpp | 75 ++++++++++++++++++++++++++--------- src/compute_grid.h | 3 ++ 3 files changed, 63 insertions(+), 21 deletions(-) diff --git a/src/SNAP/compute_sna_grid.cpp b/src/SNAP/compute_sna_grid.cpp index 196819008c..d2c2ae74ca 100644 --- a/src/SNAP/compute_sna_grid.cpp +++ b/src/SNAP/compute_sna_grid.cpp @@ -231,10 +231,10 @@ void ComputeSNAGrid::compute_array() gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bi*bi; - // upper-triangular elements of quadratic matrix + // upper-triangular elements of quadratic matrix - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bi*snaptr->blist[jcoeff]; + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bi*snaptr->blist[jcoeff]; } } } diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 1939dd544e..3cbcb2c2db 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -53,6 +53,7 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : size_array_rows = ngrid = nx*ny*nz; size_array_cols_base = 3; + gridlocal_allocated = 0; } /* ---------------------------------------------------------------------- */ @@ -61,7 +62,8 @@ ComputeGrid::~ComputeGrid() { memory->destroy(grid); memory->destroy(local_flags); - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + if (gridlocal_allocated) + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); } /* ---------------------------------------------------------------------- */ @@ -101,28 +103,59 @@ void ComputeGrid::grid2x(int igrid, double *x) } +/* ---------------------------------------------------------------------- + convert global array index to box coords +------------------------------------------------------------------------- */ + +void ComputeGrid::grid2ix(int igrid, int& ix, int& iy, int& iz) +{ + iz = igrid / (nx*ny); + igrid -= iz * (nx*ny); + iy = igrid / nx; + igrid -= iy * nx; + ix = igrid; +} + +// /* ---------------------------------------------------------------------- +// check if grid point is local +// ------------------------------------------------------------------------- */ + +// int ComputeGrid::check_local(int igrid) +// { +// double x[3]; + +// int iz = igrid / (nx*ny); +// igrid -= iz * (nx*ny); +// int iy = igrid / nx; +// igrid -= iy * nx; +// int ix = igrid; + +// x[0] = ix*delx; +// x[1] = iy*dely; +// x[2] = iz*delz; + +// int islocal = +// x[0] >= sublo[0] && x[0] < subhi[0] && +// x[1] >= sublo[1] && x[1] < subhi[1] && +// x[2] >= sublo[2] && x[2] < subhi[2]; + +// return islocal; +// } + /* ---------------------------------------------------------------------- check if grid point is local ------------------------------------------------------------------------- */ int ComputeGrid::check_local(int igrid) { - double x[3]; + int ix, iy, iz; - int iz = igrid / (nx*ny); - igrid -= iz * (nx*ny); - int iy = igrid / nx; - igrid -= iy * nx; - int ix = igrid; - - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; + grid2ix(igrid, ix, iy, iz); int islocal = - x[0] >= sublo[0] && x[0] < subhi[0] && - x[1] >= sublo[1] && x[1] < subhi[1] && - x[2] >= sublo[2] && x[2] < subhi[2]; + ix >= nxlo && ix <= nxhi && + iy >= nylo && iy <= nyhi && + iz >= nzlo && iz <= nzhi; return islocal; } @@ -153,7 +186,7 @@ void ComputeGrid::assign_local_flags() local_flags[igrid] = 1; else { local_flags[igrid] = 0; - memset(grid[igrid],0,size_array_cols); + memset(grid[igrid],0,size_array_cols * sizeof(double)); } } } @@ -168,12 +201,16 @@ void ComputeGrid::allocate() memory->destroy(grid); memory->destroy(local_flags); - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + if (gridlocal_allocated) + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); memory->create(local_flags,size_array_rows,"grid:local_flags"); - memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, - nxlo,nxhi,"grid:gridlocal"); + if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { + gridlocal_allocated = 1; + memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, + nxlo,nxhi,"grid:gridlocal"); + } array = gridall; } @@ -234,6 +271,8 @@ void ComputeGrid::set_grid_local() nzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); + + printf("me = %d n = %d x %d %d y %d %d z %d %d \n", comm->me, ngridlocal, nxlo, nxhi, nylo, nyhi, nzlo, nzhi); } /* ---------------------------------------------------------------------- diff --git a/src/compute_grid.h b/src/compute_grid.h index 7e1a4d706b..1b2797732d 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -47,8 +47,11 @@ class ComputeGrid : public Compute { double cutmax; // largest cutoff distance int size_array_cols_base; // number of columns used for coords, etc. int *local_flags; // local flag for each grid point + int gridlocal_allocated; // shows if gridlocal allocated + void allocate(); void grid2x(int, double*); // convert grid point to coord + void grid2ix(int, int&, int&, int&); // convert grid point to ix, iy, iz void assign_coords(); // assign coords for grid void assign_local_flags(); // set local flag for each grid point int check_local(int); // check if grid point is local From 6378d1d128612d3ee6f214bebcb88df54604a7fc Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 14 Jul 2021 13:50:49 -0600 Subject: [PATCH 020/172] Moved SNAP files to ML-SNAP --- src/{SNAP => ML-SNAP}/compute_sna_grid.cpp | 0 src/{SNAP => ML-SNAP}/compute_sna_grid.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{SNAP => ML-SNAP}/compute_sna_grid.cpp (100%) rename src/{SNAP => ML-SNAP}/compute_sna_grid.h (100%) diff --git a/src/SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp similarity index 100% rename from src/SNAP/compute_sna_grid.cpp rename to src/ML-SNAP/compute_sna_grid.cpp diff --git a/src/SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h similarity index 100% rename from src/SNAP/compute_sna_grid.h rename to src/ML-SNAP/compute_sna_grid.h From 614c3bc5b9905ba6c306a74208636e9eb9cd76c1 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 19 Jul 2021 14:44:08 -0600 Subject: [PATCH 021/172] Merged in old compute-grid --- src/ML-SNAP/compute_sna_grid.cpp | 122 +++++++++++++++++++++++-------- src/ML-SNAP/compute_sna_grid.h | 6 +- src/ML-SNAP/compute_snap.cpp | 2 - src/compute_grid.cpp | 6 +- 4 files changed, 98 insertions(+), 38 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index d2c2ae74ca..89e4b450bb 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -13,8 +13,6 @@ #include "compute_grid.h" #include "compute_sna_grid.h" -#include -#include #include "sna.h" #include "atom.h" #include "update.h" @@ -27,17 +25,20 @@ #include "comm.h" #include "memory.h" #include "error.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : - ComputeGrid(lmp, narg, arg), cutsq(NULL), sna(NULL), - radelem(NULL), wjelem(NULL) + ComputeGrid(lmp, narg, arg), cutsq(nullptr), + radelem(nullptr), wjelem(nullptr) { - double rmin0, rfac0; - int twojmax, switchflag, bzeroflag; - radelem = NULL; - wjelem = NULL; + + double rfac0, rmin0; + int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; // skip over arguments used by base class // so that argument positions are identical to @@ -57,10 +58,14 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : switchflag = 1; bzeroflag = 1; quadraticflag = 0; + chemflag = 0; + bnormflag = 0; + wselfallflag = 0; + nelements = 1; + + // process required arguments - // offset by 1 to match up with types - - memory->create(radelem,ntypes+1,"sna/grid:radelem"); + memory->create(radelem,ntypes+1,"sna/grid:radelem"); // offset by 1 to match up with types memory->create(wjelem,ntypes+1,"sna/grid:wjelem"); rcutfac = atof(arg[3]); @@ -112,12 +117,36 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/grid command"); quadraticflag = atoi(arg[iarg+1]); iarg += 2; + } else if (strcmp(arg[iarg],"chem") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + chemflag = 1; + memory->create(map,ntypes+1,"compute_sna_grid:map"); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + for (int i = 0; i < ntypes; i++) { + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); + if (jelem < 0 || jelem >= nelements) + error->all(FLERR,"Illegal compute sna/grid command"); + map[i+1] = jelem; + } + iarg += 2+ntypes; + } else if (strcmp(arg[iarg],"bnormflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + bnormflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"wselfallflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid command"); + wselfallflag = atoi(arg[iarg+1]); + iarg += 2; } else error->all(FLERR,"Illegal compute sna/grid command"); } - snaptr = new SNA(lmp,rfac0,twojmax, - rmin0,switchflag,bzeroflag); + snaptr = new SNA(lmp, rfac0, twojmax, + rmin0, switchflag, bzeroflag, + chemflag, bnormflag, wselfallflag, nelements); ncoeff = snaptr->ncoeff; nvalues = ncoeff; @@ -130,18 +159,19 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : ComputeSNAGrid::~ComputeSNAGrid() { - memory->destroy(sna); memory->destroy(radelem); memory->destroy(wjelem); memory->destroy(cutsq); delete snaptr; + + if (chemflag) memory->destroy(map); } /* ---------------------------------------------------------------------- */ void ComputeSNAGrid::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute sna/grid requires a pair style be defined"); if (cutmax > force->pair->cutforce) @@ -170,12 +200,28 @@ void ComputeSNAGrid::compute_array() { invoked_array = update->ntimestep; - int * const type = atom->type; + // invoke full neighbor list (will copy or build if necessary) + + // neighbor->build_one(list); + + int mynxlo = static_cast (comm->xsplit[comm->myloc[0]] * nx); + int mynxhi = static_cast (comm->xsplit[comm->myloc[0]+1] * nx) - 1; + + int mynylo = static_cast (comm->ysplit[comm->myloc[1]] * ny); + int mynyhi = static_cast (comm->ysplit[comm->myloc[1]+1] * ny) - 1; + + int mynzlo = static_cast (comm->zsplit[comm->myloc[2]] * nz); + int mynzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; + + int myngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); + + printf("me = %d n = %d x %d %d y %d %d z %d %d \n", comm->me, myngridlocal, mynxlo, mynxhi, mynylo, mynyhi, mynzlo, mynzhi); // compute sna for each gridpoint double** const x = atom->x; const int* const mask = atom->mask; + int * const type = atom->type; const int ntotal = atom->nlocal + atom->nghost; // insure rij, inside, and typej are of size jnum @@ -190,6 +236,14 @@ void ComputeSNAGrid::compute_array() const double ytmp = grid[igrid][1]; const double ztmp = grid[igrid][2]; + // currently, all grid points are type 1 + + const int itype = 1; + int ielem = 0; + if (chemflag) + ielem = map[itype]; + const double radi = radelem[itype]; + // rij[][3] = displacements between atom I and those neighbors // inside = indices of neighbors of I within cutoff // typej = types of neighbors of I within cutoff @@ -206,6 +260,9 @@ void ComputeSNAGrid::compute_array() const double delz = ztmp - x[j][2]; const double rsq = delx*delx + dely*dely + delz*delz; int jtype = type[j]; + int jelem = 0; + if (chemflag) + jelem = map[jtype]; if (rsq < cutsq[jtype][jtype] && rsq>1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; @@ -213,32 +270,33 @@ void ComputeSNAGrid::compute_array() snaptr->inside[ninside] = j; snaptr->wj[ninside] = wjelem[jtype]; snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + snaptr->element[ninside] = jelem; // element index for multi-element snap ninside++; } } - snaptr->compute_ui(ninside); + snaptr->compute_ui(ninside, ielem); snaptr->compute_zi(); - snaptr->compute_bi(); + snaptr->compute_bi(ielem); + + // linear contributions + for (int icoeff = 0; icoeff < ncoeff; icoeff++) gridlocal[size_array_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; + + // quadratic contributions + if (quadraticflag) { int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { - double bi = snaptr->blist[icoeff]; - - // diagonal element of quadratic matrix - - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bi*bi; - - // upper-triangular elements of quadratic matrix - + double bveci = snaptr->blist[icoeff]; + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bi*snaptr->blist[jcoeff]; + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bveci*snaptr->blist[jcoeff]; + } + } } - } - } - + for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { @@ -257,7 +315,9 @@ void ComputeSNAGrid::compute_array() double ComputeSNAGrid::memory_usage() { - double nbytes = snaptr->memory_usage(); // SNA object + double nbytes = snaptr->memory_usage(); // SNA object + int n = atom->ntypes+1; + nbytes += (double)n*sizeof(int); // map return nbytes; } diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index 0242a2962b..e2640081af 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -35,11 +35,13 @@ class ComputeSNAGrid : public ComputeGrid { private: int ncoeff; double **cutsq; - double **sna; double rcutfac; double *radelem; double *wjelem; - class SNA* snaptr; + int *map; // map types to [0,nelements) + int nelements, chemflag; + class SNA *snaptr; + double cutmax; int quadraticflag; }; diff --git a/src/ML-SNAP/compute_snap.cpp b/src/ML-SNAP/compute_snap.cpp index 63deff9f8f..6da7b78444 100644 --- a/src/ML-SNAP/compute_snap.cpp +++ b/src/ML-SNAP/compute_snap.cpp @@ -43,8 +43,6 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = nullptr; - wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 3cbcb2c2db..3bdbddbc0c 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -41,9 +41,9 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : int iarg = iarg0; if (strcmp(arg[iarg],"grid") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal compute grid command"); - nx = force->inumeric(FLERR,arg[iarg+1]); - ny = force->inumeric(FLERR,arg[iarg+2]); - nz = force->inumeric(FLERR,arg[iarg+3]); + nx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (nx <= 0 || ny <= 0 || nz <= 0) error->all(FLERR,"All grid dimensions must be positive"); iarg += 4; From 6d75912f7a567925c5f36ef19fd3f5e6d46d12ff Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 28 Jul 2021 18:34:08 -0600 Subject: [PATCH 022/172] Switched to local array --- src/ML-SNAP/compute_sna_grid.cpp | 30 +++++++++------ src/ML-SNAP/compute_sna_grid.h | 2 + src/compute_grid.cpp | 64 +++++++++++++++++++++++++------- 3 files changed, 71 insertions(+), 25 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 89e4b450bb..0b0c0674e4 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -22,6 +22,7 @@ #include "neigh_request.h" #include "force.h" #include "pair.h" +#include "domain.h" #include "comm.h" #include "memory.h" #include "error.h" @@ -196,26 +197,31 @@ void ComputeSNAGrid::init() /* ---------------------------------------------------------------------- */ +void ComputeSNAGrid::init_list(int /*id*/, NeighList *ptr) +{ + list = ptr; +} + +/* ---------------------------------------------------------------------- */ + void ComputeSNAGrid::compute_array() { invoked_array = update->ntimestep; - // invoke full neighbor list (will copy or build if necessary) + // // invoke full neighbor list (will copy or build if necessary) - // neighbor->build_one(list); + // neighbor->build_one(list); - int mynxlo = static_cast (comm->xsplit[comm->myloc[0]] * nx); - int mynxhi = static_cast (comm->xsplit[comm->myloc[0]+1] * nx) - 1; + // int mynxlo = static_cast (comm->xsplit[comm->myloc[0]] * nx); + // int mynxhi = static_cast (comm->xsplit[comm->myloc[0]+1] * nx) - 1; - int mynylo = static_cast (comm->ysplit[comm->myloc[1]] * ny); - int mynyhi = static_cast (comm->ysplit[comm->myloc[1]+1] * ny) - 1; + // int mynylo = static_cast (comm->ysplit[comm->myloc[1]] * ny); + // int mynyhi = static_cast (comm->ysplit[comm->myloc[1]+1] * ny) - 1; - int mynzlo = static_cast (comm->zsplit[comm->myloc[2]] * nz); - int mynzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; + // int mynzlo = static_cast (comm->zsplit[comm->myloc[2]] * nz); + // int mynzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; - int myngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); - - printf("me = %d n = %d x %d %d y %d %d z %d %d \n", comm->me, myngridlocal, mynxlo, mynxhi, mynylo, mynyhi, mynzlo, mynzhi); + // int myngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); // compute sna for each gridpoint @@ -263,7 +269,7 @@ void ComputeSNAGrid::compute_array() int jelem = 0; if (chemflag) jelem = map[jtype]; - if (rsq < cutsq[jtype][jtype] && rsq>1e-20) { + if (rsq < cutsq[jtype][jtype]) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; snaptr->rij[ninside][2] = delz; diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index e2640081af..d40c87df9b 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -29,12 +29,14 @@ class ComputeSNAGrid : public ComputeGrid { ComputeSNAGrid(class LAMMPS *, int, char **); ~ComputeSNAGrid(); void init(); + void init_list(int, class NeighList *); void compute_array(); double memory_usage(); private: int ncoeff; double **cutsq; + class NeighList *list; double rcutfac; double *radelem; double *wjelem; diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 3bdbddbc0c..740131deda 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), grid(NULL), local_flags(NULL), gridlocal(NULL) + Compute(lmp, narg, arg), grid(nullptr), gridall(nullptr), local_flags(nullptr), gridlocal(nullptr) { if (narg < 6) error->all(FLERR,"Illegal compute grid command"); @@ -61,9 +61,12 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid::~ComputeGrid() { memory->destroy(grid); + memory->destroy(gridall); memory->destroy(local_flags); - if (gridlocal_allocated) + if (gridlocal_allocated) { + gridlocal_allocated = 0; memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + } } /* ---------------------------------------------------------------------- */ @@ -200,9 +203,14 @@ void ComputeGrid::allocate() // allocate arrays memory->destroy(grid); + memory->destroy(gridall); memory->destroy(local_flags); - if (gridlocal_allocated) - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + if (gridlocal_allocated) { + gridlocal_allocated = 0; + // can't seem to do this without seg-fault + // memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + } + memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); memory->create(local_flags,size_array_rows,"grid:local_flags"); @@ -257,18 +265,48 @@ void ComputeGrid::set_grid_global() void ComputeGrid::set_grid_local() { - // global indices of grid range from 0 to N-1 - // nlo,nhi = lower/upper limits of the 3d sub-brick of - // global grid that I own without ghost cells + // nx,ny,nz = extent of global grid + // indices into the global grid range from 0 to N-1 in each dim + // if grid point is inside my sub-domain I own it, + // this includes sub-domain lo boundary but excludes hi boundary + // ixyz lo/hi = inclusive lo/hi bounds of global grid sub-brick I own + // if proc owns no grid cells in a dim, then ilo > ihi + // if 2 procs share a boundary a grid point is exactly on, + // the 2 equality if tests insure a consistent decision + // as to which proc owns it - nxlo = static_cast (comm->xsplit[comm->myloc[0]] * nx); - nxhi = static_cast (comm->xsplit[comm->myloc[0]+1] * nx) - 1; + double xfraclo,xfrachi,yfraclo,yfrachi,zfraclo,zfrachi; - nylo = static_cast (comm->ysplit[comm->myloc[1]] * ny); - nyhi = static_cast (comm->ysplit[comm->myloc[1]+1] * ny) - 1; + if (comm->layout != Comm::LAYOUT_TILED) { + xfraclo = comm->xsplit[comm->myloc[0]]; + xfrachi = comm->xsplit[comm->myloc[0]+1]; + yfraclo = comm->ysplit[comm->myloc[1]]; + yfrachi = comm->ysplit[comm->myloc[1]+1]; + zfraclo = comm->zsplit[comm->myloc[2]]; + zfrachi = comm->zsplit[comm->myloc[2]+1]; + } else { + xfraclo = comm->mysplit[0][0]; + xfrachi = comm->mysplit[0][1]; + yfraclo = comm->mysplit[1][0]; + yfrachi = comm->mysplit[1][1]; + zfraclo = comm->mysplit[2][0]; + zfrachi = comm->mysplit[2][1]; + } - nzlo = static_cast (comm->zsplit[comm->myloc[2]] * nz); - nzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; + nxlo = static_cast (xfraclo * nx); + if (1.0*nxlo != xfraclo*nx) nxlo++; + nxhi = static_cast (xfrachi * nx); + if (1.0*nxhi == xfrachi*nx) nxhi--; + + nylo = static_cast (yfraclo * ny); + if (1.0*nylo != yfraclo*ny) nylo++; + nyhi = static_cast (yfrachi * ny); + if (1.0*nyhi == yfrachi*ny) nyhi--; + + nzlo = static_cast (zfraclo * nz); + if (1.0*nzlo != zfraclo*nz) nzlo++; + nzhi = static_cast (zfrachi * nz); + if (1.0*nzhi == zfrachi*nz) nzhi--; ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); From 162868f13c5aa8b314634b0a89bbc8851a6f508c Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 30 Jul 2021 10:01:20 -0600 Subject: [PATCH 023/172] Readded r=0 check --- src/ML-SNAP/compute_sna_grid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 0b0c0674e4..62778a9e83 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -269,7 +269,7 @@ void ComputeSNAGrid::compute_array() int jelem = 0; if (chemflag) jelem = map[jtype]; - if (rsq < cutsq[jtype][jtype]) { + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; snaptr->rij[ninside][2] = delz; From 347e5a59783a4924aee2cf48a3b09c46c15d3374 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 22 Aug 2021 16:03:50 -0600 Subject: [PATCH 024/172] Created local grid that is used to populate global grid --- src/ML-SNAP/compute_sna_grid.cpp | 27 ++++++--------------------- src/compute_grid.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 62778a9e83..2def0cf6a4 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -37,7 +37,6 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { - double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -208,21 +207,6 @@ void ComputeSNAGrid::compute_array() { invoked_array = update->ntimestep; - // // invoke full neighbor list (will copy or build if necessary) - - // neighbor->build_one(list); - - // int mynxlo = static_cast (comm->xsplit[comm->myloc[0]] * nx); - // int mynxhi = static_cast (comm->xsplit[comm->myloc[0]+1] * nx) - 1; - - // int mynylo = static_cast (comm->ysplit[comm->myloc[1]] * ny); - // int mynyhi = static_cast (comm->ysplit[comm->myloc[1]+1] * ny) - 1; - - // int mynzlo = static_cast (comm->zsplit[comm->myloc[2]] * nz); - // int mynzhi = static_cast (comm->zsplit[comm->myloc[2]+1] * nz) - 1; - - // int myngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); - // compute sna for each gridpoint double** const x = atom->x; @@ -285,7 +269,7 @@ void ComputeSNAGrid::compute_array() snaptr->compute_zi(); snaptr->compute_bi(ielem); - // linear contributions + // linear contributions for (int icoeff = 0; icoeff < ncoeff; icoeff++) gridlocal[size_array_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; @@ -302,16 +286,17 @@ void ComputeSNAGrid::compute_array() } } } - + for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - const int igrid = iz*(nx*ny) + iy*nx + ix; - for (int j = 0; j < nvalues; j++) - grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; + const int igrid = iz*(nx*ny) + iy*nx + ix; + for (int j = 0; j < nvalues; j++) + grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; } MPI_Allreduce(&grid[0][0],&gridall[0][0],ngrid*size_array_cols,MPI_DOUBLE,MPI_SUM,world); + } diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 740131deda..0d880b94d5 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -207,8 +207,11 @@ void ComputeGrid::allocate() memory->destroy(local_flags); if (gridlocal_allocated) { gridlocal_allocated = 0; - // can't seem to do this without seg-fault + // MEMORY LEAK!! + // can't seem to free this memory without seg-fault + // printf("Before allocate destroy4d, proc %d %p\n",comm->me,gridlocal); // memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + // printf("After allocate destroy4d, proc %d %p\n",comm->me,gridlocal); } memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); @@ -310,7 +313,6 @@ void ComputeGrid::set_grid_local() ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); - printf("me = %d n = %d x %d %d y %d %d z %d %d \n", comm->me, ngridlocal, nxlo, nxhi, nylo, nyhi, nzlo, nzhi); } /* ---------------------------------------------------------------------- From 94c97e83a2b108f681a90ea72a0d4e340ba269bc Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 22 Aug 2021 18:30:02 -0600 Subject: [PATCH 025/172] Added this helper file --- examples/snap/lammps_utils.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 examples/snap/lammps_utils.py diff --git a/examples/snap/lammps_utils.py b/examples/snap/lammps_utils.py new file mode 100644 index 0000000000..ea74459a74 --- /dev/null +++ b/examples/snap/lammps_utils.py @@ -0,0 +1,26 @@ +import numpy as np +import ctypes + +def set_cmdlinevars(cmdargs, argdict): + for key in argdict.keys(): + cmdargs += ["-var",key,f"{argdict[key]}"] + return cmdargs + +def extract_commands(string): + return [x for x in string.splitlines() if x.strip() != ''] + +def extract_compute_np(lmp,name,compute_type,result_type,array_shape): + """ + Convert a lammps compute to a numpy array. + Assumes the compute returns a floating point numbers. + Note that the result is a view into the original memory. + If the result type is 0 (scalar) then conversion to numpy is skipped and a python float is returned. + """ + ptr = lmp.extract_compute(name, compute_type, result_type) # 1,2: Style (1) is per-atom compute, returns array type (2). + if result_type == 0: return ptr # No casting needed, lammps.py already works + if result_type == 2: ptr = ptr.contents + total_size = np.prod(array_shape) + buffer_ptr = ctypes.cast(ptr, ctypes.POINTER(ctypes.c_double * total_size)) + array_np = np.frombuffer(buffer_ptr.contents, dtype=float) + array_np.shape = array_shape + return array_np From 1b1f6f29c251b8c03d254737927149ebdba08211 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 22 Aug 2021 18:44:35 -0600 Subject: [PATCH 026/172] Updated grid.py to use sna/grid/local compute, but it seg-faults --- examples/snap/in.grid.python | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/snap/in.grid.python b/examples/snap/in.grid.python index 13fe6d0638..e04415d558 100644 --- a/examples/snap/in.grid.python +++ b/examples/snap/in.grid.python @@ -43,6 +43,8 @@ compute b all sna/atom ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${r compute bgrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} +compute bgridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} + # create dummy potential for neighbor list variable rcutneigh equal 2.0*${rcutfac}*${radelem} @@ -56,6 +58,8 @@ thermo_modify norm yes dump mydump_b all custom 1000 dump_b id c_b[*] +dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_bgridlocal[1] + # run run 0 From f473ca498bbe32b6439bfe78cfc937ef5e54fe71 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 22 Aug 2021 19:24:23 -0600 Subject: [PATCH 027/172] Created in.grid.local, fixed some problems in src --- examples/snap/in.grid.local | 73 ++++++ src/ML-SNAP/compute_sna_grid_local.cpp | 308 +++++++++++++++++++++++++ src/ML-SNAP/compute_sna_grid_local.h | 75 ++++++ src/compute_grid_local.cpp | 253 ++++++++++++++++++++ src/compute_grid_local.h | 69 ++++++ 5 files changed, 778 insertions(+) create mode 100644 examples/snap/in.grid.local create mode 100644 src/ML-SNAP/compute_sna_grid_local.cpp create mode 100644 src/ML-SNAP/compute_sna_grid_local.h create mode 100644 src/compute_grid_local.cpp create mode 100644 src/compute_grid_local.h diff --git a/examples/snap/in.grid.local b/examples/snap/in.grid.local new file mode 100644 index 0000000000..dc04fd5371 --- /dev/null +++ b/examples/snap/in.grid.local @@ -0,0 +1,73 @@ +# Demonstrate bispectrum computes with local grid + +# Initialize simulation + +variable nsteps index 0 +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 0 1 0 & + a3 0 0 1 & + basis 0 0 0 & + basis 0.5 0.5 0.5 & +# origin 0.25 0.25 0.25 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +# choose potential + +include Ta06A.snap + +# define grid compute and atom compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 1 + +compute b all sna/atom & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +# define output + +# mygrid is ngrid by (3+nbis) = 8x8 +thermo_style custom step temp ke pe vol +thermo_modify norm yes + +dump mydump_b all custom 1000 dump_b id c_b[*] +dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_mygridlocal[*] + +# run + +run 0 + diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp new file mode 100644 index 0000000000..18d9f5496d --- /dev/null +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -0,0 +1,308 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "compute_grid_local.h" +#include "compute_sna_grid_local.h" +#include "sna.h" +#include "atom.h" +#include "update.h" +#include "modify.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "force.h" +#include "pair.h" +#include "domain.h" +#include "comm.h" +#include "memory.h" +#include "error.h" +#include "tokenizer.h" + +#include +#include + +using namespace LAMMPS_NS; + +ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : + ComputeGridLocal(lmp, narg, arg), cutsq(nullptr), + radelem(nullptr), wjelem(nullptr) +{ + double rfac0, rmin0; + int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; + + // skip over arguments used by base class + // so that argument positions are identical to + // regular per-atom compute + + arg += nargbase; + narg -= nargbase; + + int ntypes = atom->ntypes; + int nargmin = 6+2*ntypes; + + if (narg < nargmin) error->all(FLERR,"Illegal compute sna/grid/local command"); + + // default values + + rmin0 = 0.0; + switchflag = 1; + bzeroflag = 1; + quadraticflag = 0; + chemflag = 0; + bnormflag = 0; + wselfallflag = 0; + nelements = 1; + + // process required arguments + + memory->create(radelem,ntypes+1,"sna/grid/local:radelem"); // offset by 1 to match up with types + memory->create(wjelem,ntypes+1,"sna/grid/local:wjelem"); + + rcutfac = atof(arg[3]); + rfac0 = atof(arg[4]); + twojmax = atoi(arg[5]); + + for(int i = 0; i < ntypes; i++) + radelem[i+1] = atof(arg[6+i]); + for(int i = 0; i < ntypes; i++) + wjelem[i+1] = atof(arg[6+ntypes+i]); + + // construct cutsq + + double cut; + cutmax = 0.0; + memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid/local:cutsq"); + for(int i = 1; i <= ntypes; i++) { + cut = 2.0*radelem[i]*rcutfac; + if (cut > cutmax) cutmax = cut; + cutsq[i][i] = cut*cut; + for(int j = i+1; j <= ntypes; j++) { + cut = (radelem[i]+radelem[j])*rcutfac; + cutsq[i][j] = cutsq[j][i] = cut*cut; + } + } + + // process optional args + + int iarg = nargmin; + + while (iarg < narg) { + if (strcmp(arg[iarg],"rmin0") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + rmin0 = atof(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"switchflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + switchflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"bzeroflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + bzeroflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"quadraticflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + quadraticflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"chem") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + chemflag = 1; + memory->create(map,ntypes+1,"compute_sna_grid_local:map"); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + for (int i = 0; i < ntypes; i++) { + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); + if (jelem < 0 || jelem >= nelements) + error->all(FLERR,"Illegal compute sna/grid/local command"); + map[i+1] = jelem; + } + iarg += 2+ntypes; + } else if (strcmp(arg[iarg],"bnormflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + bnormflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"wselfallflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute sna/grid/local command"); + wselfallflag = atoi(arg[iarg+1]); + iarg += 2; + } else error->all(FLERR,"Illegal compute sna/grid/local command"); + + } + + snaptr = new SNA(lmp, rfac0, twojmax, + rmin0, switchflag, bzeroflag, + chemflag, bnormflag, wselfallflag, nelements); + + ncoeff = snaptr->ncoeff; + nvalues = ncoeff; + if (quadraticflag) nvalues += (ncoeff*(ncoeff+1))/2; + size_local_cols = size_local_cols_base + nvalues; +} + +/* ---------------------------------------------------------------------- */ + +ComputeSNAGridLocal::~ComputeSNAGridLocal() +{ + memory->destroy(radelem); + memory->destroy(wjelem); + memory->destroy(cutsq); + delete snaptr; + + if (chemflag) memory->destroy(map); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeSNAGridLocal::init() +{ + if (force->pair == nullptr) + error->all(FLERR,"Compute sna/grid/local requires a pair style be defined"); + + if (cutmax > force->pair->cutforce) + error->all(FLERR,"Compute sna/grid/local cutoff is longer than pairwise cutoff"); + + // need an occasional full neighbor list + + int irequest = neighbor->request(this,instance_me); + neighbor->requests[irequest]->pair = 0; + neighbor->requests[irequest]->compute = 1; + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + neighbor->requests[irequest]->occasional = 1; + + int count = 0; + for (int i = 0; i < modify->ncompute; i++) + if (strcmp(modify->compute[i]->style,"sna/grid/local") == 0) count++; + if (count > 1 && comm->me == 0) + error->warning(FLERR,"More than one compute sna/grid/local"); + snaptr->init(); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeSNAGridLocal::init_list(int /*id*/, NeighList *ptr) +{ + list = ptr; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeSNAGridLocal::compute_local() +{ + invoked_array = update->ntimestep; + + // compute sna for each gridpoint + + double** const x = atom->x; + const int* const mask = atom->mask; + int * const type = atom->type; + const int ntotal = atom->nlocal + atom->nghost; + + // insure rij, inside, and typej are of size jnum + + snaptr->grow_rij(ntotal); + + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + double xgrid[3]; + grid2x(ix, iy, iz, xgrid); + const double xtmp = xgrid[0]; + const double ytmp = xgrid[1]; + const double ztmp = xgrid[2]; + + // currently, all grid points are type 1 + + const int itype = 1; + int ielem = 0; + if (chemflag) + ielem = map[itype]; + const double radi = radelem[itype]; + + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff + + int ninside = 0; + for (int j = 0; j < ntotal; j++) { + + // check that j is in compute group + + if (!(mask[j] & groupbit)) continue; + + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + int jelem = 0; + if (chemflag) + jelem = map[jtype]; + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + snaptr->element[ninside] = jelem; // element index for multi-element snap + ninside++; + } + } + + snaptr->compute_ui(ninside, ielem); + snaptr->compute_zi(); + snaptr->compute_bi(ielem); + + // linear contributions + + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + gridlocal[size_local_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; + + // quadratic contributions + + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bveci = snaptr->blist[icoeff]; + gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = bveci*snaptr->blist[jcoeff]; + } + } + } + + // copy 4d array to 2d array + + copy_gridlocal_to_local_array(); +} + + +/* ---------------------------------------------------------------------- + memory usage +------------------------------------------------------------------------- */ + +double ComputeSNAGridLocal::memory_usage() +{ + double nbytes = snaptr->memory_usage(); // SNA object + int n = atom->ntypes+1; + nbytes += (double)n*sizeof(int); // map + + return nbytes; +} + diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h new file mode 100644 index 0000000000..21e321d123 --- /dev/null +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -0,0 +1,75 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS + +ComputeStyle(sna/grid/local,ComputeSNAGridLocal) + +#else + +#ifndef LMP_COMPUTE_SNA_GRID_LOCAL_H +#define LMP_COMPUTE_SNA_GRID_LOCAL_H + +#include "compute_grid_local.h" + +namespace LAMMPS_NS { + +class ComputeSNAGridLocal : public ComputeGridLocal { + public: + ComputeSNAGridLocal(class LAMMPS *, int, char **); + ~ComputeSNAGridLocal(); + void init(); + void init_list(int, class NeighList *); + void compute_local(); + double memory_usage(); + + private: + int ncoeff; + double **cutsq; + class NeighList *list; + double rcutfac; + double *radelem; + double *wjelem; + int *map; // map types to [0,nelements) + int nelements, chemflag; + class SNA *snaptr; + double cutmax; + int quadraticflag; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Compute sna/grid/local requires a pair style be defined + +Self-explanatory. + +E: Compute sna/grid/local cutoff is longer than pairwise cutoff + +Self-explanatory. + +W: More than one compute sna/grid/local + +Self-explanatory. + +*/ diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp new file mode 100644 index 0000000000..8c0f8ff066 --- /dev/null +++ b/src/compute_grid_local.cpp @@ -0,0 +1,253 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "compute_grid_local.h" +#include +#include +#include "atom.h" +#include "update.h" +#include "modify.h" +#include "domain.h" +#include "force.h" +#include "memory.h" +#include "error.h" +#include "comm.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +ComputeGridLocal::ComputeGridLocal(LAMMPS *lmp, int narg, char **arg) : + Compute(lmp, narg, arg), gridlocal(nullptr), alocal(nullptr) +{ + if (narg < 6) error->all(FLERR,"Illegal compute grid/local command"); + + local_flag = 1; + size_local_cols = 0; + size_local_rows = 0; + extarray = 0; + + int iarg0 = 3; + int iarg = iarg0; + if (strcmp(arg[iarg],"grid") == 0) { + if (iarg+4 > narg) error->all(FLERR,"Illegal compute grid/local command"); + nx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + if (nx <= 0 || ny <= 0 || nz <= 0) + error->all(FLERR,"All grid/local dimensions must be positive"); + iarg += 4; + } else error->all(FLERR,"Illegal compute grid/local command"); + + nargbase = iarg - iarg0; + + size_local_cols_base = 6; + gridlocal_allocated = 0; +} + +/* ---------------------------------------------------------------------- */ + +ComputeGridLocal::~ComputeGridLocal() +{ + if (gridlocal_allocated) { + gridlocal_allocated = 0; + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + } + memory->destroy(alocal); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeGridLocal::init() +{ +} + +/* ---------------------------------------------------------------------- */ + +void ComputeGridLocal::setup() +{ + set_grid_global(); + set_grid_local(); + allocate(); +} + +/* ---------------------------------------------------------------------- + convert global array indexes to box coords +------------------------------------------------------------------------- */ + +void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) +{ + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; + + if (triclinic) domain->lamda2x(x, x); +} + +/* ---------------------------------------------------------------------- + free and reallocate arrays +------------------------------------------------------------------------- */ + +void ComputeGridLocal::allocate() +{ + // allocate local array + + if (gridlocal_allocated) { + gridlocal_allocated = 0; + // MEMORY LEAK!! + // can't seem to free this memory without seg-fault + // printf("Before allocate destroy4d, proc %d %p\n",comm->me,gridlocal); + // memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + // printf("After allocate destroy4d, proc %d %p\n",comm->me,gridlocal); + } + + if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { + gridlocal_allocated = 1; + memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, + nxlo,nxhi,"grid:gridlocal"); + } +} + +/* ---------------------------------------------------------------------- + set global grid +------------------------------------------------------------------------- */ + +void ComputeGridLocal::set_grid_global() +{ + // calculate grid layout + + triclinic = domain->triclinic; + + if (triclinic == 0) { + prd = domain->prd; + boxlo = domain->boxlo; + sublo = domain->sublo; + subhi = domain->subhi; + } else { + prd = domain->prd_lamda; + boxlo = domain->boxlo_lamda; + sublo = domain->sublo_lamda; + subhi = domain->subhi_lamda; + } + + double xprd = prd[0]; + double yprd = prd[1]; + double zprd = prd[2]; + + delxinv = nx/xprd; + delyinv = ny/yprd; + delzinv = nz/zprd; + + delx = 1.0/delxinv; + dely = 1.0/delyinv; + delz = 1.0/delzinv; +} + +/* ---------------------------------------------------------------------- + set local subset of grid that I own + n xyz lo/hi = 3d brick that I own (inclusive) +------------------------------------------------------------------------- */ + +void ComputeGridLocal::set_grid_local() +{ + // nx,ny,nz = extent of global grid + // indices into the global grid range from 0 to N-1 in each dim + // if grid point is inside my sub-domain I own it, + // this includes sub-domain lo boundary but excludes hi boundary + // ixyz lo/hi = inclusive lo/hi bounds of global grid sub-brick I own + // if proc owns no grid cells in a dim, then ilo > ihi + // if 2 procs share a boundary a grid point is exactly on, + // the 2 equality if tests insure a consistent decision + // as to which proc owns it + + double xfraclo,xfrachi,yfraclo,yfrachi,zfraclo,zfrachi; + + if (comm->layout != Comm::LAYOUT_TILED) { + xfraclo = comm->xsplit[comm->myloc[0]]; + xfrachi = comm->xsplit[comm->myloc[0]+1]; + yfraclo = comm->ysplit[comm->myloc[1]]; + yfrachi = comm->ysplit[comm->myloc[1]+1]; + zfraclo = comm->zsplit[comm->myloc[2]]; + zfrachi = comm->zsplit[comm->myloc[2]+1]; + } else { + xfraclo = comm->mysplit[0][0]; + xfrachi = comm->mysplit[0][1]; + yfraclo = comm->mysplit[1][0]; + yfrachi = comm->mysplit[1][1]; + zfraclo = comm->mysplit[2][0]; + zfrachi = comm->mysplit[2][1]; + } + + nxlo = static_cast (xfraclo * nx); + if (1.0*nxlo != xfraclo*nx) nxlo++; + nxhi = static_cast (xfrachi * nx); + if (1.0*nxhi == xfrachi*nx) nxhi--; + + nylo = static_cast (yfraclo * ny); + if (1.0*nylo != yfraclo*ny) nylo++; + nyhi = static_cast (yfrachi * ny); + if (1.0*nyhi == yfrachi*ny) nyhi--; + + nzlo = static_cast (zfraclo * nz); + if (1.0*nzlo != zfraclo*nz) nzlo++; + nzhi = static_cast (zfrachi * nz); + if (1.0*nzhi == zfrachi*nz) nzhi--; + + ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); + size_local_rows = ngridlocal; + + memory->destroy(alocal); + memory->create(alocal, size_local_rows, size_local_cols, "compute/grid/local:alocal"); + array_local = alocal; + + int igrid = 0; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + alocal[igrid][0] = ix; + alocal[igrid][1] = iy; + alocal[igrid][2] = iz; + double xgrid[3]; + grid2x(ix, iy, iz, xgrid); + alocal[igrid][3] = xgrid[0]; + alocal[igrid][4] = xgrid[1]; + alocal[igrid][5] = xgrid[2]; + igrid++; + } +} + +/* ---------------------------------------------------------------------- + copy the 4d gridlocal array values to the 2d local array +------------------------------------------------------------------------- */ + +void ComputeGridLocal::copy_gridlocal_to_local_array() +{ + int igrid = 0; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + for (int icol = size_local_cols_base; icol < size_local_cols; icol++) + alocal[igrid][icol] = gridlocal[icol][iz][iy][ix]; + igrid++; + } +} + +/* ---------------------------------------------------------------------- + memory usage of local data +------------------------------------------------------------------------- */ + +double ComputeGridLocal::memory_usage() +{ + int nbytes = size_array_cols*ngridlocal*sizeof(double); // gridlocal + return nbytes; +} diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h new file mode 100644 index 0000000000..b6cd882b2e --- /dev/null +++ b/src/compute_grid_local.h @@ -0,0 +1,69 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef LMP_COMPUTE_GRID_LOCAL_H +#define LMP_COMPUTE_GRID_LOCAL_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeGridLocal : public Compute { + public: + + ComputeGridLocal(class LAMMPS *, int, char **); + virtual ~ComputeGridLocal(); + void init(); + void setup(); + virtual void compute_local() = 0; + + double memory_usage(); + + protected: + int nx, ny, nz; // global grid dimensions + int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive + int ngridlocal; // number of local grid points + int nvalues; // number of values per grid point + double ****gridlocal; // local grid + double **alocal; // pointer to Compute::array_local + int triclinic; // triclinic flag + double *boxlo, *prd; // box info (units real/ortho or reduced/tri) + double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) + double delxinv,delyinv,delzinv; // inverse grid spacing + double delx,dely,delz; // grid spacing + int nargbase; // number of base class args + double cutmax; // largest cutoff distance + int size_local_cols_base; // number of columns used for coords, etc. + int gridlocal_allocated; // shows if gridlocal allocated + + void allocate(); + void grid2x(int, int, int, double*); // convert global indices to coordinates + void set_grid_global(); // set global grid + void set_grid_local(); // set bounds for local grid + void copy_gridlocal_to_local_array();// copy 4d gridlocal array to 2d local array + private: +}; + +} + +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +*/ From 5bf13b2f3cc2c8e603f4ee20ae5cbb4c8cb4c1fb Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 25 Aug 2021 17:50:40 -0600 Subject: [PATCH 028/172] Declared victory on compute grid and grid/local --- src/ML-SNAP/compute_sna_grid_local.cpp | 11 +++++++---- src/compute_grid.cpp | 6 +----- src/compute_grid_local.cpp | 10 +++------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 18d9f5496d..c1574bfa26 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -272,17 +272,20 @@ void ComputeSNAGridLocal::compute_local() // linear contributions for (int icoeff = 0; icoeff < ncoeff; icoeff++) - gridlocal[size_local_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; - + gridlocal[size_local_cols_base+icoeff][iz][iy][ix] = + snaptr->blist[icoeff]; + // quadratic contributions if (quadraticflag) { int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { double bveci = snaptr->blist[icoeff]; - gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; + gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = + 0.5*bveci*bveci; for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = bveci*snaptr->blist[jcoeff]; + gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = + bveci*snaptr->blist[jcoeff]; } } } diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 0d880b94d5..7eee793023 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -207,11 +207,7 @@ void ComputeGrid::allocate() memory->destroy(local_flags); if (gridlocal_allocated) { gridlocal_allocated = 0; - // MEMORY LEAK!! - // can't seem to free this memory without seg-fault - // printf("Before allocate destroy4d, proc %d %p\n",comm->me,gridlocal); - // memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - // printf("After allocate destroy4d, proc %d %p\n",comm->me,gridlocal); + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); } memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 8c0f8ff066..dab9aa44d4 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -104,16 +104,12 @@ void ComputeGridLocal::allocate() if (gridlocal_allocated) { gridlocal_allocated = 0; - // MEMORY LEAK!! - // can't seem to free this memory without seg-fault - // printf("Before allocate destroy4d, proc %d %p\n",comm->me,gridlocal); - // memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - // printf("After allocate destroy4d, proc %d %p\n",comm->me,gridlocal); + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); } if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; - memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, + memory->create4d_offset(gridlocal,size_local_cols,nzlo,nzhi,nylo,nyhi, nxlo,nxhi,"grid:gridlocal"); } } @@ -248,6 +244,6 @@ void ComputeGridLocal::copy_gridlocal_to_local_array() double ComputeGridLocal::memory_usage() { - int nbytes = size_array_cols*ngridlocal*sizeof(double); // gridlocal + int nbytes = size_local_cols*ngridlocal*sizeof(double); // gridlocal return nbytes; } From 78f9c7b47818dcffc6c89ecdeb9e8d1cb8df85a0 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 25 Aug 2021 17:52:53 -0600 Subject: [PATCH 029/172] Declared victory on compute grid and grid/local --- examples/snap/in.grid.local | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/snap/in.grid.local b/examples/snap/in.grid.local index dc04fd5371..121f0ba981 100644 --- a/examples/snap/in.grid.local +++ b/examples/snap/in.grid.local @@ -71,3 +71,7 @@ dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_mygridlocal[*] run 0 +run 0 + +run 0 + From ea3c89165a14565351d49b25fb14043b9f9a1649 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 26 Aug 2021 11:52:06 -0600 Subject: [PATCH 030/172] Resolved memory management issue exposed by RCB in in.grid.test --- examples/snap/in.grid.test | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 examples/snap/in.grid.test diff --git a/examples/snap/in.grid.test b/examples/snap/in.grid.test new file mode 100644 index 0000000000..c684200d44 --- /dev/null +++ b/examples/snap/in.grid.test @@ -0,0 +1,105 @@ +# Demonstrate bispectrum computes + +# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should +# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273 + +# Initialize simulation + +variable nsteps index 0 +variable nrep index 3 +variable a index 3.316 +variable ngrid index 2 + +units metal + +atom_modify map yes + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 0 1 0 & + a3 0 0 1 & + basis 0 0 0 & + basis 0.5 0.5 0.5 & +# origin 0.25 0.25 0.25 +# origin 0.25e-3 0.25e-3 0.25e-3 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +write_dump all custom test.dump id type x y z + +# choose potential + +include Ta06A.snap + +# define grid compute and atom compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 1 + +compute b all sna/atom & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} + +# define output + +# mygrid is ngrid by (3+nbis) = 8x8 +thermo_style custom step temp ke pe vol & + c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] & + c_mygrid[1][2] c_mygrid[2][2] c_mygrid[3][2] c_mygrid[4][2] c_mygrid[5][2] c_mygrid[6][2] c_mygrid[7][2] c_mygrid[8][2] & + c_mygrid[1][3] c_mygrid[2][3] c_mygrid[3][3] c_mygrid[4][3] c_mygrid[5][3] c_mygrid[6][3] c_mygrid[7][3] c_mygrid[8][3] & + c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] & + c_mygrid[1][5] c_mygrid[2][5] c_mygrid[3][5] c_mygrid[4][5] c_mygrid[5][5] c_mygrid[6][5] c_mygrid[7][5] c_mygrid[8][5] & + c_mygrid[1][6] c_mygrid[2][6] c_mygrid[3][6] c_mygrid[4][6] c_mygrid[5][6] c_mygrid[6][6] c_mygrid[7][6] c_mygrid[8][6] & + c_mygrid[1][7] c_mygrid[2][7] c_mygrid[3][7] c_mygrid[4][7] c_mygrid[5][7] c_mygrid[6][7] c_mygrid[7][7] c_mygrid[8][7] & + c_mygrid[1][8] c_mygrid[2][8] c_mygrid[3][8] c_mygrid[4][8] c_mygrid[5][8] c_mygrid[6][8] c_mygrid[7][8] c_mygrid[8][8] +thermo_modify norm yes + +#dump mydump_b all custom 1 dump_b id c_b[*] +dump mydump_bgridlocal all local 1 dump_bgridlocal index c_mygridlocal[*] + +# run + +run 1 + +# rcb + +comm_style tiled +balance 0.99 rcb +run 1 + +# rcb again + +balance 0.99 rcb +run 1 + From db58cec057e7b790bd706ad63c28c3ff79473d7f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 26 Aug 2021 11:52:46 -0600 Subject: [PATCH 031/172] Resolved memory management issue exposed by RCB in in.grid.test --- src/compute_grid.cpp | 36 +++++++++++++++++--------------- src/compute_grid.h | 3 ++- src/compute_grid_local.cpp | 42 +++++++++++++++++++++++--------------- src/compute_grid_local.h | 4 +++- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 7eee793023..52bd7d6307 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -60,13 +60,7 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid::~ComputeGrid() { - memory->destroy(grid); - memory->destroy(gridall); - memory->destroy(local_flags); - if (gridlocal_allocated) { - gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - } + deallocate(); } /* ---------------------------------------------------------------------- */ @@ -79,6 +73,7 @@ void ComputeGrid::init() void ComputeGrid::setup() { + deallocate(); set_grid_global(); set_grid_local(); allocate(); @@ -195,21 +190,13 @@ void ComputeGrid::assign_local_flags() } /* ---------------------------------------------------------------------- - free and reallocate arrays + create arrays ------------------------------------------------------------------------- */ void ComputeGrid::allocate() { // allocate arrays - memory->destroy(grid); - memory->destroy(gridall); - memory->destroy(local_flags); - if (gridlocal_allocated) { - gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - } - memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); memory->create(local_flags,size_array_rows,"grid:local_flags"); @@ -222,6 +209,23 @@ void ComputeGrid::allocate() } +/* ---------------------------------------------------------------------- + free arrays +------------------------------------------------------------------------- */ + +void ComputeGrid::deallocate() +{ + memory->destroy(grid); + memory->destroy(gridall); + memory->destroy(local_flags); + if (gridlocal_allocated) { + gridlocal_allocated = 0; + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + } + array = nullptr; +} + + /* ---------------------------------------------------------------------- set global grid ------------------------------------------------------------------------- */ diff --git a/src/compute_grid.h b/src/compute_grid.h index 1b2797732d..421656febf 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -49,7 +49,8 @@ class ComputeGrid : public Compute { int *local_flags; // local flag for each grid point int gridlocal_allocated; // shows if gridlocal allocated - void allocate(); + void allocate(); // create arrays + void deallocate(); // free arrays void grid2x(int, double*); // convert grid point to coord void grid2ix(int, int&, int&, int&); // convert grid point to ix, iy, iz void assign_coords(); // assign coords for grid diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index dab9aa44d4..1b8de3c48a 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -59,11 +59,7 @@ ComputeGridLocal::ComputeGridLocal(LAMMPS *lmp, int narg, char **arg) : ComputeGridLocal::~ComputeGridLocal() { - if (gridlocal_allocated) { - gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - } - memory->destroy(alocal); + deallocate(); } /* ---------------------------------------------------------------------- */ @@ -76,9 +72,11 @@ void ComputeGridLocal::init() void ComputeGridLocal::setup() { + deallocate(); set_grid_global(); set_grid_local(); allocate(); + assign_coords(); } /* ---------------------------------------------------------------------- @@ -95,25 +93,34 @@ void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) } /* ---------------------------------------------------------------------- - free and reallocate arrays + create arrays ------------------------------------------------------------------------- */ void ComputeGridLocal::allocate() { - // allocate local array - - if (gridlocal_allocated) { - gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - } - if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; memory->create4d_offset(gridlocal,size_local_cols,nzlo,nzhi,nylo,nyhi, nxlo,nxhi,"grid:gridlocal"); + memory->create(alocal, size_local_rows, size_local_cols, "compute/grid/local:alocal"); + array_local = alocal; } } +/* ---------------------------------------------------------------------- + free arrays +------------------------------------------------------------------------- */ + +void ComputeGridLocal::deallocate() +{ + if (gridlocal_allocated) { + gridlocal_allocated = 0; + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + memory->destroy(alocal); + } + array_local = nullptr; +} + /* ---------------------------------------------------------------------- set global grid ------------------------------------------------------------------------- */ @@ -201,11 +208,14 @@ void ComputeGridLocal::set_grid_local() ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); size_local_rows = ngridlocal; +} - memory->destroy(alocal); - memory->create(alocal, size_local_rows, size_local_cols, "compute/grid/local:alocal"); - array_local = alocal; +/* ---------------------------------------------------------------------- + copy coords to local array +------------------------------------------------------------------------- */ +void ComputeGridLocal::assign_coords() +{ int igrid = 0; for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index b6cd882b2e..6189e5b27d 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -46,10 +46,12 @@ class ComputeGridLocal : public Compute { int size_local_cols_base; // number of columns used for coords, etc. int gridlocal_allocated; // shows if gridlocal allocated - void allocate(); + void allocate(); // create arrays + void deallocate(); // free arrays void grid2x(int, int, int, double*); // convert global indices to coordinates void set_grid_global(); // set global grid void set_grid_local(); // set bounds for local grid + void assign_coords(); // assign coords for grid void copy_gridlocal_to_local_array();// copy 4d gridlocal array to 2d local array private: }; From 0a4e85a1f35c029b920246980ad0d1cfa4c42988 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 26 Aug 2021 11:58:39 -0600 Subject: [PATCH 032/172] Added README.grid --- examples/snap/README.grid | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/snap/README.grid diff --git a/examples/snap/README.grid b/examples/snap/README.grid new file mode 100644 index 0000000000..9033c9d445 --- /dev/null +++ b/examples/snap/README.grid @@ -0,0 +1,9 @@ +This branch contains the following examples: + +in.grid # simple example of grid +in.grid.local # simple example of grid/local +in.grid.python # used by grid.py +in.grid.test # stress test of grid and grid/local +in.grid.tri # grid with triclinic cell + +grid.py # access data from Python library interface From 8bddc801df643bf69f8c1a4c3798646dc46a130f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 3 Oct 2021 17:55:55 -0600 Subject: [PATCH 033/172] First successful compile of pair style --- src/ML-SNAP/pair_sna_grid.cpp | 182 ++++++++++++++++++ src/ML-SNAP/pair_sna_grid.h | 76 ++++++++ src/pair_grid.cpp | 344 ++++++++++++++++++++++++++++++++++ src/pair_grid.h | 88 +++++++++ 4 files changed, 690 insertions(+) create mode 100644 src/ML-SNAP/pair_sna_grid.cpp create mode 100644 src/ML-SNAP/pair_sna_grid.h create mode 100644 src/pair_grid.cpp create mode 100644 src/pair_grid.h diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp new file mode 100644 index 0000000000..605e05ebf9 --- /dev/null +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -0,0 +1,182 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "pair_grid.h" +#include "pair_sna_grid.h" +#include "sna.h" +#include "atom.h" +#include "update.h" +#include "modify.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "force.h" +#include "pair.h" +#include "domain.h" +#include "comm.h" +#include "memory.h" +#include "error.h" +#include "tokenizer.h" + +#include +#include + +using namespace LAMMPS_NS; + +PairSNAGrid::PairSNAGrid(LAMMPS *lmp) : + PairGrid(lmp), cutsq(nullptr), + radelem(nullptr), wjelem(nullptr) +{ +} + +/* ---------------------------------------------------------------------- */ + +PairSNAGrid::~PairSNAGrid() +{ + memory->destroy(radelem); + memory->destroy(wjelem); + memory->destroy(cutsq); + delete snaptr; + + if (chemflag) memory->destroy(map); +} + +/* ---------------------------------------------------------------------- */ + +void PairSNAGrid::init() +{ + if (force->pair == nullptr) + error->all(FLERR,"Pair sna/grid requires a pair style be defined"); + + if (cutmax > force->pair->cutforce) + error->all(FLERR,"Pair sna/grid cutoff is longer than pairwise cutoff"); + + // need an occasional full neighbor list + + int irequest = neighbor->request(this,instance_me); + neighbor->requests[irequest]->pair = 0; + neighbor->requests[irequest]->compute = 1; + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + neighbor->requests[irequest]->occasional = 1; + + snaptr->init(); +} + +/* ---------------------------------------------------------------------- */ + +void PairSNAGrid::init_list(int /*id*/, NeighList *ptr) +{ + list = ptr; +} + +/* ---------------------------------------------------------------------- */ + +void PairSNAGrid::compute(int eflag, int vflag) +{ + + // compute sna for each gridpoint + + double** const x = atom->x; + const int* const mask = atom->mask; + int * const type = atom->type; + const int ntotal = atom->nlocal + atom->nghost; + + // insure rij, inside, and typej are of size jnum + + snaptr->grow_rij(ntotal); + + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + double xgrid[3]; + grid2x(ix, iy, iz, xgrid); + const double xtmp = xgrid[0]; + const double ytmp = xgrid[1]; + const double ztmp = xgrid[2]; + + // currently, all grid points are type 1 + + const int itype = 1; + int ielem = 0; + if (chemflag) + ielem = map[itype]; + const double radi = radelem[itype]; + + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff + + int ninside = 0; + for (int j = 0; j < ntotal; j++) { + + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + int jelem = 0; + if (chemflag) + jelem = map[jtype]; + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + snaptr->element[ninside] = jelem; // element index for multi-element snap + ninside++; + } + } + + snaptr->compute_ui(ninside, ielem); + snaptr->compute_zi(); + snaptr->compute_bi(ielem); + + // linear contributions + + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + gridlocal[ndesc_base+icoeff][iz][iy][ix] = + snaptr->blist[icoeff]; + + // quadratic contributions + + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bveci = snaptr->blist[icoeff]; + gridlocal[ndesc_base+ncount++][iz][iy][ix] = + 0.5*bveci*bveci; + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + gridlocal[ndesc_base+ncount++][iz][iy][ix] = + bveci*snaptr->blist[jcoeff]; + } + } + } +} + + +/* ---------------------------------------------------------------------- + memory usage +------------------------------------------------------------------------- */ + +double PairSNAGrid::memory_usage() +{ + double nbytes = snaptr->memory_usage(); // SNA object + int n = atom->ntypes+1; + nbytes += (double)n*sizeof(int); // map + + return nbytes; +} + diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h new file mode 100644 index 0000000000..d94032e58c --- /dev/null +++ b/src/ML-SNAP/pair_sna_grid.h @@ -0,0 +1,76 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(sna/grid, PairSNAGrid); +// clang-format on +#else + +#ifndef LMP_PAIR_SNA_GRID_H +#define LMP_PAIR_SNA_GRID_H + +#include "pair_grid.h" + +namespace LAMMPS_NS { + +class PairSNAGrid : public PairGrid { + public: + PairSNAGrid(class LAMMPS *); + ~PairSNAGrid(); + + void init(); + void init_list(int, class NeighList *); + void compute(int, int); + double memory_usage(); + + private: + int ncoeff; + double **cutsq; + class NeighList *list; + double rcutfac; + double *radelem; + double *wjelem; + int *map; // map types to [0,nelements) + int nelements, chemflag; + class SNA *snaptr; + double cutmax; + int quadraticflag; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Compute sna/grid/local requires a pair style be defined + +Self-explanatory. + +E: Compute sna/grid/local cutoff is longer than pairwise cutoff + +Self-explanatory. + +W: More than one compute sna/grid/local + +Self-explanatory. + +*/ diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp new file mode 100644 index 0000000000..2d4abb7388 --- /dev/null +++ b/src/pair_grid.cpp @@ -0,0 +1,344 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "pair_grid.h" +#include +#include +#include "atom.h" +#include "update.h" +#include "modify.h" +#include "domain.h" +#include "force.h" +#include "memory.h" +#include "error.h" +#include "comm.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +PairGrid::PairGrid(LAMMPS *lmp) : + Pair(lmp), gridlocal(nullptr), alocal(nullptr) +{ + single_enable = 0; + restartinfo = 0; + one_coeff = 1; + manybody_flag = 1; + centroidstressflag = CENTROID_NOTAVAIL; + + + ndesc = 0; + ngridlocal = 0; + + ndesc_base = 6; + gridlocal_allocated = 0; + beta_max = 0; + beta = nullptr; +} + +/* ---------------------------------------------------------------------- */ + +PairGrid::~PairGrid() +{ + if (copymode) return; + + memory->destroy(beta); + + deallocate_grid(); +} + +/* ---------------------------------------------------------------------- */ + +void PairGrid::init() +{ +} + +/* ---------------------------------------------------------------------- */ + +void PairGrid::setup() +{ + deallocate_grid(); + set_grid_global(); + set_grid_local(); + allocate_grid(); + assign_coords(); +} + +/* ---------------------------------------------------------------------- + convert global array indexes to box coords +------------------------------------------------------------------------- */ + +void PairGrid::grid2x(int ix, int iy, int iz, double *x) +{ + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; + + if (triclinic) domain->lamda2x(x, x); +} + +/* ---------------------------------------------------------------------- + create arrays +------------------------------------------------------------------------- */ + +void PairGrid::allocate_grid() +{ + if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { + gridlocal_allocated = 1; + memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi, + nxlo,nxhi,"pair/grid:gridlocal"); + memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal"); + } +} + +/* ---------------------------------------------------------------------- + free arrays +------------------------------------------------------------------------- */ + +void PairGrid::deallocate_grid() +{ + if (gridlocal_allocated) { + gridlocal_allocated = 0; + memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + memory->destroy(alocal); + } +} + +/* ---------------------------------------------------------------------- + set global grid +------------------------------------------------------------------------- */ + +void PairGrid::set_grid_global() +{ + // calculate grid layout + + triclinic = domain->triclinic; + + if (triclinic == 0) { + prd = domain->prd; + boxlo = domain->boxlo; + sublo = domain->sublo; + subhi = domain->subhi; + } else { + prd = domain->prd_lamda; + boxlo = domain->boxlo_lamda; + sublo = domain->sublo_lamda; + subhi = domain->subhi_lamda; + } + + double xprd = prd[0]; + double yprd = prd[1]; + double zprd = prd[2]; + + delxinv = nx/xprd; + delyinv = ny/yprd; + delzinv = nz/zprd; + + delx = 1.0/delxinv; + dely = 1.0/delyinv; + delz = 1.0/delzinv; +} + +/* ---------------------------------------------------------------------- + set local subset of grid that I own + n xyz lo/hi = 3d brick that I own (inclusive) +------------------------------------------------------------------------- */ + +void PairGrid::set_grid_local() +{ + // nx,ny,nz = extent of global grid + // indices into the global grid range from 0 to N-1 in each dim + // if grid point is inside my sub-domain I own it, + // this includes sub-domain lo boundary but excludes hi boundary + // ixyz lo/hi = inclusive lo/hi bounds of global grid sub-brick I own + // if proc owns no grid cells in a dim, then ilo > ihi + // if 2 procs share a boundary a grid point is exactly on, + // the 2 equality if tests insure a consistent decision + // as to which proc owns it + + double xfraclo,xfrachi,yfraclo,yfrachi,zfraclo,zfrachi; + + if (comm->layout != Comm::LAYOUT_TILED) { + xfraclo = comm->xsplit[comm->myloc[0]]; + xfrachi = comm->xsplit[comm->myloc[0]+1]; + yfraclo = comm->ysplit[comm->myloc[1]]; + yfrachi = comm->ysplit[comm->myloc[1]+1]; + zfraclo = comm->zsplit[comm->myloc[2]]; + zfrachi = comm->zsplit[comm->myloc[2]+1]; + } else { + xfraclo = comm->mysplit[0][0]; + xfrachi = comm->mysplit[0][1]; + yfraclo = comm->mysplit[1][0]; + yfrachi = comm->mysplit[1][1]; + zfraclo = comm->mysplit[2][0]; + zfrachi = comm->mysplit[2][1]; + } + + nxlo = static_cast (xfraclo * nx); + if (1.0*nxlo != xfraclo*nx) nxlo++; + nxhi = static_cast (xfrachi * nx); + if (1.0*nxhi == xfrachi*nx) nxhi--; + + nylo = static_cast (yfraclo * ny); + if (1.0*nylo != yfraclo*ny) nylo++; + nyhi = static_cast (yfrachi * ny); + if (1.0*nyhi == yfrachi*ny) nyhi--; + + nzlo = static_cast (zfraclo * nz); + if (1.0*nzlo != zfraclo*nz) nzlo++; + nzhi = static_cast (zfrachi * nz); + if (1.0*nzhi == zfrachi*nz) nzhi--; + + ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); +} + +/* ---------------------------------------------------------------------- + copy coords to local array +------------------------------------------------------------------------- */ + +void PairGrid::assign_coords() +{ + int igrid = 0; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + alocal[igrid][0] = ix; + alocal[igrid][1] = iy; + alocal[igrid][2] = iz; + double xgrid[3]; + grid2x(ix, iy, iz, xgrid); + alocal[igrid][3] = xgrid[0]; + alocal[igrid][4] = xgrid[1]; + alocal[igrid][5] = xgrid[2]; + igrid++; + } +} + +/* ---------------------------------------------------------------------- + copy the 4d gridlocal array values to the 2d local array +------------------------------------------------------------------------- */ + +void PairGrid::copy_gridlocal_to_local_array() +{ + int igrid = 0; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + for (int icol = ndesc_base; icol < ndesc; icol++) + alocal[igrid][icol] = gridlocal[icol][iz][iy][ix]; + igrid++; + } +} + +/* ---------------------------------------------------------------------- + get beta from someplace +------------------------------------------------------------------------- */ + +void PairGrid::compute_beta() +{ + int igrid = 0; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + for (int icol = ndesc_base; icol < ndesc; icol++) + beta[igrid][icol] = 1.0; + igrid++; + } +} + +/* ---------------------------------------------------------------------- + allocate all arrays +------------------------------------------------------------------------- */ + +void PairGrid::allocate() +{ + allocated = 1; + int n = atom->ntypes; + memory->create(setflag,n+1,n+1,"pair:setflag"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + map = new int[n+1]; +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairGrid::settings(int narg, char ** arg) +{ + if (narg < 6) error->all(FLERR,"Illegal pair style command"); + + int iarg0 = 3; + int iarg = iarg0; + if (strcmp(arg[iarg],"grid") == 0) { + if (iarg+4 > narg) error->all(FLERR,"Illegal pair grid command"); + nx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + if (nx <= 0 || ny <= 0 || nz <= 0) + error->all(FLERR,"All grid/local dimensions must be positive"); + iarg += 4; + } else error->all(FLERR,"Illegal pair grid command"); + + nargbase = iarg - iarg0; + +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ + +void PairGrid::coeff(int narg, char **arg) +{ + if (!allocated) allocate(); + if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); + + map_element2type(narg-4,arg+4); + +} + +/* ---------------------------------------------------------------------- + init specific to this pair style +------------------------------------------------------------------------- */ + +void PairGrid::init_style() +{ + if (force->newton_pair == 0) + error->all(FLERR,"Pair style grid requires newton pair on"); + + // no neighbor list + + // int irequest = neighbor->request(this,instance_me); + // neighbor->requests[irequest]->half = 0; + // neighbor->requests[irequest]->full = 1; + +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairGrid::init_one(int i, int j) +{ + if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); + return 0.0; +} + +/* ---------------------------------------------------------------------- + memory usage of local data +------------------------------------------------------------------------- */ + +double PairGrid::memory_usage() +{ + int nbytes = ndesc*ngridlocal*sizeof(double); // gridlocal + return nbytes; +} diff --git a/src/pair_grid.h b/src/pair_grid.h new file mode 100644 index 0000000000..9c40165154 --- /dev/null +++ b/src/pair_grid.h @@ -0,0 +1,88 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(grid,PairGrid); +// clang-format on +#else + +#ifndef LMP_PAIR_GRID_H +#define LMP_PAIR_GRID_H + +#include "pair.h" + +namespace LAMMPS_NS { + +class PairGrid : public Pair { + public: + PairGrid(class LAMMPS *); + virtual ~PairGrid(); + void init(); + void setup(); + virtual void compute(int, int) { + printf("DANGER! This function should always be overridden by child\n"); + }; + + void settings(int, char **); + virtual void coeff(int, char **); + virtual void init_style(); + virtual double init_one(int, int); + double memory_usage(); + + protected: + int nx, ny, nz; // global grid dimensions + int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive + int ngridlocal; // number of local grid points + int nvalues; // number of values per grid point + double ****gridlocal; // local grid + double **alocal; // pointer to Compute::array_local + int triclinic; // triclinic flag + double *boxlo, *prd; // box info (units real/ortho or reduced/tri) + double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) + double delxinv,delyinv,delzinv; // inverse grid spacing + double delx,dely,delz; // grid spacing + int nargbase; // number of base class args + double cutmax; // largest cutoff distance + int ndesc; // number of descriptors + int ndesc_base; // number of columns used for coords, etc. + int gridlocal_allocated; // shows if gridlocal allocated + double **beta; // betas for all local grid points in list + int beta_max; // length of beta + + void allocate(); // allocate pairstyle arrays + void allocate_grid(); // create grid arrays + void deallocate_grid(); // free grid arrays + void grid2x(int, int, int, double*); // convert global indices to coordinates + void set_grid_global(); // set global grid + void set_grid_local(); // set bounds for local grid + void assign_coords(); // assign coords for grid + void copy_gridlocal_to_local_array();// copy 4d gridlocal array to 2d local array + void compute_beta(); // get betas from someplace + private: +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +*/ From f41d65029418633e688bcb24e1f1b83414f1ba75 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 3 Oct 2021 17:59:33 -0600 Subject: [PATCH 034/172] Added non-working pair script --- examples/snap/in.grid.pair | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 examples/snap/in.grid.pair diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair new file mode 100644 index 0000000000..ee40984ce6 --- /dev/null +++ b/examples/snap/in.grid.pair @@ -0,0 +1,61 @@ +# Demonstrate bispectrum computes + +# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should +# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273 + +# Initialize simulation + +variable nsteps index 0 +variable nrep index 3 +variable a index 3.316 +variable ngrid index 2 + +units metal + +atom_modify map yes + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 0 1 0 & + a3 0 0 1 & + basis 0 0 0 & + basis 0.5 0.5 0.5 & +# origin 0.25 0.25 0.25 +# origin 0.25e-3 0.25e-3 0.25e-3 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +write_dump all custom test.dump id type x y z + +# define grid compute and atom compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 1 + +pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} +pair_coeff * * + +run 0 From e698d295fc6fd6afdeca34ee2709342b1427f6d7 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 3 Oct 2021 18:35:54 -0600 Subject: [PATCH 035/172] Fixed some parsing errors, more waiting --- src/ML-SNAP/pair_sna_grid.cpp | 120 ++++++++++++++++++++++++++++++++++ src/ML-SNAP/pair_sna_grid.h | 1 + src/pair_grid.cpp | 7 +- 3 files changed, 123 insertions(+), 5 deletions(-) diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index 605e05ebf9..f2176b7520 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -167,6 +167,126 @@ void PairSNAGrid::compute(int eflag, int vflag) } +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairSNAGrid::settings(int narg, char ** arg) +{ + double rfac0, rmin0; + int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; + + // call base class first + + PairGrid::settings(narg, arg); + + // skip over arguments used by base class + // so that argument positions are identical to + // regular per-atom compute + + arg += nargbase; + narg -= nargbase; + + int ntypes = atom->ntypes; + int nargmin = 3+2*ntypes; + + if (narg < nargmin) error->all(FLERR,"Illegal pair sna/grid command"); + + // default values + + rmin0 = 0.0; + switchflag = 1; + bzeroflag = 1; + quadraticflag = 0; + chemflag = 0; + bnormflag = 0; + wselfallflag = 0; + nelements = 1; + + // process required arguments + + memory->create(radelem,ntypes+1,"sna/grid/local:radelem"); // offset by 1 to match up with types + memory->create(wjelem,ntypes+1,"sna/grid/local:wjelem"); + + rcutfac = atof(arg[0]); + rfac0 = atof(arg[1]); + twojmax = atoi(arg[2]); + + for(int i = 0; i < ntypes; i++) + radelem[i+1] = atof(arg[3+i]); + for(int i = 0; i < ntypes; i++) + wjelem[i+1] = atof(arg[3+ntypes+i]); + + // construct cutsq + + double cut; + cutmax = 0.0; + memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid/local:cutsq"); + for(int i = 1; i <= ntypes; i++) { + cut = 2.0*radelem[i]*rcutfac; + if (cut > cutmax) cutmax = cut; + cutsq[i][i] = cut*cut; + for(int j = i+1; j <= ntypes; j++) { + cut = (radelem[i]+radelem[j])*rcutfac; + cutsq[i][j] = cutsq[j][i] = cut*cut; + } + } + + // process optional args + + int iarg = nargmin; + + while (iarg < narg) { + printf("%d %d %d %s\n",iarg,narg,nargbase,arg[iarg]); + if (strcmp(arg[iarg],"rmin0") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + rmin0 = atof(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"switchflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + switchflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"bzeroflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + bzeroflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"quadraticflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + quadraticflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"chem") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + chemflag = 1; + memory->create(map,ntypes+1,"compute_sna_grid_local:map"); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + for (int i = 0; i < ntypes; i++) { + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); + if (jelem < 0 || jelem >= nelements) + error->all(FLERR,"Illegal pair sna/grid command"); + map[i+1] = jelem; + } + iarg += 2+ntypes; + } else if (strcmp(arg[iarg],"bnormflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + bnormflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"wselfallflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + wselfallflag = atoi(arg[iarg+1]); + iarg += 2; + } else error->all(FLERR,"Illegal pair sna/grid command"); + + } + +} + /* ---------------------------------------------------------------------- memory usage ------------------------------------------------------------------------- */ diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h index d94032e58c..30b6aa8f92 100644 --- a/src/ML-SNAP/pair_sna_grid.h +++ b/src/ML-SNAP/pair_sna_grid.h @@ -31,6 +31,7 @@ class PairSNAGrid : public PairGrid { void init(); void init_list(int, class NeighList *); + void settings(int, char **); void compute(int, int); double memory_usage(); diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index 2d4abb7388..56478ad21f 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -275,9 +275,8 @@ void PairGrid::allocate() void PairGrid::settings(int narg, char ** arg) { - if (narg < 6) error->all(FLERR,"Illegal pair style command"); - - int iarg0 = 3; + if (narg < 4) error->all(FLERR,"Illegal pair style command"); + int iarg0 = 0; int iarg = iarg0; if (strcmp(arg[iarg],"grid") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal pair grid command"); @@ -288,9 +287,7 @@ void PairGrid::settings(int narg, char ** arg) error->all(FLERR,"All grid/local dimensions must be positive"); iarg += 4; } else error->all(FLERR,"Illegal pair grid command"); - nargbase = iarg - iarg0; - } /* ---------------------------------------------------------------------- From 1450af8ba19991984c682ffb52fa253f5c30d06c Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 22 Oct 2021 17:01:20 -0600 Subject: [PATCH 036/172] Latest version of PairGrid --- src/ML-SNAP/pair_sna_grid.cpp | 8 ++++---- src/ML-SNAP/pair_sna_grid.h | 1 - src/pair_grid.cpp | 11 +++++++---- src/pair_grid.h | 2 +- src/verlet.cpp | 6 ++++++ 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index f2176b7520..3bfdcb7e12 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -205,8 +205,8 @@ void PairSNAGrid::settings(int narg, char ** arg) // process required arguments - memory->create(radelem,ntypes+1,"sna/grid/local:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"sna/grid/local:wjelem"); + memory->create(radelem,ntypes+1,"pair:sna/grid:radelem"); // offset by 1 to match up with types + memory->create(wjelem,ntypes+1,"pair:sna/grid:wjelem"); rcutfac = atof(arg[0]); rfac0 = atof(arg[1]); @@ -221,7 +221,7 @@ void PairSNAGrid::settings(int narg, char ** arg) double cut; cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid/local:cutsq"); + memory->create(cutsq,ntypes+1,ntypes+1,"pair:sna/grid:cutsq"); for(int i = 1; i <= ntypes; i++) { cut = 2.0*radelem[i]*rcutfac; if (cut > cutmax) cutmax = cut; @@ -262,7 +262,7 @@ void PairSNAGrid::settings(int narg, char ** arg) if (iarg+2 > narg) error->all(FLERR,"Illegal pair sna/grid command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_sna_grid_local:map"); + memory->create(map,ntypes+1,"pair:sna/grid:map"); nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h index 30b6aa8f92..2216739ce3 100644 --- a/src/ML-SNAP/pair_sna_grid.h +++ b/src/ML-SNAP/pair_sna_grid.h @@ -45,7 +45,6 @@ class PairSNAGrid : public PairGrid { int *map; // map types to [0,nelements) int nelements, chemflag; class SNA *snaptr; - double cutmax; int quadraticflag; }; diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index 56478ad21f..166d4c258d 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -67,6 +67,7 @@ void PairGrid::init() void PairGrid::setup() { + printf("Hello, world! C\n"); deallocate_grid(); set_grid_global(); set_grid_local(); @@ -297,9 +298,11 @@ void PairGrid::settings(int narg, char ** arg) void PairGrid::coeff(int narg, char **arg) { if (!allocated) allocate(); - if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); + if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients"); + // if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); - map_element2type(narg-4,arg+4); + // map_element2type(narg-4,arg+4); + // map_element2type(0,nullptr); } @@ -321,13 +324,13 @@ void PairGrid::init_style() } /* ---------------------------------------------------------------------- - init for one type pair i,j and corresponding j,i + return maximum force cut off distance ------------------------------------------------------------------------- */ double PairGrid::init_one(int i, int j) { if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); - return 0.0; + return cutmax; } /* ---------------------------------------------------------------------- diff --git a/src/pair_grid.h b/src/pair_grid.h index 9c40165154..d7aa151633 100644 --- a/src/pair_grid.h +++ b/src/pair_grid.h @@ -57,7 +57,7 @@ class PairGrid : public Pair { int ndesc; // number of descriptors int ndesc_base; // number of columns used for coords, etc. int gridlocal_allocated; // shows if gridlocal allocated - double **beta; // betas for all local grid points in list + double **beta; // betas for all local grid points in list int beta_max; // length of beta void allocate(); // allocate pairstyle arrays diff --git a/src/verlet.cpp b/src/verlet.cpp index b9b0b392e1..385b234a29 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -99,6 +99,8 @@ void Verlet::setup(int flag) } } + printf("Hello, world! A\n"); + if (lmp->kokkos) error->all(FLERR,"KOKKOS package requires run_style verlet/kk"); @@ -126,6 +128,8 @@ void Verlet::setup(int flag) modify->setup_post_neighbor(); neighbor->ncalls = 0; + printf("Hello, world! B\n"); + // compute all forces force->setup(); @@ -133,6 +137,8 @@ void Verlet::setup(int flag) force_clear(); modify->setup_pre_force(vflag); + printf("Hello, world!\n"); + if (pair_compute_flag) force->pair->compute(eflag,vflag); else if (force->pair) force->pair->compute_dummy(eflag,vflag); From 6d5506353b83fc369259cc29add6dc6f67d34fca Mon Sep 17 00:00:00 2001 From: LOFT Date: Sun, 24 Oct 2021 15:45:24 -0600 Subject: [PATCH 037/172] Eliminated a few mistakes,s till not working --- examples/snap/in.grid.pair | 2 +- src/ML-SNAP/pair_sna_grid.cpp | 15 +++++++------ src/ML-SNAP/pair_sna_grid.h | 7 ++++-- src/pair_grid.cpp | 40 +++++++++++++---------------------- src/pair_grid.h | 3 +-- 5 files changed, 31 insertions(+), 36 deletions(-) diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair index ee40984ce6..9d21c1f62c 100644 --- a/examples/snap/in.grid.pair +++ b/examples/snap/in.grid.pair @@ -56,6 +56,6 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & ${rcutfac} ${rfac0} ${twojmax} ${radelem} & ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & quadraticflag ${quad} switchflag ${switch} -pair_coeff * * +pair_coeff * * Al run 0 diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index 3bfdcb7e12..7e626edd1a 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -53,14 +53,11 @@ PairSNAGrid::~PairSNAGrid() /* ---------------------------------------------------------------------- */ -void PairSNAGrid::init() +void PairSNAGrid::init_style() { if (force->pair == nullptr) error->all(FLERR,"Pair sna/grid requires a pair style be defined"); - if (cutmax > force->pair->cutforce) - error->all(FLERR,"Pair sna/grid cutoff is longer than pairwise cutoff"); - // need an occasional full neighbor list int irequest = neighbor->request(this,instance_me); @@ -70,7 +67,13 @@ void PairSNAGrid::init() neighbor->requests[irequest]->full = 1; neighbor->requests[irequest]->occasional = 1; + snaptr = new SNA(lmp, rfac0, twojmax, + rmin0, switchflag, bzeroflag, + chemflag, bnormflag, wselfallflag, nelements); + ndesc = ndesc_base + snaptr->ncoeff; + printf("ndesc = %d\n", ndesc); snaptr->init(); + } /* ---------------------------------------------------------------------- */ @@ -173,8 +176,6 @@ void PairSNAGrid::compute(int eflag, int vflag) void PairSNAGrid::settings(int narg, char ** arg) { - double rfac0, rmin0; - int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; // call base class first @@ -232,6 +233,8 @@ void PairSNAGrid::settings(int narg, char ** arg) } } + printf("settings cutmax = %g \n",cutmax); + // process optional args int iarg = nargmin; diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h index 2216739ce3..929d6db975 100644 --- a/src/ML-SNAP/pair_sna_grid.h +++ b/src/ML-SNAP/pair_sna_grid.h @@ -29,7 +29,7 @@ class PairSNAGrid : public PairGrid { PairSNAGrid(class LAMMPS *); ~PairSNAGrid(); - void init(); + void init_style(); void init_list(int, class NeighList *); void settings(int, char **); void compute(int, int); @@ -43,9 +43,12 @@ class PairSNAGrid : public PairGrid { double *radelem; double *wjelem; int *map; // map types to [0,nelements) - int nelements, chemflag; + int nelements; class SNA *snaptr; int quadraticflag; + int twojmax, switchflag, bzeroflag, bnormflag; + int chemflag, wselfallflag; + double rfac0, rmin0; }; } diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index 166d4c258d..b552b509e5 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -59,20 +59,19 @@ PairGrid::~PairGrid() /* ---------------------------------------------------------------------- */ -void PairGrid::init() -{ -} - -/* ---------------------------------------------------------------------- */ - void PairGrid::setup() { printf("Hello, world! C\n"); deallocate_grid(); + printf("Hello, world! D\n"); set_grid_global(); + printf("Hello, world! E\n"); set_grid_local(); + printf("Hello, world! F\n"); allocate_grid(); + printf("Hello, world! G\n"); assign_coords(); + printf("Hello, world! H\n"); } /* ---------------------------------------------------------------------- @@ -96,6 +95,7 @@ void PairGrid::allocate_grid() { if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; + printf("ngridlocal = %d ndesc = %d\n",ngridlocal, ndesc); memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi, nxlo,nxhi,"pair/grid:gridlocal"); memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal"); @@ -209,6 +209,7 @@ void PairGrid::set_grid_local() void PairGrid::assign_coords() { + printf("nxhi/lo = %d %d nyhi/lo = %d %d nzhi/lo = %d %d\n",nxlo,nxhi,nylo,nyhi,nzlo,nzhi); int igrid = 0; for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) @@ -266,6 +267,10 @@ void PairGrid::allocate() allocated = 1; int n = atom->ntypes; memory->create(setflag,n+1,n+1,"pair:setflag"); + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + setflag[i][j] = 0; + memory->create(cutsq,n+1,n+1,"pair:cutsq"); map = new int[n+1]; } @@ -298,38 +303,23 @@ void PairGrid::settings(int narg, char ** arg) void PairGrid::coeff(int narg, char **arg) { if (!allocated) allocate(); - if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients"); + if (narg < 2) error->all(FLERR,"Incorrect args for pair coefficients"); // if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); - // map_element2type(narg-4,arg+4); + map_element2type(narg-2,arg+2); // map_element2type(0,nullptr); } -/* ---------------------------------------------------------------------- - init specific to this pair style -------------------------------------------------------------------------- */ - -void PairGrid::init_style() -{ - if (force->newton_pair == 0) - error->all(FLERR,"Pair style grid requires newton pair on"); - - // no neighbor list - - // int irequest = neighbor->request(this,instance_me); - // neighbor->requests[irequest]->half = 0; - // neighbor->requests[irequest]->full = 1; - -} - /* ---------------------------------------------------------------------- return maximum force cut off distance ------------------------------------------------------------------------- */ double PairGrid::init_one(int i, int j) { + printf("i = %d j = %d setflag = %d\n", i, j, setflag[i][j]); if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); + printf("PairGrid cutmax = %g\n",cutmax); return cutmax; } diff --git a/src/pair_grid.h b/src/pair_grid.h index d7aa151633..97799a5c30 100644 --- a/src/pair_grid.h +++ b/src/pair_grid.h @@ -28,7 +28,7 @@ class PairGrid : public Pair { public: PairGrid(class LAMMPS *); virtual ~PairGrid(); - void init(); + virtual void init_style(){}; void setup(); virtual void compute(int, int) { printf("DANGER! This function should always be overridden by child\n"); @@ -36,7 +36,6 @@ class PairGrid : public Pair { void settings(int, char **); virtual void coeff(int, char **); - virtual void init_style(); virtual double init_one(int, int); double memory_usage(); From dcf521be53a00542c4e06b17c4114574b245a76e Mon Sep 17 00:00:00 2001 From: LOFT Date: Fri, 29 Oct 2021 06:34:32 -0600 Subject: [PATCH 038/172] Fixed a few more problems, but still no joy --- src/ML-SNAP/pair_sna_grid.cpp | 3 ++- src/ML-SNAP/pair_sna_grid.h | 3 --- src/pair_grid.cpp | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index 7e626edd1a..dc3de8e941 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -34,9 +34,10 @@ using namespace LAMMPS_NS; PairSNAGrid::PairSNAGrid(LAMMPS *lmp) : - PairGrid(lmp), cutsq(nullptr), + PairGrid(lmp), radelem(nullptr), wjelem(nullptr) { + snaptr = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h index 929d6db975..9ae0eece79 100644 --- a/src/ML-SNAP/pair_sna_grid.h +++ b/src/ML-SNAP/pair_sna_grid.h @@ -37,13 +37,10 @@ class PairSNAGrid : public PairGrid { private: int ncoeff; - double **cutsq; class NeighList *list; double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) - int nelements; class SNA *snaptr; int quadraticflag; int twojmax, switchflag, bzeroflag, bnormflag; diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index b552b509e5..dd35f75f8c 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -36,7 +36,6 @@ PairGrid::PairGrid(LAMMPS *lmp) : manybody_flag = 1; centroidstressflag = CENTROID_NOTAVAIL; - ndesc = 0; ngridlocal = 0; @@ -62,7 +61,7 @@ PairGrid::~PairGrid() void PairGrid::setup() { printf("Hello, world! C\n"); - deallocate_grid(); + // deallocate_grid(); printf("Hello, world! D\n"); set_grid_global(); printf("Hello, world! E\n"); @@ -70,7 +69,7 @@ void PairGrid::setup() printf("Hello, world! F\n"); allocate_grid(); printf("Hello, world! G\n"); - assign_coords(); + // assign_coords(); printf("Hello, world! H\n"); } @@ -273,6 +272,7 @@ void PairGrid::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); map = new int[n+1]; + printf("Allocated!\n"); } /* ---------------------------------------------------------------------- From 591af3f5602c8e63707f446d8727cf9931755ef8 Mon Sep 17 00:00:00 2001 From: LOFT Date: Fri, 29 Oct 2021 07:49:15 -0600 Subject: [PATCH 039/172] Eliminated obvious but hard to find error in neighbor list request --- examples/snap/in.grid.pair | 2 ++ src/ML-SNAP/pair_sna_grid.cpp | 9 +++------ src/pair_grid.cpp | 2 ++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair index 9d21c1f62c..5f70f79d09 100644 --- a/examples/snap/in.grid.pair +++ b/examples/snap/in.grid.pair @@ -58,4 +58,6 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & quadraticflag ${quad} switchflag ${switch} pair_coeff * * Al +neighbor 0.0 nsq + run 0 diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index dc3de8e941..6dc7bc9173 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -56,17 +56,14 @@ PairSNAGrid::~PairSNAGrid() void PairSNAGrid::init_style() { - if (force->pair == nullptr) - error->all(FLERR,"Pair sna/grid requires a pair style be defined"); + if (force->newton_pair == 0) + error->all(FLERR,"Pair style sna/grid requires newton pair on"); - // need an occasional full neighbor list + // need a full neighbor list int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->pair = 0; - neighbor->requests[irequest]->compute = 1; neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; - neighbor->requests[irequest]->occasional = 1; snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index dd35f75f8c..f76629717b 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -60,6 +60,7 @@ PairGrid::~PairGrid() void PairGrid::setup() { + printf("Inside PairGrid::setup()\n"); printf("Hello, world! C\n"); // deallocate_grid(); printf("Hello, world! D\n"); @@ -317,6 +318,7 @@ void PairGrid::coeff(int narg, char **arg) double PairGrid::init_one(int i, int j) { + printf("Inside PairGrid::init_one()\n"); printf("i = %d j = %d setflag = %d\n", i, j, setflag[i][j]); if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); printf("PairGrid cutmax = %g\n",cutmax); From c69edde55cf3245c9ab30bf455927be94f63b232 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 10 Dec 2021 18:30:44 -0700 Subject: [PATCH 040/172] Eliminated several undefined variables --- examples/snap/in.grid.pair | 8 +++----- src/ML-SNAP/pair_sna_grid.cpp | 10 +++++----- src/pair_grid.cpp | 17 ++--------------- src/verlet.cpp | 6 ------ 4 files changed, 10 insertions(+), 31 deletions(-) diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair index 5f70f79d09..e2143427e6 100644 --- a/examples/snap/in.grid.pair +++ b/examples/snap/in.grid.pair @@ -1,8 +1,5 @@ -# Demonstrate bispectrum computes +# Demonstrate pair style base on sna/grid -# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should -# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273 - # Initialize simulation variable nsteps index 0 @@ -58,6 +55,7 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & quadraticflag ${quad} switchflag ${switch} pair_coeff * * Al +thermo_style custom step temp epair emol etotal press neighbor 0.0 nsq -run 0 +run 10 diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index 6dc7bc9173..5be3bf98d6 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -68,8 +68,8 @@ void PairSNAGrid::init_style() snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements); - ndesc = ndesc_base + snaptr->ncoeff; - printf("ndesc = %d\n", ndesc); + ncoeff = snaptr->ncoeff; + ndesc = ndesc_base + ncoeff; snaptr->init(); } @@ -85,6 +85,7 @@ void PairSNAGrid::init_list(int /*id*/, NeighList *ptr) void PairSNAGrid::compute(int eflag, int vflag) { + ev_init(eflag,vflag); // compute sna for each gridpoint @@ -165,6 +166,8 @@ void PairSNAGrid::compute(int eflag, int vflag) } } } + + if (vflag_fdotr) virial_fdotr_compute(); } @@ -231,14 +234,11 @@ void PairSNAGrid::settings(int narg, char ** arg) } } - printf("settings cutmax = %g \n",cutmax); - // process optional args int iarg = nargmin; while (iarg < narg) { - printf("%d %d %d %s\n",iarg,narg,nargbase,arg[iarg]); if (strcmp(arg[iarg],"rmin0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair sna/grid command"); diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index f76629717b..3f88635ecf 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -60,18 +60,11 @@ PairGrid::~PairGrid() void PairGrid::setup() { - printf("Inside PairGrid::setup()\n"); - printf("Hello, world! C\n"); - // deallocate_grid(); - printf("Hello, world! D\n"); + deallocate_grid(); set_grid_global(); - printf("Hello, world! E\n"); set_grid_local(); - printf("Hello, world! F\n"); allocate_grid(); - printf("Hello, world! G\n"); - // assign_coords(); - printf("Hello, world! H\n"); + assign_coords(); } /* ---------------------------------------------------------------------- @@ -95,7 +88,6 @@ void PairGrid::allocate_grid() { if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; - printf("ngridlocal = %d ndesc = %d\n",ngridlocal, ndesc); memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi, nxlo,nxhi,"pair/grid:gridlocal"); memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal"); @@ -209,7 +201,6 @@ void PairGrid::set_grid_local() void PairGrid::assign_coords() { - printf("nxhi/lo = %d %d nyhi/lo = %d %d nzhi/lo = %d %d\n",nxlo,nxhi,nylo,nyhi,nzlo,nzhi); int igrid = 0; for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) @@ -273,7 +264,6 @@ void PairGrid::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); map = new int[n+1]; - printf("Allocated!\n"); } /* ---------------------------------------------------------------------- @@ -318,10 +308,7 @@ void PairGrid::coeff(int narg, char **arg) double PairGrid::init_one(int i, int j) { - printf("Inside PairGrid::init_one()\n"); - printf("i = %d j = %d setflag = %d\n", i, j, setflag[i][j]); if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); - printf("PairGrid cutmax = %g\n",cutmax); return cutmax; } diff --git a/src/verlet.cpp b/src/verlet.cpp index 385b234a29..b9b0b392e1 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -99,8 +99,6 @@ void Verlet::setup(int flag) } } - printf("Hello, world! A\n"); - if (lmp->kokkos) error->all(FLERR,"KOKKOS package requires run_style verlet/kk"); @@ -128,8 +126,6 @@ void Verlet::setup(int flag) modify->setup_post_neighbor(); neighbor->ncalls = 0; - printf("Hello, world! B\n"); - // compute all forces force->setup(); @@ -137,8 +133,6 @@ void Verlet::setup(int flag) force_clear(); modify->setup_pre_force(vflag); - printf("Hello, world!\n"); - if (pair_compute_flag) force->pair->compute(eflag,vflag); else if (force->pair) force->pair->compute_dummy(eflag,vflag); From addb8948f9a922e095d8184c59d6f7ffeab30b27 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 23 Dec 2021 15:01:41 -0700 Subject: [PATCH 041/172] Able to run dynamics smoothly, does not conserve energy, but maybe that is a feature --- examples/snap/in.grid.pair | 25 +++++-- src/ML-SNAP/pair_sna_grid.cpp | 125 +++++++++++++++++++++++++++++++++- src/compute_grid_local.h | 2 +- src/pair_grid.cpp | 19 ++++-- src/pair_grid.h | 2 +- 5 files changed, 158 insertions(+), 15 deletions(-) diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair index e2143427e6..99c9623f7d 100644 --- a/examples/snap/in.grid.pair +++ b/examples/snap/in.grid.pair @@ -2,10 +2,14 @@ # Initialize simulation -variable nsteps index 0 +variable dt index 0.5e-5 +variable nthermo index 100 +variable nsteps index 10000 variable nrep index 3 -variable a index 3.316 +variable a index 3.0 variable ngrid index 2 +variable t index 300 +variable del index 0.1 units metal @@ -31,7 +35,7 @@ lattice custom $a & region box block 0 ${nx} 0 ${ny} 0 ${nz} create_box 1 box create_atoms 1 box - +displace_atoms all random ${del} ${del} ${del} 12345 mass 1 180.88 write_dump all custom test.dump id type x y z @@ -56,6 +60,17 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & pair_coeff * * Al thermo_style custom step temp epair emol etotal press -neighbor 0.0 nsq +thermo ${nthermo} +thermo_modify norm yes -run 10 +# Set up NVE run + +timestep ${dt} +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create $t 4928459 loop geom +fix 1 all nve +run ${nsteps} diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index 5be3bf98d6..c84dcaf467 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -85,19 +85,25 @@ void PairSNAGrid::init_list(int /*id*/, NeighList *ptr) void PairSNAGrid::compute(int eflag, int vflag) { + double fij[3]; + ev_init(eflag,vflag); // compute sna for each gridpoint double** const x = atom->x; + double **f = atom->f; const int* const mask = atom->mask; int * const type = atom->type; const int ntotal = atom->nlocal + atom->nghost; - // insure rij, inside, and typej are of size jnum + // insure rij, inside, and typej are of size ntotal snaptr->grow_rij(ntotal); + // first generate fingerprint, + // which allows calculation of beta + for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { @@ -153,6 +159,7 @@ void PairSNAGrid::compute(int eflag, int vflag) snaptr->blist[icoeff]; // quadratic contributions + // untested if (quadraticflag) { int ncount = ncoeff; @@ -167,7 +174,123 @@ void PairSNAGrid::compute(int eflag, int vflag) } } + // this is a proxy for a call to the energy model + // beta is dE/dB^i, the derivative of the total + // energy w.r.t. to descriptors of grid point i + + compute_beta(); + + // second compute forces using beta + + int igrid = 0; + for (int iz = nzlo; iz <= nzhi; iz++) + for (int iy = nylo; iy <= nyhi; iy++) + for (int ix = nxlo; ix <= nxhi; ix++) { + double xgrid[3]; + grid2x(ix, iy, iz, xgrid); + const double xtmp = xgrid[0]; + const double ytmp = xgrid[1]; + const double ztmp = xgrid[2]; + + // currently, all grid points are type 1 + + const int itype = 1; + int ielem = 0; + if (chemflag) + ielem = map[itype]; + const double radi = radelem[itype]; + + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff + + int ninside = 0; + for (int j = 0; j < ntotal; j++) { + + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + int jelem = 0; + if (chemflag) + jelem = map[jtype]; + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + snaptr->element[ninside] = jelem; // element index for multi-element snap + ninside++; + } + } + + // compute Ui, Yi for atom I + + if (chemflag) + snaptr->compute_ui(ninside, ielem); + else + snaptr->compute_ui(ninside, 0); + + // for neighbors of I within cutoff: + // compute Fij = dEi/dRj = -dEi/dRi + // add to Fi, subtract from Fj + // scaling is that for type I + + snaptr->compute_yi(beta[igrid]); + + for (int jj = 0; jj < ninside; jj++) { + int j = snaptr->inside[jj]; + if (chemflag) + snaptr->compute_duidrj(snaptr->rij[jj], snaptr->wj[jj], + snaptr->rcutij[jj],jj, snaptr->element[jj]); + else + snaptr->compute_duidrj(snaptr->rij[jj], snaptr->wj[jj], + snaptr->rcutij[jj],jj, 0); + + snaptr->compute_deidrj(fij); + + f[j][0] -= fij[0]; + f[j][1] -= fij[1]; + f[j][2] -= fij[2]; + + // tally per-atom virial contribution + + if (vflag) + ev_tally_xyz(-1,j,atom->nlocal,force->newton_pair,0.0,0.0, + fij[0],fij[1],fij[2], + -snaptr->rij[jj][0],-snaptr->rij[jj][1], + -snaptr->rij[jj][2]); + } + + // tally energy contribution + + if (eflag) { + + // get descriptors again + + snaptr->compute_zi(); + snaptr->compute_bi(ielem); + + // evdwl = energy of atom I, sum over coeffs_k * Bi_k + + double evdwl = 0.0; + + // E = beta.B + + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + evdwl += beta[igrid][icoeff]*snaptr->blist[icoeff]; + + ev_tally_full(-1,2.0*evdwl,0.0,0.0,0.0,0.0,0.0); + + } + igrid++; + } + if (vflag_fdotr) virial_fdotr_compute(); + } diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index 6189e5b27d..b3d2f4cd94 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -34,7 +34,7 @@ class ComputeGridLocal : public Compute { int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive int ngridlocal; // number of local grid points int nvalues; // number of values per grid point - double ****gridlocal; // local grid + double ****gridlocal; // local grid, redundant w.r.t. alocal double **alocal; // pointer to Compute::array_local int triclinic; // triclinic flag double *boxlo, *prd; // box info (units real/ortho or reduced/tri) diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp index 3f88635ecf..1f17553055 100644 --- a/src/pair_grid.cpp +++ b/src/pair_grid.cpp @@ -23,12 +23,14 @@ #include "error.h" #include "comm.h" +#define BETA_CONST 1.0e-2 + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairGrid::PairGrid(LAMMPS *lmp) : - Pair(lmp), gridlocal(nullptr), alocal(nullptr) + Pair(lmp), gridlocal(nullptr), alocal(nullptr), beta(nullptr) { single_enable = 0; restartinfo = 0; @@ -50,9 +52,6 @@ PairGrid::PairGrid(LAMMPS *lmp) : PairGrid::~PairGrid() { if (copymode) return; - - memory->destroy(beta); - deallocate_grid(); } @@ -91,6 +90,7 @@ void PairGrid::allocate_grid() memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi, nxlo,nxhi,"pair/grid:gridlocal"); memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal"); + memory->create(beta, ngridlocal, ndesc-ndesc_base, "pair/grid:beta"); } } @@ -104,6 +104,7 @@ void PairGrid::deallocate_grid() gridlocal_allocated = 0; memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); memory->destroy(alocal); + memory->destroy(beta); } } @@ -234,17 +235,21 @@ void PairGrid::copy_gridlocal_to_local_array() } /* ---------------------------------------------------------------------- - get beta from someplace + calculate beta ------------------------------------------------------------------------- */ + // this is a proxy for a call to the energy model + // beta is dE/dB^i, the derivative of the total + // energy w.r.t. to descriptors of grid point i + void PairGrid::compute_beta() { int igrid = 0; for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - for (int icol = ndesc_base; icol < ndesc; icol++) - beta[igrid][icol] = 1.0; + for (int icol = 0; icol < ndesc-ndesc_base; icol++) + beta[igrid][icol] = BETA_CONST; igrid++; } } diff --git a/src/pair_grid.h b/src/pair_grid.h index 97799a5c30..b5bf7ad9ef 100644 --- a/src/pair_grid.h +++ b/src/pair_grid.h @@ -44,7 +44,7 @@ class PairGrid : public Pair { int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive int ngridlocal; // number of local grid points int nvalues; // number of values per grid point - double ****gridlocal; // local grid + double ****gridlocal; // local grid, redundant w.r.t. alocal double **alocal; // pointer to Compute::array_local int triclinic; // triclinic flag double *boxlo, *prd; // box info (units real/ortho or reduced/tri) From 19d469222a6450d0bf8f90358f50a248ff6a6ee7 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 23 Dec 2021 16:28:25 -0700 Subject: [PATCH 042/172] Added test for energy conservation --- examples/snap/econs.py | 16 ++++++++++++++++ examples/snap/in.grid.pair | 27 +++++++++++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 examples/snap/econs.py diff --git a/examples/snap/econs.py b/examples/snap/econs.py new file mode 100644 index 0000000000..2e7167daca --- /dev/null +++ b/examples/snap/econs.py @@ -0,0 +1,16 @@ +import lammps + +infile = "in.grid.pair" +faclist = [0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5] + +print("# Timestep DeltaE DeltaE/Timestep^2") +for fac in faclist: + cmdlist = ["-screen","none","-var","dtfac", "%g" % fac] + lmp = lammps.lammps(cmdargs = cmdlist) + lmp.file(infile) + dt = lmp.extract_global("dt", lammps.LAMMPS_DOUBLE) + de = lmp.extract_fix("avede", lammps.LMP_STYLE_GLOBAL, lammps.LMP_TYPE_SCALAR) + dedt2 = de/dt**2 + print(f"{dt} {de} {dedt2}") + + diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair index 99c9623f7d..e4cf3e3298 100644 --- a/examples/snap/in.grid.pair +++ b/examples/snap/in.grid.pair @@ -1,10 +1,16 @@ # Demonstrate pair style base on sna/grid +# Test energy conservation +# Choose dtfac in the range [0.01,Infinity] +# Large dtfac means small timestep, while +# keeping trajectory output interval fixed +# Variable etotdelta measures change in (PE+KE)/natoms # Initialize simulation -variable dt index 0.5e-5 -variable nthermo index 100 -variable nsteps index 10000 +variable dtfac index 1 +variable dt equal 0.5e-3/${dtfac} +variable nthermo equal 1000*${dtfac} +variable nsteps equal 1000*${dtfac} variable nrep index 3 variable a index 3.0 variable ngrid index 2 @@ -35,8 +41,9 @@ lattice custom $a & region box block 0 ${nx} 0 ${ny} 0 ${nz} create_box 1 box create_atoms 1 box -displace_atoms all random ${del} ${del} ${del} 12345 mass 1 180.88 +displace_atoms all random ${del} ${del} ${del} 12345 +velocity all create $t 4928459 loop geom write_dump all custom test.dump id type x y z @@ -59,7 +66,16 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & quadraticflag ${quad} switchflag ${switch} pair_coeff * * Al -thermo_style custom step temp epair emol etotal press +thermo ${nthermo} +thermo_modify norm yes + +run 0 + +variable etot0 equal etotal +variable etotdelta equal abs(etotal-${etot0})/atoms +fix avede all ave/time 1 ${nthermo} ${nthermo} v_etotdelta + +thermo_style custom step temp epair ke etotal press v_etotdelta f_avede thermo ${nthermo} thermo_modify norm yes @@ -71,6 +87,5 @@ neigh_modify once no every 1 delay 0 check yes # Run MD -velocity all create $t 4928459 loop geom fix 1 all nve run ${nsteps} From 6de9c09730d9b0e9569d44be0f863fd2cdeb397b Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 23 Dec 2021 16:35:30 -0700 Subject: [PATCH 043/172] Tweaked econs.py --- examples/snap/econs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/snap/econs.py b/examples/snap/econs.py index 2e7167daca..aece097622 100644 --- a/examples/snap/econs.py +++ b/examples/snap/econs.py @@ -1,7 +1,7 @@ import lammps infile = "in.grid.pair" -faclist = [0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5] +faclist = [0.001,0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5] print("# Timestep DeltaE DeltaE/Timestep^2") for fac in faclist: From 567c5c733465f891e39e333b877e368f12596b3d Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 23 Dec 2021 16:37:23 -0700 Subject: [PATCH 044/172] Fixed sign error that now gives wonderful energy conservation --- src/ML-SNAP/pair_sna_grid.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index c84dcaf467..43a07b48e4 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -252,9 +252,9 @@ void PairSNAGrid::compute(int eflag, int vflag) snaptr->compute_deidrj(fij); - f[j][0] -= fij[0]; - f[j][1] -= fij[1]; - f[j][2] -= fij[2]; + f[j][0] += fij[0]; + f[j][1] += fij[1]; + f[j][2] += fij[2]; // tally per-atom virial contribution From 57aedc500ee7a99fe290f53b3103286427288886 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 23 Dec 2021 17:40:29 -0700 Subject: [PATCH 045/172] Added a numerical force test, not automated --- examples/snap/in.fnum | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 examples/snap/in.fnum diff --git a/examples/snap/in.fnum b/examples/snap/in.fnum new file mode 100644 index 0000000000..addb9827d0 --- /dev/null +++ b/examples/snap/in.fnum @@ -0,0 +1,63 @@ +# Demonstrate pair style base on sna/grid +# Check numerical forces + +variable nrep index 3 +variable a index 3.0 +variable ngrid index 2 +variable del index 0.1 +variable fdelta index 0.0001 + +units metal + +atom_modify map yes + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 0 1 0 & + a3 0 0 1 & + basis 0 0 0 & + basis 0.5 0.5 0.5 & +# origin 0.25 0.25 0.25 +# origin 0.25e-3 0.25e-3 0.25e-3 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box +mass 1 180.88 +displace_atoms all random ${del} ${del} ${del} 12345 + +# define grid compute and atom compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 1 + +pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & + ${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & + quadraticflag ${quad} switchflag ${switch} +pair_coeff * * Al + +fix fnum all numdiff 1 ${fdelta} +variable fz1 equal fz[1] +variable fnumz1 equal f_fnum[1][3] +variable ferrz1 equal f_fnum[1][3]-fz[1] +thermo_style custom v_fz1 v_fnumz1 v_ferrz1 +thermo_modify norm yes + +run 0 From 4a7f726395ff720145219a6a0a09d4e5fc6e6ec8 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 23 Dec 2021 17:40:59 -0700 Subject: [PATCH 046/172] Minor tweak --- examples/snap/in.grid.pair | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair index e4cf3e3298..128da2ad7a 100644 --- a/examples/snap/in.grid.pair +++ b/examples/snap/in.grid.pair @@ -70,7 +70,6 @@ thermo ${nthermo} thermo_modify norm yes run 0 - variable etot0 equal etotal variable etotdelta equal abs(etotal-${etot0})/atoms fix avede all ave/time 1 ${nthermo} ${nthermo} v_etotdelta @@ -87,5 +86,5 @@ neigh_modify once no every 1 delay 0 check yes # Run MD -fix 1 all nve +fix mynve all nve run ${nsteps} From ad307fb7849e408edad0b5aa8bef7614386e683f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 30 Dec 2021 11:43:32 -0700 Subject: [PATCH 047/172] Added script for RMSE on numerical forces --- examples/snap/fnum.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/snap/fnum.py diff --git a/examples/snap/fnum.py b/examples/snap/fnum.py new file mode 100644 index 0000000000..bde45b042c --- /dev/null +++ b/examples/snap/fnum.py @@ -0,0 +1,24 @@ +import lammps + +def sqerr(a,b): + return (a[0]-b[0])**2+(a[1]-b[1])**2+(a[2]-b[2])**2 + +infile = "in.fnum" + +fdeltalist = [1.0e-2,1.0e-3,1.0e-4,1.0e-5,1.0e-6,1.0e-7,1.0e-8,1.0e-9,1.0e-10] + +print("Fdelta RMSE") +for fdelta in fdeltalist: + cmdlist = ["-screen","none","-var","fdelta",f'{fdelta}'] + lmp = lammps.lammps(cmdargs = cmdlist) + lmp.file(infile) + natoms = lmp.get_natoms() + + f = lmp.extract_atom("f") + fnum = lmp.extract_fix("fnum", lammps.LMP_STYLE_ATOM, lammps.LMP_TYPE_ARRAY) + + sumsq = 0 + for i in range(natoms): + sumsq += sqerr(fnum[i],f[i]) + rmse = (sumsq/natoms)**0.5 + print(f"{fdelta} {rmse}") From 0e8287730271cd3256832ab9249d6fa40ac1da43 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 30 Dec 2021 11:51:16 -0700 Subject: [PATCH 048/172] Tweak --- examples/snap/fnum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/snap/fnum.py b/examples/snap/fnum.py index bde45b042c..9f496861cc 100644 --- a/examples/snap/fnum.py +++ b/examples/snap/fnum.py @@ -18,7 +18,7 @@ for fdelta in fdeltalist: fnum = lmp.extract_fix("fnum", lammps.LMP_STYLE_ATOM, lammps.LMP_TYPE_ARRAY) sumsq = 0 - for i in range(natoms): + for i in range(nlocal): sumsq += sqerr(fnum[i],f[i]) rmse = (sumsq/natoms)**0.5 print(f"{fdelta} {rmse}") From 499bae77bdc3f0ad2521f76a6832c72e55f6b526 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 30 Dec 2021 12:02:53 -0700 Subject: [PATCH 049/172] Tweak --- examples/snap/fnum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/snap/fnum.py b/examples/snap/fnum.py index 9f496861cc..83bdbba503 100644 --- a/examples/snap/fnum.py +++ b/examples/snap/fnum.py @@ -12,7 +12,7 @@ for fdelta in fdeltalist: cmdlist = ["-screen","none","-var","fdelta",f'{fdelta}'] lmp = lammps.lammps(cmdargs = cmdlist) lmp.file(infile) - natoms = lmp.get_natoms() + nlocal = lmp.extract_global("nlocal") f = lmp.extract_atom("f") fnum = lmp.extract_fix("fnum", lammps.LMP_STYLE_ATOM, lammps.LMP_TYPE_ARRAY) @@ -20,5 +20,5 @@ for fdelta in fdeltalist: sumsq = 0 for i in range(nlocal): sumsq += sqerr(fnum[i],f[i]) - rmse = (sumsq/natoms)**0.5 + rmse = (sumsq/nlocal)**0.5 print(f"{fdelta} {rmse}") From 82b7b2f3ea641daaff87dd2659dc881bbcc585ef Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Tue, 4 Jan 2022 14:02:29 -0700 Subject: [PATCH 050/172] Simplified access of force errors --- examples/snap/fnum.py | 14 ++------------ examples/snap/in.fnum | 8 +++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/examples/snap/fnum.py b/examples/snap/fnum.py index 83bdbba503..1e50e49b09 100644 --- a/examples/snap/fnum.py +++ b/examples/snap/fnum.py @@ -1,8 +1,5 @@ import lammps -def sqerr(a,b): - return (a[0]-b[0])**2+(a[1]-b[1])**2+(a[2]-b[2])**2 - infile = "in.fnum" fdeltalist = [1.0e-2,1.0e-3,1.0e-4,1.0e-5,1.0e-6,1.0e-7,1.0e-8,1.0e-9,1.0e-10] @@ -12,13 +9,6 @@ for fdelta in fdeltalist: cmdlist = ["-screen","none","-var","fdelta",f'{fdelta}'] lmp = lammps.lammps(cmdargs = cmdlist) lmp.file(infile) - nlocal = lmp.extract_global("nlocal") - - f = lmp.extract_atom("f") - fnum = lmp.extract_fix("fnum", lammps.LMP_STYLE_ATOM, lammps.LMP_TYPE_ARRAY) - - sumsq = 0 - for i in range(nlocal): - sumsq += sqerr(fnum[i],f[i]) - rmse = (sumsq/nlocal)**0.5 + faverrsq = lmp.extract_compute("faverrsq", lammps.LMP_STYLE_GLOBAL, lammps.LMP_TYPE_SCALAR) + rmse = faverrsq**0.5 print(f"{fdelta} {rmse}") diff --git a/examples/snap/in.fnum b/examples/snap/in.fnum index addb9827d0..1298e9aed9 100644 --- a/examples/snap/in.fnum +++ b/examples/snap/in.fnum @@ -54,10 +54,8 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & pair_coeff * * Al fix fnum all numdiff 1 ${fdelta} -variable fz1 equal fz[1] -variable fnumz1 equal f_fnum[1][3] -variable ferrz1 equal f_fnum[1][3]-fz[1] -thermo_style custom v_fz1 v_fnumz1 v_ferrz1 -thermo_modify norm yes +variable ferrsq atom (fx-f_fnum[1])^2+(fy-f_fnum[2])^2+(fz-f_fnum[3])^2 +compute faverrsq all reduce ave v_ferrsq +thermo_style custom c_faverrsq run 0 From 6ef7d19fc0a8a6180dd0c9ea3d4399c7d8143a0c Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 8 Apr 2022 15:05:17 -0600 Subject: [PATCH 051/172] Added a test for bgrid/local --- examples/snap/grid.local.py | 119 +++++++++++++++++++++++++++++ examples/snap/in.grid.python.local | 69 +++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100755 examples/snap/grid.local.py create mode 100644 examples/snap/in.grid.python.local diff --git a/examples/snap/grid.local.py b/examples/snap/grid.local.py new file mode 100755 index 0000000000..8b8cb99d66 --- /dev/null +++ b/examples/snap/grid.local.py @@ -0,0 +1,119 @@ +#!/Users/athomps/miniconda3/bin/python3.7 +# +# An example of SNAP grid from LAMMPS Python interface +# +# https://lammps.sandia.gov/doc/Python_library.html + + +from lammps import lammps, LMP_STYLE_LOCAL, LMP_SIZE_ROWS, LMP_SIZE_COLS, LMP_TYPE_ARRAY +import lammps_utils + +from mpi4py import MPI +comm = MPI.COMM_WORLD +me = comm.Get_rank() +nprocs = comm.Get_size() + +# define command line input variables + +ngridx = 2 +ngridy = 3 +ngridz = nprocs +twojmax = 2 + +lmp_cmdargs = ["-echo","screen"] +lmp_cmdargs = lammps_utils.set_cmdlinevars(lmp_cmdargs, + { + "ngridx":ngridx, + "ngridy":ngridy, + "ngridz":ngridz, + "twojmax":twojmax + } + ) + +# launch LAMMPS instance + +lmp = lammps(cmdargs=lmp_cmdargs) + +# run LAMMPS input script + +lmp.file("in.grid.python.local") + +# get quantities from LAMMPS + +num_atoms = lmp.get_natoms() + +# set things not accessible from LAMMPS + +# first 3 cols are x, y, z, coords + +ncols0 = 3 + +# analytical relation + +ncoeff = (twojmax+2)*(twojmax+3)*(twojmax+4) +ncoeff = ncoeff // 24 # integer division +ncols = ncols0+ncoeff + +# get B_0 at position (0,0,0) in 4 different ways + +# 1. from comute sna/atom + +bptr = lmp.extract_compute("b", 1, 2) # 1 = per-atom data, 2 = array +print("b = ",bptr[0][0]) + +# 2. from compute sna/grid + +bgridptr = lmp.extract_compute("bgrid", 0, 2) # 0 = style global, 2 = type array +print("bgrid = ",bgridptr[0][3]) + +# 3. from Numpy array pointing to sna/atom array + +bptr_np = lammps_utils.extract_compute_np(lmp,"b",1,2,(num_atoms,ncoeff)) +print("b_np = ",bptr_np[0][0]) + +# 4. from Numpy array pointing to sna/grid array + +bgridptr_np = lammps_utils.extract_compute_np(lmp,"bgrid",0,2,(ngridz,ngridy,ngridx,ncols)) +print("bgrid_np = ",bgridptr_np[0][0][0][ncols0+0]) + +# 5. from sna/grid/local array + +bgridlocalnrows = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_SIZE_ROWS) +print("bgridlocal nrows = ",bgridlocalnrows) +bgridlocalncols = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_SIZE_COLS) +print("bgridlocal ncols = ",bgridlocalncols) +bgridlocalptr = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_TYPE_ARRAY) +print("bgridlocal = ",bgridlocalptr) +print("bgridlocal[0][0] = ",bgridlocalptr[5][10]) + +# print out the LAMMPS array to a file + +outfile = open("bgrid.dat",'w') +igrid = 0 +for iz in range(ngridz): + for iy in range(ngridy): + for ix in range(ngridx): + outfile.write("x, y, z = %g %g %g\n" % + (bgridptr[igrid][0], + bgridptr[igrid][1], + bgridptr[igrid][2])) + for icoeff in range(ncoeff): + outfile.write("%g " % bgridptr[igrid][ncols0+icoeff]) + outfile.write("\n") + igrid += 1 +outfile.close() + +# print out the Numpy array to a file + +outfile = open("bgrid_np.dat",'w') +for iz in range(ngridz): + for iy in range(ngridy): + for ix in range(ngridx): + outfile.write("x, y, z = %g %g %g\n" % + (bgridptr_np[iz][iy][ix][0], + bgridptr_np[iz][iy][ix][1], + bgridptr_np[iz][iy][ix][2])) + for icoeff in range(ncoeff): + outfile.write("%g " % bgridptr_np[iz][iy][ix][ncols0+icoeff]) + outfile.write("\n") +outfile.close() diff --git a/examples/snap/in.grid.python.local b/examples/snap/in.grid.python.local new file mode 100644 index 0000000000..af95696a2b --- /dev/null +++ b/examples/snap/in.grid.python.local @@ -0,0 +1,69 @@ +# Demonstrate bispectrum per-atom and grid computes + +# Invoked from grid.py +# pass in values for ngridx, ngridy, ngridz, twojmax + +# Initialize simulation + +variable nsteps equal 0 +variable nrep equal 1 +variable a equal 3.316 + +units metal + +# make processor grid equal to nz + +processors 1 1 ${ngridz} + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom ${a} a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +# define grid compute and atom compute + +group snapgroup type 1 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quad equal 0 +variable switch equal 1 + +compute b all sna/atom ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} + +compute bgrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} + +compute bgridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} + +# create dummy potential for neighbor list + +variable rcutneigh equal 2.0*${rcutfac}*${radelem} +pair_style zero ${rcutneigh} +pair_coeff * * + +# define output + +thermo_style custom step temp ke pe vol c_bgrid[1][1] +thermo_modify norm yes + +dump mydump_b all custom 1000 dump_b id c_b[*] + +dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_bgridlocal[*] + +# run + +run 0 From da6fb4c5443d72e790484e63a23e3e9b4e272860 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 8 Apr 2022 15:47:12 -0600 Subject: [PATCH 052/172] Added epsilon shift to eliminate uneven tiebreaks --- src/compute_grid_local.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 1b8de3c48a..e99a742c3b 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -191,6 +191,19 @@ void ComputeGridLocal::set_grid_local() zfrachi = comm->mysplit[2][1]; } + // not fully clear why this works + // without, sometimes get uneven assignments + // in case where ngridz is multiple of nprocz + + double MYEPS = 1.0e-10; + + xfraclo += MYEPS; + xfrachi += MYEPS; + yfraclo += MYEPS; + yfrachi += MYEPS; + zfraclo += MYEPS; + zfrachi += MYEPS; + nxlo = static_cast (xfraclo * nx); if (1.0*nxlo != xfraclo*nx) nxlo++; nxhi = static_cast (xfrachi * nx); From 429163d2b29608892c67d69852802e062de3dc0f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 11 Apr 2022 14:47:14 -0600 Subject: [PATCH 053/172] Added check for grid points outside subdomain --- src/compute_grid_local.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index e99a742c3b..d751a517cb 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -238,6 +238,14 @@ void ComputeGridLocal::assign_coords() alocal[igrid][2] = iz; double xgrid[3]; grid2x(ix, iy, iz, xgrid); + + // ensure gridpoint is not strictly outside subdomain + + if (xgrid[0] < sublo[0] && xgrid[0] > subhi[0] && + xgrid[1] < sublo[1] && xgrid[1] > subhi[1] && + xgrid[2] < sublo[2] && xgrid[2] > subhi[2]) + error->all(FLERR,"Invalid gridpoint position in compute grid/local"); + alocal[igrid][3] = xgrid[0]; alocal[igrid][4] = xgrid[1]; alocal[igrid][5] = xgrid[2]; From bae9ef7e565e2616cef8901fc0dc923f210f4754 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 11 Apr 2022 14:51:15 -0600 Subject: [PATCH 054/172] Added check for grid points outside subdomain --- src/compute_grid_local.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index d751a517cb..33e2bc9c49 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -244,7 +244,7 @@ void ComputeGridLocal::assign_coords() if (xgrid[0] < sublo[0] && xgrid[0] > subhi[0] && xgrid[1] < sublo[1] && xgrid[1] > subhi[1] && xgrid[2] < sublo[2] && xgrid[2] > subhi[2]) - error->all(FLERR,"Invalid gridpoint position in compute grid/local"); + error->one(FLERR,"Invalid gridpoint position in compute grid/local"); alocal[igrid][3] = xgrid[0]; alocal[igrid][4] = xgrid[1]; From c939316b99b9e06ac10d14455665ee85b4712ff4 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 11 Apr 2022 14:52:35 -0600 Subject: [PATCH 055/172] Added check for grid points outside subdomain --- src/compute_grid_local.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 33e2bc9c49..299e42d81d 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -241,9 +241,9 @@ void ComputeGridLocal::assign_coords() // ensure gridpoint is not strictly outside subdomain - if (xgrid[0] < sublo[0] && xgrid[0] > subhi[0] && - xgrid[1] < sublo[1] && xgrid[1] > subhi[1] && - xgrid[2] < sublo[2] && xgrid[2] > subhi[2]) + if (xgrid[0] < sublo[0] || xgrid[0] > subhi[0] || + xgrid[1] < sublo[1] || xgrid[1] > subhi[1] || + xgrid[2] < sublo[2] || xgrid[2] > subhi[2]) error->one(FLERR,"Invalid gridpoint position in compute grid/local"); alocal[igrid][3] = xgrid[0]; From ab73faee095419dbf80733bd64745880c0bab53a Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Tue, 19 Apr 2022 11:33:59 -0600 Subject: [PATCH 056/172] Removed EPS trick that was causing some unexpected reordering --- src/compute_grid_local.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 299e42d81d..ec385f6a13 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -191,18 +191,18 @@ void ComputeGridLocal::set_grid_local() zfrachi = comm->mysplit[2][1]; } - // not fully clear why this works - // without, sometimes get uneven assignments - // in case where ngridz is multiple of nprocz + // // not fully clear why this works + // // without, sometimes get uneven assignments + // // in case where ngridz is multiple of nprocz - double MYEPS = 1.0e-10; + // double MYEPS = 1.0e-10; - xfraclo += MYEPS; - xfrachi += MYEPS; - yfraclo += MYEPS; - yfrachi += MYEPS; - zfraclo += MYEPS; - zfrachi += MYEPS; + // xfraclo += MYEPS; + // xfrachi += MYEPS; + // yfraclo += MYEPS; + // yfrachi += MYEPS; + // zfraclo += MYEPS; + // zfrachi += MYEPS; nxlo = static_cast (xfraclo * nx); if (1.0*nxlo != xfraclo*nx) nxlo++; From 4c5782018897874fe3c11ac50757d505d7239885 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Tue, 19 Apr 2022 11:48:16 -0600 Subject: [PATCH 057/172] Applied the Modine transpose to x,y,z --- src/compute_grid_local.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index ec385f6a13..0d8738e230 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -230,9 +230,9 @@ void ComputeGridLocal::set_grid_local() void ComputeGridLocal::assign_coords() { int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) + for (int ix = nxlo; ix <= nxhi; ix++) for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { + for (int iz = nzlo; iz <= nzhi; iz++) { alocal[igrid][0] = ix; alocal[igrid][1] = iy; alocal[igrid][2] = iz; @@ -260,9 +260,9 @@ void ComputeGridLocal::assign_coords() void ComputeGridLocal::copy_gridlocal_to_local_array() { int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) + for (int ix = nxlo; ix <= nxhi; ix++) for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { + for (int iz = nzlo; iz <= nzhi; iz++) { for (int icol = size_local_cols_base; icol < size_local_cols; icol++) alocal[igrid][icol] = gridlocal[icol][iz][iy][ix]; igrid++; From 78aec491ff871ca2135b3861cd34f40b80ab89ca Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 22 Apr 2022 17:32:26 -0600 Subject: [PATCH 058/172] Minor tweaks --- examples/snap/grid.local.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/snap/grid.local.py b/examples/snap/grid.local.py index 8b8cb99d66..414558b79b 100755 --- a/examples/snap/grid.local.py +++ b/examples/snap/grid.local.py @@ -82,9 +82,11 @@ bgridlocalnrows = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_SIZE_RO print("bgridlocal nrows = ",bgridlocalnrows) bgridlocalncols = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_SIZE_COLS) print("bgridlocal ncols = ",bgridlocalncols) -bgridlocalptr = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_TYPE_ARRAY) -print("bgridlocal = ",bgridlocalptr) -print("bgridlocal[0][0] = ",bgridlocalptr[5][10]) + +if bgridlocalnrows > 0: + bgridlocalptr = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_TYPE_ARRAY) + print("bgridlocal = ",bgridlocalptr) + print("bgridlocal[0][0] = ",bgridlocalptr[5][10]) # print out the LAMMPS array to a file From 872e4de6ab9c91cd8e1001457cc39f558e38e53e Mon Sep 17 00:00:00 2001 From: Lenz Fiedler Date: Thu, 19 May 2022 23:21:15 +0200 Subject: [PATCH 059/172] Rolled back the Modine transpose --- src/compute_grid_local.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 0d8738e230..ec385f6a13 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -230,9 +230,9 @@ void ComputeGridLocal::set_grid_local() void ComputeGridLocal::assign_coords() { int igrid = 0; - for (int ix = nxlo; ix <= nxhi; ix++) + for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) - for (int iz = nzlo; iz <= nzhi; iz++) { + for (int ix = nxlo; ix <= nxhi; ix++) { alocal[igrid][0] = ix; alocal[igrid][1] = iy; alocal[igrid][2] = iz; @@ -260,9 +260,9 @@ void ComputeGridLocal::assign_coords() void ComputeGridLocal::copy_gridlocal_to_local_array() { int igrid = 0; - for (int ix = nxlo; ix <= nxhi; ix++) + for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) - for (int iz = nzlo; iz <= nzhi; iz++) { + for (int ix = nxlo; ix <= nxhi; ix++) { for (int icol = size_local_cols_base; icol < size_local_cols; icol++) alocal[igrid][icol] = gridlocal[icol][iz][iy][ix]; igrid++; From 2b001f9505aff2fe538d78c42720960025b412df Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 20 May 2022 13:21:55 -0600 Subject: [PATCH 060/172] Fix subdomain check for triclinic --- src/compute_grid_local.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index ec385f6a13..66eb0c5db3 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -81,6 +81,7 @@ void ComputeGridLocal::setup() /* ---------------------------------------------------------------------- convert global array indexes to box coords + for triclinic, these will be lamda coords ------------------------------------------------------------------------- */ void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) @@ -88,8 +89,6 @@ void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) x[0] = ix*delx; x[1] = iy*dely; x[2] = iz*delz; - - if (triclinic) domain->lamda2x(x, x); } /* ---------------------------------------------------------------------- @@ -245,6 +244,10 @@ void ComputeGridLocal::assign_coords() xgrid[1] < sublo[1] || xgrid[1] > subhi[1] || xgrid[2] < sublo[2] || xgrid[2] > subhi[2]) error->one(FLERR,"Invalid gridpoint position in compute grid/local"); + + // convert lamda to x, y, z, after sudomain check + + if (triclinic) domain->lamda2x(xgrid, xgrid); alocal[igrid][3] = xgrid[0]; alocal[igrid][4] = xgrid[1]; From 59e010343016b9eafcaf75d3f279fd2b34b9fbc5 Mon Sep 17 00:00:00 2001 From: Lenz Fiedler Date: Tue, 24 May 2022 17:00:41 +0200 Subject: [PATCH 061/172] Added EPSILON to subdomain check --- src/compute_grid_local.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 66eb0c5db3..a6f3cf29ad 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -23,6 +23,10 @@ #include "error.h" #include "comm.h" +// For the subdomain test below; grid-points and subdomain boundaries +// sometimes differ by minimal amounts (in the order of 2e-17). +#define EPSILON 1.0e-10 + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -239,11 +243,15 @@ void ComputeGridLocal::assign_coords() grid2x(ix, iy, iz, xgrid); // ensure gridpoint is not strictly outside subdomain - - if (xgrid[0] < sublo[0] || xgrid[0] > subhi[0] || - xgrid[1] < sublo[1] || xgrid[1] > subhi[1] || - xgrid[2] < sublo[2] || xgrid[2] > subhi[2]) - error->one(FLERR,"Invalid gridpoint position in compute grid/local"); + // There have been some problem with a gridpoint being something like 2e-17 outside of the subdomain, + // thus the EPISLON check. + if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || + (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || + (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) + { + error->one(FLERR,"Invalid gridpoint position in compute grid/local"); + } + // convert lamda to x, y, z, after sudomain check From 0a8b4c514265c478d219876b75cc90ade4ea3677 Mon Sep 17 00:00:00 2001 From: Lenz Fiedler Date: Wed, 25 May 2022 15:27:27 +0200 Subject: [PATCH 062/172] Hotfix for triclinic calculations --- src/compute_grid_local.cpp | 36 ++++++++++++++++++++++++++++++------ src/compute_grid_local.h | 1 + 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index a6f3cf29ad..504555a718 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -85,7 +85,6 @@ void ComputeGridLocal::setup() /* ---------------------------------------------------------------------- convert global array indexes to box coords - for triclinic, these will be lamda coords ------------------------------------------------------------------------- */ void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) @@ -93,8 +92,23 @@ void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) x[0] = ix*delx; x[1] = iy*dely; x[2] = iz*delz; + + if (triclinic) domain->lamda2x(x, x); } +/* ---------------------------------------------------------------------- + convert global array indexes to lamda coords; for orthorombic + cells defaults to grid2x. +------------------------------------------------------------------------- */ + +void ComputeGridLocal::grid2lamda(int ix, int iy, int iz, double *x) +{ + x[0] = ix*delx; + x[1] = iy*dely; + x[2] = iz*delz; +} + + /* ---------------------------------------------------------------------- create arrays ------------------------------------------------------------------------- */ @@ -240,9 +254,20 @@ void ComputeGridLocal::assign_coords() alocal[igrid][1] = iy; alocal[igrid][2] = iz; double xgrid[3]; - grid2x(ix, iy, iz, xgrid); - // ensure gridpoint is not strictly outside subdomain + // For triclinic: create gridpoint in lamda coordinates and transform after check. + // For orthorombic: create gridpoint in box coordinates. + + if (triclinic) + { + grid2lamda(ix, iy, iz, xgrid); + } + else + { + grid2x(ix, iy, iz, xgrid); + } + + // Ensure gridpoint is not strictly outside subdomain. // There have been some problem with a gridpoint being something like 2e-17 outside of the subdomain, // thus the EPISLON check. if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || @@ -252,11 +277,10 @@ void ComputeGridLocal::assign_coords() error->one(FLERR,"Invalid gridpoint position in compute grid/local"); } - // convert lamda to x, y, z, after sudomain check - + if (triclinic) domain->lamda2x(xgrid, xgrid); - + alocal[igrid][3] = xgrid[0]; alocal[igrid][4] = xgrid[1]; alocal[igrid][5] = xgrid[2]; diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index b3d2f4cd94..79a5ea765d 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -49,6 +49,7 @@ class ComputeGridLocal : public Compute { void allocate(); // create arrays void deallocate(); // free arrays void grid2x(int, int, int, double*); // convert global indices to coordinates + void grid2lamda(int, int, int, double*); // convert global indices to lamda coordinates void set_grid_global(); // set global grid void set_grid_local(); // set bounds for local grid void assign_coords(); // assign coords for grid From f68247ad6aed9cfd41b818095e05dfa1dae6f586 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Jun 2022 05:10:00 -0400 Subject: [PATCH 063/172] add ML-PACE and PLUGIN packages to be compiled with MinGW cross-compilers --- cmake/presets/mingw-cross.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 81db71729a..29de394b8e 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -46,8 +46,9 @@ set(WIN_PACKAGES MISC ML-HDNNP ML-IAP - ML-SNAP + ML-PACE ML-RANN + ML-SNAP MOFFF MOLECULE MOLFILE @@ -56,6 +57,7 @@ set(WIN_PACKAGES ORIENT PERI PHONON + PLUGIN POEMS PTM QEQ From f9b5679c0078e2fe3b312dd273d5370249dd7fe7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Jun 2022 07:16:19 -0400 Subject: [PATCH 064/172] remove unused function arguments --- src/EXTRA-COMPUTE/compute_stress_cartesian.cpp | 6 +++--- src/EXTRA-COMPUTE/compute_stress_cartesian.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp index 25c3117b0f..f873c70bae 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp @@ -318,7 +318,7 @@ void ComputeStressCartesian::compute_array() // Check if inside cut-off if (rsq >= cutsq[itype][jtype]) continue; pair->single(i, j, itype, jtype, rsq, factor_coul, factor_lj, fpair); - compute_pressure(fpair, xi1, xi2, xj1, xj2, delx, dely, delz); + compute_pressure(fpair, xi1, xi2, delx, dely, delz); } } @@ -356,8 +356,8 @@ void ComputeStressCartesian::compute_array() } } -void ComputeStressCartesian::compute_pressure(double fpair, double xi, double yi, double xj, - double yj, double delx, double dely, double delz) +void ComputeStressCartesian::compute_pressure(double fpair, double xi, double yi, double delx, + double dely, double delz) { int bin1, bin2, next_bin1, next_bin2; double la = 0.0, lb = 0.0, l_sum = 0.0; diff --git a/src/EXTRA-COMPUTE/compute_stress_cartesian.h b/src/EXTRA-COMPUTE/compute_stress_cartesian.h index 63e33a5407..d4505a1e8e 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cartesian.h +++ b/src/EXTRA-COMPUTE/compute_stress_cartesian.h @@ -41,7 +41,7 @@ class ComputeStressCartesian : public Compute { double *dens, *pkxx, *pkyy, *pkzz, *pcxx, *pcyy, *pczz; double *tdens, *tpkxx, *tpkyy, *tpkzz, *tpcxx, *tpcyy, *tpczz; class NeighList *list; - void compute_pressure(double, double, double, double, double, double, double, double); + void compute_pressure(double, double, double, double, double, double); }; } // namespace LAMMPS_NS From 7c4d77f7765eec4d989900357c729646891a0f38 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Jun 2022 07:36:25 -0400 Subject: [PATCH 065/172] tweak epsilon for portability --- unittest/force-styles/tests/manybody-pair-pace_product.yaml | 2 +- unittest/force-styles/tests/manybody-pair-pace_recursive.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unittest/force-styles/tests/manybody-pair-pace_product.yaml b/unittest/force-styles/tests/manybody-pair-pace_product.yaml index 9aac9ddcae..1e82029777 100644 --- a/unittest/force-styles/tests/manybody-pair-pace_product.yaml +++ b/unittest/force-styles/tests/manybody-pair-pace_product.yaml @@ -1,7 +1,7 @@ --- lammps_version: 17 Feb 2022 date_generated: Fri Mar 18 22:17:48 2022 -epsilon: 5e-13 +epsilon: 1e-12 skip_tests: prerequisites: ! | pair pace diff --git a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml index eef7509606..f20440c85d 100644 --- a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml +++ b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Mar 2021 date_generated: Wed Apr 7 19:30:07 2021 -epsilon: 5e-13 +epsilon: 1e-12 prerequisites: ! | pair pace pre_commands: ! | From 587438eb30ecc99f3c9877cecdd1bde3cbfceb9a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 3 Jun 2022 09:14:34 -0400 Subject: [PATCH 066/172] fix typo in read_data add merge example --- doc/src/read_data.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/read_data.rst b/doc/src/read_data.rst index 68e1efc496..b10e758444 100644 --- a/doc/src/read_data.rst +++ b/doc/src/read_data.rst @@ -56,7 +56,7 @@ Examples read_data ../run7/data.polymer.gz read_data data.protein fix mycmap crossterm CMAP read_data data.water add append offset 3 1 1 1 1 shift 0.0 0.0 50.0 - read_data data.water add merge 1 group solvent + read_data data.water add merge group solvent Description """"""""""" From 25c74652e36e594dfd827bc41360f7a30f69fe16 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jun 2022 04:25:13 -0400 Subject: [PATCH 067/172] remove bogus tags --- unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml | 1 - unittest/force-styles/tests/atomic-pair-threebody_table.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml b/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml index b8eae7848b..7229a3cd26 100644 --- a/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml +++ b/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml @@ -1,6 +1,5 @@ --- lammps_version: 4 May 2022 -tags: generated date_generated: Wed Jun 1 15:17:22 2022 epsilon: 1e-12 skip_tests: single diff --git a/unittest/force-styles/tests/atomic-pair-threebody_table.yaml b/unittest/force-styles/tests/atomic-pair-threebody_table.yaml index 605f18a9a6..bb3c8c1c1b 100644 --- a/unittest/force-styles/tests/atomic-pair-threebody_table.yaml +++ b/unittest/force-styles/tests/atomic-pair-threebody_table.yaml @@ -1,6 +1,5 @@ --- lammps_version: 4 May 2022 -tags: generated date_generated: Wed Jun 1 15:28:13 2022 epsilon: 1e-05 skip_tests: single From fa9ad10bc1c32beed713e3b618c1b91e544fdd38 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jun 2022 05:00:12 -0400 Subject: [PATCH 068/172] add missing line to read_data docs about atom style dielectric --- doc/src/read_data.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/read_data.rst b/doc/src/read_data.rst index b10e758444..853d86785e 100644 --- a/doc/src/read_data.rst +++ b/doc/src/read_data.rst @@ -622,6 +622,8 @@ of analysis. - atom-ID molecule-ID atom-type x y z * - charge - atom-ID atom-type q x y z + * - dielectric + - atom-ID atom-type q x y z normx normy normz area ed em epsilon curvature * - dipole - atom-ID atom-type q x y z mux muy muz * - dpd From 0dc486c90b03d7d372f0b4813085d2847a220b77 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jun 2022 05:00:28 -0400 Subject: [PATCH 069/172] fix bug introduced during stringification --- src/DIELECTRIC/atom_vec_dielectric.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DIELECTRIC/atom_vec_dielectric.cpp b/src/DIELECTRIC/atom_vec_dielectric.cpp index b15b233991..67bb9f7dc3 100644 --- a/src/DIELECTRIC/atom_vec_dielectric.cpp +++ b/src/DIELECTRIC/atom_vec_dielectric.cpp @@ -78,9 +78,9 @@ AtomVecDielectric::AtomVecDielectric(LAMMPS *_lmp) : AtomVec(_lmp) "mu", "area", "ed", "em", "epsilon", "curvature", "q_unscaled"}; fields_create = {"q", "molecule", "num_bond", "num_angle", "num_dihedral", "num_improper", "nspecial", "mu", "area", "ed", "em", "epsilon", "curvature", "q_unscaled"}; - fields_data_atom = { "id", "molecule", "type", "q", "x", "mu3", "area", "ed", "em", "epsilon", + fields_data_atom = {"id", "molecule", "type", "q", "x", "mu3", "area", "ed", "em", "epsilon", "curvature"}; - fields_data_vel = {"id v"}; + fields_data_vel = {"id", "v"}; // clang-format on setup_fields(); From 3beb071d382bd3d76ad48ebfd37f2fb13c0a92f5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jun 2022 05:15:14 -0400 Subject: [PATCH 070/172] make plugin compilation settings with MSVC consistent and more compile specific --- cmake/CMakeLists.txt | 12 +++++++----- examples/kim/plugin/CMakeLists.txt | 11 ++++++++--- examples/plugins/CMakeLists.txt | 11 ++++++++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2566497c0e..6af33cd5b3 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -135,11 +135,13 @@ set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions") # ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro # and prints lots of pointless warnings about "unsafe" functions if(MSVC) - add_compile_options(/Zc:__cplusplus) - add_compile_options(/wd4244) - add_compile_options(/wd4267) - if(LAMMPS_EXCEPTIONS) - add_compile_options(/EHsc) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + if(LAMMPS_EXCEPTIONS) + add_compile_options(/EHsc) + endif() endif() add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/examples/kim/plugin/CMakeLists.txt b/examples/kim/plugin/CMakeLists.txt index f4cb5f598d..851f4db607 100644 --- a/examples/kim/plugin/CMakeLists.txt +++ b/examples/kim/plugin/CMakeLists.txt @@ -28,9 +28,14 @@ endif() # ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro # and prints lots of pointless warnings about "unsafe" functions if(MSVC) - add_compile_options(/Zc:__cplusplus) - add_compile_options(/wd4244) - add_compile_options(/wd4267) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + if(LAMMPS_EXCEPTIONS) + add_compile_options(/EHsc) + endif() + endif() add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/examples/plugins/CMakeLists.txt b/examples/plugins/CMakeLists.txt index 8bef055ad3..688835de56 100644 --- a/examples/plugins/CMakeLists.txt +++ b/examples/plugins/CMakeLists.txt @@ -32,9 +32,14 @@ else() # ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro # and prints lots of pointless warnings about "unsafe" functions if(MSVC) - add_compile_options(/Zc:__cplusplus) - add_compile_options(/wd4244) - add_compile_options(/wd4267) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + if(LAMMPS_EXCEPTIONS) + add_compile_options(/EHsc) + endif() + endif() add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() endif() From a232bd330223d5408836010ea6b5e7d50c0df2ac Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jun 2022 10:59:25 -0400 Subject: [PATCH 071/172] refactor LAMMPS plugin building to share more code and to add a demo for ML-PACE --- cmake/Modules/LAMMPSInterfacePlugin.cmake | 197 ++++++++++++++++++ cmake/Modules/Packages/ML-PACE.cmake | 5 +- examples/PACKAGES/pace/plugin/CMakeLists.txt | 36 ++++ .../pace/plugin/LAMMPSInterfacePlugin.cmake | 1 + examples/PACKAGES/pace/plugin/ML-PACE.cmake | 1 + .../pace/plugin/lammps-text-logo-wide.bmp | Bin 0 -> 25818 bytes examples/PACKAGES/pace/plugin/lammps.ico | Bin 0 -> 209266 bytes examples/PACKAGES/pace/plugin/paceplugin.cpp | 28 +++ examples/PACKAGES/pace/plugin/paceplugin.nsis | 157 ++++++++++++++ examples/kim/plugin/CMakeLists.txt | 46 +--- examples/kim/plugin/LAMMPSInterfaceCXX.cmake | 88 -------- .../kim/plugin/LAMMPSInterfacePlugin.cmake | 1 + 12 files changed, 427 insertions(+), 133 deletions(-) create mode 100644 cmake/Modules/LAMMPSInterfacePlugin.cmake create mode 100644 examples/PACKAGES/pace/plugin/CMakeLists.txt create mode 120000 examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake create mode 120000 examples/PACKAGES/pace/plugin/ML-PACE.cmake create mode 100644 examples/PACKAGES/pace/plugin/lammps-text-logo-wide.bmp create mode 100644 examples/PACKAGES/pace/plugin/lammps.ico create mode 100644 examples/PACKAGES/pace/plugin/paceplugin.cpp create mode 100644 examples/PACKAGES/pace/plugin/paceplugin.nsis delete mode 100644 examples/kim/plugin/LAMMPSInterfaceCXX.cmake create mode 120000 examples/kim/plugin/LAMMPSInterfacePlugin.cmake diff --git a/cmake/Modules/LAMMPSInterfacePlugin.cmake b/cmake/Modules/LAMMPSInterfacePlugin.cmake new file mode 100644 index 0000000000..ec7a739785 --- /dev/null +++ b/cmake/Modules/LAMMPSInterfacePlugin.cmake @@ -0,0 +1,197 @@ +# CMake script code to define LAMMPS settings required for building LAMMPS plugins + +# enforce out-of-source build +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. " + "Please remove CMakeCache.txt and CMakeFiles first.") +endif() + +# global LAMMPS/plugin build settings +set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder") +if(NOT LAMMPS_SOURCE_DIR) + message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR") +endif() + +# by default, install into $HOME/.local (not /usr/local), +# so that no root access (and sudo) is needed +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE) +endif() + +# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro +# and prints lots of pointless warnings about "unsafe" functions +if(MSVC) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + if(LAMMPS_EXCEPTIONS) + add_compile_options(/EHsc) + endif() + endif() + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) +endif() + +# C++11 is required +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Need -restrict with Intel compilers +if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict") +endif() +set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + +####### +# helper functions from LAMMPSUtils.cmake +function(validate_option name values) + string(TOLOWER ${${name}} needle_lower) + string(TOUPPER ${${name}} needle_upper) + list(FIND ${values} ${needle_lower} IDX_LOWER) + list(FIND ${values} ${needle_upper} IDX_UPPER) + if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0) + list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}}) + message(FATAL_ERROR "\n########################################################################\n" + "Invalid value '${${name}}' for option ${name}\n" + "\n" + "Possible values are:\n" + "${POSSIBLE_VALUE_LIST}" + "########################################################################") + endif() +endfunction(validate_option) + +# helper function for getting the most recently modified file or folder from a glob pattern +function(get_newest_file path variable) + file(GLOB _dirs ${path}) + set(_besttime 2000-01-01T00:00:00) + set(_bestfile "") + foreach(_dir ${_dirs}) + file(TIMESTAMP ${_dir} _newtime) + if(_newtime IS_NEWER_THAN _besttime) + set(_bestfile ${_dir}) + set(_besttime ${_newtime}) + endif() + endforeach() + if(_bestfile STREQUAL "") + message(FATAL_ERROR "Could not find valid path at: ${path}") + endif() + set(${variable} ${_bestfile} PARENT_SCOPE) +endfunction() + +################################################################################# +# LAMMPS C++ interface. We only need the header related parts except on windows. +add_library(lammps INTERFACE) +target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR}) +if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) + target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a) +endif() + +################################################################################ +# MPI configuration +if(NOT CMAKE_CROSSCOMPILING) + find_package(MPI QUIET) + option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) +else() + option(BUILD_MPI "Build MPI version" OFF) +endif() + +if(BUILD_MPI) + # do not include the (obsolete) MPI C++ bindings which makes + # for leaner object files and avoids namespace conflicts + set(MPI_CXX_SKIP_MPICXX TRUE) + # We use a non-standard procedure to cross-compile with MPI on Windows + if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) + # Download and configure custom MPICH files for Windows + message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows") + set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball") + set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball") + set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball") + set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball") + mark_as_advanced(MPICH2_WIN64_DEVEL_URL) + mark_as_advanced(MPICH2_WIN32_DEVEL_URL) + mark_as_advanced(MPICH2_WIN64_DEVEL_MD5) + mark_as_advanced(MPICH2_WIN32_DEVEL_MD5) + + include(ExternalProject) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + ExternalProject_Add(mpi4win_build + URL ${MPICH2_WIN64_DEVEL_URL} + URL_MD5 ${MPICH2_WIN64_DEVEL_MD5} + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + BUILD_BYPRODUCTS /lib/libmpi.a) + else() + ExternalProject_Add(mpi4win_build + URL ${MPICH2_WIN32_DEVEL_URL} + URL_MD5 ${MPICH2_WIN32_DEVEL_MD5} + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + BUILD_BYPRODUCTS /lib/libmpi.a) + endif() + + ExternalProject_get_property(mpi4win_build SOURCE_DIR) + file(MAKE_DIRECTORY "${SOURCE_DIR}/include") + add_library(MPI::MPI_CXX UNKNOWN IMPORTED) + set_target_properties(MPI::MPI_CXX PROPERTIES + IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a" + INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include" + INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") + add_dependencies(MPI::MPI_CXX mpi4win_build) + + # set variables for status reporting at the end of CMake run + set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include") + set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") + set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a") + else() + find_package(MPI REQUIRED) + option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) + if(LAMMPS_LONGLONG_TO_LONG) + target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) + endif() + endif() + target_link_libraries(lammps INTERFACE MPI::MPI_CXX) +else() + add_library(mpi_stubs INTERFACE) + target_include_directories(mpi_stubs INTERFACE $) + target_link_libraries(lammps INTERFACE mpi_stubs) +endif() + +################################################################################ +# detect if we may enable OpenMP support by default +set(BUILD_OMP_DEFAULT OFF) +find_package(OpenMP QUIET) +if(OpenMP_FOUND) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(HAVE_OMP_H_INCLUDE) + set(BUILD_OMP_DEFAULT ON) + endif() +endif() + +option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT}) + +if(BUILD_OMP) + find_package(OpenMP REQUIRED) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(NOT HAVE_OMP_H_INCLUDE) + message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support") + endif() + + if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0))) + # GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts. + # Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe. + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4) + else() + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3) + endif() + target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX) +endif() + +################ +# integer size selection +set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") +set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) +set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) +validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) +string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) +target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES}) diff --git a/cmake/Modules/Packages/ML-PACE.cmake b/cmake/Modules/Packages/ML-PACE.cmake index c647c8873a..c553809ff1 100644 --- a/cmake/Modules/Packages/ML-PACE.cmake +++ b/cmake/Modules/Packages/ML-PACE.cmake @@ -32,5 +32,6 @@ target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_ target_link_libraries(pace PRIVATE yaml-cpp-pace) - -target_link_libraries(lammps PRIVATE pace) +if(CMAKE_PROJECT_NAME STREQUAL "lammps") + target_link_libraries(lammps PRIVATE pace) +endif() diff --git a/examples/PACKAGES/pace/plugin/CMakeLists.txt b/examples/PACKAGES/pace/plugin/CMakeLists.txt new file mode 100644 index 0000000000..f4068a03c9 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/CMakeLists.txt @@ -0,0 +1,36 @@ +########################################## +# CMake build system for plugin examples. +# The is meant to be used as a template for plugins that are +# distributed independent from the LAMMPS package. +########################################## + +cmake_minimum_required(VERSION 3.10) + +project(paceplugin VERSION 1.0 LANGUAGES CXX) + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +include(CheckIncludeFileCXX) +include(LAMMPSInterfacePlugin) +include(ML-PACE) + +########################## +# building the plugins + +add_library(paceplugin MODULE paceplugin.cpp ${LAMMPS_SOURCE_DIR}/ML-PACE/pair_pace.cpp) +target_link_libraries(paceplugin PRIVATE pace) +target_link_libraries(paceplugin PRIVATE lammps) +target_include_directories(paceplugin PRIVATE ${LAMMPS_SOURCE_DIR}/ML-PACE) +set_target_properties(paceplugin PROPERTIES PREFIX "" SUFFIX ".so") + +# MacOS seems to need this +if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + set_target_properties(paceplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") +# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers + set_target_properties(paceplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + if(CMAKE_CROSSCOMPILING) + set_target_properties(paceplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") + endif() +else() + set_target_properties(paceplugin PROPERTIES LINK_FLAGS "-rdynamic") +endif() diff --git a/examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake b/examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake new file mode 120000 index 0000000000..2ac6d20a54 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake @@ -0,0 +1 @@ +../../../../cmake/Modules/LAMMPSInterfacePlugin.cmake \ No newline at end of file diff --git a/examples/PACKAGES/pace/plugin/ML-PACE.cmake b/examples/PACKAGES/pace/plugin/ML-PACE.cmake new file mode 120000 index 0000000000..3990c0d334 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/ML-PACE.cmake @@ -0,0 +1 @@ +../../../../cmake/Modules/Packages/ML-PACE.cmake \ No newline at end of file diff --git a/examples/PACKAGES/pace/plugin/lammps-text-logo-wide.bmp b/examples/PACKAGES/pace/plugin/lammps-text-logo-wide.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b9ec4c35f22ef07acea3256fa80f58b8e9b5f5cc GIT binary patch literal 25818 zcmeI42Y6LgzUcQpq>z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Ro_NA2X|c zY50b5`Ptpju*UdaW$fll3G;gRTfu(}KHqhtkB!qNWqi#^s+QW*-uk=x64%0S$$pmj zuMvOGP5^%v>%g7lJygNXZ(+JW==|%|y0Zb_|ND&3X85DPhjyEQ-w(c?S@#|1Ft7iF zU(E2U$dEp9ra$}qy|w=IN*%uMx^K`3-}ztq2mHO2V(Nka?d0i~;o&CM680%=eYX+5 zH2ji`2SfPX6Igq;69?!;?)Cz|25!Q&5B;vdKj15W_UCthYUI&rt0zD9XpWi4 zvwhIpcl^eLSJ!Th@U7>iPMH5{e8YN|hf9Stz}OGbr}>%UxRBrFyH|57^#cQk*z27M cJb# Date: Sat, 4 Jun 2022 11:49:33 -0400 Subject: [PATCH 072/172] provide README files with pointers to the developer info for plugins also add a paragraph with information about the ML-PACE plugin to the plugin developer info docs. --- doc/src/Developer_plugins.rst | 29 ++++++++++++++++----- doc/utils/sphinx-config/false_positives.txt | 3 +++ examples/PACKAGES/pace/plugin/README.txt | 2 ++ examples/kim/plugin/README.txt | 2 ++ 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 examples/PACKAGES/pace/plugin/README.txt create mode 100644 examples/kim/plugin/README.txt diff --git a/doc/src/Developer_plugins.rst b/doc/src/Developer_plugins.rst index 9bf52801a7..36fdd010b3 100644 --- a/doc/src/Developer_plugins.rst +++ b/doc/src/Developer_plugins.rst @@ -276,10 +276,27 @@ Compilation of the plugin can be managed via both, CMake or traditional GNU makefiles. Some examples that can be used as a template are in the ``examples/plugins`` folder. The CMake script code has some small adjustments to allow building the plugins for running unit tests with -them. Another example that converts the KIM package into a plugin can be -found in the ``examples/kim/plugin`` folder. No changes to the sources -of the KIM package themselves are needed; only the plugin interface and -loader code needs to be added. This example only supports building with -CMake, but is probably a more typical example. To compile you need to -run CMake with -DLAMMPS_SOURCE_DIR=. Other +them. + +Another example that converts the KIM package into a plugin can be found +in the ``examples/kim/plugin`` folder. No changes to the sources of the +KIM package themselves are needed; only the plugin interface and loader +code needs to be added. This example only supports building with CMake, +but is probably a more typical example. To compile you need to run CMake +with -DLAMMPS_SOURCE_DIR=. Other configuration setting are identical to those for compiling LAMMPS. + +A second example for a plugin from a package is in the +``examples/PACKAGES/pace/plugin`` folder that will create a plugin from +the ML-PACE package. In this case the bulk of the code is in a static +external library that is being downloaded and compiled first and then +combined with the pair style wrapper and the plugin loader. This +example also contains a NSIS script that can be used to create an +Installer package for Windows (the mutual licensing terms of the +external library and LAMMPS conflict when distributing binaries, so the +ML-PACE package cannot be linked statically, but the LAMMPS headers +required to build the plugin are also available under a less restrictive +license). This will automatically set the required environment variable +and launching a (compatible) LAMMPS binary will load and register the +plugin and the ML-PACE package can then be used as it was linked into +LAMMPS. diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 836dc4efa8..0912a63352 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2369,6 +2369,9 @@ Nord norder Nordlund normals +normx +normy +normz Noskov noslip noticable diff --git a/examples/PACKAGES/pace/plugin/README.txt b/examples/PACKAGES/pace/plugin/README.txt new file mode 100644 index 0000000000..85490c3f6c --- /dev/null +++ b/examples/PACKAGES/pace/plugin/README.txt @@ -0,0 +1,2 @@ +This folder contains a loader and support files to build the ML-PACE package as plugin. +For more information please see: https://docs.lammps.org/Developer_plugins.html diff --git a/examples/kim/plugin/README.txt b/examples/kim/plugin/README.txt new file mode 100644 index 0000000000..eecc6cc7b4 --- /dev/null +++ b/examples/kim/plugin/README.txt @@ -0,0 +1,2 @@ +This folder contains a loader and support files to build the KIM package as plugin. +For more information please see: https://docs.lammps.org/Developer_plugins.html From b0d2cc305226a109328e16ab58efc4970a4b991f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 4 Jun 2022 19:23:32 -0400 Subject: [PATCH 073/172] we can build a plugin instead --- cmake/presets/mingw-cross.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 29de394b8e..13cfee9018 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -46,7 +46,6 @@ set(WIN_PACKAGES MISC ML-HDNNP ML-IAP - ML-PACE ML-RANN ML-SNAP MOFFF From b338781f8842b21a3ebc0e363d292b4d3f51089c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 5 Jun 2022 06:52:15 -0400 Subject: [PATCH 074/172] cosmetic --- src/MC/fix_widom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 0adabe5eae..0a20e7adf3 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -273,7 +273,7 @@ void FixWidom::init() triclinic = domain->triclinic; - ave_widom_chemical_potential = 0; + ave_widom_chemical_potential = 0.0; if (region) volume = region_volume; else volume = domain->xprd * domain->yprd * domain->zprd; From dcbc5256fa9e037ef6469f1f3c039d9aaa6c3385 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 5 Jun 2022 12:30:27 -0400 Subject: [PATCH 075/172] additional OpenMP suppressions for newer GCC --- tools/valgrind/OpenMP.supp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/valgrind/OpenMP.supp b/tools/valgrind/OpenMP.supp index e1870e668c..15531fa8ec 100644 --- a/tools/valgrind/OpenMP.supp +++ b/tools/valgrind/OpenMP.supp @@ -134,3 +134,31 @@ fun:GOMP_parallel obj:* } +{ + OpnMP_open_part1 + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + ... + fun:openaux + ... + fun:dl_open_worker_begin + ... + fun:dl_open_worker + ... + fun:_dl_open +} +{ + OpnMP_open_part2 + Memcheck:Leak + match-leak-kinds: reachable + fun:calloc + ... + fun:openaux + ... + fun:dl_open_worker_begin + ... + fun:dl_open_worker + ... + fun:_dl_open +} From 8f773be2d6c698900ddcd6f063433dd76aaa9ed9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 6 Jun 2022 15:01:25 -0400 Subject: [PATCH 076/172] must open files for xtc dump in binary mode --- src/EXTRA-DUMP/dump_xtc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-DUMP/dump_xtc.cpp b/src/EXTRA-DUMP/dump_xtc.cpp index 3c5be6b9be..8e0bb4a0d7 100644 --- a/src/EXTRA-DUMP/dump_xtc.cpp +++ b/src/EXTRA-DUMP/dump_xtc.cpp @@ -433,10 +433,10 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) return 0; } if (*type == 'w' || *type == 'W') { - type = (char *) "w+"; + type = (char *) "wb+"; lmode = XDR_ENCODE; } else { - type = (char *) "r"; + type = (char *) "rb"; lmode = XDR_DECODE; } xdrfiles[xdrid] = fopen(filename, type); From 5c68fe6e8154765772e7f3e81cafa7a389cca08c Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 6 Jun 2022 15:15:47 -0700 Subject: [PATCH 077/172] Fix issues in compute ave/sphere/atom --- doc/src/compute_ave_sphere_atom.rst | 6 ++-- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 31 ++++++++++++++++--- src/EXTRA-COMPUTE/compute_ave_sphere_atom.h | 2 +- src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 28 ++++++++++++++--- src/KOKKOS/compute_ave_sphere_atom_kokkos.h | 13 +++++--- 5 files changed, 62 insertions(+), 18 deletions(-) diff --git a/doc/src/compute_ave_sphere_atom.rst b/doc/src/compute_ave_sphere_atom.rst index db04682865..0cf631a941 100644 --- a/doc/src/compute_ave_sphere_atom.rst +++ b/doc/src/compute_ave_sphere_atom.rst @@ -35,7 +35,7 @@ Examples Description """"""""""" -Define a computation that calculates the local density and temperature +Define a computation that calculates the local mass density and temperature for each atom and neighbors inside a spherical cutoff. The optional keyword *cutoff* defines the distance cutoff @@ -58,7 +58,7 @@ too frequently. interactions between atoms in the same bond, angle, or dihedral. This is the default setting for the :doc:`special_bonds ` command, and means those pairwise interactions do not appear in the - neighbor list. Because this fix uses the neighbor list, it also means + neighbor list. Because this compute uses the neighbor list, it also means those pairs will not be included in the order parameter. This difficulty can be circumvented by writing a dump file, and using the :doc:`rerun ` command to compute the order parameter for @@ -77,7 +77,7 @@ too frequently. Output info """"""""""" -This compute calculates a per-atom array with two columns: density and temperature. +This compute calculates a per-atom array with two columns: mass density and temperature. These values can be accessed by any command that uses per-atom values from a compute as input. See the :doc:`Howto output ` doc diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index 07803aca20..b63c5c2b07 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -15,6 +15,7 @@ #include "atom.h" #include "comm.h" +#include "domain.h" #include "error.h" #include "force.h" #include "math_const.h" @@ -98,7 +99,10 @@ void ComputeAveSphereAtom::init() } cutsq = cutoff * cutoff; - sphere_vol = 4.0 / 3.0 * MY_PI * cutsq * cutoff; + if (domain->dimension == 3) + volume = 4.0 / 3.0 * MY_PI * cutsq * cutoff; + else + volume = MY_PI * cutsq; // need an occasional full neighbor list @@ -152,12 +156,25 @@ void ComputeAveSphereAtom::compute_peratom() double **x = atom->x; double **v = atom->v; + double *mass = atom->mass; + double *rmass = atom->rmass; + int *type = atom->type; int *mask = atom->mask; + double massone_i,massone_j; + double totalmass = 0.0; + + double adof = domain->dimension; + double mvv2e = force->mvv2e; + double mv2d = force->mv2d; + double boltz = force->boltz; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { + if (rmass) massone_i = rmass[i]; + else massone_i = mass[type[i]]; + xtmp = x[i][0]; ytmp = x[i][1]; ztmp = x[i][2]; @@ -174,6 +191,8 @@ void ComputeAveSphereAtom::compute_peratom() for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; + if (rmass) massone_j = rmass[i]; + else massone_j = mass[type[i]]; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; @@ -194,10 +213,11 @@ void ComputeAveSphereAtom::compute_peratom() // i atom contribution count = 1; + totalmass = massone_i; vnet[0] = v[i][0] - vavg[0]; vnet[1] = v[i][1] - vavg[1]; vnet[2] = v[i][2] - vavg[2]; - double ke_sum = vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]; + double ke_sum = massone_i * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]); for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; @@ -209,14 +229,15 @@ void ComputeAveSphereAtom::compute_peratom() rsq = delx * delx + dely * dely + delz * delz; if (rsq < cutsq) { count++; + totalmass += massone_j; vnet[0] = v[j][0] - vavg[0]; vnet[1] = v[j][1] - vavg[1]; vnet[2] = v[j][2] - vavg[2]; - ke_sum += vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]; + ke_sum += massone_j * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]); } } - double density = count / sphere_vol; - double temp = ke_sum / 3.0 / count; + double density = mv2d * totalmass / volume; + double temp = mvv2e * ke_sum / (adof * count * boltz); result[i][0] = density; result[i][1] = temp; } diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h index ffed09bae5..76350997f9 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h @@ -37,7 +37,7 @@ class ComputeAveSphereAtom : public Compute { protected: int nmax; - double cutoff, cutsq, sphere_vol; + double cutoff, cutsq, volume; class NeighList *list; double **result; diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index d2cb6682a7..df70a27738 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -16,6 +16,7 @@ #include "atom_kokkos.h" #include "atom_masks.h" #include "comm.h" +#include "domain.h" #include "error.h" #include "force.h" #include "memory_kokkos.h" @@ -105,11 +106,19 @@ void ComputeAveSphereAtomKokkos::compute_peratom() // compute properties for each atom in group // use full neighbor list to count atoms less than cutoff - atomKK->sync(execution_space,X_MASK|V_MASK|TYPE_MASK|MASK_MASK); + atomKK->sync(execution_space,X_MASK|V_MASK|RMASS_MASK|TYPE_MASK|MASK_MASK); x = atomKK->k_x.view(); v = atomKK->k_v.view(); + rmass = atomKK->k_rmass.view(); + mass = atomKK->k_mass.view(); + type = atomKK->k_type.view(); mask = atomKK->k_mask.view(); + adof = domain->dimension; + mvv2e = force->mvv2e; + mv2d = force->mv2d; + boltz = force->boltz; + Kokkos::deep_copy(d_result,0.0); copymode = 1; @@ -125,8 +134,13 @@ template KOKKOS_INLINE_FUNCTION void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const int &ii) const { + double massone_i,massone_j,totalmass; + const int i = d_ilist[ii]; if (mask[i] & groupbit) { + if (rmass.data()) massone_i = rmass[i]; + else massone_i = mass[type[i]]; + const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); @@ -164,15 +178,18 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, // i atom contribution count = 1; + totalmass = massone_i; double vnet[3]; vnet[0] = v(i,0) - vavg[0]; vnet[1] = v(i,1) - vavg[1]; vnet[2] = v(i,2) - vavg[2]; - double ke_sum = vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]; + double ke_sum = massone_i * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]); for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); j &= NEIGHMASK; + if (rmass.data()) massone_j = rmass[i]; + else massone_j = mass[type[i]]; const F_FLOAT delx = x(j,0) - xtmp; const F_FLOAT dely = x(j,1) - ytmp; @@ -180,14 +197,15 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutsq) { count++; + totalmass += massone_j; vnet[0] = v(j,0) - vavg[0]; vnet[1] = v(j,1) - vavg[1]; vnet[2] = v(j,2) - vavg[2]; - ke_sum += vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]; + ke_sum += massone_j * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]); } } - double density = count/sphere_vol; - double temp = ke_sum/3.0/count; + double density = mv2d*totalmass/volume; + double temp = mvv2e*ke_sum/(adof*count*boltz); d_result(i,0) = density; d_result(i,1) = temp; } diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h index 75b5ca3aba..1ddf943e7d 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h @@ -46,13 +46,18 @@ template class ComputeAveSphereAtomKokkos : public ComputeAve void operator()(TagComputeAveSphereAtom, const int &) const; private: - typename AT::t_x_array_randomread x; - typename AT::t_v_array_randomread v; + double adof,mvv2e,mv2d,boltz; + + typename AT::t_x_array x; + typename AT::t_v_array v; + typename ArrayTypes::t_float_1d rmass; + typename ArrayTypes::t_float_1d mass; + typename ArrayTypes::t_int_1d type; typename ArrayTypes::t_int_1d mask; typename AT::t_neighbors_2d d_neighbors; - typename AT::t_int_1d_randomread d_ilist; - typename AT::t_int_1d_randomread d_numneigh; + typename AT::t_int_1d d_ilist; + typename AT::t_int_1d d_numneigh; DAT::tdual_float_2d k_result; typename AT::t_float_2d d_result; From 7e77b61042c09ba47c88f4983d0505f39b74f10e Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 6 Jun 2022 15:23:03 -0700 Subject: [PATCH 078/172] simplify --- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index b63c5c2b07..f299305cf3 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -160,8 +160,7 @@ void ComputeAveSphereAtom::compute_peratom() double *rmass = atom->rmass; int *type = atom->type; int *mask = atom->mask; - double massone_i,massone_j; - double totalmass = 0.0; + double massone_i,massone_j,totalmass; double adof = domain->dimension; double mvv2e = force->mvv2e; From 67d367e714082941c55f6b547e6b1e2352626031 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 6 Jun 2022 15:28:40 -0700 Subject: [PATCH 079/172] Fix copy/paste bug --- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 4 ++-- src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index f299305cf3..4409fbb502 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -190,8 +190,8 @@ void ComputeAveSphereAtom::compute_peratom() for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; - if (rmass) massone_j = rmass[i]; - else massone_j = mass[type[i]]; + if (rmass) massone_j = rmass[j]; + else massone_j = mass[type[j]]; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index df70a27738..ed54a92f63 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -188,8 +188,8 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); j &= NEIGHMASK; - if (rmass.data()) massone_j = rmass[i]; - else massone_j = mass[type[i]]; + if (rmass.data()) massone_j = rmass[j]; + else massone_j = mass[type[j]]; const F_FLOAT delx = x(j,0) - xtmp; const F_FLOAT dely = x(j,1) - ytmp; From 96b5a706da86d3b8d43e58a4acf5c98c3c812bbf Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 6 Jun 2022 21:39:10 -0400 Subject: [PATCH 080/172] apply clang-format --- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index 4409fbb502..45cab08329 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -160,7 +160,7 @@ void ComputeAveSphereAtom::compute_peratom() double *rmass = atom->rmass; int *type = atom->type; int *mask = atom->mask; - double massone_i,massone_j,totalmass; + double massone_i, massone_j, totalmass; double adof = domain->dimension; double mvv2e = force->mvv2e; @@ -171,8 +171,10 @@ void ComputeAveSphereAtom::compute_peratom() i = ilist[ii]; if (mask[i] & groupbit) { - if (rmass) massone_i = rmass[i]; - else massone_i = mass[type[i]]; + if (rmass) + massone_i = rmass[i]; + else + massone_i = mass[type[i]]; xtmp = x[i][0]; ytmp = x[i][1]; @@ -190,8 +192,10 @@ void ComputeAveSphereAtom::compute_peratom() for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; - if (rmass) massone_j = rmass[j]; - else massone_j = mass[type[j]]; + if (rmass) + massone_j = rmass[j]; + else + massone_j = mass[type[j]]; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; From d7680dd7852901cf690b3c39472ffa71bb54c824 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Tue, 7 Jun 2022 10:10:03 -0600 Subject: [PATCH 081/172] Fix int32 overflow in Kokkos ReaxFF --- src/KOKKOS/pair_reaxff_kokkos.cpp | 2 +- src/KOKKOS/pair_reaxff_kokkos.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index 7f2477adba..bb6ee0c1f1 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -2628,7 +2628,7 @@ int PairReaxFFKokkos::preprocess_angular(int i, int itype, int j_sta template template KOKKOS_INLINE_FUNCTION -int PairReaxFFKokkos::preprocess_torsion(int i, int /*itype*/, int itag, +int PairReaxFFKokkos::preprocess_torsion(int i, int /*itype*/, tagint itag, F_FLOAT xtmp, F_FLOAT ytmp, F_FLOAT ztmp, int j_start, int j_end, int location_torsion) const { // in reaxff_torsion_angles: j = i, k = j, i = k; diff --git a/src/KOKKOS/pair_reaxff_kokkos.h b/src/KOKKOS/pair_reaxff_kokkos.h index 39b323a0fe..836a2de731 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.h +++ b/src/KOKKOS/pair_reaxff_kokkos.h @@ -257,7 +257,7 @@ class PairReaxFFKokkos : public PairReaxFF { // Abstraction for counting and populating torsion intermediated template KOKKOS_INLINE_FUNCTION - int preprocess_torsion(int, int, int, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const; + int preprocess_torsion(int, int, tagint, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const; template KOKKOS_INLINE_FUNCTION From 42694ba6406245ae0a66ec74c814f445224b997c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 7 Jun 2022 19:39:36 -0400 Subject: [PATCH 082/172] reduce warnings when compiling with KOKKOS --- src/fmt/core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fmt/core.h b/src/fmt/core.h index 8444cd9546..2fafa777ba 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -315,7 +315,9 @@ // Enable minimal optimizations for more compact code in debug mode. FMT_GCC_PRAGMA("GCC push_options") -#ifndef __OPTIMIZE__ +// LAMMPS CUSTOMIZATION: suppress warning about pragma with KOKKOS +#if !defined(__OPTIMIZE__) && !defined(LMP_KOKKOS) +// END LAMMPS CUSTOMIZATION FMT_GCC_PRAGMA("GCC optimize(\"Og\")") #endif From 55fdb7f12a4a4b6f3a291f0d34b57ab391722245 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Jun 2022 08:19:54 -0400 Subject: [PATCH 083/172] update GPU container definitions for CUDA 11.7 and singularity -> apptainer --- doc/src/Tools.rst | 17 +++++++++-------- tools/singularity/README.md | 10 ++++++---- tools/singularity/ubuntu18.04_gpu.def | 14 +++++++------- tools/singularity/ubuntu20.04_gpu.def | 12 ++++++------ 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index ef403daa84..b57c91ffee 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -95,7 +95,7 @@ Miscellaneous tools * :ref:`LAMMPS shell ` * :ref:`LAMMPS magic patterns for file(1) ` * :ref:`Offline build tool ` - * :ref:`singularity ` + * :ref:`singularity/apptainer ` * :ref:`SWIG interface ` * :ref:`vim ` @@ -1007,14 +1007,15 @@ Ivanov, at University of Iceland (ali5 at hi.is). .. _singularity_tool: -singularity tool ----------------------------------------- +singularity/apptainer tool +-------------------------- -The singularity sub-directory contains container definitions files -that can be used to build container images for building and testing -LAMMPS on specific OS variants using the `Singularity `_ -container software. Contributions for additional variants are welcome. -For more details please see the README.md file in that folder. +The singularity sub-directory contains container definitions files that +can be used to build container images for building and testing LAMMPS on +specific OS variants using the `Apptainer `_ or +`Singularity `_ container software. Contributions for +additional variants are welcome. For more details please see the +README.md file in that folder. ---------- diff --git a/tools/singularity/README.md b/tools/singularity/README.md index db7aa9e3b0..4700dac6ec 100644 --- a/tools/singularity/README.md +++ b/tools/singularity/README.md @@ -1,17 +1,19 @@ -# Singularity container definitions for compiling/testing LAMMPS +# Apptainer (aka Singularity) container definitions for compiling/testing LAMMPS The *.def files in this folder can be used to build container images -for [Singularity](https://sylabs.io), suitable for compiling and testing +for [Apptainer](https://apptainer.org) (previously called +[Singularity](https://sylabs.io)), suitable for compiling and testing LAMMPS on a variety of OS variants with support for most standard packages and - for some of them - also building/spellchecking the manual -in all supported formats. This allows to test and debug LAMMPS code on +in all supported formats. This allows to test and debug LAMMPS code on different OS variants without doing a full installation on your development workstation, e.g. when bugs are reported that can only be reproduced on a specific OS or with specific (mostly older) versions of tools, compilers, or libraries. Here is a workflow for testing a compilation of LAMMPS with a locally -built CentOS 7.x singularity container. +built CentOS 7.x Singularity container. For Apptainer replace the +`singularity` command with `apptainer`. ``` cd some/work/directory diff --git a/tools/singularity/ubuntu18.04_gpu.def b/tools/singularity/ubuntu18.04_gpu.def index 6aa37ccf84..fac27dc7f3 100644 --- a/tools/singularity/ubuntu18.04_gpu.def +++ b/tools/singularity/ubuntu18.04_gpu.def @@ -2,11 +2,11 @@ BootStrap: docker From: ubuntu:18.04 %environment - export PATH=/usr/lib/ccache:/usr/local/cuda-11.5/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export CUDADIR=/usr/local/cuda-11.5 - export CUDA_PATH=/usr/local/cuda-11.5 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.5/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib - export LIBRARY_PATH=/usr/local/cuda-11.5/lib64/stubs + export PATH=/usr/lib/ccache:/usr/local/cuda-11.7/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 + export CUDADIR=/usr/local/cuda-11.7 + export CUDA_PATH=/usr/local/cuda-11.7 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib + export LIBRARY_PATH=/usr/local/cuda-11.7/lib64/stubs %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -122,11 +122,11 @@ From: ubuntu:18.04 wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" apt-get update - export CUDA_PKG_VERSION=11.5 + export CUDA_PKG_VERSION=11.7 apt-get install -y --no-install-recommends \ cuda-libraries-${CUDA_PKG_VERSION} \ diff --git a/tools/singularity/ubuntu20.04_gpu.def b/tools/singularity/ubuntu20.04_gpu.def index 23bddeb14f..8c40f6c8d6 100644 --- a/tools/singularity/ubuntu20.04_gpu.def +++ b/tools/singularity/ubuntu20.04_gpu.def @@ -2,11 +2,11 @@ BootStrap: docker From: ubuntu:20.04 %environment - export PATH=/usr/lib/ccache:/usr/local/cuda-11.5/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export CUDADIR=/usr/local/cuda-11.5 - export CUDA_PATH=/usr/local/cuda-11.5 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.5/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib - export LIBRARY_PATH=/usr/local/cuda-11.5/lib64/stubs + export PATH=/usr/lib/ccache:/usr/local/cuda-11.7/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 + export CUDADIR=/usr/local/cuda-11.7 + export CUDA_PATH=/usr/local/cuda-11.7 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib + export LIBRARY_PATH=/usr/local/cuda-11.7/lib64/stubs %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -109,7 +109,7 @@ From: ubuntu:20.04 wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" apt-get update From 7769a8e0de24c9d89191baf532fcc70bf3042495 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Jun 2022 12:18:17 -0400 Subject: [PATCH 084/172] update ROCm to version 5.1.3 consistently --- tools/singularity/ubuntu18.04_amd_rocm.def | 8 ++++---- tools/singularity/ubuntu18.04_gpu.def | 6 +++--- tools/singularity/ubuntu20.04_amd_rocm.def | 8 ++++---- tools/singularity/ubuntu20.04_gpu.def | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/singularity/ubuntu18.04_amd_rocm.def b/tools/singularity/ubuntu18.04_amd_rocm.def index ceedfd8144..febdf1172e 100644 --- a/tools/singularity/ubuntu18.04_amd_rocm.def +++ b/tools/singularity/ubuntu18.04_amd_rocm.def @@ -3,7 +3,7 @@ From: ubuntu:18.04 %environment export PATH=/usr/lib/ccache:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.2/llvm/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -22,10 +22,10 @@ From: ubuntu:18.04 apt install -y cmake ########################################################################### - # ROCm 5.1.2 + # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/22.10.2/ubuntu/bionic/amdgpu-install_22.10.2.50102-1_all.deb - apt-get install -y ./amdgpu-install_22.10.2.50102-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/bionic/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ diff --git a/tools/singularity/ubuntu18.04_gpu.def b/tools/singularity/ubuntu18.04_gpu.def index fac27dc7f3..7d639a1e1d 100644 --- a/tools/singularity/ubuntu18.04_gpu.def +++ b/tools/singularity/ubuntu18.04_gpu.def @@ -5,7 +5,7 @@ From: ubuntu:18.04 export PATH=/usr/lib/ccache:/usr/local/cuda-11.7/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 export CUDADIR=/usr/local/cuda-11.7 export CUDA_PATH=/usr/local/cuda-11.7 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib export LIBRARY_PATH=/usr/local/cuda-11.7/lib64/stubs %post export DEBIAN_FRONTEND=noninteractive @@ -27,8 +27,8 @@ From: ubuntu:18.04 ########################################################################### # ROCm 4.5 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/21.40/ubuntu/focal/amdgpu-install-21.40.40500-1_all.deb - apt-get install -y ./amdgpu-install-21.40.40500-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install-22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install-22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ diff --git a/tools/singularity/ubuntu20.04_amd_rocm.def b/tools/singularity/ubuntu20.04_amd_rocm.def index 5e351e49a8..6034014370 100644 --- a/tools/singularity/ubuntu20.04_amd_rocm.def +++ b/tools/singularity/ubuntu20.04_amd_rocm.def @@ -3,7 +3,7 @@ From: ubuntu:20.04 %environment export PATH=/usr/lib/ccache:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.2/llvm/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -13,10 +13,10 @@ From: ubuntu:20.04 apt-get install --no-install-recommends -y software-properties-common ########################################################################### - # ROCm 5.1.2 + # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/22.10.2/ubuntu/focal/amdgpu-install_22.10.2.50102-1_all.deb - apt-get install -y ./amdgpu-install_22.10.2.50102-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ diff --git a/tools/singularity/ubuntu20.04_gpu.def b/tools/singularity/ubuntu20.04_gpu.def index 8c40f6c8d6..1e28ab95fa 100644 --- a/tools/singularity/ubuntu20.04_gpu.def +++ b/tools/singularity/ubuntu20.04_gpu.def @@ -5,7 +5,7 @@ From: ubuntu:20.04 export PATH=/usr/lib/ccache:/usr/local/cuda-11.7/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 export CUDADIR=/usr/local/cuda-11.7 export CUDA_PATH=/usr/local/cuda-11.7 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib export LIBRARY_PATH=/usr/local/cuda-11.7/lib64/stubs %post export DEBIAN_FRONTEND=noninteractive @@ -15,10 +15,10 @@ From: ubuntu:20.04 apt-get install -y --no-install-recommends curl wget libnuma-dev gnupg ca-certificates ########################################################################### - # ROCm 4.5 + # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/21.40/ubuntu/focal/amdgpu-install-21.40.40500-1_all.deb - apt-get install -y ./amdgpu-install-21.40.40500-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install-22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install-22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ From b6e0d7612303cde834fde55bd8a145a9fd983767 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Jun 2022 12:47:30 -0400 Subject: [PATCH 085/172] fix some docs formatting issues --- doc/src/pair_e3b.rst | 91 +++++++++++++-------- doc/src/pair_sw_angle_table.rst | 4 +- doc/src/pair_threebody_table.rst | 6 +- doc/utils/sphinx-config/false_positives.txt | 1 + 4 files changed, 65 insertions(+), 37 deletions(-) diff --git a/doc/src/pair_e3b.rst b/doc/src/pair_e3b.rst index b75fb8450c..8ae6d10b82 100644 --- a/doc/src/pair_e3b.rst +++ b/doc/src/pair_e3b.rst @@ -50,6 +50,12 @@ Examples pair_style hybrid/overlay e3b 1 lj/cut/tip4p/long 1 2 1 1 0.15 8.5 pair_coeff * * e3b preset 2011 +Used in example input script: + +.. parsed-literal:: + + examples/PACKAGES/e3b/in.e3b-tip4p2005 + Description """"""""""" @@ -68,21 +74,27 @@ The *e3b* style computes an \"explicit three-body\" (E3B) potential for water :r 0 & r>R_f\\ \end{cases} -This potential was developed as a water model that includes the three-body cooperativity of hydrogen bonding explicitly. -To use it in this way, it must be applied in conjunction with a conventional two-body water model, through *pair_style hybrid/overlay*. -The three body interactions are split into three types: A, B, and C. -Type A corresponds to anti-cooperative double hydrogen bond donor interactions. -Type B corresponds to the cooperative interaction of molecules that both donate and accept a hydrogen bond. -Type C corresponds to anti-cooperative double hydrogen bond acceptor interactions. -The three-body interactions are smoothly cutoff by the switching function s(r) between Rs and Rc3. -The two-body interactions are designed to correct for the effective many-body interactions implicitly included in the conventional two-body potential. -The two-body interactions are cut off sharply at Rc2, because K3 is typically significantly smaller than K2. -See :ref:`(Kumar 2008) ` for more details. +This potential was developed as a water model that includes the +three-body cooperativity of hydrogen bonding explicitly. To use it in +this way, it must be applied in conjunction with a conventional two-body +water model, through pair style :doc:`hybrid/overlay `. The +three body interactions are split into three types: A, B, and C. Type A +corresponds to anti-cooperative double hydrogen bond donor interactions. +Type B corresponds to the cooperative interaction of molecules that both +donate and accept a hydrogen bond. Type C corresponds to +anti-cooperative double hydrogen bond acceptor interactions. The +three-body interactions are smoothly cutoff by the switching function +s(r) between Rs and Rc3. The two-body interactions are designed to +correct for the effective many-body interactions implicitly included in +the conventional two-body potential. The two-body interactions are cut +off sharply at Rc2, because K3 is typically significantly smaller than +K2. See :ref:`(Kumar 2008) ` for more details. -Only a single *pair_coeff* command is used with the *e3b* style. -The first two arguments must be \* \*. -The oxygen atom type for the pair style is passed as the only argument to the *pair_style* command, not in the *pair_coeff* command. -The hydrogen atom type is inferred by the ordering of the atoms. +Only a single :doc:`pair_coeff ` command is used with the +*e3b* style and the first two arguments must be \* \*. The oxygen atom +type for the pair style is passed as the only argument to the +*pair_style* command, not in the *pair_coeff* command. The hydrogen +atom type is inferred from the ordering of the atoms. .. note:: @@ -90,26 +102,41 @@ The hydrogen atom type is inferred by the ordering of the atoms. Each water molecule must have consecutive IDs with the oxygen first. This pair style does not test that this criteria is met. -The *pair_coeff* command must have at least one keyword/value pair, as described above. -The *preset* keyword sets the potential parameters to the values used in :ref:`(Tainter 2011) ` or :ref:`(Tainter 2015) `. -To use the water models defined in those references, the *e3b* style should always be used in conjunction with an *lj/cut/tip4p/long* style through *pair_style hybrid/overlay*, as demonstrated in the second example above. -The *preset 2011* option should be used with the :doc:`TIP4P water model `. -The *preset 2015* option should be used with the :doc:`TIP4P/2005 water model `. -If the *preset* keyword is used, no other keyword is needed. -Changes to the preset parameters can be made by specifying the *preset* keyword followed by the specific parameter to change, like *Ea*\ . -Note that the other keywords must come after *preset* in the pair_style command. -The *e3b* style can also be used to implement any three-body potential of the same form by specifying all the keywords except *neigh*\ : *Ea*, *Eb*, *Ec*, *E2*, *K3*, *K2*, *Rc3*, *Rc2*, *Rs*, and *bondL*\ . -The keyword *bondL* specifies the intramolecular OH bond length of the water model being used. -This is needed to include H atoms that are within the cutoff even when the attached oxygen atom is not. +The *pair_coeff* command must have at least one keyword/value pair, as +described above. The *preset* keyword sets the potential parameters to +the values used in :ref:`(Tainter 2011) ` or +:ref:`(Tainter 2015) `. To use the water models defined in +those references, the *e3b* style should always be used in conjunction +with an *lj/cut/tip4p/long* style through *pair_style hybrid/overlay*, +as demonstrated in the second example above. The *preset 2011* option +should be used with the :doc:`TIP4P water model `. The +*preset 2015* option should be used with the :doc:`TIP4P/2005 water +model `. If the *preset* keyword is used, no other keyword +is needed. Changes to the preset parameters can be made by specifying +the *preset* keyword followed by the specific parameter to change, like +*Ea*\ . Note that the other keywords must come after *preset* in the +pair_style command. The *e3b* style can also be used to implement any +three-body potential of the same form by specifying all the keywords +except *neigh*\ : *Ea*, *Eb*, *Ec*, *E2*, *K3*, *K2*, *Rc3*, *Rc2*, +*Rs*, and *bondL*\ . The keyword *bondL* specifies the intramolecular +OH bond length of the water model being used. This is needed to include +H atoms that are within the cutoff even when the attached oxygen atom is +not. -This pair style allocates arrays sized according to the number of pairwise interactions within Rc3. -To do this it needs an estimate for the number of water molecules within Rc3 of an oxygen atom. -This estimate defaults to 10 and can be changed using the *neigh* keyword, which takes an integer as an argument. -If the neigh setting is too small, the simulation will fail with the error "neigh is too small". -If the neigh setting is too large, the pair style will use more memory than necessary. +This pair style allocates arrays sized according to the number of +pairwise interactions within Rc3. To do this it needs an estimate for +the number of water molecules within Rc3 of an oxygen atom. This +estimate defaults to 10 and can be changed using the *neigh* keyword, +which takes an integer as an argument. If the neigh setting is too +small, the simulation will fail with the error "neigh is too small". If +the neigh setting is too large, the pair style will use more memory than +necessary. -This pair style tallies a breakdown of the total E3B potential energy into sub-categories, which can be accessed via the :doc:`compute pair ` command as a vector of values of length 4. -The 4 values correspond to the terms in the first equation above: the E2 term, the Ea term, the Eb term, and the Ec term. +This pair style tallies a breakdown of the total E3B potential energy +into sub-categories, which can be accessed via the :doc:`compute pair +` command as a vector of values of length 4. The 4 values +correspond to the terms in the first equation above: the E2 term, the Ea +term, the Eb term, and the Ec term. See the examples/PACKAGES/e3b directory for a complete example script. diff --git a/doc/src/pair_sw_angle_table.rst b/doc/src/pair_sw_angle_table.rst index 6431917d67..ff88711d7a 100644 --- a/doc/src/pair_sw_angle_table.rst +++ b/doc/src/pair_sw_angle_table.rst @@ -23,9 +23,9 @@ Examples Used in example input script: - .. parsed-literal:: +.. parsed-literal:: - examples/PACKAGES/manybody_table/in.spce_sw + examples/PACKAGES/manybody_table/in.spce_sw Description diff --git a/doc/src/pair_threebody_table.rst b/doc/src/pair_threebody_table.rst index 68661270c9..19c90feccd 100644 --- a/doc/src/pair_threebody_table.rst +++ b/doc/src/pair_threebody_table.rst @@ -27,10 +27,10 @@ Examples Used in example input scripts: - .. parsed-literal:: +.. parsed-literal:: - examples/PACKAGES/manybody_table/in.spce - examples/PACKAGES/manybody_table/in.spce2 + examples/PACKAGES/manybody_table/in.spce + examples/PACKAGES/manybody_table/in.spce2 Description """"""""""" diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 0912a63352..b42cff262a 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -120,6 +120,7 @@ Antonelli api Apoorva Appl +apptainer Apu arallel arccos From 5fca9f4d1fb0bbfb44c8d72af43b247fed980f73 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Jun 2022 17:04:26 -0400 Subject: [PATCH 086/172] update mathjax version with bugfix release --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 07b201b07e..8841ae4825 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -13,7 +13,7 @@ VENV = $(BUILDDIR)/docenv ANCHORCHECK = $(VENV)/bin/rst_anchor_check SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config MATHJAX = $(SPHINXCONFIG)/_static/mathjax -MATHJAXTAG = 3.2.1 +MATHJAXTAG = 3.2.2 PYTHON = $(word 3,$(shell type python3)) DOXYGEN = $(word 3,$(shell type doxygen)) From 68a9db0950cb5d03219b0cf9e2605210d325d2de Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 8 Jun 2022 17:07:08 -0400 Subject: [PATCH 087/172] fix typos --- tools/singularity/ubuntu18.04_gpu.def | 4 ++-- tools/singularity/ubuntu20.04_gpu.def | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/singularity/ubuntu18.04_gpu.def b/tools/singularity/ubuntu18.04_gpu.def index 7d639a1e1d..90034285ff 100644 --- a/tools/singularity/ubuntu18.04_gpu.def +++ b/tools/singularity/ubuntu18.04_gpu.def @@ -27,8 +27,8 @@ From: ubuntu:18.04 ########################################################################### # ROCm 4.5 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install-22.10.3.50103-1_all.deb - apt-get install -y ./amdgpu-install-22.10.3.50103-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ diff --git a/tools/singularity/ubuntu20.04_gpu.def b/tools/singularity/ubuntu20.04_gpu.def index 1e28ab95fa..f7bab1ee9d 100644 --- a/tools/singularity/ubuntu20.04_gpu.def +++ b/tools/singularity/ubuntu20.04_gpu.def @@ -17,8 +17,8 @@ From: ubuntu:20.04 ########################################################################### # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install-22.10.3.50103-1_all.deb - apt-get install -y ./amdgpu-install-22.10.3.50103-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ From 7f1e76b7a5b860aac4c20887f4ef5c7adbc01662 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 9 Jun 2022 14:53:44 -0600 Subject: [PATCH 088/172] Don't compute count twice --- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 2 -- src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index 45cab08329..8181172d30 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -215,7 +215,6 @@ void ComputeAveSphereAtom::compute_peratom() // i atom contribution - count = 1; totalmass = massone_i; vnet[0] = v[i][0] - vavg[0]; vnet[1] = v[i][1] - vavg[1]; @@ -231,7 +230,6 @@ void ComputeAveSphereAtom::compute_peratom() delz = ztmp - x[j][2]; rsq = delx * delx + dely * dely + delz * delz; if (rsq < cutsq) { - count++; totalmass += massone_j; vnet[0] = v[j][0] - vavg[0]; vnet[1] = v[j][1] - vavg[1]; diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index ed54a92f63..df3998e35a 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -177,7 +177,6 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, // i atom contribution - count = 1; totalmass = massone_i; double vnet[3]; vnet[0] = v(i,0) - vavg[0]; @@ -196,7 +195,6 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const F_FLOAT delz = x(j,2) - ztmp; const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutsq) { - count++; totalmass += massone_j; vnet[0] = v(j,0) - vavg[0]; vnet[1] = v(j,1) - vavg[1]; From 9be6e2a064237ac92769783c44a4985fd901bc26 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 9 Jun 2022 15:29:40 -0600 Subject: [PATCH 089/172] Use COM velocity --- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 36 +++++++++--------- src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 37 ++++++++++--------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index 8181172d30..8638ba1fc0 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -125,7 +125,7 @@ void ComputeAveSphereAtom::compute_peratom() double xtmp, ytmp, ztmp, delx, dely, delz, rsq; int *ilist, *jlist, *numneigh, **firstneigh; int count; - double vsum[3], vavg[3], vnet[3]; + double p[3], vcom[3], vnet[3]; invoked_peratom = update->ntimestep; @@ -185,9 +185,10 @@ void ComputeAveSphereAtom::compute_peratom() // i atom contribution count = 1; - vsum[0] = v[i][0]; - vsum[1] = v[i][1]; - vsum[2] = v[i][2]; + totalmass = massone_i; + p[0] = v[i][0] * massone_i; + p[1] = v[i][1] * massone_i; + p[2] = v[i][2] * massone_i; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; @@ -203,22 +204,22 @@ void ComputeAveSphereAtom::compute_peratom() rsq = delx * delx + dely * dely + delz * delz; if (rsq < cutsq) { count++; - vsum[0] += v[j][0]; - vsum[1] += v[j][1]; - vsum[2] += v[j][2]; + totalmass += massone_j; + p[0] += v[j][0] * massone_j; + p[1] += v[j][1] * massone_j; + p[2] += v[j][2] * massone_j; } } - vavg[0] = vsum[0] / count; - vavg[1] = vsum[1] / count; - vavg[2] = vsum[2] / count; + vcom[0] = p[0] / totalmass; + vcom[1] = p[1] / totalmass; + vcom[2] = p[2] / totalmass; // i atom contribution - totalmass = massone_i; - vnet[0] = v[i][0] - vavg[0]; - vnet[1] = v[i][1] - vavg[1]; - vnet[2] = v[i][2] - vavg[2]; + vnet[0] = v[i][0] - vcom[0]; + vnet[1] = v[i][1] - vcom[1]; + vnet[2] = v[i][2] - vcom[2]; double ke_sum = massone_i * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]); for (jj = 0; jj < jnum; jj++) { @@ -230,10 +231,9 @@ void ComputeAveSphereAtom::compute_peratom() delz = ztmp - x[j][2]; rsq = delx * delx + dely * dely + delz * delz; if (rsq < cutsq) { - totalmass += massone_j; - vnet[0] = v[j][0] - vavg[0]; - vnet[1] = v[j][1] - vavg[1]; - vnet[2] = v[j][2] - vavg[2]; + vnet[0] = v[j][0] - vcom[0]; + vnet[1] = v[j][1] - vcom[1]; + vnet[2] = v[j][2] - vcom[2]; ke_sum += massone_j * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]); } } diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index df3998e35a..6e7abdcf23 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -149,10 +149,11 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, // i atom contribution int count = 1; - double vsum[3]; - vsum[0] = v(i,0); - vsum[1] = v(i,1); - vsum[2] = v(i,2); + double totalmass = massone_i; + double p[3]; + p[0] = v(i,0)*massone_i; + p[1] = v(i,1)*massone_i; + p[2] = v(i,2)*massone_i; for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); @@ -164,24 +165,25 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutsq) { count++; - vsum[0] += v(j,0); - vsum[1] += v(j,1); - vsum[2] += v(j,2); + totalmass += massone_j; + p[0] += v(j,0)*massone_j; + p[1] += v(j,1)*massone_j; + p[2] += v(j,2)*massone_j; } } - double vavg[3]; - vavg[0] = vsum[0]/count; - vavg[1] = vsum[1]/count; - vavg[2] = vsum[2]/count; + double vcom[3]; + vcom[0] = p[0]/totalmass; + vcom[1] = p[1]/totalmass; + vcom[2] = p[2]/totalmass; // i atom contribution totalmass = massone_i; double vnet[3]; - vnet[0] = v(i,0) - vavg[0]; - vnet[1] = v(i,1) - vavg[1]; - vnet[2] = v(i,2) - vavg[2]; + vnet[0] = v(i,0) - vcom[0]; + vnet[1] = v(i,1) - vcom[1]; + vnet[2] = v(i,2) - vcom[2]; double ke_sum = massone_i * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]); for (int jj = 0; jj < jnum; jj++) { @@ -195,10 +197,9 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const F_FLOAT delz = x(j,2) - ztmp; const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutsq) { - totalmass += massone_j; - vnet[0] = v(j,0) - vavg[0]; - vnet[1] = v(j,1) - vavg[1]; - vnet[2] = v(j,2) - vavg[2]; + vnet[0] = v(j,0) - vcom[0]; + vnet[1] = v(j,1) - vcom[1]; + vnet[2] = v(j,2) - vcom[2]; ke_sum += massone_j * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]); } } From 80727e47f44e93fa3f32c39fd13ead8c066013ff Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 9 Jun 2022 15:31:48 -0600 Subject: [PATCH 090/172] Add attribution --- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 4 ++++ src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index 8638ba1fc0..a477da0511 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -11,6 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing author: Stan Moore (SNL) +------------------------------------------------------------------------- */ + #include "compute_ave_sphere_atom.h" #include "atom.h" diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index 6e7abdcf23..e79259e99d 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -11,6 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing author: Stan Moore (SNL) +------------------------------------------------------------------------- */ + #include "compute_ave_sphere_atom_kokkos.h" #include "atom_kokkos.h" From 5d7b1f3ebb3baf0cae21a7ec6d87027d5f6afdec Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 9 Jun 2022 15:36:17 -0600 Subject: [PATCH 091/172] fix small issues --- src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index e79259e99d..32d3078aa8 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -138,7 +138,7 @@ template KOKKOS_INLINE_FUNCTION void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const int &ii) const { - double massone_i,massone_j,totalmass; + double massone_i,massone_j; const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -183,7 +183,6 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, // i atom contribution - totalmass = massone_i; double vnet[3]; vnet[0] = v(i,0) - vcom[0]; vnet[1] = v(i,1) - vcom[1]; From 495418158a3da1488966408648921417e7584a56 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Thu, 9 Jun 2022 15:51:31 -0600 Subject: [PATCH 092/172] Clarify doc page --- doc/src/compute_ave_sphere_atom.rst | 7 +++++-- src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp | 4 ++++ src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/src/compute_ave_sphere_atom.rst b/doc/src/compute_ave_sphere_atom.rst index 0cf631a941..a6607356c9 100644 --- a/doc/src/compute_ave_sphere_atom.rst +++ b/doc/src/compute_ave_sphere_atom.rst @@ -36,7 +36,9 @@ Description """"""""""" Define a computation that calculates the local mass density and temperature -for each atom and neighbors inside a spherical cutoff. +for each atom and neighbors inside a spherical cutoff. The center-of-mass +velocity of the atoms in the sphere is subtracted out before computing the +temperature, which leaves only the thermal velocity, similar to :doc:`compute temp/com `. The optional keyword *cutoff* defines the distance cutoff used when searching for neighbors. The default value is the cutoff @@ -77,7 +79,8 @@ too frequently. Output info """"""""""" -This compute calculates a per-atom array with two columns: mass density and temperature. +This compute calculates a per-atom array with two columns: mass density in density +:doc:`units ` and temperature in temperature :doc:`units `. These values can be accessed by any command that uses per-atom values from a compute as input. See the :doc:`Howto output ` doc diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index a477da0511..010051029a 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -229,6 +229,10 @@ void ComputeAveSphereAtom::compute_peratom() for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; + if (rmass) + massone_j = rmass[j]; + else + massone_j = mass[type[j]]; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index 32d3078aa8..7873bd0d92 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -162,6 +162,8 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); j &= NEIGHMASK; + if (rmass.data()) massone_j = rmass[j]; + else massone_j = mass[type[j]]; const F_FLOAT delx = x(j,0) - xtmp; const F_FLOAT dely = x(j,1) - ytmp; From ac48852b2d02005d1f92504a7d6474d4cdb808f7 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 10 Jun 2022 08:30:23 -0600 Subject: [PATCH 093/172] edits to 1st paragraph of description --- doc/src/compute_ave_sphere_atom.rst | 64 ++++++++++++++++------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/doc/src/compute_ave_sphere_atom.rst b/doc/src/compute_ave_sphere_atom.rst index a6607356c9..48dbf377cb 100644 --- a/doc/src/compute_ave_sphere_atom.rst +++ b/doc/src/compute_ave_sphere_atom.rst @@ -35,18 +35,24 @@ Examples Description """"""""""" -Define a computation that calculates the local mass density and temperature -for each atom and neighbors inside a spherical cutoff. The center-of-mass -velocity of the atoms in the sphere is subtracted out before computing the -temperature, which leaves only the thermal velocity, similar to :doc:`compute temp/com `. +Define a computation that calculates the local mass density and +temperature for each atom based on its neighbors inside a spherical +cutoff. If an atom has M neighbors, then its local mass density is +calculated as the sum of its mass and its M neighbor masses, divided +by the volume of the cutoff sphere (or circle in 2d). The local +temperature of the atom is calculated as the temperature of the +collection of M+1 atoms, after subtracting the center-of-mass velocity +of the M+1 atoms from each of the M+1 atom's velocities. This is +effectively the thermal velocity of the neighborhood of the central +atom, similar to :doc:`compute temp/com `. -The optional keyword *cutoff* defines the distance cutoff -used when searching for neighbors. The default value is the cutoff -specified by the pair style. If no pair style is defined, then a cutoff -must be defined using this keyword. If the specified cutoff is larger than -that of the pair_style plus neighbor skin (or no pair style is defined), -the *comm_modify cutoff* option must also be set to match that of the -*cutoff* keyword. +The optional keyword *cutoff* defines the distance cutoff used when +searching for neighbors. The default value is the cutoff specified by +the pair style. If no pair style is defined, then a cutoff must be +defined using this keyword. If the specified cutoff is larger than +that of the pair_style plus neighbor skin (or no pair style is +defined), the *comm_modify cutoff* option must also be set to match +that of the *cutoff* keyword. The neighbor list needed to compute this quantity is constructed each time the calculation is performed (i.e. each time a snapshot of atoms @@ -57,16 +63,16 @@ too frequently. If you have a bonded system, then the settings of :doc:`special_bonds ` command can remove pairwise - interactions between atoms in the same bond, angle, or dihedral. This - is the default setting for the :doc:`special_bonds ` - command, and means those pairwise interactions do not appear in the - neighbor list. Because this compute uses the neighbor list, it also means - those pairs will not be included in the order parameter. This - difficulty can be circumvented by writing a dump file, and using the - :doc:`rerun ` command to compute the order parameter for - snapshots in the dump file. The rerun script can use a - :doc:`special_bonds ` command that includes all pairs in - the neighbor list. + interactions between atoms in the same bond, angle, or dihedral. + This is the default setting for the :doc:`special_bonds + ` command, and means those pairwise interactions do + not appear in the neighbor list. Because this compute uses the + neighbor list, it also means those pairs will not be included in + the order parameter. This difficulty can be circumvented by + writing a dump file, and using the :doc:`rerun ` command to + compute the order parameter for snapshots in the dump file. The + rerun script can use a :doc:`special_bonds ` command + that includes all pairs in the neighbor list. ---------- @@ -79,18 +85,20 @@ too frequently. Output info """"""""""" -This compute calculates a per-atom array with two columns: mass density in density -:doc:`units ` and temperature in temperature :doc:`units `. +This compute calculates a per-atom array with two columns: mass +density in density :doc:`units ` and temperature in temperature +:doc:`units `. These values can be accessed by any command that uses per-atom values -from a compute as input. See the :doc:`Howto output ` doc -page for an overview of LAMMPS output options. +from a compute as input. See the :doc:`Howto output ` +doc page for an overview of LAMMPS output options. Restrictions """""""""""" -This compute is part of the EXTRA-COMPUTE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. +This compute is part of the EXTRA-COMPUTE package. It is only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` page for more info. Related commands """""""""""""""" @@ -100,5 +108,5 @@ Related commands Default """"""" -The option defaults are *cutoff* = pair style cutoff +The option defaults are *cutoff* = pair style cutoff. From ed702aab0539e0b4749ae24b3c36d3ac03dc87ad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 10 Jun 2022 13:00:36 -0400 Subject: [PATCH 094/172] update for renamed style names --- src/.gitignore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/.gitignore b/src/.gitignore index de157734fc..220cd621db 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -997,8 +997,8 @@ /neb.h /netcdf_units.cpp /netcdf_units.h -/pair_3b_table.cpp -/pair_3b_table.h +/pair_threebody_table.cpp +/pair_threebody_table.h /pair_adp.cpp /pair_adp.h /pair_agni.cpp @@ -1293,8 +1293,8 @@ /pair_sph_taitwater_morris.h /pair_sw.cpp /pair_sw.h -/pair_sw_3b_table.cpp -/pair_sw_3b_table.h +/pair_sw_angle_table.cpp +/pair_sw_angle_table.h /pair_sw_mod.cpp /pair_sw_mod.h /pair_tersoff.cpp From ef48fd2d9ce71163a418412aa0423a985bf6058f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 12 Jun 2022 23:36:43 -0400 Subject: [PATCH 095/172] remove unused imports --- examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py | 2 +- python/install.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py b/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py index 0daf62b1b0..2307f3d413 100644 --- a/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py +++ b/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py @@ -1,5 +1,5 @@ import numpy as np -from lammps import lammps, LAMMPS_INT, LMP_STYLE_GLOBAL, LMP_VAR_EQUAL, LMP_VAR_ATOM +from lammps import lammps, LMP_VAR_EQUAL # method for rotating elastic constants diff --git a/python/install.py b/python/install.py index 03b3366ba6..e3a4dc9251 100644 --- a/python/install.py +++ b/python/install.py @@ -11,7 +11,7 @@ independently and used to build the wheel without installing it. """ from __future__ import print_function -import sys,os,shutil,time,glob,subprocess +import sys,os,shutil,glob,subprocess from argparse import ArgumentParser parser = ArgumentParser(prog='install.py', From 33f4bb525b58ed5fd90e6ccbd477412afefe0713 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Jun 2022 17:43:40 -0400 Subject: [PATCH 096/172] remove redundant condition --- src/INTERLAYER/pair_ilp_tmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index 15e1beede7..52119cbf12 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -483,7 +483,7 @@ void PairILPTMD::calc_normal() } } //############################ For the edge atoms of TMD ################################ - else if (cont > 1 && cont < Nnei) { + else if (cont < Nnei) { if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0) { // derivatives of Ni[l] respect to the cont neighbors From c53e53d701ece2c8a66339cb43f1f5046c355b30 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Jun 2022 17:47:20 -0400 Subject: [PATCH 097/172] must set `suffix` variable only when suffixflag is true --- lib/latte/Install.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/latte/Install.py b/lib/latte/Install.py index 94879ff4a0..2e8f9bee8d 100644 --- a/lib/latte/Install.py +++ b/lib/latte/Install.py @@ -71,7 +71,8 @@ buildflag = args.build pathflag = args.path is not None version = args.version suffixflag = args.machine is not None -suffix = args.machine +if suffixflag: + suffix = args.machine if pathflag: lattedir = args.path @@ -132,8 +133,6 @@ os.symlink(os.path.join(lattedir, 'src', 'latte_c_bind.o'), 'filelink.o') # copy Makefile.lammps.suffix to Makefile.lammps if suffixflag or not os.path.exists("Makefile.lammps"): - if suffix is None: - suffix = 'gfortran' print("Creating Makefile.lammps") if os.path.exists("Makefile.lammps.%s" % suffix): shutil.copyfile("Makefile.lammps.%s" % suffix, 'Makefile.lammps') From 0f5ae6d48c2a55ffbd097175c16303da23cd6f57 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Jun 2022 22:00:36 -0400 Subject: [PATCH 098/172] remove references to "plugin" options from fix mdi/aimd --- doc/src/fix_mdi_aimd.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst index 64bc4a3d6a..9ab2a933ed 100644 --- a/doc/src/fix_mdi_aimd.rst +++ b/doc/src/fix_mdi_aimd.rst @@ -12,7 +12,6 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * mdi/aimd = style name of this fix command -* optional keyword = *plugin* Examples """""""" @@ -20,7 +19,6 @@ Examples .. code-block:: LAMMPS fix 1 all mdi/aimd - fix 1 all mdi/aimd plugin Description """"""""""" @@ -53,14 +51,6 @@ same time as LAMMPS, or as a plugin library. See the :doc:`mdi plugin Again, the examples/mdi/README file explains how to launch both driver and engine codes so that engine is used in plugin mode. -To use this fix with a plugin engine, you must specify the -*plugin* keyword as the last argument, as illustrated above. - -.. note:: - - As of April 2022, the *plugin* keyword is needed. In a future - version of the MDI library it will no longer be necessary. - ---------- This fix performs the timestepping portion of an AIMD simulation. From ea48dd30199436b3b230a806b89c26cd9653c1ad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Jun 2022 22:01:30 -0400 Subject: [PATCH 099/172] avoid file pointer leakage in dump reader base class. --- src/reader.cpp | 6 ++++++ src/reader.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/reader.cpp b/src/reader.cpp index c7b99260e7..025445ca24 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -28,6 +28,12 @@ Reader::Reader(LAMMPS *lmp) : Pointers(lmp) compressed = false; } +// avoid resource leak +Reader::~Reader() +{ + if (fp != nullptr) close_file(); +} + /* ---------------------------------------------------------------------- try to open given file generic version for ASCII files with optional compression or for native binary dumps diff --git a/src/reader.h b/src/reader.h index 93f9197b7a..753b6956f7 100644 --- a/src/reader.h +++ b/src/reader.h @@ -23,6 +23,7 @@ namespace LAMMPS_NS { class Reader : protected Pointers { public: Reader(class LAMMPS *); + ~Reader() override; virtual void settings(int, char **); From 423c511d7a4f4d2d5830bf2bfd1a9184df90ff1e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Jun 2022 22:10:43 -0400 Subject: [PATCH 100/172] use explicit scoping in destructor --- src/REAXFF/fix_acks2_reaxff.cpp | 4 ++-- src/REAXFF/fix_qeq_reaxff.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/REAXFF/fix_acks2_reaxff.cpp b/src/REAXFF/fix_acks2_reaxff.cpp index bd93dec0b7..be71bc761f 100644 --- a/src/REAXFF/fix_acks2_reaxff.cpp +++ b/src/REAXFF/fix_acks2_reaxff.cpp @@ -94,8 +94,8 @@ FixACKS2ReaxFF::~FixACKS2ReaxFF() memory->destroy(s_hist_X); memory->destroy(s_hist_last); - deallocate_storage(); - deallocate_matrix(); + FixACKS2ReaxFF::deallocate_storage(); + FixACKS2ReaxFF::deallocate_matrix(); } /* ---------------------------------------------------------------------- */ diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index aeeee7b71a..1b9d33c3d5 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -163,7 +163,7 @@ FixQEqReaxFF::~FixQEqReaxFF() memory->destroy(t_hist); FixQEqReaxFF::deallocate_storage(); - deallocate_matrix(); + FixQEqReaxFF::deallocate_matrix(); memory->destroy(shld); From 26dcb649bbe6e36575e80e26b9a79db42794afdb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Jun 2022 22:10:51 -0400 Subject: [PATCH 101/172] remove redundant check --- src/create_bonds.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 7b3929db62..d316644e15 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -73,7 +73,6 @@ void CreateBonds::command(int narg, char **arg) iarg = 6; } else if (strcmp(arg[0], "single/bond") == 0) { style = SBOND; - if (narg < 4) error->all(FLERR, "Illegal create_bonds command"); btype = utils::inumeric(FLERR, arg[1], false, lmp); batom1 = utils::tnumeric(FLERR, arg[2], false, lmp); batom2 = utils::tnumeric(FLERR, arg[3], false, lmp); From 7a64d1358e25e13f9b5419636346ab00493ba66a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Jun 2022 10:36:11 -0400 Subject: [PATCH 102/172] remove unused module --- python/makewheel.py | 2 +- python/setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/makewheel.py b/python/makewheel.py index 64ecbe2464..a5b683aa63 100644 --- a/python/makewheel.py +++ b/python/makewheel.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import sys,os,shutil +import sys,os # find python script to activate the virtual environment and source it if sys.platform == 'win32': diff --git a/python/setup.py b/python/setup.py index 0097e3d596..7794119930 100644 --- a/python/setup.py +++ b/python/setup.py @@ -3,7 +3,7 @@ from setuptools import setup from setuptools.dist import Distribution from sys import version_info -import os,time,shutil +import os,time LAMMPS_PYTHON_DIR = os.path.dirname(os.path.realpath(__file__)) LAMMPS_DIR = os.path.dirname(LAMMPS_PYTHON_DIR) LAMMPS_SOURCE_DIR = os.path.join(LAMMPS_DIR, 'src') @@ -24,7 +24,7 @@ def get_lammps_version(): class BinaryDistribution(Distribution): """Wrapper to enforce creating a binary package""" - def has_ext_modules(foo): + def has_ext_modules(self): return True if version_info.major >= 3: From 6abb316dbad9e5c6298d8ae4e4a165a4ad25b765 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Jun 2022 10:36:21 -0400 Subject: [PATCH 103/172] avoid resource leak --- src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp b/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp index f5ccb15eac..7a36cdfc5c 100644 --- a/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp +++ b/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp @@ -44,7 +44,7 @@ static const double sqrt_2_inv = std::sqrt(0.5); /* ---------------------------------------------------------------------- */ PairSDPDTaitwaterIsothermal::PairSDPDTaitwaterIsothermal (LAMMPS *lmp) -: Pair (lmp) { +: Pair (lmp), random(nullptr) { restartinfo = 0; single_enable =0; } @@ -61,6 +61,7 @@ PairSDPDTaitwaterIsothermal::~PairSDPDTaitwaterIsothermal () { memory->destroy (soundspeed); memory->destroy (B); } + delete random; } /* ---------------------------------------------------------------------- */ From 2028c68becd9290dde3da700a7548521f7296233 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Jun 2022 10:45:05 -0400 Subject: [PATCH 104/172] remove unused imports --- .../ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py | 1 - examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py | 1 - examples/mdi/aimd_driver.py | 5 ++--- lib/install_helpers.py | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py b/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py index 0f3265faeb..88cc8dcca2 100644 --- a/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py +++ b/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import sys import numpy as np def reduce_Born(Cf): diff --git a/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py b/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py index 0f3265faeb..88cc8dcca2 100644 --- a/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py +++ b/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import sys import numpy as np def reduce_Born(Cf): diff --git a/examples/mdi/aimd_driver.py b/examples/mdi/aimd_driver.py index 2d8fe10c1a..ee493ea31e 100644 --- a/examples/mdi/aimd_driver.py +++ b/examples/mdi/aimd_driver.py @@ -26,7 +26,7 @@ # -nsteps 5 # number of timesteps, default = 5 -import sys,math,random +import sys import mdi import numpy as np from mpi4py import MPI @@ -42,10 +42,9 @@ def error(txt=None): def perform_aimd(world,mm_comm,qm_comm): me = world.Get_rank() - nprocs = world.Get_size() # receive number of atoms from the MM engine - + mdi.MDI_Send_command(" Date: Tue, 14 Jun 2022 10:45:31 -0400 Subject: [PATCH 105/172] rename local variable shadowing a global one --- src/REAXFF/fix_qeq_reaxff.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index 1b9d33c3d5..48e93f682a 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -640,7 +640,7 @@ void FixQEqReaxFF::compute_H() int jnum; int i, j, ii, jj, flag; double dx, dy, dz, r_sqr; - const double SMALL = 0.0001; + constexpr double EPSILON = 0.0001; int *type = atom->type; tagint *tag = atom->tag; @@ -671,10 +671,10 @@ void FixQEqReaxFF::compute_H() if (j < atom->nlocal) flag = 1; else if (tag[i] < tag[j]) flag = 1; else if (tag[i] == tag[j]) { - if (dz > SMALL) flag = 1; - else if (fabs(dz) < SMALL) { - if (dy > SMALL) flag = 1; - else if (fabs(dy) < SMALL && dx > SMALL) + if (dz > EPSILON) flag = 1; + else if (fabs(dz) < EPSILON) { + if (dy > EPSILON) flag = 1; + else if (fabs(dy) < EPSILON && dx > EPSILON) flag = 1; } } From 927287e3e5b1c5d308aed767e615c4dcfa93475a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Jun 2022 14:06:11 -0400 Subject: [PATCH 106/172] fixes from clang-tidy --- src/ATC/fix_atc.cpp | 2 +- src/KOKKOS/pair_pace_kokkos.cpp | 3 +-- src/MANYBODY/pair_threebody_table.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ATC/fix_atc.cpp b/src/ATC/fix_atc.cpp index a7c0cf5ade..356aa2596c 100644 --- a/src/ATC/fix_atc.cpp +++ b/src/ATC/fix_atc.cpp @@ -284,7 +284,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), int me = ATC::LammpsInterface::instance()->comm_rank(); string groupName(arg[1]); - int igroup = group->find(groupName.c_str()); + int igroup = group->find(groupName); int atomCount = group->count(igroup); try { diff --git a/src/KOKKOS/pair_pace_kokkos.cpp b/src/KOKKOS/pair_pace_kokkos.cpp index 9d78b63167..4ffc971cea 100644 --- a/src/KOKKOS/pair_pace_kokkos.cpp +++ b/src/KOKKOS/pair_pace_kokkos.cpp @@ -534,8 +534,7 @@ void PairPACEKokkos::compute(int eflag_in, int vflag_in) } copymode = 1; - int newton_pair = force->newton_pair; - if (newton_pair == false) + if (!force->newton_pair) error->all(FLERR,"PairPACEKokkos requires 'newton on'"); if (recursive) diff --git a/src/MANYBODY/pair_threebody_table.cpp b/src/MANYBODY/pair_threebody_table.cpp index 14f3c261d9..2f4bc83f5a 100644 --- a/src/MANYBODY/pair_threebody_table.cpp +++ b/src/MANYBODY/pair_threebody_table.cpp @@ -450,7 +450,7 @@ void PairThreebodyTable::read_table(Table *tb, char *file, char *keyword, bool s param_extract(tb, line); // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { memory->create(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r12file"); memory->create(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r13file"); memory->create(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:thetafile"); @@ -481,7 +481,7 @@ void PairThreebodyTable::read_table(Table *tb, char *file, char *keyword, bool s int cerror = 0; reader.skip_line(); // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { for (int i = 0; i < tb->ninput * tb->ninput * (tb->ninput + 1); i++) { line = reader.next_line(11); try { @@ -583,7 +583,7 @@ void PairThreebodyTable::bcast_table(Table *tb, bool symmetric) MPI_Comm_rank(world, &me); if (me > 0) { // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { memory->create(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r12file"); memory->create(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r13file"); memory->create(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), @@ -612,7 +612,7 @@ void PairThreebodyTable::bcast_table(Table *tb, bool symmetric) } // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { MPI_Bcast(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world); MPI_Bcast(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world); MPI_Bcast(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world); @@ -697,7 +697,7 @@ void PairThreebodyTable::uf_lookup(Param *pm, double r12, double r13, double the //lookup scheme // if it is a symmetric threebody interaction, less table entries are required - if (pm->symmetric == true) { + if (pm->symmetric) { nr12 = (r12 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr; if (r12 == (pm->mltable->rmin - 0.5 * dr)) { nr12 = 0; } nr13 = (r13 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr; @@ -778,7 +778,7 @@ void PairThreebodyTable::threebody(Param *paramijk, double rsq1, double rsq2, do } // if the indices have been swapped, swap them back - if (swapped == true) { + if (swapped) { temp = r12; r12 = r13; r13 = temp; From 728e4a59107dac5f9a8865ce4c8259b3cb6e5aee Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Jun 2022 18:51:40 -0400 Subject: [PATCH 107/172] add permissions for codeql action --- .github/workflows/codeql-analysis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7ea31fcf14..ef1cb0a987 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,6 +13,11 @@ jobs: if: ${{ github.repository == 'lammps/lammps' }} runs-on: ubuntu-latest + permissions: + security-events: write + actions: read + contents: read + strategy: fail-fast: false matrix: From 03c0b4ae2718cb80d122936f64bae85112a202bb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Jun 2022 18:54:32 -0400 Subject: [PATCH 108/172] upgrade action versions --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/compile-msvc.yml | 4 ++-- .github/workflows/unittest-macos.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ef1cb0a987..07b64296a7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 @@ -35,7 +35,7 @@ jobs: python-version: '3.x' - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} config-file: ./.github/codeql/${{ matrix.language }}.yml @@ -53,4 +53,4 @@ jobs: cmake --build . --parallel 2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 15fcf1099d..7747be7b46 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -15,12 +15,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Select Python version - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.10' diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 2d903af646..9b8e79425c 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 From 9842879db188b008d7bd70bf385b1b65f1a964fa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 15 Jun 2022 08:14:53 -0400 Subject: [PATCH 109/172] fix typos --- doc/src/kspace_style.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/kspace_style.rst b/doc/src/kspace_style.rst index 59efbdc5bd..30f3e550c5 100644 --- a/doc/src/kspace_style.rst +++ b/doc/src/kspace_style.rst @@ -129,8 +129,8 @@ Examples kspace_style pppm 1.0e-4 kspace_style pppm/cg 1.0e-5 1.0e-6 - kspace style msm 1.0e-4 - kspace style scafacos fmm 1.0e-4 + kspace_style msm 1.0e-4 + kspace_style scafacos fmm 1.0e-4 kspace_style none Used in input scripts: From 1403a0dd94a4540c1561fc833d3bd2b73b03397a Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Wed, 15 Jun 2022 08:22:59 -0600 Subject: [PATCH 110/172] update affilication for Zhen Li --- doc/src/Packages_details.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index aaac06a4a8..b5d704190e 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -657,7 +657,7 @@ advection-diffusion-reaction systems. The equations of motion of these DPD extensions are integrated through a modified velocity-Verlet (MVV) algorithm. -**Author:** Zhen Li (Division of Applied Mathematics, Brown University) +**Author:** Zhen Li (Department of Mechanical Engineering, Clemson University) **Supporting info:** From 9ca91bfe8010ce28167d7cc5e3f350bcb9e4fe8f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 15 Jun 2022 18:14:27 -0600 Subject: [PATCH 111/172] Created two simple examples of compute sna/grid and sna/grid/local --- examples/snap/README.grid | 10 ++ examples/snap/in.grid.snap | 94 ++++++++++ examples/snap/in.grid.tri | 143 +++++++--------- examples/snap/log.15Jun22.grid.snap.g++.1 | 167 ++++++++++++++++++ examples/snap/log.15Jun22.grid.snap.g++.4 | 168 ++++++++++++++++++ examples/snap/log.15Jun22.grid.tri.g++.1 | 200 ++++++++++++++++++++++ examples/snap/log.15Jun22.grid.tri.g++.4 | 200 ++++++++++++++++++++++ 7 files changed, 900 insertions(+), 82 deletions(-) create mode 100644 examples/snap/in.grid.snap create mode 100644 examples/snap/log.15Jun22.grid.snap.g++.1 create mode 100644 examples/snap/log.15Jun22.grid.snap.g++.4 create mode 100644 examples/snap/log.15Jun22.grid.tri.g++.1 create mode 100644 examples/snap/log.15Jun22.grid.tri.g++.4 diff --git a/examples/snap/README.grid b/examples/snap/README.grid index 9033c9d445..a552ce38ab 100644 --- a/examples/snap/README.grid +++ b/examples/snap/README.grid @@ -7,3 +7,13 @@ in.grid.test # stress test of grid and grid/local in.grid.tri # grid with triclinic cell grid.py # access data from Python library interface + +For the LAMMPS public repo, the only examples that will be provided are: + + in.grid.snap # simple test of grid and grid/local + in.grid.tri # same for a triclinic box + log.15Jun22.grid.snap.g++.1 + log.15Jun22.grid.snap.g++.4 + log.15Jun22.grid.tri.g++.1 + log.15Jun22.grid.tri.g++.4 + diff --git a/examples/snap/in.grid.snap b/examples/snap/in.grid.snap new file mode 100644 index 0000000000..08c95a004f --- /dev/null +++ b/examples/snap/in.grid.snap @@ -0,0 +1,94 @@ +# Demonstrate calculation of SNAP bispectrum descriptors on a grid + +# CORRECTNESS: The two atom positions coincide with two of +# the gridpoints, so c_b[2][1-5] should match c_mygrid[8][4-8]. +# The same is true for compute grid/local c_mygridlocal[8][4-11]. +# Local arrays can not be access directly in the script, +# but they are printed out to file dump.blocal + +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +units metal +atom_modify map hash + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice custom $a & + a1 1 0 0 & + a2 0 1 0 & + a3 0 0 1 & + basis 0 0 0 & + basis 0.5 0.5 0.5 & + +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 180.88 + +# define atom compute and grid compute + +group snapgroup type 1 +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quadratic equal 0 +variable switch equal 1 + +variable snap_options string & + "${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} & + bzeroflag ${bzero} switchflag ${switch}" + +# build zero potential to satisfy compute sna/atom + +pair_style zero ${rcutfac} +pair_coeff * * + +# define atom and grid computes + +compute b all sna/atom ${snap_options} +compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & + ${snap_options} +compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} & + ${snap_options} + +# define output + +variable B5atom equal c_b[2][5] +variable B5grid equal c_mygrid[8][8] + +variable rmse_global equal "sqrt( & + (c_mygrid[8][1] - x[2])^2 + & + (c_mygrid[8][2] - y[2])^2 + & + (c_mygrid[8][3] - z[2])^2 + & + (c_mygrid[8][4] - c_b[2][1])^2 + & + (c_mygrid[8][5] - c_b[2][2])^2 + & + (c_mygrid[8][6] - c_b[2][3])^2 + & + (c_mygrid[8][7] - c_b[2][4])^2 + & + (c_mygrid[8][8] - c_b[2][5])^2 & + )" + +thermo_style custom step v_B5atom v_B5grid v_rmse_global + +# this is the only way to view the local grid + +dump 1 all local 1000 dump.blocal c_mygridlocal[*] +dump 2 all custom 1000 dump.batom id x y z c_b[*] + +# run + +run 0 + diff --git a/examples/snap/in.grid.tri b/examples/snap/in.grid.tri index f375c18c42..5283957eb8 100644 --- a/examples/snap/in.grid.tri +++ b/examples/snap/in.grid.tri @@ -1,4 +1,5 @@ -# Demonstrate bispectrum computes for triclinic cell +# Demonstrate calculation of SNAP bispectrum +# descriptors on a grid for triclinic cell # This triclinic cell has 6 times the volume of the single # unit cell used by in.grid @@ -6,35 +7,37 @@ # with each unit cell containing 2 atoms and the # reduced lattice vectors are [1 0 0], [1 1 0], and [1 1 1]. # The grid is listed in x-fastest order -# CORRECTNESS: thermo output for c_mygrid[*][7] should contain -# the same 2 values that appear in c_mygrid[*][7] for in.grid, -# 7.0663376 and 13.808803, corresponding to atom and insterstitial sites, -# respectively, and with occurrences 12 and 36, respectively. + +# CORRECTNESS: The atom positions coincide with certain +# gridpoints, so c_b[1][1-5] should match c_mygrid[1][4-8] +# and c_b[7][1-5] should match c_mygrid[13][4-8]. +# Local arrays can not be access directly in the script, +# but they are printed out to file dump.blocal.tri # Initialize simulation -variable nsteps index 0 -variable nrep index 1 -variable a index 3.316 -variable ngrid index 4 +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 -variable ngridx equal 3*${ngrid} -variable ngridy equal 2*${ngrid} -variable ngridz equal 1*${ngrid} +variable nrepx equal 3*${nrep} +variable nrepy equal 2*${nrep} +variable nrepz equal 1*${nrep} -variable nrepx equal 1*${nrep} -variable nrepy equal 1*${nrep} -variable nrepz equal 1*${nrep} +variable ngridx equal 3*${ngrid} +variable ngridy equal 2*${ngrid} +variable ngridz equal 1*${ngrid} -units metal +units metal +atom_modify map hash sort 0 0 # generate the box and atom positions using a BCC lattice -variable nx equal ${nrepx} -variable ny equal ${nrepy} -variable nz equal ${nrepz} +variable nx equal ${nrepx} +variable ny equal ${nrepy} +variable nz equal ${nrepz} -boundary p p p +boundary p p p lattice custom $a & a1 1 0 0 & @@ -42,20 +45,16 @@ lattice custom $a & a3 1 1 1 & basis 0 0 0 & basis 0.0 0.0 0.5 & -# origin 0.25 0.25 0.25 + spacing 1 1 1 box tilt large region box prism 0 ${nx} 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} create_box 1 box create_atoms 1 box -mass 1 180.88 +mass 1 180.88 -# choose potential - -include Ta06A.snap - -# define grid compute and atom compute +# define atom compute and grid compute group snapgroup type 1 variable twojmax equal 2 @@ -65,71 +64,51 @@ variable rmin0 equal 0 variable wj equal 1 variable radelem equal 0.5 variable bzero equal 0 -variable quad equal 0 +variable quadratic equal 0 variable switch equal 1 -compute b all sna/atom & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} +variable snap_options string & + "${rcutfac} ${rfac0} ${twojmax} ${radelem} & + ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} & + bzeroflag ${bzero} switchflag ${switch}" -compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} +# build zero potential to satisfy compute sna/atom + +pair_style zero ${rcutfac} +pair_coeff * * + +# define atom and grid computes + +compute b all sna/atom ${snap_options} +compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} & + ${snap_options} +compute mygridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} & + ${snap_options} # define output -# mygrid is ngrid by (3+nbis) = 384x8 +variable B5atom equal c_b[7][5] +variable B5grid equal c_mygrid[13][8] -thermo_style custom step temp ke pe vol & - c_mygrid[1][7] c_mygrid[2][7] c_mygrid[3][7] c_mygrid[4][7] c_mygrid[5][7] c_mygrid[6][7] c_mygrid[7][7] c_mygrid[8][7] c_mygrid[9][7] & - c_mygrid[10][7] c_mygrid[11][7] c_mygrid[12][7] c_mygrid[13][7] c_mygrid[14][7] c_mygrid[15][7] c_mygrid[16][7] c_mygrid[17][7] c_mygrid[18][7] c_mygrid[19][7] & - c_mygrid[20][7] c_mygrid[21][7] c_mygrid[22][7] c_mygrid[23][7] c_mygrid[24][7] c_mygrid[25][7] c_mygrid[26][7] c_mygrid[27][7] c_mygrid[28][7] c_mygrid[29][7] & - c_mygrid[30][7] c_mygrid[31][7] c_mygrid[32][7] c_mygrid[33][7] c_mygrid[34][7] c_mygrid[35][7] c_mygrid[36][7] c_mygrid[37][7] c_mygrid[38][7] c_mygrid[39][7] & - c_mygrid[40][7] c_mygrid[41][7] c_mygrid[42][7] c_mygrid[43][7] c_mygrid[44][7] c_mygrid[45][7] c_mygrid[46][7] c_mygrid[47][7] c_mygrid[48][7] c_mygrid[49][7] & - c_mygrid[50][7] c_mygrid[51][7] c_mygrid[52][7] c_mygrid[53][7] c_mygrid[54][7] c_mygrid[55][7] c_mygrid[56][7] c_mygrid[57][7] c_mygrid[58][7] c_mygrid[59][7] & - c_mygrid[60][7] c_mygrid[61][7] c_mygrid[62][7] c_mygrid[63][7] c_mygrid[64][7] c_mygrid[65][7] c_mygrid[66][7] c_mygrid[67][7] c_mygrid[68][7] c_mygrid[69][7] & - c_mygrid[70][7] c_mygrid[71][7] c_mygrid[72][7] c_mygrid[73][7] c_mygrid[74][7] c_mygrid[75][7] c_mygrid[76][7] c_mygrid[77][7] c_mygrid[78][7] c_mygrid[79][7] & - c_mygrid[80][7] c_mygrid[81][7] c_mygrid[82][7] c_mygrid[83][7] c_mygrid[84][7] c_mygrid[85][7] c_mygrid[86][7] c_mygrid[87][7] c_mygrid[88][7] c_mygrid[89][7] & - c_mygrid[90][7] c_mygrid[91][7] c_mygrid[92][7] c_mygrid[93][7] c_mygrid[94][7] c_mygrid[95][7] c_mygrid[96][7] c_mygrid[97][7] c_mygrid[98][7] c_mygrid[99][7] & - c_mygrid[100][7] c_mygrid[101][7] c_mygrid[102][7] c_mygrid[103][7] c_mygrid[104][7] c_mygrid[105][7] c_mygrid[106][7] c_mygrid[107][7] c_mygrid[108][7] c_mygrid[109][7] & - c_mygrid[110][7] c_mygrid[111][7] c_mygrid[112][7] c_mygrid[113][7] c_mygrid[114][7] c_mygrid[115][7] c_mygrid[116][7] c_mygrid[117][7] c_mygrid[118][7] c_mygrid[119][7] & - c_mygrid[120][7] c_mygrid[121][7] c_mygrid[122][7] c_mygrid[123][7] c_mygrid[124][7] c_mygrid[125][7] c_mygrid[126][7] c_mygrid[127][7] c_mygrid[128][7] c_mygrid[129][7] & - c_mygrid[130][7] c_mygrid[131][7] c_mygrid[132][7] c_mygrid[133][7] c_mygrid[134][7] c_mygrid[135][7] c_mygrid[136][7] c_mygrid[137][7] c_mygrid[138][7] c_mygrid[139][7] & - c_mygrid[140][7] c_mygrid[141][7] c_mygrid[142][7] c_mygrid[143][7] c_mygrid[144][7] c_mygrid[145][7] c_mygrid[146][7] c_mygrid[147][7] c_mygrid[148][7] c_mygrid[149][7] & - c_mygrid[150][7] c_mygrid[151][7] c_mygrid[152][7] c_mygrid[153][7] c_mygrid[154][7] c_mygrid[155][7] c_mygrid[156][7] c_mygrid[157][7] c_mygrid[158][7] c_mygrid[159][7] & - c_mygrid[160][7] c_mygrid[161][7] c_mygrid[162][7] c_mygrid[163][7] c_mygrid[164][7] c_mygrid[165][7] c_mygrid[166][7] c_mygrid[167][7] c_mygrid[168][7] c_mygrid[169][7] & - c_mygrid[170][7] c_mygrid[171][7] c_mygrid[172][7] c_mygrid[173][7] c_mygrid[174][7] c_mygrid[175][7] c_mygrid[176][7] c_mygrid[177][7] c_mygrid[178][7] c_mygrid[179][7] & - c_mygrid[180][7] c_mygrid[181][7] c_mygrid[182][7] c_mygrid[183][7] c_mygrid[184][7] c_mygrid[185][7] c_mygrid[186][7] c_mygrid[187][7] c_mygrid[188][7] c_mygrid[189][7] & - c_mygrid[190][7] c_mygrid[191][7] c_mygrid[192][7] c_mygrid[193][7] c_mygrid[194][7] c_mygrid[195][7] c_mygrid[196][7] c_mygrid[197][7] c_mygrid[198][7] c_mygrid[199][7] & - c_mygrid[200][7] c_mygrid[201][7] c_mygrid[202][7] c_mygrid[203][7] c_mygrid[204][7] c_mygrid[205][7] c_mygrid[206][7] c_mygrid[207][7] c_mygrid[208][7] c_mygrid[209][7] & - c_mygrid[210][7] c_mygrid[211][7] c_mygrid[212][7] c_mygrid[213][7] c_mygrid[214][7] c_mygrid[215][7] c_mygrid[216][7] c_mygrid[217][7] c_mygrid[218][7] c_mygrid[219][7] & - c_mygrid[220][7] c_mygrid[221][7] c_mygrid[222][7] c_mygrid[223][7] c_mygrid[224][7] c_mygrid[225][7] c_mygrid[226][7] c_mygrid[227][7] c_mygrid[228][7] c_mygrid[229][7] & - c_mygrid[230][7] c_mygrid[231][7] c_mygrid[232][7] c_mygrid[233][7] c_mygrid[234][7] c_mygrid[235][7] c_mygrid[236][7] c_mygrid[237][7] c_mygrid[238][7] c_mygrid[239][7] & - c_mygrid[240][7] c_mygrid[241][7] c_mygrid[242][7] c_mygrid[243][7] c_mygrid[244][7] c_mygrid[245][7] c_mygrid[246][7] c_mygrid[247][7] c_mygrid[248][7] c_mygrid[249][7] & - c_mygrid[250][7] c_mygrid[251][7] c_mygrid[252][7] c_mygrid[253][7] c_mygrid[254][7] c_mygrid[255][7] c_mygrid[256][7] c_mygrid[257][7] c_mygrid[258][7] c_mygrid[259][7] & - c_mygrid[260][7] c_mygrid[261][7] c_mygrid[262][7] c_mygrid[263][7] c_mygrid[264][7] c_mygrid[265][7] c_mygrid[266][7] c_mygrid[267][7] c_mygrid[268][7] c_mygrid[269][7] & - c_mygrid[270][7] c_mygrid[271][7] c_mygrid[272][7] c_mygrid[273][7] c_mygrid[274][7] c_mygrid[275][7] c_mygrid[276][7] c_mygrid[277][7] c_mygrid[278][7] c_mygrid[279][7] & - c_mygrid[280][7] c_mygrid[281][7] c_mygrid[282][7] c_mygrid[283][7] c_mygrid[284][7] c_mygrid[285][7] c_mygrid[286][7] c_mygrid[287][7] c_mygrid[288][7] c_mygrid[289][7] & - c_mygrid[290][7] c_mygrid[291][7] c_mygrid[292][7] c_mygrid[293][7] c_mygrid[294][7] c_mygrid[295][7] c_mygrid[296][7] c_mygrid[297][7] c_mygrid[298][7] c_mygrid[299][7] & - c_mygrid[300][7] c_mygrid[301][7] c_mygrid[302][7] c_mygrid[303][7] c_mygrid[304][7] c_mygrid[305][7] c_mygrid[306][7] c_mygrid[307][7] c_mygrid[308][7] c_mygrid[309][7] & - c_mygrid[310][7] c_mygrid[311][7] c_mygrid[312][7] c_mygrid[313][7] c_mygrid[314][7] c_mygrid[315][7] c_mygrid[316][7] c_mygrid[317][7] c_mygrid[318][7] c_mygrid[319][7] & - c_mygrid[320][7] c_mygrid[321][7] c_mygrid[322][7] c_mygrid[323][7] c_mygrid[324][7] c_mygrid[325][7] c_mygrid[326][7] c_mygrid[327][7] c_mygrid[328][7] c_mygrid[329][7] & - c_mygrid[330][7] c_mygrid[331][7] c_mygrid[332][7] c_mygrid[333][7] c_mygrid[334][7] c_mygrid[335][7] c_mygrid[336][7] c_mygrid[337][7] c_mygrid[338][7] c_mygrid[339][7] & - c_mygrid[340][7] c_mygrid[341][7] c_mygrid[342][7] c_mygrid[343][7] c_mygrid[344][7] c_mygrid[345][7] c_mygrid[346][7] c_mygrid[347][7] c_mygrid[348][7] c_mygrid[349][7] & - c_mygrid[350][7] c_mygrid[351][7] c_mygrid[352][7] c_mygrid[353][7] c_mygrid[354][7] c_mygrid[355][7] c_mygrid[356][7] c_mygrid[357][7] c_mygrid[358][7] c_mygrid[359][7] & - c_mygrid[360][7] c_mygrid[361][7] c_mygrid[362][7] c_mygrid[363][7] c_mygrid[364][7] c_mygrid[365][7] c_mygrid[366][7] c_mygrid[367][7] c_mygrid[368][7] c_mygrid[369][7] & - c_mygrid[370][7] c_mygrid[371][7] c_mygrid[372][7] c_mygrid[373][7] c_mygrid[374][7] c_mygrid[375][7] c_mygrid[376][7] c_mygrid[377][7] c_mygrid[378][7] c_mygrid[379][7] & - c_mygrid[380][7] c_mygrid[381][7] c_mygrid[382][7] c_mygrid[383][7] c_mygrid[384][7] +# do not compare x,y,z because assignment of ids +# to atoms is not unnique for different processor grids -thermo_modify norm yes +variable rmse_global equal "sqrt( & + (c_mygrid[13][4] - c_b[7][1])^2 + & + (c_mygrid[13][5] - c_b[7][2])^2 + & + (c_mygrid[13][6] - c_b[7][3])^2 + & + (c_mygrid[13][7] - c_b[7][4])^2 + & + (c_mygrid[13][8] - c_b[7][5])^2 & + )" -dump mydump_b all custom 1000 dump_b id c_b[*] +thermo_style custom step v_B5atom v_B5grid v_rmse_global + +# this is the only way to view the local grid + +dump 1 all local 1000 dump.blocal.tri c_mygridlocal[*] +dump 2 all custom 1000 dump.batom.tri id x y z c_b[*] # run -run 0 - - +run 0 diff --git a/examples/snap/log.15Jun22.grid.snap.g++.1 b/examples/snap/log.15Jun22.grid.snap.g++.1 new file mode 100644 index 0000000000..71b884d1b6 --- /dev/null +++ b/examples/snap/log.15Jun22.grid.snap.g++.1 @@ -0,0 +1,167 @@ +LAMMPS (28 Jul 2021) +# Demonstrate calculation of SNAP bispectrum descriptors on a grid + +# CORRECTNESS: The two atom positions coincide with two of +# the gridpoints, so c_b[2][1-5] should match c_mygrid[8][4-8]. +# The same is true for compute grid/local c_mygridlocal[8][4-11]. +# Local arrays can not be access directly in the script, +# but they are printed out to file dump.blocal + +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +units metal +atom_modify map hash + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable nx equal 1 +variable ny equal ${nrep} +variable ny equal 1 +variable nz equal ${nrep} +variable nz equal 1 + +boundary p p p + +lattice custom $a a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 +lattice custom 3.316 a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 +Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 +region box block 0 ${nx} 0 ${ny} 0 ${nz} +region box block 0 1 0 ${ny} 0 ${nz} +region box block 0 1 0 1 0 ${nz} +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 2 atoms + using lattice units in orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) + create_atoms CPU = 0.000 seconds + +mass 1 180.88 + +# define atom compute and grid compute + +group snapgroup type 1 +2 atoms in group snapgroup +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quadratic equal 0 +variable switch equal 1 + +variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}" +4.67637 ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# build zero potential to satisfy compute sna/atom + +pair_style zero ${rcutfac} +pair_style zero 4.67637 +pair_coeff * * + +# define atom and grid computes + +compute b all sna/atom ${snap_options} +compute b all sna/atom 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} ${snap_options} +compute mygrid all sna/grid grid 2 ${ngrid} ${ngrid} ${snap_options} +compute mygrid all sna/grid grid 2 2 ${ngrid} ${snap_options} +compute mygrid all sna/grid grid 2 2 2 ${snap_options} +compute mygrid all sna/grid grid 2 2 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} ${snap_options} +compute mygridlocal all sna/grid/local grid 2 ${ngrid} ${ngrid} ${snap_options} +compute mygridlocal all sna/grid/local grid 2 2 ${ngrid} ${snap_options} +compute mygridlocal all sna/grid/local grid 2 2 2 ${snap_options} +compute mygridlocal all sna/grid/local grid 2 2 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# define output + +variable B5atom equal c_b[2][5] +variable B5grid equal c_mygrid[8][8] + +variable rmse_global equal "sqrt( (c_mygrid[8][1] - x[2])^2 + (c_mygrid[8][2] - y[2])^2 + (c_mygrid[8][3] - z[2])^2 + (c_mygrid[8][4] - c_b[2][1])^2 + (c_mygrid[8][5] - c_b[2][2])^2 + (c_mygrid[8][6] - c_b[2][3])^2 + (c_mygrid[8][7] - c_b[2][4])^2 + (c_mygrid[8][8] - c_b[2][5])^2 )" + +thermo_style custom step v_B5atom v_B5grid v_rmse_global + +# this is the only way to view the local grid + +dump 1 all local 1000 dump.blocal c_mygridlocal[*] +dump 2 all custom 1000 dump.batom id x y z c_b[*] + +# run + +run 0 +WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 6.67637 + ghost atom cutoff = 6.67637 + binsize = 3.338185, bins = 1 1 1 + 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) compute sna/atom, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (3) compute sna/grid, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (4) compute sna/grid/local, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 8.384 | 8.384 | 8.384 Mbytes +Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 0 +Loop time of 1e-06 on 1 procs for 0 steps with 2 atoms + +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 1e-06 | | |100.00 + +Nlocal: 2.00000 ave 2 max 2 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 339.000 ave 339 max 339 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 64.0000 ave 64 max 64 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 128.000 ave 128 max 128 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 128 +Ave neighs/atom = 64.000000 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:00 diff --git a/examples/snap/log.15Jun22.grid.snap.g++.4 b/examples/snap/log.15Jun22.grid.snap.g++.4 new file mode 100644 index 0000000000..80761fc395 --- /dev/null +++ b/examples/snap/log.15Jun22.grid.snap.g++.4 @@ -0,0 +1,168 @@ +LAMMPS (28 Jul 2021) +# Demonstrate calculation of SNAP bispectrum descriptors on a grid + +# CORRECTNESS: The two atom positions coincide with two of +# the gridpoints, so c_b[2][1-5] should match c_mygrid[8][4-8]. +# The same is true for compute grid/local c_mygridlocal[8][4-11]. +# Local arrays can not be access directly in the script, +# but they are printed out to file dump.blocal + +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +units metal +atom_modify map hash + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable nx equal 1 +variable ny equal ${nrep} +variable ny equal 1 +variable nz equal ${nrep} +variable nz equal 1 + +boundary p p p + +lattice custom $a a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 +lattice custom 3.316 a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 +Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 +region box block 0 ${nx} 0 ${ny} 0 ${nz} +region box block 0 1 0 ${ny} 0 ${nz} +region box block 0 1 0 1 0 ${nz} +region box block 0 1 0 1 0 1 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 2 atoms + using lattice units in orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) + create_atoms CPU = 0.001 seconds + +mass 1 180.88 + +# define atom compute and grid compute + +group snapgroup type 1 +2 atoms in group snapgroup +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quadratic equal 0 +variable switch equal 1 + +variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}" +4.67637 ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# build zero potential to satisfy compute sna/atom + +pair_style zero ${rcutfac} +pair_style zero 4.67637 +pair_coeff * * + +# define atom and grid computes + +compute b all sna/atom ${snap_options} +compute b all sna/atom 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} ${snap_options} +compute mygrid all sna/grid grid 2 ${ngrid} ${ngrid} ${snap_options} +compute mygrid all sna/grid grid 2 2 ${ngrid} ${snap_options} +compute mygrid all sna/grid grid 2 2 2 ${snap_options} +compute mygrid all sna/grid grid 2 2 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} ${snap_options} +compute mygridlocal all sna/grid/local grid 2 ${ngrid} ${ngrid} ${snap_options} +compute mygridlocal all sna/grid/local grid 2 2 ${ngrid} ${snap_options} +compute mygridlocal all sna/grid/local grid 2 2 2 ${snap_options} +compute mygridlocal all sna/grid/local grid 2 2 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# define output + +variable B5atom equal c_b[2][5] +variable B5grid equal c_mygrid[8][8] + +variable rmse_global equal "sqrt( (c_mygrid[8][1] - x[2])^2 + (c_mygrid[8][2] - y[2])^2 + (c_mygrid[8][3] - z[2])^2 + (c_mygrid[8][4] - c_b[2][1])^2 + (c_mygrid[8][5] - c_b[2][2])^2 + (c_mygrid[8][6] - c_b[2][3])^2 + (c_mygrid[8][7] - c_b[2][4])^2 + (c_mygrid[8][8] - c_b[2][5])^2 )" + +thermo_style custom step v_B5atom v_B5grid v_rmse_global + +# this is the only way to view the local grid + +dump 1 all local 1000 dump.blocal c_mygridlocal[*] +dump 2 all custom 1000 dump.batom id x y z c_b[*] + +# run + +run 0 +WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 6.67637 + ghost atom cutoff = 6.67637 + binsize = 3.338185, bins = 1 1 1 + 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) compute sna/atom, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (3) compute sna/grid, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (4) compute sna/grid/local, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +WARNING: Proc sub-domain size < neighbor skin, could lead to lost atoms (src/domain.cpp:964) +Per MPI rank memory allocation (min/avg/max) = 7.381 | 7.889 | 8.397 Mbytes +Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 0 +Loop time of 1.5e-06 on 4 procs for 0 steps with 2 atoms + +83.3% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 1.5e-06 | | |100.00 + +Nlocal: 0.500000 ave 1 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 274.500 ave 275 max 274 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 16.0000 ave 40 max 0 min +Histogram: 2 0 0 0 0 0 1 0 0 1 +FullNghs: 32.0000 ave 64 max 0 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 128 +Ave neighs/atom = 64.000000 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:00 diff --git a/examples/snap/log.15Jun22.grid.tri.g++.1 b/examples/snap/log.15Jun22.grid.tri.g++.1 new file mode 100644 index 0000000000..c261154367 --- /dev/null +++ b/examples/snap/log.15Jun22.grid.tri.g++.1 @@ -0,0 +1,200 @@ +LAMMPS (28 Jul 2021) +# Demonstrate calculation of SNAP bispectrum +# descriptors on a grid for triclinic cell + +# This triclinic cell has 6 times the volume of the single +# unit cell used by in.grid +# and contains 12 atoms. It is a 3x2x1 supercell +# with each unit cell containing 2 atoms and the +# reduced lattice vectors are [1 0 0], [1 1 0], and [1 1 1]. +# The grid is listed in x-fastest order + +# CORRECTNESS: The atom positions coincide with certain +# gridpoints, so c_b[1][1-5] should match c_mygrid[1][4-8] +# and c_b[7][1-5] should match c_mygrid[13][4-8]. +# Local arrays can not be access directly in the script, +# but they are printed out to file dump.blocal.tri + +# Initialize simulation + +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +variable nrepx equal 3*${nrep} +variable nrepx equal 3*1 +variable nrepy equal 2*${nrep} +variable nrepy equal 2*1 +variable nrepz equal 1*${nrep} +variable nrepz equal 1*1 + +variable ngridx equal 3*${ngrid} +variable ngridx equal 3*2 +variable ngridy equal 2*${ngrid} +variable ngridy equal 2*2 +variable ngridz equal 1*${ngrid} +variable ngridz equal 1*2 + +units metal +atom_modify map hash sort 0 0 + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrepx} +variable nx equal 3 +variable ny equal ${nrepy} +variable ny equal 2 +variable nz equal ${nrepz} +variable nz equal 1 + +boundary p p p + +lattice custom $a a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 +lattice custom 3.316 a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 +Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 + +box tilt large +region box prism 0 ${nx} 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} +region box prism 0 3 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} +region box prism 0 3 0 2 0 ${nz} ${ny} ${nz} ${nz} +region box prism 0 3 0 2 0 1 ${ny} ${nz} ${nz} +region box prism 0 3 0 2 0 1 2 ${nz} ${nz} +region box prism 0 3 0 2 0 1 2 1 ${nz} +region box prism 0 3 0 2 0 1 2 1 1 +create_box 1 box +Created triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) +WARNING: Triclinic box skew is large (src/domain.cpp:219) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 12 atoms + using lattice units in triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) + create_atoms CPU = 0.001 seconds + +mass 1 180.88 + +# define atom compute and grid compute + +group snapgroup type 1 +12 atoms in group snapgroup +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quadratic equal 0 +variable switch equal 1 + +variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}" +4.67637 ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# build zero potential to satisfy compute sna/atom + +pair_style zero ${rcutfac} +pair_style zero 4.67637 +pair_coeff * * + +# define atom and grid computes + +compute b all sna/atom ${snap_options} +compute b all sna/atom 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${snap_options} +compute mygrid all sna/grid grid 6 ${ngridy} ${ngridz} ${snap_options} +compute mygrid all sna/grid grid 6 4 ${ngridz} ${snap_options} +compute mygrid all sna/grid grid 6 4 2 ${snap_options} +compute mygrid all sna/grid grid 6 4 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${snap_options} +compute mygridlocal all sna/grid/local grid 6 ${ngridy} ${ngridz} ${snap_options} +compute mygridlocal all sna/grid/local grid 6 4 ${ngridz} ${snap_options} +compute mygridlocal all sna/grid/local grid 6 4 2 ${snap_options} +compute mygridlocal all sna/grid/local grid 6 4 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# define output + +variable B5atom equal c_b[7][5] +variable B5grid equal c_mygrid[13][8] + +# do not compare x,y,z because assignment of ids +# to atoms is not unnique for different processor grids + +variable rmse_global equal "sqrt( (c_mygrid[13][4] - c_b[7][1])^2 + (c_mygrid[13][5] - c_b[7][2])^2 + (c_mygrid[13][6] - c_b[7][3])^2 + (c_mygrid[13][7] - c_b[7][4])^2 + (c_mygrid[13][8] - c_b[7][5])^2 )" + +thermo_style custom step v_B5atom v_B5grid v_rmse_global + +# this is the only way to view the local grid + +dump 1 all local 1000 dump.blocal.tri c_mygridlocal[*] +dump 2 all custom 1000 dump.batom.tri id x y z c_b[*] + +# run + +run 0 +WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 6.67637 + ghost atom cutoff = 6.67637 + binsize = 3.338185, bins = 6 3 1 + 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton/tri + stencil: half/bin/3d/tri + bin: standard + (2) compute sna/atom, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (3) compute sna/grid, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (4) compute sna/grid/local, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 8.435 | 8.435 | 8.435 Mbytes +Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 7.2262471e-14 +Loop time of 1e-06 on 1 procs for 0 steps with 12 atoms + +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 1e-06 | | |100.00 + +Nlocal: 12.0000 ave 12 max 12 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 604.000 ave 604 max 604 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 384.000 ave 384 max 384 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 768.000 ave 768 max 768 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 768 +Ave neighs/atom = 64.000000 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:00 diff --git a/examples/snap/log.15Jun22.grid.tri.g++.4 b/examples/snap/log.15Jun22.grid.tri.g++.4 new file mode 100644 index 0000000000..bac7ecaa5a --- /dev/null +++ b/examples/snap/log.15Jun22.grid.tri.g++.4 @@ -0,0 +1,200 @@ +LAMMPS (28 Jul 2021) +# Demonstrate calculation of SNAP bispectrum +# descriptors on a grid for triclinic cell + +# This triclinic cell has 6 times the volume of the single +# unit cell used by in.grid +# and contains 12 atoms. It is a 3x2x1 supercell +# with each unit cell containing 2 atoms and the +# reduced lattice vectors are [1 0 0], [1 1 0], and [1 1 1]. +# The grid is listed in x-fastest order + +# CORRECTNESS: The atom positions coincide with certain +# gridpoints, so c_b[1][1-5] should match c_mygrid[1][4-8] +# and c_b[7][1-5] should match c_mygrid[13][4-8]. +# Local arrays can not be access directly in the script, +# but they are printed out to file dump.blocal.tri + +# Initialize simulation + +variable nrep index 1 +variable a index 3.316 +variable ngrid index 2 + +variable nrepx equal 3*${nrep} +variable nrepx equal 3*1 +variable nrepy equal 2*${nrep} +variable nrepy equal 2*1 +variable nrepz equal 1*${nrep} +variable nrepz equal 1*1 + +variable ngridx equal 3*${ngrid} +variable ngridx equal 3*2 +variable ngridy equal 2*${ngrid} +variable ngridy equal 2*2 +variable ngridz equal 1*${ngrid} +variable ngridz equal 1*2 + +units metal +atom_modify map hash sort 0 0 + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrepx} +variable nx equal 3 +variable ny equal ${nrepy} +variable ny equal 2 +variable nz equal ${nrepz} +variable nz equal 1 + +boundary p p p + +lattice custom $a a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 +lattice custom 3.316 a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 +Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 + +box tilt large +region box prism 0 ${nx} 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} +region box prism 0 3 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} +region box prism 0 3 0 2 0 ${nz} ${ny} ${nz} ${nz} +region box prism 0 3 0 2 0 1 ${ny} ${nz} ${nz} +region box prism 0 3 0 2 0 1 2 ${nz} ${nz} +region box prism 0 3 0 2 0 1 2 1 ${nz} +region box prism 0 3 0 2 0 1 2 1 1 +create_box 1 box +Created triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) +WARNING: Triclinic box skew is large (src/domain.cpp:219) + 2 by 2 by 1 MPI processor grid +create_atoms 1 box +Created 12 atoms + using lattice units in triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) + create_atoms CPU = 0.001 seconds + +mass 1 180.88 + +# define atom compute and grid compute + +group snapgroup type 1 +12 atoms in group snapgroup +variable twojmax equal 2 +variable rcutfac equal 4.67637 +variable rfac0 equal 0.99363 +variable rmin0 equal 0 +variable wj equal 1 +variable radelem equal 0.5 +variable bzero equal 0 +variable quadratic equal 0 +variable switch equal 1 + +variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}" +4.67637 ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 ${radelem} ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 ${wj} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag ${bzero} switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag ${switch} +4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# build zero potential to satisfy compute sna/atom + +pair_style zero ${rcutfac} +pair_style zero 4.67637 +pair_coeff * * + +# define atom and grid computes + +compute b all sna/atom ${snap_options} +compute b all sna/atom 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${snap_options} +compute mygrid all sna/grid grid 6 ${ngridy} ${ngridz} ${snap_options} +compute mygrid all sna/grid grid 6 4 ${ngridz} ${snap_options} +compute mygrid all sna/grid grid 6 4 2 ${snap_options} +compute mygrid all sna/grid grid 6 4 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 +compute mygridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${snap_options} +compute mygridlocal all sna/grid/local grid 6 ${ngridy} ${ngridz} ${snap_options} +compute mygridlocal all sna/grid/local grid 6 4 ${ngridz} ${snap_options} +compute mygridlocal all sna/grid/local grid 6 4 2 ${snap_options} +compute mygridlocal all sna/grid/local grid 6 4 2 4.67637 0.99363 2 0.5 1 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 1 + +# define output + +variable B5atom equal c_b[7][5] +variable B5grid equal c_mygrid[13][8] + +# do not compare x,y,z because assignment of ids +# to atoms is not unnique for different processor grids + +variable rmse_global equal "sqrt( (c_mygrid[13][4] - c_b[7][1])^2 + (c_mygrid[13][5] - c_b[7][2])^2 + (c_mygrid[13][6] - c_b[7][3])^2 + (c_mygrid[13][7] - c_b[7][4])^2 + (c_mygrid[13][8] - c_b[7][5])^2 )" + +thermo_style custom step v_B5atom v_B5grid v_rmse_global + +# this is the only way to view the local grid + +dump 1 all local 1000 dump.blocal.tri c_mygridlocal[*] +dump 2 all custom 1000 dump.batom.tri id x y z c_b[*] + +# run + +run 0 +WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 6.67637 + ghost atom cutoff = 6.67637 + binsize = 3.338185, bins = 6 3 1 + 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton/tri + stencil: half/bin/3d/tri + bin: standard + (2) compute sna/atom, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (3) compute sna/grid, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard + (4) compute sna/grid/local, occasional + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 8.405 | 8.405 | 8.405 Mbytes +Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 2.1052124e-14 +Loop time of 1.25e-06 on 4 procs for 0 steps with 12 atoms + +140.0% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 1.25e-06 | | |100.00 + +Nlocal: 3.00000 ave 4 max 2 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 459.000 ave 460 max 458 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 96.0000 ave 128 max 64 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +FullNghs: 192.000 ave 256 max 128 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 768 +Ave neighs/atom = 64.000000 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:00 From 8004f8bf0ff3a9a4920017e9f6eabe55be48c09f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 15 Jun 2022 18:59:48 -0600 Subject: [PATCH 112/172] Removed unneeded member functions and data --- src/compute_grid.cpp | 92 ++++---------------------------------------- src/compute_grid.h | 6 +-- 2 files changed, 9 insertions(+), 89 deletions(-) diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 52bd7d6307..91d320bf63 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), grid(nullptr), gridall(nullptr), local_flags(nullptr), gridlocal(nullptr) + Compute(lmp, narg, arg), grid(nullptr), gridall(nullptr), gridlocal(nullptr) { if (narg < 6) error->all(FLERR,"Illegal compute grid command"); @@ -77,8 +77,6 @@ void ComputeGrid::setup() set_grid_global(); set_grid_local(); allocate(); - assign_coords(); - assign_local_flags(); } /* ---------------------------------------------------------------------- @@ -101,91 +99,18 @@ void ComputeGrid::grid2x(int igrid, double *x) } -/* ---------------------------------------------------------------------- - convert global array index to box coords -------------------------------------------------------------------------- */ - -void ComputeGrid::grid2ix(int igrid, int& ix, int& iy, int& iz) -{ - iz = igrid / (nx*ny); - igrid -= iz * (nx*ny); - iy = igrid / nx; - igrid -= iy * nx; - ix = igrid; -} - -// /* ---------------------------------------------------------------------- -// check if grid point is local -// ------------------------------------------------------------------------- */ - -// int ComputeGrid::check_local(int igrid) -// { -// double x[3]; - -// int iz = igrid / (nx*ny); -// igrid -= iz * (nx*ny); -// int iy = igrid / nx; -// igrid -= iy * nx; -// int ix = igrid; - -// x[0] = ix*delx; -// x[1] = iy*dely; -// x[2] = iz*delz; - -// int islocal = -// x[0] >= sublo[0] && x[0] < subhi[0] && -// x[1] >= sublo[1] && x[1] < subhi[1] && -// x[2] >= sublo[2] && x[2] < subhi[2]; - -// return islocal; -// } - -/* ---------------------------------------------------------------------- - check if grid point is local -------------------------------------------------------------------------- */ - -int ComputeGrid::check_local(int igrid) -{ - int ix, iy, iz; - - grid2ix(igrid, ix, iy, iz); - - int islocal = - ix >= nxlo && ix <= nxhi && - iy >= nylo && iy <= nyhi && - iz >= nzlo && iz <= nzhi; - - return islocal; -} - /* ---------------------------------------------------------------------- copy coords to global array ------------------------------------------------------------------------- */ -void ComputeGrid::assign_coords() +void ComputeGrid::assign_coords_all() { double x[3]; for (int igrid = 0; igrid < ngrid; igrid++) { grid2x(igrid,x); - grid[igrid][0] = x[0]; - grid[igrid][1] = x[1]; - grid[igrid][2] = x[2]; - } -} - -/* ---------------------------------------------------------------------- - copy coords to global array -------------------------------------------------------------------------- */ - -void ComputeGrid::assign_local_flags() -{ - for (int igrid = 0; igrid < ngrid; igrid++) { - if (check_local(igrid)) - local_flags[igrid] = 1; - else { - local_flags[igrid] = 0; - memset(grid[igrid],0,size_array_cols * sizeof(double)); - } + gridall[igrid][0] = x[0]; + gridall[igrid][1] = x[1]; + gridall[igrid][2] = x[2]; } } @@ -199,7 +124,6 @@ void ComputeGrid::allocate() memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); - memory->create(local_flags,size_array_rows,"grid:local_flags"); if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, @@ -217,7 +141,6 @@ void ComputeGrid::deallocate() { memory->destroy(grid); memory->destroy(gridall); - memory->destroy(local_flags); if (gridlocal_allocated) { gridlocal_allocated = 0; memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); @@ -322,8 +245,9 @@ void ComputeGrid::set_grid_local() double ComputeGrid::memory_usage() { double nbytes = size_array_rows*size_array_cols * - sizeof(double); // grid - nbytes += size_array_rows*sizeof(int); // local_flags + sizeof(double); // grid + nbytes += size_array_rows*size_array_cols * + sizeof(double); // gridall nbytes += size_array_cols*ngridlocal*sizeof(double); // gridlocal return nbytes; } diff --git a/src/compute_grid.h b/src/compute_grid.h index 421656febf..ab8e5bbf9e 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -46,16 +46,12 @@ class ComputeGrid : public Compute { int nargbase; // number of base class args double cutmax; // largest cutoff distance int size_array_cols_base; // number of columns used for coords, etc. - int *local_flags; // local flag for each grid point int gridlocal_allocated; // shows if gridlocal allocated void allocate(); // create arrays void deallocate(); // free arrays void grid2x(int, double*); // convert grid point to coord - void grid2ix(int, int&, int&, int&); // convert grid point to ix, iy, iz - void assign_coords(); // assign coords for grid - void assign_local_flags(); // set local flag for each grid point - int check_local(int); // check if grid point is local + void assign_coords_all(); // assign coords for global grid void set_grid_global(); // set global grid void set_grid_local(); // set bounds for local grid private: From 9d5f4bf1e9ad7b301c152db0069383d6147f0790 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 15 Jun 2022 19:02:14 -0600 Subject: [PATCH 113/172] Updated to include switchinnerflag support, anticipating merging in the latest LAMMPS --- src/ML-SNAP/compute_sna_grid.cpp | 36 ++++++++++++++++++++++++-- src/ML-SNAP/compute_sna_grid.h | 3 +++ src/ML-SNAP/compute_sna_grid_local.cpp | 32 ++++++++++++++++++++++- src/ML-SNAP/compute_sna_grid_local.h | 3 +++ 4 files changed, 71 insertions(+), 3 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 2def0cf6a4..d6ebcda3ef 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -61,6 +61,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : chemflag = 0; bnormflag = 0; wselfallflag = 0; + switchinnerflag = 0; nelements = 1; // process required arguments @@ -92,6 +93,11 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } } + // set local input checks + + int sinnerflag = 0; + int dinnerflag = 0; + // process optional args int iarg = nargmin; @@ -140,13 +146,37 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/grid command"); wselfallflag = atoi(arg[iarg+1]); iarg += 2; + } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute snap command"); + switchinnerflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"sinner") == 0) { + iarg++; + if (iarg+ntypes > narg) + error->all(FLERR,"Illegal compute snap command"); + memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); + for (int i = 0; i < ntypes; i++) + sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerflag = 1; + iarg += ntypes; + } else if (strcmp(arg[iarg],"dinner") == 0) { + iarg++; + if (iarg+ntypes > narg) + error->all(FLERR,"Illegal compute snap command"); + memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); + for (int i = 0; i < ntypes; i++) + dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerflag = 1; + iarg += ntypes; } else error->all(FLERR,"Illegal compute sna/grid command"); } snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, nelements); + chemflag, bnormflag, wselfallflag, + nelements, switchinnerflag); ncoeff = snaptr->ncoeff; nvalues = ncoeff; @@ -287,6 +317,8 @@ void ComputeSNAGrid::compute_array() } } + memset(grid[0],0,ngrid*size_array_cols*sizeof(double)); + for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { @@ -295,7 +327,7 @@ void ComputeSNAGrid::compute_array() grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; } MPI_Allreduce(&grid[0][0],&gridall[0][0],ngrid*size_array_cols,MPI_DOUBLE,MPI_SUM,world); - + assign_coords_all(); } diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index d40c87df9b..777b874505 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -42,6 +42,9 @@ class ComputeSNAGrid : public ComputeGrid { double *wjelem; int *map; // map types to [0,nelements) int nelements, chemflag; + int switchinnerflag; + double *sinnerelem; + double *dinnerelem; class SNA *snaptr; double cutmax; int quadraticflag; diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index c1574bfa26..7b26a88975 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -61,8 +61,14 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : chemflag = 0; bnormflag = 0; wselfallflag = 0; + switchinnerflag = 0; nelements = 1; + // set local input checks + + int sinnerflag = 0; + int dinnerflag = 0; + // process required arguments memory->create(radelem,ntypes+1,"sna/grid/local:radelem"); // offset by 1 to match up with types @@ -140,13 +146,37 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/grid/local command"); wselfallflag = atoi(arg[iarg+1]); iarg += 2; + } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal compute snap command"); + switchinnerflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"sinner") == 0) { + iarg++; + if (iarg+ntypes > narg) + error->all(FLERR,"Illegal compute snap command"); + memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); + for (int i = 0; i < ntypes; i++) + sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerflag = 1; + iarg += ntypes; + } else if (strcmp(arg[iarg],"dinner") == 0) { + iarg++; + if (iarg+ntypes > narg) + error->all(FLERR,"Illegal compute snap command"); + memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); + for (int i = 0; i < ntypes; i++) + dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerflag = 1; + iarg += ntypes; } else error->all(FLERR,"Illegal compute sna/grid/local command"); } snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, nelements); + chemflag, bnormflag, wselfallflag, + nelements, switchinnerflag); ncoeff = snaptr->ncoeff; nvalues = ncoeff; diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h index 21e321d123..853d629d87 100644 --- a/src/ML-SNAP/compute_sna_grid_local.h +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -42,6 +42,9 @@ class ComputeSNAGridLocal : public ComputeGridLocal { double *wjelem; int *map; // map types to [0,nelements) int nelements, chemflag; + int switchinnerflag; + double *sinnerelem; + double *dinnerelem; class SNA *snaptr; double cutmax; int quadraticflag; From cdc0b48a0b5954c557d52c3b53d1c46bbefddfef Mon Sep 17 00:00:00 2001 From: naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Thu, 16 Jun 2022 01:33:01 +0000 Subject: [PATCH 114/172] chore: Included githubactions in the dependabot config This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure. Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com> --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5ace4600a1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 70f836e2753df19a5bcb106717d93bf66dd4cf4e Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 15 Jun 2022 19:53:37 -0600 Subject: [PATCH 115/172] Updated to latest LAMMPS --- src/ML-SNAP/compute_sna_grid.cpp | 37 +++++++++-------- src/ML-SNAP/compute_sna_grid_local.cpp | 36 +++++++++------- src/ML-SNAP/pair_sna_grid.cpp | 57 +++++++++++++++++++------- src/ML-SNAP/pair_sna_grid.h | 3 ++ 4 files changed, 88 insertions(+), 45 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index d6ebcda3ef..302e81ede2 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -148,13 +148,13 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); + error->all(FLERR,"Illegal compute sna/grid command"); switchinnerflag = atoi(arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"sinner") == 0) { iarg++; if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); + error->all(FLERR,"Illegal compute sna/grid command"); memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); @@ -163,7 +163,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"dinner") == 0) { iarg++; if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); + error->all(FLERR,"Illegal compute sna/grid command"); memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); @@ -201,20 +201,20 @@ ComputeSNAGrid::~ComputeSNAGrid() void ComputeSNAGrid::init() { - if (force->pair == nullptr) - error->all(FLERR,"Compute sna/grid requires a pair style be defined"); + // if (force->pair == nullptr) + // error->all(FLERR,"Compute sna/grid requires a pair style be defined"); - if (cutmax > force->pair->cutforce) - error->all(FLERR,"Compute sna/grid cutoff is longer than pairwise cutoff"); + // if (cutmax > force->pair->cutforce) + // error->all(FLERR,"Compute sna/grid cutoff is longer than pairwise cutoff"); - // need an occasional full neighbor list + // // need an occasional full neighbor list - int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->pair = 0; - neighbor->requests[irequest]->compute = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - neighbor->requests[irequest]->occasional = 1; + // int irequest = neighbor->request(this,instance_me); + // neighbor->requests[irequest]->pair = 0; + // neighbor->requests[irequest]->compute = 1; + // neighbor->requests[irequest]->half = 0; + // neighbor->requests[irequest]->full = 1; + // neighbor->requests[irequest]->occasional = 1; int count = 0; for (int i = 0; i < modify->ncompute; i++) @@ -282,7 +282,8 @@ void ComputeSNAGrid::compute_array() int jtype = type[j]; int jelem = 0; if (chemflag) - jelem = map[jtype]; + jelem = map[jtype]; + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; @@ -290,7 +291,11 @@ void ComputeSNAGrid::compute_array() snaptr->inside[ninside] = j; snaptr->wj[ninside] = wjelem[jtype]; snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - snaptr->element[ninside] = jelem; // element index for multi-element snap + if (switchinnerflag) { + snaptr->sinnerij[ninside] = sinnerelem[jelem]; + snaptr->dinnerij[ninside] = dinnerelem[jelem]; + } + if (chemflag) snaptr->element[ninside] = jelem; ninside++; } } diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 7b26a88975..67ac316834 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -148,13 +148,13 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); + error->all(FLERR,"Illegal compute sna/grid/local command"); switchinnerflag = atoi(arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"sinner") == 0) { iarg++; if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); + error->all(FLERR,"Illegal compute sna/grid/local command"); memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); @@ -163,7 +163,7 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"dinner") == 0) { iarg++; if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); + error->all(FLERR,"Illegal compute sna/grid/local command"); memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); @@ -200,20 +200,20 @@ ComputeSNAGridLocal::~ComputeSNAGridLocal() void ComputeSNAGridLocal::init() { - if (force->pair == nullptr) - error->all(FLERR,"Compute sna/grid/local requires a pair style be defined"); + // if (force->pair == nullptr) + // error->all(FLERR,"Compute sna/grid/local requires a pair style be defined"); - if (cutmax > force->pair->cutforce) - error->all(FLERR,"Compute sna/grid/local cutoff is longer than pairwise cutoff"); + // if (cutmax > force->pair->cutforce) + // error->all(FLERR,"Compute sna/grid/local cutoff is longer than pairwise cutoff"); - // need an occasional full neighbor list + // // need an occasional full neighbor list - int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->pair = 0; - neighbor->requests[irequest]->compute = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - neighbor->requests[irequest]->occasional = 1; + // int irequest = neighbor->request(this,instance_me); + // neighbor->requests[irequest]->pair = 0; + // neighbor->requests[irequest]->compute = 1; + // neighbor->requests[irequest]->half = 0; + // neighbor->requests[irequest]->full = 1; + // neighbor->requests[irequest]->occasional = 1; int count = 0; for (int i = 0; i < modify->ncompute; i++) @@ -234,6 +234,7 @@ void ComputeSNAGridLocal::init_list(int /*id*/, NeighList *ptr) void ComputeSNAGridLocal::compute_local() { + printf("Entering compute_local()\n"); invoked_array = update->ntimestep; // compute sna for each gridpoint @@ -290,7 +291,11 @@ void ComputeSNAGridLocal::compute_local() snaptr->inside[ninside] = j; snaptr->wj[ninside] = wjelem[jtype]; snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - snaptr->element[ninside] = jelem; // element index for multi-element snap + if (switchinnerflag) { + snaptr->sinnerij[ninside] = sinnerelem[jelem]; + snaptr->dinnerij[ninside] = dinnerelem[jelem]; + } + if (chemflag) snaptr->element[ninside] = jelem; // element index for multi-element snap ninside++; } } @@ -323,6 +328,7 @@ void ComputeSNAGridLocal::compute_local() // copy 4d array to 2d array copy_gridlocal_to_local_array(); + printf("Exiting compute_local()\n"); } diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index 43a07b48e4..effed79ebf 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -59,15 +59,16 @@ void PairSNAGrid::init_style() if (force->newton_pair == 0) error->all(FLERR,"Pair style sna/grid requires newton pair on"); - // need a full neighbor list + // // need a full neighbor list - int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; + // int irequest = neighbor->request(this,instance_me); + // neighbor->requests[irequest]->half = 0; + // neighbor->requests[irequest]->full = 1; snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, nelements); + chemflag, bnormflag, wselfallflag, + nelements, switchinnerflag); ncoeff = snaptr->ncoeff; ndesc = ndesc_base + ncoeff; snaptr->init(); @@ -213,8 +214,8 @@ void PairSNAGrid::compute(int eflag, int vflag) const double rsq = delx*delx + dely*dely + delz*delz; int jtype = type[j]; int jelem = 0; - if (chemflag) - jelem = map[jtype]; + jelem = map[jtype]; + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; @@ -222,7 +223,11 @@ void PairSNAGrid::compute(int eflag, int vflag) snaptr->inside[ninside] = j; snaptr->wj[ninside] = wjelem[jtype]; snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - snaptr->element[ninside] = jelem; // element index for multi-element snap + if (switchinnerflag) { + snaptr->sinnerij[ninside] = 0.5*(sinnerelem[ielem]+sinnerelem[jelem]); + snaptr->dinnerij[ninside] = 0.5*(dinnerelem[ielem]+dinnerelem[jelem]); + } + if (chemflag) snaptr->element[ninside] = jelem; ninside++; } } @@ -243,12 +248,7 @@ void PairSNAGrid::compute(int eflag, int vflag) for (int jj = 0; jj < ninside; jj++) { int j = snaptr->inside[jj]; - if (chemflag) - snaptr->compute_duidrj(snaptr->rij[jj], snaptr->wj[jj], - snaptr->rcutij[jj],jj, snaptr->element[jj]); - else - snaptr->compute_duidrj(snaptr->rij[jj], snaptr->wj[jj], - snaptr->rcutij[jj],jj, 0); + snaptr->compute_duidrj(jj); snaptr->compute_deidrj(fij); @@ -326,6 +326,7 @@ void PairSNAGrid::settings(int narg, char ** arg) chemflag = 0; bnormflag = 0; wselfallflag = 0; + switchinnerflag = 0; nelements = 1; // process required arguments @@ -357,6 +358,11 @@ void PairSNAGrid::settings(int narg, char ** arg) } } + // set local input checks + + int sinnerflag = 0; + int dinnerflag = 0; + // process optional args int iarg = nargmin; @@ -405,6 +411,29 @@ void PairSNAGrid::settings(int narg, char ** arg) error->all(FLERR,"Illegal pair sna/grid command"); wselfallflag = atoi(arg[iarg+1]); iarg += 2; + } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { + if (iarg+2 > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + switchinnerflag = atoi(arg[iarg+1]); + iarg += 2; + } else if (strcmp(arg[iarg],"sinner") == 0) { + iarg++; + if (iarg+ntypes > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); + for (int i = 0; i < ntypes; i++) + sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerflag = 1; + iarg += ntypes; + } else if (strcmp(arg[iarg],"dinner") == 0) { + iarg++; + if (iarg+ntypes > narg) + error->all(FLERR,"Illegal pair sna/grid command"); + memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); + for (int i = 0; i < ntypes; i++) + dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerflag = 1; + iarg += ntypes; } else error->all(FLERR,"Illegal pair sna/grid command"); } diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h index 9ae0eece79..653bb9d1c1 100644 --- a/src/ML-SNAP/pair_sna_grid.h +++ b/src/ML-SNAP/pair_sna_grid.h @@ -45,6 +45,9 @@ class PairSNAGrid : public PairGrid { int quadraticflag; int twojmax, switchflag, bzeroflag, bnormflag; int chemflag, wselfallflag; + int switchinnerflag; + double *sinnerelem; + double *dinnerelem; double rfac0, rmin0; }; From 483e3cf04996125511bcd2b5d7aa0d295fdb072e Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 15 Jun 2022 20:28:22 -0600 Subject: [PATCH 116/172] Eliminated global storage for grid/local --- src/ML-SNAP/compute_sna_grid_local.cpp | 33 +++----------- src/ML-SNAP/pair_sna_grid.cpp | 6 --- src/compute_grid_local.cpp | 63 +++++--------------------- src/compute_grid_local.h | 1 - 4 files changed, 18 insertions(+), 85 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 67ac316834..e45a334d67 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -200,21 +200,6 @@ ComputeSNAGridLocal::~ComputeSNAGridLocal() void ComputeSNAGridLocal::init() { - // if (force->pair == nullptr) - // error->all(FLERR,"Compute sna/grid/local requires a pair style be defined"); - - // if (cutmax > force->pair->cutforce) - // error->all(FLERR,"Compute sna/grid/local cutoff is longer than pairwise cutoff"); - - // // need an occasional full neighbor list - - // int irequest = neighbor->request(this,instance_me); - // neighbor->requests[irequest]->pair = 0; - // neighbor->requests[irequest]->compute = 1; - // neighbor->requests[irequest]->half = 0; - // neighbor->requests[irequest]->full = 1; - // neighbor->requests[irequest]->occasional = 1; - int count = 0; for (int i = 0; i < modify->ncompute; i++) if (strcmp(modify->compute[i]->style,"sna/grid/local") == 0) count++; @@ -234,7 +219,6 @@ void ComputeSNAGridLocal::init_list(int /*id*/, NeighList *ptr) void ComputeSNAGridLocal::compute_local() { - printf("Entering compute_local()\n"); invoked_array = update->ntimestep; // compute sna for each gridpoint @@ -248,6 +232,7 @@ void ComputeSNAGridLocal::compute_local() snaptr->grow_rij(ntotal); + int igrid = 0; for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { @@ -307,8 +292,7 @@ void ComputeSNAGridLocal::compute_local() // linear contributions for (int icoeff = 0; icoeff < ncoeff; icoeff++) - gridlocal[size_local_cols_base+icoeff][iz][iy][ix] = - snaptr->blist[icoeff]; + alocal[igrid][size_local_cols_base+icoeff] = snaptr->blist[icoeff]; // quadratic contributions @@ -316,19 +300,14 @@ void ComputeSNAGridLocal::compute_local() int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { double bveci = snaptr->blist[icoeff]; - gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = - 0.5*bveci*bveci; + alocal[igrid][size_local_cols_base+ncount++] = 0.5*bveci*bveci; for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[size_local_cols_base+ncount++][iz][iy][ix] = + alocal[igrid][size_local_cols_base+ncount++] = bveci*snaptr->blist[jcoeff]; } } + igrid++; } - - // copy 4d array to 2d array - - copy_gridlocal_to_local_array(); - printf("Exiting compute_local()\n"); } @@ -340,7 +319,7 @@ double ComputeSNAGridLocal::memory_usage() { double nbytes = snaptr->memory_usage(); // SNA object int n = atom->ntypes+1; - nbytes += (double)n*sizeof(int); // map + nbytes += (double)n*sizeof(int); // map return nbytes; } diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp index effed79ebf..ffb4dfa033 100644 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ b/src/ML-SNAP/pair_sna_grid.cpp @@ -59,12 +59,6 @@ void PairSNAGrid::init_style() if (force->newton_pair == 0) error->all(FLERR,"Pair style sna/grid requires newton pair on"); - // // need a full neighbor list - - // int irequest = neighbor->request(this,instance_me); - // neighbor->requests[irequest]->half = 0; - // neighbor->requests[irequest]->full = 1; - snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 504555a718..4169d23e54 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -117,8 +117,6 @@ void ComputeGridLocal::allocate() { if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; - memory->create4d_offset(gridlocal,size_local_cols,nzlo,nzhi,nylo,nyhi, - nxlo,nxhi,"grid:gridlocal"); memory->create(alocal, size_local_rows, size_local_cols, "compute/grid/local:alocal"); array_local = alocal; } @@ -132,7 +130,6 @@ void ComputeGridLocal::deallocate() { if (gridlocal_allocated) { gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); memory->destroy(alocal); } array_local = nullptr; @@ -208,19 +205,6 @@ void ComputeGridLocal::set_grid_local() zfrachi = comm->mysplit[2][1]; } - // // not fully clear why this works - // // without, sometimes get uneven assignments - // // in case where ngridz is multiple of nprocz - - // double MYEPS = 1.0e-10; - - // xfraclo += MYEPS; - // xfrachi += MYEPS; - // yfraclo += MYEPS; - // yfrachi += MYEPS; - // zfraclo += MYEPS; - // zfrachi += MYEPS; - nxlo = static_cast (xfraclo * nx); if (1.0*nxlo != xfraclo*nx) nxlo++; nxhi = static_cast (xfrachi * nx); @@ -255,27 +239,20 @@ void ComputeGridLocal::assign_coords() alocal[igrid][2] = iz; double xgrid[3]; - // For triclinic: create gridpoint in lamda coordinates and transform after check. - // For orthorombic: create gridpoint in box coordinates. + // for triclinic: create gridpoint in lamda coordinates and transform after check. + // for orthorombic: create gridpoint in box coordinates. - if (triclinic) - { - grid2lamda(ix, iy, iz, xgrid); - } - else - { - grid2x(ix, iy, iz, xgrid); - } + if (triclinic) + grid2lamda(ix, iy, iz, xgrid); + else + grid2x(ix, iy, iz, xgrid); - // Ensure gridpoint is not strictly outside subdomain. - // There have been some problem with a gridpoint being something like 2e-17 outside of the subdomain, - // thus the EPISLON check. - if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || - (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || - (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) - { - error->one(FLERR,"Invalid gridpoint position in compute grid/local"); - } + // ensure gridpoint is not strictly outside subdomain + + if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || + (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || + (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) + error->one(FLERR,"Invalid gridpoint position in compute grid/local"); // convert lamda to x, y, z, after sudomain check @@ -288,22 +265,6 @@ void ComputeGridLocal::assign_coords() } } -/* ---------------------------------------------------------------------- - copy the 4d gridlocal array values to the 2d local array -------------------------------------------------------------------------- */ - -void ComputeGridLocal::copy_gridlocal_to_local_array() -{ - int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) - for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { - for (int icol = size_local_cols_base; icol < size_local_cols; icol++) - alocal[igrid][icol] = gridlocal[icol][iz][iy][ix]; - igrid++; - } -} - /* ---------------------------------------------------------------------- memory usage of local data ------------------------------------------------------------------------- */ diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index 79a5ea765d..0e6e37cd35 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -53,7 +53,6 @@ class ComputeGridLocal : public Compute { void set_grid_global(); // set global grid void set_grid_local(); // set bounds for local grid void assign_coords(); // assign coords for grid - void copy_gridlocal_to_local_array();// copy 4d gridlocal array to 2d local array private: }; From e30f86c2ff31775d8dd282e157f7c056c5693505 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 16 Jun 2022 08:22:51 -0600 Subject: [PATCH 117/172] Removed a few more unnecessary member data --- src/compute_grid_local.cpp | 7 +++---- src/compute_grid_local.h | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 4169d23e54..bcc56c3abd 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGridLocal::ComputeGridLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), gridlocal(nullptr), alocal(nullptr) + Compute(lmp, narg, arg), alocal(nullptr) { if (narg < 6) error->all(FLERR,"Illegal compute grid/local command"); @@ -220,8 +220,7 @@ void ComputeGridLocal::set_grid_local() nzhi = static_cast (zfrachi * nz); if (1.0*nzhi == zfrachi*nz) nzhi--; - ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); - size_local_rows = ngridlocal; + size_local_rows = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); } /* ---------------------------------------------------------------------- @@ -271,6 +270,6 @@ void ComputeGridLocal::assign_coords() double ComputeGridLocal::memory_usage() { - int nbytes = size_local_cols*ngridlocal*sizeof(double); // gridlocal + int nbytes = size_local_rows * size_local_cols * sizeof(double); // gridlocal return nbytes; } diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index 0e6e37cd35..15ea8ca47f 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -32,9 +32,7 @@ class ComputeGridLocal : public Compute { protected: int nx, ny, nz; // global grid dimensions int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive - int ngridlocal; // number of local grid points int nvalues; // number of values per grid point - double ****gridlocal; // local grid, redundant w.r.t. alocal double **alocal; // pointer to Compute::array_local int triclinic; // triclinic flag double *boxlo, *prd; // box info (units real/ortho or reduced/tri) From 535a5211fc60dcd9571596ac1403c8f1f91fa6d9 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 16 Jun 2022 10:33:54 -0600 Subject: [PATCH 118/172] More cleanup --- src/ML-SNAP/compute_sna_grid.cpp | 23 ++++++++--------------- src/ML-SNAP/compute_sna_grid_local.cpp | 6 ++++++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 302e81ede2..e96b54e7ed 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -173,6 +173,12 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } + if (switchinnerflag && !(sinnerflag && dinnerflag)) + error->all(FLERR,"Illegal compute sna/grid command: switchinnerflag = 1, missing sinner/dinner keyword"); + + if (!switchinnerflag && (sinnerflag || dinnerflag)) + error->all(FLERR,"Illegal compute sna/grid command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, @@ -201,21 +207,6 @@ ComputeSNAGrid::~ComputeSNAGrid() void ComputeSNAGrid::init() { - // if (force->pair == nullptr) - // error->all(FLERR,"Compute sna/grid requires a pair style be defined"); - - // if (cutmax > force->pair->cutforce) - // error->all(FLERR,"Compute sna/grid cutoff is longer than pairwise cutoff"); - - // // need an occasional full neighbor list - - // int irequest = neighbor->request(this,instance_me); - // neighbor->requests[irequest]->pair = 0; - // neighbor->requests[irequest]->compute = 1; - // neighbor->requests[irequest]->half = 0; - // neighbor->requests[irequest]->full = 1; - // neighbor->requests[irequest]->occasional = 1; - int count = 0; for (int i = 0; i < modify->ncompute; i++) if (strcmp(modify->compute[i]->style,"sna/grid") == 0) count++; @@ -284,6 +275,8 @@ void ComputeSNAGrid::compute_array() if (chemflag) jelem = map[jtype]; + // printf("jtype = %d cutsq[jtype][jtype] = %g\n", + // jtype, cutsq[jtype][jtype]); if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index e45a334d67..1dacc28617 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -173,6 +173,12 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : } + if (switchinnerflag && !(sinnerflag && dinnerflag)) + error->all(FLERR,"Illegal compute sna/grid/local command: switchinnerflag = 1, missing sinner/dinner keyword"); + + if (!switchinnerflag && (sinnerflag || dinnerflag)) + error->all(FLERR,"Illegal compute sna/grid/local command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, From 0a5d921f3f08167e3c7c5476cc46379dde719464 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 16 Jun 2022 15:37:55 -0400 Subject: [PATCH 119/172] update affiliation in source code as well --- src/DPD-MESO/fix_mvv_dpd.cpp | 4 ++-- src/DPD-MESO/fix_mvv_edpd.cpp | 4 ++-- src/DPD-MESO/fix_mvv_tdpd.cpp | 4 ++-- src/DPD-MESO/pair_edpd.cpp | 4 ++-- src/DPD-MESO/pair_mdpd.cpp | 4 ++-- src/DPD-MESO/pair_mdpd_rhosum.cpp | 2 +- src/DPD-MESO/pair_tdpd.cpp | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/DPD-MESO/fix_mvv_dpd.cpp b/src/DPD-MESO/fix_mvv_dpd.cpp index 73290535b1..d96031c9f9 100644 --- a/src/DPD-MESO/fix_mvv_dpd.cpp +++ b/src/DPD-MESO/fix_mvv_dpd.cpp @@ -17,8 +17,8 @@ modified velocity-Verlet (MVV) algorithm. Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm. - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "fix_mvv_dpd.h" diff --git a/src/DPD-MESO/fix_mvv_edpd.cpp b/src/DPD-MESO/fix_mvv_edpd.cpp index 856647d792..9b31bc4c5d 100644 --- a/src/DPD-MESO/fix_mvv_edpd.cpp +++ b/src/DPD-MESO/fix_mvv_edpd.cpp @@ -17,8 +17,8 @@ v and edpd_T) using the modified velocity-Verlet (MVV) algorithm. Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm. - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu Please cite the related publication: Z. Li, Y.-H. Tang, H. Lei, B. Caswell and G.E. Karniadakis. "Energy- diff --git a/src/DPD-MESO/fix_mvv_tdpd.cpp b/src/DPD-MESO/fix_mvv_tdpd.cpp index 00c6e29968..1a0dc5d520 100644 --- a/src/DPD-MESO/fix_mvv_tdpd.cpp +++ b/src/DPD-MESO/fix_mvv_tdpd.cpp @@ -17,8 +17,8 @@ v and cc) using the modified velocity-Verlet (MVV) algorithm. Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm. - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu Please cite the related publication: Z. Li, A. Yazdani, A. Tartakovsky and G.E. Karniadakis. "Transport diff --git a/src/DPD-MESO/pair_edpd.cpp b/src/DPD-MESO/pair_edpd.cpp index ddbbd05085..b05f588b7c 100644 --- a/src/DPD-MESO/pair_edpd.cpp +++ b/src/DPD-MESO/pair_edpd.cpp @@ -13,8 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "pair_edpd.h" diff --git a/src/DPD-MESO/pair_mdpd.cpp b/src/DPD-MESO/pair_mdpd.cpp index 053d322f00..ec0a57be15 100644 --- a/src/DPD-MESO/pair_mdpd.cpp +++ b/src/DPD-MESO/pair_mdpd.cpp @@ -13,8 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "pair_mdpd.h" diff --git a/src/DPD-MESO/pair_mdpd_rhosum.cpp b/src/DPD-MESO/pair_mdpd_rhosum.cpp index b44ca94c4e..773248a212 100644 --- a/src/DPD-MESO/pair_mdpd_rhosum.cpp +++ b/src/DPD-MESO/pair_mdpd_rhosum.cpp @@ -17,7 +17,7 @@ before the force calculation. The code uses 3D Lucy kernel, it can be modified for other kernels. - Contributing author: Zhen Li (Brown University) + Contributing author: Zhen Li (Clemson University) ------------------------------------------------------------------------- */ #include "pair_mdpd_rhosum.h" diff --git a/src/DPD-MESO/pair_tdpd.cpp b/src/DPD-MESO/pair_tdpd.cpp index 76f4b59108..39d9a151d9 100644 --- a/src/DPD-MESO/pair_tdpd.cpp +++ b/src/DPD-MESO/pair_tdpd.cpp @@ -13,8 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "pair_tdpd.h" From ba4cbf7055b6e8e98ed1fbd06ff7c3a0998bccf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 19:41:20 +0000 Subject: [PATCH 120/172] Bump actions/setup-python from 2 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 07b64296a7..07f7564727 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: fetch-depth: 2 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' From 2fc0a44ab20b1f64ed0539b37ecef76d2a9bb648 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 19:41:23 +0000 Subject: [PATCH 121/172] Bump actions/cache from 2 to 3 Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/unittest-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 9b8e79425c..e6e5ccfdc8 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -28,7 +28,7 @@ jobs: run: mkdir build - name: Set up ccache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ env.CCACHE_DIR }} key: macos-ccache-${{ github.sha }} From f12e8f932afb32cc462e71f21dbe336578110c98 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 16 Jun 2022 18:20:46 -0600 Subject: [PATCH 122/172] Eliminated problem with unassigned coordinates in grid array --- src/ML-SNAP/compute_sna_grid.cpp | 14 +++++++------- src/compute_grid.cpp | 7 ++++--- src/compute_grid.h | 1 - 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index e96b54e7ed..1d868ba769 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -242,10 +242,12 @@ void ComputeSNAGrid::compute_array() for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { + double xgrid[3]; const int igrid = iz*(nx*ny) + iy*nx + ix; - const double xtmp = grid[igrid][0]; - const double ytmp = grid[igrid][1]; - const double ztmp = grid[igrid][2]; + grid2x(igrid, xgrid); + const double xtmp = xgrid[0]; + const double ytmp = xgrid[1]; + const double ztmp = xgrid[2]; // currently, all grid points are type 1 @@ -275,8 +277,6 @@ void ComputeSNAGrid::compute_array() if (chemflag) jelem = map[jtype]; - // printf("jtype = %d cutsq[jtype][jtype] = %g\n", - // jtype, cutsq[jtype][jtype]); if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; @@ -315,7 +315,7 @@ void ComputeSNAGrid::compute_array() } } - memset(grid[0],0,ngrid*size_array_cols*sizeof(double)); + memset(&grid[0][0],0,size_array_rows*size_array_cols*sizeof(double)); for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) @@ -324,7 +324,7 @@ void ComputeSNAGrid::compute_array() for (int j = 0; j < nvalues; j++) grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; } - MPI_Allreduce(&grid[0][0],&gridall[0][0],ngrid*size_array_cols,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&grid[0][0],&gridall[0][0],size_array_rows*size_array_cols,MPI_DOUBLE,MPI_SUM,world); assign_coords_all(); } diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 91d320bf63..dd21b731e8 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -51,7 +51,7 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : nargbase = iarg - iarg0; - size_array_rows = ngrid = nx*ny*nz; + size_array_rows = nx*ny*nz; size_array_cols_base = 3; gridlocal_allocated = 0; } @@ -106,7 +106,7 @@ void ComputeGrid::grid2x(int igrid, double *x) void ComputeGrid::assign_coords_all() { double x[3]; - for (int igrid = 0; igrid < ngrid; igrid++) { + for (int igrid = 0; igrid < size_array_rows; igrid++) { grid2x(igrid,x); gridall[igrid][0] = x[0]; gridall[igrid][1] = x[1]; @@ -122,12 +122,13 @@ void ComputeGrid::allocate() { // allocate arrays + printf("In allocate() %d %d \n", size_array_rows,size_array_cols); memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, - nxlo,nxhi,"grid:gridlocal"); + nxlo,nxhi,"grid:gridlocal"); } array = gridall; } diff --git a/src/compute_grid.h b/src/compute_grid.h index ab8e5bbf9e..7bda1a89fa 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -32,7 +32,6 @@ class ComputeGrid : public Compute { protected: int nx, ny, nz; // global grid dimensions int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive - int ngrid; // number of global grid points int ngridlocal; // number of local grid points int nvalues; // number of values per grid point double **grid; // global grid From a7c5b5e8fd152f5abe064451b4371a9695834095 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 16 Jun 2022 20:22:40 -0600 Subject: [PATCH 123/172] Finsished documentation --- doc/src/Commands_compute.rst | 2 + doc/src/Errors_warnings.rst | 6 + doc/src/Packages_details.rst | 2 + doc/src/compute.rst | 2 + doc/src/compute_sna_atom.rst | 300 +++++++++++++++++++- doc/utils/sphinx-config/false_positives.txt | 3 + src/ML-SNAP/compute_sna_grid.h | 6 - src/ML-SNAP/compute_sna_grid_local.h | 8 - 8 files changed, 311 insertions(+), 18 deletions(-) diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index 61c5e83eda..bb0c3e9c2a 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -138,6 +138,8 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`smd/vol ` * :doc:`snap ` * :doc:`sna/atom ` + * :doc:`sna/grid ` + * :doc:`sna/grid/local ` * :doc:`snad/atom ` * :doc:`snav/atom ` * :doc:`sph/e/atom ` diff --git a/doc/src/Errors_warnings.rst b/doc/src/Errors_warnings.rst index 2d588a1b77..ab06ac523c 100644 --- a/doc/src/Errors_warnings.rst +++ b/doc/src/Errors_warnings.rst @@ -470,6 +470,12 @@ This will most likely cause errors in kinetic fluctuations. *More than one compute sna/atom* Self-explanatory. +*More than one compute sna/grid* + Self-explanatory. + +*More than one compute sna/grid/local* + Self-explanatory. + *More than one compute snad/atom* Self-explanatory. diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index aaac06a4a8..92a4cab46b 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1801,6 +1801,8 @@ computes which analyze attributes of the potential. * src/ML-SNAP: filenames -> commands * :doc:`pair_style snap ` * :doc:`compute sna/atom ` +* :doc:`compute sna/grid ` +* :doc:`compute sna/grid/local ` * :doc:`compute snad/atom ` * :doc:`compute snav/atom ` * examples/snap diff --git a/doc/src/compute.rst b/doc/src/compute.rst index 6fdedbbb95..cf17433035 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -284,6 +284,8 @@ The individual style names on the :doc:`Commands compute ` pag * :doc:`smd/vol ` - per-particle volumes and their sum in Smooth Mach Dynamics * :doc:`snap ` - gradients of SNAP energy and forces w.r.t. linear coefficients and related quantities for fitting SNAP potentials * :doc:`sna/atom ` - bispectrum components for each atom +* :doc:`sna/grid ` - global array of bispectrum components on a regular grid +* :doc:`sna/grid/local ` - local array of bispectrum components on a regular grid * :doc:`snad/atom ` - derivative of bispectrum components for each atom * :doc:`snav/atom ` - virial contribution from bispectrum components for each atom * :doc:`sph/e/atom ` - per-atom internal energy of Smooth-Particle Hydrodynamics atoms diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index 54a6df02a2..2bbee1e6b6 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -24,6 +24,9 @@ Syntax compute ID group-ID snad/atom rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... compute ID group-ID snav/atom rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... compute ID group-ID snap rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... + compute ID group-ID snap rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... + compute ID group-ID sna/grid nx ny nz rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... + compute ID group-ID sna/grid/local nx ny nz rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... * ID, group-ID are documented in :doc:`compute ` command * sna/atom = style name of this compute command @@ -32,6 +35,7 @@ Syntax * twojmax = band limit for bispectrum components (non-negative integer) * R_1, R_2,... = list of cutoff radii, one for each type (distance units) * w_1, w_2,... = list of neighbor weights, one for each type +* nx, ny, nz = number of grid points in x, y, and z directions (positive integer) * zero or more keyword/value pairs may be appended * keyword = *rmin0* or *switchflag* or *bzeroflag* or *quadraticflag* or *chem* or *bnormflag* or *wselfallflag* or *bikflag* or *switchinnerflag* or *sinner* or *dinner* @@ -78,6 +82,7 @@ Examples compute snap all snap 1.4 0.95 6 2.0 1.0 compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 chem 2 0 1 compute snap all snap 1.0 0.99363 6 3.81 3.83 1.0 0.93 switchinnerflag 1 sinner 1.35 1.6 dinner 0.25 0.3 + compute bgrid all sna/grid/local 200 200 200 1.4 0.95 6 2.0 1.0 Description """"""""""" @@ -212,6 +217,46 @@ command: See section below on output for a detailed explanation of the data layout in the global array. +The compute *sna/grid* and *sna/grid/local* commands calculate +bispectrum components for a regular grid of points. +These are calculated from the local density of nearby atoms *i'* +around each grid point, as if there was a central atom *i* +at the grid point. This is useful for characterizing fine-scale +structure in a configuration of atoms, and it has been used +to build a machine-learning surrogate for finite-temperature Kohn-Sham +density functional theory (:ref:`Ellis et al. `). +Neighbor atoms not in the group do not contribute to the +bispectrum components of the grid points. The distance cutoff :math:`R_{ii'}` +and other parameters are defined as for a central atom with the same type as the +neighbor atoms *i'*. + +Compute *sna/grid* calculates a global array containing bispectrum +components for a regular grid of points. +The grid is aligned with the current box dimensions, with the +first point at the box origin, and forming a regular 3d array with +*nx*, *ny*, and *nz* points in the x, y, and z directions. For triclinic +boxes, the array is congruent with the periodic lattice vectors +a, b, and c. The array contains one row for each of the +:math:`nx \times ny \times nz` grid points, looping over the index for *ix* fastest, +then *iy*, and *iz* slowest. Each row of the array contains the *x*, *y*, +and *z* coordinates of the grid point, followed by the bispectrum +components. See section below on output for a detailed explanation of the data +layout in the global array. + +Compute *sna/grid/local* calculates bispectrum components of a regular +grid of points similarly to compute *sna/grid* described above. +However, because the array is local, it contains only rows for grid points +that are local to the processor subdomain. The global grid +of :math:`nx \times ny \times nz` points is still laid out in space the same as for *sna/grid*, +but grid points are strictly partitioned, so that every grid point appears in +one and only one local array. The array contains one row for each of the +local grid points, looping over the global index *ix* fastest, +then *iy*, and *iz* slowest. Each row of the array contains +the global indexes *ix*, *iy*, and *iz* first, followed by the *x*, *y*, +and *z* coordinates of the grid point, followed by the bispectrum +components. See section below on output for a detailed explanation of the data +layout in the global array. + The value of all bispectrum components will be zero for atoms not in the group. Neighbor atoms not in the group do not contribute to the bispectrum of atoms in the group. @@ -441,6 +486,250 @@ page for an overview of LAMMPS output options. To see how this command can be used within a Python workflow to train SNAP potentials, see the examples in `FitSNAP `_. +The value of all bispectrum components will be zero for atoms not in +the group. Neighbor atoms not in the group do not contribute to the +bispectrum of atoms in the group. + +The neighbor list needed to compute this quantity is constructed each +time the calculation is performed (i.e. each time a snapshot of atoms +is dumped). Thus it can be inefficient to compute/dump this quantity +too frequently. + +The argument *rcutfac* is a scale factor that controls the ratio of +atomic radius to radial cutoff distance. + +The argument *rfac0* and the optional keyword *rmin0* define the +linear mapping from radial distance to polar angle :math:`theta_0` on the +3-sphere, given above. + +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. + +The keyword *switchflag* can be used to turn off the switching +function :math:`f_c(r)`. + +The keyword *bzeroflag* determines whether or not *B0*, the bispectrum +components of an atom with no neighbors, are subtracted from the +calculated bispectrum components. This optional keyword normally only +affects compute *sna/atom*\ . However, when *quadraticflag* is on, it +also affects *snad/atom* and *snav/atom*\ . + +The keyword *quadraticflag* determines whether or not the quadratic +combinations of bispectrum quantities are generated. These are formed +by taking the outer product of the vector of bispectrum components with +itself. See section below on output for a detailed explanation of the +number of quadratic terms and the ordered in which they are listed. + +The keyword *chem* activates the explicit multi-element variant of the +SNAP bispectrum components. The argument *nelements* specifies the +number of SNAP elements that will be handled. This is followed by +*elementlist*, a list of integers of length *ntypes*, with values in the +range [0, *nelements* ), which maps each LAMMPS type to one of the SNAP +elements. Note that multiple LAMMPS types can be mapped to the same +element, and some elements may be mapped by no LAMMPS type. However, in +typical use cases (training SNAP potentials) the mapping from LAMMPS +types to elements is one-to-one. + +The explicit multi-element variant invoked by the *chem* keyword +partitions the density of neighbors into partial densities for each +chemical element. This is described in detail in the paper by +:ref:`Cusentino et al. ` The bispectrum components are +indexed on ordered triplets of elements: + +.. math:: + + B_{j_1,j_2,j}^{\kappa\lambda\mu} = + \sum_{m_1,m'_1=-j_1}^{j_1}\sum_{m_2,m'_2=-j_2}^{j_2}\sum_{m,m'=-j}^{j} (u^{\mu}_{j,m,m'})^* + H {\scriptscriptstyle \begin{array}{l} {j} {m} {m'} \\ + {j_1} {m_1} {m'_1} \\ + {j_2} {m_2} {m'_2} \end{array}} + u^{\kappa}_{j_1,m_1,m'_1} u^{\lambda}_{j_2,m_2,m'_2} + +where :math:`u^{\mu}_{j,m,m'}` is an expansion coefficient for the partial density of neighbors +of element :math:`\mu` + +.. math:: + + u^{\mu}_{j,m,m'} = w^{self}_{\mu_{i}\mu} U^{j,m,m'}(0,0,0) + \sum_{r_{ii'} < R_{ii'}}{\delta_{\mu\mu_{i'}}f_c(r_{ii'}) w_{\mu_{i'}} U^{j,m,m'}(\theta_0,\theta,\phi)} + +where :math:`w^{self}_{\mu_{i}\mu}` is the self-contribution, which is +either 1 or 0 (see keyword *wselfallflag* below), +:math:`\delta_{\mu\mu_{i'}}` indicates that the sum is only over +neighbor atoms of element :math:`\mu`, and all other quantities are the +same as those appearing in the original equation for :math:`u^j_{m,m'}` +given above. + +The keyword *wselfallflag* defines the rule used for the +self-contribution. If *wselfallflag* is on, then +:math:`w^{self}_{\mu_{i}\mu}` = 1. If it is off then +:math:`w^{self}_{\mu_{i}\mu}` = 0, except in the case of +:math:`{\mu_{i}=\mu}`, when :math:`w^{self}_{\mu_{i}\mu}` = 1. When the +*chem* keyword is not used, this keyword has no effect. + +The keyword *bnormflag* determines whether or not the bispectrum +component :math:`B_{j_1,j_2,j}` is divided by a factor of :math:`2j+1`. +This normalization simplifies force calculations because of the +following symmetry relation + +.. math:: + + \frac{B_{j_1,j_2,j}}{2j+1} = \frac{B_{j,j_2,j_1}}{2j_1+1} = \frac{B_{j_1,j,j_2}}{2j_2+1} + +This option is typically used in conjunction with the *chem* keyword, +and LAMMPS will generate a warning if both *chem* and *bnormflag* +are not both set or not both unset. + +The keyword *bikflag* determines whether or not to expand the bispectrum +rows of the global array returned by compute snap. If *bikflag* is set +to *1* then the bispectrum row, which is typically the per-atom bispectrum +descriptors :math:`B_{i,k}` summed over all atoms *i* to produce +:math:`B_k`, becomes bispectrum rows equal to the number of atoms. Thus, +the resulting bispectrum rows are :math:`B_{i,k}` instead of just +:math:`B_k`. In this case, the entries in the final column for these rows +are set to zero. + +The keyword *switchinnerflag* with value 1 +activates an additional radial switching +function similar to :math:`f_c(r)` above, but acting to switch off +smoothly contributions from neighbor atoms at short separation distances. +This is useful when SNAP is used in combination with a simple +repulsive potential. For a neighbor atom at +distance :math:`r`, its contribution is scaled by a multiplicative +factor :math:`f_{inner}(r)` defined as follows: + +.. math:: + + = & 0, r \leq S_{inner} - D_{inner} \\ + f_{inner}(r) = & \frac{1}{2}(1 - \cos(\frac{\pi}{2} (1 + \frac{r-S_{inner}}{D_{inner}})), S_{inner} - D_{inner} < r \leq S_{inner} + D_{inner} \\ + = & 1, r > S_{inner} + D_{inner} + +where the switching region is centered at :math:`S_{inner}` and it extends a distance :math:`D_{inner}` +to the left and to the right of this. +With this option, additional keywords *sinner* and *dinner* must be used, +each followed by *ntypes* +values for :math:`S_{inner}` and :math:`D_{inner}`, respectively. +When the central atom and the neighbor atom have different types, +the values of :math:`S_{inner}` and :math:`D_{inner}` are +the arithmetic means of the values for both types. + +.. note:: + + If you have a bonded system, then the settings of :doc:`special_bonds + ` command can remove pairwise interactions between + atoms in the same bond, angle, or dihedral. This is the default + setting for the :doc:`special_bonds ` command, and + means those pairwise interactions do not appear in the neighbor list. + Because this fix uses the neighbor list, it also means those pairs + will not be included in the calculation. One way to get around this, + is to write a dump file, and use the :doc:`rerun ` command to + compute the bispectrum components for snapshots in the dump file. + The rerun script can use a :doc:`special_bonds ` + command that includes all pairs in the neighbor list. + +---------- + +Output info +""""""""""" + +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 of the value of *twojmax*, as described by the following +piece of python code: + +.. parsed-literal:: + + for j1 in range(0,twojmax+1): + 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. + +For even twojmax = 2(*m*\ -1), :math:`K = m(m+1)(2m+1)/6`, the *m*\ -th pyramidal number. For odd twojmax = 2 *m*\ -1, :math:`K = m(m+1)(m+2)/3`, twice the *m*\ -th tetrahedral number. + +.. 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* +components of the atom position. Each of these sub-blocks contains *K* +columns for the *K* bispectrum components, the same as for compute +*sna/atom* + +Compute *snav/atom* evaluates a per-atom array. The columns are arranged +into *ntypes* blocks, listed in order of atom type *I*\ . Each block +contains six sub-blocks corresponding to the *xx*, *yy*, *zz*, +*yz*, *xz*, and *xy* components of the virial tensor in Voigt +notation. Each of these sub-blocks contains *K* columns for the *K* +bispectrum components, the same as for compute *sna/atom* + +Compute *snap* evaluates a global array. The columns are arranged into +*ntypes* blocks, listed in order of atom type *I*\ . Each block contains +one column for each bispectrum component, the same as for compute +*sna/atom*\ . A final column contains the corresponding energy, force +component on an atom, or virial stress component. The rows of the array +appear in the following order: + +* 1 row: *sna/atom* quantities summed for all atoms of type *I* +* 3\*\ *N* rows: *snad/atom* quantities, with derivatives w.r.t. x, y, and z coordinate of atom *i* appearing in consecutive rows. The atoms are sorted based on atom ID. +* 6 rows: *snav/atom* quantities summed for all atoms of type *I* + +For example, if *K* =30 and ntypes=1, the number of columns in the +per-atom arrays generated by *sna/atom*, *snad/atom*, and +*snav/atom* are 30, 90, and 180, respectively. With *quadratic* value=1, +the numbers of columns are 930, 2790, and 5580, respectively. The +number of columns in the global array generated by *snap* are 31, and +931, respectively, while the number of rows is 1+3\*\ *N*\ +6, where *N* +is the total number of atoms. + +If the *quadratic* keyword value is set to 1, then additional columns +are generated, corresponding to the products of all distinct pairs of +bispectrum components. If the number of bispectrum components is *K*, +then the number of distinct pairs is *K*\ (\ *K*\ +1)/2. For compute +*sna/atom* these columns are appended to existing *K* columns. The +ordering of quadratic terms is upper-triangular, (1,1),(1,2)...(1,\ *K*\ +),(2,1)...(\ *K*\ -1,\ *K*\ -1),(\ *K*\ -1,\ *K*\ ),(\ *K*,\ *K*\ ). +For computes *snad/atom* and *snav/atom* each set of *K*\ (\ *K*\ +1)/2 +additional columns is inserted directly after each of sub-block of +linear terms i.e. linear and quadratic terms are contiguous. So the +nesting order from inside to outside is bispectrum component, linear +then quadratic, vector/tensor component, type. + +If the *chem* keyword is used, then the data is arranged into +:math:`N_{elem}^3` sub-blocks, each sub-block corresponding to a +particular chemical labeling :math:`\kappa\lambda\mu` with the last +label changing fastest. Each sub-block contains *K* bispectrum +components. For the purposes of handling contributions to force, virial, +and quadratic combinations, these :math:`N_{elem}^3` sub-blocks are +treated as a single block of :math:`K N_{elem}^3` columns. + +These values can be accessed by any command that uses per-atom values +from a compute as input. See the :doc:`Howto output ` doc +page for an overview of LAMMPS output options. To see how this command +can be used within a Python workflow to train SNAP potentials, see the +examples in `FitSNAP `_. + +Compute *sna/grid* evaluates a global array. +The array contains one row for each of the +:math:`nx \times ny \times nz` grid points, looping over the index for *ix* fastest, +then *iy*, and *iz* slowest. Each row of the array contains the *x*, *y*, +and *z* coordinates of the grid point, followed by the bispectrum +components. + +Compute *sna/grid/local* evaluates a local array. +The array contains one row for each of the +local grid points, looping over the global index *ix* fastest, +then *iy*, and *iz* slowest. Each row of the array contains +the global indexes *ix*, *iy*, and *iz* first, followed by the *x*, *y*, +and *z* coordinates of the grid point, followed by the bispectrum +components. + Restrictions """""""""""" @@ -464,9 +753,8 @@ The optional keyword defaults are *rmin0* = 0, .. _Thompson20141: -**(Thompson)** Thompson, Swiler, Trott, Foiles, Tucker, under review, preprint -available at `arXiv:1409.3880 `_ - +**(Thompson)** Thompson, Swiler, Trott, Foiles, Tucker, J Comp Phys, 285, 316, (2015). + .. _Bartok20101: **(Bartok)** Bartok, Payne, Risi, Csanyi, Phys Rev Lett, 104, 136403 (2010). @@ -486,4 +774,8 @@ of Angular Momentum, World Scientific, Singapore (1987). .. _Cusentino2020: -**(Cusentino)** Cusentino, Wood, and Thompson, J Phys Chem A, xxx, xxxxx, (2020) +**(Cusentino)** Cusentino, Wood, Thompson, J Phys Chem A, 124, 5456, (2020) + +.. _Ellis2021: + +**(Ellis)** Ellis, Fiedler, Popoola, Modine, Stephens, Thompson, Cangi, Rajamanickam, Phys Rev B, 104, 035120, (2021) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 836dc4efa8..21f4549441 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -372,6 +372,7 @@ Caltech Camilloni Camiloni Campana +Cangi Cao Capolungo Caro @@ -2676,6 +2677,7 @@ polyhedra Polym polymorphism popen +Popoola Popov popstore Poresag @@ -2819,6 +2821,7 @@ radians Rafferty rahman Rahman +Rajamanickam Ralf Raman ramped diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index 777b874505..c203ce8bb4 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -63,12 +63,6 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. -E: Compute sna/grid requires a pair style be defined - -Self-explanatory. - -E: Compute sna/grid cutoff is longer than pairwise cutoff - Self-explanatory. W: More than one compute sna/grid diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h index 853d629d87..5ce40069ee 100644 --- a/src/ML-SNAP/compute_sna_grid_local.h +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -63,14 +63,6 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. -E: Compute sna/grid/local requires a pair style be defined - -Self-explanatory. - -E: Compute sna/grid/local cutoff is longer than pairwise cutoff - -Self-explanatory. - W: More than one compute sna/grid/local Self-explanatory. From 21b3020a9734861ae6fd9782116b9c74b90840be Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 00:10:06 -0400 Subject: [PATCH 124/172] make the "makewheel.py" script independent from the activate_this.py script The "activate_this.py" script only seems to be included in virtualenv, but not venv. Now we implement its effect directly. --- python/makewheel.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/python/makewheel.py b/python/makewheel.py index a5b683aa63..f13ad110ce 100644 --- a/python/makewheel.py +++ b/python/makewheel.py @@ -1,14 +1,26 @@ #!/usr/bin/env python -import sys,os +import sys,os,site -# find python script to activate the virtual environment and source it +base = os.path.abspath('buildwheel') if sys.platform == 'win32': - virtenv=os.path.join('buildwheel','Scripts','activate_this.py') + bin_dir=os.path.join(base,'Scripts') else: - virtenv=os.path.join('buildwheel','bin','activate_this.py') + bin_dir=os.path.join(base,'bin') -exec(open(virtenv).read(), {'__file__': virtenv}) +# prepend bin to PATH, set venv path +os.environ["PATH"] = os.pathsep.join([bin_dir] + os.environ.get("PATH", "").split(os.pathsep)) +os.environ["VIRTUAL_ENV"] = base + +# add the virtual environments libraries to the host python import mechanism +prev_length = len(sys.path) +for lib in "__LIB_FOLDERS__".split(os.pathsep): + path = os.path.realpath(os.path.join(bin_dir, lib)) + site.addsitedir(path) +sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length] + +sys.real_prefix = sys.prefix +sys.prefix = base # update pip and install all requirements to build the wheel os.system('python -m pip install --upgrade pip') From 18f9e5836bd3e2e4fd9c91b9cc035d35cbac5232 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 06:52:25 -0400 Subject: [PATCH 125/172] support installing the built wheel into virtual environment, if active --- python/install.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/python/install.py b/python/install.py index e3a4dc9251..3c4be00779 100644 --- a/python/install.py +++ b/python/install.py @@ -84,6 +84,10 @@ if args.noinstall: # install the wheel with pip. first try to install in the default environment. # that will be a virtual environment, if active, or the system folder. +# if in a virtual environment, we must not use the python executable +# that is running this script (configured by cmake), but use "python" +# from the regular system path. The user may have changed to the virtual +# environment *after* running cmake. # recent versions of pip will automatically drop to use the user folder # in case the system folder is not writable. @@ -93,10 +97,16 @@ if args.noinstall: # must be uninstalled manually. We must not ignore this and drop # back to install into a (forced) user folder. -print("Installing wheel") +if "VIRTUAL_ENV" in os.environ: + print("Installing wheel into virtual environment") + py_exe = 'python' +else: + print("Installing wheel into system site-packages folder") + py_exe = sys.executable + for wheel in glob.glob('lammps-*.whl'): try: - txt = subprocess.check_output([sys.executable, '-m', 'pip', 'install', '--force-reinstall', wheel], stderr=subprocess.STDOUT, shell=False) + txt = subprocess.check_output([py_exe, '-m', 'pip', 'install', '--force-reinstall', wheel], stderr=subprocess.STDOUT, shell=False) print(txt.decode('UTF-8')) continue except subprocess.CalledProcessError as err: @@ -104,7 +114,7 @@ for wheel in glob.glob('lammps-*.whl'): if errmsg.find("distutils installed"): sys.exit(errmsg + "You need to uninstall the LAMMPS python module manually first.\n") try: - print('Installing wheel into standard site-packages folder failed. Trying user folder now') + print('Installing wheel into system site-packages folder failed. Trying user folder now') txt = subprocess.check_output([sys.executable, '-m', 'pip', 'install', '--user', '--force-reinstall', wheel], stderr=subprocess.STDOUT, shell=False) print(txt.decode('UTF-8')) except: From deac9f05b18624455da6c6782072cea01c9cb546 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 08:05:28 -0400 Subject: [PATCH 126/172] move the created wheel to the build folder at the end --- cmake/CMakeLists.txt | 8 +++++--- python/install.py | 32 +++++++++++++++++++++++++++----- src/Makefile | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6af33cd5b3..b0b8bfd363 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -786,14 +786,16 @@ if(BUILD_SHARED_LIBS) find_package(Python COMPONENTS Interpreter) endif() if(BUILD_IS_MULTI_CONFIG) - set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/$/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}/$) else() - set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}) endif() + set(LIBLAMMPS_SHARED_BINARY ${MY_BUILD_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) if(Python_EXECUTABLE) add_custom_target( install-python ${CMAKE_COMMAND} -E remove_directory build - COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps -l ${LIBLAMMPS_SHARED_BINARY} + COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps + -l ${LIBLAMMPS_SHARED_BINARY} -w ${MY_BUILD_DIR} COMMENT "Installing LAMMPS Python module") else() add_custom_target( diff --git a/python/install.py b/python/install.py index 3c4be00779..591e8525dc 100644 --- a/python/install.py +++ b/python/install.py @@ -23,6 +23,8 @@ parser.add_argument("-l", "--lib", required=True, help="path to the compiled LAMMPS shared library") parser.add_argument("-n", "--noinstall", action="store_true", default=False, help="only build a binary wheel. Don't attempt to install it") +parser.add_argument("-w", "--wheeldir", required=False, + help="path to a directory where the created wheel will be stored") args = parser.parse_args() @@ -30,7 +32,7 @@ args = parser.parse_args() if args.package: if not os.path.exists(args.package): - print( "ERROR: LAMMPS package %s does not exist" % args.package) + print("ERROR: LAMMPS package %s does not exist" % args.package) parser.print_help() sys.exit(1) else: @@ -38,12 +40,20 @@ if args.package: if args.lib: if not os.path.exists(args.lib): - print( "ERROR: LAMMPS shared library %s does not exist" % args.lib) + print("ERROR: LAMMPS shared library %s does not exist" % args.lib) parser.print_help() sys.exit(1) else: args.lib = os.path.abspath(args.lib) +if args.wheeldir: + if not os.path.exists(args.wheeldir): + print("ERROR: directory %s to store the wheel does not exist" % args.wheeldir) + parser.print_help() + sys.exit(1) + else: + args.wheeldir = os.path.abspath(args.wheeldir) + # we need to switch to the folder of the python package olddir = os.path.abspath('.') os.chdir(os.path.dirname(args.package)) @@ -80,7 +90,11 @@ os.remove(os.path.join('lammps',os.path.basename(args.lib))) # stop here if we were asked not to install the wheel we created if args.noinstall: - exit(0) + if args.wheeldir: + for wheel in glob.glob('lammps-*.whl'): + shutil.copy(wheel, args.wheeldir) + os.remove(wheel) + exit(0) # install the wheel with pip. first try to install in the default environment. # that will be a virtual environment, if active, or the system folder. @@ -108,6 +122,11 @@ for wheel in glob.glob('lammps-*.whl'): try: txt = subprocess.check_output([py_exe, '-m', 'pip', 'install', '--force-reinstall', wheel], stderr=subprocess.STDOUT, shell=False) print(txt.decode('UTF-8')) + if args.wheeldir: + shutil.copy(wheel, args.wheeldir) + else: + shutil.copy(wheel, olddir) + os.remove(wheel) continue except subprocess.CalledProcessError as err: errmsg = err.output.decode('UTF-8') @@ -117,7 +136,10 @@ for wheel in glob.glob('lammps-*.whl'): print('Installing wheel into system site-packages folder failed. Trying user folder now') txt = subprocess.check_output([sys.executable, '-m', 'pip', 'install', '--user', '--force-reinstall', wheel], stderr=subprocess.STDOUT, shell=False) print(txt.decode('UTF-8')) + if args.wheeldir: + shutil.copy(wheel, args.wheeldir) + else: + shutil.copy(wheel, olddir) + os.remove(wheel) except: sys.exit('Failed to install wheel ' + wheel) - shutil.copy(wheel, olddir) - os.remove(wheel) diff --git a/src/Makefile b/src/Makefile index ab8e5c4fea..649a1ad002 100644 --- a/src/Makefile +++ b/src/Makefile @@ -461,7 +461,7 @@ mpi-stubs: sinclude ../lib/python/Makefile.lammps install-python: @rm -rf ../python/build - @$(PYTHON) ../python/install.py -p ../python/lammps -l ../src/liblammps.so + @$(PYTHON) ../python/install.py -p ../python/lammps -l ../src/liblammps.so -w $(PWD) # Create a tarball of src dir and packages From e201d6e77e9ce45250a1caf5e4a44301cb3ab2a0 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 16 Jun 2022 20:31:06 -0600 Subject: [PATCH 127/172] Delete files --- examples/snap/README.grid | 19 -- examples/snap/econs.py | 16 - examples/snap/fnum.py | 14 - examples/snap/grid.local.py | 121 -------- examples/snap/grid.py | 104 ------- examples/snap/in.fnum | 61 ---- examples/snap/in.grid | 83 ------ examples/snap/in.grid.local | 77 ----- examples/snap/in.grid.pair | 90 ------ examples/snap/in.grid.python | 65 ----- examples/snap/in.grid.python.local | 69 ----- examples/snap/in.grid.test | 105 ------- examples/snap/lammps_utils.py | 26 -- src/ML-SNAP/pair_sna_grid.cpp | 449 ----------------------------- src/ML-SNAP/pair_sna_grid.h | 79 ----- src/pair_grid.cpp | 328 --------------------- src/pair_grid.h | 87 ------ 17 files changed, 1793 deletions(-) delete mode 100644 examples/snap/README.grid delete mode 100644 examples/snap/econs.py delete mode 100644 examples/snap/fnum.py delete mode 100755 examples/snap/grid.local.py delete mode 100755 examples/snap/grid.py delete mode 100644 examples/snap/in.fnum delete mode 100644 examples/snap/in.grid delete mode 100644 examples/snap/in.grid.local delete mode 100644 examples/snap/in.grid.pair delete mode 100644 examples/snap/in.grid.python delete mode 100644 examples/snap/in.grid.python.local delete mode 100644 examples/snap/in.grid.test delete mode 100644 examples/snap/lammps_utils.py delete mode 100644 src/ML-SNAP/pair_sna_grid.cpp delete mode 100644 src/ML-SNAP/pair_sna_grid.h delete mode 100644 src/pair_grid.cpp delete mode 100644 src/pair_grid.h diff --git a/examples/snap/README.grid b/examples/snap/README.grid deleted file mode 100644 index a552ce38ab..0000000000 --- a/examples/snap/README.grid +++ /dev/null @@ -1,19 +0,0 @@ -This branch contains the following examples: - -in.grid # simple example of grid -in.grid.local # simple example of grid/local -in.grid.python # used by grid.py -in.grid.test # stress test of grid and grid/local -in.grid.tri # grid with triclinic cell - -grid.py # access data from Python library interface - -For the LAMMPS public repo, the only examples that will be provided are: - - in.grid.snap # simple test of grid and grid/local - in.grid.tri # same for a triclinic box - log.15Jun22.grid.snap.g++.1 - log.15Jun22.grid.snap.g++.4 - log.15Jun22.grid.tri.g++.1 - log.15Jun22.grid.tri.g++.4 - diff --git a/examples/snap/econs.py b/examples/snap/econs.py deleted file mode 100644 index aece097622..0000000000 --- a/examples/snap/econs.py +++ /dev/null @@ -1,16 +0,0 @@ -import lammps - -infile = "in.grid.pair" -faclist = [0.001,0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5] - -print("# Timestep DeltaE DeltaE/Timestep^2") -for fac in faclist: - cmdlist = ["-screen","none","-var","dtfac", "%g" % fac] - lmp = lammps.lammps(cmdargs = cmdlist) - lmp.file(infile) - dt = lmp.extract_global("dt", lammps.LAMMPS_DOUBLE) - de = lmp.extract_fix("avede", lammps.LMP_STYLE_GLOBAL, lammps.LMP_TYPE_SCALAR) - dedt2 = de/dt**2 - print(f"{dt} {de} {dedt2}") - - diff --git a/examples/snap/fnum.py b/examples/snap/fnum.py deleted file mode 100644 index 1e50e49b09..0000000000 --- a/examples/snap/fnum.py +++ /dev/null @@ -1,14 +0,0 @@ -import lammps - -infile = "in.fnum" - -fdeltalist = [1.0e-2,1.0e-3,1.0e-4,1.0e-5,1.0e-6,1.0e-7,1.0e-8,1.0e-9,1.0e-10] - -print("Fdelta RMSE") -for fdelta in fdeltalist: - cmdlist = ["-screen","none","-var","fdelta",f'{fdelta}'] - lmp = lammps.lammps(cmdargs = cmdlist) - lmp.file(infile) - faverrsq = lmp.extract_compute("faverrsq", lammps.LMP_STYLE_GLOBAL, lammps.LMP_TYPE_SCALAR) - rmse = faverrsq**0.5 - print(f"{fdelta} {rmse}") diff --git a/examples/snap/grid.local.py b/examples/snap/grid.local.py deleted file mode 100755 index 414558b79b..0000000000 --- a/examples/snap/grid.local.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/Users/athomps/miniconda3/bin/python3.7 -# -# An example of SNAP grid from LAMMPS Python interface -# -# https://lammps.sandia.gov/doc/Python_library.html - - -from lammps import lammps, LMP_STYLE_LOCAL, LMP_SIZE_ROWS, LMP_SIZE_COLS, LMP_TYPE_ARRAY -import lammps_utils - -from mpi4py import MPI -comm = MPI.COMM_WORLD -me = comm.Get_rank() -nprocs = comm.Get_size() - -# define command line input variables - -ngridx = 2 -ngridy = 3 -ngridz = nprocs -twojmax = 2 - -lmp_cmdargs = ["-echo","screen"] -lmp_cmdargs = lammps_utils.set_cmdlinevars(lmp_cmdargs, - { - "ngridx":ngridx, - "ngridy":ngridy, - "ngridz":ngridz, - "twojmax":twojmax - } - ) - -# launch LAMMPS instance - -lmp = lammps(cmdargs=lmp_cmdargs) - -# run LAMMPS input script - -lmp.file("in.grid.python.local") - -# get quantities from LAMMPS - -num_atoms = lmp.get_natoms() - -# set things not accessible from LAMMPS - -# first 3 cols are x, y, z, coords - -ncols0 = 3 - -# analytical relation - -ncoeff = (twojmax+2)*(twojmax+3)*(twojmax+4) -ncoeff = ncoeff // 24 # integer division -ncols = ncols0+ncoeff - -# get B_0 at position (0,0,0) in 4 different ways - -# 1. from comute sna/atom - -bptr = lmp.extract_compute("b", 1, 2) # 1 = per-atom data, 2 = array -print("b = ",bptr[0][0]) - -# 2. from compute sna/grid - -bgridptr = lmp.extract_compute("bgrid", 0, 2) # 0 = style global, 2 = type array -print("bgrid = ",bgridptr[0][3]) - -# 3. from Numpy array pointing to sna/atom array - -bptr_np = lammps_utils.extract_compute_np(lmp,"b",1,2,(num_atoms,ncoeff)) -print("b_np = ",bptr_np[0][0]) - -# 4. from Numpy array pointing to sna/grid array - -bgridptr_np = lammps_utils.extract_compute_np(lmp,"bgrid",0,2,(ngridz,ngridy,ngridx,ncols)) -print("bgrid_np = ",bgridptr_np[0][0][0][ncols0+0]) - -# 5. from sna/grid/local array - -bgridlocalnrows = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_SIZE_ROWS) -print("bgridlocal nrows = ",bgridlocalnrows) -bgridlocalncols = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_SIZE_COLS) -print("bgridlocal ncols = ",bgridlocalncols) - -if bgridlocalnrows > 0: - bgridlocalptr = lmp.extract_compute("bgridlocal", LMP_STYLE_LOCAL, LMP_TYPE_ARRAY) - print("bgridlocal = ",bgridlocalptr) - print("bgridlocal[0][0] = ",bgridlocalptr[5][10]) - -# print out the LAMMPS array to a file - -outfile = open("bgrid.dat",'w') -igrid = 0 -for iz in range(ngridz): - for iy in range(ngridy): - for ix in range(ngridx): - outfile.write("x, y, z = %g %g %g\n" % - (bgridptr[igrid][0], - bgridptr[igrid][1], - bgridptr[igrid][2])) - for icoeff in range(ncoeff): - outfile.write("%g " % bgridptr[igrid][ncols0+icoeff]) - outfile.write("\n") - igrid += 1 -outfile.close() - -# print out the Numpy array to a file - -outfile = open("bgrid_np.dat",'w') -for iz in range(ngridz): - for iy in range(ngridy): - for ix in range(ngridx): - outfile.write("x, y, z = %g %g %g\n" % - (bgridptr_np[iz][iy][ix][0], - bgridptr_np[iz][iy][ix][1], - bgridptr_np[iz][iy][ix][2])) - for icoeff in range(ncoeff): - outfile.write("%g " % bgridptr_np[iz][iy][ix][ncols0+icoeff]) - outfile.write("\n") -outfile.close() diff --git a/examples/snap/grid.py b/examples/snap/grid.py deleted file mode 100755 index 9fe88fd1b4..0000000000 --- a/examples/snap/grid.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/Users/athomps/miniconda3/bin/python3.7 -# -# An example of SNAP grid from LAMMPS Python interface -# -# https://lammps.sandia.gov/doc/Python_library.html - - -from lammps import lammps -import lammps_utils - -# define command line input variables - -ngridx = 2 -ngridy = 3 -ngridz = 4 -twojmax = 2 - -lmp_cmdargs = ["-echo","screen"] -lmp_cmdargs = lammps_utils.set_cmdlinevars(lmp_cmdargs, - { - "ngridx":ngridx, - "ngridy":ngridy, - "ngridz":ngridz, - "twojmax":twojmax - } - ) - -# launch LAMMPS instance - -lmp = lammps(cmdargs=lmp_cmdargs) - -# run LAMMPS input script - -lmp.file("in.grid.python") - -# get quantities from LAMMPS - -num_atoms = lmp.get_natoms() - -# set things not accessible from LAMMPS - -# first 3 cols are x, y, z, coords - -ncols0 = 3 - -# analytical relation - -ncoeff = (twojmax+2)*(twojmax+3)*(twojmax+4) -ncoeff = ncoeff // 24 # integer division -ncols = ncols0+ncoeff - -# get B_0 at position (0,0,0) in 4 different ways - -# 1. from comute sna/atom - -bptr = lmp.extract_compute("b", 1, 2) # 1 = per-atom data, 2 = array -print("b = ",bptr[0][0]) - -# 2. from compute sna/grid - -bgridptr = lmp.extract_compute("bgrid", 0, 2) # 0 = style global, 2 = type array -print("bgrid = ",bgridptr[0][3]) - -# 3. from Numpy array pointing to sna/atom array - -bptr_np = lammps_utils.extract_compute_np(lmp,"b",1,2,(num_atoms,ncoeff)) -print("b_np = ",bptr_np[0][0]) - -# 4. from Numpy array pointing to sna/grid array - -bgridptr_np = lammps_utils.extract_compute_np(lmp,"bgrid",0,2,(ngridz,ngridy,ngridx,ncols)) -print("bgrid_np = ",bgridptr_np[0][0][0][ncols0+0]) - -# print out the LAMMPS array to a file - -outfile = open("bgrid.dat",'w') -igrid = 0 -for iz in range(ngridz): - for iy in range(ngridy): - for ix in range(ngridx): - outfile.write("x, y, z = %g %g %g\n" % - (bgridptr[igrid][0], - bgridptr[igrid][1], - bgridptr[igrid][2])) - for icoeff in range(ncoeff): - outfile.write("%g " % bgridptr[igrid][ncols0+icoeff]) - outfile.write("\n") - igrid += 1 -outfile.close() - -# print out the Numpy array to a file - -outfile = open("bgrid_np.dat",'w') -for iz in range(ngridz): - for iy in range(ngridy): - for ix in range(ngridx): - outfile.write("x, y, z = %g %g %g\n" % - (bgridptr_np[iz][iy][ix][0], - bgridptr_np[iz][iy][ix][1], - bgridptr_np[iz][iy][ix][2])) - for icoeff in range(ncoeff): - outfile.write("%g " % bgridptr_np[iz][iy][ix][ncols0+icoeff]) - outfile.write("\n") -outfile.close() diff --git a/examples/snap/in.fnum b/examples/snap/in.fnum deleted file mode 100644 index 1298e9aed9..0000000000 --- a/examples/snap/in.fnum +++ /dev/null @@ -1,61 +0,0 @@ -# Demonstrate pair style base on sna/grid -# Check numerical forces - -variable nrep index 3 -variable a index 3.0 -variable ngrid index 2 -variable del index 0.1 -variable fdelta index 0.0001 - -units metal - -atom_modify map yes - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom $a & - a1 1 0 0 & - a2 0 1 0 & - a3 0 0 1 & - basis 0 0 0 & - basis 0.5 0.5 0.5 & -# origin 0.25 0.25 0.25 -# origin 0.25e-3 0.25e-3 0.25e-3 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box -mass 1 180.88 -displace_atoms all random ${del} ${del} ${del} 12345 - -# define grid compute and atom compute - -group snapgroup type 1 -variable twojmax equal 2 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} -pair_coeff * * Al - -fix fnum all numdiff 1 ${fdelta} -variable ferrsq atom (fx-f_fnum[1])^2+(fy-f_fnum[2])^2+(fz-f_fnum[3])^2 -compute faverrsq all reduce ave v_ferrsq -thermo_style custom c_faverrsq - -run 0 diff --git a/examples/snap/in.grid b/examples/snap/in.grid deleted file mode 100644 index 44c42673e0..0000000000 --- a/examples/snap/in.grid +++ /dev/null @@ -1,83 +0,0 @@ -# Demonstrate bispectrum computes - -# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should -# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273 - -# Initialize simulation - -variable nsteps index 0 -variable nrep index 1 -variable a index 3.316 -variable ngrid index 2 - -units metal - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom $a & - a1 1 0 0 & - a2 0 1 0 & - a3 0 0 1 & - basis 0 0 0 & - basis 0.5 0.5 0.5 & -# origin 0.25 0.25 0.25 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box - -mass 1 180.88 - -# choose potential - -include Ta06A.snap - -# define grid compute and atom compute - -group snapgroup type 1 -variable twojmax equal 2 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -compute b all sna/atom & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -# define output - -# mygrid is ngrid by (3+nbis) = 8x8 -thermo_style custom step temp ke pe vol & - c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] & - c_mygrid[1][2] c_mygrid[2][2] c_mygrid[3][2] c_mygrid[4][2] c_mygrid[5][2] c_mygrid[6][2] c_mygrid[7][2] c_mygrid[8][2] & - c_mygrid[1][3] c_mygrid[2][3] c_mygrid[3][3] c_mygrid[4][3] c_mygrid[5][3] c_mygrid[6][3] c_mygrid[7][3] c_mygrid[8][3] & - c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] & - c_mygrid[1][5] c_mygrid[2][5] c_mygrid[3][5] c_mygrid[4][5] c_mygrid[5][5] c_mygrid[6][5] c_mygrid[7][5] c_mygrid[8][5] & - c_mygrid[1][6] c_mygrid[2][6] c_mygrid[3][6] c_mygrid[4][6] c_mygrid[5][6] c_mygrid[6][6] c_mygrid[7][6] c_mygrid[8][6] & - c_mygrid[1][7] c_mygrid[2][7] c_mygrid[3][7] c_mygrid[4][7] c_mygrid[5][7] c_mygrid[6][7] c_mygrid[7][7] c_mygrid[8][7] & - c_mygrid[1][8] c_mygrid[2][8] c_mygrid[3][8] c_mygrid[4][8] c_mygrid[5][8] c_mygrid[6][8] c_mygrid[7][8] c_mygrid[8][8] -thermo_modify norm yes - -dump mydump_b all custom 1000 dump_b id c_b[*] - -# run - -run 0 - diff --git a/examples/snap/in.grid.local b/examples/snap/in.grid.local deleted file mode 100644 index 121f0ba981..0000000000 --- a/examples/snap/in.grid.local +++ /dev/null @@ -1,77 +0,0 @@ -# Demonstrate bispectrum computes with local grid - -# Initialize simulation - -variable nsteps index 0 -variable nrep index 1 -variable a index 3.316 -variable ngrid index 2 - -units metal - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom $a & - a1 1 0 0 & - a2 0 1 0 & - a3 0 0 1 & - basis 0 0 0 & - basis 0.5 0.5 0.5 & -# origin 0.25 0.25 0.25 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box - -mass 1 180.88 - -# choose potential - -include Ta06A.snap - -# define grid compute and atom compute - -group snapgroup type 1 -variable twojmax equal 2 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -compute b all sna/atom & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -# define output - -# mygrid is ngrid by (3+nbis) = 8x8 -thermo_style custom step temp ke pe vol -thermo_modify norm yes - -dump mydump_b all custom 1000 dump_b id c_b[*] -dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_mygridlocal[*] - -# run - -run 0 - -run 0 - -run 0 - diff --git a/examples/snap/in.grid.pair b/examples/snap/in.grid.pair deleted file mode 100644 index 128da2ad7a..0000000000 --- a/examples/snap/in.grid.pair +++ /dev/null @@ -1,90 +0,0 @@ -# Demonstrate pair style base on sna/grid -# Test energy conservation -# Choose dtfac in the range [0.01,Infinity] -# Large dtfac means small timestep, while -# keeping trajectory output interval fixed -# Variable etotdelta measures change in (PE+KE)/natoms - -# Initialize simulation - -variable dtfac index 1 -variable dt equal 0.5e-3/${dtfac} -variable nthermo equal 1000*${dtfac} -variable nsteps equal 1000*${dtfac} -variable nrep index 3 -variable a index 3.0 -variable ngrid index 2 -variable t index 300 -variable del index 0.1 - -units metal - -atom_modify map yes - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom $a & - a1 1 0 0 & - a2 0 1 0 & - a3 0 0 1 & - basis 0 0 0 & - basis 0.5 0.5 0.5 & -# origin 0.25 0.25 0.25 -# origin 0.25e-3 0.25e-3 0.25e-3 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box -mass 1 180.88 -displace_atoms all random ${del} ${del} ${del} 12345 -velocity all create $t 4928459 loop geom - -write_dump all custom test.dump id type x y z - -# define grid compute and atom compute - -group snapgroup type 1 -variable twojmax equal 2 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} -pair_coeff * * Al - -thermo ${nthermo} -thermo_modify norm yes - -run 0 -variable etot0 equal etotal -variable etotdelta equal abs(etotal-${etot0})/atoms -fix avede all ave/time 1 ${nthermo} ${nthermo} v_etotdelta - -thermo_style custom step temp epair ke etotal press v_etotdelta f_avede -thermo ${nthermo} -thermo_modify norm yes - -# Set up NVE run - -timestep ${dt} -neighbor 1.0 bin -neigh_modify once no every 1 delay 0 check yes - -# Run MD - -fix mynve all nve -run ${nsteps} diff --git a/examples/snap/in.grid.python b/examples/snap/in.grid.python deleted file mode 100644 index e04415d558..0000000000 --- a/examples/snap/in.grid.python +++ /dev/null @@ -1,65 +0,0 @@ -# Demonstrate bispectrum per-atom and grid computes - -# Invoked from grid.py -# pass in values for ngridx, ngridy, ngridz, twojmax - -# Initialize simulation - -variable nsteps equal 0 -variable nrep equal 1 -variable a equal 3.316 - -units metal - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom ${a} a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box - -mass 1 180.88 - -# define grid compute and atom compute - -group snapgroup type 1 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -compute b all sna/atom ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} - -compute bgrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} - -compute bgridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} - -# create dummy potential for neighbor list - -variable rcutneigh equal 2.0*${rcutfac}*${radelem} -pair_style zero ${rcutneigh} -pair_coeff * * - -# define output - -thermo_style custom step temp ke pe vol c_bgrid[1][1] -thermo_modify norm yes - -dump mydump_b all custom 1000 dump_b id c_b[*] - -dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_bgridlocal[1] - -# run - -run 0 diff --git a/examples/snap/in.grid.python.local b/examples/snap/in.grid.python.local deleted file mode 100644 index af95696a2b..0000000000 --- a/examples/snap/in.grid.python.local +++ /dev/null @@ -1,69 +0,0 @@ -# Demonstrate bispectrum per-atom and grid computes - -# Invoked from grid.py -# pass in values for ngridx, ngridy, ngridz, twojmax - -# Initialize simulation - -variable nsteps equal 0 -variable nrep equal 1 -variable a equal 3.316 - -units metal - -# make processor grid equal to nz - -processors 1 1 ${ngridz} - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom ${a} a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box - -mass 1 180.88 - -# define grid compute and atom compute - -group snapgroup type 1 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -compute b all sna/atom ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} - -compute bgrid all sna/grid grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} - -compute bgridlocal all sna/grid/local grid ${ngridx} ${ngridy} ${ngridz} ${rcutfac} ${rfac0} ${twojmax} ${radelem} ${wj} rmin0 ${rmin0} bzeroflag ${bzero} quadraticflag ${quad} switchflag ${switch} - -# create dummy potential for neighbor list - -variable rcutneigh equal 2.0*${rcutfac}*${radelem} -pair_style zero ${rcutneigh} -pair_coeff * * - -# define output - -thermo_style custom step temp ke pe vol c_bgrid[1][1] -thermo_modify norm yes - -dump mydump_b all custom 1000 dump_b id c_b[*] - -dump mydump_bgridlocal all local 1000 dump_bgridlocal index c_bgridlocal[*] - -# run - -run 0 diff --git a/examples/snap/in.grid.test b/examples/snap/in.grid.test deleted file mode 100644 index c684200d44..0000000000 --- a/examples/snap/in.grid.test +++ /dev/null @@ -1,105 +0,0 @@ -# Demonstrate bispectrum computes - -# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should -# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273 - -# Initialize simulation - -variable nsteps index 0 -variable nrep index 3 -variable a index 3.316 -variable ngrid index 2 - -units metal - -atom_modify map yes - -# generate the box and atom positions using a BCC lattice - -variable nx equal ${nrep} -variable ny equal ${nrep} -variable nz equal ${nrep} - -boundary p p p - -lattice custom $a & - a1 1 0 0 & - a2 0 1 0 & - a3 0 0 1 & - basis 0 0 0 & - basis 0.5 0.5 0.5 & -# origin 0.25 0.25 0.25 -# origin 0.25e-3 0.25e-3 0.25e-3 - -region box block 0 ${nx} 0 ${ny} 0 ${nz} -create_box 1 box -create_atoms 1 box - -mass 1 180.88 - -write_dump all custom test.dump id type x y z - -# choose potential - -include Ta06A.snap - -# define grid compute and atom compute - -group snapgroup type 1 -variable twojmax equal 2 -variable rcutfac equal 4.67637 -variable rfac0 equal 0.99363 -variable rmin0 equal 0 -variable wj equal 1 -variable radelem equal 0.5 -variable bzero equal 0 -variable quad equal 0 -variable switch equal 1 - -compute b all sna/atom & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -compute mygrid all sna/grid grid ${ngrid} ${ngrid} ${ngrid} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -compute mygridlocal all sna/grid/local grid ${ngrid} ${ngrid} ${ngrid} & - ${rcutfac} ${rfac0} ${twojmax} ${radelem} & - ${wj} rmin0 ${rmin0} bzeroflag ${bzero} & - quadraticflag ${quad} switchflag ${switch} - -# define output - -# mygrid is ngrid by (3+nbis) = 8x8 -thermo_style custom step temp ke pe vol & - c_mygrid[1][1] c_mygrid[2][1] c_mygrid[3][1] c_mygrid[4][1] c_mygrid[5][1] c_mygrid[6][1] c_mygrid[7][1] c_mygrid[8][1] & - c_mygrid[1][2] c_mygrid[2][2] c_mygrid[3][2] c_mygrid[4][2] c_mygrid[5][2] c_mygrid[6][2] c_mygrid[7][2] c_mygrid[8][2] & - c_mygrid[1][3] c_mygrid[2][3] c_mygrid[3][3] c_mygrid[4][3] c_mygrid[5][3] c_mygrid[6][3] c_mygrid[7][3] c_mygrid[8][3] & - c_mygrid[1][4] c_mygrid[2][4] c_mygrid[3][4] c_mygrid[4][4] c_mygrid[5][4] c_mygrid[6][4] c_mygrid[7][4] c_mygrid[8][4] & - c_mygrid[1][5] c_mygrid[2][5] c_mygrid[3][5] c_mygrid[4][5] c_mygrid[5][5] c_mygrid[6][5] c_mygrid[7][5] c_mygrid[8][5] & - c_mygrid[1][6] c_mygrid[2][6] c_mygrid[3][6] c_mygrid[4][6] c_mygrid[5][6] c_mygrid[6][6] c_mygrid[7][6] c_mygrid[8][6] & - c_mygrid[1][7] c_mygrid[2][7] c_mygrid[3][7] c_mygrid[4][7] c_mygrid[5][7] c_mygrid[6][7] c_mygrid[7][7] c_mygrid[8][7] & - c_mygrid[1][8] c_mygrid[2][8] c_mygrid[3][8] c_mygrid[4][8] c_mygrid[5][8] c_mygrid[6][8] c_mygrid[7][8] c_mygrid[8][8] -thermo_modify norm yes - -#dump mydump_b all custom 1 dump_b id c_b[*] -dump mydump_bgridlocal all local 1 dump_bgridlocal index c_mygridlocal[*] - -# run - -run 1 - -# rcb - -comm_style tiled -balance 0.99 rcb -run 1 - -# rcb again - -balance 0.99 rcb -run 1 - diff --git a/examples/snap/lammps_utils.py b/examples/snap/lammps_utils.py deleted file mode 100644 index ea74459a74..0000000000 --- a/examples/snap/lammps_utils.py +++ /dev/null @@ -1,26 +0,0 @@ -import numpy as np -import ctypes - -def set_cmdlinevars(cmdargs, argdict): - for key in argdict.keys(): - cmdargs += ["-var",key,f"{argdict[key]}"] - return cmdargs - -def extract_commands(string): - return [x for x in string.splitlines() if x.strip() != ''] - -def extract_compute_np(lmp,name,compute_type,result_type,array_shape): - """ - Convert a lammps compute to a numpy array. - Assumes the compute returns a floating point numbers. - Note that the result is a view into the original memory. - If the result type is 0 (scalar) then conversion to numpy is skipped and a python float is returned. - """ - ptr = lmp.extract_compute(name, compute_type, result_type) # 1,2: Style (1) is per-atom compute, returns array type (2). - if result_type == 0: return ptr # No casting needed, lammps.py already works - if result_type == 2: ptr = ptr.contents - total_size = np.prod(array_shape) - buffer_ptr = ctypes.cast(ptr, ctypes.POINTER(ctypes.c_double * total_size)) - array_np = np.frombuffer(buffer_ptr.contents, dtype=float) - array_np.shape = array_shape - return array_np diff --git a/src/ML-SNAP/pair_sna_grid.cpp b/src/ML-SNAP/pair_sna_grid.cpp deleted file mode 100644 index ffb4dfa033..0000000000 --- a/src/ML-SNAP/pair_sna_grid.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "pair_grid.h" -#include "pair_sna_grid.h" -#include "sna.h" -#include "atom.h" -#include "update.h" -#include "modify.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" -#include "pair.h" -#include "domain.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "tokenizer.h" - -#include -#include - -using namespace LAMMPS_NS; - -PairSNAGrid::PairSNAGrid(LAMMPS *lmp) : - PairGrid(lmp), - radelem(nullptr), wjelem(nullptr) -{ - snaptr = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -PairSNAGrid::~PairSNAGrid() -{ - memory->destroy(radelem); - memory->destroy(wjelem); - memory->destroy(cutsq); - delete snaptr; - - if (chemflag) memory->destroy(map); -} - -/* ---------------------------------------------------------------------- */ - -void PairSNAGrid::init_style() -{ - if (force->newton_pair == 0) - error->all(FLERR,"Pair style sna/grid requires newton pair on"); - - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); - ncoeff = snaptr->ncoeff; - ndesc = ndesc_base + ncoeff; - snaptr->init(); - -} - -/* ---------------------------------------------------------------------- */ - -void PairSNAGrid::init_list(int /*id*/, NeighList *ptr) -{ - list = ptr; -} - -/* ---------------------------------------------------------------------- */ - -void PairSNAGrid::compute(int eflag, int vflag) -{ - double fij[3]; - - ev_init(eflag,vflag); - - // compute sna for each gridpoint - - double** const x = atom->x; - double **f = atom->f; - const int* const mask = atom->mask; - int * const type = atom->type; - const int ntotal = atom->nlocal + atom->nghost; - - // insure rij, inside, and typej are of size ntotal - - snaptr->grow_rij(ntotal); - - // first generate fingerprint, - // which allows calculation of beta - - for (int iz = nzlo; iz <= nzhi; iz++) - for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { - double xgrid[3]; - grid2x(ix, iy, iz, xgrid); - const double xtmp = xgrid[0]; - const double ytmp = xgrid[1]; - const double ztmp = xgrid[2]; - - // currently, all grid points are type 1 - - const int itype = 1; - int ielem = 0; - if (chemflag) - ielem = map[itype]; - const double radi = radelem[itype]; - - // rij[][3] = displacements between atom I and those neighbors - // inside = indices of neighbors of I within cutoff - // typej = types of neighbors of I within cutoff - - int ninside = 0; - for (int j = 0; j < ntotal; j++) { - - const double delx = xtmp - x[j][0]; - const double dely = ytmp - x[j][1]; - const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; - int jtype = type[j]; - int jelem = 0; - if (chemflag) - jelem = map[jtype]; - if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { - snaptr->rij[ninside][0] = delx; - snaptr->rij[ninside][1] = dely; - snaptr->rij[ninside][2] = delz; - snaptr->inside[ninside] = j; - snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - snaptr->element[ninside] = jelem; // element index for multi-element snap - ninside++; - } - } - - snaptr->compute_ui(ninside, ielem); - snaptr->compute_zi(); - snaptr->compute_bi(ielem); - - // linear contributions - - for (int icoeff = 0; icoeff < ncoeff; icoeff++) - gridlocal[ndesc_base+icoeff][iz][iy][ix] = - snaptr->blist[icoeff]; - - // quadratic contributions - // untested - - if (quadraticflag) { - int ncount = ncoeff; - for (int icoeff = 0; icoeff < ncoeff; icoeff++) { - double bveci = snaptr->blist[icoeff]; - gridlocal[ndesc_base+ncount++][iz][iy][ix] = - 0.5*bveci*bveci; - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[ndesc_base+ncount++][iz][iy][ix] = - bveci*snaptr->blist[jcoeff]; - } - } - } - - // this is a proxy for a call to the energy model - // beta is dE/dB^i, the derivative of the total - // energy w.r.t. to descriptors of grid point i - - compute_beta(); - - // second compute forces using beta - - int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) - for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { - double xgrid[3]; - grid2x(ix, iy, iz, xgrid); - const double xtmp = xgrid[0]; - const double ytmp = xgrid[1]; - const double ztmp = xgrid[2]; - - // currently, all grid points are type 1 - - const int itype = 1; - int ielem = 0; - if (chemflag) - ielem = map[itype]; - const double radi = radelem[itype]; - - // rij[][3] = displacements between atom I and those neighbors - // inside = indices of neighbors of I within cutoff - // typej = types of neighbors of I within cutoff - - int ninside = 0; - for (int j = 0; j < ntotal; j++) { - - const double delx = xtmp - x[j][0]; - const double dely = ytmp - x[j][1]; - const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; - int jtype = type[j]; - int jelem = 0; - jelem = map[jtype]; - - if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { - snaptr->rij[ninside][0] = delx; - snaptr->rij[ninside][1] = dely; - snaptr->rij[ninside][2] = delz; - snaptr->inside[ninside] = j; - snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - if (switchinnerflag) { - snaptr->sinnerij[ninside] = 0.5*(sinnerelem[ielem]+sinnerelem[jelem]); - snaptr->dinnerij[ninside] = 0.5*(dinnerelem[ielem]+dinnerelem[jelem]); - } - if (chemflag) snaptr->element[ninside] = jelem; - ninside++; - } - } - - // compute Ui, Yi for atom I - - if (chemflag) - snaptr->compute_ui(ninside, ielem); - else - snaptr->compute_ui(ninside, 0); - - // for neighbors of I within cutoff: - // compute Fij = dEi/dRj = -dEi/dRi - // add to Fi, subtract from Fj - // scaling is that for type I - - snaptr->compute_yi(beta[igrid]); - - for (int jj = 0; jj < ninside; jj++) { - int j = snaptr->inside[jj]; - snaptr->compute_duidrj(jj); - - snaptr->compute_deidrj(fij); - - f[j][0] += fij[0]; - f[j][1] += fij[1]; - f[j][2] += fij[2]; - - // tally per-atom virial contribution - - if (vflag) - ev_tally_xyz(-1,j,atom->nlocal,force->newton_pair,0.0,0.0, - fij[0],fij[1],fij[2], - -snaptr->rij[jj][0],-snaptr->rij[jj][1], - -snaptr->rij[jj][2]); - } - - // tally energy contribution - - if (eflag) { - - // get descriptors again - - snaptr->compute_zi(); - snaptr->compute_bi(ielem); - - // evdwl = energy of atom I, sum over coeffs_k * Bi_k - - double evdwl = 0.0; - - // E = beta.B - - for (int icoeff = 0; icoeff < ncoeff; icoeff++) - evdwl += beta[igrid][icoeff]*snaptr->blist[icoeff]; - - ev_tally_full(-1,2.0*evdwl,0.0,0.0,0.0,0.0,0.0); - - } - igrid++; - } - - if (vflag_fdotr) virial_fdotr_compute(); - -} - - -/* ---------------------------------------------------------------------- - global settings -------------------------------------------------------------------------- */ - -void PairSNAGrid::settings(int narg, char ** arg) -{ - - // call base class first - - PairGrid::settings(narg, arg); - - // skip over arguments used by base class - // so that argument positions are identical to - // regular per-atom compute - - arg += nargbase; - narg -= nargbase; - - int ntypes = atom->ntypes; - int nargmin = 3+2*ntypes; - - if (narg < nargmin) error->all(FLERR,"Illegal pair sna/grid command"); - - // default values - - rmin0 = 0.0; - switchflag = 1; - bzeroflag = 1; - quadraticflag = 0; - chemflag = 0; - bnormflag = 0; - wselfallflag = 0; - switchinnerflag = 0; - nelements = 1; - - // process required arguments - - memory->create(radelem,ntypes+1,"pair:sna/grid:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"pair:sna/grid:wjelem"); - - rcutfac = atof(arg[0]); - rfac0 = atof(arg[1]); - twojmax = atoi(arg[2]); - - for(int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[3+i]); - for(int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[3+ntypes+i]); - - // construct cutsq - - double cut; - cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"pair:sna/grid:cutsq"); - for(int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; - if (cut > cutmax) cutmax = cut; - cutsq[i][i] = cut*cut; - for(int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; - } - } - - // set local input checks - - int sinnerflag = 0; - int dinnerflag = 0; - - // process optional args - - int iarg = nargmin; - - while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - rmin0 = atof(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - switchflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - bzeroflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - quadraticflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - chemflag = 1; - memory->create(map,ntypes+1,"pair:sna/grid:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal pair sna/grid command"); - map[i+1] = jelem; - } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - bnormflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - wselfallflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - switchinnerflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { - iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); - for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); - sinnerflag = 1; - iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { - iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal pair sna/grid command"); - memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); - for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); - dinnerflag = 1; - iarg += ntypes; - } else error->all(FLERR,"Illegal pair sna/grid command"); - - } - -} - -/* ---------------------------------------------------------------------- - memory usage -------------------------------------------------------------------------- */ - -double PairSNAGrid::memory_usage() -{ - double nbytes = snaptr->memory_usage(); // SNA object - int n = atom->ntypes+1; - nbytes += (double)n*sizeof(int); // map - - return nbytes; -} - diff --git a/src/ML-SNAP/pair_sna_grid.h b/src/ML-SNAP/pair_sna_grid.h deleted file mode 100644 index 653bb9d1c1..0000000000 --- a/src/ML-SNAP/pair_sna_grid.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef PAIR_CLASS -// clang-format off -PairStyle(sna/grid, PairSNAGrid); -// clang-format on -#else - -#ifndef LMP_PAIR_SNA_GRID_H -#define LMP_PAIR_SNA_GRID_H - -#include "pair_grid.h" - -namespace LAMMPS_NS { - -class PairSNAGrid : public PairGrid { - public: - PairSNAGrid(class LAMMPS *); - ~PairSNAGrid(); - - void init_style(); - void init_list(int, class NeighList *); - void settings(int, char **); - void compute(int, int); - double memory_usage(); - - private: - int ncoeff; - class NeighList *list; - double rcutfac; - double *radelem; - double *wjelem; - class SNA *snaptr; - int quadraticflag; - int twojmax, switchflag, bzeroflag, bnormflag; - int chemflag, wselfallflag; - int switchinnerflag; - double *sinnerelem; - double *dinnerelem; - double rfac0, rmin0; -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -E: Compute sna/grid/local requires a pair style be defined - -Self-explanatory. - -E: Compute sna/grid/local cutoff is longer than pairwise cutoff - -Self-explanatory. - -W: More than one compute sna/grid/local - -Self-explanatory. - -*/ diff --git a/src/pair_grid.cpp b/src/pair_grid.cpp deleted file mode 100644 index 1f17553055..0000000000 --- a/src/pair_grid.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#include "pair_grid.h" -#include -#include -#include "atom.h" -#include "update.h" -#include "modify.h" -#include "domain.h" -#include "force.h" -#include "memory.h" -#include "error.h" -#include "comm.h" - -#define BETA_CONST 1.0e-2 - -using namespace LAMMPS_NS; - -/* ---------------------------------------------------------------------- */ - -PairGrid::PairGrid(LAMMPS *lmp) : - Pair(lmp), gridlocal(nullptr), alocal(nullptr), beta(nullptr) -{ - single_enable = 0; - restartinfo = 0; - one_coeff = 1; - manybody_flag = 1; - centroidstressflag = CENTROID_NOTAVAIL; - - ndesc = 0; - ngridlocal = 0; - - ndesc_base = 6; - gridlocal_allocated = 0; - beta_max = 0; - beta = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -PairGrid::~PairGrid() -{ - if (copymode) return; - deallocate_grid(); -} - -/* ---------------------------------------------------------------------- */ - -void PairGrid::setup() -{ - deallocate_grid(); - set_grid_global(); - set_grid_local(); - allocate_grid(); - assign_coords(); -} - -/* ---------------------------------------------------------------------- - convert global array indexes to box coords -------------------------------------------------------------------------- */ - -void PairGrid::grid2x(int ix, int iy, int iz, double *x) -{ - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; - - if (triclinic) domain->lamda2x(x, x); -} - -/* ---------------------------------------------------------------------- - create arrays -------------------------------------------------------------------------- */ - -void PairGrid::allocate_grid() -{ - if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { - gridlocal_allocated = 1; - memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi, - nxlo,nxhi,"pair/grid:gridlocal"); - memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal"); - memory->create(beta, ngridlocal, ndesc-ndesc_base, "pair/grid:beta"); - } -} - -/* ---------------------------------------------------------------------- - free arrays -------------------------------------------------------------------------- */ - -void PairGrid::deallocate_grid() -{ - if (gridlocal_allocated) { - gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); - memory->destroy(alocal); - memory->destroy(beta); - } -} - -/* ---------------------------------------------------------------------- - set global grid -------------------------------------------------------------------------- */ - -void PairGrid::set_grid_global() -{ - // calculate grid layout - - triclinic = domain->triclinic; - - if (triclinic == 0) { - prd = domain->prd; - boxlo = domain->boxlo; - sublo = domain->sublo; - subhi = domain->subhi; - } else { - prd = domain->prd_lamda; - boxlo = domain->boxlo_lamda; - sublo = domain->sublo_lamda; - subhi = domain->subhi_lamda; - } - - double xprd = prd[0]; - double yprd = prd[1]; - double zprd = prd[2]; - - delxinv = nx/xprd; - delyinv = ny/yprd; - delzinv = nz/zprd; - - delx = 1.0/delxinv; - dely = 1.0/delyinv; - delz = 1.0/delzinv; -} - -/* ---------------------------------------------------------------------- - set local subset of grid that I own - n xyz lo/hi = 3d brick that I own (inclusive) -------------------------------------------------------------------------- */ - -void PairGrid::set_grid_local() -{ - // nx,ny,nz = extent of global grid - // indices into the global grid range from 0 to N-1 in each dim - // if grid point is inside my sub-domain I own it, - // this includes sub-domain lo boundary but excludes hi boundary - // ixyz lo/hi = inclusive lo/hi bounds of global grid sub-brick I own - // if proc owns no grid cells in a dim, then ilo > ihi - // if 2 procs share a boundary a grid point is exactly on, - // the 2 equality if tests insure a consistent decision - // as to which proc owns it - - double xfraclo,xfrachi,yfraclo,yfrachi,zfraclo,zfrachi; - - if (comm->layout != Comm::LAYOUT_TILED) { - xfraclo = comm->xsplit[comm->myloc[0]]; - xfrachi = comm->xsplit[comm->myloc[0]+1]; - yfraclo = comm->ysplit[comm->myloc[1]]; - yfrachi = comm->ysplit[comm->myloc[1]+1]; - zfraclo = comm->zsplit[comm->myloc[2]]; - zfrachi = comm->zsplit[comm->myloc[2]+1]; - } else { - xfraclo = comm->mysplit[0][0]; - xfrachi = comm->mysplit[0][1]; - yfraclo = comm->mysplit[1][0]; - yfrachi = comm->mysplit[1][1]; - zfraclo = comm->mysplit[2][0]; - zfrachi = comm->mysplit[2][1]; - } - - nxlo = static_cast (xfraclo * nx); - if (1.0*nxlo != xfraclo*nx) nxlo++; - nxhi = static_cast (xfrachi * nx); - if (1.0*nxhi == xfrachi*nx) nxhi--; - - nylo = static_cast (yfraclo * ny); - if (1.0*nylo != yfraclo*ny) nylo++; - nyhi = static_cast (yfrachi * ny); - if (1.0*nyhi == yfrachi*ny) nyhi--; - - nzlo = static_cast (zfraclo * nz); - if (1.0*nzlo != zfraclo*nz) nzlo++; - nzhi = static_cast (zfrachi * nz); - if (1.0*nzhi == zfrachi*nz) nzhi--; - - ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); -} - -/* ---------------------------------------------------------------------- - copy coords to local array -------------------------------------------------------------------------- */ - -void PairGrid::assign_coords() -{ - int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) - for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { - alocal[igrid][0] = ix; - alocal[igrid][1] = iy; - alocal[igrid][2] = iz; - double xgrid[3]; - grid2x(ix, iy, iz, xgrid); - alocal[igrid][3] = xgrid[0]; - alocal[igrid][4] = xgrid[1]; - alocal[igrid][5] = xgrid[2]; - igrid++; - } -} - -/* ---------------------------------------------------------------------- - copy the 4d gridlocal array values to the 2d local array -------------------------------------------------------------------------- */ - -void PairGrid::copy_gridlocal_to_local_array() -{ - int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) - for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { - for (int icol = ndesc_base; icol < ndesc; icol++) - alocal[igrid][icol] = gridlocal[icol][iz][iy][ix]; - igrid++; - } -} - -/* ---------------------------------------------------------------------- - calculate beta -------------------------------------------------------------------------- */ - - // this is a proxy for a call to the energy model - // beta is dE/dB^i, the derivative of the total - // energy w.r.t. to descriptors of grid point i - -void PairGrid::compute_beta() -{ - int igrid = 0; - for (int iz = nzlo; iz <= nzhi; iz++) - for (int iy = nylo; iy <= nyhi; iy++) - for (int ix = nxlo; ix <= nxhi; ix++) { - for (int icol = 0; icol < ndesc-ndesc_base; icol++) - beta[igrid][icol] = BETA_CONST; - igrid++; - } -} - -/* ---------------------------------------------------------------------- - allocate all arrays -------------------------------------------------------------------------- */ - -void PairGrid::allocate() -{ - allocated = 1; - int n = atom->ntypes; - memory->create(setflag,n+1,n+1,"pair:setflag"); - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - setflag[i][j] = 0; - - memory->create(cutsq,n+1,n+1,"pair:cutsq"); - map = new int[n+1]; -} - -/* ---------------------------------------------------------------------- - global settings -------------------------------------------------------------------------- */ - -void PairGrid::settings(int narg, char ** arg) -{ - if (narg < 4) error->all(FLERR,"Illegal pair style command"); - int iarg0 = 0; - int iarg = iarg0; - if (strcmp(arg[iarg],"grid") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal pair grid command"); - nx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - ny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); - nz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); - if (nx <= 0 || ny <= 0 || nz <= 0) - error->all(FLERR,"All grid/local dimensions must be positive"); - iarg += 4; - } else error->all(FLERR,"Illegal pair grid command"); - nargbase = iarg - iarg0; -} - -/* ---------------------------------------------------------------------- - set coeffs for one or more type pairs -------------------------------------------------------------------------- */ - -void PairGrid::coeff(int narg, char **arg) -{ - if (!allocated) allocate(); - if (narg < 2) error->all(FLERR,"Incorrect args for pair coefficients"); - // if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients"); - - map_element2type(narg-2,arg+2); - // map_element2type(0,nullptr); - -} - -/* ---------------------------------------------------------------------- - return maximum force cut off distance -------------------------------------------------------------------------- */ - -double PairGrid::init_one(int i, int j) -{ - if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); - return cutmax; -} - -/* ---------------------------------------------------------------------- - memory usage of local data -------------------------------------------------------------------------- */ - -double PairGrid::memory_usage() -{ - int nbytes = ndesc*ngridlocal*sizeof(double); // gridlocal - return nbytes; -} diff --git a/src/pair_grid.h b/src/pair_grid.h deleted file mode 100644 index b5bf7ad9ef..0000000000 --- a/src/pair_grid.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifdef PAIR_CLASS -// clang-format off -PairStyle(grid,PairGrid); -// clang-format on -#else - -#ifndef LMP_PAIR_GRID_H -#define LMP_PAIR_GRID_H - -#include "pair.h" - -namespace LAMMPS_NS { - -class PairGrid : public Pair { - public: - PairGrid(class LAMMPS *); - virtual ~PairGrid(); - virtual void init_style(){}; - void setup(); - virtual void compute(int, int) { - printf("DANGER! This function should always be overridden by child\n"); - }; - - void settings(int, char **); - virtual void coeff(int, char **); - virtual double init_one(int, int); - double memory_usage(); - - protected: - int nx, ny, nz; // global grid dimensions - int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive - int ngridlocal; // number of local grid points - int nvalues; // number of values per grid point - double ****gridlocal; // local grid, redundant w.r.t. alocal - double **alocal; // pointer to Compute::array_local - int triclinic; // triclinic flag - double *boxlo, *prd; // box info (units real/ortho or reduced/tri) - double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) - double delxinv,delyinv,delzinv; // inverse grid spacing - double delx,dely,delz; // grid spacing - int nargbase; // number of base class args - double cutmax; // largest cutoff distance - int ndesc; // number of descriptors - int ndesc_base; // number of columns used for coords, etc. - int gridlocal_allocated; // shows if gridlocal allocated - double **beta; // betas for all local grid points in list - int beta_max; // length of beta - - void allocate(); // allocate pairstyle arrays - void allocate_grid(); // create grid arrays - void deallocate_grid(); // free grid arrays - void grid2x(int, int, int, double*); // convert global indices to coordinates - void set_grid_global(); // set global grid - void set_grid_local(); // set bounds for local grid - void assign_coords(); // assign coords for grid - void copy_gridlocal_to_local_array();// copy 4d gridlocal array to 2d local array - void compute_beta(); // get betas from someplace - private: -}; - -} - -#endif -#endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -*/ From f27e9941ae839c28f123f58df497ae2ec38acb81 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 12:48:24 -0400 Subject: [PATCH 128/172] fix homepage urls, tabs & trailing whitespace, remove errors from headers --- doc/src/compute.rst | 4 +- doc/src/compute_sna_atom.rst | 10 +- src/ML-SNAP/compute_sna_grid.cpp | 136 ++++++++++++------------- src/ML-SNAP/compute_sna_grid.h | 18 +--- src/ML-SNAP/compute_sna_grid_local.cpp | 132 ++++++++++++------------ src/ML-SNAP/compute_sna_grid_local.h | 16 +-- src/compute_grid.cpp | 10 +- src/compute_grid.h | 14 +-- src/compute_grid_local.cpp | 46 ++++----- src/compute_grid_local.h | 14 +-- 10 files changed, 175 insertions(+), 225 deletions(-) diff --git a/doc/src/compute.rst b/doc/src/compute.rst index cf17433035..508c440e78 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -284,8 +284,8 @@ The individual style names on the :doc:`Commands compute ` pag * :doc:`smd/vol ` - per-particle volumes and their sum in Smooth Mach Dynamics * :doc:`snap ` - gradients of SNAP energy and forces w.r.t. linear coefficients and related quantities for fitting SNAP potentials * :doc:`sna/atom ` - bispectrum components for each atom -* :doc:`sna/grid ` - global array of bispectrum components on a regular grid -* :doc:`sna/grid/local ` - local array of bispectrum components on a regular grid +* :doc:`sna/grid ` - global array of bispectrum components on a regular grid +* :doc:`sna/grid/local ` - local array of bispectrum components on a regular grid * :doc:`snad/atom ` - derivative of bispectrum components for each atom * :doc:`snav/atom ` - virial contribution from bispectrum components for each atom * :doc:`sph/e/atom ` - per-atom internal energy of Smooth-Particle Hydrodynamics atoms diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index 2bbee1e6b6..5f777685fd 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -35,7 +35,7 @@ Syntax * twojmax = band limit for bispectrum components (non-negative integer) * R_1, R_2,... = list of cutoff radii, one for each type (distance units) * w_1, w_2,... = list of neighbor weights, one for each type -* nx, ny, nz = number of grid points in x, y, and z directions (positive integer) +* nx, ny, nz = number of grid points in x, y, and z directions (positive integer) * zero or more keyword/value pairs may be appended * keyword = *rmin0* or *switchflag* or *bzeroflag* or *quadraticflag* or *chem* or *bnormflag* or *wselfallflag* or *bikflag* or *switchinnerflag* or *sinner* or *dinner* @@ -223,7 +223,7 @@ These are calculated from the local density of nearby atoms *i'* around each grid point, as if there was a central atom *i* at the grid point. This is useful for characterizing fine-scale structure in a configuration of atoms, and it has been used -to build a machine-learning surrogate for finite-temperature Kohn-Sham +to build a machine-learning surrogate for finite-temperature Kohn-Sham density functional theory (:ref:`Ellis et al. `). Neighbor atoms not in the group do not contribute to the bispectrum components of the grid points. The distance cutoff :math:`R_{ii'}` @@ -231,7 +231,7 @@ and other parameters are defined as for a central atom with the same type as the neighbor atoms *i'*. Compute *sna/grid* calculates a global array containing bispectrum -components for a regular grid of points. +components for a regular grid of points. The grid is aligned with the current box dimensions, with the first point at the box origin, and forming a regular 3d array with *nx*, *ny*, and *nz* points in the x, y, and z directions. For triclinic @@ -720,7 +720,7 @@ The array contains one row for each of the :math:`nx \times ny \times nz` grid points, looping over the index for *ix* fastest, then *iy*, and *iz* slowest. Each row of the array contains the *x*, *y*, and *z* coordinates of the grid point, followed by the bispectrum -components. +components. Compute *sna/grid/local* evaluates a local array. The array contains one row for each of the @@ -754,7 +754,7 @@ The optional keyword defaults are *rmin0* = 0, .. _Thompson20141: **(Thompson)** Thompson, Swiler, Trott, Foiles, Tucker, J Comp Phys, 285, 316, (2015). - + .. _Bartok20101: **(Bartok)** Bartok, Payne, Risi, Csanyi, Phys Rev Lett, 104, 136403 (2010). diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 1d868ba769..8247771493 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -41,7 +41,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; // skip over arguments used by base class - // so that argument positions are identical to + // so that argument positions are identical to // regular per-atom compute arg += nargbase; @@ -63,7 +63,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : wselfallflag = 0; switchinnerflag = 0; nelements = 1; - + // process required arguments memory->create(radelem,ntypes+1,"sna/grid:radelem"); // offset by 1 to match up with types @@ -175,14 +175,14 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all(FLERR,"Illegal compute sna/grid command: switchinnerflag = 1, missing sinner/dinner keyword"); - + if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all(FLERR,"Illegal compute sna/grid command: switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + nelements, switchinnerflag); ncoeff = snaptr->ncoeff; nvalues = ncoeff; @@ -236,83 +236,83 @@ void ComputeSNAGrid::compute_array() const int ntotal = atom->nlocal + atom->nghost; // insure rij, inside, and typej are of size jnum - + snaptr->grow_rij(ntotal); for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - double xgrid[3]; - const int igrid = iz*(nx*ny) + iy*nx + ix; - grid2x(igrid, xgrid); - const double xtmp = xgrid[0]; - const double ytmp = xgrid[1]; - const double ztmp = xgrid[2]; + double xgrid[3]; + const int igrid = iz*(nx*ny) + iy*nx + ix; + grid2x(igrid, xgrid); + const double xtmp = xgrid[0]; + const double ytmp = xgrid[1]; + const double ztmp = xgrid[2]; - // currently, all grid points are type 1 - - const int itype = 1; - int ielem = 0; - if (chemflag) - ielem = map[itype]; - const double radi = radelem[itype]; + // currently, all grid points are type 1 - // rij[][3] = displacements between atom I and those neighbors - // inside = indices of neighbors of I within cutoff - // typej = types of neighbors of I within cutoff + const int itype = 1; + int ielem = 0; + if (chemflag) + ielem = map[itype]; + const double radi = radelem[itype]; - int ninside = 0; - for (int j = 0; j < ntotal; j++) { + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff - // check that j is in compute group + int ninside = 0; + for (int j = 0; j < ntotal; j++) { - if (!(mask[j] & groupbit)) continue; + // check that j is in compute group - const double delx = xtmp - x[j][0]; - const double dely = ytmp - x[j][1]; - const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; - int jtype = type[j]; - int jelem = 0; - if (chemflag) + if (!(mask[j] & groupbit)) continue; + + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + int jelem = 0; + if (chemflag) jelem = map[jtype]; - if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { - snaptr->rij[ninside][0] = delx; - snaptr->rij[ninside][1] = dely; - snaptr->rij[ninside][2] = delz; - snaptr->inside[ninside] = j; - snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - if (switchinnerflag) { - snaptr->sinnerij[ninside] = sinnerelem[jelem]; - snaptr->dinnerij[ninside] = dinnerelem[jelem]; - } - if (chemflag) snaptr->element[ninside] = jelem; - ninside++; - } - } + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + if (switchinnerflag) { + snaptr->sinnerij[ninside] = sinnerelem[jelem]; + snaptr->dinnerij[ninside] = dinnerelem[jelem]; + } + if (chemflag) snaptr->element[ninside] = jelem; + ninside++; + } + } - snaptr->compute_ui(ninside, ielem); - snaptr->compute_zi(); - snaptr->compute_bi(ielem); + snaptr->compute_ui(ninside, ielem); + snaptr->compute_zi(); + snaptr->compute_bi(ielem); - // linear contributions + // linear contributions - for (int icoeff = 0; icoeff < ncoeff; icoeff++) - gridlocal[size_array_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; - - // quadratic contributions + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + gridlocal[size_array_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; - if (quadraticflag) { - int ncount = ncoeff; - for (int icoeff = 0; icoeff < ncoeff; icoeff++) { - double bveci = snaptr->blist[icoeff]; - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bveci*snaptr->blist[jcoeff]; - } - } + // quadratic contributions + + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bveci = snaptr->blist[icoeff]; + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bveci*snaptr->blist[jcoeff]; + } + } } memset(&grid[0][0],0,size_array_rows*size_array_cols*sizeof(double)); @@ -320,9 +320,9 @@ void ComputeSNAGrid::compute_array() for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - const int igrid = iz*(nx*ny) + iy*nx + ix; - for (int j = 0; j < nvalues; j++) - grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; + const int igrid = iz*(nx*ny) + iy*nx + ix; + for (int j = 0; j < nvalues; j++) + grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; } MPI_Allreduce(&grid[0][0],&gridall[0][0],size_array_rows*size_array_cols,MPI_DOUBLE,MPI_SUM,world); assign_coords_all(); diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index c203ce8bb4..9bc3da8112 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,19 +54,3 @@ class ComputeSNAGrid : public ComputeGrid { #endif #endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -Self-explanatory. - -W: More than one compute sna/grid - -Self-explanatory. - -*/ diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 1dacc28617..70b5b362d8 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -41,7 +41,7 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; // skip over arguments used by base class - // so that argument positions are identical to + // so that argument positions are identical to // regular per-atom compute arg += nargbase; @@ -63,7 +63,7 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : wselfallflag = 0; switchinnerflag = 0; nelements = 1; - + // set local input checks int sinnerflag = 0; @@ -175,14 +175,14 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all(FLERR,"Illegal compute sna/grid/local command: switchinnerflag = 1, missing sinner/dinner keyword"); - + if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all(FLERR,"Illegal compute sna/grid/local command: switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + nelements, switchinnerflag); ncoeff = snaptr->ncoeff; nvalues = ncoeff; @@ -235,84 +235,84 @@ void ComputeSNAGridLocal::compute_local() const int ntotal = atom->nlocal + atom->nghost; // insure rij, inside, and typej are of size jnum - + snaptr->grow_rij(ntotal); int igrid = 0; for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - double xgrid[3]; - grid2x(ix, iy, iz, xgrid); - const double xtmp = xgrid[0]; - const double ytmp = xgrid[1]; - const double ztmp = xgrid[2]; + double xgrid[3]; + grid2x(ix, iy, iz, xgrid); + const double xtmp = xgrid[0]; + const double ytmp = xgrid[1]; + const double ztmp = xgrid[2]; - // currently, all grid points are type 1 - - const int itype = 1; - int ielem = 0; - if (chemflag) - ielem = map[itype]; - const double radi = radelem[itype]; + // currently, all grid points are type 1 - // rij[][3] = displacements between atom I and those neighbors - // inside = indices of neighbors of I within cutoff - // typej = types of neighbors of I within cutoff + const int itype = 1; + int ielem = 0; + if (chemflag) + ielem = map[itype]; + const double radi = radelem[itype]; - int ninside = 0; - for (int j = 0; j < ntotal; j++) { + // rij[][3] = displacements between atom I and those neighbors + // inside = indices of neighbors of I within cutoff + // typej = types of neighbors of I within cutoff - // check that j is in compute group + int ninside = 0; + for (int j = 0; j < ntotal; j++) { - if (!(mask[j] & groupbit)) continue; + // check that j is in compute group - const double delx = xtmp - x[j][0]; - const double dely = ytmp - x[j][1]; - const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; - int jtype = type[j]; - int jelem = 0; - if (chemflag) - jelem = map[jtype]; - if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { - snaptr->rij[ninside][0] = delx; - snaptr->rij[ninside][1] = dely; - snaptr->rij[ninside][2] = delz; - snaptr->inside[ninside] = j; - snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; - if (switchinnerflag) { - snaptr->sinnerij[ninside] = sinnerelem[jelem]; - snaptr->dinnerij[ninside] = dinnerelem[jelem]; - } - if (chemflag) snaptr->element[ninside] = jelem; // element index for multi-element snap - ninside++; - } - } + if (!(mask[j] & groupbit)) continue; - snaptr->compute_ui(ninside, ielem); - snaptr->compute_zi(); - snaptr->compute_bi(ielem); + const double delx = xtmp - x[j][0]; + const double dely = ytmp - x[j][1]; + const double delz = ztmp - x[j][2]; + const double rsq = delx*delx + dely*dely + delz*delz; + int jtype = type[j]; + int jelem = 0; + if (chemflag) + jelem = map[jtype]; + if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { + snaptr->rij[ninside][0] = delx; + snaptr->rij[ninside][1] = dely; + snaptr->rij[ninside][2] = delz; + snaptr->inside[ninside] = j; + snaptr->wj[ninside] = wjelem[jtype]; + snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + if (switchinnerflag) { + snaptr->sinnerij[ninside] = sinnerelem[jelem]; + snaptr->dinnerij[ninside] = dinnerelem[jelem]; + } + if (chemflag) snaptr->element[ninside] = jelem; // element index for multi-element snap + ninside++; + } + } - // linear contributions + snaptr->compute_ui(ninside, ielem); + snaptr->compute_zi(); + snaptr->compute_bi(ielem); - for (int icoeff = 0; icoeff < ncoeff; icoeff++) - alocal[igrid][size_local_cols_base+icoeff] = snaptr->blist[icoeff]; + // linear contributions - // quadratic contributions + for (int icoeff = 0; icoeff < ncoeff; icoeff++) + alocal[igrid][size_local_cols_base+icoeff] = snaptr->blist[icoeff]; - if (quadraticflag) { - int ncount = ncoeff; - for (int icoeff = 0; icoeff < ncoeff; icoeff++) { - double bveci = snaptr->blist[icoeff]; - alocal[igrid][size_local_cols_base+ncount++] = 0.5*bveci*bveci; - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - alocal[igrid][size_local_cols_base+ncount++] = - bveci*snaptr->blist[jcoeff]; - } - } - igrid++; + // quadratic contributions + + if (quadraticflag) { + int ncount = ncoeff; + for (int icoeff = 0; icoeff < ncoeff; icoeff++) { + double bveci = snaptr->blist[icoeff]; + alocal[igrid][size_local_cols_base+ncount++] = 0.5*bveci*bveci; + for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) + alocal[igrid][size_local_cols_base+ncount++] = + bveci*snaptr->blist[jcoeff]; + } + } + igrid++; } } diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h index 5ce40069ee..69a2c528fc 100644 --- a/src/ML-SNAP/compute_sna_grid_local.h +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,17 +54,3 @@ class ComputeSNAGridLocal : public ComputeGridLocal { #endif #endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -W: More than one compute sna/grid/local - -Self-explanatory. - -*/ diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index dd21b731e8..60c9987cbc 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -128,7 +128,7 @@ void ComputeGrid::allocate() if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, - nxlo,nxhi,"grid:gridlocal"); + nxlo,nxhi,"grid:gridlocal"); } array = gridall; } @@ -179,7 +179,7 @@ void ComputeGrid::set_grid_global() delxinv = nx/xprd; delyinv = ny/yprd; delzinv = nz/zprd; - + delx = 1.0/delxinv; dely = 1.0/delyinv; delz = 1.0/delzinv; @@ -245,9 +245,9 @@ void ComputeGrid::set_grid_local() double ComputeGrid::memory_usage() { - double nbytes = size_array_rows*size_array_cols * + double nbytes = size_array_rows*size_array_cols * sizeof(double); // grid - nbytes += size_array_rows*size_array_cols * + nbytes += size_array_rows*size_array_cols * sizeof(double); // gridall nbytes += size_array_cols*ngridlocal*sizeof(double); // gridlocal return nbytes; diff --git a/src/compute_grid.h b/src/compute_grid.h index 7bda1a89fa..b0214b2b15 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,7 +42,7 @@ class ComputeGrid : public Compute { double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) double delxinv,delyinv,delzinv; // inverse grid spacing double delx,dely,delz; // grid spacing - int nargbase; // number of base class args + int nargbase; // number of base class args double cutmax; // largest cutoff distance int size_array_cols_base; // number of columns used for coords, etc. int gridlocal_allocated; // shows if gridlocal allocated @@ -59,13 +59,3 @@ class ComputeGrid : public Compute { } #endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -*/ diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index bcc56c3abd..e30d06fe45 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -164,7 +164,7 @@ void ComputeGridLocal::set_grid_global() delxinv = nx/xprd; delyinv = ny/yprd; delzinv = nz/zprd; - + delx = 1.0/delxinv; dely = 1.0/delyinv; delz = 1.0/delzinv; @@ -233,34 +233,34 @@ void ComputeGridLocal::assign_coords() for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - alocal[igrid][0] = ix; - alocal[igrid][1] = iy; - alocal[igrid][2] = iz; - double xgrid[3]; + alocal[igrid][0] = ix; + alocal[igrid][1] = iy; + alocal[igrid][2] = iz; + double xgrid[3]; - // for triclinic: create gridpoint in lamda coordinates and transform after check. - // for orthorombic: create gridpoint in box coordinates. + // for triclinic: create gridpoint in lamda coordinates and transform after check. + // for orthorombic: create gridpoint in box coordinates. - if (triclinic) - grid2lamda(ix, iy, iz, xgrid); - else - grid2x(ix, iy, iz, xgrid); + if (triclinic) + grid2lamda(ix, iy, iz, xgrid); + else + grid2x(ix, iy, iz, xgrid); - // ensure gridpoint is not strictly outside subdomain + // ensure gridpoint is not strictly outside subdomain - if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || - (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || - (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) - error->one(FLERR,"Invalid gridpoint position in compute grid/local"); + if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || + (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || + (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) + error->one(FLERR,"Invalid gridpoint position in compute grid/local"); - // convert lamda to x, y, z, after sudomain check + // convert lamda to x, y, z, after sudomain check - if (triclinic) domain->lamda2x(xgrid, xgrid); + if (triclinic) domain->lamda2x(xgrid, xgrid); - alocal[igrid][3] = xgrid[0]; - alocal[igrid][4] = xgrid[1]; - alocal[igrid][5] = xgrid[2]; - igrid++; + alocal[igrid][3] = xgrid[0]; + alocal[igrid][4] = xgrid[1]; + alocal[igrid][5] = xgrid[2]; + igrid++; } } diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index 15ea8ca47f..5c5611250b 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -39,7 +39,7 @@ class ComputeGridLocal : public Compute { double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) double delxinv,delyinv,delzinv; // inverse grid spacing double delx,dely,delz; // grid spacing - int nargbase; // number of base class args + int nargbase; // number of base class args double cutmax; // largest cutoff distance int size_local_cols_base; // number of columns used for coords, etc. int gridlocal_allocated; // shows if gridlocal allocated @@ -57,13 +57,3 @@ class ComputeGridLocal : public Compute { } #endif - -/* ERROR/WARNING messages: - -E: Illegal ... command - -Self-explanatory. Check the input script syntax and compare to the -documentation for the command. You can use -echo screen as a -command-line option when running LAMMPS to see the offending line. - -*/ From 185d5cdc0fda9d6511b3084ff718998aff7eba09 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 12:50:54 -0400 Subject: [PATCH 129/172] update .gitignore --- src/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/.gitignore b/src/.gitignore index de157734fc..198dcdc290 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -179,6 +179,10 @@ /compute_snad_atom.h /compute_snav_atom.cpp /compute_snav_atom.h +/compute_sna_grid.cpp +/compute_sna_grid.h +/compute_sna_grid_local.cpp +/compute_sna_grid_local.h /compute_snap.cpp /compute_snap.h /openmp_snap.h From dac99e462ffb7891c15a59074d39c89b53a1a5d4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 13:04:25 -0400 Subject: [PATCH 130/172] update log files --- examples/snap/log.15Jun22.grid.snap.g++.1 | 46 +++++++++------------ examples/snap/log.15Jun22.grid.snap.g++.4 | 48 +++++++++------------- examples/snap/log.15Jun22.grid.tri.g++.1 | 50 ++++++++++------------- examples/snap/log.15Jun22.grid.tri.g++.4 | 50 ++++++++++------------- 4 files changed, 81 insertions(+), 113 deletions(-) diff --git a/examples/snap/log.15Jun22.grid.snap.g++.1 b/examples/snap/log.15Jun22.grid.snap.g++.1 index 71b884d1b6..ec2026b16e 100644 --- a/examples/snap/log.15Jun22.grid.snap.g++.1 +++ b/examples/snap/log.15Jun22.grid.snap.g++.1 @@ -1,4 +1,5 @@ -LAMMPS (28 Jul 2021) +LAMMPS (2 Jun 2022) + using 1 OpenMP thread(s) per MPI task # Demonstrate calculation of SNAP bispectrum descriptors on a grid # CORRECTNESS: The two atom positions coincide with two of @@ -27,17 +28,17 @@ boundary p p p lattice custom $a a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 lattice custom 3.316 a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 -Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 +Lattice spacing in x,y,z = 3.316 3.316 3.316 region box block 0 ${nx} 0 ${ny} 0 ${nz} region box block 0 1 0 ${ny} 0 ${nz} region box block 0 1 0 1 0 ${nz} region box block 0 1 0 1 0 1 create_box 1 box -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) +Created orthogonal box = (0 0 0) to (3.316 3.316 3.316) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 2 atoms - using lattice units in orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) + using lattice units in orthogonal box = (0 0 0) to (3.316 3.316 3.316) create_atoms CPU = 0.000 seconds mass 1 180.88 @@ -105,14 +106,15 @@ dump 2 all custom 1000 dump.batom id x y z c_b[*] # run run 0 -WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 6.67637 ghost atom cutoff = 6.67637 binsize = 3.338185, bins = 1 1 1 - 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 (1) pair zero, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton @@ -123,22 +125,12 @@ Neighbor list info ... pair build: full/bin/atomonly stencil: full/bin/3d bin: standard - (3) compute sna/grid, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (4) compute sna/grid/local, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 8.384 | 8.384 | 8.384 Mbytes -Step v_B5atom v_B5grid v_rmse_global - 0 1.0427295 1.0427295 0 -Loop time of 1e-06 on 1 procs for 0 steps with 2 atoms +Per MPI rank memory allocation (min/avg/max) = 7.127 | 7.127 | 7.127 Mbytes + Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 9.1551336e-16 +Loop time of 1.43e-06 on 1 procs for 0 steps with 2 atoms -100.0% CPU use with 1 MPI tasks x no OpenMP threads +139.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total @@ -148,19 +140,19 @@ Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0 | 0 | 0 | 0.0 | 0.00 Output | 0 | 0 | 0 | 0.0 | 0.00 Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1e-06 | | |100.00 +Other | | 1.43e-06 | | |100.00 -Nlocal: 2.00000 ave 2 max 2 min +Nlocal: 2 ave 2 max 2 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 339.000 ave 339 max 339 min +Nghost: 339 ave 339 max 339 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 64.0000 ave 64 max 64 min +Neighs: 64 ave 64 max 64 min Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 128.000 ave 128 max 128 min +FullNghs: 128 ave 128 max 128 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 128 -Ave neighs/atom = 64.000000 +Ave neighs/atom = 64 Neighbor list builds = 0 Dangerous builds = 0 diff --git a/examples/snap/log.15Jun22.grid.snap.g++.4 b/examples/snap/log.15Jun22.grid.snap.g++.4 index 80761fc395..5be17ada7d 100644 --- a/examples/snap/log.15Jun22.grid.snap.g++.4 +++ b/examples/snap/log.15Jun22.grid.snap.g++.4 @@ -1,4 +1,5 @@ -LAMMPS (28 Jul 2021) +LAMMPS (2 Jun 2022) + using 1 OpenMP thread(s) per MPI task # Demonstrate calculation of SNAP bispectrum descriptors on a grid # CORRECTNESS: The two atom positions coincide with two of @@ -27,17 +28,17 @@ boundary p p p lattice custom $a a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 lattice custom 3.316 a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 -Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 +Lattice spacing in x,y,z = 3.316 3.316 3.316 region box block 0 ${nx} 0 ${ny} 0 ${nz} region box block 0 1 0 ${ny} 0 ${nz} region box block 0 1 0 1 0 ${nz} region box block 0 1 0 1 0 1 create_box 1 box -Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) +Created orthogonal box = (0 0 0) to (3.316 3.316 3.316) 1 by 2 by 2 MPI processor grid create_atoms 1 box Created 2 atoms - using lattice units in orthogonal box = (0.0000000 0.0000000 0.0000000) to (3.3160000 3.3160000 3.3160000) + using lattice units in orthogonal box = (0 0 0) to (3.316 3.316 3.316) create_atoms CPU = 0.001 seconds mass 1 180.88 @@ -105,14 +106,15 @@ dump 2 all custom 1000 dump.batom id x y z c_b[*] # run run 0 -WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 6.67637 ghost atom cutoff = 6.67637 binsize = 3.338185, bins = 1 1 1 - 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 (1) pair zero, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton @@ -123,23 +125,13 @@ Neighbor list info ... pair build: full/bin/atomonly stencil: full/bin/3d bin: standard - (3) compute sna/grid, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (4) compute sna/grid/local, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -WARNING: Proc sub-domain size < neighbor skin, could lead to lost atoms (src/domain.cpp:964) -Per MPI rank memory allocation (min/avg/max) = 7.381 | 7.889 | 8.397 Mbytes -Step v_B5atom v_B5grid v_rmse_global - 0 1.0427295 1.0427295 0 -Loop time of 1.5e-06 on 4 procs for 0 steps with 2 atoms +WARNING: Proc sub-domain size < neighbor skin, could lead to lost atoms (src/domain.cpp:970) +Per MPI rank memory allocation (min/avg/max) = 6.123 | 6.631 | 7.139 Mbytes + Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 1.6316879e-15 +Loop time of 2.57125e-06 on 4 procs for 0 steps with 2 atoms -83.3% CPU use with 4 MPI tasks x no OpenMP threads +107.0% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total @@ -149,19 +141,19 @@ Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0 | 0 | 0 | 0.0 | 0.00 Output | 0 | 0 | 0 | 0.0 | 0.00 Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.5e-06 | | |100.00 +Other | | 2.571e-06 | | |100.00 -Nlocal: 0.500000 ave 1 max 0 min +Nlocal: 0.5 ave 1 max 0 min Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 274.500 ave 275 max 274 min +Nghost: 274.5 ave 275 max 274 min Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 16.0000 ave 40 max 0 min +Neighs: 16 ave 40 max 0 min Histogram: 2 0 0 0 0 0 1 0 0 1 -FullNghs: 32.0000 ave 64 max 0 min +FullNghs: 32 ave 64 max 0 min Histogram: 2 0 0 0 0 0 0 0 0 2 Total # of neighbors = 128 -Ave neighs/atom = 64.000000 +Ave neighs/atom = 64 Neighbor list builds = 0 Dangerous builds = 0 diff --git a/examples/snap/log.15Jun22.grid.tri.g++.1 b/examples/snap/log.15Jun22.grid.tri.g++.1 index c261154367..e26315235b 100644 --- a/examples/snap/log.15Jun22.grid.tri.g++.1 +++ b/examples/snap/log.15Jun22.grid.tri.g++.1 @@ -1,4 +1,5 @@ -LAMMPS (28 Jul 2021) +LAMMPS (2 Jun 2022) + using 1 OpenMP thread(s) per MPI task # Demonstrate calculation of SNAP bispectrum # descriptors on a grid for triclinic cell @@ -51,7 +52,7 @@ boundary p p p lattice custom $a a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 lattice custom 3.316 a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 -Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 +Lattice spacing in x,y,z = 3.316 3.316 3.316 box tilt large region box prism 0 ${nx} 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} @@ -62,13 +63,13 @@ region box prism 0 3 0 2 0 1 2 ${nz} ${nz} region box prism 0 3 0 2 0 1 2 1 ${nz} region box prism 0 3 0 2 0 1 2 1 1 create_box 1 box -Created triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) -WARNING: Triclinic box skew is large (src/domain.cpp:219) +Created triclinic box = (0 0 0) to (9.948 6.632 3.316) with tilt (6.632 3.316 3.316) +WARNING: Triclinic box skew is large (src/domain.cpp:224) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 12 atoms - using lattice units in triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) - create_atoms CPU = 0.001 seconds + using lattice units in triclinic box = (0 0 0) to (9.948 6.632 3.316) with tilt (6.632 3.316 3.316) + create_atoms CPU = 0.000 seconds mass 1 180.88 @@ -138,14 +139,15 @@ dump 2 all custom 1000 dump.batom.tri id x y z c_b[*] # run run 0 -WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 6.67637 ghost atom cutoff = 6.67637 binsize = 3.338185, bins = 6 3 1 - 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 (1) pair zero, perpetual attributes: half, newton on pair build: half/bin/newton/tri @@ -156,22 +158,12 @@ Neighbor list info ... pair build: full/bin/atomonly stencil: full/bin/3d bin: standard - (3) compute sna/grid, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (4) compute sna/grid/local, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 8.435 | 8.435 | 8.435 Mbytes -Step v_B5atom v_B5grid v_rmse_global - 0 1.0427295 1.0427295 7.2262471e-14 -Loop time of 1e-06 on 1 procs for 0 steps with 12 atoms +Per MPI rank memory allocation (min/avg/max) = 7.183 | 7.183 | 7.183 Mbytes + Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 7.2262471e-14 +Loop time of 1.414e-06 on 1 procs for 0 steps with 12 atoms -100.0% CPU use with 1 MPI tasks x no OpenMP threads +70.7% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total @@ -181,19 +173,19 @@ Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0 | 0 | 0 | 0.0 | 0.00 Output | 0 | 0 | 0 | 0.0 | 0.00 Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1e-06 | | |100.00 +Other | | 1.414e-06 | | |100.00 -Nlocal: 12.0000 ave 12 max 12 min +Nlocal: 12 ave 12 max 12 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 604.000 ave 604 max 604 min +Nghost: 604 ave 604 max 604 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 384.000 ave 384 max 384 min +Neighs: 384 ave 384 max 384 min Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 768.000 ave 768 max 768 min +FullNghs: 768 ave 768 max 768 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 768 -Ave neighs/atom = 64.000000 +Ave neighs/atom = 64 Neighbor list builds = 0 Dangerous builds = 0 diff --git a/examples/snap/log.15Jun22.grid.tri.g++.4 b/examples/snap/log.15Jun22.grid.tri.g++.4 index bac7ecaa5a..cee3ce7f12 100644 --- a/examples/snap/log.15Jun22.grid.tri.g++.4 +++ b/examples/snap/log.15Jun22.grid.tri.g++.4 @@ -1,4 +1,5 @@ -LAMMPS (28 Jul 2021) +LAMMPS (2 Jun 2022) + using 1 OpenMP thread(s) per MPI task # Demonstrate calculation of SNAP bispectrum # descriptors on a grid for triclinic cell @@ -51,7 +52,7 @@ boundary p p p lattice custom $a a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 lattice custom 3.316 a1 1 0 0 a2 1 1 0 a3 1 1 1 basis 0 0 0 basis 0.0 0.0 0.5 spacing 1 1 1 -Lattice spacing in x,y,z = 3.3160000 3.3160000 3.3160000 +Lattice spacing in x,y,z = 3.316 3.316 3.316 box tilt large region box prism 0 ${nx} 0 ${ny} 0 ${nz} ${ny} ${nz} ${nz} @@ -62,13 +63,13 @@ region box prism 0 3 0 2 0 1 2 ${nz} ${nz} region box prism 0 3 0 2 0 1 2 1 ${nz} region box prism 0 3 0 2 0 1 2 1 1 create_box 1 box -Created triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) -WARNING: Triclinic box skew is large (src/domain.cpp:219) +Created triclinic box = (0 0 0) to (9.948 6.632 3.316) with tilt (6.632 3.316 3.316) +WARNING: Triclinic box skew is large (src/domain.cpp:224) 2 by 2 by 1 MPI processor grid create_atoms 1 box Created 12 atoms - using lattice units in triclinic box = (0.0000000 0.0000000 0.0000000) to (9.9480000 6.6320000 3.3160000) with tilt (6.6320000 3.3160000 3.3160000) - create_atoms CPU = 0.001 seconds + using lattice units in triclinic box = (0 0 0) to (9.948 6.632 3.316) with tilt (6.632 3.316 3.316) + create_atoms CPU = 0.000 seconds mass 1 180.88 @@ -138,14 +139,15 @@ dump 2 all custom 1000 dump.batom.tri id x y z c_b[*] # run run 0 -WARNING: No fixes defined, atoms won't move (src/verlet.cpp:55) +WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60) +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 6.67637 ghost atom cutoff = 6.67637 binsize = 3.338185, bins = 6 3 1 - 4 neighbor lists, perpetual/occasional/extra = 1 3 0 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 (1) pair zero, perpetual attributes: half, newton on pair build: half/bin/newton/tri @@ -156,22 +158,12 @@ Neighbor list info ... pair build: full/bin/atomonly stencil: full/bin/3d bin: standard - (3) compute sna/grid, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard - (4) compute sna/grid/local, occasional - attributes: full, newton on - pair build: full/bin/atomonly - stencil: full/bin/3d - bin: standard -Per MPI rank memory allocation (min/avg/max) = 8.405 | 8.405 | 8.405 Mbytes -Step v_B5atom v_B5grid v_rmse_global - 0 1.0427295 1.0427295 2.1052124e-14 -Loop time of 1.25e-06 on 4 procs for 0 steps with 12 atoms +Per MPI rank memory allocation (min/avg/max) = 7.15 | 7.15 | 7.15 Mbytes + Step v_B5atom v_B5grid v_rmse_global + 0 1.0427295 1.0427295 1.9367585e-14 +Loop time of 2.65825e-06 on 4 procs for 0 steps with 12 atoms -140.0% CPU use with 4 MPI tasks x no OpenMP threads +84.6% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total @@ -181,19 +173,19 @@ Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0 | 0 | 0 | 0.0 | 0.00 Output | 0 | 0 | 0 | 0.0 | 0.00 Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.25e-06 | | |100.00 +Other | | 2.658e-06 | | |100.00 -Nlocal: 3.00000 ave 4 max 2 min +Nlocal: 3 ave 4 max 2 min Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 459.000 ave 460 max 458 min +Nghost: 459 ave 460 max 458 min Histogram: 2 0 0 0 0 0 0 0 0 2 -Neighs: 96.0000 ave 128 max 64 min +Neighs: 96 ave 128 max 64 min Histogram: 2 0 0 0 0 0 0 0 0 2 -FullNghs: 192.000 ave 256 max 128 min +FullNghs: 192 ave 256 max 128 min Histogram: 2 0 0 0 0 0 0 0 0 2 Total # of neighbors = 768 -Ave neighs/atom = 64.000000 +Ave neighs/atom = 64 Neighbor list builds = 0 Dangerous builds = 0 From 5b9c4069e976edbcc0a7d45e20eec42c4a0f52d1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 13:25:29 -0400 Subject: [PATCH 131/172] make headers clang-format compatible and use override keywords --- src/ML-SNAP/compute_sna_grid.h | 16 ++++++++-------- src/ML-SNAP/compute_sna_grid_local.h | 16 ++++++++-------- src/compute_grid.h | 11 +++++------ src/compute_grid_local.h | 11 +++++------ 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index 9bc3da8112..750f779a00 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(sna/grid,ComputeSNAGrid) - +// clang-format off +ComputeStyle(sna/grid,ComputeSNAGrid); +// clang-format on #else #ifndef LMP_COMPUTE_SNA_GRID_H @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeSNAGrid : public ComputeGrid { public: ComputeSNAGrid(class LAMMPS *, int, char **); - ~ComputeSNAGrid(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); - double memory_usage(); + ~ComputeSNAGrid() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; + double memory_usage() override; private: int ncoeff; diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h index 69a2c528fc..c7678d049e 100644 --- a/src/ML-SNAP/compute_sna_grid_local.h +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(sna/grid/local,ComputeSNAGridLocal) - +// clang-format off +ComputeStyle(sna/grid/local,ComputeSNAGridLocal); +// clang-format on #else #ifndef LMP_COMPUTE_SNA_GRID_LOCAL_H @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeSNAGridLocal : public ComputeGridLocal { public: ComputeSNAGridLocal(class LAMMPS *, int, char **); - ~ComputeSNAGridLocal(); - void init(); - void init_list(int, class NeighList *); - void compute_local(); - double memory_usage(); + ~ComputeSNAGridLocal() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_local() override; + double memory_usage() override; private: int ncoeff; diff --git a/src/compute_grid.h b/src/compute_grid.h index b0214b2b15..4264039cc8 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -22,12 +22,12 @@ class ComputeGrid : public Compute { public: ComputeGrid(class LAMMPS *, int, char **); - virtual ~ComputeGrid(); - void init(); - void setup(); - virtual void compute_array() = 0; + ~ComputeGrid() override; + void init() override; + void setup() override; + void compute_array() override = 0; - double memory_usage(); + double memory_usage() override; protected: int nx, ny, nz; // global grid dimensions @@ -53,7 +53,6 @@ class ComputeGrid : public Compute { void assign_coords_all(); // assign coords for global grid void set_grid_global(); // set global grid void set_grid_local(); // set bounds for local grid - private: }; } diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index 5c5611250b..2989628d79 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -22,12 +22,12 @@ class ComputeGridLocal : public Compute { public: ComputeGridLocal(class LAMMPS *, int, char **); - virtual ~ComputeGridLocal(); - void init(); - void setup(); - virtual void compute_local() = 0; + ~ComputeGridLocal() override; + void init() override; + void setup() override; + void compute_local() override = 0; - double memory_usage(); + double memory_usage() override; protected: int nx, ny, nz; // global grid dimensions @@ -51,7 +51,6 @@ class ComputeGridLocal : public Compute { void set_grid_global(); // set global grid void set_grid_local(); // set bounds for local grid void assign_coords(); // assign coords for grid - private: }; } From d9646ee537d642f72e3de20b4c3cf26d94c44a3d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 13:25:40 -0400 Subject: [PATCH 132/172] remove dead code --- src/ML-SNAP/compute_sna_grid.cpp | 1 - src/ML-SNAP/compute_sna_grid_local.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 8247771493..5ea49469e2 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -255,7 +255,6 @@ void ComputeSNAGrid::compute_array() int ielem = 0; if (chemflag) ielem = map[itype]; - const double radi = radelem[itype]; // rij[][3] = displacements between atom I and those neighbors // inside = indices of neighbors of I within cutoff diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 70b5b362d8..614880043c 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -254,7 +254,6 @@ void ComputeSNAGridLocal::compute_local() int ielem = 0; if (chemflag) ielem = map[itype]; - const double radi = radelem[itype]; // rij[][3] = displacements between atom I and those neighbors // inside = indices of neighbors of I within cutoff From 9fd6bde0ed8f5f1c040d67b2c0f8c3092e13db7a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 13:47:23 -0400 Subject: [PATCH 133/172] enable and apply clang-format --- src/ML-SNAP/compute_sna_grid.cpp | 200 ++++++++++++------------- src/ML-SNAP/compute_sna_grid.h | 2 +- src/ML-SNAP/compute_sna_grid_local.cpp | 193 +++++++++++------------- src/ML-SNAP/compute_sna_grid_local.h | 2 +- src/compute_grid.cpp | 121 +++++++-------- src/compute_grid.h | 47 +++--- src/compute_grid_local.cpp | 107 +++++++------ src/compute_grid_local.h | 43 +++--- 8 files changed, 337 insertions(+), 378 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 5ea49469e2..e182b16d64 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -11,22 +11,22 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "compute_grid.h" #include "compute_sna_grid.h" -#include "sna.h" + #include "atom.h" -#include "update.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" +#include "neighbor.h" #include "pair.h" -#include "domain.h" -#include "comm.h" -#include "memory.h" -#include "error.h" +#include "sna.h" #include "tokenizer.h" +#include "update.h" #include #include @@ -34,8 +34,7 @@ using namespace LAMMPS_NS; ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : - ComputeGrid(lmp, narg, arg), cutsq(nullptr), - radelem(nullptr), wjelem(nullptr) + ComputeGrid(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -48,9 +47,9 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : narg -= nargbase; int ntypes = atom->ntypes; - int nargmin = 6+2*ntypes; + int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR,"Illegal compute sna/grid command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute sna/grid command"); // default values @@ -66,30 +65,28 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem,ntypes+1,"sna/grid:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"sna/grid:wjelem"); + memory->create(radelem, ntypes + 1, "sna/grid:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/grid:wjelem"); rcutfac = atof(arg[3]); rfac0 = atof(arg[4]); twojmax = atoi(arg[5]); - for(int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[6+i]); - for(int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[6+ntypes+i]); + for (int i = 0; i < ntypes; i++) radelem[i + 1] = atof(arg[6 + i]); + for (int i = 0; i < ntypes; i++) wjelem[i + 1] = atof(arg[6 + ntypes + i]); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid:cutsq"); - for(int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/grid:cutsq"); + for (int i = 1; i <= ntypes; i++) { + cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; - cutsq[i][i] = cut*cut; - for(int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; + cutsq[i][i] = cut * cut; + for (int j = i + 1; j <= ntypes; j++) { + cut = (radelem[i] + radelem[j]) * rcutfac; + cutsq[i][j] = cutsq[j][i] = cut * cut; } } @@ -103,90 +100,81 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - rmin0 = atof(arg[iarg+1]); + if (strcmp(arg[iarg], "rmin0") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + rmin0 = atof(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - switchflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + switchflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - bzeroflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "bzeroflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + bzeroflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - quadraticflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "quadraticflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + quadraticflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); + } else if (strcmp(arg[iarg], "chem") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_sna_grid:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + memory->create(map, ntypes + 1, "compute_sna_grid:map"); + nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal compute sna/grid command"); - map[i+1] = jelem; + int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute sna/grid command"); + map[i + 1] = jelem; } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - bnormflag = atoi(arg[iarg+1]); + iarg += 2 + ntypes; + } else if (strcmp(arg[iarg], "bnormflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + bnormflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - wselfallflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "wselfallflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + wselfallflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - switchinnerflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + switchinnerflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { + } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid command"); + memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); sinnerflag = 1; iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { + } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute sna/grid command"); - memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid command"); + memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; - } else error->all(FLERR,"Illegal compute sna/grid command"); - + } else + error->all(FLERR, "Illegal compute sna/grid command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR,"Illegal compute sna/grid command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute sna/grid command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR,"Illegal compute sna/grid command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute sna/grid command: switchinnerflag = 0, unexpected sinner/dinner keyword"); - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, + wselfallflag, nelements, switchinnerflag); ncoeff = snaptr->ncoeff; nvalues = ncoeff; - if (quadraticflag) nvalues += (ncoeff*(ncoeff+1))/2; + if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; size_array_cols = size_array_cols_base + nvalues; array_flag = 1; } @@ -209,9 +197,8 @@ void ComputeSNAGrid::init() { int count = 0; for (int i = 0; i < modify->ncompute; i++) - if (strcmp(modify->compute[i]->style,"sna/grid") == 0) count++; - if (count > 1 && comm->me == 0) - error->warning(FLERR,"More than one compute sna/grid"); + if (strcmp(modify->compute[i]->style, "sna/grid") == 0) count++; + if (count > 1 && comm->me == 0) error->warning(FLERR, "More than one compute sna/grid"); snaptr->init(); } @@ -230,9 +217,9 @@ void ComputeSNAGrid::compute_array() // compute sna for each gridpoint - double** const x = atom->x; - const int* const mask = atom->mask; - int * const type = atom->type; + double **const x = atom->x; + const int *const mask = atom->mask; + int *const type = atom->type; const int ntotal = atom->nlocal + atom->nghost; // insure rij, inside, and typej are of size jnum @@ -243,7 +230,7 @@ void ComputeSNAGrid::compute_array() for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { double xgrid[3]; - const int igrid = iz*(nx*ny) + iy*nx + ix; + const int igrid = iz * (nx * ny) + iy * nx + ix; grid2x(igrid, xgrid); const double xtmp = xgrid[0]; const double ytmp = xgrid[1]; @@ -253,8 +240,7 @@ void ComputeSNAGrid::compute_array() const int itype = 1; int ielem = 0; - if (chemflag) - ielem = map[itype]; + if (chemflag) ielem = map[itype]; // rij[][3] = displacements between atom I and those neighbors // inside = indices of neighbors of I within cutoff @@ -270,11 +256,10 @@ void ComputeSNAGrid::compute_array() const double delx = xtmp - x[j][0]; const double dely = ytmp - x[j][1]; const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; + const double rsq = delx * delx + dely * dely + delz * delz; int jtype = type[j]; int jelem = 0; - if (chemflag) - jelem = map[jtype]; + if (chemflag) jelem = map[jtype]; if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; @@ -282,7 +267,7 @@ void ComputeSNAGrid::compute_array() snaptr->rij[ninside][2] = delz; snaptr->inside[ninside] = j; snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + snaptr->rcutij[ninside] = 2.0 * radelem[jtype] * rcutfac; if (switchinnerflag) { snaptr->sinnerij[ninside] = sinnerelem[jelem]; snaptr->dinnerij[ninside] = dinnerelem[jelem]; @@ -299,7 +284,7 @@ void ComputeSNAGrid::compute_array() // linear contributions for (int icoeff = 0; icoeff < ncoeff; icoeff++) - gridlocal[size_array_cols_base+icoeff][iz][iy][ix] = snaptr->blist[icoeff]; + gridlocal[size_array_cols_base + icoeff][iz][iy][ix] = snaptr->blist[icoeff]; // quadratic contributions @@ -307,28 +292,28 @@ void ComputeSNAGrid::compute_array() int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { double bveci = snaptr->blist[icoeff]; - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = bveci*snaptr->blist[jcoeff]; + gridlocal[size_array_cols_base + ncount++][iz][iy][ix] = 0.5 * bveci * bveci; + for (int jcoeff = icoeff + 1; jcoeff < ncoeff; jcoeff++) + gridlocal[size_array_cols_base + ncount++][iz][iy][ix] = + bveci * snaptr->blist[jcoeff]; } } } - memset(&grid[0][0],0,size_array_rows*size_array_cols*sizeof(double)); + memset(&grid[0][0], 0, size_array_rows * size_array_cols * sizeof(double)); for (int iz = nzlo; iz <= nzhi; iz++) for (int iy = nylo; iy <= nyhi; iy++) for (int ix = nxlo; ix <= nxhi; ix++) { - const int igrid = iz*(nx*ny) + iy*nx + ix; + const int igrid = iz * (nx * ny) + iy * nx + ix; for (int j = 0; j < nvalues; j++) grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; } - MPI_Allreduce(&grid[0][0],&gridall[0][0],size_array_rows*size_array_cols,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&grid[0][0], &gridall[0][0], size_array_rows * size_array_cols, MPI_DOUBLE, MPI_SUM, + world); assign_coords_all(); - } - /* ---------------------------------------------------------------------- memory usage ------------------------------------------------------------------------- */ @@ -336,9 +321,8 @@ void ComputeSNAGrid::compute_array() double ComputeSNAGrid::memory_usage() { double nbytes = snaptr->memory_usage(); // SNA object - int n = atom->ntypes+1; - nbytes += (double)n*sizeof(int); // map + int n = atom->ntypes + 1; + nbytes += (double) n * sizeof(int); // map return nbytes; } - diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index 750f779a00..7eef027ef7 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -50,7 +50,7 @@ class ComputeSNAGrid : public ComputeGrid { int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 614880043c..7359acacbf 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -11,22 +11,22 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "compute_grid_local.h" #include "compute_sna_grid_local.h" -#include "sna.h" + #include "atom.h" -#include "update.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" +#include "neighbor.h" #include "pair.h" -#include "domain.h" -#include "comm.h" -#include "memory.h" -#include "error.h" +#include "sna.h" #include "tokenizer.h" +#include "update.h" #include #include @@ -34,8 +34,7 @@ using namespace LAMMPS_NS; ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : - ComputeGridLocal(lmp, narg, arg), cutsq(nullptr), - radelem(nullptr), wjelem(nullptr) + ComputeGridLocal(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -48,9 +47,9 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : narg -= nargbase; int ntypes = atom->ntypes; - int nargmin = 6+2*ntypes; + int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR,"Illegal compute sna/grid/local command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute sna/grid/local command"); // default values @@ -71,30 +70,29 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem,ntypes+1,"sna/grid/local:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"sna/grid/local:wjelem"); + memory->create(radelem, ntypes + 1, + "sna/grid/local:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/grid/local:wjelem"); rcutfac = atof(arg[3]); rfac0 = atof(arg[4]); twojmax = atoi(arg[5]); - for(int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[6+i]); - for(int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[6+ntypes+i]); + for (int i = 0; i < ntypes; i++) radelem[i + 1] = atof(arg[6 + i]); + for (int i = 0; i < ntypes; i++) wjelem[i + 1] = atof(arg[6 + ntypes + i]); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid/local:cutsq"); - for(int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/grid/local:cutsq"); + for (int i = 1; i <= ntypes; i++) { + cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; - cutsq[i][i] = cut*cut; - for(int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; + cutsq[i][i] = cut * cut; + for (int j = i + 1; j <= ntypes; j++) { + cut = (radelem[i] + radelem[j]) * rcutfac; + cutsq[i][j] = cutsq[j][i] = cut * cut; } } @@ -103,90 +101,82 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - rmin0 = atof(arg[iarg+1]); + if (strcmp(arg[iarg], "rmin0") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + rmin0 = atof(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - switchflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + switchflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - bzeroflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "bzeroflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + bzeroflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - quadraticflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "quadraticflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + quadraticflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); + } else if (strcmp(arg[iarg], "chem") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_sna_grid_local:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + memory->create(map, ntypes + 1, "compute_sna_grid_local:map"); + nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); + int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal compute sna/grid/local command"); - map[i+1] = jelem; + error->all(FLERR, "Illegal compute sna/grid/local command"); + map[i + 1] = jelem; } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - bnormflag = atoi(arg[iarg+1]); + iarg += 2 + ntypes; + } else if (strcmp(arg[iarg], "bnormflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + bnormflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - wselfallflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "wselfallflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + wselfallflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - switchinnerflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + switchinnerflag = atoi(arg[iarg + 1]); iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { + } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); sinnerflag = 1; iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { + } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute sna/grid/local command"); - memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; - } else error->all(FLERR,"Illegal compute sna/grid/local command"); - + } else + error->all(FLERR, "Illegal compute sna/grid/local command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR,"Illegal compute sna/grid/local command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all(FLERR, + "Illegal compute sna/grid/local command: switchinnerflag = 1, missing sinner/dinner " + "keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR,"Illegal compute sna/grid/local command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all(FLERR, + "Illegal compute sna/grid/local command: switchinnerflag = 0, unexpected " + "sinner/dinner keyword"); - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, + wselfallflag, nelements, switchinnerflag); ncoeff = snaptr->ncoeff; nvalues = ncoeff; - if (quadraticflag) nvalues += (ncoeff*(ncoeff+1))/2; + if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; size_local_cols = size_local_cols_base + nvalues; } @@ -208,9 +198,8 @@ void ComputeSNAGridLocal::init() { int count = 0; for (int i = 0; i < modify->ncompute; i++) - if (strcmp(modify->compute[i]->style,"sna/grid/local") == 0) count++; - if (count > 1 && comm->me == 0) - error->warning(FLERR,"More than one compute sna/grid/local"); + if (strcmp(modify->compute[i]->style, "sna/grid/local") == 0) count++; + if (count > 1 && comm->me == 0) error->warning(FLERR, "More than one compute sna/grid/local"); snaptr->init(); } @@ -229,9 +218,9 @@ void ComputeSNAGridLocal::compute_local() // compute sna for each gridpoint - double** const x = atom->x; - const int* const mask = atom->mask; - int * const type = atom->type; + double **const x = atom->x; + const int *const mask = atom->mask; + int *const type = atom->type; const int ntotal = atom->nlocal + atom->nghost; // insure rij, inside, and typej are of size jnum @@ -252,8 +241,7 @@ void ComputeSNAGridLocal::compute_local() const int itype = 1; int ielem = 0; - if (chemflag) - ielem = map[itype]; + if (chemflag) ielem = map[itype]; // rij[][3] = displacements between atom I and those neighbors // inside = indices of neighbors of I within cutoff @@ -269,23 +257,23 @@ void ComputeSNAGridLocal::compute_local() const double delx = xtmp - x[j][0]; const double dely = ytmp - x[j][1]; const double delz = ztmp - x[j][2]; - const double rsq = delx*delx + dely*dely + delz*delz; + const double rsq = delx * delx + dely * dely + delz * delz; int jtype = type[j]; int jelem = 0; - if (chemflag) - jelem = map[jtype]; + if (chemflag) jelem = map[jtype]; if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][1] = dely; snaptr->rij[ninside][2] = delz; snaptr->inside[ninside] = j; snaptr->wj[ninside] = wjelem[jtype]; - snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; + snaptr->rcutij[ninside] = 2.0 * radelem[jtype] * rcutfac; if (switchinnerflag) { snaptr->sinnerij[ninside] = sinnerelem[jelem]; snaptr->dinnerij[ninside] = dinnerelem[jelem]; } - if (chemflag) snaptr->element[ninside] = jelem; // element index for multi-element snap + if (chemflag) + snaptr->element[ninside] = jelem; // element index for multi-element snap ninside++; } } @@ -297,7 +285,7 @@ void ComputeSNAGridLocal::compute_local() // linear contributions for (int icoeff = 0; icoeff < ncoeff; icoeff++) - alocal[igrid][size_local_cols_base+icoeff] = snaptr->blist[icoeff]; + alocal[igrid][size_local_cols_base + icoeff] = snaptr->blist[icoeff]; // quadratic contributions @@ -305,17 +293,15 @@ void ComputeSNAGridLocal::compute_local() int ncount = ncoeff; for (int icoeff = 0; icoeff < ncoeff; icoeff++) { double bveci = snaptr->blist[icoeff]; - alocal[igrid][size_local_cols_base+ncount++] = 0.5*bveci*bveci; - for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) - alocal[igrid][size_local_cols_base+ncount++] = - bveci*snaptr->blist[jcoeff]; + alocal[igrid][size_local_cols_base + ncount++] = 0.5 * bveci * bveci; + for (int jcoeff = icoeff + 1; jcoeff < ncoeff; jcoeff++) + alocal[igrid][size_local_cols_base + ncount++] = bveci * snaptr->blist[jcoeff]; } } igrid++; } } - /* ---------------------------------------------------------------------- memory usage ------------------------------------------------------------------------- */ @@ -323,9 +309,8 @@ void ComputeSNAGridLocal::compute_local() double ComputeSNAGridLocal::memory_usage() { double nbytes = snaptr->memory_usage(); // SNA object - int n = atom->ntypes+1; - nbytes += (double)n*sizeof(int); // map + int n = atom->ntypes + 1; + nbytes += (double) n * sizeof(int); // map return nbytes; } - diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h index c7678d049e..760d0de8cc 100644 --- a/src/ML-SNAP/compute_sna_grid_local.h +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -50,7 +50,7 @@ class ComputeSNAGridLocal : public ComputeGridLocal { int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 60c9987cbc..0a8ba5a697 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -12,25 +12,26 @@ ------------------------------------------------------------------------- */ #include "compute_grid.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" +#include "comm.h" #include "domain.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" -#include "comm.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), grid(nullptr), gridall(nullptr), gridlocal(nullptr) + Compute(lmp, narg, arg), grid(nullptr), gridall(nullptr), gridlocal(nullptr) { - if (narg < 6) error->all(FLERR,"Illegal compute grid command"); + if (narg < 6) error->all(FLERR, "Illegal compute grid command"); array_flag = 1; size_array_cols = 0; @@ -39,19 +40,19 @@ ComputeGrid::ComputeGrid(LAMMPS *lmp, int narg, char **arg) : int iarg0 = 3; int iarg = iarg0; - if (strcmp(arg[iarg],"grid") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal compute grid command"); - nx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - ny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); - nz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); - if (nx <= 0 || ny <= 0 || nz <= 0) - error->all(FLERR,"All grid dimensions must be positive"); + if (strcmp(arg[iarg], "grid") == 0) { + if (iarg + 4 > narg) error->all(FLERR, "Illegal compute grid command"); + nx = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); + ny = utils::inumeric(FLERR, arg[iarg + 2], false, lmp); + nz = utils::inumeric(FLERR, arg[iarg + 3], false, lmp); + if (nx <= 0 || ny <= 0 || nz <= 0) error->all(FLERR, "All grid dimensions must be positive"); iarg += 4; - } else error->all(FLERR,"Illegal compute grid command"); + } else + error->all(FLERR, "Illegal compute grid command"); nargbase = iarg - iarg0; - size_array_rows = nx*ny*nz; + size_array_rows = nx * ny * nz; size_array_cols_base = 3; gridlocal_allocated = 0; } @@ -65,9 +66,7 @@ ComputeGrid::~ComputeGrid() /* ---------------------------------------------------------------------- */ -void ComputeGrid::init() -{ -} +void ComputeGrid::init() {} /* ---------------------------------------------------------------------- */ @@ -85,18 +84,17 @@ void ComputeGrid::setup() void ComputeGrid::grid2x(int igrid, double *x) { - int iz = igrid / (nx*ny); - igrid -= iz * (nx*ny); + int iz = igrid / (nx * ny); + igrid -= iz * (nx * ny); int iy = igrid / nx; igrid -= iy * nx; int ix = igrid; - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; + x[0] = ix * delx; + x[1] = iy * dely; + x[2] = iz * delz; if (triclinic) domain->lamda2x(x, x); - } /* ---------------------------------------------------------------------- @@ -107,7 +105,7 @@ void ComputeGrid::assign_coords_all() { double x[3]; for (int igrid = 0; igrid < size_array_rows; igrid++) { - grid2x(igrid,x); + grid2x(igrid, x); gridall[igrid][0] = x[0]; gridall[igrid][1] = x[1]; gridall[igrid][2] = x[2]; @@ -122,18 +120,17 @@ void ComputeGrid::allocate() { // allocate arrays - printf("In allocate() %d %d \n", size_array_rows,size_array_cols); - memory->create(grid,size_array_rows,size_array_cols,"grid:grid"); - memory->create(gridall,size_array_rows,size_array_cols,"grid:gridall"); + printf("In allocate() %d %d \n", size_array_rows, size_array_cols); + memory->create(grid, size_array_rows, size_array_cols, "grid:grid"); + memory->create(gridall, size_array_rows, size_array_cols, "grid:gridall"); if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { gridlocal_allocated = 1; - memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, - nxlo,nxhi,"grid:gridlocal"); + memory->create4d_offset(gridlocal, size_array_cols, nzlo, nzhi, nylo, nyhi, nxlo, nxhi, + "grid:gridlocal"); } array = gridall; } - /* ---------------------------------------------------------------------- free arrays ------------------------------------------------------------------------- */ @@ -144,19 +141,18 @@ void ComputeGrid::deallocate() memory->destroy(gridall); if (gridlocal_allocated) { gridlocal_allocated = 0; - memory->destroy4d_offset(gridlocal,nzlo,nylo,nxlo); + memory->destroy4d_offset(gridlocal, nzlo, nylo, nxlo); } array = nullptr; } - /* ---------------------------------------------------------------------- set global grid ------------------------------------------------------------------------- */ void ComputeGrid::set_grid_global() { - // calculate grid layout + // calculate grid layout triclinic = domain->triclinic; @@ -176,13 +172,13 @@ void ComputeGrid::set_grid_global() double yprd = prd[1]; double zprd = prd[2]; - delxinv = nx/xprd; - delyinv = ny/yprd; - delzinv = nz/zprd; + delxinv = nx / xprd; + delyinv = ny / yprd; + delzinv = nz / zprd; - delx = 1.0/delxinv; - dely = 1.0/delyinv; - delz = 1.0/delzinv; + delx = 1.0 / delxinv; + dely = 1.0 / delyinv; + delz = 1.0 / delzinv; } /* ---------------------------------------------------------------------- @@ -202,15 +198,15 @@ void ComputeGrid::set_grid_local() // the 2 equality if tests insure a consistent decision // as to which proc owns it - double xfraclo,xfrachi,yfraclo,yfrachi,zfraclo,zfrachi; + double xfraclo, xfrachi, yfraclo, yfrachi, zfraclo, zfrachi; if (comm->layout != Comm::LAYOUT_TILED) { xfraclo = comm->xsplit[comm->myloc[0]]; - xfrachi = comm->xsplit[comm->myloc[0]+1]; + xfrachi = comm->xsplit[comm->myloc[0] + 1]; yfraclo = comm->ysplit[comm->myloc[1]]; - yfrachi = comm->ysplit[comm->myloc[1]+1]; + yfrachi = comm->ysplit[comm->myloc[1] + 1]; zfraclo = comm->zsplit[comm->myloc[2]]; - zfrachi = comm->zsplit[comm->myloc[2]+1]; + zfrachi = comm->zsplit[comm->myloc[2] + 1]; } else { xfraclo = comm->mysplit[0][0]; xfrachi = comm->mysplit[0][1]; @@ -220,23 +216,22 @@ void ComputeGrid::set_grid_local() zfrachi = comm->mysplit[2][1]; } - nxlo = static_cast (xfraclo * nx); - if (1.0*nxlo != xfraclo*nx) nxlo++; - nxhi = static_cast (xfrachi * nx); - if (1.0*nxhi == xfrachi*nx) nxhi--; + nxlo = static_cast(xfraclo * nx); + if (1.0 * nxlo != xfraclo * nx) nxlo++; + nxhi = static_cast(xfrachi * nx); + if (1.0 * nxhi == xfrachi * nx) nxhi--; - nylo = static_cast (yfraclo * ny); - if (1.0*nylo != yfraclo*ny) nylo++; - nyhi = static_cast (yfrachi * ny); - if (1.0*nyhi == yfrachi*ny) nyhi--; + nylo = static_cast(yfraclo * ny); + if (1.0 * nylo != yfraclo * ny) nylo++; + nyhi = static_cast(yfrachi * ny); + if (1.0 * nyhi == yfrachi * ny) nyhi--; - nzlo = static_cast (zfraclo * nz); - if (1.0*nzlo != zfraclo*nz) nzlo++; - nzhi = static_cast (zfrachi * nz); - if (1.0*nzhi == zfrachi*nz) nzhi--; + nzlo = static_cast(zfraclo * nz); + if (1.0 * nzlo != zfraclo * nz) nzlo++; + nzhi = static_cast(zfrachi * nz); + if (1.0 * nzhi == zfrachi * nz) nzhi--; ngridlocal = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); - } /* ---------------------------------------------------------------------- @@ -245,10 +240,8 @@ void ComputeGrid::set_grid_local() double ComputeGrid::memory_usage() { - double nbytes = size_array_rows*size_array_cols * - sizeof(double); // grid - nbytes += size_array_rows*size_array_cols * - sizeof(double); // gridall - nbytes += size_array_cols*ngridlocal*sizeof(double); // gridlocal + double nbytes = size_array_rows * size_array_cols * sizeof(double); // grid + nbytes += size_array_rows * size_array_cols * sizeof(double); // gridall + nbytes += size_array_cols * ngridlocal * sizeof(double); // gridlocal return nbytes; } diff --git a/src/compute_grid.h b/src/compute_grid.h index 4264039cc8..96338a035d 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -20,7 +20,6 @@ namespace LAMMPS_NS { class ComputeGrid : public Compute { public: - ComputeGrid(class LAMMPS *, int, char **); ~ComputeGrid() override; void init() override; @@ -30,31 +29,31 @@ class ComputeGrid : public Compute { double memory_usage() override; protected: - int nx, ny, nz; // global grid dimensions - int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive - int ngridlocal; // number of local grid points - int nvalues; // number of values per grid point - double **grid; // global grid - double **gridall; // global grid summed over procs - double ****gridlocal; // local grid - int triclinic; // triclinic flag - double *boxlo, *prd; // box info (units real/ortho or reduced/tri) - double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) - double delxinv,delyinv,delzinv; // inverse grid spacing - double delx,dely,delz; // grid spacing - int nargbase; // number of base class args - double cutmax; // largest cutoff distance - int size_array_cols_base; // number of columns used for coords, etc. - int gridlocal_allocated; // shows if gridlocal allocated + int nx, ny, nz; // global grid dimensions + int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive + int ngridlocal; // number of local grid points + int nvalues; // number of values per grid point + double **grid; // global grid + double **gridall; // global grid summed over procs + double ****gridlocal; // local grid + int triclinic; // triclinic flag + double *boxlo, *prd; // box info (units real/ortho or reduced/tri) + double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) + double delxinv, delyinv, delzinv; // inverse grid spacing + double delx, dely, delz; // grid spacing + int nargbase; // number of base class args + double cutmax; // largest cutoff distance + int size_array_cols_base; // number of columns used for coords, etc. + int gridlocal_allocated; // shows if gridlocal allocated - void allocate(); // create arrays - void deallocate(); // free arrays - void grid2x(int, double*); // convert grid point to coord - void assign_coords_all(); // assign coords for global grid - void set_grid_global(); // set global grid - void set_grid_local(); // set bounds for local grid + void allocate(); // create arrays + void deallocate(); // free arrays + void grid2x(int, double *); // convert grid point to coord + void assign_coords_all(); // assign coords for global grid + void set_grid_global(); // set global grid + void set_grid_local(); // set bounds for local grid }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index e30d06fe45..5f341680bd 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -12,29 +12,30 @@ ------------------------------------------------------------------------- */ #include "compute_grid_local.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" +#include "comm.h" #include "domain.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" -#include "comm.h" +#include "modify.h" +#include "update.h" + +#include // For the subdomain test below; grid-points and subdomain boundaries // sometimes differ by minimal amounts (in the order of 2e-17). -#define EPSILON 1.0e-10 +static constexpr double EPSILON = 1.0e-10; using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGridLocal::ComputeGridLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), alocal(nullptr) + Compute(lmp, narg, arg), alocal(nullptr) { - if (narg < 6) error->all(FLERR,"Illegal compute grid/local command"); + if (narg < 6) error->all(FLERR, "Illegal compute grid/local command"); local_flag = 1; size_local_cols = 0; @@ -43,15 +44,16 @@ ComputeGridLocal::ComputeGridLocal(LAMMPS *lmp, int narg, char **arg) : int iarg0 = 3; int iarg = iarg0; - if (strcmp(arg[iarg],"grid") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal compute grid/local command"); - nx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - ny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); - nz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + if (strcmp(arg[iarg], "grid") == 0) { + if (iarg + 4 > narg) error->all(FLERR, "Illegal compute grid/local command"); + nx = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); + ny = utils::inumeric(FLERR, arg[iarg + 2], false, lmp); + nz = utils::inumeric(FLERR, arg[iarg + 3], false, lmp); if (nx <= 0 || ny <= 0 || nz <= 0) - error->all(FLERR,"All grid/local dimensions must be positive"); + error->all(FLERR, "All grid/local dimensions must be positive"); iarg += 4; - } else error->all(FLERR,"Illegal compute grid/local command"); + } else + error->all(FLERR, "Illegal compute grid/local command"); nargbase = iarg - iarg0; @@ -68,9 +70,7 @@ ComputeGridLocal::~ComputeGridLocal() /* ---------------------------------------------------------------------- */ -void ComputeGridLocal::init() -{ -} +void ComputeGridLocal::init() {} /* ---------------------------------------------------------------------- */ @@ -89,9 +89,9 @@ void ComputeGridLocal::setup() void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) { - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; + x[0] = ix * delx; + x[1] = iy * dely; + x[2] = iz * delz; if (triclinic) domain->lamda2x(x, x); } @@ -103,12 +103,11 @@ void ComputeGridLocal::grid2x(int ix, int iy, int iz, double *x) void ComputeGridLocal::grid2lamda(int ix, int iy, int iz, double *x) { - x[0] = ix*delx; - x[1] = iy*dely; - x[2] = iz*delz; + x[0] = ix * delx; + x[1] = iy * dely; + x[2] = iz * delz; } - /* ---------------------------------------------------------------------- create arrays ------------------------------------------------------------------------- */ @@ -141,7 +140,7 @@ void ComputeGridLocal::deallocate() void ComputeGridLocal::set_grid_global() { - // calculate grid layout + // calculate grid layout triclinic = domain->triclinic; @@ -161,13 +160,13 @@ void ComputeGridLocal::set_grid_global() double yprd = prd[1]; double zprd = prd[2]; - delxinv = nx/xprd; - delyinv = ny/yprd; - delzinv = nz/zprd; + delxinv = nx / xprd; + delyinv = ny / yprd; + delzinv = nz / zprd; - delx = 1.0/delxinv; - dely = 1.0/delyinv; - delz = 1.0/delzinv; + delx = 1.0 / delxinv; + dely = 1.0 / delyinv; + delz = 1.0 / delzinv; } /* ---------------------------------------------------------------------- @@ -187,15 +186,15 @@ void ComputeGridLocal::set_grid_local() // the 2 equality if tests insure a consistent decision // as to which proc owns it - double xfraclo,xfrachi,yfraclo,yfrachi,zfraclo,zfrachi; + double xfraclo, xfrachi, yfraclo, yfrachi, zfraclo, zfrachi; if (comm->layout != Comm::LAYOUT_TILED) { xfraclo = comm->xsplit[comm->myloc[0]]; - xfrachi = comm->xsplit[comm->myloc[0]+1]; + xfrachi = comm->xsplit[comm->myloc[0] + 1]; yfraclo = comm->ysplit[comm->myloc[1]]; - yfrachi = comm->ysplit[comm->myloc[1]+1]; + yfrachi = comm->ysplit[comm->myloc[1] + 1]; zfraclo = comm->zsplit[comm->myloc[2]]; - zfrachi = comm->zsplit[comm->myloc[2]+1]; + zfrachi = comm->zsplit[comm->myloc[2] + 1]; } else { xfraclo = comm->mysplit[0][0]; xfrachi = comm->mysplit[0][1]; @@ -205,20 +204,20 @@ void ComputeGridLocal::set_grid_local() zfrachi = comm->mysplit[2][1]; } - nxlo = static_cast (xfraclo * nx); - if (1.0*nxlo != xfraclo*nx) nxlo++; - nxhi = static_cast (xfrachi * nx); - if (1.0*nxhi == xfrachi*nx) nxhi--; + nxlo = static_cast(xfraclo * nx); + if (1.0 * nxlo != xfraclo * nx) nxlo++; + nxhi = static_cast(xfrachi * nx); + if (1.0 * nxhi == xfrachi * nx) nxhi--; - nylo = static_cast (yfraclo * ny); - if (1.0*nylo != yfraclo*ny) nylo++; - nyhi = static_cast (yfrachi * ny); - if (1.0*nyhi == yfrachi*ny) nyhi--; + nylo = static_cast(yfraclo * ny); + if (1.0 * nylo != yfraclo * ny) nylo++; + nyhi = static_cast(yfrachi * ny); + if (1.0 * nyhi == yfrachi * ny) nyhi--; - nzlo = static_cast (zfraclo * nz); - if (1.0*nzlo != zfraclo*nz) nzlo++; - nzhi = static_cast (zfrachi * nz); - if (1.0*nzhi == zfrachi*nz) nzhi--; + nzlo = static_cast(zfraclo * nz); + if (1.0 * nzlo != zfraclo * nz) nzlo++; + nzhi = static_cast(zfrachi * nz); + if (1.0 * nzhi == zfrachi * nz) nzhi--; size_local_rows = (nxhi - nxlo + 1) * (nyhi - nylo + 1) * (nzhi - nzlo + 1); } @@ -248,10 +247,10 @@ void ComputeGridLocal::assign_coords() // ensure gridpoint is not strictly outside subdomain - if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON || - (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || - (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) - error->one(FLERR,"Invalid gridpoint position in compute grid/local"); + if ((sublo[0] - xgrid[0]) > EPSILON || (xgrid[0] - subhi[0]) > EPSILON || + (sublo[1] - xgrid[1]) > EPSILON || (xgrid[1] - subhi[1]) > EPSILON || + (sublo[2] - xgrid[2]) > EPSILON || (xgrid[2] - subhi[2]) > EPSILON) + error->one(FLERR, "Invalid gridpoint position in compute grid/local"); // convert lamda to x, y, z, after sudomain check @@ -270,6 +269,6 @@ void ComputeGridLocal::assign_coords() double ComputeGridLocal::memory_usage() { - int nbytes = size_local_rows * size_local_cols * sizeof(double); // gridlocal + int nbytes = size_local_rows * size_local_cols * sizeof(double); // gridlocal return nbytes; } diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index 2989628d79..b34dd2d096 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -20,7 +20,6 @@ namespace LAMMPS_NS { class ComputeGridLocal : public Compute { public: - ComputeGridLocal(class LAMMPS *, int, char **); ~ComputeGridLocal() override; void init() override; @@ -30,29 +29,29 @@ class ComputeGridLocal : public Compute { double memory_usage() override; protected: - int nx, ny, nz; // global grid dimensions - int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive - int nvalues; // number of values per grid point - double **alocal; // pointer to Compute::array_local - int triclinic; // triclinic flag - double *boxlo, *prd; // box info (units real/ortho or reduced/tri) - double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) - double delxinv,delyinv,delzinv; // inverse grid spacing - double delx,dely,delz; // grid spacing - int nargbase; // number of base class args - double cutmax; // largest cutoff distance - int size_local_cols_base; // number of columns used for coords, etc. - int gridlocal_allocated; // shows if gridlocal allocated + int nx, ny, nz; // global grid dimensions + int nxlo, nxhi, nylo, nyhi, nzlo, nzhi; // local grid bounds, inclusive + int nvalues; // number of values per grid point + double **alocal; // pointer to Compute::array_local + int triclinic; // triclinic flag + double *boxlo, *prd; // box info (units real/ortho or reduced/tri) + double *sublo, *subhi; // subdomain info (units real/ortho or reduced/tri) + double delxinv, delyinv, delzinv; // inverse grid spacing + double delx, dely, delz; // grid spacing + int nargbase; // number of base class args + double cutmax; // largest cutoff distance + int size_local_cols_base; // number of columns used for coords, etc. + int gridlocal_allocated; // shows if gridlocal allocated - void allocate(); // create arrays - void deallocate(); // free arrays - void grid2x(int, int, int, double*); // convert global indices to coordinates - void grid2lamda(int, int, int, double*); // convert global indices to lamda coordinates - void set_grid_global(); // set global grid - void set_grid_local(); // set bounds for local grid - void assign_coords(); // assign coords for grid + void allocate(); // create arrays + void deallocate(); // free arrays + void grid2x(int, int, int, double *); // convert global indices to coordinates + void grid2lamda(int, int, int, double *); // convert global indices to lamda coordinates + void set_grid_global(); // set global grid + void set_grid_local(); // set bounds for local grid + void assign_coords(); // assign coords for grid }; -} +} // namespace LAMMPS_NS #endif From b46773e39869e0cc73fc91fdd776a76f401e4b69 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 15:53:04 -0400 Subject: [PATCH 134/172] add support for writing a dump file footer --- src/EXTRA-DUMP/dump_yaml.cpp | 6 ++++++ src/EXTRA-DUMP/dump_yaml.h | 1 + src/dump.cpp | 2 ++ src/dump.h | 2 ++ 4 files changed, 11 insertions(+) diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp index d4f3208ffb..be1c9768bf 100644 --- a/src/EXTRA-DUMP/dump_yaml.cpp +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -124,6 +124,12 @@ void DumpYAML::write_data(int n, double *mybuf) } fputs("]\n", fp); } +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write_footer() +{ fputs("...\n", fp); } diff --git a/src/EXTRA-DUMP/dump_yaml.h b/src/EXTRA-DUMP/dump_yaml.h index bf621dcb51..60ab894de4 100644 --- a/src/EXTRA-DUMP/dump_yaml.h +++ b/src/EXTRA-DUMP/dump_yaml.h @@ -35,6 +35,7 @@ class DumpYAML : public DumpCustom { void write() override; void write_header(bigint) override; void write_data(int, double *) override; + void write_footer() override; int modify_param(int, char **) override; }; diff --git a/src/dump.cpp b/src/dump.cpp index 3569d32165..a354be4f04 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -517,6 +517,8 @@ void Dump::write() if (refreshflag) modify->compute[irefresh]->refresh(); + if (filewriter && fp != nullptr) write_footer(); + // if file per timestep, close file if I am filewriter if (multifile) { diff --git a/src/dump.h b/src/dump.h index a95029ada8..90866a3567 100644 --- a/src/dump.h +++ b/src/dump.h @@ -153,6 +153,8 @@ class Dump : protected Pointers { virtual void pack(tagint *) = 0; virtual int convert_string(int, double *) { return 0; } virtual void write_data(int, double *) = 0; + virtual void write_footer() {} + void pbc_allocate(); double compute_time(); From 86f0a62ee0454694f8fe8ed9cc2e68ce27138327 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 17 Jun 2022 17:16:02 -0600 Subject: [PATCH 135/172] Cleaned up programming style --- doc/src/compute_sna_atom.rst | 46 ++++++++++++++++++++---------------- src/compute_grid.cpp | 5 ---- src/compute_grid.h | 1 - src/compute_grid_local.cpp | 4 ---- src/compute_grid_local.h | 1 - 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index 5f777685fd..242defe614 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -15,6 +15,12 @@ compute snav/atom command compute snap command ==================== +compute sna/grid command +======================== + +compute sna/grid/local command +============================== + Syntax """""" @@ -222,13 +228,13 @@ bispectrum components for a regular grid of points. These are calculated from the local density of nearby atoms *i'* around each grid point, as if there was a central atom *i* at the grid point. This is useful for characterizing fine-scale -structure in a configuration of atoms, and it has been used -to build a machine-learning surrogate for finite-temperature Kohn-Sham -density functional theory (:ref:`Ellis et al. `). +structure in a configuration of atoms, and it is used +in the `MALA package `_ +to build machine-learning surrogates for finite-temperature Kohn-Sham +density functional theory (:ref:`Ellis et al. `) Neighbor atoms not in the group do not contribute to the bispectrum components of the grid points. The distance cutoff :math:`R_{ii'}` -and other parameters are defined as for a central atom with the same type as the -neighbor atoms *i'*. +assumes that *i* has the same type as the neighbor atom *i'*. Compute *sna/grid* calculates a global array containing bispectrum components for a regular grid of points. @@ -688,6 +694,21 @@ number of columns in the global array generated by *snap* are 31, and 931, respectively, while the number of rows is 1+3\*\ *N*\ +6, where *N* is the total number of atoms. +Compute *sna/grid* evaluates a global array. +The array contains one row for each of the +:math:`nx \times ny \times nz` grid points, looping over the index for *ix* fastest, +then *iy*, and *iz* slowest. Each row of the array contains the *x*, *y*, +and *z* coordinates of the grid point, followed by the bispectrum +components. + +Compute *sna/grid/local* evaluates a local array. +The array contains one row for each of the +local grid points, looping over the global index *ix* fastest, +then *iy*, and *iz* slowest. Each row of the array contains +the global indexes *ix*, *iy*, and *iz* first, followed by the *x*, *y*, +and *z* coordinates of the grid point, followed by the bispectrum +components. + If the *quadratic* keyword value is set to 1, then additional columns are generated, corresponding to the products of all distinct pairs of bispectrum components. If the number of bispectrum components is *K*, @@ -715,21 +736,6 @@ page for an overview of LAMMPS output options. To see how this command can be used within a Python workflow to train SNAP potentials, see the examples in `FitSNAP `_. -Compute *sna/grid* evaluates a global array. -The array contains one row for each of the -:math:`nx \times ny \times nz` grid points, looping over the index for *ix* fastest, -then *iy*, and *iz* slowest. Each row of the array contains the *x*, *y*, -and *z* coordinates of the grid point, followed by the bispectrum -components. - -Compute *sna/grid/local* evaluates a local array. -The array contains one row for each of the -local grid points, looping over the global index *ix* fastest, -then *iy*, and *iz* slowest. Each row of the array contains -the global indexes *ix*, *iy*, and *iz* first, followed by the *x*, *y*, -and *z* coordinates of the grid point, followed by the bispectrum -components. - Restrictions """""""""""" diff --git a/src/compute_grid.cpp b/src/compute_grid.cpp index 0a8ba5a697..7a5ffe1e24 100644 --- a/src/compute_grid.cpp +++ b/src/compute_grid.cpp @@ -66,10 +66,6 @@ ComputeGrid::~ComputeGrid() /* ---------------------------------------------------------------------- */ -void ComputeGrid::init() {} - -/* ---------------------------------------------------------------------- */ - void ComputeGrid::setup() { deallocate(); @@ -120,7 +116,6 @@ void ComputeGrid::allocate() { // allocate arrays - printf("In allocate() %d %d \n", size_array_rows, size_array_cols); memory->create(grid, size_array_rows, size_array_cols, "grid:grid"); memory->create(gridall, size_array_rows, size_array_cols, "grid:gridall"); if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { diff --git a/src/compute_grid.h b/src/compute_grid.h index 96338a035d..84b3bc4e98 100644 --- a/src/compute_grid.h +++ b/src/compute_grid.h @@ -22,7 +22,6 @@ class ComputeGrid : public Compute { public: ComputeGrid(class LAMMPS *, int, char **); ~ComputeGrid() override; - void init() override; void setup() override; void compute_array() override = 0; diff --git a/src/compute_grid_local.cpp b/src/compute_grid_local.cpp index 5f341680bd..48714962ac 100644 --- a/src/compute_grid_local.cpp +++ b/src/compute_grid_local.cpp @@ -70,10 +70,6 @@ ComputeGridLocal::~ComputeGridLocal() /* ---------------------------------------------------------------------- */ -void ComputeGridLocal::init() {} - -/* ---------------------------------------------------------------------- */ - void ComputeGridLocal::setup() { deallocate(); diff --git a/src/compute_grid_local.h b/src/compute_grid_local.h index b34dd2d096..5bc6f2082a 100644 --- a/src/compute_grid_local.h +++ b/src/compute_grid_local.h @@ -22,7 +22,6 @@ class ComputeGridLocal : public Compute { public: ComputeGridLocal(class LAMMPS *, int, char **); ~ComputeGridLocal() override; - void init() override; void setup() override; void compute_local() override = 0; From 44436c0eb662fb4e396c8496354bbe59b04e3f31 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 17 Jun 2022 17:24:34 -0600 Subject: [PATCH 136/172] Cleaned up programming style --- src/ML-SNAP/compute_sna_atom.cpp | 151 ++++++++--------- src/ML-SNAP/compute_sna_atom.h | 1 + src/ML-SNAP/compute_sna_grid.cpp | 92 +++++----- src/ML-SNAP/compute_sna_grid.h | 2 - src/ML-SNAP/compute_sna_grid_local.cpp | 114 ++++++------- src/ML-SNAP/compute_sna_grid_local.h | 2 - src/ML-SNAP/compute_snad_atom.cpp | 157 ++++++++--------- src/ML-SNAP/compute_snad_atom.h | 2 +- src/ML-SNAP/compute_snap.cpp | 177 ++++++++++--------- src/ML-SNAP/compute_snap.h | 2 +- src/ML-SNAP/compute_snav_atom.cpp | 224 +++++++++++++------------ src/ML-SNAP/compute_snav_atom.h | 3 +- 12 files changed, 460 insertions(+), 467 deletions(-) diff --git a/src/ML-SNAP/compute_sna_atom.cpp b/src/ML-SNAP/compute_sna_atom.cpp index 5f24ebeaa6..69f233b1c3 100644 --- a/src/ML-SNAP/compute_sna_atom.cpp +++ b/src/ML-SNAP/compute_sna_atom.cpp @@ -30,25 +30,28 @@ using namespace LAMMPS_NS; +#define SNAPCOMPUTENAME "sna/atom" + ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), sna(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) { - double rmin0, rfac0; + // code common to all SNAP computes + + double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; int ntypes = atom->ntypes; - int nargmin = 6+2*ntypes; + int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR,"Illegal compute sna/atom command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); // default values rmin0 = 0.0; switchflag = 1; bzeroflag = 1; - bnormflag = 0; quadraticflag = 0; chemflag = 0; bnormflag = 0; @@ -56,32 +59,34 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : switchinnerflag = 0; nelements = 1; - // offset by 1 to match up with types + // process required arguments - memory->create(radelem,ntypes+1,"sna/atom:radelem"); - memory->create(wjelem,ntypes+1,"sna/atom:wjelem"); + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); - rcutfac = atof(arg[3]); - rfac0 = atof(arg[4]); - twojmax = atoi(arg[5]); + rcutfac = utils::numeric(FLERR, arg[3], false, lmp); + rfac0 = utils::numeric(FLERR, arg[4], false, lmp); + twojmax = utils::inumeric(FLERR, arg[5], false, lmp); for (int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[6+i]); + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[6+ntypes+i]); + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"sna/atom:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; + cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; - cutsq[i][i] = cut*cut; - for (int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; + cutsq[i][i] = cut * cut; + for (int j = i + 1; j <= ntypes; j++) { + cut = (radelem[i] + radelem[j]) * rcutfac; + cutsq[i][j] = cutsq[j][i] = cut * cut; } } @@ -95,89 +100,85 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - rmin0 = atof(arg[iarg+1]); + if (strcmp(arg[iarg], "rmin0") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - switchflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - bzeroflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "bzeroflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - quadraticflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "quadraticflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2+ntypes > narg) - error->all(FLERR,"Illegal compute sna/atom command"); + } else if (strcmp(arg[iarg], "chem") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_sna_atom:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + memory->create(map, ntypes + 1, "compute_sna_grid:map"); + nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal compute sna/atom command"); - map[i+1] = jelem; + int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + map[i + 1] = jelem; } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - bnormflag = atoi(arg[iarg+1]); + iarg += 2 + ntypes; + } else if (strcmp(arg[iarg], "bnormflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - wselfallflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "wselfallflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - switchinnerflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { + } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - memory->create(sinnerelem,ntypes+1,"sna/atom:sinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); sinnerflag = 1; iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { + } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute sna/atom command"); - memory->create(dinnerelem,ntypes+1,"sna/atom:dinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; - } else error->all(FLERR,"Illegal compute sna/atom command"); + } else + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR,"Illegal compute sna/atom command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR,"Illegal compute sna/atom command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, + wselfallflag, nelements, switchinnerflag); ncoeff = snaptr->ncoeff; - size_peratom_cols = ncoeff; - if (quadraticflag) size_peratom_cols += (ncoeff*(ncoeff+1))/2; + nvalues = ncoeff; + if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; + + // end code common to all SNAP computes + + size_peratom_cols = nvalues; peratom_flag = 1; nmax = 0; diff --git a/src/ML-SNAP/compute_sna_atom.h b/src/ML-SNAP/compute_sna_atom.h index 7d1ebfa2f8..059062670f 100644 --- a/src/ML-SNAP/compute_sna_atom.h +++ b/src/ML-SNAP/compute_sna_atom.h @@ -50,6 +50,7 @@ class ComputeSNAAtom : public Compute { class SNA *snaptr; double cutmax; int quadraticflag; + int nvalues; }; } // namespace LAMMPS_NS diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index e182b16d64..4c8e4f82ef 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -15,17 +15,11 @@ #include "atom.h" #include "comm.h" -#include "domain.h" #include "error.h" #include "force.h" #include "memory.h" #include "modify.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "neighbor.h" -#include "pair.h" #include "sna.h" -#include "tokenizer.h" #include "update.h" #include @@ -33,12 +27,11 @@ using namespace LAMMPS_NS; +#define SNAPCOMPUTENAME "sna/grid" + ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { - double rfac0, rmin0; - int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - // skip over arguments used by base class // so that argument positions are identical to // regular per-atom compute @@ -46,10 +39,15 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : arg += nargbase; narg -= nargbase; + // code common to all SNAP computes + + double rfac0, rmin0; + int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; + int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute sna/grid command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); // default values @@ -65,15 +63,19 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "sna/grid:radelem"); // offset by 1 to match up with types + memory->create(radelem, ntypes + 1, "sna/grid:radelem"); // offset by 1 to match up with types memory->create(wjelem, ntypes + 1, "sna/grid:wjelem"); - rcutfac = atof(arg[3]); - rfac0 = atof(arg[4]); - twojmax = atoi(arg[5]); + rcutfac = utils::numeric(FLERR, arg[3], false, lmp); + rfac0 = utils::numeric(FLERR, arg[4], false, lmp); + twojmax = utils::inumeric(FLERR, arg[5], false, lmp); - for (int i = 0; i < ntypes; i++) radelem[i + 1] = atof(arg[6 + i]); - for (int i = 0; i < ntypes; i++) wjelem[i + 1] = atof(arg[6 + ntypes + i]); + for (int i = 0; i < ntypes; i++) + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); + for (int i = 0; i < ntypes; i++) + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq @@ -101,47 +103,47 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - rmin0 = atof(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - switchflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - bzeroflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - quadraticflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute sna/grid command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - bnormflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - wselfallflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid command"); - switchinnerflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -149,25 +151,25 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute sna/grid command"); + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute sna/grid command: switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute sna/grid command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); @@ -175,6 +177,9 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : ncoeff = snaptr->ncoeff; nvalues = ncoeff; if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; + + // end code common to all SNAP computes + size_array_cols = size_array_cols_base + nvalues; array_flag = 1; } @@ -195,22 +200,13 @@ ComputeSNAGrid::~ComputeSNAGrid() void ComputeSNAGrid::init() { - int count = 0; - for (int i = 0; i < modify->ncompute; i++) - if (strcmp(modify->compute[i]->style, "sna/grid") == 0) count++; - if (count > 1 && comm->me == 0) error->warning(FLERR, "More than one compute sna/grid"); + if ((modify->get_compute_by_style("sna/grid").size() > 1) && (comm->me == 0)) + error->warning(FLERR, "More than one instance of compute sna/grid"); snaptr->init(); } /* ---------------------------------------------------------------------- */ -void ComputeSNAGrid::init_list(int /*id*/, NeighList *ptr) -{ - list = ptr; -} - -/* ---------------------------------------------------------------------- */ - void ComputeSNAGrid::compute_array() { invoked_array = update->ntimestep; diff --git a/src/ML-SNAP/compute_sna_grid.h b/src/ML-SNAP/compute_sna_grid.h index 7eef027ef7..839003dc2e 100644 --- a/src/ML-SNAP/compute_sna_grid.h +++ b/src/ML-SNAP/compute_sna_grid.h @@ -29,14 +29,12 @@ class ComputeSNAGrid : public ComputeGrid { ComputeSNAGrid(class LAMMPS *, int, char **); ~ComputeSNAGrid() override; void init() override; - void init_list(int, class NeighList *) override; void compute_array() override; double memory_usage() override; private: int ncoeff; double **cutsq; - class NeighList *list; double rcutfac; double *radelem; double *wjelem; diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 7359acacbf..d9d66787f4 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -15,17 +15,11 @@ #include "atom.h" #include "comm.h" -#include "domain.h" #include "error.h" #include "force.h" #include "memory.h" #include "modify.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "neighbor.h" -#include "pair.h" #include "sna.h" -#include "tokenizer.h" #include "update.h" #include @@ -33,12 +27,11 @@ using namespace LAMMPS_NS; +#define SNAPCOMPUTENAME "sna/grid/local" + ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : ComputeGridLocal(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { - double rfac0, rmin0; - int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - // skip over arguments used by base class // so that argument positions are identical to // regular per-atom compute @@ -46,10 +39,15 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : arg += nargbase; narg -= nargbase; + // code common to all SNAP computes + + double rfac0, rmin0; + int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; + int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute sna/grid/local command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); // default values @@ -63,23 +61,21 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : switchinnerflag = 0; nelements = 1; - // set local input checks - - int sinnerflag = 0; - int dinnerflag = 0; - // process required arguments - memory->create(radelem, ntypes + 1, - "sna/grid/local:radelem"); // offset by 1 to match up with types + memory->create(radelem, ntypes + 1, "sna/grid/local:radelem"); // offset by 1 to match up with types memory->create(wjelem, ntypes + 1, "sna/grid/local:wjelem"); - rcutfac = atof(arg[3]); - rfac0 = atof(arg[4]); - twojmax = atoi(arg[5]); + rcutfac = utils::numeric(FLERR, arg[3], false, lmp); + rfac0 = utils::numeric(FLERR, arg[4], false, lmp); + twojmax = utils::inumeric(FLERR, arg[5], false, lmp); - for (int i = 0; i < ntypes; i++) radelem[i + 1] = atof(arg[6 + i]); - for (int i = 0; i < ntypes; i++) wjelem[i + 1] = atof(arg[6 + ntypes + i]); + for (int i = 0; i < ntypes; i++) + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); + for (int i = 0; i < ntypes; i++) + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq @@ -96,54 +92,58 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : } } + // set local input checks + + int sinnerflag = 0; + int dinnerflag = 0; + // process optional args int iarg = nargmin; while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - rmin0 = atof(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - switchflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - bzeroflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - quadraticflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); chemflag = 1; - memory->create(map, ntypes + 1, "compute_sna_grid_local:map"); + memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR, "Illegal compute sna/grid/local command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - bnormflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - wselfallflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); - switchinnerflag = atoi(arg[iarg + 1]); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -151,25 +151,25 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute sna/grid/local command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute sna/grid/local command"); + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR, - "Illegal compute sna/grid/local command: switchinnerflag = 1, missing sinner/dinner " - "keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR, - "Illegal compute sna/grid/local command: switchinnerflag = 0, unexpected " - "sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); @@ -177,6 +177,9 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : ncoeff = snaptr->ncoeff; nvalues = ncoeff; if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; + + // end code common to all SNAP computes + size_local_cols = size_local_cols_base + nvalues; } @@ -196,22 +199,13 @@ ComputeSNAGridLocal::~ComputeSNAGridLocal() void ComputeSNAGridLocal::init() { - int count = 0; - for (int i = 0; i < modify->ncompute; i++) - if (strcmp(modify->compute[i]->style, "sna/grid/local") == 0) count++; - if (count > 1 && comm->me == 0) error->warning(FLERR, "More than one compute sna/grid/local"); + if ((modify->get_compute_by_style("sna/grid/local").size() > 1) && (comm->me == 0)) + error->warning(FLERR, "More than one instance of compute sna/grid/local"); snaptr->init(); } /* ---------------------------------------------------------------------- */ -void ComputeSNAGridLocal::init_list(int /*id*/, NeighList *ptr) -{ - list = ptr; -} - -/* ---------------------------------------------------------------------- */ - void ComputeSNAGridLocal::compute_local() { invoked_array = update->ntimestep; diff --git a/src/ML-SNAP/compute_sna_grid_local.h b/src/ML-SNAP/compute_sna_grid_local.h index 760d0de8cc..60f93b92b0 100644 --- a/src/ML-SNAP/compute_sna_grid_local.h +++ b/src/ML-SNAP/compute_sna_grid_local.h @@ -29,14 +29,12 @@ class ComputeSNAGridLocal : public ComputeGridLocal { ComputeSNAGridLocal(class LAMMPS *, int, char **); ~ComputeSNAGridLocal() override; void init() override; - void init_list(int, class NeighList *) override; void compute_local() override; double memory_usage() override; private: int ncoeff; double **cutsq; - class NeighList *list; double rcutfac; double *radelem; double *wjelem; diff --git a/src/ML-SNAP/compute_snad_atom.cpp b/src/ML-SNAP/compute_snad_atom.cpp index 838d8a85c9..c9a88da535 100644 --- a/src/ML-SNAP/compute_snad_atom.cpp +++ b/src/ML-SNAP/compute_snad_atom.cpp @@ -30,24 +30,27 @@ using namespace LAMMPS_NS; +#define SNAPCOMPUTENAME "snad/atom" + ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snad(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) { + // code common to all SNAP computes + double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; int ntypes = atom->ntypes; - int nargmin = 6+2*ntypes; + int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR,"Illegal compute snad/atom command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); // default values rmin0 = 0.0; switchflag = 1; bzeroflag = 1; - bnormflag = 0; quadraticflag = 0; chemflag = 0; bnormflag = 0; @@ -57,28 +60,32 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem,ntypes+1,"snad/atom:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"snad/atom:wjelem"); - rcutfac = atof(arg[3]); - rfac0 = atof(arg[4]); - twojmax = atoi(arg[5]); + memory->create(radelem, ntypes + 1, "snad/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "snad/atom:wjelem"); + + rcutfac = utils::numeric(FLERR, arg[3], false, lmp); + rfac0 = utils::numeric(FLERR, arg[4], false, lmp); + twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[6+i]); + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[6+ntypes+i]); + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"snad/atom:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "snad/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; + cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; - cutsq[i][i] = cut*cut; - for (int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; + cutsq[i][i] = cut * cut; + for (int j = i + 1; j <= ntypes; j++) { + cut = (radelem[i] + radelem[j]) * rcutfac; + cutsq[i][j] = cutsq[j][i] = cut * cut; } } @@ -92,93 +99,87 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - rmin0 = atof(arg[iarg+1]); + if (strcmp(arg[iarg], "rmin0") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - bzeroflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - switchflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "bzeroflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - quadraticflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "quadraticflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2+ntypes > narg) - error->all(FLERR,"Illegal compute snad/atom command"); + } else if (strcmp(arg[iarg], "chem") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_snad_atom:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + memory->create(map, ntypes + 1, "compute_sna_grid:map"); + nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal compute snad/atom command"); - map[i+1] = jelem; + int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + map[i + 1] = jelem; } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - bnormflag = atoi(arg[iarg+1]); + iarg += 2 + ntypes; + } else if (strcmp(arg[iarg], "bnormflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - wselfallflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "wselfallflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - switchinnerflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { + } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - memory->create(sinnerelem,ntypes+1,"snad/atom:sinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); sinnerflag = 1; iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { + } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snad/atom command"); - memory->create(dinnerelem,ntypes+1,"snad/atom:dinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; - } else error->all(FLERR,"Illegal compute snad/atom command"); + } else + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR,"Illegal compute snad/atom command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR,"Illegal compute snad/atom command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); - - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, + wselfallflag, nelements, switchinnerflag); ncoeff = snaptr->ncoeff; - nperdim = ncoeff; - if (quadraticflag) nperdim += (ncoeff*(ncoeff+1))/2; - yoffset = nperdim; - zoffset = 2*nperdim; - size_peratom_cols = 3*nperdim*atom->ntypes; + nvalues = ncoeff; + if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; + + // end code common to all SNAP computes + + yoffset = nvalues; + zoffset = 2*nvalues; + size_peratom_cols = 3*nvalues*atom->ntypes; comm_reverse = size_peratom_cols; peratom_flag = 1; @@ -289,7 +290,7 @@ void ComputeSNADAtom::compute_peratom() // const int typeoffset = threencoeff*(atom->type[i]-1); // const int quadraticoffset = threencoeff*atom->ntypes + // threencoeffq*(atom->type[i]-1); - const int typeoffset = 3*nperdim*(atom->type[i]-1); + const int typeoffset = 3*nvalues*(atom->type[i]-1); // insure rij, inside, and typej are of size jnum diff --git a/src/ML-SNAP/compute_snad_atom.h b/src/ML-SNAP/compute_snad_atom.h index 0cdb075daf..ac27e10769 100644 --- a/src/ML-SNAP/compute_snad_atom.h +++ b/src/ML-SNAP/compute_snad_atom.h @@ -37,7 +37,7 @@ class ComputeSNADAtom : public Compute { private: int nmax; - int ncoeff, nperdim, yoffset, zoffset; + int ncoeff, nvalues, yoffset, zoffset; double **cutsq; class NeighList *list; double **snad; diff --git a/src/ML-SNAP/compute_snap.cpp b/src/ML-SNAP/compute_snap.cpp index 83f56e338c..64daaa4c1e 100644 --- a/src/ML-SNAP/compute_snap.cpp +++ b/src/ML-SNAP/compute_snap.cpp @@ -32,6 +32,8 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; +#define SNAPCOMPUTENAME "snap" + ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snap(nullptr), snapall(nullptr), snap_peratom(nullptr), radelem(nullptr), wjelem(nullptr), @@ -41,13 +43,15 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : array_flag = 1; extarray = 0; + // code common to all SNAP computes + double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; int ntypes = atom->ntypes; - int nargmin = 6+2*ntypes; + int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR,"Illegal compute snap command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); // default values @@ -55,7 +59,6 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : switchflag = 1; bzeroflag = 1; quadraticflag = 0; - bikflag = 0; chemflag = 0; bnormflag = 0; wselfallflag = 0; @@ -64,28 +67,32 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem,ntypes+1,"snap:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"snap:wjelem"); - rcutfac = atof(arg[3]); - rfac0 = atof(arg[4]); - twojmax = atoi(arg[5]); + memory->create(radelem, ntypes + 1, "snap:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "snap:wjelem"); + + rcutfac = utils::numeric(FLERR, arg[3], false, lmp); + rfac0 = utils::numeric(FLERR, arg[4], false, lmp); + twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[6+i]); + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[6+ntypes+i]); + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq,ntypes+1,ntypes+1,"snap:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "snap:cutsq"); for (int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; + cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; - cutsq[i][i] = cut*cut; - for (int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; + cutsq[i][i] = cut * cut; + for (int j = i + 1; j <= ntypes; j++) { + cut = (radelem[i] + radelem[j]) * rcutfac; + cutsq[i][j] = cutsq[j][i] = cut * cut; } } @@ -99,107 +106,97 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - rmin0 = atof(arg[iarg+1]); + if (strcmp(arg[iarg], "rmin0") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - bzeroflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - switchflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "bzeroflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - quadraticflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "quadraticflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); + } else if (strcmp(arg[iarg], "chem") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_snap:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + memory->create(map, ntypes + 1, "compute_sna_grid:map"); + nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal compute snap command"); - map[i+1] = jelem; + int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + map[i + 1] = jelem; } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - bnormflag = atoi(arg[iarg+1]); + iarg += 2 + ntypes; + } else if (strcmp(arg[iarg], "bnormflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - wselfallflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "wselfallflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"bikflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - bikflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snap command"); - switchinnerflag = atoi(arg[iarg+1]); - iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { + } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); - memory->create(sinnerelem,ntypes+1,"snap:sinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); sinnerflag = 1; iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { + } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snap command"); - memory->create(dinnerelem,ntypes+1,"snap:dinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; - } else error->all(FLERR,"Illegal compute snap command"); + } else + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR,"Illegal compute snap command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR,"Illegal compute snap command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, + wselfallflag, nelements, switchinnerflag); ncoeff = snaptr->ncoeff; - nperdim = ncoeff; - if (quadraticflag) nperdim += (ncoeff*(ncoeff+1))/2; + nvalues = ncoeff; + if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; + + // end code common to all SNAP computes + ndims_force = 3; ndims_virial = 6; - yoffset = nperdim; - zoffset = 2*nperdim; + yoffset = nvalues; + zoffset = 2*nvalues; natoms = atom->natoms; bik_rows = 1; if (bikflag) bik_rows = natoms; size_array_rows = bik_rows+ndims_force*natoms+ndims_virial; - size_array_cols = nperdim*atom->ntypes+1; + size_array_cols = nvalues*atom->ntypes+1; lastcol = size_array_cols-1; ndims_peratom = ndims_force; - size_peratom = ndims_peratom*nperdim*atom->ntypes; + size_peratom = ndims_peratom*nvalues*atom->ntypes; nmax = 0; } @@ -341,8 +338,8 @@ void ComputeSnap::compute_array() const double radi = radelem[itype]; const int* const jlist = firstneigh[i]; const int jnum = numneigh[i]; - const int typeoffset_local = ndims_peratom*nperdim*(itype-1); - const int typeoffset_global = nperdim*(itype-1); + const int typeoffset_local = ndims_peratom*nvalues*(itype-1); + const int typeoffset_global = nvalues*(itype-1); // insure rij, inside, and typej are of size jnum @@ -481,9 +478,9 @@ void ComputeSnap::compute_array() // accumulate bispectrum force contributions to global array for (int itype = 0; itype < atom->ntypes; itype++) { - const int typeoffset_local = ndims_peratom*nperdim*itype; - const int typeoffset_global = nperdim*itype; - for (int icoeff = 0; icoeff < nperdim; icoeff++) { + const int typeoffset_local = ndims_peratom*nvalues*itype; + const int typeoffset_global = nvalues*itype; + for (int icoeff = 0; icoeff < nvalues; icoeff++) { for (int i = 0; i < ntotal; i++) { double *snadi = snap_peratom[i]+typeoffset_local; int iglobal = atom->tag[i]; @@ -549,10 +546,10 @@ void ComputeSnap::dbdotr_compute() int nall = atom->nlocal + atom->nghost; for (int i = 0; i < nall; i++) for (int itype = 0; itype < atom->ntypes; itype++) { - const int typeoffset_local = ndims_peratom*nperdim*itype; - const int typeoffset_global = nperdim*itype; + const int typeoffset_local = ndims_peratom*nvalues*itype; + const int typeoffset_global = nvalues*itype; double *snadi = snap_peratom[i]+typeoffset_local; - for (int icoeff = 0; icoeff < nperdim; icoeff++) { + for (int icoeff = 0; icoeff < nvalues; icoeff++) { double dbdx = snadi[icoeff]; double dbdy = snadi[icoeff+yoffset]; double dbdz = snadi[icoeff+zoffset]; diff --git a/src/ML-SNAP/compute_snap.h b/src/ML-SNAP/compute_snap.h index bc0670e2c7..9f4162d6c4 100644 --- a/src/ML-SNAP/compute_snap.h +++ b/src/ML-SNAP/compute_snap.h @@ -35,7 +35,7 @@ class ComputeSnap : public Compute { private: int natoms, nmax, size_peratom, lastcol; - int ncoeff, nperdim, yoffset, zoffset; + int ncoeff, nvalues, yoffset, zoffset; int ndims_peratom, ndims_force, ndims_virial; double **cutsq; class NeighList *list; diff --git a/src/ML-SNAP/compute_snav_atom.cpp b/src/ML-SNAP/compute_snav_atom.cpp index 0baa4bc110..b2fa24b231 100644 --- a/src/ML-SNAP/compute_snav_atom.cpp +++ b/src/ML-SNAP/compute_snav_atom.cpp @@ -21,6 +21,7 @@ #include "neighbor.h" #include "neigh_list.h" #include "force.h" +#include "pair.h" #include "comm.h" #include "memory.h" #include "error.h" @@ -29,24 +30,27 @@ using namespace LAMMPS_NS; +#define SNAPCOMPUTENAME "snav/atom" + ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snav(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) { + // code common to all SNAP computes + double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; int ntypes = atom->ntypes; - int nargmin = 6+2*ntypes; + int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR,"Illegal compute snav/atom command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); // default values rmin0 = 0.0; switchflag = 1; bzeroflag = 1; - bnormflag = 0; quadraticflag = 0; chemflag = 0; bnormflag = 0; @@ -56,24 +60,32 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem,ntypes+1,"snav/atom:radelem"); // offset by 1 to match up with types - memory->create(wjelem,ntypes+1,"snav/atom:wjelem"); - rcutfac = atof(arg[3]); - rfac0 = atof(arg[4]); - twojmax = atoi(arg[5]); + memory->create(radelem, ntypes + 1, "snav/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "snav/atom:wjelem"); + + rcutfac = utils::numeric(FLERR, arg[3], false, lmp); + rfac0 = utils::numeric(FLERR, arg[4], false, lmp); + twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) - radelem[i+1] = atof(arg[6+i]); + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - wjelem[i+1] = atof(arg[6+ntypes+i]); + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + // construct cutsq + double cut; - memory->create(cutsq,ntypes+1,ntypes+1,"snav/atom:cutsq"); + cutmax = 0.0; + memory->create(cutsq, ntypes + 1, ntypes + 1, "snav/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { - cut = 2.0*radelem[i]*rcutfac; - cutsq[i][i] = cut*cut; - for (int j = i+1; j <= ntypes; j++) { - cut = (radelem[i]+radelem[j])*rcutfac; - cutsq[i][j] = cutsq[j][i] = cut*cut; + cut = 2.0 * radelem[i] * rcutfac; + if (cut > cutmax) cutmax = cut; + cutsq[i][i] = cut * cut; + for (int j = i + 1; j <= ntypes; j++) { + cut = (radelem[i] + radelem[j]) * rcutfac; + cutsq[i][j] = cutsq[j][i] = cut * cut; } } @@ -87,90 +99,85 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : int iarg = nargmin; while (iarg < narg) { - if (strcmp(arg[iarg],"rmin0") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - rmin0 = atof(arg[iarg+1]); + if (strcmp(arg[iarg], "rmin0") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - switchflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"bzeroflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - bzeroflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "bzeroflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"quadraticflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - quadraticflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "quadraticflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"chem") == 0) { - if (iarg+2+ntypes > narg) - error->all(FLERR,"Illegal compute snav/atom command"); + } else if (strcmp(arg[iarg], "chem") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); chemflag = 1; - memory->create(map,ntypes+1,"compute_sna_atom:map"); - nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + memory->create(map, ntypes + 1, "compute_sna_grid:map"); + nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { - int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR,"Illegal compute snav/atom command"); - map[i+1] = jelem; + int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + map[i + 1] = jelem; } - iarg += 2+ntypes; - } else if (strcmp(arg[iarg],"bnormflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - bnormflag = atoi(arg[iarg+1]); + iarg += 2 + ntypes; + } else if (strcmp(arg[iarg], "bnormflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"wselfallflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - wselfallflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "wselfallflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"switchinnerflag") == 0) { - if (iarg+2 > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - switchinnerflag = atoi(arg[iarg+1]); + } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"sinner") == 0) { + } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - memory->create(sinnerelem,ntypes+1,"snav/atom:sinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) - sinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); sinnerflag = 1; iarg += ntypes; - } else if (strcmp(arg[iarg],"dinner") == 0) { + } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg+ntypes > narg) - error->all(FLERR,"Illegal compute snav/atom command"); - memory->create(dinnerelem,ntypes+1,"snav/atom:dinnerelem"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) - dinnerelem[i+1] = utils::numeric(FLERR,arg[iarg+i],false,lmp); + dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; - } else error->all(FLERR,"Illegal compute snav/atom command"); + } else + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR,"Illegal compute snav/atom command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR,"Illegal compute snav/atom command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all( + FLERR, + "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); - snaptr = new SNA(lmp, rfac0, twojmax, - rmin0, switchflag, bzeroflag, - chemflag, bnormflag, wselfallflag, - nelements, switchinnerflag); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, + wselfallflag, nelements, switchinnerflag); ncoeff = snaptr->ncoeff; - nperdim = ncoeff; - if (quadraticflag) nperdim += (ncoeff*(ncoeff+1))/2; - size_peratom_cols = 6*nperdim*atom->ntypes; + nvalues = ncoeff; + if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; + + // end code common to all SNAP computes + + size_peratom_cols = 6*nvalues*atom->ntypes; comm_reverse = size_peratom_cols; peratom_flag = 1; @@ -203,10 +210,9 @@ void ComputeSNAVAtom::init() { if (force->pair == nullptr) error->all(FLERR,"Compute snav/atom requires a pair style be defined"); - // TODO: Not sure what to do with this error check since cutoff radius is not - // a single number - //if (sqrt(cutsq) > force->pair->cutforce) - // error->all(FLERR,"Compute snav/atom cutoff is longer than pairwise cutoff"); + + if (cutmax > force->pair->cutforce) + error->all(FLERR,"Compute snav/atom cutoff is longer than pairwise cutoff"); // need an occasional full neighbor list @@ -280,7 +286,7 @@ void ComputeSNAVAtom::compute_peratom() const int* const jlist = firstneigh[i]; const int jnum = numneigh[i]; - const int typeoffset = 6*nperdim*(atom->type[i]-1); + const int typeoffset = 6*nvalues*(atom->type[i]-1); // insure rij, inside, and typej are of size jnum @@ -339,17 +345,17 @@ void ComputeSNAVAtom::compute_peratom() for (int icoeff = 0; icoeff < ncoeff; icoeff++) { snavi[icoeff] += snaptr->dblist[icoeff][0]*xtmp; - snavi[icoeff+nperdim] += snaptr->dblist[icoeff][1]*ytmp; - snavi[icoeff+2*nperdim] += snaptr->dblist[icoeff][2]*ztmp; - snavi[icoeff+3*nperdim] += snaptr->dblist[icoeff][1]*ztmp; - snavi[icoeff+4*nperdim] += snaptr->dblist[icoeff][0]*ztmp; - snavi[icoeff+5*nperdim] += snaptr->dblist[icoeff][0]*ytmp; + snavi[icoeff+nvalues] += snaptr->dblist[icoeff][1]*ytmp; + snavi[icoeff+2*nvalues] += snaptr->dblist[icoeff][2]*ztmp; + snavi[icoeff+3*nvalues] += snaptr->dblist[icoeff][1]*ztmp; + snavi[icoeff+4*nvalues] += snaptr->dblist[icoeff][0]*ztmp; + snavi[icoeff+5*nvalues] += snaptr->dblist[icoeff][0]*ytmp; snavj[icoeff] -= snaptr->dblist[icoeff][0]*x[j][0]; - snavj[icoeff+nperdim] -= snaptr->dblist[icoeff][1]*x[j][1]; - snavj[icoeff+2*nperdim] -= snaptr->dblist[icoeff][2]*x[j][2]; - snavj[icoeff+3*nperdim] -= snaptr->dblist[icoeff][1]*x[j][2]; - snavj[icoeff+4*nperdim] -= snaptr->dblist[icoeff][0]*x[j][2]; - snavj[icoeff+5*nperdim] -= snaptr->dblist[icoeff][0]*x[j][1]; + snavj[icoeff+nvalues] -= snaptr->dblist[icoeff][1]*x[j][1]; + snavj[icoeff+2*nvalues] -= snaptr->dblist[icoeff][2]*x[j][2]; + snavj[icoeff+3*nvalues] -= snaptr->dblist[icoeff][1]*x[j][2]; + snavj[icoeff+4*nvalues] -= snaptr->dblist[icoeff][0]*x[j][2]; + snavj[icoeff+5*nvalues] -= snaptr->dblist[icoeff][0]*x[j][1]; } if (quadraticflag) { @@ -369,17 +375,17 @@ void ComputeSNAVAtom::compute_peratom() double dbytmp = bi*biy; double dbztmp = bi*biz; snavi[ncount] += dbxtmp*xtmp; - snavi[ncount+nperdim] += dbytmp*ytmp; - snavi[ncount+2*nperdim] += dbztmp*ztmp; - snavi[ncount+3*nperdim] += dbytmp*ztmp; - snavi[ncount+4*nperdim] += dbxtmp*ztmp; - snavi[ncount+5*nperdim] += dbxtmp*ytmp; + snavi[ncount+nvalues] += dbytmp*ytmp; + snavi[ncount+2*nvalues] += dbztmp*ztmp; + snavi[ncount+3*nvalues] += dbytmp*ztmp; + snavi[ncount+4*nvalues] += dbxtmp*ztmp; + snavi[ncount+5*nvalues] += dbxtmp*ytmp; snavj[ncount] -= dbxtmp*x[j][0]; - snavj[ncount+nperdim] -= dbytmp*x[j][1]; - snavj[ncount+2*nperdim] -= dbztmp*x[j][2]; - snavj[ncount+3*nperdim] -= dbytmp*x[j][2]; - snavj[ncount+4*nperdim] -= dbxtmp*x[j][2]; - snavj[ncount+5*nperdim] -= dbxtmp*x[j][1]; + snavj[ncount+nvalues] -= dbytmp*x[j][1]; + snavj[ncount+2*nvalues] -= dbztmp*x[j][2]; + snavj[ncount+3*nvalues] -= dbytmp*x[j][2]; + snavj[ncount+4*nvalues] -= dbxtmp*x[j][2]; + snavj[ncount+5*nvalues] -= dbxtmp*x[j][1]; ncount++; // upper-triangular elements of quadratic matrix @@ -392,17 +398,17 @@ void ComputeSNAVAtom::compute_peratom() double dbztmp = bi*snaptr->dblist[jcoeff][2] + biz*snaptr->blist[jcoeff]; snavi[ncount] += dbxtmp*xtmp; - snavi[ncount+nperdim] += dbytmp*ytmp; - snavi[ncount+2*nperdim] += dbztmp*ztmp; - snavi[ncount+3*nperdim] += dbytmp*ztmp; - snavi[ncount+4*nperdim] += dbxtmp*ztmp; - snavi[ncount+5*nperdim] += dbxtmp*ytmp; + snavi[ncount+nvalues] += dbytmp*ytmp; + snavi[ncount+2*nvalues] += dbztmp*ztmp; + snavi[ncount+3*nvalues] += dbytmp*ztmp; + snavi[ncount+4*nvalues] += dbxtmp*ztmp; + snavi[ncount+5*nvalues] += dbxtmp*ytmp; snavj[ncount] -= dbxtmp*x[j][0]; - snavj[ncount+nperdim] -= dbytmp*x[j][1]; - snavj[ncount+2*nperdim] -= dbztmp*x[j][2]; - snavj[ncount+3*nperdim] -= dbytmp*x[j][2]; - snavj[ncount+4*nperdim] -= dbxtmp*x[j][2]; - snavj[ncount+5*nperdim] -= dbxtmp*x[j][1]; + snavj[ncount+nvalues] -= dbytmp*x[j][1]; + snavj[ncount+2*nvalues] -= dbztmp*x[j][2]; + snavj[ncount+3*nvalues] -= dbytmp*x[j][2]; + snavj[ncount+4*nvalues] -= dbxtmp*x[j][2]; + snavj[ncount+5*nvalues] -= dbxtmp*x[j][1]; ncount++; } } diff --git a/src/ML-SNAP/compute_snav_atom.h b/src/ML-SNAP/compute_snav_atom.h index 1eb84d8df7..2eac0b7b28 100644 --- a/src/ML-SNAP/compute_snav_atom.h +++ b/src/ML-SNAP/compute_snav_atom.h @@ -37,7 +37,7 @@ class ComputeSNAVAtom : public Compute { private: int nmax; - int ncoeff, nperdim; + int ncoeff, nvalues; double **cutsq; class NeighList *list; double **snav; @@ -50,6 +50,7 @@ class ComputeSNAVAtom : public Compute { double *sinnerelem; double *dinnerelem; class SNA *snaptr; + double cutmax; int quadraticflag; }; From 3ff998fdb0bff166355eeb2b61694b1a4ecc359d Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 17 Jun 2022 17:31:58 -0600 Subject: [PATCH 137/172] Restricted style string matching --- src/ML-SNAP/compute_sna_grid.cpp | 2 +- src/ML-SNAP/compute_sna_grid_local.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 4c8e4f82ef..2a9b9bf672 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -200,7 +200,7 @@ ComputeSNAGrid::~ComputeSNAGrid() void ComputeSNAGrid::init() { - if ((modify->get_compute_by_style("sna/grid").size() > 1) && (comm->me == 0)) + if ((modify->get_compute_by_style("^sna/grid$").size() > 1) && (comm->me == 0)) error->warning(FLERR, "More than one instance of compute sna/grid"); snaptr->init(); } diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index d9d66787f4..aa18d4c84d 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -199,7 +199,7 @@ ComputeSNAGridLocal::~ComputeSNAGridLocal() void ComputeSNAGridLocal::init() { - if ((modify->get_compute_by_style("sna/grid/local").size() > 1) && (comm->me == 0)) + if ((modify->get_compute_by_style("^sna/grid/local$").size() > 1) && (comm->me == 0)) error->warning(FLERR, "More than one instance of compute sna/grid/local"); snaptr->init(); } From cbc7669a4f43a4e7180444afbd00311c554de857 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 19:37:26 -0400 Subject: [PATCH 138/172] apply clang-format --- src/ML-SNAP/compute_sna_grid.cpp | 22 +++++++++------------- src/ML-SNAP/compute_sna_grid_local.cpp | 23 ++++++++++------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 2a9b9bf672..90df726687 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -63,19 +63,16 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "sna/grid:radelem"); // offset by 1 to match up with types + memory->create(radelem, ntypes + 1, "sna/grid:radelem"); // offset by 1 to match up with types memory->create(wjelem, ntypes + 1, "sna/grid:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) radelem[i + 1] = utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - radelem[i + 1] = - utils::numeric(FLERR, arg[6 + i], false, lmp); - for (int i = 0; i < ntypes; i++) - wjelem[i + 1] = - utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + wjelem[i + 1] = utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq @@ -125,7 +122,8 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); map[i + 1] = jelem; } iarg += 2 + ntypes; @@ -162,14 +160,12 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all( - FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, + " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all( - FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, + " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index aa18d4c84d..3da5ef4e8a 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -63,19 +63,17 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "sna/grid/local:radelem"); // offset by 1 to match up with types + memory->create(radelem, ntypes + 1, + "sna/grid/local:radelem"); // offset by 1 to match up with types memory->create(wjelem, ntypes + 1, "sna/grid/local:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) radelem[i + 1] = utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - radelem[i + 1] = - utils::numeric(FLERR, arg[6 + i], false, lmp); - for (int i = 0; i < ntypes; i++) - wjelem[i + 1] = - utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + wjelem[i + 1] = utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq @@ -125,7 +123,8 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); map[i + 1] = jelem; } iarg += 2 + ntypes; @@ -162,14 +161,12 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all( - FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, + " command: switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all( - FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, + " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); From 34e7fa92ab1f0d0b85845d34e22e24515ec7e9af Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 19:44:13 -0400 Subject: [PATCH 139/172] simplify using fmt --- src/ML-SNAP/compute_sna_atom.cpp | 32 ++++++++++----------- src/ML-SNAP/compute_sna_grid.cpp | 39 +++++++++++++------------- src/ML-SNAP/compute_sna_grid_local.cpp | 39 +++++++++++++------------- src/ML-SNAP/compute_snad_atom.cpp | 32 ++++++++++----------- src/ML-SNAP/compute_snap.cpp | 32 ++++++++++----------- src/ML-SNAP/compute_snav_atom.cpp | 32 ++++++++++----------- 6 files changed, 98 insertions(+), 108 deletions(-) diff --git a/src/ML-SNAP/compute_sna_atom.cpp b/src/ML-SNAP/compute_sna_atom.cpp index 69f233b1c3..daec59e3f0 100644 --- a/src/ML-SNAP/compute_sna_atom.cpp +++ b/src/ML-SNAP/compute_sna_atom.cpp @@ -30,8 +30,6 @@ using namespace LAMMPS_NS; -#define SNAPCOMPUTENAME "sna/atom" - ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), sna(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) @@ -45,7 +43,7 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute {} command", style); // default values @@ -101,47 +99,47 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute {} command", style); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -149,25 +147,25 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + error->all(FLERR, "Illegal compute {} command", style); } if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 90df726687..f8da915051 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -27,8 +27,6 @@ using namespace LAMMPS_NS; -#define SNAPCOMPUTENAME "sna/grid" - ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : ComputeGrid(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { @@ -47,7 +45,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute {} command", style); // default values @@ -100,48 +98,47 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute {} command", style); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -149,23 +146,25 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + error->all(FLERR, "Illegal compute {} command", style); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, - " command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, - " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 3da5ef4e8a..079ecac319 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -27,8 +27,6 @@ using namespace LAMMPS_NS; -#define SNAPCOMPUTENAME "sna/grid/local" - ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : ComputeGridLocal(lmp, narg, arg), cutsq(nullptr), radelem(nullptr), wjelem(nullptr) { @@ -47,7 +45,7 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute {} command", style); // default values @@ -101,48 +99,47 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute {} command", style); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -150,23 +147,25 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + error->all(FLERR, "Illegal compute {} command", style); } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, - " command: switchinnerflag = 1, missing sinner/dinner keyword"); + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, - " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snad_atom.cpp b/src/ML-SNAP/compute_snad_atom.cpp index c9a88da535..623eb16268 100644 --- a/src/ML-SNAP/compute_snad_atom.cpp +++ b/src/ML-SNAP/compute_snad_atom.cpp @@ -30,8 +30,6 @@ using namespace LAMMPS_NS; -#define SNAPCOMPUTENAME "snad/atom" - ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snad(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) @@ -44,7 +42,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute {} command", style); // default values @@ -100,47 +98,47 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute {} command", style); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -148,25 +146,25 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + error->all(FLERR, "Illegal compute {} command", style); } if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snap.cpp b/src/ML-SNAP/compute_snap.cpp index 64daaa4c1e..2aa503021c 100644 --- a/src/ML-SNAP/compute_snap.cpp +++ b/src/ML-SNAP/compute_snap.cpp @@ -32,8 +32,6 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; -#define SNAPCOMPUTENAME "snap" - ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snap(nullptr), snapall(nullptr), snap_peratom(nullptr), radelem(nullptr), wjelem(nullptr), @@ -51,7 +49,7 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute {} command", style); // default values @@ -107,47 +105,47 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute {} command", style); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -155,25 +153,25 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + error->all(FLERR, "Illegal compute {} command", style); } if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snav_atom.cpp b/src/ML-SNAP/compute_snav_atom.cpp index b2fa24b231..74d52e231a 100644 --- a/src/ML-SNAP/compute_snav_atom.cpp +++ b/src/ML-SNAP/compute_snav_atom.cpp @@ -30,8 +30,6 @@ using namespace LAMMPS_NS; -#define SNAPCOMPUTENAME "snav/atom" - ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snav(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) @@ -44,7 +42,7 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : int ntypes = atom->ntypes; int nargmin = 6 + 2 * ntypes; - if (narg < nargmin) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (narg < nargmin) error->all(FLERR, "Illegal compute {} command", style); // default values @@ -100,47 +98,47 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg], "rmin0") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); rmin0 = utils::numeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "bzeroflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bzeroflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "quadraticflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); quadraticflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "chem") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); chemflag = 1; memory->create(map, ntypes + 1, "compute_sna_grid:map"); nelements = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); for (int i = 0; i < ntypes; i++) { int jelem = utils::inumeric(FLERR, arg[iarg + 2 + i], false, lmp); - if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (jelem < 0 || jelem >= nelements) error->all(FLERR, "Illegal compute {} command", style); map[i + 1] = jelem; } iarg += 2 + ntypes; } else if (strcmp(arg[iarg], "bnormflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); bnormflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "wselfallflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); wselfallflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "switchinnerflag") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute {} command", style); switchinnerflag = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "sinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(sinnerelem, ntypes + 1, "snap:sinnerelem"); for (int i = 0; i < ntypes; i++) sinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); @@ -148,25 +146,25 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : iarg += ntypes; } else if (strcmp(arg[iarg], "dinner") == 0) { iarg++; - if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + if (iarg + ntypes > narg) error->all(FLERR, "Illegal compute {} command", style); memory->create(dinnerelem, ntypes + 1, "snap:dinnerelem"); for (int i = 0; i < ntypes; i++) dinnerelem[i + 1] = utils::numeric(FLERR, arg[iarg + i], false, lmp); dinnerflag = 1; iarg += ntypes; } else - error->all(FLERR, "Illegal compute ", SNAPCOMPUTENAME, " command"); + error->all(FLERR, "Illegal compute {} command", style); } if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute ", SNAPCOMPUTENAME, " command: switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); From b3fea1cb71d1f3e47dceacf07e0d252bd9670fdd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 19:48:09 -0400 Subject: [PATCH 140/172] make spellchecker happy --- doc/src/compute_sna_atom.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index 242defe614..f6946b421d 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -252,7 +252,7 @@ layout in the global array. Compute *sna/grid/local* calculates bispectrum components of a regular grid of points similarly to compute *sna/grid* described above. However, because the array is local, it contains only rows for grid points -that are local to the processor subdomain. The global grid +that are local to the processor sub-domain. The global grid of :math:`nx \times ny \times nz` points is still laid out in space the same as for *sna/grid*, but grid points are strictly partitioned, so that every grid point appears in one and only one local array. The array contains one row for each of the From eb69bb28b8c266d4c41848b8dfb0945130f81e1d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jun 2022 21:52:57 -0400 Subject: [PATCH 141/172] add missing style index entries --- doc/src/compute_sna_atom.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index f6946b421d..354a9a8fa6 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -2,6 +2,8 @@ .. index:: compute snad/atom .. index:: compute snav/atom .. index:: compute snap +.. index:: compute sna/grid +.. index:: compute sna/grid/local compute sna/atom command ======================== From f831a776beb5318c4249ad77b2ac5f71d75e7b54 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 18 Jun 2022 22:25:32 -0400 Subject: [PATCH 142/172] correct python example --- doc/src/Howto_structured_data.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/Howto_structured_data.rst b/doc/src/Howto_structured_data.rst index 4ea6c28086..18a5dfd775 100644 --- a/doc/src/Howto_structured_data.rst +++ b/doc/src/Howto_structured_data.rst @@ -184,7 +184,7 @@ frame. .. code-block:: python - import re, yaml + import yaml import pandas as pd try: @@ -193,7 +193,7 @@ frame. from yaml import SafeLoader as Loader with open("ave.yaml") as f: - ave = yaml.load(docs, Loader=Loader) + ave = yaml.load(f, Loader=Loader) keys = ave['keywords'] df = {} From 063fc47f6478c272d01cdb002e5152d66ec0a828 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 19 Jun 2022 06:38:14 -0400 Subject: [PATCH 143/172] tweak to avoid test failure on FreeBSD --- unittest/force-styles/tests/manybody-pair-pace_product.yaml | 2 +- unittest/force-styles/tests/manybody-pair-pace_recursive.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unittest/force-styles/tests/manybody-pair-pace_product.yaml b/unittest/force-styles/tests/manybody-pair-pace_product.yaml index 1e82029777..b178586ab2 100644 --- a/unittest/force-styles/tests/manybody-pair-pace_product.yaml +++ b/unittest/force-styles/tests/manybody-pair-pace_product.yaml @@ -1,7 +1,7 @@ --- lammps_version: 17 Feb 2022 date_generated: Fri Mar 18 22:17:48 2022 -epsilon: 1e-12 +epsilon: 5e-12 skip_tests: prerequisites: ! | pair pace diff --git a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml index f20440c85d..6105debb67 100644 --- a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml +++ b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Mar 2021 date_generated: Wed Apr 7 19:30:07 2021 -epsilon: 1e-12 +epsilon: 5e-12 prerequisites: ! | pair pace pre_commands: ! | From de4558aa07fef7301dd6352761b03fc89fb501f4 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 19 Jun 2022 09:58:01 -0600 Subject: [PATCH 144/172] Tweaked error messages --- src/ML-SNAP/compute_sna_atom.cpp | 9 +++++--- src/ML-SNAP/compute_sna_grid.cpp | 30 +++++++++++++++---------- src/ML-SNAP/compute_sna_grid_local.cpp | 31 +++++++++++++++----------- src/ML-SNAP/compute_snad_atom.cpp | 18 +++++++++------ src/ML-SNAP/compute_snap.cpp | 15 ++++++++----- src/ML-SNAP/compute_snav_atom.cpp | 20 ++++++++++------- 6 files changed, 74 insertions(+), 49 deletions(-) diff --git a/src/ML-SNAP/compute_sna_atom.cpp b/src/ML-SNAP/compute_sna_atom.cpp index daec59e3f0..9dce3d6e6d 100644 --- a/src/ML-SNAP/compute_sna_atom.cpp +++ b/src/ML-SNAP/compute_sna_atom.cpp @@ -35,7 +35,7 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) { - // code common to all SNAP computes + // begin code common to all SNAP computes double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -160,12 +160,15 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", + style); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index f8da915051..dc92ee2b15 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -37,7 +37,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : arg += nargbase; narg -= nargbase; - // code common to all SNAP computes + // begin code common to all SNAP computes double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -61,22 +61,25 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "sna/grid:radelem"); // offset by 1 to match up with types - memory->create(wjelem, ntypes + 1, "sna/grid:wjelem"); + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); twojmax = utils::inumeric(FLERR, arg[5], false, lmp); - for (int i = 0; i < ntypes; i++) radelem[i + 1] = utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - wjelem[i + 1] = utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); + for (int i = 0; i < ntypes; i++) + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/grid:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; @@ -157,14 +160,17 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR, - "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", - style); + error->all( + FLERR, + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR, - "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", - style); + error->all( + FLERR, + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", + style); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 079ecac319..8b0121b9ce 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -37,7 +37,7 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : arg += nargbase; narg -= nargbase; - // code common to all SNAP computes + // begin code common to all SNAP computes double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -61,23 +61,25 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, - "sna/grid/local:radelem"); // offset by 1 to match up with types - memory->create(wjelem, ntypes + 1, "sna/grid/local:wjelem"); + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); twojmax = utils::inumeric(FLERR, arg[5], false, lmp); - for (int i = 0; i < ntypes; i++) radelem[i + 1] = utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - wjelem[i + 1] = utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + radelem[i + 1] = + utils::numeric(FLERR, arg[6 + i], false, lmp); + for (int i = 0; i < ntypes; i++) + wjelem[i + 1] = + utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq double cut; cutmax = 0.0; - memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/grid/local:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; @@ -158,14 +160,17 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all(FLERR, - "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", - style); + error->all( + FLERR, + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all(FLERR, - "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", - style); + error->all( + FLERR, + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", + style); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snad_atom.cpp b/src/ML-SNAP/compute_snad_atom.cpp index 623eb16268..1cd2278b00 100644 --- a/src/ML-SNAP/compute_snad_atom.cpp +++ b/src/ML-SNAP/compute_snad_atom.cpp @@ -34,7 +34,8 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snad(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) { - // code common to all SNAP computes + + // begin code common to all SNAP computes double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -58,8 +59,8 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "snad/atom:radelem"); // offset by 1 to match up with types - memory->create(wjelem, ntypes + 1, "snad/atom:wjelem"); + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); @@ -76,7 +77,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : double cut; cutmax = 0.0; - memory->create(cutsq, ntypes + 1, ntypes + 1, "snad/atom:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; @@ -159,12 +160,15 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", + style); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); @@ -174,7 +178,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; // end code common to all SNAP computes - + yoffset = nvalues; zoffset = 2*nvalues; size_peratom_cols = 3*nvalues*atom->ntypes; diff --git a/src/ML-SNAP/compute_snap.cpp b/src/ML-SNAP/compute_snap.cpp index 2aa503021c..fb10fa0fbe 100644 --- a/src/ML-SNAP/compute_snap.cpp +++ b/src/ML-SNAP/compute_snap.cpp @@ -41,7 +41,7 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : array_flag = 1; extarray = 0; - // code common to all SNAP computes + // begin code common to all SNAP computes double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -65,8 +65,8 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "snap:radelem"); // offset by 1 to match up with types - memory->create(wjelem, ntypes + 1, "snap:wjelem"); + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); @@ -83,7 +83,7 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : double cut; cutmax = 0.0; - memory->create(cutsq, ntypes + 1, ntypes + 1, "snap:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; @@ -166,12 +166,15 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", + style); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snav_atom.cpp b/src/ML-SNAP/compute_snav_atom.cpp index 74d52e231a..4b7b0caa64 100644 --- a/src/ML-SNAP/compute_snav_atom.cpp +++ b/src/ML-SNAP/compute_snav_atom.cpp @@ -34,7 +34,8 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snav(nullptr), radelem(nullptr), wjelem(nullptr), sinnerelem(nullptr), dinnerelem(nullptr) { - // code common to all SNAP computes + + // begin code common to all SNAP computes double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; @@ -58,8 +59,8 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "snav/atom:radelem"); // offset by 1 to match up with types - memory->create(wjelem, ntypes + 1, "snav/atom:wjelem"); + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); @@ -76,7 +77,7 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : double cut; cutmax = 0.0; - memory->create(cutsq, ntypes + 1, ntypes + 1, "snav/atom:cutsq"); + memory->create(cutsq, ntypes + 1, ntypes + 1, "sna/atom:cutsq"); for (int i = 1; i <= ntypes; i++) { cut = 2.0 * radelem[i] * rcutfac; if (cut > cutmax) cutmax = cut; @@ -159,12 +160,15 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword"); + "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", + style); + snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); @@ -174,8 +178,8 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; // end code common to all SNAP computes - - size_peratom_cols = 6*nvalues*atom->ntypes; + + size_peratom_cols = 6*nvalues*atom->ntypes; comm_reverse = size_peratom_cols; peratom_flag = 1; From f632cff8f245d18d0696b17f02342a0e1c609681 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 19 Jun 2022 16:11:37 -0400 Subject: [PATCH 145/172] remove excess text and re-apply clang-format --- src/ML-SNAP/compute_sna_atom.cpp | 9 ++++----- src/ML-SNAP/compute_sna_grid.cpp | 24 +++++++++--------------- src/ML-SNAP/compute_sna_grid_local.cpp | 24 +++++++++--------------- src/ML-SNAP/compute_snad_atom.cpp | 9 ++++----- src/ML-SNAP/compute_snap.cpp | 9 ++++----- src/ML-SNAP/compute_snav_atom.cpp | 9 ++++----- 6 files changed, 34 insertions(+), 50 deletions(-) diff --git a/src/ML-SNAP/compute_sna_atom.cpp b/src/ML-SNAP/compute_sna_atom.cpp index 9dce3d6e6d..1d2190d50d 100644 --- a/src/ML-SNAP/compute_sna_atom.cpp +++ b/src/ML-SNAP/compute_sna_atom.cpp @@ -160,15 +160,14 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", - style); + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", - style); - + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index dc92ee2b15..ac267112b1 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -61,19 +61,16 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) radelem[i + 1] = utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - radelem[i + 1] = - utils::numeric(FLERR, arg[6 + i], false, lmp); - for (int i = 0; i < ntypes; i++) - wjelem[i + 1] = - utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + wjelem[i + 1] = utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq @@ -160,17 +157,14 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) : } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all( - FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", - style); + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all( - FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", - style); - + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 8b0121b9ce..059f177696 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -61,19 +61,16 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : // process required arguments - memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types + memory->create(radelem, ntypes + 1, "sna/atom:radelem"); // offset by 1 to match up with types memory->create(wjelem, ntypes + 1, "sna/atom:wjelem"); rcutfac = utils::numeric(FLERR, arg[3], false, lmp); rfac0 = utils::numeric(FLERR, arg[4], false, lmp); twojmax = utils::inumeric(FLERR, arg[5], false, lmp); + for (int i = 0; i < ntypes; i++) radelem[i + 1] = utils::numeric(FLERR, arg[6 + i], false, lmp); for (int i = 0; i < ntypes; i++) - radelem[i + 1] = - utils::numeric(FLERR, arg[6 + i], false, lmp); - for (int i = 0; i < ntypes; i++) - wjelem[i + 1] = - utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); + wjelem[i + 1] = utils::numeric(FLERR, arg[6 + ntypes + i], false, lmp); // construct cutsq @@ -160,17 +157,14 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) : } if (switchinnerflag && !(sinnerflag && dinnerflag)) - error->all( - FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", - style); + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) - error->all( - FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", - style); - + error->all(FLERR, + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snad_atom.cpp b/src/ML-SNAP/compute_snad_atom.cpp index 1cd2278b00..9d080508f5 100644 --- a/src/ML-SNAP/compute_snad_atom.cpp +++ b/src/ML-SNAP/compute_snad_atom.cpp @@ -160,15 +160,14 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", - style); + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", - style); - + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snap.cpp b/src/ML-SNAP/compute_snap.cpp index fb10fa0fbe..d1f75f8382 100644 --- a/src/ML-SNAP/compute_snap.cpp +++ b/src/ML-SNAP/compute_snap.cpp @@ -166,15 +166,14 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", - style); + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", - style); - + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); diff --git a/src/ML-SNAP/compute_snav_atom.cpp b/src/ML-SNAP/compute_snav_atom.cpp index 4b7b0caa64..27c304b424 100644 --- a/src/ML-SNAP/compute_snav_atom.cpp +++ b/src/ML-SNAP/compute_snav_atom.cpp @@ -160,15 +160,14 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : if (switchinnerflag && !(sinnerflag && dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 1, missing sinner/dinner keyword", - style); + "Illegal compute {} command: switchinnerflag = 1, missing sinner/dinner keyword", + style); if (!switchinnerflag && (sinnerflag || dinnerflag)) error->all( FLERR, - "Illegal compute {} command:, style switchinnerflag = 0, unexpected sinner/dinner keyword", - style); - + "Illegal compute {} command: switchinnerflag = 0, unexpected sinner/dinner keyword", + style); snaptr = new SNA(lmp, rfac0, twojmax, rmin0, switchflag, bzeroflag, chemflag, bnormflag, wselfallflag, nelements, switchinnerflag); From 4881b232d30a0a53d8a63ca43d75ec6f336225ba Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 19 Jun 2022 16:28:55 -0400 Subject: [PATCH 146/172] whitespace --- src/ML-SNAP/compute_snad_atom.cpp | 2 +- src/ML-SNAP/compute_snav_atom.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ML-SNAP/compute_snad_atom.cpp b/src/ML-SNAP/compute_snad_atom.cpp index 9d080508f5..12839629a9 100644 --- a/src/ML-SNAP/compute_snad_atom.cpp +++ b/src/ML-SNAP/compute_snad_atom.cpp @@ -177,7 +177,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; // end code common to all SNAP computes - + yoffset = nvalues; zoffset = 2*nvalues; size_peratom_cols = 3*nvalues*atom->ntypes; diff --git a/src/ML-SNAP/compute_snav_atom.cpp b/src/ML-SNAP/compute_snav_atom.cpp index 27c304b424..949dda8e5c 100644 --- a/src/ML-SNAP/compute_snav_atom.cpp +++ b/src/ML-SNAP/compute_snav_atom.cpp @@ -177,7 +177,7 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : if (quadraticflag) nvalues += (ncoeff * (ncoeff + 1)) / 2; // end code common to all SNAP computes - + size_peratom_cols = 6*nvalues*atom->ntypes; comm_reverse = size_peratom_cols; peratom_flag = 1; From 3828c857f7bfaa9e688604618e0c8055907ac0c0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 18:10:19 -0400 Subject: [PATCH 147/172] accept LMP_SIZE_VECTOR as alias for LMP_SIZE_ROWS with local computes --- src/library.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/library.cpp b/src/library.cpp index 079534d663..de655d74d0 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1749,6 +1749,7 @@ void *lammps_extract_compute(void *handle, const char *id, int style, int type) if (type == LMP_TYPE_SCALAR) return (void *) &compute->size_local_rows; /* for backward compatibility */ if (type == LMP_TYPE_VECTOR) return (void *) compute->vector_local; if (type == LMP_TYPE_ARRAY) return (void *) compute->array_local; + if (type == LMP_SIZE_VECTOR) return (void *) &compute->size_local_rows; /* alias for LMP_SIZE_ROWS */ if (type == LMP_SIZE_ROWS) return (void *) &compute->size_local_rows; if (type == LMP_SIZE_COLS) return (void *) &compute->size_local_cols; } From ffc5b12c5fcd97dccf7e4321c3a450be1d326fda Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 18:10:57 -0400 Subject: [PATCH 148/172] correct handling data of local computes which always needs to check rows and cols --- python/lammps/numpy_wrapper.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/lammps/numpy_wrapper.py b/python/lammps/numpy_wrapper.py index 3619728081..ce0cb35e47 100644 --- a/python/lammps/numpy_wrapper.py +++ b/python/lammps/numpy_wrapper.py @@ -165,7 +165,7 @@ class numpy_wrapper: """ value = self.lmp.extract_compute(cid, cstyle, ctype) - if cstyle in (LMP_STYLE_GLOBAL, LMP_STYLE_LOCAL): + if cstyle == LMP_STYLE_GLOBAL: if ctype == LMP_TYPE_VECTOR: nrows = self.lmp.extract_compute(cid, cstyle, LMP_SIZE_VECTOR) return self.darray(value, nrows) @@ -173,6 +173,13 @@ class numpy_wrapper: nrows = self.lmp.extract_compute(cid, cstyle, LMP_SIZE_ROWS) ncols = self.lmp.extract_compute(cid, cstyle, LMP_SIZE_COLS) return self.darray(value, nrows, ncols) + elif cstyle == LMP_STYLE_LOCAL: + nrows = self.lmp.extract_compute(cid, cstyle, LMP_SIZE_ROWS) + ncols = self.lmp.extract_compute(cid, cstyle, LMP_SIZE_COLS) + if ncols == 0: + return self.darray(value, nrows) + else: + return self.darray(value, nrows, ncols) elif cstyle == LMP_STYLE_ATOM: if ctype == LMP_TYPE_VECTOR: nlocal = self.lmp.extract_global("nlocal") From ac615059a7aa85643e378bcb85f8b5e7cf764c72 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 18:15:02 -0400 Subject: [PATCH 149/172] update some linewraps for 100 col limit --- python/lammps/core.py | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/python/lammps/core.py b/python/lammps/core.py index 23002b210c..930a40a4b0 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -188,20 +188,17 @@ class lammps(object): [c_void_p,POINTER(c_double),POINTER(c_double),c_double,c_double,c_double] self.lib.lammps_reset_box.restype = None - self.lib.lammps_gather_atoms.argtypes = \ - [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_gather_atoms.argtypes = [c_void_p,c_char_p,c_int,c_int,c_void_p] self.lib.lammps_gather_atoms.restype = None - self.lib.lammps_gather_atoms_concat.argtypes = \ - [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_gather_atoms_concat.argtypes = [c_void_p,c_char_p,c_int,c_int,c_void_p] self.lib.lammps_gather_atoms_concat.restype = None self.lib.lammps_gather_atoms_subset.argtypes = \ [c_void_p,c_char_p,c_int,c_int,c_int,POINTER(c_int),c_void_p] self.lib.lammps_gather_atoms_subset.restype = None - self.lib.lammps_scatter_atoms.argtypes = \ - [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_scatter_atoms.argtypes = [c_void_p,c_char_p,c_int,c_int,c_void_p] self.lib.lammps_scatter_atoms.restype = None self.lib.lammps_scatter_atoms_subset.argtypes = \ @@ -211,20 +208,17 @@ class lammps(object): self.lib.lammps_gather_bonds.argtypes = [c_void_p,c_void_p] self.lib.lammps_gather_bonds.restype = None - self.lib.lammps_gather.argtypes = \ - [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_gather.argtypes = [c_void_p,c_char_p,c_int,c_int,c_void_p] self.lib.lammps_gather.restype = None - self.lib.lammps_gather_concat.argtypes = \ - [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_gather_concat.argtypes = [c_void_p,c_char_p,c_int,c_int,c_void_p] self.lib.lammps_gather_concat.restype = None self.lib.lammps_gather_subset.argtypes = \ [c_void_p,c_char_p,c_int,c_int,c_int,POINTER(c_int),c_void_p] self.lib.lammps_gather_subset.restype = None - self.lib.lammps_scatter.argtypes = \ - [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_scatter.argtypes = [c_void_p,c_char_p,c_int,c_int,c_void_p] self.lib.lammps_scatter.restype = None self.lib.lammps_scatter_subset.argtypes = \ @@ -244,7 +238,8 @@ class lammps(object): self.lib.lammps_neighlist_num_elements.argtypes = [c_void_p, c_int] self.lib.lammps_neighlist_num_elements.restype = c_int - self.lib.lammps_neighlist_element_neighbors.argtypes = [c_void_p, c_int, c_int, POINTER(c_int), POINTER(c_int), POINTER(POINTER(c_int))] + self.lib.lammps_neighlist_element_neighbors.argtypes = \ + [c_void_p, c_int, c_int, POINTER(c_int), POINTER(c_int), POINTER(POINTER(c_int))] self.lib.lammps_neighlist_element_neighbors.restype = None self.lib.lammps_is_running.argtypes = [c_void_p] @@ -368,11 +363,9 @@ class lammps(object): if type(cmdargs[i]) is str: cmdargs[i] = cmdargs[i].encode() cargs = (c_char_p*narg)(*cmdargs) - self.lib.lammps_open.argtypes = [c_int, c_char_p*narg, \ - MPI_Comm, c_void_p] + self.lib.lammps_open.argtypes = [c_int, c_char_p*narg, MPI_Comm, c_void_p] else: - self.lib.lammps_open.argtypes = [c_int, c_char_p, \ - MPI_Comm, c_void_p] + self.lib.lammps_open.argtypes = [c_int, c_char_p, MPI_Comm, c_void_p] self.opened = 1 comm_ptr = self.MPI._addressof(comm) @@ -390,8 +383,7 @@ class lammps(object): if type(cmdargs[i]) is str: cmdargs[i] = cmdargs[i].encode() cargs = (c_char_p*narg)(*cmdargs) - self.lib.lammps_open_no_mpi.argtypes = [c_int, c_char_p*narg, \ - c_void_p] + self.lib.lammps_open_no_mpi.argtypes = [c_int, c_char_p*narg, c_void_p] self.lmp = c_void_p(self.lib.lammps_open_no_mpi(narg,cargs,None)) else: self.lib.lammps_open_no_mpi.argtypes = [c_int, c_char_p, c_void_p] @@ -963,17 +955,14 @@ class lammps(object): return ptr elif ctype == LMP_SIZE_COLS: - if cstyle == LMP_STYLE_GLOBAL \ - or cstyle == LMP_STYLE_ATOM \ - or cstyle == LMP_STYLE_LOCAL: + if cstyle == LMP_STYLE_GLOBAL or cstyle == LMP_STYLE_ATOM or cstyle == LMP_STYLE_LOCAL: self.lib.lammps_extract_compute.restype = POINTER(c_int) with ExceptionCheck(self): ptr = self.lib.lammps_extract_compute(self.lmp,cid,cstyle,ctype) return ptr[0] elif ctype == LMP_SIZE_VECTOR or ctype == LMP_SIZE_ROWS: - if cstyle == LMP_STYLE_GLOBAL \ - or cstyle == LMP_STYLE_LOCAL: + if cstyle == LMP_STYLE_GLOBAL or cstyle == LMP_STYLE_LOCAL: self.lib.lammps_extract_compute.restype = POINTER(c_int) with ExceptionCheck(self): ptr = self.lib.lammps_extract_compute(self.lmp,cid,cstyle,ctype) From 78129f9078b39b97bcc0c1601ef7dd3d1de4ebd1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 18:23:20 -0400 Subject: [PATCH 150/172] update embedded docs for LMP_SIZE_VECTOR update for extract_compute() --- src/library.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index de655d74d0..cdc0a812c5 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1659,14 +1659,18 @@ lists the available options. - LMP_TYPE_ARRAY - ``double **`` - Local data array + * - LMP_STYLE_LOCAL + - LMP_SIZE_VECTOR + - ``int *`` + - Alias for using LMP_SIZE_ROWS * - LMP_STYLE_LOCAL - LMP_SIZE_ROWS - ``int *`` - - Number of local data rows + - Number of local array rows or length of vector * - LMP_STYLE_LOCAL - LMP_SIZE_COLS - ``int *`` - - Number of local data columns + - Number of local array columns, 0 if vector .. warning:: From 033af0c507b4be72ef9cdfb240aa0dc34762fb50 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 18:48:50 -0400 Subject: [PATCH 151/172] add unit test for extracting local vector and array via numpy --- unittest/python/python-numpy.py | 38 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/unittest/python/python-numpy.py b/unittest/python/python-numpy.py index 010255a81e..7cbae8e48d 100644 --- a/unittest/python/python-numpy.py +++ b/unittest/python/python-numpy.py @@ -93,17 +93,39 @@ class PythonNumpy(unittest.TestCase): # TODO pass - def testExtractComputeLocalScalar(self): - # TODO - pass - def testExtractComputeLocalVector(self): - # TODO - pass + self.lmp.command("region box block 0 2 0 2 0 2") + self.lmp.command("create_box 1 box") + self.lmp.command("create_atoms 1 single 1.0 1.0 1.0") + self.lmp.command("create_atoms 1 single 1.0 1.0 1.5") + self.lmp.command("mass 1 1.0") + self.lmp.command("pair_style lj/cut 1.9") + self.lmp.command("pair_coeff 1 1 1.0 1.0") + self.lmp.command("compute r0 all pair/local dist") + self.lmp.command("run 0 post no") + values = self.lmp.numpy.extract_compute("r0", LMP_STYLE_LOCAL, LMP_TYPE_VECTOR) + self.assertEqual(values.ndim, 1) + self.assertEqual(values.size, 2) + self.assertEqual(values[0], 0.5) + self.assertEqual(values[1], 1.5) def testExtractComputeLocalArray(self): - # TODO - pass + self.lmp.command("region box block 0 2 0 2 0 2") + self.lmp.command("create_box 1 box") + self.lmp.command("create_atoms 1 single 1.0 1.0 1.0") + self.lmp.command("create_atoms 1 single 1.0 1.0 1.5") + self.lmp.command("mass 1 1.0") + self.lmp.command("pair_style lj/cut 1.9") + self.lmp.command("pair_coeff 1 1 1.0 1.0") + self.lmp.command("compute r0 all pair/local dist dx dy dz") + self.lmp.command("run 0 post no") + values = self.lmp.numpy.extract_compute("r0", LMP_STYLE_LOCAL, LMP_TYPE_ARRAY) + self.assertEqual(values.ndim, 2) + self.assertEqual(values.size, 8) + self.assertEqual(values[0,0], 0.5) + self.assertEqual(values[0,3], -0.5) + self.assertEqual(values[1,0], 1.5) + self.assertEqual(values[1,3], 1.5) def testExtractAtomDeprecated(self): self.lmp.command("units lj") From ec46510d2e33e09cd23641ec0a3dcb9b0d35017a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 23:07:01 -0400 Subject: [PATCH 152/172] add local extract_compute() tests --- unittest/python/python-commands.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/unittest/python/python-commands.py b/unittest/python/python-commands.py index 58a0772510..cd77fa21a1 100644 --- a/unittest/python/python-commands.py +++ b/unittest/python/python-commands.py @@ -1,6 +1,8 @@ import sys,os,unittest,ctypes -from lammps import lammps, LMP_VAR_ATOM, LMP_STYLE_GLOBAL, LMP_TYPE_VECTOR, LAMMPS_DOUBLE_2D, LAMMPS_AUTODETECT +from lammps import lammps, LMP_VAR_ATOM, LMP_STYLE_GLOBAL, LMP_STYLE_LOCAL +from lammps import LMP_TYPE_VECTOR, LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS +from lammps import LAMMPS_DOUBLE_2D, LAMMPS_AUTODETECT has_manybody=False try: @@ -311,6 +313,14 @@ create_atoms 1 single & self.assertEqual(minval,1.0) self.assertEqual(maxval,2.1) + ndist1 = self.lmp.extract_compute("dist",LMP_STYLE_LOCAL,LMP_SIZE_VECTOR) + ndist2 = self.lmp.extract_compute("dist",LMP_STYLE_LOCAL,LMP_SIZE_ROWS) + ndist3 = self.lmp.extract_compute("dist",LMP_STYLE_LOCAL,LMP_SIZE_COLS) + + self.assertEqual(ndist1,21) + self.assertEqual(ndist2,21) + self.assertEqual(ndist3,0) + self.assertNotEqual(self.lmp.find_pair_neighlist("lj/cut"),-1) self.assertNotEqual(self.lmp.find_compute_neighlist("dist"),-1) self.assertEqual(self.lmp.find_compute_neighlist("xxx"),-1) From ad20e54638cfb2a70f529c56090a2c7035b50022 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 20 Jun 2022 23:19:00 -0400 Subject: [PATCH 153/172] fix typos --- tools/msi2lmp/src/msi2lmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/msi2lmp/src/msi2lmp.c b/tools/msi2lmp/src/msi2lmp.c index 87cffb4e6e..3136678023 100644 --- a/tools/msi2lmp/src/msi2lmp.c +++ b/tools/msi2lmp/src/msi2lmp.c @@ -66,9 +66,9 @@ * The program is started by supplying information at the command prompt * according to the usage described below. * -* USAGE: msi2lmp3 ROOTNAME {-print #} {-class #} {-frc FRC_FILE} {-ignore} {-nocenter} {-oldstyle} +* USAGE: msi2lmp ROOTNAME {-print #} {-class #} {-frc FRC_FILE} {-ignore} {-nocenter} {-oldstyle} * -* -- msi2lmp3 is the name of the executable +* -- msi2lmp is the name of the executable * -- ROOTNAME is the base name of the .car and .mdf files * -- all opther flags are optional and can be abbreviated (e.g. -p instead of -print) * From 6815b27cd5436ddc5484229004aeb019e3b0a2e0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 21 Jun 2022 08:52:11 -0400 Subject: [PATCH 154/172] step version strings for the next patch release --- doc/lammps.1 | 4 ++-- src/version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/lammps.1 b/doc/lammps.1 index cfeb23aadb..5f1c25867e 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,7 +1,7 @@ -.TH LAMMPS "1" "2 June 2022" "2022-6-2" +.TH LAMMPS "1" "23 June 2022" "2022-6-23" .SH NAME .B LAMMPS -\- Molecular Dynamics Simulator. Version 2 June 2022 +\- Molecular Dynamics Simulator. Version 23 June 2022 .SH SYNOPSIS .B lmp diff --git a/src/version.h b/src/version.h index 60ed7ad75f..4b95d1c910 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "2 Jun 2022" +#define LAMMPS_VERSION "23 Jun 2022" From 7d49ad5924d3d3121983f2d57b2ac86395f0b96e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 21 Jun 2022 19:30:42 -0400 Subject: [PATCH 155/172] enable remap for restarting by default, add noremap option --- src/read_restart.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/read_restart.cpp b/src/read_restart.cpp index b42dcce1ca..a7fb5a828d 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -61,9 +61,10 @@ void ReadRestart::command(int narg, char **arg) // check for remap option - int remapflag = 0; + int remapflag = 1; if (narg == 2) { - if (strcmp(arg[1],"remap") == 0) remapflag = 1; + if (strcmp(arg[1],"noremap") == 0) remapflag = 0; + else if (strcmp(arg[1],"remap") == 0) remapflag = 1; // for backward compatibility else error->all(FLERR,"Illegal read_restart command"); } @@ -643,8 +644,7 @@ void ReadRestart::header() int dimension = read_int(); domain->dimension = dimension; if (domain->dimension == 2 && domain->zperiodic == 0) - error->all(FLERR, - "Cannot run 2d simulation with non-periodic Z dimension"); + error->all(FLERR, "Cannot run 2d simulation with non-periodic Z dimension"); // read nprocs from restart file, warn if different From b0f4ef8a39f684b5663071ad45c48b789bce723a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 21 Jun 2022 20:19:13 -0400 Subject: [PATCH 156/172] update docs for noremap option to read_restart --- doc/src/read_restart.rst | 67 ++++++++++----------- doc/utils/sphinx-config/false_positives.txt | 1 + 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/doc/src/read_restart.rst b/doc/src/read_restart.rst index 4d68167560..b593fd51ae 100644 --- a/doc/src/read_restart.rst +++ b/doc/src/read_restart.rst @@ -11,7 +11,7 @@ Syntax read_restart file flag * file = name of binary restart file to read in -* flag = remap (optional) +* flag = noremap (optional) Examples """""""" @@ -19,39 +19,36 @@ Examples .. code-block:: LAMMPS read_restart save.10000 - read_restart save.10000 remap + read_restart save.10000 noremap read_restart restart.* read_restart restart.*.mpiio - read_restart poly.*.% remap + read_restart poly.*.% noremap Description """"""""""" Read in a previously saved system configuration from a restart file. This allows continuation of a previous run. Details about what -information is stored (and not stored) in a restart file is given -below. Basically this operation will re-create the simulation box -with all its atoms and their attributes as well as some related global -settings, at the point in time it was written to the restart file by a -previous simulation. The simulation box will be partitioned into a -regular 3d grid of rectangular bricks, one per processor, based on the -number of processors in the current simulation and the settings of the +information is stored (and not stored) in a restart file is given below. +Basically this operation will re-create the simulation box with all its +atoms and their attributes as well as some related global settings, at +the point in time it was written to the restart file by a previous +simulation. The simulation box will be partitioned into a regular 3d +grid of rectangular bricks, one per processor, based on the number of +processors in the current simulation and the settings of the :doc:`processors ` command. The partitioning can later be -changed by the :doc:`balance ` or :doc:`fix balance ` commands. +changed by the :doc:`balance ` or :doc:`fix balance +` commands. .. note:: - Normally, restart files are written by the - :doc:`restart ` or :doc:`write_restart ` commands - so that all atoms in the restart file are inside the simulation box. - If this is not the case, the read_restart command will print an error - that atoms were "lost" when the file is read. This error should be - reported to the LAMMPS developers so the invalid writing of the - restart file can be fixed. If you still wish to use the restart file, - the optional *remap* flag can be appended to the read_restart command. - This should avoid the error, by explicitly remapping each atom back - into the simulation box, updating image flags for the atom - appropriately. + When restart files are read, atoms are explicitly remapped back into + the simulation box and image flags updated accordingly. In most + cases this will not make a difference since writing a restart file + will also trigger a rebuild of the neighbor lists and remapping of + atoms into the simulation box. This extra remap results in some + overhead that can be avoided by appending the optional *noremap* flag + to the read_restart command. Restart files are saved in binary format to enable exact restarts, meaning that the trajectories of a restarted run will precisely match @@ -65,7 +62,8 @@ certain settings such as those set by the :doc:`newton ` or these cases. Certain fixes will not restart exactly, though they should provide -statistically similar results. These include :doc:`fix shake ` and :doc:`fix langevin `. +statistically similar results. These include :doc:`fix shake +` and :doc:`fix langevin `. Certain pair styles will not restart exactly, though they should provide statistically similar results. This is because the forces @@ -81,18 +79,19 @@ produced the restart file, it could be a LAMMPS bug, so consider :doc:`reporting it ` if you think the behavior is a bug. Because restart files are binary, they may not be portable to other -machines. In this case, you can use the :doc:`-restart command-line switch ` to convert a restart file to a data file. +machines. In this case, you can use the :doc:`-restart command-line +switch ` to convert a restart file to a data file. -Similar to how restart files are written (see the -:doc:`write_restart ` and :doc:`restart ` -commands), the restart filename can contain two wild-card characters. -If a "\*" appears in the filename, the directory is searched for all -filenames that match the pattern where "\*" is replaced with a timestep -value. The file with the largest timestep value is read in. Thus, -this effectively means, read the latest restart file. It's useful if -you want your script to continue a run from where it left off. See -the :doc:`run ` command and its "upto" option for how to specify -the run command so it does not need to be changed either. +Similar to how restart files are written (see the :doc:`write_restart +` and :doc:`restart ` commands), the restart +filename can contain two wild-card characters. If a "\*" appears in the +filename, the directory is searched for all filenames that match the +pattern where "\*" is replaced with a timestep value. The file with the +largest timestep value is read in. Thus, this effectively means, read +the latest restart file. It's useful if you want your script to +continue a run from where it left off. See the :doc:`run ` command +and its "upto" option for how to specify the run command so it does not +need to be changed either. If a "%" character appears in the restart filename, LAMMPS expects a set of multiple files to exist. The :doc:`restart ` and diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index b42cff262a..cce6e92d05 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2369,6 +2369,7 @@ nopreliminary Nord norder Nordlund +noremap normals normx normy From b0c673d8564629f35c1ed9de081ca1837536c83f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 21 Jun 2022 20:37:20 -0400 Subject: [PATCH 157/172] updates from Karl Hammond to adjust his email and correct an error message --- examples/COUPLE/fortran2/LAMMPS-wrapper.cpp | 4 ++-- examples/COUPLE/fortran2/LAMMPS-wrapper.h | 4 ++-- examples/COUPLE/fortran2/LAMMPS.F90 | 2 +- examples/COUPLE/fortran2/README | 5 ++--- examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp | 4 ++-- examples/COUPLE/fortran_dftb/LAMMPS-wrapper.h | 4 ++-- examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp | 4 ++-- examples/COUPLE/fortran_dftb/LAMMPS.F90 | 4 ++-- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp index 8b6a257755..b5b265b4dd 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond - University of Tennessee, Knoxville (USA), 2012 + Contributing author: Karl D. Hammond + University of Missouri (USA), 2012 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.h b/examples/COUPLE/fortran2/LAMMPS-wrapper.h index 68e03ae05a..479af91738 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.h +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.h @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond - University of Tennessee, Knoxville (USA), 2012 + Contributing author: Karl D. Hammond + University of Missouri (USA), 2012 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself diff --git a/examples/COUPLE/fortran2/LAMMPS.F90 b/examples/COUPLE/fortran2/LAMMPS.F90 index 8b74a38721..65ea83e245 100644 --- a/examples/COUPLE/fortran2/LAMMPS.F90 +++ b/examples/COUPLE/fortran2/LAMMPS.F90 @@ -1292,7 +1292,7 @@ contains !! Wrapper functions local to this module {{{1 Cname = string2Cstring (name) Ccount = size(data) / natoms if ( Ccount /= 1 .and. Ccount /= 3 ) & - call lammps_error_all (ptr, FLERR, 'lammps_gather_atoms requires& + call lammps_error_all (ptr, FLERR, 'lammps_scatter_atoms requires& & count to be either 1 or 3') Fdata = data Cdata = C_loc (Fdata(1)) diff --git a/examples/COUPLE/fortran2/README b/examples/COUPLE/fortran2/README index 1710ca8ba6..0a7b862d86 100644 --- a/examples/COUPLE/fortran2/README +++ b/examples/COUPLE/fortran2/README @@ -11,9 +11,8 @@ This interface was created by Karl Hammond who you can contact with questions: Karl D. Hammond -University of Tennessee, Knoxville -karlh at ugcs.caltech.edu -karlh at utk.edu +University of Missouri +hammondkd at missouri.edu ------------------------------------- diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp index 8b6a257755..b5b265b4dd 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond - University of Tennessee, Knoxville (USA), 2012 + Contributing author: Karl D. Hammond + University of Missouri (USA), 2012 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.h b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.h index 7d94362436..553466d138 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.h +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.h @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond - University of Tennessee, Knoxville (USA), 2012 + Contributing author: Karl D. Hammond + University of Missouri (USA), 2012 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp index 5f94363346..605735a2b7 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond - University of Tennessee, Knoxville (USA), 2012 + Contributing author: Karl D. Hammond + University of Missouri (USA), 2012 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself diff --git a/examples/COUPLE/fortran_dftb/LAMMPS.F90 b/examples/COUPLE/fortran_dftb/LAMMPS.F90 index 9b18bbfa5f..188fff9d60 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS.F90 +++ b/examples/COUPLE/fortran_dftb/LAMMPS.F90 @@ -12,8 +12,8 @@ !-------------------------------------------------------------------------- !! ------------------------------------------------------------------------ -! Contributing author: Karl D. Hammond -! University of Tennessee, Knoxville (USA), 2012 +! Contributing author: Karl D. Hammond +! University of Missouri (USA), 2012 !-------------------------------------------------------------------------- !! LAMMPS, a Fortran 2003 module containing an interface between Fortran From c0b109f715b08eb05535fcc318a0db19b7b3b06b Mon Sep 17 00:00:00 2001 From: Karl Hammond Date: Tue, 21 Jun 2022 20:53:45 -0500 Subject: [PATCH 158/172] Fixed some typos and updated e-mail addresses in examples/COUPLE/fortran2 --- examples/COUPLE/fortran2/LAMMPS-wrapper.cpp | 2 +- examples/COUPLE/fortran2/LAMMPS-wrapper.h | 2 +- examples/COUPLE/fortran2/LAMMPS.F90 | 4 ++-- examples/COUPLE/fortran2/README | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp index 8b6a257755..fb8c67ecc9 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond + Contributing author: Karl D. Hammond University of Tennessee, Knoxville (USA), 2012 ------------------------------------------------------------------------- */ diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.h b/examples/COUPLE/fortran2/LAMMPS-wrapper.h index 68e03ae05a..a1e5fcdd1f 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.h +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.h @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond + Contributing author: Karl D. Hammond University of Tennessee, Knoxville (USA), 2012 ------------------------------------------------------------------------- */ diff --git a/examples/COUPLE/fortran2/LAMMPS.F90 b/examples/COUPLE/fortran2/LAMMPS.F90 index 8b74a38721..251b56f48f 100644 --- a/examples/COUPLE/fortran2/LAMMPS.F90 +++ b/examples/COUPLE/fortran2/LAMMPS.F90 @@ -1292,7 +1292,7 @@ contains !! Wrapper functions local to this module {{{1 Cname = string2Cstring (name) Ccount = size(data) / natoms if ( Ccount /= 1 .and. Ccount /= 3 ) & - call lammps_error_all (ptr, FLERR, 'lammps_gather_atoms requires& + call lammps_error_all (ptr, FLERR, 'lammps_scatter_atoms requires& & count to be either 1 or 3') Fdata = data Cdata = C_loc (Fdata(1)) @@ -1355,7 +1355,7 @@ contains !! Wrapper functions local to this module {{{1 Cname = string2Cstring (name) Ccount = size(data) / ndata if ( Ccount /= 1 .and. Ccount /= 3 ) & - call lammps_error_all (ptr, FLERR, 'lammps_gather_atoms requires& + call lammps_error_all (ptr, FLERR, 'lammps_scatter_atoms requires& & count to be either 1 or 3') Fdata = data Cdata = C_loc (Fdata(1)) diff --git a/examples/COUPLE/fortran2/README b/examples/COUPLE/fortran2/README index 1710ca8ba6..0a7b862d86 100644 --- a/examples/COUPLE/fortran2/README +++ b/examples/COUPLE/fortran2/README @@ -11,9 +11,8 @@ This interface was created by Karl Hammond who you can contact with questions: Karl D. Hammond -University of Tennessee, Knoxville -karlh at ugcs.caltech.edu -karlh at utk.edu +University of Missouri +hammondkd at missouri.edu ------------------------------------- From 49331be33e4aeb89b69a2056b26bfdc82ada6e46 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 22 Jun 2022 07:05:30 -0400 Subject: [PATCH 159/172] simplify --- examples/COUPLE/fortran2/LAMMPS-wrapper.cpp | 1 + examples/COUPLE/fortran2/Makefile | 2 +- examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp index b5b265b4dd..1301bfe348 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp @@ -23,6 +23,7 @@ #include #include "LAMMPS-wrapper.h" +#define LAMMPS_LIB_MPI 1 #include #include #include diff --git a/examples/COUPLE/fortran2/Makefile b/examples/COUPLE/fortran2/Makefile index fe66914892..f8a2126233 100644 --- a/examples/COUPLE/fortran2/Makefile +++ b/examples/COUPLE/fortran2/Makefile @@ -14,7 +14,7 @@ CXXLIB = -lstdc++ # replace with your C++ runtime libs # Flags for Fortran compiler, C++ compiler, and C preprocessor, respectively FFLAGS = -O2 -fPIC CXXFLAGS = -O2 -fPIC -CPPFLAGS = -DOMPI_SKIP_MPICXX=1 -DMPICH_SKIP_MPICXX -DLAMMPS_LIB_MPI +CPPFLAGS = -DOMPI_SKIP_MPICXX=1 -DMPICH_SKIP_MPICXX all : liblammps_fortran.a liblammps_fortran.so diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp index b5b265b4dd..1301bfe348 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp @@ -23,6 +23,7 @@ #include #include "LAMMPS-wrapper.h" +#define LAMMPS_LIB_MPI 1 #include #include #include From 37f056c45590d63005f495c1cdbf0a5d89454ec2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 22 Jun 2022 07:06:00 -0400 Subject: [PATCH 160/172] get array and vector sizes from the avaiable APIs --- examples/COUPLE/fortran2/LAMMPS-wrapper.cpp | 177 ++---------------- .../COUPLE/fortran_dftb/LAMMPS-wrapper.cpp | 177 ++---------------- 2 files changed, 36 insertions(+), 318 deletions(-) diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp index 1301bfe348..eb6f421606 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp @@ -57,181 +57,40 @@ void lammps_error_all (void *ptr, const char *file, int line, const char *str) int lammps_extract_compute_vectorsize (void *ptr, char *id, int style) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int icompute = lmp->modify->find_compute(id); - if ( icompute < 0 ) return 0; - class Compute *compute = lmp->modify->compute[icompute]; - - if ( style == 0 ) - { - if ( !compute->vector_flag ) - return 0; - else - return compute->size_vector; - } - else if ( style == 1 ) - { - return lammps_get_natoms (ptr); - } - else if ( style == 2 ) - { - if ( !compute->local_flag ) - return 0; - else - return compute->size_local_rows; - } - else - return 0; + int *size; + size = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_VECTOR); + if (size) return *size; + return 0; } void lammps_extract_compute_arraysize (void *ptr, char *id, int style, int *nrows, int *ncols) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int icompute = lmp->modify->find_compute(id); - if ( icompute < 0 ) - { - *nrows = 0; - *ncols = 0; - } - class Compute *compute = lmp->modify->compute[icompute]; - - if ( style == 0 ) - { - if ( !compute->array_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = compute->size_array_rows; - *ncols = compute->size_array_cols; - } - } - else if ( style == 1 ) - { - if ( !compute->peratom_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = lammps_get_natoms (ptr); - *ncols = compute->size_peratom_cols; - } - } - else if ( style == 2 ) - { - if ( !compute->local_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = compute->size_local_rows; - *ncols = compute->size_local_cols; - } - } - else - { - *nrows = 0; - *ncols = 0; - } - + int *tmp; + tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_ROWS); + if (tmp) *nrows = *tmp; + tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_COLS); + if (tmp) *ncols = *tmp; return; } int lammps_extract_fix_vectorsize (void *ptr, char *id, int style) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int ifix = lmp->modify->find_fix(id); - if ( ifix < 0 ) return 0; - class Fix *fix = lmp->modify->fix[ifix]; - - if ( style == 0 ) - { - if ( !fix->vector_flag ) - return 0; - else - return fix->size_vector; - } - else if ( style == 1 ) - { - return lammps_get_natoms (ptr); - } - else if ( style == 2 ) - { - if ( !fix->local_flag ) - return 0; - else - return fix->size_local_rows; - } - else - return 0; + int *size; + size = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_VECTOR, 0, 0); + if (size) return *size; + return 0; } void lammps_extract_fix_arraysize (void *ptr, char *id, int style, int *nrows, int *ncols) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int ifix = lmp->modify->find_fix(id); - if ( ifix < 0 ) - { - *nrows = 0; - *ncols = 0; - } - class Fix *fix = lmp->modify->fix[ifix]; - - if ( style == 0 ) - { - if ( !fix->array_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = fix->size_array_rows; - *ncols = fix->size_array_cols; - } - } - else if ( style == 1 ) - { - if ( !fix->peratom_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = lammps_get_natoms (ptr); - *ncols = fix->size_peratom_cols; - } - } - else if ( style == 2 ) - { - if ( !fix->local_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = fix->size_local_rows; - *ncols = fix->size_local_cols; - } - } - else - { - *nrows = 0; - *ncols = 0; - } - + int *tmp; + tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_ROWS, 0, 0); + if (tmp) *nrows = *tmp; + tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_COLS, 0, 0); + if (tmp) *ncols = *tmp; return; - } /* vim: set ts=3 sts=3 expandtab: */ diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp index 1301bfe348..eb6f421606 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp @@ -57,181 +57,40 @@ void lammps_error_all (void *ptr, const char *file, int line, const char *str) int lammps_extract_compute_vectorsize (void *ptr, char *id, int style) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int icompute = lmp->modify->find_compute(id); - if ( icompute < 0 ) return 0; - class Compute *compute = lmp->modify->compute[icompute]; - - if ( style == 0 ) - { - if ( !compute->vector_flag ) - return 0; - else - return compute->size_vector; - } - else if ( style == 1 ) - { - return lammps_get_natoms (ptr); - } - else if ( style == 2 ) - { - if ( !compute->local_flag ) - return 0; - else - return compute->size_local_rows; - } - else - return 0; + int *size; + size = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_VECTOR); + if (size) return *size; + return 0; } void lammps_extract_compute_arraysize (void *ptr, char *id, int style, int *nrows, int *ncols) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int icompute = lmp->modify->find_compute(id); - if ( icompute < 0 ) - { - *nrows = 0; - *ncols = 0; - } - class Compute *compute = lmp->modify->compute[icompute]; - - if ( style == 0 ) - { - if ( !compute->array_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = compute->size_array_rows; - *ncols = compute->size_array_cols; - } - } - else if ( style == 1 ) - { - if ( !compute->peratom_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = lammps_get_natoms (ptr); - *ncols = compute->size_peratom_cols; - } - } - else if ( style == 2 ) - { - if ( !compute->local_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = compute->size_local_rows; - *ncols = compute->size_local_cols; - } - } - else - { - *nrows = 0; - *ncols = 0; - } - + int *tmp; + tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_ROWS); + if (tmp) *nrows = *tmp; + tmp = (int *) lammps_extract_compute(ptr, id, style, LMP_SIZE_COLS); + if (tmp) *ncols = *tmp; return; } int lammps_extract_fix_vectorsize (void *ptr, char *id, int style) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int ifix = lmp->modify->find_fix(id); - if ( ifix < 0 ) return 0; - class Fix *fix = lmp->modify->fix[ifix]; - - if ( style == 0 ) - { - if ( !fix->vector_flag ) - return 0; - else - return fix->size_vector; - } - else if ( style == 1 ) - { - return lammps_get_natoms (ptr); - } - else if ( style == 2 ) - { - if ( !fix->local_flag ) - return 0; - else - return fix->size_local_rows; - } - else - return 0; + int *size; + size = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_VECTOR, 0, 0); + if (size) return *size; + return 0; } void lammps_extract_fix_arraysize (void *ptr, char *id, int style, int *nrows, int *ncols) { - class LAMMPS *lmp = (class LAMMPS *) ptr; - int ifix = lmp->modify->find_fix(id); - if ( ifix < 0 ) - { - *nrows = 0; - *ncols = 0; - } - class Fix *fix = lmp->modify->fix[ifix]; - - if ( style == 0 ) - { - if ( !fix->array_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = fix->size_array_rows; - *ncols = fix->size_array_cols; - } - } - else if ( style == 1 ) - { - if ( !fix->peratom_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = lammps_get_natoms (ptr); - *ncols = fix->size_peratom_cols; - } - } - else if ( style == 2 ) - { - if ( !fix->local_flag ) - { - *nrows = 0; - *ncols = 0; - } - else - { - *nrows = fix->size_local_rows; - *ncols = fix->size_local_cols; - } - } - else - { - *nrows = 0; - *ncols = 0; - } - + int *tmp; + tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_ROWS, 0, 0); + if (tmp) *nrows = *tmp; + tmp = (int *) lammps_extract_fix(ptr, id, style, LMP_SIZE_COLS, 0, 0); + if (tmp) *ncols = *tmp; return; - } /* vim: set ts=3 sts=3 expandtab: */ From 2fb36084625933d9544681becc550d52f9402432 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 22 Jun 2022 07:06:16 -0400 Subject: [PATCH 161/172] update/correct contact info --- examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp | 3 +-- examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp index 605735a2b7..44d7b5bca4 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp @@ -12,8 +12,7 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Karl D. Hammond - University of Missouri (USA), 2012 + Contributing author: Nir Goldman, LLNL , 2016 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.h b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.h index ed79015e78..d3705179ed 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.h +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.h @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------ - Contributing author: Nir Goldman, ngoldman@llnl.gov, Oct. 19th, 2016 + Contributing author: Nir Goldman, LLNL , 2016 ------------------------------------------------------------------------- */ /* This is set of "wrapper" functions to assist LAMMPS.F90, which itself From 9b8c19c1a5846db7a04c8d70b6e8f74720390da6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 22 Jun 2022 10:24:56 -0400 Subject: [PATCH 162/172] correct docs about how to get synchronized timings --- doc/src/Speed_measure.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/Speed_measure.rst b/doc/src/Speed_measure.rst index 1daf49f4c4..888e8d9790 100644 --- a/doc/src/Speed_measure.rst +++ b/doc/src/Speed_measure.rst @@ -42,5 +42,4 @@ inaccurate relative timing data, because processors have to wait when communication occurs for other processors to catch up. Thus the reported times for "Communication" or "Other" may be higher than they really are, due to load-imbalance. If this is an issue, you can -uncomment the MPI_Barrier() lines in src/timer.cpp, and re-compile -LAMMPS, to obtain synchronized timings. +use the :doc:`timer sync ` command to obtain synchronized timings. From c5999df3039a4921f978993c06ed3df09dabf66c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 22 Jun 2022 10:32:03 -0400 Subject: [PATCH 163/172] remove dead code and silence compiler warning about it --- src/EXTRA-COMPUTE/compute_stress_cartesian.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp index f873c70bae..2dde2397db 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp @@ -266,7 +266,7 @@ void ComputeStressCartesian::compute_array() Pair *pair = force->pair; double **cutsq = force->pair->cutsq; - double xi1, xi2, xj1, xj2; + double xi1, xi2; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; @@ -305,9 +305,6 @@ void ComputeStressCartesian::compute_array() } } } - xj1 = x[j][dir1]; - xj2 = x[j][dir2]; - delx = x[j][0] - xtmp; dely = x[j][1] - ytmp; delz = x[j][2] - ztmp; From 1099199e9303107eee6d2e7649fcaf57165c20f8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 22 Jun 2022 14:22:23 -0400 Subject: [PATCH 164/172] remove any remap related documentation. add paragraph about file compatibility --- doc/src/read_restart.rst | 55 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/doc/src/read_restart.rst b/doc/src/read_restart.rst index b593fd51ae..f3065a2a5c 100644 --- a/doc/src/read_restart.rst +++ b/doc/src/read_restart.rst @@ -11,7 +11,6 @@ Syntax read_restart file flag * file = name of binary restart file to read in -* flag = noremap (optional) Examples """""""" @@ -19,10 +18,8 @@ Examples .. code-block:: LAMMPS read_restart save.10000 - read_restart save.10000 noremap read_restart restart.* read_restart restart.*.mpiio - read_restart poly.*.% noremap Description """"""""""" @@ -40,20 +37,21 @@ processors in the current simulation and the settings of the changed by the :doc:`balance ` or :doc:`fix balance ` commands. -.. note:: - - When restart files are read, atoms are explicitly remapped back into - the simulation box and image flags updated accordingly. In most - cases this will not make a difference since writing a restart file - will also trigger a rebuild of the neighbor lists and remapping of - atoms into the simulation box. This extra remap results in some - overhead that can be avoided by appending the optional *noremap* flag - to the read_restart command. - Restart files are saved in binary format to enable exact restarts, meaning that the trajectories of a restarted run will precisely match those produced by the original run had it continued on. +The binary restart file format was not designed with backward, forward, +or cross-platform compatibility in mind, so the files are only expected +to be read correctly by the same LAMMPS executable on the same platform. +Changes to the architecture, compilation settings, or LAMMPS version can +render a restart file unreadable or it may read the data incorrectly. +If you want a more portable format, you can use the data file format as +created by the :doc:`write_data ` command. Binary restart +files can also be converted into a data file from the command line by +the LAMMPS executable that wrote them using the :ref:`-restart2data +` command line flag. + Several things can prevent exact restarts due to round-off effects, in which case the trajectories in the 2 runs will slowly diverge. These include running on a different number of processors or changing @@ -221,17 +219,17 @@ its calculations in a consistent manner. .. note:: - There are a handful of commands which can be used before or - between runs which may require a system initialization. Examples - include the "balance", "displace_atoms", "delete_atoms", "set" (some - options), and "velocity" (some options) commands. This is because - they can migrate atoms to new processors. Thus they will also discard - unused "state" information from fixes. You will know the discard has + There are a handful of commands which can be used before or between + runs which may require a system initialization. Examples include the + "balance", "displace_atoms", "delete_atoms", "set" (some options), + and "velocity" (some options) commands. This is because they can + migrate atoms to new processors. Thus they will also discard unused + "state" information from fixes. You will know the discard has occurred because a list of discarded fixes will be printed to the screen and log file, as explained above. This means that if you wish to retain that info in a restarted run, you must re-specify the - relevant fixes and computes (which create fixes) before those commands - are used. + relevant fixes and computes (which create fixes) before those + commands are used. Some pair styles, like the :doc:`granular pair styles `, also use a fix to store "state" information that persists from timestep to @@ -244,18 +242,19 @@ LAMMPS allows bond interactions (angle, etc) to be turned off or deleted in various ways, which can affect how their info is stored in a restart file. -If bonds (angles, etc) have been turned off by the :doc:`fix shake ` or :doc:`delete_bonds ` command, -their info will be written to a restart file as if they are turned on. -This means they will need to be turned off again in a new run after -the restart file is read. +If bonds (angles, etc) have been turned off by the :doc:`fix shake +` or :doc:`delete_bonds ` command, their info +will be written to a restart file as if they are turned on. This means +they will need to be turned off again in a new run after the restart +file is read. Bonds that are broken (e.g. by a bond-breaking potential) are written to the restart file as broken bonds with a type of 0. Thus these bonds will still be broken when the restart file is read. -Bonds that have been broken by the :doc:`fix bond/break ` command have disappeared from the -system. No information about these bonds is written to the restart -file. +Bonds that have been broken by the :doc:`fix bond/break +` command have disappeared from the system. No +information about these bonds is written to the restart file. ---------- From b1b580cc041f3092a138e59ca68713268dc41237 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Mon, 27 Jun 2022 17:03:02 -0600 Subject: [PATCH 165/172] Final tidying up --- doc/src/compute_sna_atom.rst | 229 ----------------------- src/{ => ML-SNAP}/compute_grid.cpp | 0 src/{ => ML-SNAP}/compute_grid.h | 0 src/{ => ML-SNAP}/compute_grid_local.cpp | 0 src/{ => ML-SNAP}/compute_grid_local.h | 0 src/ML-SNAP/compute_sna_grid.cpp | 3 +- src/ML-SNAP/compute_sna_grid_local.cpp | 1 + 7 files changed, 3 insertions(+), 230 deletions(-) rename src/{ => ML-SNAP}/compute_grid.cpp (100%) rename src/{ => ML-SNAP}/compute_grid.h (100%) rename src/{ => ML-SNAP}/compute_grid_local.cpp (100%) rename src/{ => ML-SNAP}/compute_grid_local.h (100%) diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index 354a9a8fa6..deb717d84d 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -467,235 +467,6 @@ number of columns in the global array generated by *snap* are 31, and 931, respectively, while the number of rows is 1+3\*\ *N*\ +6, where *N* is the total number of atoms. -If the *quadratic* keyword value is set to 1, then additional columns -are generated, corresponding to the products of all distinct pairs of -bispectrum components. If the number of bispectrum components is *K*, -then the number of distinct pairs is *K*\ (\ *K*\ +1)/2. For compute -*sna/atom* these columns are appended to existing *K* columns. The -ordering of quadratic terms is upper-triangular, (1,1),(1,2)...(1,\ *K*\ -),(2,1)...(\ *K*\ -1,\ *K*\ -1),(\ *K*\ -1,\ *K*\ ),(\ *K*,\ *K*\ ). -For computes *snad/atom* and *snav/atom* each set of *K*\ (\ *K*\ +1)/2 -additional columns is inserted directly after each of sub-block of -linear terms i.e. linear and quadratic terms are contiguous. So the -nesting order from inside to outside is bispectrum component, linear -then quadratic, vector/tensor component, type. - -If the *chem* keyword is used, then the data is arranged into -:math:`N_{elem}^3` sub-blocks, each sub-block corresponding to a -particular chemical labeling :math:`\kappa\lambda\mu` with the last -label changing fastest. Each sub-block contains *K* bispectrum -components. For the purposes of handling contributions to force, virial, -and quadratic combinations, these :math:`N_{elem}^3` sub-blocks are -treated as a single block of :math:`K N_{elem}^3` columns. - -These values can be accessed by any command that uses per-atom values -from a compute as input. See the :doc:`Howto output ` doc -page for an overview of LAMMPS output options. To see how this command -can be used within a Python workflow to train SNAP potentials, see the -examples in `FitSNAP `_. - -The value of all bispectrum components will be zero for atoms not in -the group. Neighbor atoms not in the group do not contribute to the -bispectrum of atoms in the group. - -The neighbor list needed to compute this quantity is constructed each -time the calculation is performed (i.e. each time a snapshot of atoms -is dumped). Thus it can be inefficient to compute/dump this quantity -too frequently. - -The argument *rcutfac* is a scale factor that controls the ratio of -atomic radius to radial cutoff distance. - -The argument *rfac0* and the optional keyword *rmin0* define the -linear mapping from radial distance to polar angle :math:`theta_0` on the -3-sphere, given above. - -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. - -The keyword *switchflag* can be used to turn off the switching -function :math:`f_c(r)`. - -The keyword *bzeroflag* determines whether or not *B0*, the bispectrum -components of an atom with no neighbors, are subtracted from the -calculated bispectrum components. This optional keyword normally only -affects compute *sna/atom*\ . However, when *quadraticflag* is on, it -also affects *snad/atom* and *snav/atom*\ . - -The keyword *quadraticflag* determines whether or not the quadratic -combinations of bispectrum quantities are generated. These are formed -by taking the outer product of the vector of bispectrum components with -itself. See section below on output for a detailed explanation of the -number of quadratic terms and the ordered in which they are listed. - -The keyword *chem* activates the explicit multi-element variant of the -SNAP bispectrum components. The argument *nelements* specifies the -number of SNAP elements that will be handled. This is followed by -*elementlist*, a list of integers of length *ntypes*, with values in the -range [0, *nelements* ), which maps each LAMMPS type to one of the SNAP -elements. Note that multiple LAMMPS types can be mapped to the same -element, and some elements may be mapped by no LAMMPS type. However, in -typical use cases (training SNAP potentials) the mapping from LAMMPS -types to elements is one-to-one. - -The explicit multi-element variant invoked by the *chem* keyword -partitions the density of neighbors into partial densities for each -chemical element. This is described in detail in the paper by -:ref:`Cusentino et al. ` The bispectrum components are -indexed on ordered triplets of elements: - -.. math:: - - B_{j_1,j_2,j}^{\kappa\lambda\mu} = - \sum_{m_1,m'_1=-j_1}^{j_1}\sum_{m_2,m'_2=-j_2}^{j_2}\sum_{m,m'=-j}^{j} (u^{\mu}_{j,m,m'})^* - H {\scriptscriptstyle \begin{array}{l} {j} {m} {m'} \\ - {j_1} {m_1} {m'_1} \\ - {j_2} {m_2} {m'_2} \end{array}} - u^{\kappa}_{j_1,m_1,m'_1} u^{\lambda}_{j_2,m_2,m'_2} - -where :math:`u^{\mu}_{j,m,m'}` is an expansion coefficient for the partial density of neighbors -of element :math:`\mu` - -.. math:: - - u^{\mu}_{j,m,m'} = w^{self}_{\mu_{i}\mu} U^{j,m,m'}(0,0,0) + \sum_{r_{ii'} < R_{ii'}}{\delta_{\mu\mu_{i'}}f_c(r_{ii'}) w_{\mu_{i'}} U^{j,m,m'}(\theta_0,\theta,\phi)} - -where :math:`w^{self}_{\mu_{i}\mu}` is the self-contribution, which is -either 1 or 0 (see keyword *wselfallflag* below), -:math:`\delta_{\mu\mu_{i'}}` indicates that the sum is only over -neighbor atoms of element :math:`\mu`, and all other quantities are the -same as those appearing in the original equation for :math:`u^j_{m,m'}` -given above. - -The keyword *wselfallflag* defines the rule used for the -self-contribution. If *wselfallflag* is on, then -:math:`w^{self}_{\mu_{i}\mu}` = 1. If it is off then -:math:`w^{self}_{\mu_{i}\mu}` = 0, except in the case of -:math:`{\mu_{i}=\mu}`, when :math:`w^{self}_{\mu_{i}\mu}` = 1. When the -*chem* keyword is not used, this keyword has no effect. - -The keyword *bnormflag* determines whether or not the bispectrum -component :math:`B_{j_1,j_2,j}` is divided by a factor of :math:`2j+1`. -This normalization simplifies force calculations because of the -following symmetry relation - -.. math:: - - \frac{B_{j_1,j_2,j}}{2j+1} = \frac{B_{j,j_2,j_1}}{2j_1+1} = \frac{B_{j_1,j,j_2}}{2j_2+1} - -This option is typically used in conjunction with the *chem* keyword, -and LAMMPS will generate a warning if both *chem* and *bnormflag* -are not both set or not both unset. - -The keyword *bikflag* determines whether or not to expand the bispectrum -rows of the global array returned by compute snap. If *bikflag* is set -to *1* then the bispectrum row, which is typically the per-atom bispectrum -descriptors :math:`B_{i,k}` summed over all atoms *i* to produce -:math:`B_k`, becomes bispectrum rows equal to the number of atoms. Thus, -the resulting bispectrum rows are :math:`B_{i,k}` instead of just -:math:`B_k`. In this case, the entries in the final column for these rows -are set to zero. - -The keyword *switchinnerflag* with value 1 -activates an additional radial switching -function similar to :math:`f_c(r)` above, but acting to switch off -smoothly contributions from neighbor atoms at short separation distances. -This is useful when SNAP is used in combination with a simple -repulsive potential. For a neighbor atom at -distance :math:`r`, its contribution is scaled by a multiplicative -factor :math:`f_{inner}(r)` defined as follows: - -.. math:: - - = & 0, r \leq S_{inner} - D_{inner} \\ - f_{inner}(r) = & \frac{1}{2}(1 - \cos(\frac{\pi}{2} (1 + \frac{r-S_{inner}}{D_{inner}})), S_{inner} - D_{inner} < r \leq S_{inner} + D_{inner} \\ - = & 1, r > S_{inner} + D_{inner} - -where the switching region is centered at :math:`S_{inner}` and it extends a distance :math:`D_{inner}` -to the left and to the right of this. -With this option, additional keywords *sinner* and *dinner* must be used, -each followed by *ntypes* -values for :math:`S_{inner}` and :math:`D_{inner}`, respectively. -When the central atom and the neighbor atom have different types, -the values of :math:`S_{inner}` and :math:`D_{inner}` are -the arithmetic means of the values for both types. - -.. note:: - - If you have a bonded system, then the settings of :doc:`special_bonds - ` command can remove pairwise interactions between - atoms in the same bond, angle, or dihedral. This is the default - setting for the :doc:`special_bonds ` command, and - means those pairwise interactions do not appear in the neighbor list. - Because this fix uses the neighbor list, it also means those pairs - will not be included in the calculation. One way to get around this, - is to write a dump file, and use the :doc:`rerun ` command to - compute the bispectrum components for snapshots in the dump file. - The rerun script can use a :doc:`special_bonds ` - command that includes all pairs in the neighbor list. - ----------- - -Output info -""""""""""" - -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 of the value of *twojmax*, as described by the following -piece of python code: - -.. parsed-literal:: - - for j1 in range(0,twojmax+1): - 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. - -For even twojmax = 2(*m*\ -1), :math:`K = m(m+1)(2m+1)/6`, the *m*\ -th pyramidal number. For odd twojmax = 2 *m*\ -1, :math:`K = m(m+1)(m+2)/3`, twice the *m*\ -th tetrahedral number. - -.. 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* -components of the atom position. Each of these sub-blocks contains *K* -columns for the *K* bispectrum components, the same as for compute -*sna/atom* - -Compute *snav/atom* evaluates a per-atom array. The columns are arranged -into *ntypes* blocks, listed in order of atom type *I*\ . Each block -contains six sub-blocks corresponding to the *xx*, *yy*, *zz*, -*yz*, *xz*, and *xy* components of the virial tensor in Voigt -notation. Each of these sub-blocks contains *K* columns for the *K* -bispectrum components, the same as for compute *sna/atom* - -Compute *snap* evaluates a global array. The columns are arranged into -*ntypes* blocks, listed in order of atom type *I*\ . Each block contains -one column for each bispectrum component, the same as for compute -*sna/atom*\ . A final column contains the corresponding energy, force -component on an atom, or virial stress component. The rows of the array -appear in the following order: - -* 1 row: *sna/atom* quantities summed for all atoms of type *I* -* 3\*\ *N* rows: *snad/atom* quantities, with derivatives w.r.t. x, y, and z coordinate of atom *i* appearing in consecutive rows. The atoms are sorted based on atom ID. -* 6 rows: *snav/atom* quantities summed for all atoms of type *I* - -For example, if *K* =30 and ntypes=1, the number of columns in the -per-atom arrays generated by *sna/atom*, *snad/atom*, and -*snav/atom* are 30, 90, and 180, respectively. With *quadratic* value=1, -the numbers of columns are 930, 2790, and 5580, respectively. The -number of columns in the global array generated by *snap* are 31, and -931, respectively, while the number of rows is 1+3\*\ *N*\ +6, where *N* -is the total number of atoms. - Compute *sna/grid* evaluates a global array. The array contains one row for each of the :math:`nx \times ny \times nz` grid points, looping over the index for *ix* fastest, diff --git a/src/compute_grid.cpp b/src/ML-SNAP/compute_grid.cpp similarity index 100% rename from src/compute_grid.cpp rename to src/ML-SNAP/compute_grid.cpp diff --git a/src/compute_grid.h b/src/ML-SNAP/compute_grid.h similarity index 100% rename from src/compute_grid.h rename to src/ML-SNAP/compute_grid.h diff --git a/src/compute_grid_local.cpp b/src/ML-SNAP/compute_grid_local.cpp similarity index 100% rename from src/compute_grid_local.cpp rename to src/ML-SNAP/compute_grid_local.cpp diff --git a/src/compute_grid_local.h b/src/ML-SNAP/compute_grid_local.h similarity index 100% rename from src/compute_grid_local.h rename to src/ML-SNAP/compute_grid_local.h diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index ac267112b1..771a30eb9f 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -228,7 +228,8 @@ void ComputeSNAGrid::compute_array() const double ztmp = xgrid[2]; // currently, all grid points are type 1 - + // not clear what a better choice would be + const int itype = 1; int ielem = 0; if (chemflag) ielem = map[itype]; diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 059f177696..80a1baddab 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -227,6 +227,7 @@ void ComputeSNAGridLocal::compute_local() const double ztmp = xgrid[2]; // currently, all grid points are type 1 + // not clear what a better choice would be const int itype = 1; int ielem = 0; From b165c2ca080113877c35c316cbaea7c38d653f36 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 08:39:12 -0400 Subject: [PATCH 166/172] add files to .gitignore after move to package --- src/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/.gitignore b/src/.gitignore index 8294a204c7..4c1cf49b3b 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -173,6 +173,10 @@ /pair_tdpd.cpp /pair_tdpd.h +/compute_grid.cpp +/compute_grid.h +/compute_grid_local.cpp +/compute_grid_local.h /compute_sna_atom.cpp /compute_sna_atom.h /compute_snad_atom.cpp From a9f3108f294586552277b2f21924a31d629f7bfd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 08:39:20 -0400 Subject: [PATCH 167/172] whitespace --- src/ML-SNAP/compute_sna_grid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ML-SNAP/compute_sna_grid.cpp b/src/ML-SNAP/compute_sna_grid.cpp index 771a30eb9f..497390f99a 100644 --- a/src/ML-SNAP/compute_sna_grid.cpp +++ b/src/ML-SNAP/compute_sna_grid.cpp @@ -228,8 +228,8 @@ void ComputeSNAGrid::compute_array() const double ztmp = xgrid[2]; // currently, all grid points are type 1 - // not clear what a better choice would be - + // not clear what a better choice would be + const int itype = 1; int ielem = 0; if (chemflag) ielem = map[itype]; From ae1a33aa5afd455b798179e5ab3c3044518acc36 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 13:36:49 -0400 Subject: [PATCH 168/172] update unit test --- unittest/cplusplus/test_lammps_class.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unittest/cplusplus/test_lammps_class.cpp b/unittest/cplusplus/test_lammps_class.cpp index d25bf43656..64ce1eefb1 100644 --- a/unittest/cplusplus/test_lammps_class.cpp +++ b/unittest/cplusplus/test_lammps_class.cpp @@ -83,8 +83,8 @@ TEST_F(LAMMPS_plain, InitMembers) EXPECT_STREQ(lmp->exename, "LAMMPS_test"); EXPECT_EQ(lmp->num_package, 0); - EXPECT_EQ(lmp->clientserver, 0); + EXPECT_EQ(lmp->mdicomm, nullptr); EXPECT_EQ(lmp->kokkos, nullptr); EXPECT_EQ(lmp->atomKK, nullptr); EXPECT_EQ(lmp->memoryKK, nullptr); @@ -218,8 +218,8 @@ TEST_F(LAMMPS_omp, InitMembers) EXPECT_STREQ(lmp->exename, "LAMMPS_test"); EXPECT_EQ(lmp->num_package, 1); - EXPECT_EQ(lmp->clientserver, 0); + EXPECT_EQ(lmp->mdicomm, nullptr); EXPECT_EQ(lmp->kokkos, nullptr); EXPECT_EQ(lmp->atomKK, nullptr); EXPECT_EQ(lmp->memoryKK, nullptr); @@ -302,12 +302,12 @@ TEST_F(LAMMPS_kokkos, InitMembers) EXPECT_STREQ(lmp->exename, "LAMMPS_test"); EXPECT_EQ(lmp->num_package, 0); - EXPECT_EQ(lmp->clientserver, 0); if (Info::has_accelerator_feature("KOKKOS", "api", "openmp")) EXPECT_EQ(lmp->comm->nthreads, 2); else EXPECT_EQ(lmp->comm->nthreads, 1); + EXPECT_EQ(lmp->mdicomm, nullptr); EXPECT_NE(lmp->kokkos, nullptr); EXPECT_NE(lmp->atomKK, nullptr); EXPECT_NE(lmp->memoryKK, nullptr); From 7aabbba7fffaa7215ca621b3098725c34dfc770e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 13:37:33 -0400 Subject: [PATCH 169/172] whitespace --- doc/src/fix_mdi_qm.rst | 2 +- src/MDI/fix_mdi_qm.cpp | 22 +++++++++++----------- src/MDI/mdi_command.cpp | 4 ++-- src/MDI/mdi_engine.cpp | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/src/fix_mdi_qm.rst b/doc/src/fix_mdi_qm.rst index a00f6e2edc..a6c2b6c744 100644 --- a/doc/src/fix_mdi_qm.rst +++ b/doc/src/fix_mdi_qm.rst @@ -141,7 +141,7 @@ directory. See its README file for more details. (1) To run an ab initio MD (AIMD) dynamics simulation, or an energy minimization with QM forces, or a multi-replica NEB calculation, use *add yes* and *every 1* (the defaults). This is so that every time -LAMMPS needs energy and forces, the QM code will be invoked. +LAMMPS needs energy and forces, the QM code will be invoked. Both LAMMPS and the QM code should define the same system (simulation box, atoms and their types) in their respective input scripts. Note diff --git a/src/MDI/fix_mdi_qm.cpp b/src/MDI/fix_mdi_qm.cpp index 1c725a0871..db1c59ada9 100644 --- a/src/MDI/fix_mdi_qm.cpp +++ b/src/MDI/fix_mdi_qm.cpp @@ -33,7 +33,7 @@ FixMDIQM::FixMDIQM(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { // check requirements for LAMMPS to work with MDI as an engine - if (atom->tag_enable == 0) + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use MDI engine without atom IDs"); if (atom->natoms && atom->tag_consecutive() == 0) error->all(FLERR, "MDI engine requires consecutive atom IDs"); @@ -201,7 +201,7 @@ void FixMDIQM::init() // this fix makes one-time connection to engine if (connectflag) { - + // if MDI's mdicomm not set, need to Accept_comm() with stand-alone engine // othewise are already connected to plugin engine @@ -210,24 +210,24 @@ void FixMDIQM::init() if (mdicomm == MDI_COMM_NULL) { plugin = 0; MDI_Accept_communicator(&mdicomm); - if (mdicomm == MDI_COMM_NULL) + if (mdicomm == MDI_COMM_NULL) error->all(FLERR, "MDI unable to connect to stand-alone engine"); } else { plugin = 1; int method; MDI_Get_method(&method, mdicomm); - if (method != MDI_PLUGIN) + if (method != MDI_PLUGIN) error->all(FLERR, "MDI internal error for plugin engine"); } - + // connection should have been already made by "mdi connect" command // only works for stand-alone engines } else { plugin = 0; - if (lmp->mdicomm == nullptr) + if (lmp->mdicomm == nullptr) error->all(FLERR,"Fix mdi/qm is not connected to engine via mdi connect"); int nbytes = sizeof(MDI_Comm); @@ -424,7 +424,7 @@ void FixMDIQM::reallocate() bigint nsize = atom->natoms * 3; if (nsize > MAXSMALLINT) error->all(FLERR, "Natoms too large to use with fix mdi/qm"); - + maxbuf = static_cast (atom->natoms); memory->destroy(ibuf1); memory->destroy(buf3); @@ -447,10 +447,10 @@ void FixMDIQM::send_types() // use local atomID to index into ordered ibuf1 - tagint *tag = atom->tag; + tagint *tag = atom->tag; int *type = atom->type; int nlocal = atom->nlocal; - + int index; for (int i = 0; i < nlocal; i++) { index = static_cast(tag[i]) - 1; @@ -476,10 +476,10 @@ void FixMDIQM::send_elements() // use local atomID to index into ordered ibuf1 - tagint *tag = atom->tag; + tagint *tag = atom->tag; int *type = atom->type; int nlocal = atom->nlocal; - + int index; for (int i = 0; i < nlocal; i++) { index = static_cast(tag[i]) - 1; diff --git a/src/MDI/mdi_command.cpp b/src/MDI/mdi_command.cpp index 96ba839dfc..42d8b2691a 100644 --- a/src/MDI/mdi_command.cpp +++ b/src/MDI/mdi_command.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; mdi command: engine or plugin or connect or exit engine is used when LAMMPS is an MDI engine, to start listening for requests plugin is used when LAMMPS is an MDI driver to load a plugin library - connect and exit are used when LAMMPS is an MDI driver to + connect and exit are used when LAMMPS is an MDI driver to (a) connect = setup comm with a stand-alone MDI engine (b) exit = terminate comm with a stand-alone MDI engine ---------------------------------------------------------------------- */ @@ -51,7 +51,7 @@ void MDICommand::command(int narg, char **arg) if (mdicomm == MDI_COMM_NULL) { MDI_Accept_communicator(&mdicomm); - if (mdicomm == MDI_COMM_NULL) + if (mdicomm == MDI_COMM_NULL) error->all(FLERR, "MDI unable to connect to stand-alone engine"); } else error->all(FLERR, "Cannot use mdi connect with plugin engine"); diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 79bfbe097e..91774659ff 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -101,7 +101,7 @@ MDIEngine::MDIEngine(LAMMPS *_lmp, int narg, char ** arg) : Pointers(_lmp) for (int i = 1; i < ntypes; i++) for (int j = i+1; j <= ntypes; j++) { if (elements[i] == 0 || elements[j] == 0) continue; - if (elements[i] == elements[j]) + if (elements[i] == elements[j]) error->all(FLERR,"MDI engine element cannot map to multiple types"); } } @@ -1227,7 +1227,7 @@ void MDIEngine::receive_elements() break; } } - if (itype > ntypes) + if (itype > ntypes) error->all(FLERR,"MDI element not found in element list"); } } From 56cb2f3077a814a4035cdc7cf05175408e89e558 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 13:44:41 -0400 Subject: [PATCH 170/172] update external library version and md5sum --- cmake/Modules/Packages/MDI.cmake | 4 ++-- lib/mdi/Install.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/Packages/MDI.cmake b/cmake/Modules/Packages/MDI.cmake index 88859f0285..90188f91a8 100644 --- a/cmake/Modules/Packages/MDI.cmake +++ b/cmake/Modules/Packages/MDI.cmake @@ -8,8 +8,8 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al if(DOWNLOAD_MDI) message(STATUS "MDI download requested - we will build our own") - set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.3.2.tar.gz" CACHE STRING "URL for MDI tarball") - set(MDI_MD5 "836f5da400d8cff0f0e4435640f9454f" CACHE STRING "MD5 checksum for MDI tarball") + set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.1.tar.gz" CACHE STRING "URL for MDI tarball") + set(MDI_MD5 "f9505fccd4c79301a619f6452dad4ad9" CACHE STRING "MD5 checksum for MDI tarball") mark_as_advanced(MDI_URL) mark_as_advanced(MDI_MD5) enable_language(C) diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py index 48d4952f9b..940a49555c 100644 --- a/lib/mdi/Install.py +++ b/lib/mdi/Install.py @@ -39,7 +39,7 @@ url = "https://github.com/MolSSI-MDI/MDI_Library/archive/v%s.tar.gz" % version # known checksums for different MDI versions. used to validate the download. checksums = { \ - '1.3.2' : '836f5da400d8cff0f0e4435640f9454f', \ + '1.4.1' : 'f9505fccd4c79301a619f6452dad4ad9', \ } # print error message or help From 03962ba0f4c73f88bbbb05279eeab7940c162be9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 13:55:48 -0400 Subject: [PATCH 171/172] fix spelling in MDI docs --- doc/src/Howto_mdi.rst | 2 +- doc/src/Packages_details.rst | 2 +- doc/src/fix_mdi_qm.rst | 14 +++++++------- doc/src/mdi.rst | 8 ++++---- doc/utils/sphinx-config/false_positives.txt | 6 ++++++ 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index 578f98e61e..14bef1a546 100644 --- a/doc/src/Howto_mdi.rst +++ b/doc/src/Howto_mdi.rst @@ -72,7 +72,7 @@ either a stand-alone code or a plugin library. As explained on the `fix mdi/qm ` command doc page, it can be used to perform *ab initio* MD simulations or energy minimizations, -or to evalute the quantum energy and forces for a series of +or to evaluate the quantum energy and forces for a series of independent systems. The examples/mdi directory has example input scripts for all of these use cases. diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 65bab0e5a2..59922bd939 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1479,7 +1479,7 @@ the :doc:`Build extras ` page. * lib/mdi/README * :doc:`Howto MDI ` * :doc:`mdi ` -* :doc:`fix mdi/aimd ` +* :doc:`fix mdi/qm ` * examples/PACKAGES/mdi ---------- diff --git a/doc/src/fix_mdi_qm.rst b/doc/src/fix_mdi_qm.rst index a6c2b6c744..ca47db5e7a 100644 --- a/doc/src/fix_mdi_qm.rst +++ b/doc/src/fix_mdi_qm.rst @@ -57,9 +57,9 @@ explained below. These are example use cases for this fix, discussed further below: -* perform an ab intitio MD (AIMD) simulation with quantum forces -* perform an energy minimziation with quantum forces -* perform a nudged elatic band (NEB) calculation with quantum forces +* perform an ab initio MD (AIMD) simulation with quantum forces +* perform an energy minimization with quantum forces +* perform a nudged elastic band (NEB) calculation with quantum forces * perform a QM calculation for a series of independent systems which LAMMPS reads or generates The code coupling performed by this command is done via the `MDI @@ -71,7 +71,7 @@ information about how LAMMPS can operate as either an MDI driver or engine. The examples/mdi directory contains input scripts using this fix in -the various use cases dicussed below. In each case, two instances of +the various use cases discussed below. In each case, two instances of LAMMPS are used, once as an MDI driver, once as an MDI engine (surrogate for a QM code). The examples/mdi/README file explains how to launch two codes so that they communicate via the MDI library using @@ -157,7 +157,7 @@ atom coordinates. The engine code computes quantum forces on each atom and the total energy of the system and returns them to LAMMPS. Note that if the AIMD simulation is an NPT or NPH model, or the energy -minimization includesf :doc:`fix box relax ` to +minimization includes :doc:`fix box relax ` to equilibrate the box size/shape, then LAMMPS computes a pressure. This means the *virial* keyword should be set to *yes* so that the QM contribution to the pressure can be included. @@ -172,7 +172,7 @@ atom coordinates and QM forces to a file. Likewise the QM energy and virial could be output with the :doc:`thermo_style custom ` command. -(3) To do a QM evaulation of energy and forces for a series of *N* +(3) To do a QM evaluation of energy and forces for a series of *N* independent systems (simulation box and atoms), use *add no* and *every 1*. Write a LAMMPS input script which loops over the *N* systems. See the :doc:`Howto multiple ` doc page for @@ -180,7 +180,7 @@ details on looping and removing old systems. The series of systems could be initialized by reading them from data files with :doc:`read_data ` commands. Or, for example, by using the :doc:`lattice ` , :doc:`create_atoms `, -:doc:`delete_atoms `, and/or :doc:`displace_atoms +:doc:`delete_atoms `, and/or :doc:`displace_atoms random ` commands to generate a series of different systems. At the end of the loop perform :doc:`run 0 ` and :doc:`write_dump ` commands to invoke the QM code and diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst index 2591b3ea16..b5ee0098bd 100644 --- a/doc/src/mdi.rst +++ b/doc/src/mdi.rst @@ -326,15 +326,15 @@ able to initiate and terminate the connection to the engine code. The only current MDI driver command in LAMMPS is the :doc:`fix mdi/qm ` command. If it is only used once in an input script then it can initiate and terminate the connection. But if it is being -issuedd multiple times, e.g. in a loop that issues a :doc:`clear -` command, then it cannot initiate/terminate the connection +issued multiple times, e.g. in a loop that issues a :doc:`clear +` command, then it cannot initiate or terminate the connection multiple times. Instead, the *mdi connect* and *mdi exit* commands -should be used outside the loop to intiate/terminate the connection. +should be used outside the loop to initiate or terminate the connection. See the examples/mdi/in.series.driver script for an example of how this is done. The LOOP in that script is reading a series of data file configurations and passing them to an MDI engine (e.g. quantum -code) for enery and force evaluation. A *clear* command inside the +code) for energy and force evaluation. A *clear* command inside the loop wipes out the current system so a new one can be defined. This operation also destroys all fixes. So the :doc:`fix mdi/qm ` command is issued once per loop iteration. Note that it diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index abc6b47ccd..77a1da6643 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -3679,13 +3679,19 @@ vx Vx vxcm vxmu +vxx +vxy +vxz vy Vy vycm +vyy +vyz vz Vz vzcm vzi +vzz Waals Wadley wallstyle From 373c719f4f7821d5a7a5da3fb092a97794dbd9f8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Jun 2022 15:22:54 -0400 Subject: [PATCH 172/172] make compilation settings consistent with CMake --- lib/mdi/Install.py | 6 +++--- lib/mdi/Makefile.g++ | 2 +- lib/mdi/Makefile.gcc | 2 +- lib/mdi/Makefile.icc | 2 +- lib/mdi/Makefile.mpi | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py index 940a49555c..5452853b82 100644 --- a/lib/mdi/Install.py +++ b/lib/mdi/Install.py @@ -177,7 +177,7 @@ try: except: n_cpus = 1 -print("Building lib%s.so ..." % lib) +print("Building lib%s.a ..." % lib) cmd = "make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus txt = subprocess.check_output(cmd,shell=True,stderr=subprocess.STDOUT) print(txt.decode('UTF-8')) @@ -201,10 +201,10 @@ makefile_lammps.write(str(rpath_option) + "\n") makefile_lammps.close() -shared_files = glob.glob( os.path.join( homepath, "liblink", "lib%s.so*" % lib) ) +shared_files = glob.glob( os.path.join( homepath, "liblink", "lib%s.a" % lib) ) if len(shared_files) > 0: print("Build was successful") else: - error("Build of lib/%s/lib%s.so was NOT successful" % (lib,lib)) + error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib)) if has_extramake and not os.path.exists("Makefile.lammps"): print("lib/%s/Makefile.lammps was NOT created" % lib) diff --git a/lib/mdi/Makefile.g++ b/lib/mdi/Makefile.g++ index 15cc9c3a3b..41300f9992 100644 --- a/lib/mdi/Makefile.g++ +++ b/lib/mdi/Makefile.g++ @@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty lib: $(OBJ) mkdir -p build - cd build; cmake -Dlibtype=SHARED -Dlanguage=CXX -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ ../MDI_Library; make + cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ ../MDI_Library; make @cp $(EXTRAMAKE) Makefile.lammps # ------ CLEAN ------ diff --git a/lib/mdi/Makefile.gcc b/lib/mdi/Makefile.gcc index a67209202b..023c0e20df 100644 --- a/lib/mdi/Makefile.gcc +++ b/lib/mdi/Makefile.gcc @@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty lib: $(OBJ) mkdir -p build - cd build; cmake -Dlibtype=SHARED -D CMAKE_C_COMPILER=gcc ../MDI_Library; make + cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=gcc ../MDI_Library; make @cp $(EXTRAMAKE) Makefile.lammps # ------ CLEAN ------ diff --git a/lib/mdi/Makefile.icc b/lib/mdi/Makefile.icc index eac6ba087f..8c5049561b 100644 --- a/lib/mdi/Makefile.icc +++ b/lib/mdi/Makefile.icc @@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty lib: $(OBJ) mkdir -p build - cd build; cmake -Dlibtype=SHARED -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icc ../MDI_Library; make + cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icpc ../MDI_Library; make @cp $(EXTRAMAKE) Makefile.lammps # ------ CLEAN ------ diff --git a/lib/mdi/Makefile.mpi b/lib/mdi/Makefile.mpi index 0a40520c95..ce40bc9d4d 100644 --- a/lib/mdi/Makefile.mpi +++ b/lib/mdi/Makefile.mpi @@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty lib: $(OBJ) mkdir -p build - cd build; cmake -Dlibtype=SHARED -D CMAKE_C_COMPILER=mpicc -D CMAKE_CXX_COMPILER=mpicxx ../MDI_Library; make + cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=mpicc -D CMAKE_CXX_COMPILER=mpicxx ../MDI_Library; make @cp $(EXTRAMAKE) Makefile.lammps # ------ CLEAN ------