fix homepage urls, tabs & trailing whitespace, remove errors from headers

This commit is contained in:
Axel Kohlmeyer
2022-06-17 12:48:24 -04:00
parent e201d6e77e
commit f27e9941ae
10 changed files with 175 additions and 225 deletions

View File

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -182,7 +182,7 @@ ComputeSNAGrid::ComputeSNAGrid(LAMMPS *lmp, int narg, char **arg) :
snaptr = new SNA(lmp, rfac0, twojmax, snaptr = new SNA(lmp, rfac0, twojmax,
rmin0, switchflag, bzeroflag, rmin0, switchflag, bzeroflag,
chemflag, bnormflag, wselfallflag, chemflag, bnormflag, wselfallflag,
nelements, switchinnerflag); nelements, switchinnerflag);
ncoeff = snaptr->ncoeff; ncoeff = snaptr->ncoeff;
nvalues = ncoeff; nvalues = ncoeff;
@ -242,77 +242,77 @@ void ComputeSNAGrid::compute_array()
for (int iz = nzlo; iz <= nzhi; iz++) for (int iz = nzlo; iz <= nzhi; iz++)
for (int iy = nylo; iy <= nyhi; iy++) for (int iy = nylo; iy <= nyhi; iy++)
for (int ix = nxlo; ix <= nxhi; ix++) { for (int ix = nxlo; ix <= nxhi; ix++) {
double xgrid[3]; double xgrid[3];
const int igrid = iz*(nx*ny) + iy*nx + ix; const int igrid = iz*(nx*ny) + iy*nx + ix;
grid2x(igrid, xgrid); grid2x(igrid, xgrid);
const double xtmp = xgrid[0]; const double xtmp = xgrid[0];
const double ytmp = xgrid[1]; const double ytmp = xgrid[1];
const double ztmp = xgrid[2]; const double ztmp = xgrid[2];
// currently, all grid points are type 1 // currently, all grid points are type 1
const int itype = 1; const int itype = 1;
int ielem = 0; int ielem = 0;
if (chemflag) if (chemflag)
ielem = map[itype]; ielem = map[itype];
const double radi = radelem[itype]; const double radi = radelem[itype];
// rij[][3] = displacements between atom I and those neighbors // rij[][3] = displacements between atom I and those neighbors
// inside = indices of neighbors of I within cutoff // inside = indices of neighbors of I within cutoff
// typej = types of neighbors of I within cutoff // typej = types of neighbors of I within cutoff
int ninside = 0; int ninside = 0;
for (int j = 0; j < ntotal; j++) { 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 delx = xtmp - x[j][0];
const double dely = ytmp - x[j][1]; const double dely = ytmp - x[j][1];
const double delz = ztmp - x[j][2]; 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 jtype = type[j];
int jelem = 0; int jelem = 0;
if (chemflag) if (chemflag)
jelem = map[jtype]; jelem = map[jtype];
if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) {
snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][0] = delx;
snaptr->rij[ninside][1] = dely; snaptr->rij[ninside][1] = dely;
snaptr->rij[ninside][2] = delz; snaptr->rij[ninside][2] = delz;
snaptr->inside[ninside] = j; snaptr->inside[ninside] = j;
snaptr->wj[ninside] = wjelem[jtype]; snaptr->wj[ninside] = wjelem[jtype];
snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac;
if (switchinnerflag) { if (switchinnerflag) {
snaptr->sinnerij[ninside] = sinnerelem[jelem]; snaptr->sinnerij[ninside] = sinnerelem[jelem];
snaptr->dinnerij[ninside] = dinnerelem[jelem]; snaptr->dinnerij[ninside] = dinnerelem[jelem];
} }
if (chemflag) snaptr->element[ninside] = jelem; if (chemflag) snaptr->element[ninside] = jelem;
ninside++; ninside++;
} }
} }
snaptr->compute_ui(ninside, ielem); snaptr->compute_ui(ninside, ielem);
snaptr->compute_zi(); snaptr->compute_zi();
snaptr->compute_bi(ielem); snaptr->compute_bi(ielem);
// linear contributions // linear contributions
for (int icoeff = 0; icoeff < ncoeff; icoeff++) 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 // quadratic contributions
if (quadraticflag) { if (quadraticflag) {
int ncount = ncoeff; int ncount = ncoeff;
for (int icoeff = 0; icoeff < ncoeff; icoeff++) { for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
double bveci = snaptr->blist[icoeff]; double bveci = snaptr->blist[icoeff];
gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci; gridlocal[size_array_cols_base+ncount++][iz][iy][ix] = 0.5*bveci*bveci;
for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) 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] = 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));
@ -320,9 +320,9 @@ void ComputeSNAGrid::compute_array()
for (int iz = nzlo; iz <= nzhi; iz++) for (int iz = nzlo; iz <= nzhi; iz++)
for (int iy = nylo; iy <= nyhi; iy++) for (int iy = nylo; iy <= nyhi; iy++)
for (int ix = nxlo; ix <= nxhi; ix++) { 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++) for (int j = 0; j < nvalues; j++)
grid[igrid][size_array_cols_base + j] = gridlocal[size_array_cols_base + j][iz][iy][ix]; 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(); assign_coords_all();

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ---------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -54,19 +54,3 @@ class ComputeSNAGrid : public ComputeGrid {
#endif #endif
#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.
*/

View File

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -182,7 +182,7 @@ ComputeSNAGridLocal::ComputeSNAGridLocal(LAMMPS *lmp, int narg, char **arg) :
snaptr = new SNA(lmp, rfac0, twojmax, snaptr = new SNA(lmp, rfac0, twojmax,
rmin0, switchflag, bzeroflag, rmin0, switchflag, bzeroflag,
chemflag, bnormflag, wselfallflag, chemflag, bnormflag, wselfallflag,
nelements, switchinnerflag); nelements, switchinnerflag);
ncoeff = snaptr->ncoeff; ncoeff = snaptr->ncoeff;
nvalues = ncoeff; nvalues = ncoeff;
@ -242,77 +242,77 @@ void ComputeSNAGridLocal::compute_local()
for (int iz = nzlo; iz <= nzhi; iz++) for (int iz = nzlo; iz <= nzhi; iz++)
for (int iy = nylo; iy <= nyhi; iy++) for (int iy = nylo; iy <= nyhi; iy++)
for (int ix = nxlo; ix <= nxhi; ix++) { for (int ix = nxlo; ix <= nxhi; ix++) {
double xgrid[3]; double xgrid[3];
grid2x(ix, iy, iz, xgrid); grid2x(ix, iy, iz, xgrid);
const double xtmp = xgrid[0]; const double xtmp = xgrid[0];
const double ytmp = xgrid[1]; const double ytmp = xgrid[1];
const double ztmp = xgrid[2]; const double ztmp = xgrid[2];
// currently, all grid points are type 1 // currently, all grid points are type 1
const int itype = 1; const int itype = 1;
int ielem = 0; int ielem = 0;
if (chemflag) if (chemflag)
ielem = map[itype]; ielem = map[itype];
const double radi = radelem[itype]; const double radi = radelem[itype];
// rij[][3] = displacements between atom I and those neighbors // rij[][3] = displacements between atom I and those neighbors
// inside = indices of neighbors of I within cutoff // inside = indices of neighbors of I within cutoff
// typej = types of neighbors of I within cutoff // typej = types of neighbors of I within cutoff
int ninside = 0; int ninside = 0;
for (int j = 0; j < ntotal; j++) { 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 delx = xtmp - x[j][0];
const double dely = ytmp - x[j][1]; const double dely = ytmp - x[j][1];
const double delz = ztmp - x[j][2]; 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 jtype = type[j];
int jelem = 0; int jelem = 0;
if (chemflag) if (chemflag)
jelem = map[jtype]; jelem = map[jtype];
if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) { if (rsq < cutsq[jtype][jtype] && rsq > 1e-20) {
snaptr->rij[ninside][0] = delx; snaptr->rij[ninside][0] = delx;
snaptr->rij[ninside][1] = dely; snaptr->rij[ninside][1] = dely;
snaptr->rij[ninside][2] = delz; snaptr->rij[ninside][2] = delz;
snaptr->inside[ninside] = j; snaptr->inside[ninside] = j;
snaptr->wj[ninside] = wjelem[jtype]; snaptr->wj[ninside] = wjelem[jtype];
snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac; snaptr->rcutij[ninside] = 2.0*radelem[jtype]*rcutfac;
if (switchinnerflag) { if (switchinnerflag) {
snaptr->sinnerij[ninside] = sinnerelem[jelem]; snaptr->sinnerij[ninside] = sinnerelem[jelem];
snaptr->dinnerij[ninside] = dinnerelem[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++; ninside++;
} }
} }
snaptr->compute_ui(ninside, ielem); snaptr->compute_ui(ninside, ielem);
snaptr->compute_zi(); snaptr->compute_zi();
snaptr->compute_bi(ielem); snaptr->compute_bi(ielem);
// linear contributions // linear contributions
for (int icoeff = 0; icoeff < ncoeff; icoeff++) 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 // quadratic contributions
if (quadraticflag) { if (quadraticflag) {
int ncount = ncoeff; int ncount = ncoeff;
for (int icoeff = 0; icoeff < ncoeff; icoeff++) { for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
double bveci = snaptr->blist[icoeff]; double bveci = snaptr->blist[icoeff];
alocal[igrid][size_local_cols_base+ncount++] = 0.5*bveci*bveci; alocal[igrid][size_local_cols_base+ncount++] = 0.5*bveci*bveci;
for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++)
alocal[igrid][size_local_cols_base+ncount++] = alocal[igrid][size_local_cols_base+ncount++] =
bveci*snaptr->blist[jcoeff]; bveci*snaptr->blist[jcoeff];
} }
} }
igrid++; igrid++;
} }
} }

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ---------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -54,17 +54,3 @@ class ComputeSNAGridLocal : public ComputeGridLocal {
#endif #endif
#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.
*/

View File

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -128,7 +128,7 @@ void ComputeGrid::allocate()
if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) { if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) {
gridlocal_allocated = 1; gridlocal_allocated = 1;
memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi, memory->create4d_offset(gridlocal,size_array_cols,nzlo,nzhi,nylo,nyhi,
nxlo,nxhi,"grid:gridlocal"); nxlo,nxhi,"grid:gridlocal");
} }
array = gridall; array = gridall;
} }

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ---------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -59,13 +59,3 @@ class ComputeGrid : public Compute {
} }
#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.
*/

View File

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -233,34 +233,34 @@ void ComputeGridLocal::assign_coords()
for (int iz = nzlo; iz <= nzhi; iz++) for (int iz = nzlo; iz <= nzhi; iz++)
for (int iy = nylo; iy <= nyhi; iy++) for (int iy = nylo; iy <= nyhi; iy++)
for (int ix = nxlo; ix <= nxhi; ix++) { for (int ix = nxlo; ix <= nxhi; ix++) {
alocal[igrid][0] = ix; alocal[igrid][0] = ix;
alocal[igrid][1] = iy; alocal[igrid][1] = iy;
alocal[igrid][2] = iz; alocal[igrid][2] = iz;
double xgrid[3]; double xgrid[3];
// for triclinic: create gridpoint in lamda coordinates and transform after check. // for triclinic: create gridpoint in lamda coordinates and transform after check.
// for orthorombic: create gridpoint in box coordinates. // for orthorombic: create gridpoint in box coordinates.
if (triclinic) if (triclinic)
grid2lamda(ix, iy, iz, xgrid); grid2lamda(ix, iy, iz, xgrid);
else else
grid2x(ix, iy, iz, xgrid); 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 || if ((sublo[0]-xgrid[0]) > EPSILON || (xgrid[0]-subhi[0]) > EPSILON ||
(sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON || (sublo[1]-xgrid[1]) > EPSILON || (xgrid[1]-subhi[1]) > EPSILON ||
(sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON) (sublo[2]-xgrid[2]) > EPSILON || (xgrid[2]-subhi[2]) > EPSILON)
error->one(FLERR,"Invalid gridpoint position in compute grid/local"); 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][3] = xgrid[0];
alocal[igrid][4] = xgrid[1]; alocal[igrid][4] = xgrid[1];
alocal[igrid][5] = xgrid[2]; alocal[igrid][5] = xgrid[2];
igrid++; igrid++;
} }
} }

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ---------------------------------------------------------- /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 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 Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -57,13 +57,3 @@ class ComputeGridLocal : public Compute {
} }
#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.
*/