From 3a4652613d0d3c6c8adae1bf7937deecf888d6f3 Mon Sep 17 00:00:00 2001 From: charlie sievers Date: Mon, 13 Jul 2020 19:43:24 -0700 Subject: [PATCH 001/174] Add folded option, change ballistico to eskm, add post force modifications --- src/USER-PHONON/dynamical_matrix.cpp | 79 +++++++++++++---- src/USER-PHONON/dynamical_matrix.h | 2 + src/USER-PHONON/third_order.cpp | 126 ++++++++++++++++++++------- src/USER-PHONON/third_order.h | 2 + 4 files changed, 157 insertions(+), 52 deletions(-) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 1495219124..ced290f6fe 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -125,6 +125,7 @@ void DynamicalMatrix::command(int narg, char **arg) compressed = 0; file_flag = 0; file_opened = 0; + folded = 0; conversion = 1; // read options from end of input line @@ -132,6 +133,9 @@ void DynamicalMatrix::command(int narg, char **arg) else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); + if (!folded) dynlenb = dynlen; + if (folded) dynlenb = (atom->natoms)*3; + if (atom->map_style == 0) error->all(FLERR,"Dynamical_matrix command requires an atom map, see atom_modify"); @@ -184,6 +188,16 @@ void DynamicalMatrix::options(int narg, char **arg) filename = arg[iarg + 1]; file_flag = 1; iarg += 2; + } else if (strcmp(arg[iarg],"fold") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"yes") == 0) { + folded = 1; + } + else if (strcmp(arg[iarg+1],"no") == 0) { + folded = 0; + } + else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + iarg += 2; } else error->all(FLERR,"Illegal dynamical_matrix command"); } if (file_flag == 1) { @@ -244,11 +258,11 @@ void DynamicalMatrix::calculateMatrix() double **dynmat = new double*[3]; for (int i=0; i<3; i++) - dynmat[i] = new double[dynlen]; + dynmat[i] = new double[dynlenb]; double **fdynmat = new double*[3]; for (int i=0; i<3; i++) - fdynmat[i] = new double[dynlen]; + fdynmat[i] = new double[dynlenb]; //initialize dynmat to all zeros dynmat_clear(dynmat); @@ -257,7 +271,7 @@ void DynamicalMatrix::calculateMatrix() fprintf(screen,"Calculating Dynamical Matrix ...\n"); fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); - fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlen*dynlen) ); + fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlenb*dynlen) ); } // emit dynlen rows of dimalpha*dynlen*dimbeta elements @@ -274,9 +288,16 @@ void DynamicalMatrix::calculateMatrix() for (bigint j=1; j<=natoms; j++){ local_jdx = atom->map(j); if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && gm[j-1] >= 0){ - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; + && (gm[j-1] >= 0 || folded)){ + if (folded) { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; + } + } + else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; + } } } } @@ -285,22 +306,35 @@ void DynamicalMatrix::calculateMatrix() for (bigint j=1; j<=natoms; j++){ local_jdx = atom->map(j); if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && gm[j-1] >= 0){ - for (int beta=0; beta<3; beta++){ - if (atom->rmass_flag == 1) - imass = sqrt(m[local_idx] * m[local_jdx]); - else - imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); - dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); - dynmat[alpha][gm[j-1]*3+beta] *= conversion; + && (gm[j-1] >= 0 || folded)){ + if (folded){ + for (int beta=0; beta<3; beta++){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); + dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); + dynmat[alpha][(j-1)*3+beta] *= conversion; + } + } + else{ + for (int beta=0; beta<3; beta++){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); + dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); + dynmat[alpha][gm[j-1]*3+beta] *= conversion; + } } } } displace_atom(local_idx,alpha,1); } for (int k=0; k<3; k++) - MPI_Reduce(dynmat[k],fdynmat[k],dynlen,MPI_DOUBLE,MPI_SUM,0,world); + MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); if (me == 0) writeMatrix(fdynmat); dynmat_clear(dynmat); @@ -338,12 +372,12 @@ void DynamicalMatrix::writeMatrix(double **dynmat) clearerr(fp); if (binaryflag) { for (int i=0; i<3; i++) - fwrite(dynmat[i], sizeof(double), dynlen, fp); + fwrite(dynmat[i], sizeof(double), dynlenb, fp); if (ferror(fp)) error->one(FLERR, "Error writing to binary file"); } else { for (int i = 0; i < 3; i++) { - for (bigint j = 0; j < dynlen; j++) { + for (bigint j = 0; j < dynlenb; j++) { if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); else fprintf(fp, "%4.8f ",dynmat[i][j]); } @@ -385,6 +419,7 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { force_clear(); + int n_post_force = modify->n_post_force; if (pair_compute_flag) { force->pair->compute(eflag,vflag); @@ -405,6 +440,12 @@ void DynamicalMatrix::update_force() comm->reverse_comm(); timer->stamp(Timer::COMM); } + + // force modifications + + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + ++ update->nsteps; } @@ -435,7 +476,7 @@ void DynamicalMatrix::force_clear() void DynamicalMatrix::dynmat_clear(double **dynmat) { - size_t nbytes = sizeof(double) * dynlen; + size_t nbytes = sizeof(double) * dynlenb; if (nbytes) { for (int i=0; i<3; i++) diff --git a/src/USER-PHONON/dynamical_matrix.h b/src/USER-PHONON/dynamical_matrix.h index 8ff11044ea..02b52defb4 100644 --- a/src/USER-PHONON/dynamical_matrix.h +++ b/src/USER-PHONON/dynamical_matrix.h @@ -56,6 +56,7 @@ namespace LAMMPS_NS { int igroup,groupbit; bigint gcount; // number of atoms in group bigint dynlen; // rank of dynamical matrix + bigint dynlenb; // new dynlen if folded int scaleflag; int me; bigint *groupmap; @@ -64,6 +65,7 @@ namespace LAMMPS_NS { int binaryflag; // 1 if dump file is written binary, 0 no int file_opened; // 1 if openfile method has been called, 0 no int file_flag; // 1 custom file name, 0 dynmat.dat + int folded; // 1 folded, 0 nonfolded FILE *fp; }; diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 7764287337..bc5d766ba6 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; using namespace MathSpecial; -enum{REGULAR,BALLISTICO}; +enum{REGULAR,ESKM}; /* ---------------------------------------------------------------------- */ @@ -116,7 +116,7 @@ void ThirdOrder::command(int narg, char **arg) int style = -1; if (strcmp(arg[1],"regular") == 0) style = REGULAR; - else if (strcmp(arg[1],"eskm") == 0) style = BALLISTICO; + else if (strcmp(arg[1],"eskm") == 0) style = ESKM; else error->all(FLERR,"Illegal Dynamical Matrix command"); // set option defaults @@ -127,13 +127,17 @@ void ThirdOrder::command(int narg, char **arg) file_flag = 0; file_opened = 0; conversion = 1; + folded = 0; // read options from end of input line if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK - else if (style == BALLISTICO) options(narg-3,&arg[3]); //COME BACK + else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); del = force->numeric(FLERR, arg[2]); + if (!folded) dynlenb = dynlen; + if (folded) dynlenb = (atom->natoms)*3; + if (atom->map_style == 0) error->all(FLERR,"third_order command requires an atom map, see atom_modify"); @@ -147,7 +151,7 @@ void ThirdOrder::command(int narg, char **arg) timer->barrier_stop(); } - if (style == BALLISTICO) { + if (style == ESKM) { setup(); convert_units(update->unit_style); conversion = conv_energy/conv_distance/conv_distance; @@ -187,6 +191,16 @@ void ThirdOrder::options(int narg, char **arg) binaryflag = 1; } iarg += 2; + } else if (strcmp(arg[iarg],"fold") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"yes") == 0) { + folded = 1; + } + else if (strcmp(arg[iarg+1],"no") == 0) { + folded = 0; + } + else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + iarg += 2; } else error->all(FLERR,"Illegal third_order command"); } if (file_flag == 1 and me == 0) { @@ -242,23 +256,25 @@ void ThirdOrder::calculateMatrix() bigint *gm = groupmap; double **f = atom->f; - double *dynmat = new double[3*dynlen]; - double *fdynmat = new double[3*dynlen]; - memset(&dynmat[0],0,dynlen*sizeof(double)); - memset(&fdynmat[0],0,dynlen*sizeof(double)); + double *dynmat = new double[dynlenb]; + double *fdynmat = new double[dynlenb]; + memset(&dynmat[0],0,dynlenb*sizeof(double)); + memset(&fdynmat[0],0,dynlenb*sizeof(double)); if (comm->me == 0 && screen) { fprintf(screen,"Calculating Third Order ...\n"); fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); fprintf(screen," Total third order elements = " - BIGINT_FORMAT "\n", (dynlen*dynlen*dynlen) ); + BIGINT_FORMAT "\n", (dynlen*dynlenb*dynlenb) ); } update->nsteps = 0; int prog = 0; for (bigint i=1; i<=natoms; i++){ local_idx = atom->map(i); + if (gm[i-1] < 0) + continue; for (int alpha=0; alpha<3; alpha++){ for (bigint j=1; j<=natoms; j++){ local_jdx = atom->map(j); @@ -270,9 +286,13 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && gm[i-1] >= 0 && gm[j-1] >= 0 && gm[k-1] >= 0 + && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { - dynmat[gm[k-1]*3+gamma] += f[local_kdx][gamma]; + if (folded) { + dynmat[(k-1)*3+gamma] += f[local_kdx][gamma]; + } else { + dynmat[gm[k-1]*3+gamma] += f[local_kdx][gamma]; + } } } } @@ -282,9 +302,13 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && gm[i-1] >= 0 && gm[j-1] >= 0 && gm[k-1] >= 0 + && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { - dynmat[gm[k-1]*3+gamma] -= f[local_kdx][gamma]; + if (folded) { + dynmat[(k-1)*3+gamma] -= f[local_kdx][gamma]; + } else { + dynmat[gm[k-1]*3+gamma] -= f[local_kdx][gamma]; + } } } } @@ -296,9 +320,13 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && gm[i-1] >= 0 && gm[j-1] >= 0 && gm[k-1] >= 0 + && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { - dynmat[gm[k-1]*3+gamma] -= f[local_kdx][gamma]; + if (folded) { + dynmat[(k-1)*3+gamma] -= f[local_kdx][gamma]; + } else { + dynmat[gm[k-1]*3+gamma] -= f[local_kdx][gamma]; + } } } } @@ -308,20 +336,29 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && gm[i-1] >= 0 && gm[j-1] >= 0 && gm[k-1] >= 0 + && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { - dynmat[gm[k-1]*3+gamma] += f[local_kdx][gamma]; - dynmat[gm[k-1]*3+gamma] /= (4 * del * del); + if (folded) { + dynmat[(k-1)*3+gamma] += f[local_kdx][gamma]; + dynmat[(k-1)*3+gamma] /= (4 * del * del); + } else { + dynmat[gm[k-1]*3+gamma] += f[local_kdx][gamma]; + dynmat[gm[k-1]*3+gamma] /= (4 * del * del); + } } } } displace_atom(local_jdx, beta, 1); displace_atom(local_idx, alpha, 1); - MPI_Reduce(dynmat,fdynmat,3*dynlen,MPI_DOUBLE,MPI_SUM,0,world); + MPI_Reduce(dynmat,fdynmat,dynlenb,MPI_DOUBLE,MPI_SUM,0,world); if (me == 0){ - writeMatrix(fdynmat, gm[i-1], alpha, gm[j-1], beta); + if (folded) { + writeMatrix(fdynmat, gm[i-1], alpha, (j-1), beta); + } else { + writeMatrix(fdynmat, gm[i-1], alpha, gm[j-1], beta); + } } - memset(&dynmat[0],0,dynlen*sizeof(double)); + memset(&dynmat[0],0,dynlenb*sizeof(double)); } } } @@ -354,18 +391,34 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) double norm; if (!binaryflag && fp) { clearerr(fp); - for (int k = 0; k < gcount; k++){ - norm = square(dynmat[k*3])+ - square(dynmat[k*3+1])+ - square(dynmat[k*3+2]); - if (norm > 1.0e-16) - fprintf(fp, - BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT - " %7.8f %7.8f %7.8f\n", - i+1, a + 1, j+1, b + 1, groupmap[k]+1, - dynmat[k*3] * conversion, - dynmat[k*3+1] * conversion, - dynmat[k*3+2] * conversion); + if (folded){ + for (int k = 0; k < atom->natoms; k++){ + norm = square(dynmat[k*3])+ + square(dynmat[k*3+1])+ + square(dynmat[k*3+2]); + if (norm > 1.0e-16) + fprintf(fp, + BIGINT_FORMAT " %d " BIGINT_FORMAT " %d %d" + " %7.8f %7.8f %7.8f\n", + i+1, a + 1, j+1, b + 1, k+1, + dynmat[k*3] * conversion, + dynmat[k*3+1] * conversion, + dynmat[k*3+2] * conversion); + } + } else { + for (int k = 0; k < gcount; k++){ + norm = square(dynmat[k*3])+ + square(dynmat[k*3+1])+ + square(dynmat[k*3+2]); + if (norm > 1.0e-16) + fprintf(fp, + BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT + " %7.8f %7.8f %7.8f\n", + i+1, a + 1, j+1, b + 1, groupmap[k]+1, + dynmat[k*3] * conversion, + dynmat[k*3+1] * conversion, + dynmat[k*3+2] * conversion); + } } } else if (binaryflag && fp){ clearerr(fp); @@ -406,6 +459,7 @@ void ThirdOrder::displace_atom(int local_idx, int direction, int magnitude) void ThirdOrder::update_force() { force_clear(); + int n_post_force = modify->n_post_force; if (pair_compute_flag) { force->pair->compute(eflag,vflag); @@ -426,6 +480,12 @@ void ThirdOrder::update_force() comm->reverse_comm(); timer->stamp(Timer::COMM); } + + // force modifications + + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + ++ update->nsteps; } diff --git a/src/USER-PHONON/third_order.h b/src/USER-PHONON/third_order.h index 83062b6b1f..7bd80840f5 100644 --- a/src/USER-PHONON/third_order.h +++ b/src/USER-PHONON/third_order.h @@ -56,6 +56,7 @@ namespace LAMMPS_NS { double del; int igroup,groupbit; bigint dynlen; + bigint dynlenb; int scaleflag; int me; bigint gcount; // number of atoms in group @@ -65,6 +66,7 @@ namespace LAMMPS_NS { int binaryflag; // 1 if dump file is written binary, 0 no int file_opened; // 1 if openfile method has been called, 0 no int file_flag; // 1 custom file name, 0 dynmat.dat + int folded; // 1 if system is folded, 0 no FILE *fp; }; From 4b656b39612a2fecb238778f11c3ea3960f7384d Mon Sep 17 00:00:00 2001 From: Sievers Date: Tue, 14 Jul 2020 15:47:14 -0700 Subject: [PATCH 002/174] Check if atom is part of group before computing forces --- src/USER-PHONON/third_order.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index bc5d766ba6..0f5fc08bc5 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -20,6 +20,7 @@ #include "kspace.h" #include "update.h" #include "neighbor.h" +#include "modify.h" #include "pair.h" #include "timer.h" #include "finish.h" @@ -278,6 +279,8 @@ void ThirdOrder::calculateMatrix() for (int alpha=0; alpha<3; alpha++){ for (bigint j=1; j<=natoms; j++){ local_jdx = atom->map(j); + if (gm[j-1] < 0 && !folded) + continue; for (int beta=0; beta<3; beta++){ displace_atom(local_idx, alpha, 1); displace_atom(local_jdx, beta, 1); From 999dd13924d386bbe6e9727ac1f16f95dac42215 Mon Sep 17 00:00:00 2001 From: Sievers Date: Wed, 15 Jul 2020 12:45:46 -0700 Subject: [PATCH 003/174] Draft of force calculation reduction through neighbor lists --- src/USER-PHONON/third_order.cpp | 131 +++++++++++++++++++++++++++++--- src/USER-PHONON/third_order.h | 5 ++ 2 files changed, 126 insertions(+), 10 deletions(-) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 0f5fc08bc5..2e85b37bf2 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -20,6 +20,8 @@ #include "kspace.h" #include "update.h" #include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" #include "modify.h" #include "pair.h" #include "timer.h" @@ -46,6 +48,8 @@ ThirdOrder::~ThirdOrder() if (fp && me == 0) fclose(fp); fp = NULL; memory->destroy(groupmap); + memory->destroy(ijnum); + memory->destroy(neighbortags); } /* ---------------------------------------------------------------------- @@ -71,6 +75,10 @@ void ThirdOrder::setup() domain->box_too_small_check(); neighbor->build(1); + // build neighbor list this command needs based on earlier request + + neighbor->build_one(list); + // compute all forces external_force_clear = 0; eflag=0; @@ -94,7 +102,18 @@ void ThirdOrder::command(int narg, char **arg) error->all(FLERR,"third_order command before simulation box is defined"); if (narg < 2) error->all(FLERR,"Illegal third_order command"); + // request a full neighbor list for use by this command + + int irequest = neighbor->request(this); + neighbor->requests[irequest]->pair = 0; + neighbor->requests[irequest]->command = 1; + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + neighbor->requests[irequest]->occasional = 1; + neighbor->requests[irequest]->command_style = "third_order"; + lmp->init(); + list = neighbor->lists[irequest]; // orthogonal vs triclinic simulation box @@ -130,6 +149,10 @@ void ThirdOrder::command(int narg, char **arg) conversion = 1; folded = 0; + // set Neigborlist attributes to NULL + ijnum = NULL; + neighbortags = NULL; + // read options from end of input line if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK @@ -256,12 +279,17 @@ void ThirdOrder::calculateMatrix() bigint natoms = atom->natoms; bigint *gm = groupmap; double **f = atom->f; + int inum; + bigint j; + bigint *firstneigh; double *dynmat = new double[dynlenb]; double *fdynmat = new double[dynlenb]; memset(&dynmat[0],0,dynlenb*sizeof(double)); memset(&fdynmat[0],0,dynlenb*sizeof(double)); + getNeighbortags(); + if (comm->me == 0 && screen) { fprintf(screen,"Calculating Third Order ...\n"); fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); @@ -273,14 +301,17 @@ void ThirdOrder::calculateMatrix() update->nsteps = 0; int prog = 0; for (bigint i=1; i<=natoms; i++){ - local_idx = atom->map(i); if (gm[i-1] < 0) continue; + inum = ijnum[i-1]; + firstneigh = neighbortags[i-1]; + local_idx = atom->map(i); for (int alpha=0; alpha<3; alpha++){ - for (bigint j=1; j<=natoms; j++){ - local_jdx = atom->map(j); - if (gm[j-1] < 0 && !folded) + for (int jj=0; jjmap(j+1); for (int beta=0; beta<3; beta++){ displace_atom(local_idx, alpha, 1); displace_atom(local_jdx, beta, 1); @@ -289,7 +320,7 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) + && ((gm[j] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { if (folded) { dynmat[(k-1)*3+gamma] += f[local_kdx][gamma]; @@ -305,7 +336,7 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) + && ((gm[j] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { if (folded) { dynmat[(k-1)*3+gamma] -= f[local_kdx][gamma]; @@ -323,7 +354,7 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) + && ((gm[j] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { if (folded) { dynmat[(k-1)*3+gamma] -= f[local_kdx][gamma]; @@ -339,7 +370,7 @@ void ThirdOrder::calculateMatrix() local_kdx = atom->map(k); for (int gamma=0; gamma<3; gamma++){ if (local_idx >= 0 && local_jdx >= 0 && local_kdx >= 0 - && ((gm[j-1] >= 0 && gm[k-1] >= 0) || folded) + && ((gm[j] >= 0 && gm[k-1] >= 0) || folded) && local_kdx < nlocal) { if (folded) { dynmat[(k-1)*3+gamma] += f[local_kdx][gamma]; @@ -356,9 +387,9 @@ void ThirdOrder::calculateMatrix() MPI_Reduce(dynmat,fdynmat,dynlenb,MPI_DOUBLE,MPI_SUM,0,world); if (me == 0){ if (folded) { - writeMatrix(fdynmat, gm[i-1], alpha, (j-1), beta); + writeMatrix(fdynmat, gm[i-1], alpha, j, beta); } else { - writeMatrix(fdynmat, gm[i-1], alpha, gm[j-1], beta); + writeMatrix(fdynmat, gm[i-1], alpha, gm[j], beta); } } memset(&dynmat[0],0,dynlenb*sizeof(double)); @@ -636,3 +667,83 @@ void ThirdOrder::create_groupmap() delete[] sub_groupmap; delete[] temp_groupmap; } + +void ThirdOrder::getNeighbortags() { + bigint natoms = atom->natoms; + int *ilist,*jlist,*numneigh,**firstneigh; + int ii,jj,inum,jnum,sum; + int *temptags = (int*) malloc(natoms*sizeof(int)); + int *ijnumproc = (int*) malloc(natoms*sizeof(int)); + memory->create(ijnum, natoms, "thirdorder:ijnum"); + bigint **firsttags; + + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + memset(&ijnumproc[0],0,natoms*sizeof(int)); + for (ii = 0; ii < inum; ii++) { + //fprintf(screen, "i: %i on rank %i\n",atom->tag[ilist[ii] & NEIGHMASK], comm->me); + sum = 0; + memset(&temptags[0],0,natoms*sizeof(int)); + jnum = numneigh[ii]; + jlist = firstneigh[ii]; + temptags[atom->tag[ilist[ii] & NEIGHMASK]-1] = 1; + for (jj = 0; jj < jnum; jj++) { + // fprintf(screen, "i: %i and j: %i on rank %i\n",atom->tag[ilist[ii] & NEIGHMASK], atom->tag[jlist[jj] & NEIGHMASK],comm->me); + temptags[atom->tag[jlist[jj] & NEIGHMASK]-1] = 1; + } + for (bigint i=0; i<=natoms-1; i++) { + sum += temptags[i]; + } + ijnumproc[atom->tag[ilist[ii] & NEIGHMASK]-1] = sum; + // fprintf(screen, "tag %i sum %i on rank %i\n",atom->tag[ilist[ii] & NEIGHMASK], sum, comm->me); + } + MPI_Allreduce(ijnumproc,ijnum,natoms,MPI_INT,MPI_SUM,world); + sum = 0; + for (bigint i=0; i<=natoms-1; i++) { + sum += ijnum[i]; + } + + bigint nbytes = ((bigint) sizeof(bigint)) * sum; + bigint *data = (bigint *) memory->smalloc(nbytes, "thirdorder:firsttags"); + bigint *datarecv = (bigint *) memory->smalloc(nbytes, "thirdorder:neighbortags"); + nbytes = ((bigint) sizeof(bigint *)) * natoms; + firsttags = (bigint **) memory->smalloc(nbytes, "thirdorder:firsttags"); + neighbortags = (bigint **) memory->smalloc(nbytes, "thirdorder:neighbortags"); + memset(&data[0],0,sum*sizeof(bigint)); + memset(&datarecv[0],0,sum*sizeof(bigint)); + + bigint n = 0; + for (bigint i = 0; i < natoms; i++) { + firsttags[i] = &data[n]; + neighbortags[i] = &datarecv[n]; + n += ijnum[i]; + } + + for (ii = 0; ii < inum; ii++) { + int m = 0; + memset(&temptags[0],0,natoms*sizeof(int)); + jnum = numneigh[ii]; + jlist = firstneigh[ii]; + temptags[atom->tag[ilist[ii] & NEIGHMASK]-1] = 1; + for (jj = 0; jj < jnum; jj++) { + temptags[atom->tag[jlist[jj] & NEIGHMASK]-1] = 1; + } + for (int j=0; j < natoms; j++) { + if (temptags[j] == 1) { + firsttags[atom->tag[ilist[ii] & NEIGHMASK]-1][m] = j; + m += 1; + } + } + } + MPI_Allreduce(data,datarecv,sum,MPI_INT,MPI_SUM,world); + // for (bigint i=0; i < natoms; i++) { + // jnum = ijnum[i]; + // for (int j=0; j < jnum; j++) { + // fprintf(screen, "i: %lli and j: %i bool: %lli on rank %i\n", i, j, neighbortags[i][j], comm->me); + // } + // } + free (ijnumproc); + free (temptags); +} \ No newline at end of file diff --git a/src/USER-PHONON/third_order.h b/src/USER-PHONON/third_order.h index 7bd80840f5..3c39f912d6 100644 --- a/src/USER-PHONON/third_order.h +++ b/src/USER-PHONON/third_order.h @@ -48,6 +48,7 @@ namespace LAMMPS_NS { void convert_units(const char *style); void displace_atom(int local_idx, int direction, int magnitude); void writeMatrix(double *, bigint, int, bigint, int); + void getNeighbortags(); double conversion; double conv_energy; @@ -68,6 +69,10 @@ namespace LAMMPS_NS { int file_flag; // 1 custom file name, 0 dynmat.dat int folded; // 1 if system is folded, 0 no + class NeighList *list; + int *ijnum; + bigint **neighbortags; + FILE *fp; }; } From 7133311d2da0178930951ae4b9f7711946454678 Mon Sep 17 00:00:00 2001 From: Sievers Date: Thu, 16 Jul 2020 14:13:45 -0700 Subject: [PATCH 004/174] Change Allreduce to fit bigint --- src/USER-PHONON/third_order.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 2e85b37bf2..b33dc73d88 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -737,13 +737,18 @@ void ThirdOrder::getNeighbortags() { } } } - MPI_Allreduce(data,datarecv,sum,MPI_INT,MPI_SUM,world); - // for (bigint i=0; i < natoms; i++) { - // jnum = ijnum[i]; - // for (int j=0; j < jnum; j++) { - // fprintf(screen, "i: %lli and j: %i bool: %lli on rank %i\n", i, j, neighbortags[i][j], comm->me); - // } - // } + MPI_Allreduce(data,datarecv,sum,MPI_LONG_LONG_INT,MPI_SUM,world); + for (bigint i=0; i < natoms; i++) { + jnum = ijnum[i]; + if (comm->me==0) + fprintf(screen, "i: %lli : ", i); + for (int j=0; j < jnum; j++) { + if (comm->me==0) + fprintf(screen, "%lli ",neighbortags[i][j]); + } + if (comm->me==0) + fprintf(screen, "\n"); + } free (ijnumproc); free (temptags); } \ No newline at end of file From dd6e5df3563550abfb019cf1981bfc42089eac10 Mon Sep 17 00:00:00 2001 From: Sievers Date: Thu, 16 Jul 2020 14:16:12 -0700 Subject: [PATCH 005/174] Remove print statement --- src/USER-PHONON/third_order.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index b33dc73d88..54d8ad4f3e 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -738,17 +738,7 @@ void ThirdOrder::getNeighbortags() { } } MPI_Allreduce(data,datarecv,sum,MPI_LONG_LONG_INT,MPI_SUM,world); - for (bigint i=0; i < natoms; i++) { - jnum = ijnum[i]; - if (comm->me==0) - fprintf(screen, "i: %lli : ", i); - for (int j=0; j < jnum; j++) { - if (comm->me==0) - fprintf(screen, "%lli ",neighbortags[i][j]); - } - if (comm->me==0) - fprintf(screen, "\n"); - } + free (ijnumproc); free (temptags); } \ No newline at end of file From 9011cfaa96da87c40f06ee6b20c0cadebbe24fb5 Mon Sep 17 00:00:00 2001 From: Sievers Date: Sat, 18 Jul 2020 02:27:31 -0700 Subject: [PATCH 006/174] Added neighbors of neighbors list indexed by tag and return tags. --- src/USER-PHONON/third_order.cpp | 89 ++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 13 deletions(-) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 54d8ad4f3e..635d2be512 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -48,8 +48,8 @@ ThirdOrder::~ThirdOrder() if (fp && me == 0) fclose(fp); fp = NULL; memory->destroy(groupmap); - memory->destroy(ijnum); - memory->destroy(neighbortags); + // memory->destroy(ijnum); + // memory->destroy(neighbortags); } /* ---------------------------------------------------------------------- @@ -668,10 +668,13 @@ void ThirdOrder::create_groupmap() delete[] temp_groupmap; } +/* ---------------------------------------------------------------------- */ + void ThirdOrder::getNeighbortags() { bigint natoms = atom->natoms; int *ilist,*jlist,*numneigh,**firstneigh; - int ii,jj,inum,jnum,sum; + bigint *Jlist,*klist; + int ii,jj,kk,inum,jnum,knum,sum; int *temptags = (int*) malloc(natoms*sizeof(int)); int *ijnumproc = (int*) malloc(natoms*sizeof(int)); memory->create(ijnum, natoms, "thirdorder:ijnum"); @@ -681,28 +684,26 @@ void ThirdOrder::getNeighbortags() { ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - memset(&ijnumproc[0],0,natoms*sizeof(int)); + memset(&ijnum[0],0,natoms*sizeof(int)); for (ii = 0; ii < inum; ii++) { - //fprintf(screen, "i: %i on rank %i\n",atom->tag[ilist[ii] & NEIGHMASK], comm->me); sum = 0; memset(&temptags[0],0,natoms*sizeof(int)); jnum = numneigh[ii]; jlist = firstneigh[ii]; temptags[atom->tag[ilist[ii] & NEIGHMASK]-1] = 1; for (jj = 0; jj < jnum; jj++) { - // fprintf(screen, "i: %i and j: %i on rank %i\n",atom->tag[ilist[ii] & NEIGHMASK], atom->tag[jlist[jj] & NEIGHMASK],comm->me); temptags[atom->tag[jlist[jj] & NEIGHMASK]-1] = 1; } for (bigint i=0; i<=natoms-1; i++) { sum += temptags[i]; } - ijnumproc[atom->tag[ilist[ii] & NEIGHMASK]-1] = sum; - // fprintf(screen, "tag %i sum %i on rank %i\n",atom->tag[ilist[ii] & NEIGHMASK], sum, comm->me); + ijnum[atom->tag[ilist[ii] & NEIGHMASK]-1] = sum; } - MPI_Allreduce(ijnumproc,ijnum,natoms,MPI_INT,MPI_SUM,world); + MPI_Allreduce(ijnum,ijnumproc,natoms,MPI_INT,MPI_SUM,world); + memset(&ijnum[0],0,natoms*sizeof(int)); sum = 0; for (bigint i=0; i<=natoms-1; i++) { - sum += ijnum[i]; + sum += ijnumproc[i]; } bigint nbytes = ((bigint) sizeof(bigint)) * sum; @@ -718,7 +719,7 @@ void ThirdOrder::getNeighbortags() { for (bigint i = 0; i < natoms; i++) { firsttags[i] = &data[n]; neighbortags[i] = &datarecv[n]; - n += ijnum[i]; + n += ijnumproc[i]; } for (ii = 0; ii < inum; ii++) { @@ -732,13 +733,75 @@ void ThirdOrder::getNeighbortags() { } for (int j=0; j < natoms; j++) { if (temptags[j] == 1) { - firsttags[atom->tag[ilist[ii] & NEIGHMASK]-1][m] = j; + neighbortags[atom->tag[ilist[ii] & NEIGHMASK]-1][m] = j; m += 1; } } } - MPI_Allreduce(data,datarecv,sum,MPI_LONG_LONG_INT,MPI_SUM,world); + MPI_Allreduce(datarecv,data,sum,MPI_LONG_LONG_INT,MPI_SUM,world); + for (bigint i = 0; i < natoms; i++) { + ijnum[i] = 0; + sum = 0; + memset(&temptags[0],0,natoms*sizeof(int)); + jnum = ijnumproc[i]; + Jlist = firsttags[i]; + temptags[i] = 1; + for (jj = 0; jj < jnum; jj++) { + temptags[Jlist[jj]] = 1; + klist = firsttags[Jlist[jj]]; + knum = ijnumproc[Jlist[jj]]; + for (kk = 0; kk < knum; kk++) { + temptags[klist[kk]] = 1; + } + } + for (bigint j=0; jsmalloc(nbytes, "thirdorder:firsttags"); + nbytes = ((bigint) sizeof(bigint *)) * natoms; + neighbortags = (bigint **) memory->smalloc(nbytes, "thirdorder:neighbortags"); + memset(&datarecv[0],0,sum*sizeof(bigint)); + + n = 0; + for (bigint i = 0; i < natoms; i++) { + neighbortags[i] = &datarecv[n]; + n += ijnum[i]; + } + + for (bigint i = 0; i < natoms; i++) { + int m = 0; + memset(&temptags[0],0,natoms*sizeof(int)); + jnum = ijnumproc[i]; + Jlist = firsttags[i]; + temptags[i] = 1; + for (int j = 0; j < jnum; j++) { + temptags[Jlist[j]] = 1; + klist = firsttags[Jlist[j]]; + knum = ijnumproc[Jlist[j]]; + for (kk = 0; kk < knum; kk++) { + temptags[klist[kk]] = 1; + } + } + for (bigint j=0; j < natoms; j++) { + if (temptags[j] == 1) { + neighbortags[i][m] = j; + m += 1; + } + } + } + + free (firsttags); free (ijnumproc); free (temptags); } \ No newline at end of file From 5abddfe68de1e0ef8704e9399df8db9e12235a3c Mon Sep 17 00:00:00 2001 From: Sievers Date: Sun, 19 Jul 2020 19:12:01 -0700 Subject: [PATCH 007/174] Fixed nitpicky details, updated output, moved mass out of folded check --- src/USER-PHONON/dynamical_matrix.cpp | 26 +++++++++---------- src/USER-PHONON/third_order.cpp | 38 +++++++++++++++------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 4895da1f7f..ff746caec2 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -24,6 +24,8 @@ #include "pair.h" #include "timer.h" #include "finish.h" +#include "utils.h" +#include "fmt/format.h" #include using namespace LAMMPS_NS; @@ -135,7 +137,7 @@ void DynamicalMatrix::command(int narg, char **arg) else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); if (!folded) dynlenb = dynlen; - if (folded) dynlenb = (atom->natoms)*3; + else dynlenb = (atom->natoms)*3; if (atom->map_style == 0) error->all(FLERR,"Dynamical_matrix command requires an atom map, see atom_modify"); @@ -268,11 +270,11 @@ void DynamicalMatrix::calculateMatrix() //initialize dynmat to all zeros dynmat_clear(dynmat); - if (comm->me == 0 && screen) { - fprintf(screen,"Calculating Dynamical Matrix ...\n"); - fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); - fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); - fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlenb*dynlen) ); + if (comm->me == 0) { + utils::logmesg(lmp,fmt::format("Calculating Dynamical Matrix ...\n")); + utils::logmesg(lmp,fmt::format(" Total # of atoms = {}\n", natoms)); + utils::logmesg(lmp,fmt::format(" Atoms in group = {}\n", gcount)); + utils::logmesg(lmp,fmt::format(" Total dynamical matrix elements = {}\n", (dynlenb*dynlen) )); } // emit dynlen rows of dimalpha*dynlen*dimbeta elements @@ -308,12 +310,12 @@ void DynamicalMatrix::calculateMatrix() local_jdx = atom->map(j); if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal && (gm[j-1] >= 0 || folded)){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); if (folded){ for (int beta=0; beta<3; beta++){ - if (atom->rmass_flag == 1) - imass = sqrt(m[local_idx] * m[local_jdx]); - else - imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); dynmat[alpha][(j-1)*3+beta] *= conversion; @@ -321,10 +323,6 @@ void DynamicalMatrix::calculateMatrix() } else{ for (int beta=0; beta<3; beta++){ - if (atom->rmass_flag == 1) - imass = sqrt(m[local_idx] * m[local_jdx]); - else - imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); dynmat[alpha][gm[j-1]*3+beta] *= conversion; diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 635d2be512..e1ac7a94f6 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -27,6 +27,8 @@ #include "timer.h" #include "finish.h" #include "math_special.h" +#include "utils.h" +#include "fmt/format.h" #include #include @@ -127,7 +129,7 @@ void ThirdOrder::command(int narg, char **arg) // group and style igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); + if (igroup == -1) error->all(FLERR,"Could not find third_order group ID"); groupbit = group->bitmask[igroup]; gcount = group->count(igroup); dynlen = (gcount)*3; @@ -160,7 +162,7 @@ void ThirdOrder::command(int narg, char **arg) del = force->numeric(FLERR, arg[2]); if (!folded) dynlenb = dynlen; - if (folded) dynlenb = (atom->natoms)*3; + else dynlenb = (atom->natoms)*3; if (atom->map_style == 0) error->all(FLERR,"third_order command requires an atom map, see atom_modify"); @@ -216,14 +218,14 @@ void ThirdOrder::options(int narg, char **arg) } iarg += 2; } else if (strcmp(arg[iarg],"fold") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (iarg+2 > narg) error->all(FLERR, "Illegal third_order command"); if (strcmp(arg[iarg+1],"yes") == 0) { folded = 1; } else if (strcmp(arg[iarg+1],"no") == 0) { folded = 0; } - else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + else error->all(FLERR,"Illegal input for third_order fold option"); iarg += 2; } else error->all(FLERR,"Illegal third_order command"); } @@ -267,7 +269,7 @@ void ThirdOrder::openfile(const char* filename) } /* ---------------------------------------------------------------------- - create dynamical matrix + create third order tensor ------------------------------------------------------------------------- */ void ThirdOrder::calculateMatrix() @@ -290,12 +292,11 @@ void ThirdOrder::calculateMatrix() getNeighbortags(); - if (comm->me == 0 && screen) { - fprintf(screen,"Calculating Third Order ...\n"); - fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); - fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); - fprintf(screen," Total third order elements = " - BIGINT_FORMAT "\n", (dynlen*dynlenb*dynlenb) ); + if (comm->me == 0) { + utils::logmesg(lmp, fmt::format("Calculating Third Order ...\n")); + utils::logmesg(lmp, fmt::format(" Total # of atoms = {}\n", natoms)); + utils::logmesg(lmp, fmt::format(" Atoms in group = {}\n", gcount)); + utils::logmesg(lmp, fmt::format(" Total third order elements = {}\n", (dynlen*dynlenb*dynlenb) )); } update->nsteps = 0; @@ -414,7 +415,7 @@ void ThirdOrder::calculateMatrix() } /* ---------------------------------------------------------------------- - write dynamical matrix + write third order tensor ------------------------------------------------------------------------- */ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) @@ -432,8 +433,8 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+2]); if (norm > 1.0e-16) fprintf(fp, - BIGINT_FORMAT " %d " BIGINT_FORMAT " %d %d" - " %7.8f %7.8f %7.8f\n", + BIGINT_FORMAT " %d " BIGINT_FORMAT + " %d %d %7.8f %7.8f %7.8f\n", i+1, a + 1, j+1, b + 1, k+1, dynmat[k*3] * conversion, dynmat[k*3+1] * conversion, @@ -446,8 +447,8 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+2]); if (norm > 1.0e-16) fprintf(fp, - BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT - " %7.8f %7.8f %7.8f\n", + BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " + BIGINT_FORMAT " %7.8f %7.8f %7.8f\n", i+1, a + 1, j+1, b + 1, groupmap[k]+1, dynmat[k*3] * conversion, dynmat[k*3+1] * conversion, @@ -671,6 +672,9 @@ void ThirdOrder::create_groupmap() /* ---------------------------------------------------------------------- */ void ThirdOrder::getNeighbortags() { + // Create an extended neighbor list which is indexed by atom tag and yields atom tags + // groupmap[global atom index-1] = global atom indices (-1) of extended neighbors + bigint natoms = atom->natoms; int *ilist,*jlist,*numneigh,**firstneigh; bigint *Jlist,*klist; @@ -738,7 +742,7 @@ void ThirdOrder::getNeighbortags() { } } } - MPI_Allreduce(datarecv,data,sum,MPI_LONG_LONG_INT,MPI_SUM,world); + MPI_Allreduce(datarecv,data,sum,MPI_LMP_BIGINT,MPI_SUM,world); for (bigint i = 0; i < natoms; i++) { ijnum[i] = 0; From e57b391d4024a4d1dedba842a78b6c5fd063cd09 Mon Sep 17 00:00:00 2001 From: Sievers Date: Mon, 20 Jul 2020 11:35:10 -0700 Subject: [PATCH 008/174] Add threading capability to both commands --- src/USER-PHONON/dynamical_matrix.cpp | 3 +++ src/USER-PHONON/third_order.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index ff746caec2..0ff67c44a8 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -76,6 +76,9 @@ void DynamicalMatrix::setup() vflag=0; update_force(); + modify->setup(vflag); + update->setupflag = 0; + //if all then skip communication groupmap population if (gcount == atom->natoms) for (bigint i=0; inatoms; i++) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index e1ac7a94f6..5b0a995d99 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -87,6 +87,9 @@ void ThirdOrder::setup() vflag=0; update_force(); + modify->setup(vflag); + update->setupflag = 0; + if (gcount == atom->natoms) for (bigint i=0; inatoms; i++) groupmap[i] = i; From 0ed44e0b8117d495379e6fbba07506e3f4a75df4 Mon Sep 17 00:00:00 2001 From: Sievers Date: Fri, 16 Apr 2021 18:05:20 -0700 Subject: [PATCH 009/174] Remove leftover merge conflict string --- src/USER-PHONON/dynamical_matrix.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/USER-PHONON/dynamical_matrix.h b/src/USER-PHONON/dynamical_matrix.h index 251d2bc3b8..e51715f291 100644 --- a/src/USER-PHONON/dynamical_matrix.h +++ b/src/USER-PHONON/dynamical_matrix.h @@ -15,7 +15,6 @@ CommandStyle(dynamical_matrix,DynamicalMatrix) namespace LAMMPS_NS { -<<<<<<< HEAD class DynamicalMatrix : public Command { public: DynamicalMatrix(class LAMMPS *); From 1ee8de42d9bc56fea68d4a9758b9dc5e68d1c1b0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 21 Apr 2021 12:08:37 -0400 Subject: [PATCH 010/174] minor cleanups and simplifications using fmtlib --- src/USER-PHONON/dynamical_matrix.cpp | 27 +++++++------- src/USER-PHONON/dynamical_matrix.h | 1 - src/USER-PHONON/third_order.cpp | 53 ++++++++++++---------------- src/USER-PHONON/third_order.h | 1 - 4 files changed, 34 insertions(+), 48 deletions(-) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index e86b511e1a..9c6c6fe029 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -21,9 +21,8 @@ #include "neighbor.h" #include "pair.h" #include "timer.h" -#include "utils.h" -#include "fmt/format.h" #include "update.h" + #include #include @@ -41,7 +40,7 @@ DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Command(lmp), fp(nullptr) DynamicalMatrix::~DynamicalMatrix() { - if (fp && me == 0) fclose(fp); + if (fp && comm->me == 0) fclose(fp); memory->destroy(groupmap); fp = nullptr; } @@ -90,8 +89,6 @@ void DynamicalMatrix::setup() void DynamicalMatrix::command(int narg, char **arg) { - MPI_Comm_rank(world,&me); - if (domain->box_exist == 0) error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); @@ -120,7 +117,7 @@ void DynamicalMatrix::command(int narg, char **arg) int style = -1; if (strcmp(arg[1],"regular") == 0) style = REGULAR; else if (strcmp(arg[1],"eskm") == 0) style = ESKM; - else error->all(FLERR,"Illegal Dynamical Matrix command"); + else error->all(FLERR,"Illegal dynamical_matrix command"); del = utils::numeric(FLERR, arg[2],false,lmp); // set option defaults @@ -136,13 +133,13 @@ void DynamicalMatrix::command(int narg, char **arg) // read options from end of input line if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK - else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); + else error->all(FLERR,"Illegal dynamical_matrix command"); if (!folded) dynlenb = dynlen; else dynlenb = (atom->natoms)*3; if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"Dynamical_matrix command requires an atom map, see atom_modify"); + error->all(FLERR,"Dynamical_matrix command requires an atom map"); // move atoms by 3-vector or specified variable(s) @@ -219,7 +216,6 @@ void DynamicalMatrix::options(int narg, char **arg) void DynamicalMatrix::openfile(const char* filename) { // if file already opened, return - //if (me!=0) return; if (file_opened) return; if (compressed) { @@ -276,7 +272,7 @@ void DynamicalMatrix::calculateMatrix() utils::logmesg(lmp,fmt::format("Calculating Dynamical Matrix ...\n")); utils::logmesg(lmp,fmt::format(" Total # of atoms = {}\n", natoms)); utils::logmesg(lmp,fmt::format(" Atoms in group = {}\n", gcount)); - utils::logmesg(lmp,fmt::format(" Total dynamical matrix elements = {}\n", (dynlenb*dynlen) )); + utils::logmesg(lmp,fmt::format(" Total dynamical matrix elements = {}\n", (dynlenb*dynlen))); } // emit dynlen rows of dimalpha*dynlen*dimbeta elements @@ -336,7 +332,7 @@ void DynamicalMatrix::calculateMatrix() } for (int k=0; k<3; k++) MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (me == 0) + if (comm->me == 0) writeMatrix(fdynmat); dynmat_clear(dynmat); if (comm->me == 0 && screen) { @@ -358,7 +354,7 @@ void DynamicalMatrix::calculateMatrix() delete [] fdynmat[i]; delete [] fdynmat; - if (screen && me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); + if (screen && comm->me ==0) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); } /* ---------------------------------------------------------------------- @@ -367,7 +363,7 @@ void DynamicalMatrix::calculateMatrix() void DynamicalMatrix::writeMatrix(double **dynmat) { - if (me != 0 || !fp) + if (comm->me != 0 || !fp) return; clearerr(fp); @@ -379,8 +375,9 @@ void DynamicalMatrix::writeMatrix(double **dynmat) } else { for (int i = 0; i < 3; i++) { for (bigint j = 0; j < dynlenb; j++) { - if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); - else fprintf(fp, "%4.8f ",dynmat[i][j]); + fmt::print(fp, "{:.8f}", dynmat[i][j]); + if ((j+1)%3==0) fputs("\n",fp); + else fputs(" ",fp); } } if (ferror(fp)) diff --git a/src/USER-PHONON/dynamical_matrix.h b/src/USER-PHONON/dynamical_matrix.h index e51715f291..1c5333f31d 100644 --- a/src/USER-PHONON/dynamical_matrix.h +++ b/src/USER-PHONON/dynamical_matrix.h @@ -58,7 +58,6 @@ class DynamicalMatrix : public Command { bigint dynlen; // rank of dynamical matrix bigint dynlenb; // new dynlen if folded int scaleflag; - int me; bigint *groupmap; int compressed; // 1 if dump file is written compressed, 0 no diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 53a0d280cc..6a4ef24751 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -18,17 +18,14 @@ #include "kspace.h" #include "math_special.h" #include "memory.h" -#include "neighbor.h" +#include "modify.h" #include "neigh_list.h" #include "neigh_request.h" -#include "modify.h" +#include "neighbor.h" #include "pair.h" #include "timer.h" -#include "finish.h" -#include "math_special.h" -#include "utils.h" -#include "fmt/format.h" #include "update.h" + #include #include @@ -47,7 +44,7 @@ ThirdOrder::ThirdOrder(LAMMPS *lmp) : Command(lmp), fp(nullptr) ThirdOrder::~ThirdOrder() { - if (fp && me == 0) fclose(fp); + if (fp && comm->me == 0) fclose(fp); fp = nullptr; memory->destroy(groupmap); // memory->destroy(ijnum); @@ -101,8 +98,6 @@ void ThirdOrder::setup() void ThirdOrder::command(int narg, char **arg) { - MPI_Comm_rank(world,&me); - if (domain->box_exist == 0) error->all(FLERR,"third_order command before simulation box is defined"); if (narg < 2) error->all(FLERR,"Illegal third_order command"); @@ -161,14 +156,14 @@ void ThirdOrder::command(int narg, char **arg) // read options from end of input line if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK - else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); + else error->all(FLERR,"Illegal third_order command"); del = utils::numeric(FLERR, arg[2],false,lmp); if (!folded) dynlenb = dynlen; else dynlenb = (atom->natoms)*3; if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"third_order command requires an atom map, see atom_modify"); + error->all(FLERR,"third_order command requires an atom map"); // move atoms by 3-vector or specified variable(s) @@ -230,7 +225,7 @@ void ThirdOrder::options(int narg, char **arg) iarg += 2; } else error->all(FLERR,"Illegal third_order command"); } - if (file_flag == 1 and me == 0) { + if (file_flag == 1 && comm->me == 0) { openfile(filename); } } @@ -297,7 +292,7 @@ void ThirdOrder::calculateMatrix() utils::logmesg(lmp, fmt::format("Calculating Third Order ...\n")); utils::logmesg(lmp, fmt::format(" Total # of atoms = {}\n", natoms)); utils::logmesg(lmp, fmt::format(" Atoms in group = {}\n", gcount)); - utils::logmesg(lmp, fmt::format(" Total third order elements = {}\n", (dynlen*dynlenb*dynlenb) )); + utils::logmesg(lmp, fmt::format(" Total third order elements = {}\n", (dynlen*dynlenb*dynlenb))); } update->nsteps = 0; @@ -387,7 +382,7 @@ void ThirdOrder::calculateMatrix() displace_atom(local_jdx, beta, 1); displace_atom(local_idx, alpha, 1); MPI_Reduce(dynmat,fdynmat,dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (me == 0){ + if (comm->me == 0){ if (folded) { writeMatrix(fdynmat, gm[i-1], alpha, j, beta); } else { @@ -411,7 +406,7 @@ void ThirdOrder::calculateMatrix() delete [] dynmat; delete [] fdynmat; - if (screen && me ==0 ) + if (screen && comm->me ==0) fprintf(screen,"Finished Calculating Third Order Tensor\n"); } @@ -421,7 +416,7 @@ void ThirdOrder::calculateMatrix() void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) { - if (me != 0) + if (comm->me != 0) return; double norm; @@ -433,13 +428,11 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+1])+ square(dynmat[k*3+2]); if (norm > 1.0e-16) - fprintf(fp, - BIGINT_FORMAT " %d " BIGINT_FORMAT - " %d %d %7.8f %7.8f %7.8f\n", - i+1, a + 1, j+1, b + 1, k+1, - dynmat[k*3] * conversion, - dynmat[k*3+1] * conversion, - dynmat[k*3+2] * conversion); + fmt::print(fp,"{} {} {} {} {} {:.8f} {.8f} {.8f}\n", + i+1, a + 1, j+1, b + 1, k+1, + dynmat[k*3] * conversion, + dynmat[k*3+1] * conversion, + dynmat[k*3+2] * conversion); } } else { for (int k = 0; k < gcount; k++){ @@ -447,13 +440,11 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+1])+ square(dynmat[k*3+2]); if (norm > 1.0e-16) - fprintf(fp, - BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " - BIGINT_FORMAT " %7.8f %7.8f %7.8f\n", - i+1, a + 1, j+1, b + 1, groupmap[k]+1, - dynmat[k*3] * conversion, - dynmat[k*3+1] * conversion, - dynmat[k*3+2] * conversion); + fmt::print(fp, "{} {} {} {} {} {:.8f} {.8f} {.8f}\n", + i+1, a + 1, j+1, b + 1, groupmap[k]+1, + dynmat[k*3] * conversion, + dynmat[k*3+1] * conversion, + dynmat[k*3+2] * conversion); } } } else if (binaryflag && fp) { @@ -809,4 +800,4 @@ void ThirdOrder::getNeighbortags() { free (firsttags); free (ijnumproc); free (temptags); -} \ No newline at end of file +} diff --git a/src/USER-PHONON/third_order.h b/src/USER-PHONON/third_order.h index a833cc4754..201eff9383 100644 --- a/src/USER-PHONON/third_order.h +++ b/src/USER-PHONON/third_order.h @@ -59,7 +59,6 @@ namespace LAMMPS_NS { bigint dynlen; bigint dynlenb; int scaleflag; - int me; bigint gcount; // number of atoms in group bigint *groupmap; From 598e82d2366c176ed9476930b030c1a31594b734 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 21 Apr 2021 12:16:43 -0400 Subject: [PATCH 011/174] small cosmetic changes --- src/USER-PHONON/dynamical_matrix.cpp | 26 ++++++++++---------------- src/USER-PHONON/third_order.cpp | 18 ++++++++---------- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 9c6c6fe029..7dbd0d0183 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -79,7 +79,7 @@ void DynamicalMatrix::setup() //if all then skip communication groupmap population if (gcount == atom->natoms) - for (bigint i=0; inatoms; i++) + for (bigint i=0; i < atom->natoms; i++) groupmap[i] = i; else create_groupmap(); @@ -179,13 +179,11 @@ void DynamicalMatrix::options(int narg, char **arg) if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); if (strcmp(arg[iarg+1],"gzip") == 0) { compressed = 1; - } - else if (strcmp(arg[iarg+1],"yes") == 0) { + } else if (strcmp(arg[iarg+1],"yes") == 0) { binaryflag = 1; } iarg += 2; - } - else if (strcmp(arg[iarg],"file") == 0) { + } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); filename = arg[iarg + 1]; file_flag = 1; @@ -194,11 +192,9 @@ void DynamicalMatrix::options(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); if (strcmp(arg[iarg+1],"yes") == 0) { folded = 1; - } - else if (strcmp(arg[iarg+1],"no") == 0) { + } else if (strcmp(arg[iarg+1],"no") == 0) { folded = 0; - } - else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); iarg += 2; } else error->all(FLERR,"Illegal dynamical_matrix command"); } @@ -294,8 +290,7 @@ void DynamicalMatrix::calculateMatrix() for (int beta=0; beta<3; beta++){ dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; } - } - else { + } else { for (int beta=0; beta<3; beta++){ dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; } @@ -318,8 +313,7 @@ void DynamicalMatrix::calculateMatrix() dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); dynmat[alpha][(j-1)*3+beta] *= conversion; } - } - else{ + } else { for (int beta=0; beta<3; beta++){ dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); @@ -573,12 +567,12 @@ void DynamicalMatrix::create_groupmap() } //populate arrays for Allgatherv - for (int i=0; inprocs; i++) { + for (int i=0; i < comm->nprocs; i++) { recv[i] = 0; } recv[comm->me] = gid; MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; inprocs; i++) { + for (int i=0; i < comm->nprocs; i++) { recv[i]=displs[i]; if (i>0) displs[i] = displs[i-1]+recv[i-1]; else displs[i] = 0; @@ -590,7 +584,7 @@ void DynamicalMatrix::create_groupmap() //populate member groupmap based on temp groupmap bigint j = 0; - for (bigint i=1; i<=natoms; i++) { + for (bigint i=1; i <= natoms; i++) { // flag groupmap contents that are in temp_groupmap if (j < gcount && i == temp_groupmap[j]) groupmap[i-1] = j++; diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 6a4ef24751..010924982d 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -26,8 +26,8 @@ #include "timer.h" #include "update.h" -#include #include +#include using namespace LAMMPS_NS; using namespace MathSpecial; @@ -217,11 +217,9 @@ void ThirdOrder::options(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR, "Illegal third_order command"); if (strcmp(arg[iarg+1],"yes") == 0) { folded = 1; - } - else if (strcmp(arg[iarg+1],"no") == 0) { + } else if (strcmp(arg[iarg+1],"no") == 0) { folded = 0; - } - else error->all(FLERR,"Illegal input for third_order fold option"); + } else error->all(FLERR,"Illegal input for third_order fold option"); iarg += 2; } else error->all(FLERR,"Illegal third_order command"); } @@ -608,7 +606,7 @@ void ThirdOrder::create_groupmap() bigint *temp_groupmap = new bigint[natoms]; //find number of local atoms in the group (final_gid) - for (bigint i=1; i<=natoms; i++) { + for (bigint i=1; i <= natoms; i++) { local_idx = atom->map(i); if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) gid += 1; // gid at the end of loop is final_Gid @@ -618,7 +616,7 @@ void ThirdOrder::create_groupmap() gid = 0; //create a map between global atom id and group atom id for each proc - for (bigint i=1; i<=natoms; i++) { + for (bigint i=1; i <= natoms; i++) { local_idx = atom->map(i); if ((local_idx >= 0) && (local_idx < nlocal) && (mask[local_idx] & groupbit)) { @@ -628,12 +626,12 @@ void ThirdOrder::create_groupmap() } //populate arrays for Allgatherv - for (int i=0; inprocs; i++) { + for (int i=0; i < comm->nprocs; i++) { recv[i] = 0; } recv[comm->me] = gid; MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; inprocs; i++) { + for (int i=0; i < comm->nprocs; i++) { recv[i]=displs[i]; if (i>0) displs[i] = displs[i-1]+recv[i-1]; else displs[i] = 0; @@ -646,7 +644,7 @@ void ThirdOrder::create_groupmap() //populate member groupmap based on temp groupmap bigint j = 0; - for (bigint i=1; i<=natoms; i++) { + for (bigint i=1; i <= natoms; i++) { // flag groupmap contents that are in temp_groupmap if (j < gcount && i == temp_groupmap[j]) groupmap[i-1] = j++; From b982542ae66b0a6d8a5712d28c1fa4b7a77ccc91 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 21 Apr 2021 14:56:26 -0400 Subject: [PATCH 012/174] update indentation to 2 blanks. avoid "hanging else" constructs. --- src/USER-PHONON/dynamical_matrix.cpp | 766 +++++++++++++-------------- src/USER-PHONON/third_order.cpp | 8 +- 2 files changed, 387 insertions(+), 387 deletions(-) diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index 7dbd0d0183..b43227fd7c 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -33,16 +33,16 @@ enum{REGULAR,ESKM}; DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Command(lmp), fp(nullptr) { - external_force_clear = 1; + external_force_clear = 1; } /* ---------------------------------------------------------------------- */ DynamicalMatrix::~DynamicalMatrix() { - if (fp && comm->me == 0) fclose(fp); - memory->destroy(groupmap); - fp = nullptr; + if (fp && comm->me == 0) fclose(fp); + memory->destroy(groupmap); + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -53,116 +53,116 @@ DynamicalMatrix::~DynamicalMatrix() void DynamicalMatrix::setup() { - // setup domain, communication and neighboring - // acquire ghosts - // build neighbor lists - if (triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - comm->setup(); - if (neighbor->style) neighbor->setup_bins(); - comm->exchange(); - comm->borders(); - if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); - domain->image_check(); - domain->box_too_small_check(); - neighbor->build(1); + // setup domain, communication and neighboring + // acquire ghosts + // build neighbor lists + if (triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + comm->setup(); + if (neighbor->style) neighbor->setup_bins(); + comm->exchange(); + comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + domain->image_check(); + domain->box_too_small_check(); + neighbor->build(1); - // compute all forces - external_force_clear = 0; - eflag=0; - vflag=0; - update_force(); + // compute all forces + external_force_clear = 0; + eflag=0; + vflag=0; + update_force(); - modify->setup(vflag); - update->setupflag = 0; + modify->setup(vflag); + update->setupflag = 0; - //if all then skip communication groupmap population - if (gcount == atom->natoms) - for (bigint i=0; i < atom->natoms; i++) - groupmap[i] = i; - else - create_groupmap(); + //if all then skip communication groupmap population + if (gcount == atom->natoms) + for (bigint i=0; i < atom->natoms; i++) + groupmap[i] = i; + else + create_groupmap(); } /* ---------------------------------------------------------------------- */ void DynamicalMatrix::command(int narg, char **arg) { - if (domain->box_exist == 0) - error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); - if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); + if (domain->box_exist == 0) + error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); + if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); - lmp->init(); + lmp->init(); - // orthogonal vs triclinic simulation box + // orthogonal vs triclinic simulation box - triclinic = domain->triclinic; + triclinic = domain->triclinic; - if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; - else pair_compute_flag = 0; - if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; - else kspace_compute_flag = 0; + if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; + else pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; + else kspace_compute_flag = 0; - // group and style + // group and style - igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); - groupbit = group->bitmask[igroup]; - gcount = group->count(igroup); - dynlen = (gcount)*3; - memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); - update->setupflag = 1; + igroup = group->find(arg[0]); + if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); + groupbit = group->bitmask[igroup]; + gcount = group->count(igroup); + dynlen = (gcount)*3; + memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); + update->setupflag = 1; - int style = -1; - if (strcmp(arg[1],"regular") == 0) style = REGULAR; - else if (strcmp(arg[1],"eskm") == 0) style = ESKM; - else error->all(FLERR,"Illegal dynamical_matrix command"); - del = utils::numeric(FLERR, arg[2],false,lmp); + int style = -1; + if (strcmp(arg[1],"regular") == 0) style = REGULAR; + else if (strcmp(arg[1],"eskm") == 0) style = ESKM; + else error->all(FLERR,"Illegal dynamical_matrix command"); + del = utils::numeric(FLERR, arg[2],false,lmp); - // set option defaults + // set option defaults - binaryflag = 0; - scaleflag = 0; - compressed = 0; - file_flag = 0; - file_opened = 0; - folded = 0; - conversion = 1; + binaryflag = 0; + scaleflag = 0; + compressed = 0; + file_flag = 0; + file_opened = 0; + folded = 0; + conversion = 1; - // read options from end of input line - if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK - else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK - else error->all(FLERR,"Illegal dynamical_matrix command"); + // read options from end of input line + if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK + else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK + else error->all(FLERR,"Illegal dynamical_matrix command"); - if (!folded) dynlenb = dynlen; - else dynlenb = (atom->natoms)*3; + if (!folded) dynlenb = dynlen; + else dynlenb = (atom->natoms)*3; - if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"Dynamical_matrix command requires an atom map"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR,"Dynamical_matrix command requires an atom map"); - // move atoms by 3-vector or specified variable(s) + // move atoms by 3-vector or specified variable(s) - if (style == REGULAR) { - setup(); - timer->init(); - timer->barrier_start(); - calculateMatrix(); - timer->barrier_stop(); - } + if (style == REGULAR) { + setup(); + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } - if (style == ESKM) { - setup(); - convert_units(update->unit_style); - conversion = conv_energy/conv_distance/conv_mass; - timer->init(); - timer->barrier_start(); - calculateMatrix(); - timer->barrier_stop(); - } + if (style == ESKM) { + setup(); + convert_units(update->unit_style); + conversion = conv_energy/conv_distance/conv_mass; + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } - Finish finish(lmp); - finish.end(1); + Finish finish(lmp); + finish.end(1); } /* ---------------------------------------------------------------------- @@ -171,36 +171,36 @@ void DynamicalMatrix::command(int narg, char **arg) void DynamicalMatrix::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); - int iarg = 0; - const char* filename = "dynmat.dyn"; - while (iarg < narg) { - if (strcmp(arg[iarg],"binary") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - if (strcmp(arg[iarg+1],"gzip") == 0) { - compressed = 1; - } else if (strcmp(arg[iarg+1],"yes") == 0) { - binaryflag = 1; - } - iarg += 2; - } else if (strcmp(arg[iarg],"file") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - filename = arg[iarg + 1]; - file_flag = 1; - iarg += 2; - } else if (strcmp(arg[iarg],"fold") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - if (strcmp(arg[iarg+1],"yes") == 0) { - folded = 1; - } else if (strcmp(arg[iarg+1],"no") == 0) { - folded = 0; - } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); - iarg += 2; - } else error->all(FLERR,"Illegal dynamical_matrix command"); - } - if (file_flag == 1) { - openfile(filename); - } + if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); + int iarg = 0; + const char* filename = "dynmat.dyn"; + while (iarg < narg) { + if (strcmp(arg[iarg],"binary") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"gzip") == 0) { + compressed = 1; + } else if (strcmp(arg[iarg+1],"yes") == 0) { + binaryflag = 1; + } + iarg += 2; + } else if (strcmp(arg[iarg],"file") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + filename = arg[iarg + 1]; + file_flag = 1; + iarg += 2; + } else if (strcmp(arg[iarg],"fold") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"yes") == 0) { + folded = 1; + } else if (strcmp(arg[iarg+1],"no") == 0) { + folded = 0; + } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + iarg += 2; + } else error->all(FLERR,"Illegal dynamical_matrix command"); + } + if (file_flag == 1) { + openfile(filename); + } } /* ---------------------------------------------------------------------- @@ -211,12 +211,12 @@ void DynamicalMatrix::options(int narg, char **arg) void DynamicalMatrix::openfile(const char* filename) { - // if file already opened, return - if (file_opened) return; + // if file already opened, return + if (file_opened) return; - if (compressed) { + if (compressed) { #ifdef LAMMPS_GZIP - char gzip[128]; + char gzip[128]; sprintf(gzip,"gzip -6 > %s",filename); #ifdef _WIN32 fp = _popen(gzip,"wb"); @@ -224,17 +224,17 @@ void DynamicalMatrix::openfile(const char* filename) fp = popen(gzip,"w"); #endif #else - error->one(FLERR,"Cannot open gzipped file"); + error->one(FLERR,"Cannot open gzipped file"); #endif - } else if (binaryflag) { - fp = fopen(filename,"wb"); - } else { - fp = fopen(filename,"w"); - } + } else if (binaryflag) { + fp = fopen(filename,"wb"); + } else { + fp = fopen(filename,"w"); + } - if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); - file_opened = 1; + file_opened = 1; } /* ---------------------------------------------------------------------- @@ -243,112 +243,112 @@ void DynamicalMatrix::openfile(const char* filename) void DynamicalMatrix::calculateMatrix() { - int local_idx; // local index - int local_jdx; // second local index - int nlocal = atom->nlocal; - bigint natoms = atom->natoms; - int *type = atom->type; - bigint *gm = groupmap; - double imass; // dynamical matrix element - double *m = atom->mass; - double **f = atom->f; + int local_idx; // local index + int local_jdx; // second local index + int nlocal = atom->nlocal; + bigint natoms = atom->natoms; + int *type = atom->type; + bigint *gm = groupmap; + double imass; // dynamical matrix element + double *m = atom->mass; + double **f = atom->f; - double **dynmat = new double*[3]; - for (int i=0; i<3; i++) - dynmat[i] = new double[dynlenb]; + double **dynmat = new double*[3]; + for (int i=0; i<3; i++) + dynmat[i] = new double[dynlenb]; - double **fdynmat = new double*[3]; - for (int i=0; i<3; i++) - fdynmat[i] = new double[dynlenb]; + double **fdynmat = new double*[3]; + for (int i=0; i<3; i++) + fdynmat[i] = new double[dynlenb]; - //initialize dynmat to all zeros + //initialize dynmat to all zeros + dynmat_clear(dynmat); + + if (comm->me == 0) { + utils::logmesg(lmp,fmt::format("Calculating Dynamical Matrix ...\n")); + utils::logmesg(lmp,fmt::format(" Total # of atoms = {}\n", natoms)); + utils::logmesg(lmp,fmt::format(" Atoms in group = {}\n", gcount)); + utils::logmesg(lmp,fmt::format(" Total dynamical matrix elements = {}\n", (dynlenb*dynlen))); + } + + // emit dynlen rows of dimalpha*dynlen*dimbeta elements + + update->nsteps = 0; + int prog = 0; + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if (gm[i-1] < 0) + continue; + for (int alpha=0; alpha<3; alpha++) { + displace_atom(local_idx, alpha, 1); + update_force(); + for (bigint j=1; j<=natoms; j++) { + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && (gm[j-1] >= 0 || folded)){ + if (folded) { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; + } + } else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; + } + } + } + } + displace_atom(local_idx,alpha,-2); + update_force(); + for (bigint j=1; j<=natoms; j++) { + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && (gm[j-1] >= 0 || folded)){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); + if (folded){ + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); + dynmat[alpha][(j-1)*3+beta] *= conversion; + } + } else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); + dynmat[alpha][gm[j-1]*3+beta] *= conversion; + } + } + } + } + displace_atom(local_idx,alpha,1); + } + for (int k=0; k<3; k++) + MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); + if (comm->me == 0) + writeMatrix(fdynmat); dynmat_clear(dynmat); - - if (comm->me == 0) { - utils::logmesg(lmp,fmt::format("Calculating Dynamical Matrix ...\n")); - utils::logmesg(lmp,fmt::format(" Total # of atoms = {}\n", natoms)); - utils::logmesg(lmp,fmt::format(" Atoms in group = {}\n", gcount)); - utils::logmesg(lmp,fmt::format(" Total dynamical matrix elements = {}\n", (dynlenb*dynlen))); + if (comm->me == 0 && screen) { + int p = 10 * gm[i-1] / gcount; + if (p > prog) { + prog = p; + fprintf(screen," %d%%",p*10); + fflush(screen); + } } + } + if (comm->me == 0 && screen) fprintf(screen,"\n"); - // emit dynlen rows of dimalpha*dynlen*dimbeta elements + for (int i=0; i < 3; i++) + delete [] dynmat[i]; + delete [] dynmat; - update->nsteps = 0; - int prog = 0; - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if (gm[i-1] < 0) - continue; - for (int alpha=0; alpha<3; alpha++) { - displace_atom(local_idx, alpha, 1); - update_force(); - for (bigint j=1; j<=natoms; j++) { - local_jdx = atom->map(j); - if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && (gm[j-1] >= 0 || folded)){ - if (folded) { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; - } - } else { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; - } - } - } - } - displace_atom(local_idx,alpha,-2); - update_force(); - for (bigint j=1; j<=natoms; j++) { - local_jdx = atom->map(j); - if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && (gm[j-1] >= 0 || folded)){ - if (atom->rmass_flag == 1) - imass = sqrt(m[local_idx] * m[local_jdx]); - else - imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); - if (folded){ - for (int beta=0; beta<3; beta++){ - dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); - dynmat[alpha][(j-1)*3+beta] *= conversion; - } - } else { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); - dynmat[alpha][gm[j-1]*3+beta] *= conversion; - } - } - } - } - displace_atom(local_idx,alpha,1); - } - for (int k=0; k<3; k++) - MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (comm->me == 0) - writeMatrix(fdynmat); - dynmat_clear(dynmat); - if (comm->me == 0 && screen) { - int p = 10 * gm[i-1] / gcount; - if (p > prog) { - prog = p; - fprintf(screen," %d%%",p*10); - fflush(screen); - } - } - } - if (comm->me == 0 && screen) fprintf(screen,"\n"); + for (int i=0; i < 3; i++) + delete [] fdynmat[i]; + delete [] fdynmat; - for (int i=0; i < 3; i++) - delete [] dynmat[i]; - delete [] dynmat; - - for (int i=0; i < 3; i++) - delete [] fdynmat[i]; - delete [] fdynmat; - - if (screen && comm->me ==0) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); + if (screen && comm->me ==0) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); } /* ---------------------------------------------------------------------- @@ -357,26 +357,26 @@ void DynamicalMatrix::calculateMatrix() void DynamicalMatrix::writeMatrix(double **dynmat) { - if (comm->me != 0 || !fp) - return; + if (comm->me != 0 || !fp) + return; - clearerr(fp); - if (binaryflag) { - for (int i=0; i<3; i++) - fwrite(dynmat[i], sizeof(double), dynlenb, fp); - if (ferror(fp)) - error->one(FLERR, "Error writing to binary file"); - } else { - for (int i = 0; i < 3; i++) { - for (bigint j = 0; j < dynlenb; j++) { - fmt::print(fp, "{:.8f}", dynmat[i][j]); - if ((j+1)%3==0) fputs("\n",fp); - else fputs(" ",fp); - } - } - if (ferror(fp)) - error->one(FLERR,"Error writing to file"); + clearerr(fp); + if (binaryflag) { + for (int i=0; i<3; i++) + fwrite(dynmat[i], sizeof(double), dynlenb, fp); + if (ferror(fp)) + error->one(FLERR, "Error writing to binary file"); + } else { + for (int i = 0; i < 3; i++) { + for (bigint j = 0; j < dynlenb; j++) { + fmt::print(fp, "{:.8f}", dynmat[i][j]); + if ((j+1)%3==0) fputs("\n",fp); + else fputs(" ",fp); + } } + if (ferror(fp)) + error->one(FLERR,"Error writing to file"); + } } /* ---------------------------------------------------------------------- @@ -385,18 +385,18 @@ void DynamicalMatrix::writeMatrix(double **dynmat) void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) { - if (local_idx < 0) return; + if (local_idx < 0) return; - double **x = atom->x; - int *sametag = atom->sametag; - int j = local_idx; + double **x = atom->x; + int *sametag = atom->sametag; + int j = local_idx; - x[local_idx][direction] += del*magnitude; + x[local_idx][direction] += del*magnitude; - while (sametag[j] >= 0) { - j = sametag[j]; - x[j][direction] += del*magnitude; - } + while (sametag[j] >= 0) { + j = sametag[j]; + x[j][direction] += del*magnitude; + } } @@ -410,35 +410,35 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { - force_clear(); - int n_post_force = modify->n_post_force; + force_clear(); + int n_post_force = modify->n_post_force; - if (pair_compute_flag) { - force->pair->compute(eflag,vflag); - timer->stamp(Timer::PAIR); - } - if (atom->molecular != Atom::ATOMIC) { - if (force->bond) force->bond->compute(eflag,vflag); - if (force->angle) force->angle->compute(eflag,vflag); - if (force->dihedral) force->dihedral->compute(eflag,vflag); - if (force->improper) force->improper->compute(eflag,vflag); - timer->stamp(Timer::BOND); - } - if (kspace_compute_flag) { - force->kspace->compute(eflag,vflag); - timer->stamp(Timer::KSPACE); - } - if (force->newton) { - comm->reverse_comm(); - timer->stamp(Timer::COMM); - } + if (pair_compute_flag) { + force->pair->compute(eflag,vflag); + timer->stamp(Timer::PAIR); + } + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag,vflag); + if (force->angle) force->angle->compute(eflag,vflag); + if (force->dihedral) force->dihedral->compute(eflag,vflag); + if (force->improper) force->improper->compute(eflag,vflag); + timer->stamp(Timer::BOND); + } + if (kspace_compute_flag) { + force->kspace->compute(eflag,vflag); + timer->stamp(Timer::KSPACE); + } + if (force->newton) { + comm->reverse_comm(); + timer->stamp(Timer::COMM); + } - // force modifications + // force modifications - if (n_post_force) modify->post_force(vflag); - timer->stamp(Timer::MODIFY); + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); - ++ update->nsteps; + ++ update->nsteps; } /* ---------------------------------------------------------------------- @@ -448,17 +448,17 @@ void DynamicalMatrix::update_force() void DynamicalMatrix::force_clear() { - if (external_force_clear) return; + if (external_force_clear) return; - // clear global force array - // if either newton flag is set, also include ghosts + // clear global force array + // if either newton flag is set, also include ghosts - size_t nbytes = sizeof(double) * atom->nlocal; - if (force->newton) nbytes += sizeof(double) * atom->nghost; + size_t nbytes = sizeof(double) * atom->nlocal; + if (force->newton) nbytes += sizeof(double) * atom->nghost; - if (nbytes) { - memset(&atom->f[0][0],0,3*nbytes); - } + if (nbytes) { + memset(&atom->f[0][0],0,3*nbytes); + } } /* ---------------------------------------------------------------------- @@ -480,54 +480,54 @@ void DynamicalMatrix::dynmat_clear(double **dynmat) void DynamicalMatrix::convert_units(const char *style) { - // physical constants from: - // https://physics.nist.gov/cuu/Constants/Table/allascii.txt - // using thermochemical calorie = 4.184 J + // physical constants from: + // https://physics.nist.gov/cuu/Constants/Table/allascii.txt + // using thermochemical calorie = 4.184 J - if (strcmp(style,"lj") == 0) { - error->all(FLERR,"Conversion Not Set"); - //conversion = 1; // lj -> 10 J/mol + if (strcmp(style,"lj") == 0) { + error->all(FLERR,"Conversion Not Set"); + //conversion = 1; // lj -> 10 J/mol - } else if (strcmp(style,"real") == 0) { - conv_energy = 418.4; // kcal/mol -> 10 J/mol - conv_mass = 1; // g/mol -> g/mol - conv_distance = 1; // angstrom -> angstrom + } else if (strcmp(style,"real") == 0) { + conv_energy = 418.4; // kcal/mol -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom - } else if (strcmp(style,"metal") == 0) { - conv_energy = 9648.5; // eV -> 10 J/mol - conv_mass = 1; // g/mol -> g/mol - conv_distance = 1; // angstrom -> angstrom + } else if (strcmp(style,"metal") == 0) { + conv_energy = 9648.5; // eV -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom - } else if (strcmp(style,"si") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); - conv_energy = 6.022E22; // J -> 10 J/mol - conv_mass = 6.022E26; // kg -> g/mol - conv_distance = 1E-10; // meter -> angstrom + } else if (strcmp(style,"si") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E22; // J -> 10 J/mol + conv_mass = 6.022E26; // kg -> g/mol + conv_distance = 1E-10; // meter -> angstrom - } else if (strcmp(style,"cgs") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); - conv_energy = 6.022E12; // Erg -> 10 J/mol - conv_mass = 6.022E23; // g -> g/mol - conv_distance = 1E-7; // centimeter -> angstrom + } else if (strcmp(style,"cgs") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E12; // Erg -> 10 J/mol + conv_mass = 6.022E23; // g -> g/mol + conv_distance = 1E-7; // centimeter -> angstrom - } else if (strcmp(style,"electron") == 0) { - conv_energy = 262550; // Hartree -> 10 J/mol - conv_mass = 1; // amu -> g/mol - conv_distance = 0.529177249; // bohr -> angstrom + } else if (strcmp(style,"electron") == 0) { + conv_energy = 262550; // Hartree -> 10 J/mol + conv_mass = 1; // amu -> g/mol + conv_distance = 0.529177249; // bohr -> angstrom - } else if (strcmp(style,"micro") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); - conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol - conv_mass = 6.022E11; // pg -> g/mol - conv_distance = 1E-4; // micrometer -> angstrom + } else if (strcmp(style,"micro") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol + conv_mass = 6.022E11; // pg -> g/mol + conv_distance = 1E-4; // micrometer -> angstrom - } else if (strcmp(style,"nano") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); - conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol - conv_mass = 6.022E5; // ag -> g/mol - conv_distance = 0.1; // angstrom -> angstrom + } else if (strcmp(style,"nano") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol + conv_mass = 6.022E5; // ag -> g/mol + conv_distance = 0.1; // angstrom -> angstrom - } else error->all(FLERR,"Units Type Conversion Not Found"); + } else error->all(FLERR,"Units Type Conversion Not Found"); } @@ -535,66 +535,66 @@ void DynamicalMatrix::convert_units(const char *style) void DynamicalMatrix::create_groupmap() { - //Create a group map which maps atom order onto group - // groupmap[global atom index-1] = output column/row + //Create a group map which maps atom order onto group + // groupmap[global atom index-1] = output column/row - int local_idx; // local index - int gid = 0; //group index - int nlocal = atom->nlocal; - int *mask = atom->mask; - bigint natoms = atom->natoms; - int *recv = new int[comm->nprocs]; - int *displs = new int[comm->nprocs]; - bigint *temp_groupmap = new bigint[natoms]; + int local_idx; // local index + int gid = 0; //group index + int nlocal = atom->nlocal; + int *mask = atom->mask; + bigint natoms = atom->natoms; + int *recv = new int[comm->nprocs]; + int *displs = new int[comm->nprocs]; + bigint *temp_groupmap = new bigint[natoms]; - //find number of local atoms in the group (final_gid) - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) - gid += 1; // gid at the end of loop is final_Gid + //find number of local atoms in the group (final_gid) + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) + gid += 1; // gid at the end of loop is final_Gid + } + //create an array of length final_gid + bigint *sub_groupmap = new bigint[gid]; + + gid = 0; + //create a map between global atom id and group atom id for each proc + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) { + sub_groupmap[gid] = i; + gid += 1; } - //create an array of length final_gid - bigint *sub_groupmap = new bigint[gid]; + } - gid = 0; - //create a map between global atom id and group atom id for each proc - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) { - sub_groupmap[gid] = i; - gid += 1; - } - } + //populate arrays for Allgatherv + for (int i=0; i < comm->nprocs; i++) { + recv[i] = 0; + } + recv[comm->me] = gid; + MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); + for (int i=0; i < comm->nprocs; i++) { + recv[i]=displs[i]; + if (i>0) displs[i] = displs[i-1]+recv[i-1]; + else displs[i] = 0; + } - //populate arrays for Allgatherv - for (int i=0; i < comm->nprocs; i++) { - recv[i] = 0; - } - recv[comm->me] = gid; - MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; i < comm->nprocs; i++) { - recv[i]=displs[i]; - if (i>0) displs[i] = displs[i-1]+recv[i-1]; - else displs[i] = 0; - } + //combine subgroup maps into total temporary groupmap + MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world); + std::sort(temp_groupmap,temp_groupmap+gcount); - //combine subgroup maps into total temporary groupmap - MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world); - std::sort(temp_groupmap,temp_groupmap+gcount); + //populate member groupmap based on temp groupmap + bigint j = 0; + for (bigint i=1; i <= natoms; i++) { + // flag groupmap contents that are in temp_groupmap + if (j < gcount && i == temp_groupmap[j]) + groupmap[i-1] = j++; + else + groupmap[i-1] = -1; + } - //populate member groupmap based on temp groupmap - bigint j = 0; - for (bigint i=1; i <= natoms; i++) { - // flag groupmap contents that are in temp_groupmap - if (j < gcount && i == temp_groupmap[j]) - groupmap[i-1] = j++; - else - groupmap[i-1] = -1; - } - - //free that memory! - delete[] recv; - delete[] displs; - delete[] sub_groupmap; - delete[] temp_groupmap; + //free that memory! + delete[] recv; + delete[] displs; + delete[] sub_groupmap; + delete[] temp_groupmap; } diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 010924982d..c43d3a5fb2 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -423,8 +423,8 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) if (folded){ for (int k = 0; k < atom->natoms; k++){ norm = square(dynmat[k*3])+ - square(dynmat[k*3+1])+ - square(dynmat[k*3+2]); + square(dynmat[k*3+1])+ + square(dynmat[k*3+2]); if (norm > 1.0e-16) fmt::print(fp,"{} {} {} {} {} {:.8f} {.8f} {.8f}\n", i+1, a + 1, j+1, b + 1, k+1, @@ -435,8 +435,8 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) } else { for (int k = 0; k < gcount; k++){ norm = square(dynmat[k*3])+ - square(dynmat[k*3+1])+ - square(dynmat[k*3+2]); + square(dynmat[k*3+1])+ + square(dynmat[k*3+2]); if (norm > 1.0e-16) fmt::print(fp, "{} {} {} {} {} {:.8f} {.8f} {.8f}\n", i+1, a + 1, j+1, b + 1, groupmap[k]+1, From 0867299adb44d91b8eb66c96fdce2c3ec141cc16 Mon Sep 17 00:00:00 2001 From: Sievers Date: Mon, 19 Jul 2021 11:54:49 -0700 Subject: [PATCH 013/174] Fixed format error bug in third order tensor print --- src/USER-PHONON/third_order.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 6c78e51c79..6bd04a3d5e 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -439,7 +439,7 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+1])+ square(dynmat[k*3+2]); if (norm > 1.0e-16) - fmt::print(fp,"{} {} {} {} {} {:.8f} {.8f} {.8f}\n", + fmt::print(fp,"{} {} {} {} {} {:.8f} {:.8f} {:.8f}\n", i+1, a + 1, j+1, b + 1, k+1, dynmat[k*3] * conversion, dynmat[k*3+1] * conversion, @@ -451,7 +451,7 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+1])+ square(dynmat[k*3+2]); if (norm > 1.0e-16) - fmt::print(fp, "{} {} {} {} {} {:.8f} {.8f} {.8f}\n", + fmt::print(fp, "{} {} {} {} {} {:.8f} {:.8f} {:.8f}\n", i+1, a + 1, j+1, b + 1, groupmap[k]+1, dynmat[k*3] * conversion, dynmat[k*3+1] * conversion, From d207710b43d4985774a35084ca0268c92b8b6127 Mon Sep 17 00:00:00 2001 From: Lewis M Russell <71833891+lrussell676@users.noreply.github.com> Date: Wed, 13 Oct 2021 10:47:41 +0100 Subject: [PATCH 014/174] lrefpos (nx/y/z) now working in oxdna_hbond. Being comm'ed and MPI working (#7) * use the term 'website' consistently (and not also 'web site') * update for clang-format * clarify * split off the programming/submission style guide to a separate file * Updates to support ROCm 4.3 in GPU package * update and reorder the description of the process for submitting contributions * correct and clarify Python compatibility * refactor style guide and integrate text from issue * update contribution guidelines for github * mention when testing may be added * integrate file with description of include file conventions * update github workflow doc * adapt section about domain decomposition from paper * use a more compact image * add communication section * update man page with missing flags and correct URLs * improve the load imbalance viz * add section about neighbor list construction * break large file into multiple smaller files by section and add toctree * fix typo * add section about parallelization in the OPENMP package * add -skipruin to help message * add discussion of OpenMP parallelization * spelling * add section on PPPM * use larger version of FFT grid comm image * minor tweak * Update compute angle doc page * Update Singularity definitions to use ROCm 4.3 * Update CUDA container definitions to CUDA 11.4 * Update container definitions to include PLUMED 2.7.2 * Update more definition files * RHEL8/CentOS8 PowerTools is now powertools * Add Rocky Linux 8 container definition * Add omega field to numpy_wrapper detection * Return None in case of null pointer * Add more atom fields in numpy_wrapper and correct csforce size * must not clear force array. will segfault in hybrid atom styles * update example for dynamically loading LAMMPS with current library API * update example to use current library interface. No need to use the namespace. * add note to README files about age of the example * simplify building shared libs on windows * detect a few more compilers * Revert "simplify building shared libs on windows" This reverts commit fa3429ab022b6bbb680011fee9a33f0a77839e1e. * step version strings for next patch release * fix mingw 32-bit vs 64-bit craziness * detect C++20 standard * build "fat" cuda binaries only with known toolkits * spelling * Try to improve the pair style hybrid docs This specifically tries to avoid the ambiguous use of "mixing" and clarify that similar is still different when pair styles are concerned. See discussion here: https://matsci.org/t/confusion-about-mixing-and-pair-coeff-section/38317/3 * spelling * use nullptr * use symbolic constant * small optimization * use cmath header instead of math.h * use explicit scoping when virtual dispatch is not available. * cosmetic changes * simplify/optimize code * simplify * Bugfix from Trung for crashes in pppm/gpu without local atoms * fix typo * refer to "XXX Coeffs" sections consistently * small tweaks from static code analysis * fix small bug * small tweaks * simplify and modernize code a little * use correct data type for MPI calls * simplify/modernize * remove dead code * about 1.5x speedup for pair style comb3 by using MathSpecial::powint() * small performance optimization for pair style comb * simplify * modernize * simplify * removed dead code, reformat * modernize * use explicit scoping when virtual dispatch is not (yet) available * reformat for increased readability * move misplaced #endif and make code more readable * make sure err_flag is initialized * modernize * remove redundant code: all struct members are initialized to defaults in the constructor * enforce initialization and thus silence compiler warnings * fix typo * provide more comprehensive suggestions for GPU neighbor list errors * add utils::logical() function to complement the *numeric() functions * Add stable link in docs * revert modernization change (for now) * remove unused variable * include EXTRA-DUMP in "most" * small tweaks * simplify * Add log file printing of KIM search directories in 'kim init' * use clang-format on kim_init.cpp * Improve style in response to Axel's suggestions * initialize all members * format changes * simplify. use utils::strdup() more. * small corrections * apply fix from balance command to fix balance * dead code removal * reformat strings * implement utils::current_date() convenience function to reduce replicated code * update list and order of include files from include-what-you-use analysis * handle changes in GAP repo * a few remaining updates to include statements * expand mapping to handle "style_*.h" header files correctly. * add support for compilation of OpenCL loader on FreeBSD * more iwyu header updates * small correction * fix typo * a few more (final?) IWYU updates * expand tests for numeric values * return int instead of bool to minimize code changes * fix spelling issues * some applications of the new function * fix typo * Change "offsite" to "external" to correct broken URLs to lammps.org * improve error message * insert missing atom-ID * convert yes/no on/off flags in the package command(s) * update version strings * update death tests for change in error message * correctly specify the destructor function name. * apply utils::logical() to more commands * apply utils::logical() in more places * for consistency with utils::logical() * only accept lower case to be consistent with the rest of the input * a few more converted commands and updates for unit tests * modernize and fix some memory leaks * adjust for compatibility with C++20 compilers * do not downgrade C++ standard when adding the KOKKOS package * undo "risky" C++20 related changes * mention how to set the path to the fftw3_omp library * correct paths to downloaded PACE package sources in lib * Update CMake variable descriptions * possible workaround for some GPU package neighbor list issue * final chunk of changes to apply utils::logical() * update suffix command unit tests * update citation info with new LAMMPS paper reference and acknowledge it * update some formulations as suggested by @sjplimp * add check and suitable error message when fp64 is required but not available * do not call memset on a null pointer * fix string formatting bugs in fix npt/cauchy * must use a soft core potential to avoid a singularity * in floating point math a*b may be zero even if both a>0 and b>0 * use proper integer type for atom IDs * Building voro++ lib as part of LAMMPS requires the "patch" program * silence output from hwloc when launching LAMMPS * detect double precision support according to OpenCL specs (1.2 and later) * Fix bug in Kokkos pair_eam_alloy * calling fwrite() with a null pointer causes undefined behavior. avoid it. * cosmetic * apply current include file conventions * include zstd libs in windows build * update .gitignore for recent additions * make check more obvious * step version strings for stable release * Adjust for kim-api bug * cleaner variant of version check, add directory numbering * hbond comm added for rsq_hb * rsq_hb removed, exyz added (no MPI comm yet) * Fix Colvars output files not written with "run 0" See: https://github.com/Colvars/colvars/commit/ff2f0d39ee5 which fixes a bug introduced in: https://github.com/Colvars/colvars/commit/1e964a542b The message applies to NAMD, but the logic used in LAMMPS when handling "run 0" is very similar. The Colvars version string is also updated, however this commit does not include other changes, such as the following: https://github.com/Colvars/colvars/pull/419 which were not fully completed before the LAMMPS Summer 2021 finalization. * add -std=c++11 to a number of machine makefiles for traditional make build * copy request to mention lammps.org form home page instructions for citing * be more specific about what the name of the LAMMPS executable can be also provide a few more examples without a machine suffix * small tweak * remove references to USER packages, have package lists alphabetically sorted "make package-update" or "make pu" must be processed in the special order because of inter-package dependencies * make "make package-update" and "make package-overwrite" less verbose * freeze versions of pip packages for processing the manual of the stable version this way we avoid surprises in case one of the packages get updated to an incompatible new version. these are know-to-work versions. * make sure the one_coeff flag is applied to sub-styles since the check for Pair::one_coeff was moved to the Input class (to reduce redundant code), hybrid substyles could "escape" that requirement. Thus checks have to be added to the hybrid coeff() methods. * Prevent neigh list from copying "unique" stencil/bin * compiling ML-HDNNP with downloaded n2p2 lib requires the sed command * detect and error out if BLAS/LAPACK libraries variables are a list This will cause external project compilation to fail since the semi-colons are converted to blanks, but one cannot properly escape the variables. So far the only viable solution seems to be to convert the scripts from using ExternalProject_add() to FetchContent and add_subdirectory() * portability improvement * must have patch command available to compile ScaFaCoS * only need Tcl not Tk to compile Tcl swig wrapper * correctly handle Tcl stub library if available * add missing keyword * hbond_pos added, MPI and values ok, Pair time slow. * make C library example work with strict C compilers * silence compiler warnings * make Nevery keyword per-reaction * recover cross-compilation with mingw64 * reverted wrong approach from last commits - now intpos flag - hbond_pos added - (a/b)xyz WiP * lrefpos working in serial, MPI wrong * attempt to merge doubles into n(xyz)[3] * save * Update pair_oxdna_hbond.cpp * hbond now working for MPI, comming lrefpos Co-authored-by: Axel Kohlmeyer Co-authored-by: Richard Berger Co-authored-by: Ryan S. Elliott Co-authored-by: Stan Gerald Moore Co-authored-by: Giacomo Fiorin Co-authored-by: Jacob Gissinger --- src/CG-DNA/bond_oxdna_fene.cpp | 3 +- src/CG-DNA/pair_oxdna_hbond.cpp | 178 ++++++++++++++++++++++++++++++-- src/CG-DNA/pair_oxdna_hbond.h | 8 ++ src/atom.cpp | 1 + src/atom.h | 4 + 5 files changed, 182 insertions(+), 12 deletions(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index 6b720f6a7f..6d92e4bcb0 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -255,7 +255,8 @@ void BondOxdnaFene::compute(int eflag, int vflag) if (evflag) ev_tally_xyz(a, b, nlocal, newton_bond, ebond, delf[0], delf[1], delf[2], x[a][0] - x[b][0], x[a][1] - x[b][1], x[a][2] - x[b][2]); - } + } + atom->lrefpos_flag = 0; // reset for next timestep } /* ---------------------------------------------------------------------- */ diff --git a/src/CG-DNA/pair_oxdna_hbond.cpp b/src/CG-DNA/pair_oxdna_hbond.cpp index 4bf0bc9c56..e268ffaded 100644 --- a/src/CG-DNA/pair_oxdna_hbond.cpp +++ b/src/CG-DNA/pair_oxdna_hbond.cpp @@ -62,6 +62,11 @@ PairOxdnaHbond::PairOxdnaHbond(LAMMPS *lmp) : Pair(lmp) alpha_hb[3][1] = 1.00000; alpha_hb[3][2] = 1.00000; alpha_hb[3][3] = 1.00000; + + // set comm size needed by this Pair + + comm_forward = 9; + comm_reverse = 9; } @@ -69,7 +74,12 @@ PairOxdnaHbond::PairOxdnaHbond(LAMMPS *lmp) : Pair(lmp) PairOxdnaHbond::~PairOxdnaHbond() { + if (allocated) { + + memory->destroy(nx); + memory->destroy(ny); + memory->destroy(nz); memory->destroy(setflag); memory->destroy(cutsq); @@ -149,9 +159,10 @@ void PairOxdnaHbond::compute(int eflag, int vflag) // vectors COM-h-bonding site in lab frame double ra_chb[3],rb_chb[3]; - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + // Only (a/b)x required here + double ax[3]; + double bx[3]; double **x = atom->x; double **f = atom->f; @@ -167,7 +178,7 @@ void PairOxdnaHbond::compute(int eflag, int vflag) AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; - int a,b,ia,ib,anum,bnum,atype,btype; + int n,a,b,in,ia,ib,anum,bnum,atype,btype; double f1,f4t1,f4t4,f4t2,f4t3,f4t7,f4t8; double df1,df4t1,df4t4,df4t2,df4t3,df4t7,df4t8; @@ -175,10 +186,41 @@ void PairOxdnaHbond::compute(int eflag, int vflag) evdwl = 0.0; ev_init(eflag,vflag); + nlocal = atom->nlocal; anum = list->inum; alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // loop over all local atoms, handle calculation of local reference frame + + if (atom->lrefpos_flag < atom->nmax) { + for (in = 0; in < atom->nlocal; in++) { + + int n = alist[in]; + + double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame + qn=bonus[ellipsoid[n]].quat; + MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); + + nx[n][0] = nx_temp[0]; + nx[n][1] = nx_temp[1]; + nx[n][2] = nx_temp[2]; + ny[n][0] = ny_temp[0]; + ny[n][1] = ny_temp[1]; + ny[n][2] = ny_temp[2]; + nz[n][0] = nz_temp[0]; + nz[n][1] = nz_temp[1]; + nz[n][2] = nz_temp[2]; + + //printf("\n In top: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[n][0], nx[n][1], nx[n][2], atom->tag[n]); + + atom->lrefpos_flag += 1; + } + } + + //if (newton_pair) comm->reverse_comm_pair(this); + comm->forward_comm_pair(this); // loop over pair interaction neighbors of my atoms @@ -187,12 +229,17 @@ void PairOxdnaHbond::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + //printf("\n In A loop: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[a][0], nx[a][1], nx[a][2], atom->tag[a]); - ra_chb[0] = d_chb*ax[0]; + ax[0] = nx[a][0]; + ax[1] = nx[a][1]; + ax[2] = nx[a][2]; + + ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; ra_chb[2] = d_chb*ax[2]; + + //printf("\n ax[0] = %f, ax[1] = %f, ax[2] = %f, id = %d", ax[0], ax[1], ax[2], atom->tag[a]); blist = firstneigh[a]; bnum = numneigh[a]; @@ -205,12 +252,15 @@ void PairOxdnaHbond::compute(int eflag, int vflag) btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); - - rb_chb[0] = d_chb*bx[0]; + bx[0] = nx[b][0]; + bx[1] = nx[b][1]; + bx[2] = nx[b][2]; + + rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; rb_chb[2] = d_chb*bx[2]; + + //printf("\n bx[0] = %f, bx[1] = %f, bx[2] = %f, id = %d", bx[0], bx[1], bx[2], atom->tag[b]); // vector h-bonding site b to a delr_hb[0] = x[a][0] + ra_chb[0] - x[b][0] - rb_chb[0]; @@ -264,6 +314,16 @@ void PairOxdnaHbond::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { + + double az[3]; + double bz[3]; + + az[0] = nz[a][0]; + az[1] = nz[a][1]; + az[2] = nz[a][2]; + bz[0] = nz[b][0]; + bz[1] = nz[b][1]; + bz[2] = nz[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; @@ -560,6 +620,10 @@ void PairOxdnaHbond::allocate() for (int j = i; j <= n; j++) setflag[i][j] = 0; + memory->create(nx,atom->nmax,3,"pair:nx"); + memory->create(ny,atom->nmax,3,"pair:ny"); + memory->create(nz,atom->nmax,3,"pair:nz"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(epsilon_hb,n+1,n+1,"pair:epsilon_hb"); @@ -1182,10 +1246,102 @@ void PairOxdnaHbond::write_data_all(FILE *fp) /* ---------------------------------------------------------------------- */ +int PairOxdnaHbond::pack_forward_comm(int n, int *list, double *buf, + int /*pbc_flag*/, int * /*pbc*/) +{ + int i,j,m; + + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = nx[j][0]; + buf[m++] = nx[j][1]; + buf[m++] = nx[j][2]; + buf[m++] = ny[j][0]; + buf[m++] = ny[j][1]; + buf[m++] = ny[j][2]; + buf[m++] = nz[j][0]; + buf[m++] = nz[j][1]; + buf[m++] = nz[j][2]; + } + return m; +} + +/* ---------------------------------------------------------------------- */ + +void PairOxdnaHbond::unpack_forward_comm(int n, int first, double *buf) +{ + int i,m,last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) { + nx[i][0] = buf[m++]; + nx[i][1] = buf[m++]; + nx[i][2] = buf[m++]; + ny[i][0] = buf[m++]; + ny[i][1] = buf[m++]; + ny[i][2] = buf[m++]; + nz[i][0] = buf[m++]; + nz[i][1] = buf[m++]; + nz[i][2] = buf[m++]; + } +} + +/* ---------------------------------------------------------------------- */ + +int PairOxdnaHbond::pack_reverse_comm(int n, int first, double *buf) +{ + int i,m,last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) { + buf[m++] = nx[i][0]; + buf[m++] = nx[i][1]; + buf[m++] = nx[i][2]; + buf[m++] = ny[i][0]; + buf[m++] = ny[i][1]; + buf[m++] = ny[i][2]; + buf[m++] = nz[i][0]; + buf[m++] = nz[i][1]; + buf[m++] = nz[i][2]; + } + return m; +} + +/* ---------------------------------------------------------------------- */ + +void PairOxdnaHbond::unpack_reverse_comm(int n, int *list, double *buf) +{ + int i,j,m; + + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + nx[j][0] += buf[m++]; + nx[j][1] += buf[m++]; + nx[j][2] += buf[m++]; + ny[j][0] += buf[m++]; + ny[j][1] += buf[m++]; + ny[j][2] += buf[m++]; + nz[j][0] += buf[m++]; + nz[j][1] += buf[m++]; + nz[j][2] += buf[m++]; + + } +} + +/* ---------------------------------------------------------------------- */ + void *PairOxdnaHbond::extract(const char *str, int &dim) { dim = 2; + if (strcmp(str,"nx") == 0) return (void *) nx; + if (strcmp(str,"ny") == 0) return (void *) ny; + if (strcmp(str,"nz") == 0) return (void *) nz; + if (strcmp(str,"epsilon_hb") == 0) return (void *) epsilon_hb; if (strcmp(str,"a_hb") == 0) return (void *) a_hb; if (strcmp(str,"cut_hb_0") == 0) return (void *) cut_hb_0; diff --git a/src/CG-DNA/pair_oxdna_hbond.h b/src/CG-DNA/pair_oxdna_hbond.h index fdc8e9823b..e6dc47db56 100644 --- a/src/CG-DNA/pair_oxdna_hbond.h +++ b/src/CG-DNA/pair_oxdna_hbond.h @@ -41,6 +41,11 @@ class PairOxdnaHbond : public Pair { void write_data(FILE *); void write_data_all(FILE *); void *extract(const char *, int &); + + virtual int pack_forward_comm(int, int *, double *, int, int *); + virtual void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); protected: // h-bonding interaction @@ -67,6 +72,9 @@ class PairOxdnaHbond : public Pair { double **a_hb8, **theta_hb8_0, **dtheta_hb8_ast; double **b_hb8, **dtheta_hb8_c; + // per-atom arrays for q_to_exyz storage + double **nx, **ny, **nz; + int seqdepflag; virtual void allocate(); diff --git a/src/atom.cpp b/src/atom.cpp index 111ce7c93c..48adbf1eea 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -649,6 +649,7 @@ void Atom::set_atomflag_defaults() rho_flag = esph_flag = cv_flag = vest_flag = 0; dpd_flag = edpd_flag = tdpd_flag = 0; sp_flag = 0; + lrefpos_flag = 0; x0_flag = 0; smd_flag = damage_flag = 0; mesont_flag = 0; diff --git a/src/atom.h b/src/atom.h index e196d2d135..ee52c2c3d4 100644 --- a/src/atom.h +++ b/src/atom.h @@ -190,6 +190,10 @@ class Atom : protected Pointers { // SPIN package int sp_flag; + + // CG-DNA package + + int lrefpos_flag; // MACHDYN package From 20fec49635d78914ef4f6d5004529ac91376b2eb Mon Sep 17 00:00:00 2001 From: Lewis M Russell <71833891+lrussell676@users.noreply.github.com> Date: Tue, 26 Oct 2021 16:45:44 +0100 Subject: [PATCH 015/174] Intpos (#8) * use the term 'website' consistently (and not also 'web site') * update for clang-format * clarify * split off the programming/submission style guide to a separate file * Updates to support ROCm 4.3 in GPU package * update and reorder the description of the process for submitting contributions * correct and clarify Python compatibility * refactor style guide and integrate text from issue * update contribution guidelines for github * mention when testing may be added * integrate file with description of include file conventions * update github workflow doc * adapt section about domain decomposition from paper * use a more compact image * add communication section * update man page with missing flags and correct URLs * improve the load imbalance viz * add section about neighbor list construction * break large file into multiple smaller files by section and add toctree * fix typo * add section about parallelization in the OPENMP package * add -skipruin to help message * add discussion of OpenMP parallelization * spelling * add section on PPPM * use larger version of FFT grid comm image * minor tweak * Update compute angle doc page * Update Singularity definitions to use ROCm 4.3 * Update CUDA container definitions to CUDA 11.4 * Update container definitions to include PLUMED 2.7.2 * Update more definition files * RHEL8/CentOS8 PowerTools is now powertools * Add Rocky Linux 8 container definition * Add omega field to numpy_wrapper detection * Return None in case of null pointer * Add more atom fields in numpy_wrapper and correct csforce size * must not clear force array. will segfault in hybrid atom styles * update example for dynamically loading LAMMPS with current library API * update example to use current library interface. No need to use the namespace. * add note to README files about age of the example * simplify building shared libs on windows * detect a few more compilers * Revert "simplify building shared libs on windows" This reverts commit fa3429ab022b6bbb680011fee9a33f0a77839e1e. * step version strings for next patch release * fix mingw 32-bit vs 64-bit craziness * detect C++20 standard * build "fat" cuda binaries only with known toolkits * spelling * Try to improve the pair style hybrid docs This specifically tries to avoid the ambiguous use of "mixing" and clarify that similar is still different when pair styles are concerned. See discussion here: https://matsci.org/t/confusion-about-mixing-and-pair-coeff-section/38317/3 * spelling * use nullptr * use symbolic constant * small optimization * use cmath header instead of math.h * use explicit scoping when virtual dispatch is not available. * cosmetic changes * simplify/optimize code * simplify * Bugfix from Trung for crashes in pppm/gpu without local atoms * fix typo * refer to "XXX Coeffs" sections consistently * small tweaks from static code analysis * fix small bug * small tweaks * simplify and modernize code a little * use correct data type for MPI calls * simplify/modernize * remove dead code * about 1.5x speedup for pair style comb3 by using MathSpecial::powint() * small performance optimization for pair style comb * simplify * modernize * simplify * removed dead code, reformat * modernize * use explicit scoping when virtual dispatch is not (yet) available * reformat for increased readability * move misplaced #endif and make code more readable * make sure err_flag is initialized * modernize * remove redundant code: all struct members are initialized to defaults in the constructor * enforce initialization and thus silence compiler warnings * fix typo * provide more comprehensive suggestions for GPU neighbor list errors * add utils::logical() function to complement the *numeric() functions * Add stable link in docs * revert modernization change (for now) * remove unused variable * include EXTRA-DUMP in "most" * small tweaks * simplify * Add log file printing of KIM search directories in 'kim init' * use clang-format on kim_init.cpp * Improve style in response to Axel's suggestions * initialize all members * format changes * simplify. use utils::strdup() more. * small corrections * apply fix from balance command to fix balance * dead code removal * reformat strings * implement utils::current_date() convenience function to reduce replicated code * update list and order of include files from include-what-you-use analysis * handle changes in GAP repo * a few remaining updates to include statements * expand mapping to handle "style_*.h" header files correctly. * add support for compilation of OpenCL loader on FreeBSD * more iwyu header updates * small correction * fix typo * a few more (final?) IWYU updates * expand tests for numeric values * return int instead of bool to minimize code changes * fix spelling issues * some applications of the new function * fix typo * Change "offsite" to "external" to correct broken URLs to lammps.org * improve error message * insert missing atom-ID * convert yes/no on/off flags in the package command(s) * update version strings * update death tests for change in error message * correctly specify the destructor function name. * apply utils::logical() to more commands * apply utils::logical() in more places * for consistency with utils::logical() * only accept lower case to be consistent with the rest of the input * a few more converted commands and updates for unit tests * modernize and fix some memory leaks * adjust for compatibility with C++20 compilers * do not downgrade C++ standard when adding the KOKKOS package * undo "risky" C++20 related changes * mention how to set the path to the fftw3_omp library * correct paths to downloaded PACE package sources in lib * Update CMake variable descriptions * possible workaround for some GPU package neighbor list issue * final chunk of changes to apply utils::logical() * update suffix command unit tests * update citation info with new LAMMPS paper reference and acknowledge it * update some formulations as suggested by @sjplimp * add check and suitable error message when fp64 is required but not available * do not call memset on a null pointer * fix string formatting bugs in fix npt/cauchy * must use a soft core potential to avoid a singularity * in floating point math a*b may be zero even if both a>0 and b>0 * use proper integer type for atom IDs * Building voro++ lib as part of LAMMPS requires the "patch" program * silence output from hwloc when launching LAMMPS * detect double precision support according to OpenCL specs (1.2 and later) * Fix bug in Kokkos pair_eam_alloy * calling fwrite() with a null pointer causes undefined behavior. avoid it. * cosmetic * apply current include file conventions * include zstd libs in windows build * update .gitignore for recent additions * make check more obvious * step version strings for stable release * Adjust for kim-api bug * cleaner variant of version check, add directory numbering * hbond comm added for rsq_hb * rsq_hb removed, exyz added (no MPI comm yet) * Fix Colvars output files not written with "run 0" See: https://github.com/Colvars/colvars/commit/ff2f0d39ee5 which fixes a bug introduced in: https://github.com/Colvars/colvars/commit/1e964a542b The message applies to NAMD, but the logic used in LAMMPS when handling "run 0" is very similar. The Colvars version string is also updated, however this commit does not include other changes, such as the following: https://github.com/Colvars/colvars/pull/419 which were not fully completed before the LAMMPS Summer 2021 finalization. * add -std=c++11 to a number of machine makefiles for traditional make build * copy request to mention lammps.org form home page instructions for citing * be more specific about what the name of the LAMMPS executable can be also provide a few more examples without a machine suffix * small tweak * remove references to USER packages, have package lists alphabetically sorted "make package-update" or "make pu" must be processed in the special order because of inter-package dependencies * make "make package-update" and "make package-overwrite" less verbose * freeze versions of pip packages for processing the manual of the stable version this way we avoid surprises in case one of the packages get updated to an incompatible new version. these are know-to-work versions. * make sure the one_coeff flag is applied to sub-styles since the check for Pair::one_coeff was moved to the Input class (to reduce redundant code), hybrid substyles could "escape" that requirement. Thus checks have to be added to the hybrid coeff() methods. * Prevent neigh list from copying "unique" stencil/bin * compiling ML-HDNNP with downloaded n2p2 lib requires the sed command * detect and error out if BLAS/LAPACK libraries variables are a list This will cause external project compilation to fail since the semi-colons are converted to blanks, but one cannot properly escape the variables. So far the only viable solution seems to be to convert the scripts from using ExternalProject_add() to FetchContent and add_subdirectory() * portability improvement * must have patch command available to compile ScaFaCoS * only need Tcl not Tk to compile Tcl swig wrapper * correctly handle Tcl stub library if available * add missing keyword * hbond_pos added, MPI and values ok, Pair time slow. * make C library example work with strict C compilers * silence compiler warnings * make Nevery keyword per-reaction * recover cross-compilation with mingw64 * reverted wrong approach from last commits - now intpos flag - hbond_pos added - (a/b)xyz WiP * lrefpos working in serial, MPI wrong * attempt to merge doubles into n(xyz)[3] * save * Update pair_oxdna_hbond.cpp * hbond now working for MPI, comming lrefpos * extracting nxyz in excv/bond working Co-authored-by: Axel Kohlmeyer Co-authored-by: Richard Berger Co-authored-by: Ryan S. Elliott Co-authored-by: Stan Gerald Moore Co-authored-by: Giacomo Fiorin Co-authored-by: Jacob Gissinger Co-authored-by: Oliver Henrich --- src/CG-DNA/bond_oxdna_fene.cpp | 3 + src/CG-DNA/pair_oxdna_coaxstk.cpp | 2 + src/CG-DNA/pair_oxdna_excv.cpp | 124 ++++++++++++++++++++++++++++-- src/CG-DNA/pair_oxdna_excv.h | 6 ++ src/CG-DNA/pair_oxdna_hbond.cpp | 68 ++++++---------- src/CG-DNA/pair_oxdna_hbond.h | 10 +-- src/CG-DNA/pair_oxdna_stk.cpp | 2 + src/CG-DNA/pair_oxdna_xstk.cpp | 2 + 8 files changed, 155 insertions(+), 62 deletions(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index 6d92e4bcb0..468878c315 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -145,6 +145,9 @@ void BondOxdnaFene::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, doub ------------------------------------------------------------------------- */ void BondOxdnaFene::compute(int eflag, int vflag) { + + //printf("\n FENE-bond HERE, proc = %d \n", comm->me); + int a, b, in, type; double delf[3], delta[3], deltb[3]; // force, torque increment;; double delr[3], ebond, fbond; diff --git a/src/CG-DNA/pair_oxdna_coaxstk.cpp b/src/CG-DNA/pair_oxdna_coaxstk.cpp index 2715b7c5e2..c7ca9f9f47 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna_coaxstk.cpp @@ -106,6 +106,8 @@ PairOxdnaCoaxstk::~PairOxdnaCoaxstk() void PairOxdnaCoaxstk::compute(int eflag, int vflag) { + + //printf("\n Coaxstk HERE, proc = %d \n", comm->me); double delf[3],delt[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair,factor_lj; diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index d41976e86c..10eb371703 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -39,6 +39,9 @@ PairOxdnaExcv::PairOxdnaExcv(LAMMPS *lmp) : Pair(lmp) { single_enable = 0; writedata = 1; + + // set comm size needed by this Pair + comm_forward = 9; } /* ---------------------------------------------------------------------- */ @@ -46,6 +49,10 @@ PairOxdnaExcv::PairOxdnaExcv(LAMMPS *lmp) : Pair(lmp) PairOxdnaExcv::~PairOxdnaExcv() { if (allocated) { + + memory->destroy(nx); + memory->destroy(ny); + memory->destroy(nz); memory->destroy(setflag); memory->destroy(cutsq); @@ -109,6 +116,8 @@ void PairOxdnaExcv::compute_interaction_sites(double e1[3], double /*e2*/[3], void PairOxdnaExcv::compute(int eflag, int vflag) { + //printf("\n ExcVol HERE, proc = %d \n", comm->me); + double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,factor_lj; double rtmp_s[3],rtmp_b[3]; @@ -119,9 +128,8 @@ void PairOxdnaExcv::compute(int eflag, int vflag) double ra_cs[3],ra_cb[3]; double rb_cs[3],rb_cb[3]; - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double *special_lj = force->special_lj; double **x = atom->x; @@ -137,7 +145,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; - int a,b,ia,ib,anum,bnum,atype,btype; + int n,a,b,in,ia,ib,anum,bnum,atype,btype; evdwl = 0.0; ev_init(eflag,vflag); @@ -146,6 +154,36 @@ void PairOxdnaExcv::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // loop over all local atoms, handle calculation of local reference frame + + if (!atom->lrefpos_flag) { + for (in = 0; in < atom->nlocal; in++) { + + int n = alist[in]; + + double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame + qn=bonus[ellipsoid[n]].quat; + MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); + + nx[n][0] = nx_temp[0]; + nx[n][1] = nx_temp[1]; + nx[n][2] = nx_temp[2]; + ny[n][0] = ny_temp[0]; + ny[n][1] = ny_temp[1]; + ny[n][2] = ny_temp[2]; + nz[n][0] = nz_temp[0]; + nz[n][1] = nz_temp[1]; + nz[n][2] = nz_temp[2]; + + //printf("\n In top: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[n][0], nx[n][1], nx[n][2], atom->tag[n]); + + atom->lrefpos_flag = 1; + } + } + + //if (newton_pair) comm->reverse_comm_pair(this); + comm->forward_comm_pair(this); // loop over pair interaction neighbors of my atoms @@ -154,8 +192,19 @@ void PairOxdnaExcv::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + //printf("\n In A loop: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[a][0], nx[a][1], nx[a][2], atom->tag[a]); + + ax[0] = nx[a][0]; + ax[1] = nx[a][1]; + ax[2] = nx[a][2]; + ay[0] = ny[a][0]; + ay[1] = ny[a][1]; + ay[2] = ny[a][2]; + az[0] = nz[a][0]; + az[1] = nz[a][1]; + az[2] = nz[a][2]; + + //printf("\n ax[0] = %f, ax[1] = %f, ax[2] = %f, id = %d", ax[0], ax[1], ax[2], atom->tag[a]); // vector COM - backbone and base site a compute_interaction_sites(ax,ay,az,ra_cs,ra_cb); @@ -179,8 +228,15 @@ void PairOxdnaExcv::compute(int eflag, int vflag) btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + bx[0] = nx[b][0]; + bx[1] = nx[b][1]; + bx[2] = nx[b][2]; + by[0] = ny[b][0]; + by[1] = ny[b][1]; + by[2] = ny[b][2]; + bz[0] = nz[b][0]; + bz[1] = nz[b][1]; + bz[2] = nz[b][2]; // vector COM - backbone and base site b compute_interaction_sites(bx,by,bz,rb_cs,rb_cb); @@ -400,6 +456,10 @@ void PairOxdnaExcv::allocate() for (int j = i; j <= n; j++) setflag[i][j] = 0; + memory->create(nx,atom->nmax,3,"pair:nx"); + memory->create(ny,atom->nmax,3,"pair:ny"); + memory->create(nz,atom->nmax,3,"pair:nz"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(epsilon_ss,n+1,n+1,"pair:epsilon_ss"); @@ -806,9 +866,57 @@ void PairOxdnaExcv::write_data_all(FILE *fp) /* ---------------------------------------------------------------------- */ +int PairOxdnaExcv::pack_forward_comm(int n, int *list, double *buf, + int /*pbc_flag*/, int * /*pbc*/) +{ + int i,j,m; + + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = nx[j][0]; + buf[m++] = nx[j][1]; + buf[m++] = nx[j][2]; + buf[m++] = ny[j][0]; + buf[m++] = ny[j][1]; + buf[m++] = ny[j][2]; + buf[m++] = nz[j][0]; + buf[m++] = nz[j][1]; + buf[m++] = nz[j][2]; + } + return m; +} + +/* ---------------------------------------------------------------------- */ + +void PairOxdnaExcv::unpack_forward_comm(int n, int first, double *buf) +{ + int i,m,last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) { + nx[i][0] = buf[m++]; + nx[i][1] = buf[m++]; + nx[i][2] = buf[m++]; + ny[i][0] = buf[m++]; + ny[i][1] = buf[m++]; + ny[i][2] = buf[m++]; + nz[i][0] = buf[m++]; + nz[i][1] = buf[m++]; + nz[i][2] = buf[m++]; + } +} + +/* ---------------------------------------------------------------------- */ + void *PairOxdnaExcv::extract(const char *str, int &dim) { dim = 2; + + if (strcmp(str,"nx") == 0) return (void *) nx; + if (strcmp(str,"ny") == 0) return (void *) ny; + if (strcmp(str,"nz") == 0) return (void *) nz; if (strcmp(str,"epsilon_ss") == 0) return (void *) epsilon_ss; if (strcmp(str,"sigma_ss") == 0) return (void *) sigma_ss; diff --git a/src/CG-DNA/pair_oxdna_excv.h b/src/CG-DNA/pair_oxdna_excv.h index c3ad6cf37a..1d2a871dd9 100644 --- a/src/CG-DNA/pair_oxdna_excv.h +++ b/src/CG-DNA/pair_oxdna_excv.h @@ -41,6 +41,9 @@ class PairOxdnaExcv : public Pair { void write_data(FILE *); void write_data_all(FILE *); void *extract(const char *, int &); + + virtual int pack_forward_comm(int, int *, double *, int, int *); + virtual void unpack_forward_comm(int, int, double *); protected: // s=sugar-phosphate backbone site, b=base site, st=stacking site @@ -52,6 +55,9 @@ class PairOxdnaExcv : public Pair { double **lj1_sb, **lj2_sb, **b_sb, **cut_sb_c, **cutsq_sb_c; double **epsilon_bb, **sigma_bb, **cut_bb_ast, **cutsq_bb_ast; double **lj1_bb, **lj2_bb, **b_bb, **cut_bb_c, **cutsq_bb_c; + + // per-atom arrays for q_to_exyz storage + double **nx, **ny, **nz; virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna_hbond.cpp b/src/CG-DNA/pair_oxdna_hbond.cpp index e268ffaded..083b60678e 100644 --- a/src/CG-DNA/pair_oxdna_hbond.cpp +++ b/src/CG-DNA/pair_oxdna_hbond.cpp @@ -192,35 +192,11 @@ void PairOxdnaHbond::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; - // loop over all local atoms, handle calculation of local reference frame - - if (atom->lrefpos_flag < atom->nmax) { - for (in = 0; in < atom->nlocal; in++) { - - int n = alist[in]; - - double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame - qn=bonus[ellipsoid[n]].quat; - MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); - - nx[n][0] = nx_temp[0]; - nx[n][1] = nx_temp[1]; - nx[n][2] = nx_temp[2]; - ny[n][0] = ny_temp[0]; - ny[n][1] = ny_temp[1]; - ny[n][2] = ny_temp[2]; - nz[n][0] = nz_temp[0]; - nz[n][1] = nz_temp[1]; - nz[n][2] = nz_temp[2]; - - //printf("\n In top: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[n][0], nx[n][1], nx[n][2], atom->tag[n]); - - atom->lrefpos_flag += 1; - } - } - - //if (newton_pair) comm->reverse_comm_pair(this); - comm->forward_comm_pair(this); + // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); // loop over pair interaction neighbors of my atoms @@ -231,11 +207,11 @@ void PairOxdnaHbond::compute(int eflag, int vflag) //printf("\n In A loop: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[a][0], nx[a][1], nx[a][2], atom->tag[a]); - ax[0] = nx[a][0]; - ax[1] = nx[a][1]; - ax[2] = nx[a][2]; + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; - ra_chb[0] = d_chb*ax[0]; + ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; ra_chb[2] = d_chb*ax[2]; @@ -252,11 +228,11 @@ void PairOxdnaHbond::compute(int eflag, int vflag) btype = type[b]; - bx[0] = nx[b][0]; - bx[1] = nx[b][1]; - bx[2] = nx[b][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; - rb_chb[0] = d_chb*bx[0]; + rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; rb_chb[2] = d_chb*bx[2]; @@ -315,15 +291,15 @@ void PairOxdnaHbond::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { - double az[3]; - double bz[3]; + double az[3]; + double bz[3]; - az[0] = nz[a][0]; - az[1] = nz[a][1]; - az[2] = nz[a][2]; - bz[0] = nz[b][0]; - bz[1] = nz[b][1]; - bz[2] = nz[b][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; @@ -1391,4 +1367,4 @@ void *PairOxdnaHbond::extract(const char *str, int &dim) if (strcmp(str,"dtheta_hb8_c") == 0) return (void *) dtheta_hb8_c; return nullptr; -} +} \ No newline at end of file diff --git a/src/CG-DNA/pair_oxdna_hbond.h b/src/CG-DNA/pair_oxdna_hbond.h index e6dc47db56..90ede130ba 100644 --- a/src/CG-DNA/pair_oxdna_hbond.h +++ b/src/CG-DNA/pair_oxdna_hbond.h @@ -41,11 +41,6 @@ class PairOxdnaHbond : public Pair { void write_data(FILE *); void write_data_all(FILE *); void *extract(const char *, int &); - - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); protected: // h-bonding interaction @@ -71,9 +66,8 @@ class PairOxdnaHbond : public Pair { double **a_hb8, **theta_hb8_0, **dtheta_hb8_ast; double **b_hb8, **dtheta_hb8_c; - - // per-atom arrays for q_to_exyz storage - double **nx, **ny, **nz; + + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage int seqdepflag; diff --git a/src/CG-DNA/pair_oxdna_stk.cpp b/src/CG-DNA/pair_oxdna_stk.cpp index 2f1a0bf1b6..62de43c284 100644 --- a/src/CG-DNA/pair_oxdna_stk.cpp +++ b/src/CG-DNA/pair_oxdna_stk.cpp @@ -214,6 +214,8 @@ void PairOxdnaStk::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, void PairOxdnaStk::compute(int eflag, int vflag) { + + //printf("\n Stk HERE, proc = %d \n", comm->me); double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair; diff --git a/src/CG-DNA/pair_oxdna_xstk.cpp b/src/CG-DNA/pair_oxdna_xstk.cpp index 447483e413..84e67666ee 100644 --- a/src/CG-DNA/pair_oxdna_xstk.cpp +++ b/src/CG-DNA/pair_oxdna_xstk.cpp @@ -112,6 +112,8 @@ PairOxdnaXstk::~PairOxdnaXstk() void PairOxdnaXstk::compute(int eflag, int vflag) { + //printf("\n Xstk HERE, proc = %d \n", comm->me); + double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair,factor_lj; double delr_hb[3],delr_hb_norm[3],rsq_hb,r_hb,rinv_hb; From cf968ef286d24d07b977879231e0afd2cb7768ad Mon Sep 17 00:00:00 2001 From: Lewis M Russell <71833891+lrussell676@users.noreply.github.com> Date: Tue, 2 Nov 2021 09:52:56 +0000 Subject: [PATCH 016/174] Intpos (#10) * hbond comm added for rsq_hb * lrefpos removed, extract scaled for oxDNA1 * Update pair_oxdna_hbond.cpp --- src/CG-DNA/bond_oxdna_fene.cpp | 29 +++--- src/CG-DNA/bond_oxdna_fene.h | 1 + src/CG-DNA/pair_oxdna_coaxstk.cpp | 36 +++++-- src/CG-DNA/pair_oxdna_coaxstk.h | 2 + src/CG-DNA/pair_oxdna_excv.cpp | 53 +++++------ src/CG-DNA/pair_oxdna_hbond.cpp | 152 ++++-------------------------- src/CG-DNA/pair_oxdna_stk.cpp | 38 ++++++-- src/CG-DNA/pair_oxdna_stk.h | 3 + src/CG-DNA/pair_oxdna_xstk.cpp | 32 +++++-- src/CG-DNA/pair_oxdna_xstk.h | 3 + src/atom.cpp | 1 - src/atom.h | 4 - 12 files changed, 148 insertions(+), 206 deletions(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index 468878c315..c46556768c 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -26,6 +26,7 @@ #include "atom_vec_ellipsoid.h" #include "math_extra.h" +#include "pair.h" #include @@ -144,9 +145,7 @@ void BondOxdnaFene::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, doub s=sugar-phosphate backbone site, b=base site, st=stacking site ------------------------------------------------------------------------- */ void BondOxdnaFene::compute(int eflag, int vflag) -{ - - //printf("\n FENE-bond HERE, proc = %d \n", comm->me); +{ int a, b, in, type; double delf[3], delta[3], deltb[3]; // force, torque increment;; @@ -155,9 +154,9 @@ void BondOxdnaFene::compute(int eflag, int vflag) double r, rr0, rr0sq; // vectors COM-backbone site in lab frame double ra_cs[3], rb_cs[3]; - - double *qa, ax[3], ay[3], az[3]; - double *qb, bx[3], by[3], bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -174,6 +173,12 @@ void BondOxdnaFene::compute(int eflag, int vflag) ebond = 0.0; ev_init(eflag, vflag); + + // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); // loop over FENE bonds @@ -183,10 +188,13 @@ void BondOxdnaFene::compute(int eflag, int vflag) b = bondlist[in][0]; type = bondlist[in][2]; - qa = bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa, ax, ay, az); - qb = bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb, bx, by, bz); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + //(a/b)y/z not needed here as oxDNA(1) co-linear // vector COM-backbone site a and b compute_interaction_sites(ax, ay, az, ra_cs); @@ -259,7 +267,6 @@ void BondOxdnaFene::compute(int eflag, int vflag) ev_tally_xyz(a, b, nlocal, newton_bond, ebond, delf[0], delf[1], delf[2], x[a][0] - x[b][0], x[a][1] - x[b][1], x[a][2] - x[b][2]); } - atom->lrefpos_flag = 0; // reset for next timestep } /* ---------------------------------------------------------------------- */ diff --git a/src/CG-DNA/bond_oxdna_fene.h b/src/CG-DNA/bond_oxdna_fene.h index 42b542a6fb..b24757781f 100644 --- a/src/CG-DNA/bond_oxdna_fene.h +++ b/src/CG-DNA/bond_oxdna_fene.h @@ -40,6 +40,7 @@ class BondOxdnaFene : public Bond { protected: double *k, *Delta, *r0; // FENE + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage void allocate(); void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); diff --git a/src/CG-DNA/pair_oxdna_coaxstk.cpp b/src/CG-DNA/pair_oxdna_coaxstk.cpp index c7ca9f9f47..f76ad33147 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna_coaxstk.cpp @@ -131,10 +131,9 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // vectors COM-backbone site, COM-stacking site in lab frame double ra_cs[3],ra_cst[3]; double rb_cs[3],rb_cst[3]; - - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -162,6 +161,12 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); // loop over pair interaction neighbors of my atoms @@ -170,8 +175,10 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + //a(y/z) not needed here as oxDNA(1) co-linear // vector COM a - stacking site a ra_cst[0] = d_cst*ax[0]; @@ -194,8 +201,10 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + //b(y/z) not needed here as oxDNA(1) co-linear // vector COM b - stacking site b rb_cst[0] = d_cst*bx[0]; @@ -246,6 +255,13 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // early rejection criterium if (f4t1) { + + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; @@ -382,6 +398,10 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // cosphi3 and cosphi4 (=cosphi3) force and virial if (cosphi3) { + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; + finc = -f2 * f4t1* f4t4 * f4t5 * f4t6 * 2.0 * f5c3 * df5c3 * factor_lj; fpair += finc; diff --git a/src/CG-DNA/pair_oxdna_coaxstk.h b/src/CG-DNA/pair_oxdna_coaxstk.h index 5771bbe592..d634ccdf00 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.h +++ b/src/CG-DNA/pair_oxdna_coaxstk.h @@ -62,6 +62,8 @@ class PairOxdnaCoaxstk : public Pair { double **a_cxst3p, **cosphi_cxst3p_ast, **b_cxst3p, **cosphi_cxst3p_c; double **a_cxst4p, **cosphi_cxst4p_ast, **b_cxst4p, **cosphi_cxst4p_c; + + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index 10eb371703..2edad16c83 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -127,9 +127,10 @@ void PairOxdnaExcv::compute(int eflag, int vflag) // vectors COM-backbone site, COM-base site in lab frame double ra_cs[3],ra_cb[3]; double rb_cs[3],rb_cb[3]; - + // Cartesian unit vectors in lab frame double ax[3],ay[3],az[3]; double bx[3],by[3],bz[3]; + double *special_lj = force->special_lj; double **x = atom->x; @@ -157,32 +158,26 @@ void PairOxdnaExcv::compute(int eflag, int vflag) // loop over all local atoms, handle calculation of local reference frame - if (!atom->lrefpos_flag) { - for (in = 0; in < atom->nlocal; in++) { - - int n = alist[in]; - - double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame - qn=bonus[ellipsoid[n]].quat; - MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); - - nx[n][0] = nx_temp[0]; - nx[n][1] = nx_temp[1]; - nx[n][2] = nx_temp[2]; - ny[n][0] = ny_temp[0]; - ny[n][1] = ny_temp[1]; - ny[n][2] = ny_temp[2]; - nz[n][0] = nz_temp[0]; - nz[n][1] = nz_temp[1]; - nz[n][2] = nz_temp[2]; - - //printf("\n In top: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[n][0], nx[n][1], nx[n][2], atom->tag[n]); - - atom->lrefpos_flag = 1; - } + for (in = 0; in < atom->nlocal; in++) { + + int n = alist[in]; + + double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame + qn=bonus[ellipsoid[n]].quat; + MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); + + nx[n][0] = nx_temp[0]; + nx[n][1] = nx_temp[1]; + nx[n][2] = nx_temp[2]; + ny[n][0] = ny_temp[0]; + ny[n][1] = ny_temp[1]; + ny[n][2] = ny_temp[2]; + nz[n][0] = nz_temp[0]; + nz[n][1] = nz_temp[1]; + nz[n][2] = nz_temp[2]; + } - //if (newton_pair) comm->reverse_comm_pair(this); comm->forward_comm_pair(this); // loop over pair interaction neighbors of my atoms @@ -190,9 +185,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) for (ia = 0; ia < anum; ia++) { a = alist[ia]; - atype = type[a]; - - //printf("\n In A loop: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[a][0], nx[a][1], nx[a][2], atom->tag[a]); + atype = type[a]; ax[0] = nx[a][0]; ax[1] = nx[a][1]; @@ -202,9 +195,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) ay[2] = ny[a][2]; az[0] = nz[a][0]; az[1] = nz[a][1]; - az[2] = nz[a][2]; - - //printf("\n ax[0] = %f, ax[1] = %f, ax[2] = %f, id = %d", ax[0], ax[1], ax[2], atom->tag[a]); + az[2] = nz[a][2]; // vector COM - backbone and base site a compute_interaction_sites(ax,ay,az,ra_cs,ra_cb); diff --git a/src/CG-DNA/pair_oxdna_hbond.cpp b/src/CG-DNA/pair_oxdna_hbond.cpp index 083b60678e..f4baa74787 100644 --- a/src/CG-DNA/pair_oxdna_hbond.cpp +++ b/src/CG-DNA/pair_oxdna_hbond.cpp @@ -62,11 +62,6 @@ PairOxdnaHbond::PairOxdnaHbond(LAMMPS *lmp) : Pair(lmp) alpha_hb[3][1] = 1.00000; alpha_hb[3][2] = 1.00000; alpha_hb[3][3] = 1.00000; - - // set comm size needed by this Pair - - comm_forward = 9; - comm_reverse = 9; } @@ -74,12 +69,7 @@ PairOxdnaHbond::PairOxdnaHbond(LAMMPS *lmp) : Pair(lmp) PairOxdnaHbond::~PairOxdnaHbond() { - if (allocated) { - - memory->destroy(nx); - memory->destroy(ny); - memory->destroy(nz); memory->destroy(setflag); memory->destroy(cutsq); @@ -158,11 +148,9 @@ void PairOxdnaHbond::compute(int eflag, int vflag) double d_chb=+0.4; // vectors COM-h-bonding site in lab frame double ra_chb[3],rb_chb[3]; - // Cartesian unit vectors in lab frame - // Only (a/b)x required here - double ax[3]; - double bx[3]; + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -178,7 +166,7 @@ void PairOxdnaHbond::compute(int eflag, int vflag) AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; - int n,a,b,in,ia,ib,anum,bnum,atype,btype; + int a,b,ia,ib,anum,bnum,atype,btype; double f1,f4t1,f4t4,f4t2,f4t3,f4t7,f4t8; double df1,df4t1,df4t4,df4t2,df4t3,df4t7,df4t8; @@ -186,7 +174,6 @@ void PairOxdnaHbond::compute(int eflag, int vflag) evdwl = 0.0; ev_init(eflag,vflag); - nlocal = atom->nlocal; anum = list->inum; alist = list->ilist; numneigh = list->numneigh; @@ -205,17 +192,13 @@ void PairOxdnaHbond::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - //printf("\n In A loop: nx[0] = %f, nx[1] = %f, nx[2] = %f, id = %d", nx[a][0], nx[a][1], nx[a][2], atom->tag[a]); - ax[0] = nx_xtrct[a][0]; - ax[1] = nx_xtrct[a][1]; - ax[2] = nx_xtrct[a][2]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; - ra_chb[0] = d_chb*ax[0]; + ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; ra_chb[2] = d_chb*ax[2]; - - //printf("\n ax[0] = %f, ax[1] = %f, ax[2] = %f, id = %d", ax[0], ax[1], ax[2], atom->tag[a]); blist = firstneigh[a]; bnum = numneigh[a]; @@ -228,16 +211,14 @@ void PairOxdnaHbond::compute(int eflag, int vflag) btype = type[b]; - bx[0] = nx_xtrct[b][0]; - bx[1] = nx_xtrct[b][1]; - bx[2] = nx_xtrct[b][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; - rb_chb[0] = d_chb*bx[0]; + rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; rb_chb[2] = d_chb*bx[2]; - //printf("\n bx[0] = %f, bx[1] = %f, bx[2] = %f, id = %d", bx[0], bx[1], bx[2], atom->tag[b]); - // vector h-bonding site b to a delr_hb[0] = x[a][0] + ra_chb[0] - x[b][0] - rb_chb[0]; delr_hb[1] = x[a][1] + ra_chb[1] - x[b][1] - rb_chb[1]; @@ -289,17 +270,14 @@ void PairOxdnaHbond::compute(int eflag, int vflag) b_hb3[atype][btype], dtheta_hb3_c[atype][btype]); // early rejection criterium - if (f4t3) { + if (f4t3) { - double az[3]; - double bz[3]; - - az[0] = nz_xtrct[a][0]; - az[1] = nz_xtrct[a][1]; - az[2] = nz_xtrct[a][2]; - bz[0] = nz_xtrct[b][0]; - bz[1] = nz_xtrct[b][1]; - bz[2] = nz_xtrct[b][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; @@ -596,10 +574,6 @@ void PairOxdnaHbond::allocate() for (int j = i; j <= n; j++) setflag[i][j] = 0; - memory->create(nx,atom->nmax,3,"pair:nx"); - memory->create(ny,atom->nmax,3,"pair:ny"); - memory->create(nz,atom->nmax,3,"pair:nz"); - memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(epsilon_hb,n+1,n+1,"pair:epsilon_hb"); @@ -1222,102 +1196,10 @@ void PairOxdnaHbond::write_data_all(FILE *fp) /* ---------------------------------------------------------------------- */ -int PairOxdnaHbond::pack_forward_comm(int n, int *list, double *buf, - int /*pbc_flag*/, int * /*pbc*/) -{ - int i,j,m; - - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = nx[j][0]; - buf[m++] = nx[j][1]; - buf[m++] = nx[j][2]; - buf[m++] = ny[j][0]; - buf[m++] = ny[j][1]; - buf[m++] = ny[j][2]; - buf[m++] = nz[j][0]; - buf[m++] = nz[j][1]; - buf[m++] = nz[j][2]; - } - return m; -} - -/* ---------------------------------------------------------------------- */ - -void PairOxdnaHbond::unpack_forward_comm(int n, int first, double *buf) -{ - int i,m,last; - - m = 0; - last = first + n; - for (i = first; i < last; i++) { - nx[i][0] = buf[m++]; - nx[i][1] = buf[m++]; - nx[i][2] = buf[m++]; - ny[i][0] = buf[m++]; - ny[i][1] = buf[m++]; - ny[i][2] = buf[m++]; - nz[i][0] = buf[m++]; - nz[i][1] = buf[m++]; - nz[i][2] = buf[m++]; - } -} - -/* ---------------------------------------------------------------------- */ - -int PairOxdnaHbond::pack_reverse_comm(int n, int first, double *buf) -{ - int i,m,last; - - m = 0; - last = first + n; - for (i = first; i < last; i++) { - buf[m++] = nx[i][0]; - buf[m++] = nx[i][1]; - buf[m++] = nx[i][2]; - buf[m++] = ny[i][0]; - buf[m++] = ny[i][1]; - buf[m++] = ny[i][2]; - buf[m++] = nz[i][0]; - buf[m++] = nz[i][1]; - buf[m++] = nz[i][2]; - } - return m; -} - -/* ---------------------------------------------------------------------- */ - -void PairOxdnaHbond::unpack_reverse_comm(int n, int *list, double *buf) -{ - int i,j,m; - - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - nx[j][0] += buf[m++]; - nx[j][1] += buf[m++]; - nx[j][2] += buf[m++]; - ny[j][0] += buf[m++]; - ny[j][1] += buf[m++]; - ny[j][2] += buf[m++]; - nz[j][0] += buf[m++]; - nz[j][1] += buf[m++]; - nz[j][2] += buf[m++]; - - } -} - -/* ---------------------------------------------------------------------- */ - void *PairOxdnaHbond::extract(const char *str, int &dim) { dim = 2; - if (strcmp(str,"nx") == 0) return (void *) nx; - if (strcmp(str,"ny") == 0) return (void *) ny; - if (strcmp(str,"nz") == 0) return (void *) nz; - if (strcmp(str,"epsilon_hb") == 0) return (void *) epsilon_hb; if (strcmp(str,"a_hb") == 0) return (void *) a_hb; if (strcmp(str,"cut_hb_0") == 0) return (void *) cut_hb_0; diff --git a/src/CG-DNA/pair_oxdna_stk.cpp b/src/CG-DNA/pair_oxdna_stk.cpp index ab9152a8d7..f156062463 100644 --- a/src/CG-DNA/pair_oxdna_stk.cpp +++ b/src/CG-DNA/pair_oxdna_stk.cpp @@ -229,10 +229,9 @@ void PairOxdnaStk::compute(int eflag, int vflag) // vectors COM-backbone site, COM-stacking site in lab frame double ra_cs[3],ra_cst[3]; double rb_cs[3],rb_cst[3]; - - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -258,6 +257,12 @@ void PairOxdnaStk::compute(int eflag, int vflag) evdwl = 0.0; ev_init(eflag,vflag); + + // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); // loop over stacking interaction neighbors using bond topology @@ -277,10 +282,13 @@ void PairOxdnaStk::compute(int eflag, int vflag) // a now in 3' direction, b in 5' direction - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + //(a/b)y/z not needed here as oxDNA(1) co-linear // vector COM a - stacking site a ra_cst[0] = d_cst*ax[0]; @@ -337,6 +345,13 @@ void PairOxdnaStk::compute(int eflag, int vflag) // early rejection criterium if (f1) { + + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; // theta4 angle and correction cost4 = MathExtra::dot3(bz,az); @@ -361,6 +376,13 @@ void PairOxdnaStk::compute(int eflag, int vflag) // early rejection criterium if (f4t5) { + + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; + by[0] = ny_xtrct[b][0]; + by[1] = ny_xtrct[b][1]; + by[2] = ny_xtrct[b][2]; cost6p = MathExtra::dot3(delr_st_norm,az); if (cost6p > 1.0) cost6p = 1.0; diff --git a/src/CG-DNA/pair_oxdna_stk.h b/src/CG-DNA/pair_oxdna_stk.h index 8695f8fd36..ada5cdcc6a 100644 --- a/src/CG-DNA/pair_oxdna_stk.h +++ b/src/CG-DNA/pair_oxdna_stk.h @@ -59,6 +59,9 @@ class PairOxdnaStk : public Pair { double **b_st6, **dtheta_st6_c; double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; + + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + int seqdepflag; diff --git a/src/CG-DNA/pair_oxdna_xstk.cpp b/src/CG-DNA/pair_oxdna_xstk.cpp index 84e67666ee..046659e5c6 100644 --- a/src/CG-DNA/pair_oxdna_xstk.cpp +++ b/src/CG-DNA/pair_oxdna_xstk.cpp @@ -128,10 +128,9 @@ void PairOxdnaXstk::compute(int eflag, int vflag) double d_chb=+0.4; // vectors COM-h-bonding site in lab frame double ra_chb[3],rb_chb[3]; - - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -159,6 +158,12 @@ void PairOxdnaXstk::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; + + // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); // loop over pair interaction neighbors of my atoms @@ -167,8 +172,10 @@ void PairOxdnaXstk::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + //a(y/z) not needed here as oxDNA(1) co-linear ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; @@ -185,8 +192,10 @@ void PairOxdnaXstk::compute(int eflag, int vflag) btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + //b(y/z) not needed here as oxDNA(1) co-linear rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; @@ -244,6 +253,13 @@ void PairOxdnaXstk::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { + + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; diff --git a/src/CG-DNA/pair_oxdna_xstk.h b/src/CG-DNA/pair_oxdna_xstk.h index 30089f53fb..c450755356 100644 --- a/src/CG-DNA/pair_oxdna_xstk.h +++ b/src/CG-DNA/pair_oxdna_xstk.h @@ -65,6 +65,9 @@ class PairOxdnaXstk : public Pair { double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; + + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + virtual void allocate(); }; diff --git a/src/atom.cpp b/src/atom.cpp index d368ce7f85..8bf361ab95 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -650,7 +650,6 @@ void Atom::set_atomflag_defaults() rho_flag = esph_flag = cv_flag = vest_flag = 0; dpd_flag = edpd_flag = tdpd_flag = 0; sp_flag = 0; - lrefpos_flag = 0; x0_flag = 0; smd_flag = damage_flag = 0; mesont_flag = 0; diff --git a/src/atom.h b/src/atom.h index b37e0e49e0..25a56de1c4 100644 --- a/src/atom.h +++ b/src/atom.h @@ -190,10 +190,6 @@ class Atom : protected Pointers { // SPIN package int sp_flag; - - // CG-DNA package - - int lrefpos_flag; // MACHDYN package From 7ba211a72771e377a0a8b39f7bb060aed6cad169 Mon Sep 17 00:00:00 2001 From: Sievers Date: Tue, 2 Nov 2021 21:57:55 -0700 Subject: [PATCH 017/174] Update dynamical matrix format --- src/PHONON/dynamical_matrix.cpp | 786 ++++++++++++++++---------------- src/PHONON/dynamical_matrix.h | 42 +- 2 files changed, 414 insertions(+), 414 deletions(-) diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index 18197de52e..d33a2dde2d 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://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 @@ -36,6 +37,7 @@ #include "timer.h" #include "update.h" +#include #include #include @@ -46,16 +48,19 @@ enum{REGULAR,ESKM}; DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Command(lmp), fp(nullptr) { - external_force_clear = 1; + external_force_clear = 1; } /* ---------------------------------------------------------------------- */ DynamicalMatrix::~DynamicalMatrix() { - if (fp && comm->me == 0) fclose(fp); - memory->destroy(groupmap); - fp = nullptr; + if (fp && comm->me == 0) { + if (compressed) platform::pclose(fp); + else fclose(fp); + memory->destroy(groupmap); + fp = nullptr; + } } /* ---------------------------------------------------------------------- @@ -66,116 +71,116 @@ DynamicalMatrix::~DynamicalMatrix() void DynamicalMatrix::setup() { - // setup domain, communication and neighboring - // acquire ghosts - // build neighbor lists - if (triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - comm->setup(); - if (neighbor->style) neighbor->setup_bins(); - comm->exchange(); - comm->borders(); - if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); - domain->image_check(); - domain->box_too_small_check(); - neighbor->build(1); + // setup domain, communication and neighboring + // acquire ghosts + // build neighbor lists + if (triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + comm->setup(); + if (neighbor->style) neighbor->setup_bins(); + comm->exchange(); + comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + domain->image_check(); + domain->box_too_small_check(); + neighbor->build(1); - // compute all forces - external_force_clear = 0; - eflag=0; - vflag=0; - update_force(); + // compute all forces + external_force_clear = 0; + eflag=0; + vflag=0; + update_force(); - modify->setup(vflag); - update->setupflag = 0; + modify->setup(vflag); + update->setupflag = 0; - //if all then skip communication groupmap population - if (gcount == atom->natoms) - for (bigint i=0; i < atom->natoms; i++) - groupmap[i] = i; - else - create_groupmap(); + //if all then skip communication groupmap population + if (gcount == atom->natoms) + for (bigint i=0; inatoms; i++) + groupmap[i] = i; + else + create_groupmap(); } /* ---------------------------------------------------------------------- */ void DynamicalMatrix::command(int narg, char **arg) { - if (domain->box_exist == 0) - error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); - if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); + if (domain->box_exist == 0) + error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); + if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); - lmp->init(); + lmp->init(); - // orthogonal vs triclinic simulation box + // orthogonal vs triclinic simulation box - triclinic = domain->triclinic; + triclinic = domain->triclinic; - if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; - else pair_compute_flag = 0; - if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; - else kspace_compute_flag = 0; + if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; + else pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; + else kspace_compute_flag = 0; - // group and style + // group and style - igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); - groupbit = group->bitmask[igroup]; - gcount = group->count(igroup); - dynlen = (gcount)*3; - memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); - update->setupflag = 1; + igroup = group->find(arg[0]); + if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); + groupbit = group->bitmask[igroup]; + gcount = group->count(igroup); + dynlen = (gcount)*3; + memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); + update->setupflag = 1; - int style = -1; - if (strcmp(arg[1],"regular") == 0) style = REGULAR; - else if (strcmp(arg[1],"eskm") == 0) style = ESKM; - else error->all(FLERR,"Illegal dynamical_matrix command"); - del = utils::numeric(FLERR, arg[2],false,lmp); + int style = -1; + if (strcmp(arg[1],"regular") == 0) style = REGULAR; + else if (strcmp(arg[1],"eskm") == 0) style = ESKM; + else error->all(FLERR,"Illegal dynamical_matrix command"); + del = utils::numeric(FLERR, arg[2],false,lmp); - // set option defaults + // set option defaults - binaryflag = 0; - scaleflag = 0; - compressed = 0; - file_flag = 0; - file_opened = 0; - folded = 0; - conversion = 1; + binaryflag = 0; + scaleflag = 0; + compressed = 0; + file_flag = 0; + file_opened = 0; + folded = 0; + conversion = 1; - // read options from end of input line - if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK - else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK - else error->all(FLERR,"Illegal dynamical_matrix command"); + // read options from end of input line + if (style == REGULAR) options(narg-3,&arg[3]); + else if (style == ESKM) options(narg-3,&arg[3]); + else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); - if (!folded) dynlenb = dynlen; - else dynlenb = (atom->natoms)*3; + if (!folded) dynlenb = dynlen; + else dynlenb = (atom->natoms)*3; - if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"Dynamical_matrix command requires an atom map"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR,"Dynamical_matrix command requires an atom map"); - // move atoms by 3-vector or specified variable(s) + // move atoms by 3-vector or specified variable(s) - if (style == REGULAR) { - setup(); - timer->init(); - timer->barrier_start(); - calculateMatrix(); - timer->barrier_stop(); - } + if (style == REGULAR) { + setup(); + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } - if (style == ESKM) { - setup(); - convert_units(update->unit_style); - conversion = conv_energy/conv_distance/conv_mass; - timer->init(); - timer->barrier_start(); - calculateMatrix(); - timer->barrier_stop(); - } + if (style == ESKM) { + setup(); + convert_units(update->unit_style); + conversion = conv_energy/conv_distance/conv_mass; + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } - Finish finish(lmp); - finish.end(1); + Finish finish(lmp); + finish.end(1); } /* ---------------------------------------------------------------------- @@ -184,70 +189,66 @@ void DynamicalMatrix::command(int narg, char **arg) void DynamicalMatrix::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); - int iarg = 0; - const char* filename = "dynmat.dyn"; - while (iarg < narg) { - if (strcmp(arg[iarg],"binary") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - if (strcmp(arg[iarg+1],"gzip") == 0) { - compressed = 1; - } else if (strcmp(arg[iarg+1],"yes") == 0) { - binaryflag = 1; - } - iarg += 2; - } else if (strcmp(arg[iarg],"file") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - filename = arg[iarg + 1]; - file_flag = 1; - iarg += 2; - } else if (strcmp(arg[iarg],"fold") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - if (strcmp(arg[iarg+1],"yes") == 0) { - folded = 1; - } else if (strcmp(arg[iarg+1],"no") == 0) { - folded = 0; - } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); - iarg += 2; - } else error->all(FLERR,"Illegal dynamical_matrix command"); - } - if (file_flag == 1) { - openfile(filename); - } + if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); + int iarg = 0; + const char* filename = "dynmat.dyn"; + + while (iarg < narg) { + if (strcmp(arg[iarg],"binary") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"gzip") == 0) { + compressed = 1; + } else { + binaryflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + } + iarg += 2; + } else if (strcmp(arg[iarg],"file") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + filename = arg[iarg + 1]; + file_flag = 1; + iarg += 2; + } else if (strcmp(arg[iarg],"fold") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"yes") == 0) { + folded = 1; + } else if (strcmp(arg[iarg+1],"no") == 0) { + folded = 0; + } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + iarg += 2; + } else error->all(FLERR,"Illegal dynamical_matrix command"); + } + if (file_flag == 1) { + openfile(filename); + } } /* ---------------------------------------------------------------------- generic opening of a file - ASCII or binary or gzipped + ASCII or binary or compressed some derived classes override this function ------------------------------------------------------------------------- */ -void DynamicalMatrix::openfile(const char* filename) +void DynamicalMatrix::openfile(const char *filename) { - // if file already opened, return - if (file_opened) return; + // if file already opened, return + if (file_opened) return; + fp = nullptr; - if (compressed) { -#ifdef LAMMPS_GZIP - char gzip[128]; - sprintf(gzip,"gzip -6 > %s",filename); -#ifdef _WIN32 - fp = _popen(gzip,"wb"); -#else - fp = popen(gzip,"w"); -#endif -#else - error->one(FLERR,"Cannot open gzipped file"); -#endif - } else if (binaryflag) { - fp = fopen(filename,"wb"); - } else { - fp = fopen(filename,"w"); - } + if (comm->me == 0) { + if (compressed) { + fp = platform::compressed_write(std::string(filename)+".gz"); + if (!fp) error->one(FLERR,"Cannot open compressed file"); + } else if (binaryflag) { + fp = fopen(filename,"wb"); + } else { + fp = fopen(filename,"w"); + } + if (!fp) error->one(FLERR,"Cannot open dynmat file: {}", utils::getsyserror()); + } - if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); - file_opened = 1; + file_opened = 1; } /* ---------------------------------------------------------------------- @@ -256,112 +257,112 @@ void DynamicalMatrix::openfile(const char* filename) void DynamicalMatrix::calculateMatrix() { - int local_idx; // local index - int local_jdx; // second local index - int nlocal = atom->nlocal; - bigint natoms = atom->natoms; - int *type = atom->type; - bigint *gm = groupmap; - double imass; // dynamical matrix element - double *m = atom->mass; - double **f = atom->f; + int local_idx; // local index + int local_jdx; // second local index + int nlocal = atom->nlocal; + bigint natoms = atom->natoms; + int *type = atom->type; + bigint *gm = groupmap; + double imass; // dynamical matrix element + double *m = atom->mass; + double **f = atom->f; - double **dynmat = new double*[3]; - for (int i=0; i<3; i++) - dynmat[i] = new double[dynlenb]; + double **dynmat = new double*[3]; + for (int i=0; i<3; i++) + dynmat[i] = new double[dynlenb]; - double **fdynmat = new double*[3]; - for (int i=0; i<3; i++) - fdynmat[i] = new double[dynlenb]; + double **fdynmat = new double*[3]; + for (int i=0; i<3; i++) + fdynmat[i] = new double[dynlenb]; - //initialize dynmat to all zeros - dynmat_clear(dynmat); - - if (comm->me == 0) { - utils::logmesg(lmp,fmt::format("Calculating Dynamical Matrix ...\n")); - utils::logmesg(lmp,fmt::format(" Total # of atoms = {}\n", natoms)); - utils::logmesg(lmp,fmt::format(" Atoms in group = {}\n", gcount)); - utils::logmesg(lmp,fmt::format(" Total dynamical matrix elements = {}\n", (dynlenb*dynlen))); - } - - // emit dynlen rows of dimalpha*dynlen*dimbeta elements - - update->nsteps = 0; - int prog = 0; - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if (gm[i-1] < 0) - continue; - for (int alpha=0; alpha<3; alpha++) { - displace_atom(local_idx, alpha, 1); - update_force(); - for (bigint j=1; j<=natoms; j++) { - local_jdx = atom->map(j); - if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && (gm[j-1] >= 0 || folded)){ - if (folded) { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; - } - } else { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; - } - } - } - } - displace_atom(local_idx,alpha,-2); - update_force(); - for (bigint j=1; j<=natoms; j++) { - local_jdx = atom->map(j); - if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && (gm[j-1] >= 0 || folded)){ - if (atom->rmass_flag == 1) - imass = sqrt(m[local_idx] * m[local_jdx]); - else - imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); - if (folded){ - for (int beta=0; beta<3; beta++){ - dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); - dynmat[alpha][(j-1)*3+beta] *= conversion; - } - } else { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); - dynmat[alpha][gm[j-1]*3+beta] *= conversion; - } - } - } - } - displace_atom(local_idx,alpha,1); - } - for (int k=0; k<3; k++) - MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (comm->me == 0) - writeMatrix(fdynmat); + //initialize dynmat to all zeros dynmat_clear(dynmat); + if (comm->me == 0 && screen) { - int p = 10 * gm[i-1] / gcount; - if (p > prog) { - prog = p; - fprintf(screen," %d%%",p*10); - fflush(screen); - } + fprintf(screen,"Calculating Dynamical Matrix ...\n"); + fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); + fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); + fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlen*dynlen) ); } - } - if (comm->me == 0 && screen) fprintf(screen,"\n"); - for (int i=0; i < 3; i++) - delete [] dynmat[i]; - delete [] dynmat; + // emit dynlen rows of dimalpha*dynlen*dimbeta elements - for (int i=0; i < 3; i++) - delete [] fdynmat[i]; - delete [] fdynmat; + update->nsteps = 0; + int prog = 0; + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if (gm[i-1] < 0) + continue; + for (int alpha=0; alpha<3; alpha++) { + displace_atom(local_idx, alpha, 1); + update_force(); + for (bigint j=1; j<=natoms; j++) { + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && (gm[j-1] >= 0 || folded)){ + if (folded) { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; + } + } else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; + } + } + } + } + displace_atom(local_idx,alpha,-2); + update_force(); + for (bigint j=1; j<=natoms; j++) { + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && (gm[j-1] >= 0 || folded)){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); + if (folded){ + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); + dynmat[alpha][(j-1)*3+beta] *= conversion; + } + } else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); + dynmat[alpha][gm[j-1]*3+beta] *= conversion; + } + } + } + } + displace_atom(local_idx,alpha,1); + } + for (int k=0; k<3; k++) + MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); + if (comm->me == 0) + writeMatrix(fdynmat); + dynmat_clear(dynmat); + if (comm->me == 0 && screen) { + int p = 10 * gm[i-1] / gcount; + if (p > prog) { + prog = p; + fprintf(screen," %d%%",p*10); + fflush(screen); + } + } + } + if (comm->me == 0 && screen) fprintf(screen,"\n"); - if (screen && comm->me ==0) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); + for (int i=0; i < 3; i++) + delete [] dynmat[i]; + delete [] dynmat; + + for (int i=0; i < 3; i++) + delete [] fdynmat[i]; + delete [] fdynmat; + + if (screen && comm->me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); } /* ---------------------------------------------------------------------- @@ -370,26 +371,25 @@ void DynamicalMatrix::calculateMatrix() void DynamicalMatrix::writeMatrix(double **dynmat) { - if (comm->me != 0 || !fp) - return; + if (comm->me != 0 || !fp) + return; - clearerr(fp); - if (binaryflag) { - for (int i=0; i<3; i++) - fwrite(dynmat[i], sizeof(double), dynlenb, fp); - if (ferror(fp)) - error->one(FLERR, "Error writing to binary file"); - } else { - for (int i = 0; i < 3; i++) { - for (bigint j = 0; j < dynlenb; j++) { - fmt::print(fp, "{:.8f}", dynmat[i][j]); - if ((j+1)%3==0) fputs("\n",fp); - else fputs(" ",fp); + clearerr(fp); + if (binaryflag) { + for (int i=0; i<3; i++) + fwrite(dynmat[i], sizeof(double), dynlenb, fp); + if (ferror(fp)) + error->one(FLERR, "Error writing to binary file"); + } else { + for (int i = 0; i < 3; i++) { + for (bigint j = 0; j < dynlenb; j++) { + if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); + else fprintf(fp, "%4.8f ",dynmat[i][j]); + } } + if (ferror(fp)) + error->one(FLERR,"Error writing to file"); } - if (ferror(fp)) - error->one(FLERR,"Error writing to file"); - } } /* ---------------------------------------------------------------------- @@ -398,18 +398,18 @@ void DynamicalMatrix::writeMatrix(double **dynmat) void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) { - if (local_idx < 0) return; + if (local_idx < 0) return; - double **x = atom->x; - int *sametag = atom->sametag; - int j = local_idx; + double **x = atom->x; + int *sametag = atom->sametag; + int j = local_idx; - x[local_idx][direction] += del*magnitude; + x[local_idx][direction] += del*magnitude; - while (sametag[j] >= 0) { - j = sametag[j]; - x[j][direction] += del*magnitude; - } + while (sametag[j] >= 0) { + j = sametag[j]; + x[j][direction] += del*magnitude; + } } @@ -423,35 +423,35 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { - force_clear(); - int n_post_force = modify->n_post_force; + force_clear(); + int n_post_force = modify->n_post_force; - if (pair_compute_flag) { - force->pair->compute(eflag,vflag); - timer->stamp(Timer::PAIR); - } - if (atom->molecular != Atom::ATOMIC) { - if (force->bond) force->bond->compute(eflag,vflag); - if (force->angle) force->angle->compute(eflag,vflag); - if (force->dihedral) force->dihedral->compute(eflag,vflag); - if (force->improper) force->improper->compute(eflag,vflag); - timer->stamp(Timer::BOND); - } - if (kspace_compute_flag) { - force->kspace->compute(eflag,vflag); - timer->stamp(Timer::KSPACE); - } - if (force->newton) { - comm->reverse_comm(); - timer->stamp(Timer::COMM); - } + if (pair_compute_flag) { + force->pair->compute(eflag,vflag); + timer->stamp(Timer::PAIR); + } + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag,vflag); + if (force->angle) force->angle->compute(eflag,vflag); + if (force->dihedral) force->dihedral->compute(eflag,vflag); + if (force->improper) force->improper->compute(eflag,vflag); + timer->stamp(Timer::BOND); + } + if (kspace_compute_flag) { + force->kspace->compute(eflag,vflag); + timer->stamp(Timer::KSPACE); + } + if (force->newton) { + comm->reverse_comm(); + timer->stamp(Timer::COMM); + } - // force modifications + // force modifications - if (n_post_force) modify->post_force(vflag); - timer->stamp(Timer::MODIFY); + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); - ++ update->nsteps; + ++ update->nsteps; } /* ---------------------------------------------------------------------- @@ -461,17 +461,17 @@ void DynamicalMatrix::update_force() void DynamicalMatrix::force_clear() { - if (external_force_clear) return; + if (external_force_clear) return; - // clear global force array - // if either newton flag is set, also include ghosts + // clear global force array + // if either newton flag is set, also include ghosts - size_t nbytes = sizeof(double) * atom->nlocal; - if (force->newton) nbytes += sizeof(double) * atom->nghost; + size_t nbytes = sizeof(double) * atom->nlocal; + if (force->newton) nbytes += sizeof(double) * atom->nghost; - if (nbytes) { - memset(&atom->f[0][0],0,3*nbytes); - } + if (nbytes) { + memset(&atom->f[0][0],0,3*nbytes); + } } /* ---------------------------------------------------------------------- @@ -493,54 +493,54 @@ void DynamicalMatrix::dynmat_clear(double **dynmat) void DynamicalMatrix::convert_units(const char *style) { - // physical constants from: - // https://physics.nist.gov/cuu/Constants/Table/allascii.txt - // using thermochemical calorie = 4.184 J + // physical constants from: + // https://physics.nist.gov/cuu/Constants/Table/allascii.txt + // using thermochemical calorie = 4.184 J - if (strcmp(style,"lj") == 0) { - error->all(FLERR,"Conversion Not Set"); - //conversion = 1; // lj -> 10 J/mol + if (strcmp(style,"lj") == 0) { + error->all(FLERR,"Conversion Not Set"); + //conversion = 1; // lj -> 10 J/mol - } else if (strcmp(style,"real") == 0) { - conv_energy = 418.4; // kcal/mol -> 10 J/mol - conv_mass = 1; // g/mol -> g/mol - conv_distance = 1; // angstrom -> angstrom + } else if (strcmp(style,"real") == 0) { + conv_energy = 418.4; // kcal/mol -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom - } else if (strcmp(style,"metal") == 0) { - conv_energy = 9648.5; // eV -> 10 J/mol - conv_mass = 1; // g/mol -> g/mol - conv_distance = 1; // angstrom -> angstrom + } else if (strcmp(style,"metal") == 0) { + conv_energy = 9648.5; // eV -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom - } else if (strcmp(style,"si") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); - conv_energy = 6.022E22; // J -> 10 J/mol - conv_mass = 6.022E26; // kg -> g/mol - conv_distance = 1E-10; // meter -> angstrom + } else if (strcmp(style,"si") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E22; // J -> 10 J/mol + conv_mass = 6.022E26; // kg -> g/mol + conv_distance = 1E-10; // meter -> angstrom - } else if (strcmp(style,"cgs") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); - conv_energy = 6.022E12; // Erg -> 10 J/mol - conv_mass = 6.022E23; // g -> g/mol - conv_distance = 1E-7; // centimeter -> angstrom + } else if (strcmp(style,"cgs") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E12; // Erg -> 10 J/mol + conv_mass = 6.022E23; // g -> g/mol + conv_distance = 1E-7; // centimeter -> angstrom - } else if (strcmp(style,"electron") == 0) { - conv_energy = 262550; // Hartree -> 10 J/mol - conv_mass = 1; // amu -> g/mol - conv_distance = 0.529177249; // bohr -> angstrom + } else if (strcmp(style,"electron") == 0) { + conv_energy = 262550; // Hartree -> 10 J/mol + conv_mass = 1; // amu -> g/mol + conv_distance = 0.529177249; // bohr -> angstrom - } else if (strcmp(style,"micro") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); - conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol - conv_mass = 6.022E11; // pg -> g/mol - conv_distance = 1E-4; // micrometer -> angstrom + } else if (strcmp(style,"micro") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol + conv_mass = 6.022E11; // pg -> g/mol + conv_distance = 1E-4; // micrometer -> angstrom - } else if (strcmp(style,"nano") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); - conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol - conv_mass = 6.022E5; // ag -> g/mol - conv_distance = 0.1; // angstrom -> angstrom + } else if (strcmp(style,"nano") == 0) { + if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol + conv_mass = 6.022E5; // ag -> g/mol + conv_distance = 0.1; // angstrom -> angstrom - } else error->all(FLERR,"Units Type Conversion Not Found"); + } else error->all(FLERR,"Units Type Conversion Not Found"); } @@ -548,66 +548,66 @@ void DynamicalMatrix::convert_units(const char *style) void DynamicalMatrix::create_groupmap() { - //Create a group map which maps atom order onto group - // groupmap[global atom index-1] = output column/row + //Create a group map which maps atom order onto group + // groupmap[global atom index-1] = output column/row - int local_idx; // local index - int gid = 0; //group index - int nlocal = atom->nlocal; - int *mask = atom->mask; - bigint natoms = atom->natoms; - int *recv = new int[comm->nprocs]; - int *displs = new int[comm->nprocs]; - bigint *temp_groupmap = new bigint[natoms]; + int local_idx; // local index + int gid = 0; //group index + int nlocal = atom->nlocal; + int *mask = atom->mask; + bigint natoms = atom->natoms; + int *recv = new int[comm->nprocs]; + int *displs = new int[comm->nprocs]; + bigint *temp_groupmap = new bigint[natoms]; - //find number of local atoms in the group (final_gid) - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) - gid += 1; // gid at the end of loop is final_Gid - } - //create an array of length final_gid - bigint *sub_groupmap = new bigint[gid]; - - gid = 0; - //create a map between global atom id and group atom id for each proc - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) { - sub_groupmap[gid] = i; - gid += 1; + //find number of local atoms in the group (final_gid) + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) + gid += 1; // gid at the end of loop is final_Gid } - } + //create an array of length final_gid + bigint *sub_groupmap = new bigint[gid]; - //populate arrays for Allgatherv - for (int i=0; i < comm->nprocs; i++) { - recv[i] = 0; - } - recv[comm->me] = gid; - MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; i < comm->nprocs; i++) { - recv[i]=displs[i]; - if (i>0) displs[i] = displs[i-1]+recv[i-1]; - else displs[i] = 0; - } + gid = 0; + //create a map between global atom id and group atom id for each proc + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) { + sub_groupmap[gid] = i; + gid += 1; + } + } - //combine subgroup maps into total temporary groupmap - MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world); - std::sort(temp_groupmap,temp_groupmap+gcount); + //populate arrays for Allgatherv + for (int i=0; i < comm->nprocs; i++) { + recv[i] = 0; + } + recv[comm->me] = gid; + MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); + for (int i=0; i < comm->nprocs; i++) { + recv[i]=displs[i]; + if (i>0) displs[i] = displs[i-1]+recv[i-1]; + else displs[i] = 0; + } - //populate member groupmap based on temp groupmap - bigint j = 0; - for (bigint i=1; i <= natoms; i++) { - // flag groupmap contents that are in temp_groupmap - if (j < gcount && i == temp_groupmap[j]) - groupmap[i-1] = j++; - else - groupmap[i-1] = -1; - } + //combine subgroup maps into total temporary groupmap + MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world); + std::sort(temp_groupmap,temp_groupmap+gcount); - //free that memory! - delete[] recv; - delete[] displs; - delete[] sub_groupmap; - delete[] temp_groupmap; + //populate member groupmap based on temp groupmap + bigint j = 0; + for (bigint i=1; i <= natoms; i++) { + // flag groupmap contents that are in temp_groupmap + if (j < gcount && i == temp_groupmap[j]) + groupmap[i-1] = j++; + else + groupmap[i-1] = -1; + } + + //free that memory! + delete[] recv; + delete[] displs; + delete[] sub_groupmap; + delete[] temp_groupmap; } diff --git a/src/PHONON/dynamical_matrix.h b/src/PHONON/dynamical_matrix.h index 1c5333f31d..f14c198724 100644 --- a/src/PHONON/dynamical_matrix.h +++ b/src/PHONON/dynamical_matrix.h @@ -4,7 +4,9 @@ #ifdef COMMAND_CLASS -CommandStyle(dynamical_matrix,DynamicalMatrix) +// clang-format off +CommandStyle(dynamical_matrix,DynamicalMatrix); +// clang-format on #else @@ -23,21 +25,20 @@ class DynamicalMatrix : public Command { void setup(); protected: - int eflag,vflag; // flags for energy/virial computation - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int external_force_clear; // clear forces locally or externally - - int triclinic; // 0 if domain is orthog, 1 if triclinic + int triclinic; // 0 if domain is orthog, 1 if triclinic int pairflag; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int nvec; // local atomic dof = length of xvec + int nvec; // local atomic dof = length of xvec void update_force(); void force_clear(); - virtual void openfile(const char* filename); + virtual void openfile(const char *filename); private: void options(int, char **); @@ -53,23 +54,22 @@ class DynamicalMatrix : public Command { double conv_distance; double conv_mass; double del; - int igroup,groupbit; - bigint gcount; // number of atoms in group - bigint dynlen; // rank of dynamical matrix - bigint dynlenb; // new dynlen if folded + int igroup, groupbit; + bigint gcount; // number of atoms in group + bigint dynlen; // rank of dynamical matrix + bigint dynlenb; // new dynlen if folded int scaleflag; bigint *groupmap; - int compressed; // 1 if dump file is written compressed, 0 no - int binaryflag; // 1 if dump file is written binary, 0 no - int file_opened; // 1 if openfile method has been called, 0 no - int file_flag; // 1 custom file name, 0 dynmat.dat - int folded; // 1 folded, 0 nonfolded + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat + int folded; // 1 folded, 0 nonfolded FILE *fp; }; -} +} // namespace LAMMPS_NS - -#endif //LMP_DYNAMICAL_MATRIX_H +#endif //LMP_DYNAMICAL_MATRIX_H #endif From b8970366e01146934e99f1ae9e60d41000c1d203 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Wed, 3 Nov 2021 10:59:04 +0000 Subject: [PATCH 018/174] Fixed whitespace issues --- src/CG-DNA/bond_oxdna_fene.cpp | 4 +- src/CG-DNA/bond_oxdna_fene.h | 2 +- src/CG-DNA/pair_oxdna_coaxstk.cpp | 37 +++++++++---------- src/CG-DNA/pair_oxdna_coaxstk.h | 2 +- src/CG-DNA/pair_oxdna_excv.cpp | 61 +++++++++++++++---------------- src/CG-DNA/pair_oxdna_excv.h | 3 +- src/CG-DNA/pair_oxdna_hbond.cpp | 34 ++++++++--------- src/CG-DNA/pair_oxdna_hbond.h | 2 +- src/CG-DNA/pair_oxdna_stk.cpp | 39 +++++++++----------- src/CG-DNA/pair_oxdna_stk.h | 2 +- src/CG-DNA/pair_oxdna_xstk.cpp | 27 ++++++-------- src/CG-DNA/pair_oxdna_xstk.h | 2 +- 12 files changed, 103 insertions(+), 112 deletions(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index c46556768c..317b6b3c9b 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -174,7 +174,7 @@ void BondOxdnaFene::compute(int eflag, int vflag) ebond = 0.0; ev_init(eflag, vflag); - // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -194,7 +194,7 @@ void BondOxdnaFene::compute(int eflag, int vflag) bx[0] = nx_xtrct[b][0]; bx[1] = nx_xtrct[b][1]; bx[2] = nx_xtrct[b][2]; - //(a/b)y/z not needed here as oxDNA(1) co-linear + // (a/b)y/z not needed here as oxDNA(1) co-linear // vector COM-backbone site a and b compute_interaction_sites(ax, ay, az, ra_cs); diff --git a/src/CG-DNA/bond_oxdna_fene.h b/src/CG-DNA/bond_oxdna_fene.h index b24757781f..e6020892e4 100644 --- a/src/CG-DNA/bond_oxdna_fene.h +++ b/src/CG-DNA/bond_oxdna_fene.h @@ -40,7 +40,7 @@ class BondOxdnaFene : public Bond { protected: double *k, *Delta, *r0; // FENE - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors void allocate(); void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); diff --git a/src/CG-DNA/pair_oxdna_coaxstk.cpp b/src/CG-DNA/pair_oxdna_coaxstk.cpp index f76ad33147..a5b94403da 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna_coaxstk.cpp @@ -106,9 +106,6 @@ PairOxdnaCoaxstk::~PairOxdnaCoaxstk() void PairOxdnaCoaxstk::compute(int eflag, int vflag) { - - //printf("\n Coaxstk HERE, proc = %d \n", comm->me); - double delf[3],delt[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair,factor_lj; double v1tmp[3],v2tmp[3],v3tmp[3]; @@ -162,7 +159,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; - // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -176,9 +173,9 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) atype = type[a]; ax[0] = nx_xtrct[a][0]; - ax[1] = nx_xtrct[a][1]; - ax[2] = nx_xtrct[a][2]; - //a(y/z) not needed here as oxDNA(1) co-linear + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + // a(y/z) not needed here as oxDNA(1) co-linear // vector COM a - stacking site a ra_cst[0] = d_cst*ax[0]; @@ -202,9 +199,9 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) btype = type[b]; bx[0] = nx_xtrct[b][0]; - bx[1] = nx_xtrct[b][1]; - bx[2] = nx_xtrct[b][2]; - //b(y/z) not needed here as oxDNA(1) co-linear + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + // b(y/z) not needed here as oxDNA(1) co-linear // vector COM b - stacking site b rb_cst[0] = d_cst*bx[0]; @@ -256,12 +253,12 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // early rejection criterium if (f4t1) { - az[0] = nz_xtrct[a][0]; - az[1] = nz_xtrct[a][1]; - az[2] = nz_xtrct[a][2]; - bz[0] = nz_xtrct[b][0]; - bz[1] = nz_xtrct[b][1]; - bz[2] = nz_xtrct[b][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; @@ -398,9 +395,9 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // cosphi3 and cosphi4 (=cosphi3) force and virial if (cosphi3) { - ay[0] = ny_xtrct[a][0]; - ay[1] = ny_xtrct[a][1]; - ay[2] = ny_xtrct[a][2]; + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; finc = -f2 * f4t1* f4t4 * f4t5 * f4t6 * 2.0 * f5c3 * df5c3 * factor_lj; fpair += finc; @@ -408,6 +405,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) gamma = d_cs - d_cst; gammacub = gamma * gamma * gamma; rinv_ss_cub = rinv_ss * rinv_ss * rinv_ss; + aybx = MathExtra::dot3(ay,bx); azbx = MathExtra::dot3(az,bx); rax = MathExtra::dot3(delr_st_norm,ax); @@ -547,6 +545,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) gamma = d_cs - d_cst; gammacub = gamma * gamma * gamma; rinv_ss_cub = rinv_ss * rinv_ss * rinv_ss; + aybx = MathExtra::dot3(ay,bx); azbx = MathExtra::dot3(az,bx); rax = MathExtra::dot3(delr_st_norm,ax); diff --git a/src/CG-DNA/pair_oxdna_coaxstk.h b/src/CG-DNA/pair_oxdna_coaxstk.h index d634ccdf00..050fd5b06a 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.h +++ b/src/CG-DNA/pair_oxdna_coaxstk.h @@ -63,7 +63,7 @@ class PairOxdnaCoaxstk : public Pair { double **a_cxst3p, **cosphi_cxst3p_ast, **b_cxst3p, **cosphi_cxst3p_c; double **a_cxst4p, **cosphi_cxst4p_ast, **b_cxst4p, **cosphi_cxst4p_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index 2edad16c83..096d9b5171 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -50,7 +50,7 @@ PairOxdnaExcv::~PairOxdnaExcv() { if (allocated) { - memory->destroy(nx); + memory->destroy(nx); memory->destroy(ny); memory->destroy(nz); @@ -156,24 +156,23 @@ void PairOxdnaExcv::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; - // loop over all local atoms, handle calculation of local reference frame - + // loop over all local atoms, calculation of local reference frame for (in = 0; in < atom->nlocal; in++) { int n = alist[in]; - double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame - qn=bonus[ellipsoid[n]].quat; - MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); - - nx[n][0] = nx_temp[0]; - nx[n][1] = nx_temp[1]; - nx[n][2] = nx_temp[2]; - ny[n][0] = ny_temp[0]; - ny[n][1] = ny_temp[1]; - ny[n][2] = ny_temp[2]; - nz[n][0] = nz_temp[0]; - nz[n][1] = nz_temp[1]; + + qn=bonus[ellipsoid[n]].quat; + MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); + + nx[n][0] = nx_temp[0]; + nx[n][1] = nx_temp[1]; + nx[n][2] = nx_temp[2]; + ny[n][0] = ny_temp[0]; + ny[n][1] = ny_temp[1]; + ny[n][2] = ny_temp[2]; + nz[n][0] = nz_temp[0]; + nz[n][1] = nz_temp[1]; nz[n][2] = nz_temp[2]; } @@ -188,14 +187,14 @@ void PairOxdnaExcv::compute(int eflag, int vflag) atype = type[a]; ax[0] = nx[a][0]; - ax[1] = nx[a][1]; - ax[2] = nx[a][2]; - ay[0] = ny[a][0]; - ay[1] = ny[a][1]; - ay[2] = ny[a][2]; - az[0] = nz[a][0]; - az[1] = nz[a][1]; - az[2] = nz[a][2]; + ax[1] = nx[a][1]; + ax[2] = nx[a][2]; + ay[0] = ny[a][0]; + ay[1] = ny[a][1]; + ay[2] = ny[a][2]; + az[0] = nz[a][0]; + az[1] = nz[a][1]; + az[2] = nz[a][2]; // vector COM - backbone and base site a compute_interaction_sites(ax,ay,az,ra_cs,ra_cb); @@ -220,14 +219,14 @@ void PairOxdnaExcv::compute(int eflag, int vflag) btype = type[b]; bx[0] = nx[b][0]; - bx[1] = nx[b][1]; - bx[2] = nx[b][2]; - by[0] = ny[b][0]; - by[1] = ny[b][1]; - by[2] = ny[b][2]; - bz[0] = nz[b][0]; - bz[1] = nz[b][1]; - bz[2] = nz[b][2]; + bx[1] = nx[b][1]; + bx[2] = nx[b][2]; + by[0] = ny[b][0]; + by[1] = ny[b][1]; + by[2] = ny[b][2]; + bz[0] = nz[b][0]; + bz[1] = nz[b][1]; + bz[2] = nz[b][2]; // vector COM - backbone and base site b compute_interaction_sites(bx,by,bz,rb_cs,rb_cb); diff --git a/src/CG-DNA/pair_oxdna_excv.h b/src/CG-DNA/pair_oxdna_excv.h index 1d2a871dd9..9abd97fb3d 100644 --- a/src/CG-DNA/pair_oxdna_excv.h +++ b/src/CG-DNA/pair_oxdna_excv.h @@ -56,8 +56,7 @@ class PairOxdnaExcv : public Pair { double **epsilon_bb, **sigma_bb, **cut_bb_ast, **cutsq_bb_ast; double **lj1_bb, **lj2_bb, **b_bb, **cut_bb_c, **cutsq_bb_c; - // per-atom arrays for q_to_exyz storage - double **nx, **ny, **nz; + double **nx, **ny, **nz; // per-atom arrays for local unit vectors virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna_hbond.cpp b/src/CG-DNA/pair_oxdna_hbond.cpp index f4baa74787..07a1ce332b 100644 --- a/src/CG-DNA/pair_oxdna_hbond.cpp +++ b/src/CG-DNA/pair_oxdna_hbond.cpp @@ -179,7 +179,7 @@ void PairOxdnaHbond::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; - // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -193,10 +193,10 @@ void PairOxdnaHbond::compute(int eflag, int vflag) atype = type[a]; ax[0] = nx_xtrct[a][0]; - ax[1] = nx_xtrct[a][1]; - ax[2] = nx_xtrct[a][2]; - - ra_chb[0] = d_chb*ax[0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + + ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; ra_chb[2] = d_chb*ax[2]; @@ -211,11 +211,11 @@ void PairOxdnaHbond::compute(int eflag, int vflag) btype = type[b]; - bx[0] = nx_xtrct[b][0]; - bx[1] = nx_xtrct[b][1]; - bx[2] = nx_xtrct[b][2]; - - rb_chb[0] = d_chb*bx[0]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + + rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; rb_chb[2] = d_chb*bx[2]; @@ -272,12 +272,12 @@ void PairOxdnaHbond::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { - az[0] = nz_xtrct[a][0]; - az[1] = nz_xtrct[a][1]; - az[2] = nz_xtrct[a][2]; - bz[0] = nz_xtrct[b][0]; - bz[1] = nz_xtrct[b][1]; - bz[2] = nz_xtrct[b][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; @@ -1249,4 +1249,4 @@ void *PairOxdnaHbond::extract(const char *str, int &dim) if (strcmp(str,"dtheta_hb8_c") == 0) return (void *) dtheta_hb8_c; return nullptr; -} \ No newline at end of file +} diff --git a/src/CG-DNA/pair_oxdna_hbond.h b/src/CG-DNA/pair_oxdna_hbond.h index 90ede130ba..1a138e82de 100644 --- a/src/CG-DNA/pair_oxdna_hbond.h +++ b/src/CG-DNA/pair_oxdna_hbond.h @@ -67,7 +67,7 @@ class PairOxdnaHbond : public Pair { double **a_hb8, **theta_hb8_0, **dtheta_hb8_ast; double **b_hb8, **dtheta_hb8_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors int seqdepflag; diff --git a/src/CG-DNA/pair_oxdna_stk.cpp b/src/CG-DNA/pair_oxdna_stk.cpp index f156062463..7665abbb79 100644 --- a/src/CG-DNA/pair_oxdna_stk.cpp +++ b/src/CG-DNA/pair_oxdna_stk.cpp @@ -212,9 +212,6 @@ void PairOxdnaStk::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, void PairOxdnaStk::compute(int eflag, int vflag) { - - //printf("\n Stk HERE, proc = %d \n", comm->me); - double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair; double delr_ss[3],delr_ss_norm[3],rsq_ss,r_ss,rinv_ss; @@ -258,7 +255,7 @@ void PairOxdnaStk::compute(int eflag, int vflag) evdwl = 0.0; ev_init(eflag,vflag); - // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -282,13 +279,13 @@ void PairOxdnaStk::compute(int eflag, int vflag) // a now in 3' direction, b in 5' direction - ax[0] = nx_xtrct[a][0]; - ax[1] = nx_xtrct[a][1]; - ax[2] = nx_xtrct[a][2]; - bx[0] = nx_xtrct[b][0]; - bx[1] = nx_xtrct[b][1]; - bx[2] = nx_xtrct[b][2]; - //(a/b)y/z not needed here as oxDNA(1) co-linear + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + // (a/b)y/z not needed here as oxDNA(1) co-linear // vector COM a - stacking site a ra_cst[0] = d_cst*ax[0]; @@ -346,12 +343,12 @@ void PairOxdnaStk::compute(int eflag, int vflag) // early rejection criterium if (f1) { - az[0] = nz_xtrct[a][0]; - az[1] = nz_xtrct[a][1]; - az[2] = nz_xtrct[a][2]; - bz[0] = nz_xtrct[b][0]; - bz[1] = nz_xtrct[b][1]; - bz[2] = nz_xtrct[b][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; // theta4 angle and correction cost4 = MathExtra::dot3(bz,az); @@ -377,12 +374,12 @@ void PairOxdnaStk::compute(int eflag, int vflag) // early rejection criterium if (f4t5) { - ay[0] = ny_xtrct[a][0]; + ay[0] = ny_xtrct[a][0]; ay[1] = ny_xtrct[a][1]; - ay[2] = ny_xtrct[a][2]; - by[0] = ny_xtrct[b][0]; + ay[2] = ny_xtrct[a][2]; + by[0] = ny_xtrct[b][0]; by[1] = ny_xtrct[b][1]; - by[2] = ny_xtrct[b][2]; + by[2] = ny_xtrct[b][2]; cost6p = MathExtra::dot3(delr_st_norm,az); if (cost6p > 1.0) cost6p = 1.0; diff --git a/src/CG-DNA/pair_oxdna_stk.h b/src/CG-DNA/pair_oxdna_stk.h index ada5cdcc6a..1f8a3a9249 100644 --- a/src/CG-DNA/pair_oxdna_stk.h +++ b/src/CG-DNA/pair_oxdna_stk.h @@ -60,7 +60,7 @@ class PairOxdnaStk : public Pair { double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors int seqdepflag; diff --git a/src/CG-DNA/pair_oxdna_xstk.cpp b/src/CG-DNA/pair_oxdna_xstk.cpp index 046659e5c6..bfb0d185a9 100644 --- a/src/CG-DNA/pair_oxdna_xstk.cpp +++ b/src/CG-DNA/pair_oxdna_xstk.cpp @@ -111,9 +111,6 @@ PairOxdnaXstk::~PairOxdnaXstk() void PairOxdnaXstk::compute(int eflag, int vflag) { - - //printf("\n Xstk HERE, proc = %d \n", comm->me); - double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair,factor_lj; double delr_hb[3],delr_hb_norm[3],rsq_hb,r_hb,rinv_hb; @@ -159,7 +156,7 @@ void PairOxdnaXstk::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; - // n(x/y/z)_xtrct = extracted q_to_exyz from oxdna_excv + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -173,9 +170,9 @@ void PairOxdnaXstk::compute(int eflag, int vflag) atype = type[a]; ax[0] = nx_xtrct[a][0]; - ax[1] = nx_xtrct[a][1]; - ax[2] = nx_xtrct[a][2]; - //a(y/z) not needed here as oxDNA(1) co-linear + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + // a(y/z) not needed here as oxDNA(1) co-linear ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; @@ -193,9 +190,9 @@ void PairOxdnaXstk::compute(int eflag, int vflag) btype = type[b]; bx[0] = nx_xtrct[b][0]; - bx[1] = nx_xtrct[b][1]; - bx[2] = nx_xtrct[b][2]; - //b(y/z) not needed here as oxDNA(1) co-linear + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + // b(y/z) not needed here as oxDNA(1) co-linear rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; @@ -254,12 +251,12 @@ void PairOxdnaXstk::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { - az[0] = nz_xtrct[a][0]; + az[0] = nz_xtrct[a][0]; az[1] = nz_xtrct[a][1]; - az[2] = nz_xtrct[a][2]; - bz[0] = nz_xtrct[b][0]; - bz[1] = nz_xtrct[b][1]; - bz[2] = nz_xtrct[b][2]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; diff --git a/src/CG-DNA/pair_oxdna_xstk.h b/src/CG-DNA/pair_oxdna_xstk.h index c450755356..2ad4c6027c 100644 --- a/src/CG-DNA/pair_oxdna_xstk.h +++ b/src/CG-DNA/pair_oxdna_xstk.h @@ -66,7 +66,7 @@ class PairOxdnaXstk : public Pair { double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for q_to_exyz storage + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); From fc4fdd09efcd7bda420bae5fc4eeefbbae4134c8 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Wed, 3 Nov 2021 11:44:29 +0000 Subject: [PATCH 019/174] Fixed more whitespace issues --- src/CG-DNA/bond_oxdna_fene.cpp | 29 ++++++++++++++--------------- src/CG-DNA/pair_oxdna_coaxstk.cpp | 2 -- src/CG-DNA/pair_oxdna_excv.cpp | 3 --- src/CG-DNA/pair_oxdna_hbond.cpp | 2 +- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index 317b6b3c9b..a8cd52e651 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -146,14 +146,13 @@ void BondOxdnaFene::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, doub ------------------------------------------------------------------------- */ void BondOxdnaFene::compute(int eflag, int vflag) { - - int a, b, in, type; - double delf[3], delta[3], deltb[3]; // force, torque increment;; - double delr[3], ebond, fbond; - double rsq, Deltasq, rlogarg; - double r, rr0, rr0sq; + int a,b,in,type; + double delf[3],delta[3],deltb[3]; // force, torque increment;; + double delr[3],ebond,fbond; + double rsq,Deltasq,rlogarg; + double r,rr0,rr0sq; // vectors COM-backbone site in lab frame - double ra_cs[3], rb_cs[3]; + double ra_cs[3],rb_cs[3]; // Cartesian unit vectors in lab frame double ax[3],ay[3],az[3]; double bx[3],by[3],bz[3]; @@ -188,13 +187,13 @@ void BondOxdnaFene::compute(int eflag, int vflag) b = bondlist[in][0]; type = bondlist[in][2]; - ax[0] = nx_xtrct[a][0]; - ax[1] = nx_xtrct[a][1]; - ax[2] = nx_xtrct[a][2]; - bx[0] = nx_xtrct[b][0]; - bx[1] = nx_xtrct[b][1]; - bx[2] = nx_xtrct[b][2]; - // (a/b)y/z not needed here as oxDNA(1) co-linear + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + // (a/b)y/z not needed here as oxDNA(1) co-linear // vector COM-backbone site a and b compute_interaction_sites(ax, ay, az, ra_cs); @@ -266,7 +265,7 @@ void BondOxdnaFene::compute(int eflag, int vflag) if (evflag) ev_tally_xyz(a, b, nlocal, newton_bond, ebond, delf[0], delf[1], delf[2], x[a][0] - x[b][0], x[a][1] - x[b][1], x[a][2] - x[b][2]); - } + } } /* ---------------------------------------------------------------------- */ diff --git a/src/CG-DNA/pair_oxdna_coaxstk.cpp b/src/CG-DNA/pair_oxdna_coaxstk.cpp index a5b94403da..e03de69f57 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna_coaxstk.cpp @@ -405,7 +405,6 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) gamma = d_cs - d_cst; gammacub = gamma * gamma * gamma; rinv_ss_cub = rinv_ss * rinv_ss * rinv_ss; - aybx = MathExtra::dot3(ay,bx); azbx = MathExtra::dot3(az,bx); rax = MathExtra::dot3(delr_st_norm,ax); @@ -545,7 +544,6 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) gamma = d_cs - d_cst; gammacub = gamma * gamma * gamma; rinv_ss_cub = rinv_ss * rinv_ss * rinv_ss; - aybx = MathExtra::dot3(ay,bx); azbx = MathExtra::dot3(az,bx); rax = MathExtra::dot3(delr_st_norm,ax); diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index 096d9b5171..2ae5995ebb 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -115,9 +115,6 @@ void PairOxdnaExcv::compute_interaction_sites(double e1[3], double /*e2*/[3], void PairOxdnaExcv::compute(int eflag, int vflag) { - - //printf("\n ExcVol HERE, proc = %d \n", comm->me); - double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,factor_lj; double rtmp_s[3],rtmp_b[3]; diff --git a/src/CG-DNA/pair_oxdna_hbond.cpp b/src/CG-DNA/pair_oxdna_hbond.cpp index 07a1ce332b..eb04d74f2e 100644 --- a/src/CG-DNA/pair_oxdna_hbond.cpp +++ b/src/CG-DNA/pair_oxdna_hbond.cpp @@ -218,7 +218,7 @@ void PairOxdnaHbond::compute(int eflag, int vflag) rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; rb_chb[2] = d_chb*bx[2]; - + // vector h-bonding site b to a delr_hb[0] = x[a][0] + ra_chb[0] - x[b][0] - rb_chb[0]; delr_hb[1] = x[a][1] + ra_chb[1] - x[b][1] - rb_chb[1]; From e8f6024eae460ca3fb6dbff7508f0b873293304f Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Wed, 3 Nov 2021 11:46:56 +0000 Subject: [PATCH 020/174] Fixed more whitespace issues --- src/CG-DNA/bond_oxdna_fene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index a8cd52e651..3652856a52 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -145,7 +145,7 @@ void BondOxdnaFene::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, doub s=sugar-phosphate backbone site, b=base site, st=stacking site ------------------------------------------------------------------------- */ void BondOxdnaFene::compute(int eflag, int vflag) -{ +{ int a,b,in,type; double delf[3],delta[3],deltb[3]; // force, torque increment;; double delr[3],ebond,fbond; From 5241f93641764e5d40786393392e34a54c1cce9c Mon Sep 17 00:00:00 2001 From: Sievers Date: Wed, 3 Nov 2021 10:12:17 -0700 Subject: [PATCH 021/174] Update third order format --- src/PHONON/dynamical_matrix.cpp | 42 ++++----- src/PHONON/dynamical_matrix.h | 3 +- src/PHONON/third_order.cpp | 151 ++++++++++++++++---------------- src/PHONON/third_order.h | 106 +++++++++++----------- 4 files changed, 151 insertions(+), 151 deletions(-) diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index d33a2dde2d..6a0c744d99 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -107,6 +107,8 @@ void DynamicalMatrix::setup() void DynamicalMatrix::command(int narg, char **arg) { + MPI_Comm_rank(world,&me); + if (domain->box_exist == 0) error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); @@ -135,7 +137,7 @@ void DynamicalMatrix::command(int narg, char **arg) int style = -1; if (strcmp(arg[1],"regular") == 0) style = REGULAR; else if (strcmp(arg[1],"eskm") == 0) style = ESKM; - else error->all(FLERR,"Illegal dynamical_matrix command"); + else error->all(FLERR,"Illegal Dynamical_matrix command"); del = utils::numeric(FLERR, arg[2],false,lmp); // set option defaults @@ -151,7 +153,7 @@ void DynamicalMatrix::command(int narg, char **arg) // read options from end of input line if (style == REGULAR) options(narg-3,&arg[3]); else if (style == ESKM) options(narg-3,&arg[3]); - else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); + else if (me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); if (!folded) dynlenb = dynlen; else dynlenb = (atom->natoms)*3; @@ -234,7 +236,7 @@ void DynamicalMatrix::openfile(const char *filename) if (file_opened) return; fp = nullptr; - if (comm->me == 0) { + if (me == 0) { if (compressed) { fp = platform::compressed_write(std::string(filename)+".gz"); if (!fp) error->one(FLERR,"Cannot open compressed file"); @@ -278,7 +280,7 @@ void DynamicalMatrix::calculateMatrix() //initialize dynmat to all zeros dynmat_clear(dynmat); - if (comm->me == 0 && screen) { + if (me == 0 && screen) { fprintf(screen,"Calculating Dynamical Matrix ...\n"); fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); @@ -340,10 +342,10 @@ void DynamicalMatrix::calculateMatrix() } for (int k=0; k<3; k++) MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (comm->me == 0) + if (me == 0) writeMatrix(fdynmat); dynmat_clear(dynmat); - if (comm->me == 0 && screen) { + if (me == 0 && screen) { int p = 10 * gm[i-1] / gcount; if (p > prog) { prog = p; @@ -352,7 +354,7 @@ void DynamicalMatrix::calculateMatrix() } } } - if (comm->me == 0 && screen) fprintf(screen,"\n"); + if (me == 0 && screen) fprintf(screen,"\n"); for (int i=0; i < 3; i++) delete [] dynmat[i]; @@ -362,7 +364,7 @@ void DynamicalMatrix::calculateMatrix() delete [] fdynmat[i]; delete [] fdynmat; - if (screen && comm->me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); + if (screen && me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); } /* ---------------------------------------------------------------------- @@ -371,7 +373,7 @@ void DynamicalMatrix::calculateMatrix() void DynamicalMatrix::writeMatrix(double **dynmat) { - if (comm->me != 0 || !fp) + if (me != 0 || !fp) return; clearerr(fp); @@ -386,9 +388,9 @@ void DynamicalMatrix::writeMatrix(double **dynmat) if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); else fprintf(fp, "%4.8f ",dynmat[i][j]); } - } - if (ferror(fp)) - error->one(FLERR,"Error writing to file"); + } + if (ferror(fp)) + error->one(FLERR,"Error writing to file"); } } @@ -470,7 +472,7 @@ void DynamicalMatrix::force_clear() if (force->newton) nbytes += sizeof(double) * atom->nghost; if (nbytes) { - memset(&atom->f[0][0],0,3*nbytes); + memset(&atom->f[0][0],0,3*nbytes); } } @@ -512,13 +514,13 @@ void DynamicalMatrix::convert_units(const char *style) conv_distance = 1; // angstrom -> angstrom } else if (strcmp(style,"si") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); conv_energy = 6.022E22; // J -> 10 J/mol conv_mass = 6.022E26; // kg -> g/mol conv_distance = 1E-10; // meter -> angstrom } else if (strcmp(style,"cgs") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); conv_energy = 6.022E12; // Erg -> 10 J/mol conv_mass = 6.022E23; // g -> g/mol conv_distance = 1E-7; // centimeter -> angstrom @@ -529,13 +531,13 @@ void DynamicalMatrix::convert_units(const char *style) conv_distance = 0.529177249; // bohr -> angstrom } else if (strcmp(style,"micro") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol conv_mass = 6.022E11; // pg -> g/mol conv_distance = 1E-4; // micrometer -> angstrom } else if (strcmp(style,"nano") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol conv_mass = 6.022E5; // ag -> g/mol conv_distance = 0.1; // angstrom -> angstrom @@ -583,9 +585,9 @@ void DynamicalMatrix::create_groupmap() for (int i=0; i < comm->nprocs; i++) { recv[i] = 0; } - recv[comm->me] = gid; + recv[me] = gid; MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; i < comm->nprocs; i++) { + for (int i=0; inprocs; i++) { recv[i]=displs[i]; if (i>0) displs[i] = displs[i-1]+recv[i-1]; else displs[i] = 0; @@ -597,7 +599,7 @@ void DynamicalMatrix::create_groupmap() //populate member groupmap based on temp groupmap bigint j = 0; - for (bigint i=1; i <= natoms; i++) { + for (bigint i=1; i<=natoms; i++) { // flag groupmap contents that are in temp_groupmap if (j < gcount && i == temp_groupmap[j]) groupmap[i-1] = j++; diff --git a/src/PHONON/dynamical_matrix.h b/src/PHONON/dynamical_matrix.h index f14c198724..0d1ba0c4d4 100644 --- a/src/PHONON/dynamical_matrix.h +++ b/src/PHONON/dynamical_matrix.h @@ -3,11 +3,9 @@ // #ifdef COMMAND_CLASS - // clang-format off CommandStyle(dynamical_matrix,DynamicalMatrix); // clang-format on - #else #ifndef LMP_DYNAMICAL_MATRIX_H @@ -59,6 +57,7 @@ class DynamicalMatrix : public Command { bigint dynlen; // rank of dynamical matrix bigint dynlenb; // new dynlen if folded int scaleflag; + int me; bigint *groupmap; int compressed; // 1 if dump file is written compressed, 0 no diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 6bd04a3d5e..507763caa7 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://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,8 +40,8 @@ #include "timer.h" #include "update.h" -#include #include +#include using namespace LAMMPS_NS; using namespace MathSpecial; @@ -57,11 +58,12 @@ ThirdOrder::ThirdOrder(LAMMPS *lmp) : Command(lmp), fp(nullptr) ThirdOrder::~ThirdOrder() { - if (fp && comm->me == 0) fclose(fp); + if (fp && me == 0) { + if (compressed) platform::pclose(fp); + else fclose(fp); + } fp = nullptr; memory->destroy(groupmap); - // memory->destroy(ijnum); - // memory->destroy(neighbortags); } /* ---------------------------------------------------------------------- @@ -111,6 +113,8 @@ void ThirdOrder::setup() void ThirdOrder::command(int narg, char **arg) { + MPI_Comm_rank(world,&me); + if (domain->box_exist == 0) error->all(FLERR,"third_order command before simulation box is defined"); if (narg < 2) error->all(FLERR,"Illegal third_order command"); @@ -167,16 +171,16 @@ void ThirdOrder::command(int narg, char **arg) neighbortags = NULL; // read options from end of input line - if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK - else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK - else error->all(FLERR,"Illegal third_order command"); + if (style == REGULAR) options(narg-3,&arg[3]); + else if (style == ESKM) options(narg-3,&arg[3]); + else error->all(FLERR,"Illegal Third Order command"); del = utils::numeric(FLERR, arg[2],false,lmp); if (!folded) dynlenb = dynlen; else dynlenb = (atom->natoms)*3; if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"third_order command requires an atom map"); + error->all(FLERR,"Third Order command requires an atom map, see atom_modify"); // move atoms by 3-vector or specified variable(s) @@ -208,42 +212,41 @@ void ThirdOrder::command(int narg, char **arg) void ThirdOrder::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal third_order command"); + if (narg < 0) error->all(FLERR,"Illegal Third Order command"); int iarg = 0; - const char *filename = "third_order.dat"; + const char *filename = "Third Order.dat"; while (iarg < narg) { - if (strcmp(arg[iarg],"file") == 0) { + if (strcmp(arg[iarg],"binary") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal Third Order command"); + if (strcmp(arg[iarg+1],"gzip") == 0) { + compressed = 1; + } else { + binaryflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + } + iarg += 2; + } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR, "Illegal third_order command"); filename = arg[iarg + 1]; file_flag = 1; - iarg += 2; - } else if (strcmp(arg[iarg],"binary") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal third_order command"); - if (strcmp(arg[iarg+1],"gzip") == 0) { - compressed = 1; - } else if (strcmp(arg[iarg+1],"yes") == 0) { - binaryflag = 1; - } - iarg += 2; } else if (strcmp(arg[iarg],"fold") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal third_order command"); + if (iarg+2 > narg) error->all(FLERR, "Illegal Third Order command"); if (strcmp(arg[iarg+1],"yes") == 0) { - folded = 1; + folded = 1; } else if (strcmp(arg[iarg+1],"no") == 0) { - folded = 0; - } else error->all(FLERR,"Illegal input for third_order fold option"); + folded = 0; + } else error->all(FLERR,"Illegal input for Third Order fold option"); iarg += 2; - } else error->all(FLERR,"Illegal third_order command"); + } else error->all(FLERR,"Illegal Third Order command"); } - if (file_flag == 1 && comm->me == 0) { + if (file_flag == 1 && me == 0) { openfile(filename); } } /* ---------------------------------------------------------------------- generic opening of a file - ASCII or binary or gzipped + ASCII or binary or compressed some derived classes override this function ------------------------------------------------------------------------- */ @@ -251,26 +254,20 @@ void ThirdOrder::openfile(const char* filename) { // if file already opened, return if (file_opened) return; + fp = nullptr; - if (compressed) { -#ifdef LAMMPS_GZIP - char gzip[128]; - sprintf(gzip,"gzip -6 > %s",filename); -#ifdef _WIN32 - fp = _popen(gzip,"wb"); -#else - fp = popen(gzip,"w"); -#endif -#else - error->one(FLERR,"Cannot open gzipped file"); -#endif - } else if (binaryflag) { - fp = fopen(filename,"wb"); - } else { - fp = fopen(filename,"w"); + if (me == 0) { + if (compressed) { + fp = platform::compressed_write(std::string(filename)+".gz"); + if (!fp) error->one(FLERR,"Cannot open compressed file"); + } else if (binaryflag) { + fp = fopen(filename,"wb"); + } else { + fp = fopen(filename,"w"); + } + if (!fp) error->one(FLERR,"Cannot open third_order file: {}", utils::getsyserror()); } - if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } @@ -299,12 +296,12 @@ void ThirdOrder::calculateMatrix() getNeighbortags(); - if (comm->me == 0) { - utils::logmesg(lmp, fmt::format("Calculating Third Order ...\n")); - utils::logmesg(lmp, fmt::format(" Total # of atoms = {}\n", natoms)); - utils::logmesg(lmp, fmt::format(" Atoms in group = {}\n", gcount)); - utils::logmesg(lmp, fmt::format(" Total third order elements = {}\n", (dynlen*dynlenb*dynlenb))); - } + if (comm->me == 0 && screen) { + fprintf(screen,"Calculating Third Order ...\n"); + fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); + fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); + fprintf(screen," Total third order elements = " + BIGINT_FORMAT "\n", (dynlen*dynlen*dynlen) ); update->nsteps = 0; int prog = 0; @@ -393,7 +390,7 @@ void ThirdOrder::calculateMatrix() displace_atom(local_jdx, beta, 1); displace_atom(local_idx, alpha, 1); MPI_Reduce(dynmat,fdynmat,dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (comm->me == 0){ + if (me == 0){ if (folded) { writeMatrix(fdynmat, gm[i-1], alpha, j, beta); } else { @@ -404,7 +401,7 @@ void ThirdOrder::calculateMatrix() } } } - if (comm->me == 0 && screen) { + if (me == 0 && screen) { int p = 10 * gm[i-1] / gcount; if (p > prog) { prog = p; @@ -417,7 +414,7 @@ void ThirdOrder::calculateMatrix() delete [] dynmat; delete [] fdynmat; - if (screen && comm->me ==0) + if (screen && me ==0) fprintf(screen,"Finished Calculating Third Order Tensor\n"); } @@ -427,7 +424,7 @@ void ThirdOrder::calculateMatrix() void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) { - if (comm->me != 0) + if (me != 0) return; double norm; @@ -439,11 +436,13 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+1])+ square(dynmat[k*3+2]); if (norm > 1.0e-16) - fmt::print(fp,"{} {} {} {} {} {:.8f} {:.8f} {:.8f}\n", - i+1, a + 1, j+1, b + 1, k+1, - dynmat[k*3] * conversion, - dynmat[k*3+1] * conversion, - dynmat[k*3+2] * conversion); + fprintf(fp, + BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT + " %7.8f %7.8f %7.8f\n", + i+1, a + 1, j+1, b + 1, k+1, + dynmat[k*3] * conversion, + dynmat[k*3+1] * conversion, + dynmat[k*3+2] * conversion); } } else { for (int k = 0; k < gcount; k++){ @@ -451,11 +450,13 @@ void ThirdOrder::writeMatrix(double *dynmat, bigint i, int a, bigint j, int b) square(dynmat[k*3+1])+ square(dynmat[k*3+2]); if (norm > 1.0e-16) - fmt::print(fp, "{} {} {} {} {} {:.8f} {:.8f} {:.8f}\n", - i+1, a + 1, j+1, b + 1, groupmap[k]+1, - dynmat[k*3] * conversion, - dynmat[k*3+1] * conversion, - dynmat[k*3+2] * conversion); + fprintf(fp, + BIGINT_FORMAT " %d " BIGINT_FORMAT " %d " BIGINT_FORMAT + " %7.8f %7.8f %7.8f\n", + i+1, a + 1, j+1, b + 1, groupmap[k]+1, + dynmat[k*3] * conversion, + dynmat[k*3+1] * conversion, + dynmat[k*3+2] * conversion); } } } else if (binaryflag && fp) { @@ -570,13 +571,13 @@ void ThirdOrder::convert_units(const char *style) conv_distance = 1; // angstrom -> angstrom } else if (strcmp(style,"si") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); conv_energy = 6.022E22; // J -> 10 J/mol conv_mass = 6.022E26; // kg -> g/mol conv_distance = 1E-10; // meter -> angstrom } else if (strcmp(style,"cgs") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); conv_energy = 6.022E12; // Erg -> 10 J/mol conv_mass = 6.022E23; // g -> g/mol conv_distance = 1E-7; // centimeter -> angstrom @@ -587,13 +588,13 @@ void ThirdOrder::convert_units(const char *style) conv_distance = 0.529177249; // bohr -> angstrom } else if (strcmp(style,"micro") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol conv_mass = 6.022E11; // pg -> g/mol conv_distance = 1E-4; // micrometer -> angstrom } else if (strcmp(style,"nano") == 0) { - if (comm->me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol conv_mass = 6.022E5; // ag -> g/mol conv_distance = 0.1; // angstrom -> angstrom @@ -619,7 +620,7 @@ void ThirdOrder::create_groupmap() bigint *temp_groupmap = new bigint[natoms]; //find number of local atoms in the group (final_gid) - for (bigint i=1; i <= natoms; i++) { + for (bigint i=1; i<=natoms; i++) { local_idx = atom->map(i); if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) gid += 1; // gid at the end of loop is final_Gid @@ -629,7 +630,7 @@ void ThirdOrder::create_groupmap() gid = 0; //create a map between global atom id and group atom id for each proc - for (bigint i=1; i <= natoms; i++) { + for (bigint i=1; i<=natoms; i++) { local_idx = atom->map(i); if ((local_idx >= 0) && (local_idx < nlocal) && (mask[local_idx] & groupbit)) { @@ -639,12 +640,12 @@ void ThirdOrder::create_groupmap() } //populate arrays for Allgatherv - for (int i=0; i < comm->nprocs; i++) { + for (int i=0; inprocs; i++) { recv[i] = 0; } - recv[comm->me] = gid; + recv[me] = gid; MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; i < comm->nprocs; i++) { + for (int i=0; inprocs; i++) { recv[i]=displs[i]; if (i>0) displs[i] = displs[i-1]+recv[i-1]; else displs[i] = 0; @@ -657,7 +658,7 @@ void ThirdOrder::create_groupmap() //populate member groupmap based on temp groupmap bigint j = 0; - for (bigint i=1; i <= natoms; i++) { + for (bigint i=1; i<=natoms; i++) { // flag groupmap contents that are in temp_groupmap if (j < gcount && i == temp_groupmap[j]) groupmap[i-1] = j++; diff --git a/src/PHONON/third_order.h b/src/PHONON/third_order.h index 201eff9383..41fe2759ac 100644 --- a/src/PHONON/third_order.h +++ b/src/PHONON/third_order.h @@ -2,11 +2,10 @@ // Created by charlie sievers on 7/5/18. // - #ifdef COMMAND_CLASS - -CommandStyle(third_order,ThirdOrder) - +// clang-format off +CommandStyle(third_order,ThirdOrder); +// clang-format on #else #ifndef LMP_THIRD_ORDER_H @@ -16,67 +15,66 @@ CommandStyle(third_order,ThirdOrder) namespace LAMMPS_NS { - class ThirdOrder : public Command { - public: - ThirdOrder(class LAMMPS *); - virtual ~ThirdOrder(); - void command(int, char **); - void setup(); +class ThirdOrder : public Command { + public: + ThirdOrder(class LAMMPS *); + virtual ~ThirdOrder(); + void command(int, char **); + void setup(); - protected: - int eflag,vflag; // flags for energy/virial computation - int external_force_clear; // clear forces locally or externally + protected: + int eflag,vflag; // flags for energy/virial computation + int external_force_clear; // clear forces locally or externally - int triclinic; // 0 if domain is orthog, 1 if triclinic - int pairflag; + int triclinic; // 0 if domain is orthog, 1 if triclinic + int pairflag; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int nvec; // local atomic dof = length of xvec + int nvec; // local atomic dof = length of xvec - void update_force(); - void force_clear(); - virtual void openfile(const char* filename); + void update_force(); + void force_clear(); + virtual void openfile(const char* filename); - private: - void options(int, char **); - void create_groupmap(); - void calculateMatrix(); - void convert_units(const char *style); - void displace_atom(int local_idx, int direction, int magnitude); - void writeMatrix(double *, bigint, int, bigint, int); - void getNeighbortags(); + private: + void options(int, char **); + void create_groupmap(); + void calculateMatrix(); + void convert_units(const char *style); + void displace_atom(int local_idx, int direction, int magnitude); + void writeMatrix(double *, bigint, int, bigint, int); + void getNeighbortags(); - double conversion; - double conv_energy; - double conv_distance; - double conv_mass; - double del; - int igroup,groupbit; - bigint dynlen; - bigint dynlenb; - int scaleflag; - bigint gcount; // number of atoms in group - bigint *groupmap; + double conversion; + double conv_energy; + double conv_distance; + double conv_mass; + double del; + int igroup,groupbit; + bigint dynlen; + bigint dynlenb; + int scaleflag; + int me; + bigint gcount; // number of atoms in group + bigint *groupmap; - int compressed; // 1 if dump file is written compressed, 0 no - int binaryflag; // 1 if dump file is written binary, 0 no - int file_opened; // 1 if openfile method has been called, 0 no - int file_flag; // 1 custom file name, 0 dynmat.dat - int folded; // 1 if system is folded, 0 no + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat + int folded; // 1 if system is folded, 0 no - class NeighList *list; - int *ijnum; - bigint **neighbortags; + class NeighList *list; + int *ijnum; + bigint **neighbortags; - FILE *fp; - }; -} + FILE *fp; +}; +} // namespace LAMMPS_NS - -#endif //LMP_THIRD_ORDER_H +#endif //LMP_THIRD_ORDER_H #endif - From b86a3a5d6b92b7ef3de54cae0f4c9524660c17d1 Mon Sep 17 00:00:00 2001 From: Sievers Date: Wed, 3 Nov 2021 10:24:22 -0700 Subject: [PATCH 022/174] Added missing } --- src/PHONON/third_order.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 507763caa7..69f5e5c930 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -232,9 +232,9 @@ void ThirdOrder::options(int narg, char **arg) } else if (strcmp(arg[iarg],"fold") == 0) { if (iarg+2 > narg) error->all(FLERR, "Illegal Third Order command"); if (strcmp(arg[iarg+1],"yes") == 0) { - folded = 1; + folded = 1; } else if (strcmp(arg[iarg+1],"no") == 0) { - folded = 0; + folded = 0; } else error->all(FLERR,"Illegal input for Third Order fold option"); iarg += 2; } else error->all(FLERR,"Illegal Third Order command"); @@ -297,11 +297,12 @@ void ThirdOrder::calculateMatrix() getNeighbortags(); if (comm->me == 0 && screen) { - fprintf(screen,"Calculating Third Order ...\n"); - fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); - fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); - fprintf(screen," Total third order elements = " - BIGINT_FORMAT "\n", (dynlen*dynlen*dynlen) ); + fprintf(screen, "Calculating Third Order ...\n"); + fprintf(screen, " Total # of atoms = " BIGINT_FORMAT "\n", natoms); + fprintf(screen, " Atoms in group = " BIGINT_FORMAT "\n", gcount); + fprintf(screen, " Total third order elements = " + BIGINT_FORMAT "\n", (dynlen * dynlen * dynlen)); + } update->nsteps = 0; int prog = 0; From 0909b4da9214c07da16793b76c70358759e8bc55 Mon Sep 17 00:00:00 2001 From: Sievers Date: Thu, 4 Nov 2021 11:35:31 -0700 Subject: [PATCH 023/174] Updated dynamical matrix command to work with intel potentials --- src/PHONON/dynamical_matrix.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index 6a0c744d99..e13ab05b7f 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -22,6 +22,7 @@ #include "atom.h" #include "bond.h" #include "comm.h" +#include "compute.h" #include "dihedral.h" #include "domain.h" #include "error.h" @@ -48,7 +49,7 @@ enum{REGULAR,ESKM}; DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Command(lmp), fp(nullptr) { - external_force_clear = 1; + external_force_clear = 0; } /* ---------------------------------------------------------------------- */ @@ -77,7 +78,6 @@ void DynamicalMatrix::setup() if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); domain->reset_box(); - comm->setup(); if (neighbor->style) neighbor->setup_bins(); comm->exchange(); comm->borders(); @@ -87,12 +87,14 @@ void DynamicalMatrix::setup() neighbor->build(1); // compute all forces - external_force_clear = 0; + int ifix = modify->find_fix("package_omp"); + if (ifix >= 0) external_force_clear = 1; eflag=0; vflag=0; update_force(); - modify->setup(vflag); + if (pair_compute_flag) force->pair->compute(eflag,vflag); + else if (force->pair) force->pair->compute_dummy(eflag,vflag); update->setupflag = 0; //if all then skip communication groupmap population @@ -248,8 +250,6 @@ void DynamicalMatrix::openfile(const char *filename) if (!fp) error->one(FLERR,"Cannot open dynmat file: {}", utils::getsyserror()); } - if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); - file_opened = 1; } @@ -425,9 +425,17 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { + neighbor->decide(); // needed for intel potentials to work force_clear(); + int n_pre_force = modify->n_pre_force; + int n_pre_reverse = modify->n_pre_reverse; int n_post_force = modify->n_post_force; + if (n_pre_force) { + modify->pre_force(vflag); + timer->stamp(Timer::MODIFY); + } + if (pair_compute_flag) { force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); @@ -443,11 +451,14 @@ void DynamicalMatrix::update_force() force->kspace->compute(eflag,vflag); timer->stamp(Timer::KSPACE); } + if (n_pre_reverse) { + modify->pre_reverse(eflag,vflag); + timer->stamp(Timer::MODIFY); + } if (force->newton) { comm->reverse_comm(); timer->stamp(Timer::COMM); } - // force modifications if (n_post_force) modify->post_force(vflag); From 5e7f2cf54fee40d7bebc03f6dfb2a7ebdc38bbce Mon Sep 17 00:00:00 2001 From: Sievers Date: Thu, 4 Nov 2021 14:33:16 -0700 Subject: [PATCH 024/174] Changed tab spacing from 4 to 2, to be in line with lammps standards --- src/PHONON/dynamical_matrix.cpp | 798 ++++++++++++++++---------------- 1 file changed, 398 insertions(+), 400 deletions(-) diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index e13ab05b7f..d7c0ab17b0 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -49,7 +49,7 @@ enum{REGULAR,ESKM}; DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Command(lmp), fp(nullptr) { - external_force_clear = 0; + external_force_clear = 0; } /* ---------------------------------------------------------------------- */ @@ -72,119 +72,118 @@ DynamicalMatrix::~DynamicalMatrix() void DynamicalMatrix::setup() { - // setup domain, communication and neighboring - // acquire ghosts - // build neighbor lists - if (triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - if (neighbor->style) neighbor->setup_bins(); - comm->exchange(); - comm->borders(); - if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); - domain->image_check(); - domain->box_too_small_check(); - neighbor->build(1); + // setup domain, communication and neighboring + // acquire ghosts + // build neighbor lists + if (triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (neighbor->style) neighbor->setup_bins(); + comm->exchange(); + comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + domain->image_check(); + domain->box_too_small_check(); + neighbor->build(1); - // compute all forces - int ifix = modify->find_fix("package_omp"); - if (ifix >= 0) external_force_clear = 1; - eflag=0; - vflag=0; - update_force(); + // compute all forces + if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; + eflag=0; + vflag=0; + update_force(); - if (pair_compute_flag) force->pair->compute(eflag,vflag); - else if (force->pair) force->pair->compute_dummy(eflag,vflag); - update->setupflag = 0; + if (pair_compute_flag) force->pair->compute(eflag,vflag); + else if (force->pair) force->pair->compute_dummy(eflag,vflag); + update->setupflag = 0; - //if all then skip communication groupmap population - if (gcount == atom->natoms) - for (bigint i=0; inatoms; i++) - groupmap[i] = i; - else - create_groupmap(); + //if all then skip communication groupmap population + if (gcount == atom->natoms) + for (bigint i=0; inatoms; i++) + groupmap[i] = i; + else + create_groupmap(); } /* ---------------------------------------------------------------------- */ void DynamicalMatrix::command(int narg, char **arg) { - MPI_Comm_rank(world,&me); + MPI_Comm_rank(world,&me); - if (domain->box_exist == 0) - error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); - if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); + if (domain->box_exist == 0) + error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); + if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); - lmp->init(); + lmp->init(); - // orthogonal vs triclinic simulation box + // orthogonal vs triclinic simulation box - triclinic = domain->triclinic; + triclinic = domain->triclinic; - if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; - else pair_compute_flag = 0; - if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; - else kspace_compute_flag = 0; + if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; + else pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; + else kspace_compute_flag = 0; - // group and style + // group and style - igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); - groupbit = group->bitmask[igroup]; - gcount = group->count(igroup); - dynlen = (gcount)*3; - memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); - update->setupflag = 1; + igroup = group->find(arg[0]); + if (igroup == -1) error->all(FLERR,"Could not find dynamical matrix group ID"); + groupbit = group->bitmask[igroup]; + gcount = group->count(igroup); + dynlen = (gcount)*3; + memory->create(groupmap,atom->natoms,"total_group_map:totalgm"); + update->setupflag = 1; - int style = -1; - if (strcmp(arg[1],"regular") == 0) style = REGULAR; - else if (strcmp(arg[1],"eskm") == 0) style = ESKM; - else error->all(FLERR,"Illegal Dynamical_matrix command"); - del = utils::numeric(FLERR, arg[2],false,lmp); + int style = -1; + if (strcmp(arg[1],"regular") == 0) style = REGULAR; + else if (strcmp(arg[1],"eskm") == 0) style = ESKM; + else error->all(FLERR,"Illegal Dynamical_matrix command"); + del = utils::numeric(FLERR, arg[2],false,lmp); - // set option defaults + // set option defaults - binaryflag = 0; - scaleflag = 0; - compressed = 0; - file_flag = 0; - file_opened = 0; - folded = 0; - conversion = 1; + binaryflag = 0; + scaleflag = 0; + compressed = 0; + file_flag = 0; + file_opened = 0; + folded = 0; + conversion = 1; - // read options from end of input line - if (style == REGULAR) options(narg-3,&arg[3]); - else if (style == ESKM) options(narg-3,&arg[3]); - else if (me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); + // read options from end of input line + if (style == REGULAR) options(narg-3,&arg[3]); + else if (style == ESKM) options(narg-3,&arg[3]); + else if (me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); - if (!folded) dynlenb = dynlen; - else dynlenb = (atom->natoms)*3; + if (!folded) dynlenb = dynlen; + else dynlenb = (atom->natoms)*3; - if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"Dynamical_matrix command requires an atom map"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR,"Dynamical_matrix command requires an atom map"); - // move atoms by 3-vector or specified variable(s) + // move atoms by 3-vector or specified variable(s) - if (style == REGULAR) { - setup(); - timer->init(); - timer->barrier_start(); - calculateMatrix(); - timer->barrier_stop(); - } + if (style == REGULAR) { + setup(); + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } - if (style == ESKM) { - setup(); - convert_units(update->unit_style); - conversion = conv_energy/conv_distance/conv_mass; - timer->init(); - timer->barrier_start(); - calculateMatrix(); - timer->barrier_stop(); - } + if (style == ESKM) { + setup(); + convert_units(update->unit_style); + conversion = conv_energy/conv_distance/conv_mass; + timer->init(); + timer->barrier_start(); + calculateMatrix(); + timer->barrier_stop(); + } - Finish finish(lmp); - finish.end(1); + Finish finish(lmp); + finish.end(1); } /* ---------------------------------------------------------------------- @@ -193,37 +192,37 @@ void DynamicalMatrix::command(int narg, char **arg) void DynamicalMatrix::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); - int iarg = 0; - const char* filename = "dynmat.dyn"; + if (narg < 0) error->all(FLERR,"Illegal dynamical_matrix command"); + int iarg = 0; + const char* filename = "dynmat.dyn"; - while (iarg < narg) { - if (strcmp(arg[iarg],"binary") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - if (strcmp(arg[iarg+1],"gzip") == 0) { - compressed = 1; - } else { - binaryflag = utils::logical(FLERR,arg[iarg+1],false,lmp); - } - iarg += 2; - } else if (strcmp(arg[iarg],"file") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - filename = arg[iarg + 1]; - file_flag = 1; - iarg += 2; - } else if (strcmp(arg[iarg],"fold") == 0) { - if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); - if (strcmp(arg[iarg+1],"yes") == 0) { - folded = 1; - } else if (strcmp(arg[iarg+1],"no") == 0) { - folded = 0; - } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); - iarg += 2; - } else error->all(FLERR,"Illegal dynamical_matrix command"); - } - if (file_flag == 1) { - openfile(filename); - } + while (iarg < narg) { + if (strcmp(arg[iarg],"binary") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"gzip") == 0) { + compressed = 1; + } else { + binaryflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + } + iarg += 2; + } else if (strcmp(arg[iarg],"file") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + filename = arg[iarg + 1]; + file_flag = 1; + iarg += 2; + } else if (strcmp(arg[iarg],"fold") == 0) { + if (iarg+2 > narg) error->all(FLERR, "Illegal dynamical_matrix command"); + if (strcmp(arg[iarg+1],"yes") == 0) { + folded = 1; + } else if (strcmp(arg[iarg+1],"no") == 0) { + folded = 0; + } else error->all(FLERR,"Illegal input for dynamical_matrix fold option"); + iarg += 2; + } else error->all(FLERR,"Illegal dynamical_matrix command"); + } + if (file_flag == 1) { + openfile(filename); + } } /* ---------------------------------------------------------------------- @@ -234,23 +233,23 @@ void DynamicalMatrix::options(int narg, char **arg) void DynamicalMatrix::openfile(const char *filename) { - // if file already opened, return - if (file_opened) return; - fp = nullptr; + // if file already opened, return + if (file_opened) return; + fp = nullptr; - if (me == 0) { - if (compressed) { - fp = platform::compressed_write(std::string(filename)+".gz"); - if (!fp) error->one(FLERR,"Cannot open compressed file"); - } else if (binaryflag) { - fp = fopen(filename,"wb"); - } else { - fp = fopen(filename,"w"); - } - if (!fp) error->one(FLERR,"Cannot open dynmat file: {}", utils::getsyserror()); + if (me == 0) { + if (compressed) { + fp = platform::compressed_write(std::string(filename)+".gz"); + if (!fp) error->one(FLERR,"Cannot open compressed file"); + } else if (binaryflag) { + fp = fopen(filename,"wb"); + } else { + fp = fopen(filename,"w"); } + if (!fp) error->one(FLERR,"Cannot open dynmat file: {}", utils::getsyserror()); + } - file_opened = 1; + file_opened = 1; } /* ---------------------------------------------------------------------- @@ -259,112 +258,112 @@ void DynamicalMatrix::openfile(const char *filename) void DynamicalMatrix::calculateMatrix() { - int local_idx; // local index - int local_jdx; // second local index - int nlocal = atom->nlocal; - bigint natoms = atom->natoms; - int *type = atom->type; - bigint *gm = groupmap; - double imass; // dynamical matrix element - double *m = atom->mass; - double **f = atom->f; + int local_idx; // local index + int local_jdx; // second local index + int nlocal = atom->nlocal; + bigint natoms = atom->natoms; + int *type = atom->type; + bigint *gm = groupmap; + double imass; // dynamical matrix element + double *m = atom->mass; + double **f = atom->f; - double **dynmat = new double*[3]; - for (int i=0; i<3; i++) - dynmat[i] = new double[dynlenb]; + double **dynmat = new double*[3]; + for (int i=0; i<3; i++) + dynmat[i] = new double[dynlenb]; - double **fdynmat = new double*[3]; - for (int i=0; i<3; i++) - fdynmat[i] = new double[dynlenb]; + double **fdynmat = new double*[3]; + for (int i=0; i<3; i++) + fdynmat[i] = new double[dynlenb]; - //initialize dynmat to all zeros + //initialize dynmat to all zeros + dynmat_clear(dynmat); + + if (me == 0 && screen) { + fprintf(screen,"Calculating Dynamical Matrix ...\n"); + fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); + fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); + fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlen*dynlen) ); + } + + // emit dynlen rows of dimalpha*dynlen*dimbeta elements + + update->nsteps = 0; + int prog = 0; + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if (gm[i-1] < 0) + continue; + for (int alpha=0; alpha<3; alpha++) { + displace_atom(local_idx, alpha, 1); + update_force(); + for (bigint j=1; j<=natoms; j++) { + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && (gm[j-1] >= 0 || folded)){ + if (folded) { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; + } + } else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; + } + } + } + } + displace_atom(local_idx,alpha,-2); + update_force(); + for (bigint j=1; j<=natoms; j++) { + local_jdx = atom->map(j); + if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal + && (gm[j-1] >= 0 || folded)){ + if (atom->rmass_flag == 1) + imass = sqrt(m[local_idx] * m[local_jdx]); + else + imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); + if (folded){ + for (int beta=0; beta<3; beta++){ + dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); + dynmat[alpha][(j-1)*3+beta] *= conversion; + } + } else { + for (int beta=0; beta<3; beta++){ + dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; + dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); + dynmat[alpha][gm[j-1]*3+beta] *= conversion; + } + } + } + } + displace_atom(local_idx,alpha,1); + } + for (int k=0; k<3; k++) + MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); + if (me == 0) + writeMatrix(fdynmat); dynmat_clear(dynmat); - if (me == 0 && screen) { - fprintf(screen,"Calculating Dynamical Matrix ...\n"); - fprintf(screen," Total # of atoms = " BIGINT_FORMAT "\n", natoms); - fprintf(screen," Atoms in group = " BIGINT_FORMAT "\n", gcount); - fprintf(screen," Total dynamical matrix elements = " BIGINT_FORMAT "\n", (dynlen*dynlen) ); + int p = 10 * gm[i-1] / gcount; + if (p > prog) { + prog = p; + fprintf(screen," %d%%",p*10); + fflush(screen); + } } + } + if (me == 0 && screen) fprintf(screen,"\n"); - // emit dynlen rows of dimalpha*dynlen*dimbeta elements + for (int i=0; i < 3; i++) + delete [] dynmat[i]; + delete [] dynmat; - update->nsteps = 0; - int prog = 0; - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if (gm[i-1] < 0) - continue; - for (int alpha=0; alpha<3; alpha++) { - displace_atom(local_idx, alpha, 1); - update_force(); - for (bigint j=1; j<=natoms; j++) { - local_jdx = atom->map(j); - if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && (gm[j-1] >= 0 || folded)){ - if (folded) { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][(j-1)*3+beta] -= f[local_jdx][beta]; - } - } else { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= f[local_jdx][beta]; - } - } - } - } - displace_atom(local_idx,alpha,-2); - update_force(); - for (bigint j=1; j<=natoms; j++) { - local_jdx = atom->map(j); - if (local_idx >= 0 && local_jdx >= 0 && local_jdx < nlocal - && (gm[j-1] >= 0 || folded)){ - if (atom->rmass_flag == 1) - imass = sqrt(m[local_idx] * m[local_jdx]); - else - imass = sqrt(m[type[local_idx]] * m[type[local_jdx]]); - if (folded){ - for (int beta=0; beta<3; beta++){ - dynmat[alpha][(j-1)*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][(j-1)*3+beta] /= (2 * del * imass); - dynmat[alpha][(j-1)*3+beta] *= conversion; - } - } else { - for (int beta=0; beta<3; beta++){ - dynmat[alpha][gm[j-1]*3+beta] -= -f[local_jdx][beta]; - dynmat[alpha][gm[j-1]*3+beta] /= (2 * del * imass); - dynmat[alpha][gm[j-1]*3+beta] *= conversion; - } - } - } - } - displace_atom(local_idx,alpha,1); - } - for (int k=0; k<3; k++) - MPI_Reduce(dynmat[k],fdynmat[k],dynlenb,MPI_DOUBLE,MPI_SUM,0,world); - if (me == 0) - writeMatrix(fdynmat); - dynmat_clear(dynmat); - if (me == 0 && screen) { - int p = 10 * gm[i-1] / gcount; - if (p > prog) { - prog = p; - fprintf(screen," %d%%",p*10); - fflush(screen); - } - } - } - if (me == 0 && screen) fprintf(screen,"\n"); + for (int i=0; i < 3; i++) + delete [] fdynmat[i]; + delete [] fdynmat; - for (int i=0; i < 3; i++) - delete [] dynmat[i]; - delete [] dynmat; - - for (int i=0; i < 3; i++) - delete [] fdynmat[i]; - delete [] fdynmat; - - if (screen && me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); + if (screen && me ==0 ) fprintf(screen,"Finished Calculating Dynamical Matrix\n"); } /* ---------------------------------------------------------------------- @@ -373,25 +372,25 @@ void DynamicalMatrix::calculateMatrix() void DynamicalMatrix::writeMatrix(double **dynmat) { - if (me != 0 || !fp) - return; + if (me != 0 || !fp) + return; - clearerr(fp); - if (binaryflag) { - for (int i=0; i<3; i++) - fwrite(dynmat[i], sizeof(double), dynlenb, fp); - if (ferror(fp)) - error->one(FLERR, "Error writing to binary file"); - } else { - for (int i = 0; i < 3; i++) { - for (bigint j = 0; j < dynlenb; j++) { - if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); - else fprintf(fp, "%4.8f ",dynmat[i][j]); - } - } - if (ferror(fp)) - error->one(FLERR,"Error writing to file"); + clearerr(fp); + if (binaryflag) { + for (int i=0; i<3; i++) + fwrite(dynmat[i], sizeof(double), dynlenb, fp); + if (ferror(fp)) + error->one(FLERR, "Error writing to binary file"); + } else { + for (int i = 0; i < 3; i++) { + for (bigint j = 0; j < dynlenb; j++) { + if ((j+1)%3==0) fprintf(fp, "%4.8f\n", dynmat[i][j]); + else fprintf(fp, "%4.8f ",dynmat[i][j]); + } } + if (ferror(fp)) + error->one(FLERR,"Error writing to file"); + } } /* ---------------------------------------------------------------------- @@ -400,18 +399,18 @@ void DynamicalMatrix::writeMatrix(double **dynmat) void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) { - if (local_idx < 0) return; + if (local_idx < 0) return; - double **x = atom->x; - int *sametag = atom->sametag; - int j = local_idx; + double **x = atom->x; + int *sametag = atom->sametag; + int j = local_idx; - x[local_idx][direction] += del*magnitude; + x[local_idx][direction] += del*magnitude; - while (sametag[j] >= 0) { - j = sametag[j]; - x[j][direction] += del*magnitude; - } + while (sametag[j] >= 0) { + j = sametag[j]; + x[j][direction] += del*magnitude; + } } @@ -425,46 +424,46 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { - neighbor->decide(); // needed for intel potentials to work - force_clear(); - int n_pre_force = modify->n_pre_force; - int n_pre_reverse = modify->n_pre_reverse; - int n_post_force = modify->n_post_force; + neighbor->decide(); // needed for intel potentials to work + force_clear(); + int n_pre_force = modify->n_pre_force; + int n_pre_reverse = modify->n_pre_reverse; + int n_post_force = modify->n_post_force; - if (n_pre_force) { - modify->pre_force(vflag); - timer->stamp(Timer::MODIFY); - } - - if (pair_compute_flag) { - force->pair->compute(eflag,vflag); - timer->stamp(Timer::PAIR); - } - if (atom->molecular != Atom::ATOMIC) { - if (force->bond) force->bond->compute(eflag,vflag); - if (force->angle) force->angle->compute(eflag,vflag); - if (force->dihedral) force->dihedral->compute(eflag,vflag); - if (force->improper) force->improper->compute(eflag,vflag); - timer->stamp(Timer::BOND); - } - if (kspace_compute_flag) { - force->kspace->compute(eflag,vflag); - timer->stamp(Timer::KSPACE); - } - if (n_pre_reverse) { - modify->pre_reverse(eflag,vflag); - timer->stamp(Timer::MODIFY); - } - if (force->newton) { - comm->reverse_comm(); - timer->stamp(Timer::COMM); - } - // force modifications - - if (n_post_force) modify->post_force(vflag); + if (n_pre_force) { + modify->pre_force(vflag); timer->stamp(Timer::MODIFY); + } - ++ update->nsteps; + if (pair_compute_flag) { + force->pair->compute(eflag,vflag); + timer->stamp(Timer::PAIR); + } + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag,vflag); + if (force->angle) force->angle->compute(eflag,vflag); + if (force->dihedral) force->dihedral->compute(eflag,vflag); + if (force->improper) force->improper->compute(eflag,vflag); + timer->stamp(Timer::BOND); + } + if (kspace_compute_flag) { + force->kspace->compute(eflag,vflag); + timer->stamp(Timer::KSPACE); + } + if (n_pre_reverse) { + modify->pre_reverse(eflag,vflag); + timer->stamp(Timer::MODIFY); + } + if (force->newton) { + comm->reverse_comm(); + timer->stamp(Timer::COMM); + } + // force modifications + + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + + ++ update->nsteps; } /* ---------------------------------------------------------------------- @@ -474,17 +473,17 @@ void DynamicalMatrix::update_force() void DynamicalMatrix::force_clear() { - if (external_force_clear) return; + if (external_force_clear) return; - // clear global force array - // if either newton flag is set, also include ghosts + // clear global force array + // if either newton flag is set, also include ghosts - size_t nbytes = sizeof(double) * atom->nlocal; - if (force->newton) nbytes += sizeof(double) * atom->nghost; + size_t nbytes = sizeof(double) * atom->nlocal; + if (force->newton) nbytes += sizeof(double) * atom->nghost; - if (nbytes) { - memset(&atom->f[0][0],0,3*nbytes); - } + if (nbytes) { + memset(&atom->f[0][0],0,3*nbytes); + } } /* ---------------------------------------------------------------------- @@ -493,67 +492,66 @@ void DynamicalMatrix::force_clear() void DynamicalMatrix::dynmat_clear(double **dynmat) { + size_t nbytes = sizeof(double) * dynlenb; - size_t nbytes = sizeof(double) * dynlenb; - - if (nbytes) { - for (int i=0; i<3; i++) - memset(&dynmat[i][0],0,nbytes); - } + if (nbytes) { + for (int i=0; i<3; i++) + memset(&dynmat[i][0],0,nbytes); + } } /* ---------------------------------------------------------------------- */ void DynamicalMatrix::convert_units(const char *style) { - // physical constants from: - // https://physics.nist.gov/cuu/Constants/Table/allascii.txt - // using thermochemical calorie = 4.184 J + // physical constants from: + // https://physics.nist.gov/cuu/Constants/Table/allascii.txt + // using thermochemical calorie = 4.184 J - if (strcmp(style,"lj") == 0) { - error->all(FLERR,"Conversion Not Set"); - //conversion = 1; // lj -> 10 J/mol + if (strcmp(style,"lj") == 0) { + error->all(FLERR,"Conversion Not Set"); + //conversion = 1; // lj -> 10 J/mol - } else if (strcmp(style,"real") == 0) { - conv_energy = 418.4; // kcal/mol -> 10 J/mol - conv_mass = 1; // g/mol -> g/mol - conv_distance = 1; // angstrom -> angstrom + } else if (strcmp(style,"real") == 0) { + conv_energy = 418.4; // kcal/mol -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom - } else if (strcmp(style,"metal") == 0) { - conv_energy = 9648.5; // eV -> 10 J/mol - conv_mass = 1; // g/mol -> g/mol - conv_distance = 1; // angstrom -> angstrom + } else if (strcmp(style,"metal") == 0) { + conv_energy = 9648.5; // eV -> 10 J/mol + conv_mass = 1; // g/mol -> g/mol + conv_distance = 1; // angstrom -> angstrom - } else if (strcmp(style,"si") == 0) { - if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); - conv_energy = 6.022E22; // J -> 10 J/mol - conv_mass = 6.022E26; // kg -> g/mol - conv_distance = 1E-10; // meter -> angstrom + } else if (strcmp(style,"si") == 0) { + if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E22; // J -> 10 J/mol + conv_mass = 6.022E26; // kg -> g/mol + conv_distance = 1E-10; // meter -> angstrom - } else if (strcmp(style,"cgs") == 0) { - if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); - conv_energy = 6.022E12; // Erg -> 10 J/mol - conv_mass = 6.022E23; // g -> g/mol - conv_distance = 1E-7; // centimeter -> angstrom + } else if (strcmp(style,"cgs") == 0) { + if (me) error->warning(FLERR,"Conversion Warning: Multiplication by Large Float"); + conv_energy = 6.022E12; // Erg -> 10 J/mol + conv_mass = 6.022E23; // g -> g/mol + conv_distance = 1E-7; // centimeter -> angstrom - } else if (strcmp(style,"electron") == 0) { - conv_energy = 262550; // Hartree -> 10 J/mol - conv_mass = 1; // amu -> g/mol - conv_distance = 0.529177249; // bohr -> angstrom + } else if (strcmp(style,"electron") == 0) { + conv_energy = 262550; // Hartree -> 10 J/mol + conv_mass = 1; // amu -> g/mol + conv_distance = 0.529177249; // bohr -> angstrom - } else if (strcmp(style,"micro") == 0) { - if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); - conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol - conv_mass = 6.022E11; // pg -> g/mol - conv_distance = 1E-4; // micrometer -> angstrom + } else if (strcmp(style,"micro") == 0) { + if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E10; // picogram-micrometer^2/microsecond^2 -> 10 J/mol + conv_mass = 6.022E11; // pg -> g/mol + conv_distance = 1E-4; // micrometer -> angstrom - } else if (strcmp(style,"nano") == 0) { - if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); - conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol - conv_mass = 6.022E5; // ag -> g/mol - conv_distance = 0.1; // angstrom -> angstrom + } else if (strcmp(style,"nano") == 0) { + if (me) error->warning(FLERR,"Conversion Warning: Untested Conversion"); + conv_energy = 6.022E4; // attogram-nanometer^2/nanosecond^2 -> 10 J/mol + conv_mass = 6.022E5; // ag -> g/mol + conv_distance = 0.1; // angstrom -> angstrom - } else error->all(FLERR,"Units Type Conversion Not Found"); + } else error->all(FLERR,"Units Type Conversion Not Found"); } @@ -561,66 +559,66 @@ void DynamicalMatrix::convert_units(const char *style) void DynamicalMatrix::create_groupmap() { - //Create a group map which maps atom order onto group - // groupmap[global atom index-1] = output column/row + //Create a group map which maps atom order onto group + // groupmap[global atom index-1] = output column/row - int local_idx; // local index - int gid = 0; //group index - int nlocal = atom->nlocal; - int *mask = atom->mask; - bigint natoms = atom->natoms; - int *recv = new int[comm->nprocs]; - int *displs = new int[comm->nprocs]; - bigint *temp_groupmap = new bigint[natoms]; + int local_idx; // local index + int gid = 0; //group index + int nlocal = atom->nlocal; + int *mask = atom->mask; + bigint natoms = atom->natoms; + int *recv = new int[comm->nprocs]; + int *displs = new int[comm->nprocs]; + bigint *temp_groupmap = new bigint[natoms]; - //find number of local atoms in the group (final_gid) - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) - gid += 1; // gid at the end of loop is final_Gid + //find number of local atoms in the group (final_gid) + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) + gid += 1; // gid at the end of loop is final_Gid + } + //create an array of length final_gid + bigint *sub_groupmap = new bigint[gid]; + + gid = 0; + //create a map between global atom id and group atom id for each proc + for (bigint i=1; i<=natoms; i++) { + local_idx = atom->map(i); + if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) { + sub_groupmap[gid] = i; + gid += 1; } - //create an array of length final_gid - bigint *sub_groupmap = new bigint[gid]; + } - gid = 0; - //create a map between global atom id and group atom id for each proc - for (bigint i=1; i<=natoms; i++) { - local_idx = atom->map(i); - if ((local_idx >= 0) && (local_idx < nlocal) && mask[local_idx] & groupbit) { - sub_groupmap[gid] = i; - gid += 1; - } - } + //populate arrays for Allgatherv + for (int i=0; i < comm->nprocs; i++) { + recv[i] = 0; + } + recv[me] = gid; + MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); + for (int i=0; inprocs; i++) { + recv[i]=displs[i]; + if (i>0) displs[i] = displs[i-1]+recv[i-1]; + else displs[i] = 0; + } - //populate arrays for Allgatherv - for (int i=0; i < comm->nprocs; i++) { - recv[i] = 0; - } - recv[me] = gid; - MPI_Allreduce(recv,displs,comm->nprocs,MPI_INT,MPI_SUM,world); - for (int i=0; inprocs; i++) { - recv[i]=displs[i]; - if (i>0) displs[i] = displs[i-1]+recv[i-1]; - else displs[i] = 0; - } + //combine subgroup maps into total temporary groupmap + MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world); + std::sort(temp_groupmap,temp_groupmap+gcount); - //combine subgroup maps into total temporary groupmap - MPI_Allgatherv(sub_groupmap,gid,MPI_LMP_BIGINT,temp_groupmap,recv,displs,MPI_LMP_BIGINT,world); - std::sort(temp_groupmap,temp_groupmap+gcount); + //populate member groupmap based on temp groupmap + bigint j = 0; + for (bigint i=1; i<=natoms; i++) { + // flag groupmap contents that are in temp_groupmap + if (j < gcount && i == temp_groupmap[j]) + groupmap[i-1] = j++; + else + groupmap[i-1] = -1; + } - //populate member groupmap based on temp groupmap - bigint j = 0; - for (bigint i=1; i<=natoms; i++) { - // flag groupmap contents that are in temp_groupmap - if (j < gcount && i == temp_groupmap[j]) - groupmap[i-1] = j++; - else - groupmap[i-1] = -1; - } - - //free that memory! - delete[] recv; - delete[] displs; - delete[] sub_groupmap; - delete[] temp_groupmap; + //free that memory! + delete[] recv; + delete[] displs; + delete[] sub_groupmap; + delete[] temp_groupmap; } From 367c9dff0585ad03b96b0f141b397b094ab5995e Mon Sep 17 00:00:00 2001 From: Sievers Date: Tue, 9 Nov 2021 15:21:39 -0800 Subject: [PATCH 025/174] Compilable kokkos dynamical matrix command --- cmake/Modules/Packages/KOKKOS.cmake | 5 + src/Depend.sh | 4 + src/KOKKOS/Install.sh | 2 + src/KOKKOS/dynamical_matrix_kokkos.cpp | 338 +++++++++++++++++++++++++ src/KOKKOS/dynamical_matrix_kokkos.h | 45 ++++ src/PHONON/dynamical_matrix.h | 9 +- 6 files changed, 398 insertions(+), 5 deletions(-) create mode 100644 src/KOKKOS/dynamical_matrix_kokkos.cpp create mode 100644 src/KOKKOS/dynamical_matrix_kokkos.h diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index fe6c17801e..38da364903 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -109,6 +109,11 @@ if(PKG_KSPACE) endif() endif() + +if(PKG_PHONON) + list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/dynamical_matrix_kokkos.cpp) +endif() + set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}") # detects styles which have KOKKOS version diff --git a/src/Depend.sh b/src/Depend.sh index af88f24bb4..15a8f84d23 100755 --- a/src/Depend.sh +++ b/src/Depend.sh @@ -131,6 +131,10 @@ if (test $1 = "PYTHON") then depend ML-IAP fi +if (test $1 = "PHONON") then + depend KOKKOS +fi + if (test $1 = "RIGID") then depend KOKKOS depend OPENMP diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index 04bf84ed31..cc3f3907af 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -106,6 +106,8 @@ action dihedral_opls_kokkos.cpp dihedral_opls.cpp action dihedral_opls_kokkos.h dihedral_opls.h action domain_kokkos.cpp action domain_kokkos.h +action dynamical_matrix_kokkos.cpp dynamical_matrix.cpp +action dynamical_matrix_kokkos.h dynamical_matrix.h action fftdata_kokkos.h fft3d.h action fft3d_kokkos.cpp fft3d.cpp action fft3d_kokkos.h fft3d.h diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp new file mode 100644 index 0000000000..f9f871d01a --- /dev/null +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -0,0 +1,338 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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. + ----------------------------------------------------------------------- */ + +// +// Created by charlie sievers on 6/21/18. +// + +#include "dynamical_matrix_kokkos.h" + +#include "angle.h" +#include "atom_kokkos.h" +#include "atom_masks.h" +#include "bond.h" +#include "comm.h" +#include "compute.h" +#include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "force.h" +#include "group.h" +#include "improper.h" +#include "kokkos.h" +#include "kspace.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" +#include "pair.h" +#include "timer.h" +#include "update.h" + +#include +#include +#include + +using namespace LAMMPS_NS; +enum{REGULAR,ESKM}; + +template +struct ForceAdder { + ViewA a; + ViewB b; + ForceAdder(const ViewA& a_, const ViewB& b_):a(a_),b(b_) {} + KOKKOS_INLINE_FUNCTION + void operator() (const int& i) const { + a(i,0) += b(i,0); + a(i,1) += b(i,1); + a(i,2) += b(i,2); + } +}; + +/* ---------------------------------------------------------------------- */ + +template +struct Zero { + View v; + Zero(const View &v_):v(v_) {} + KOKKOS_INLINE_FUNCTION + void operator()(const int &i) const { + v(i,0) = 0; + v(i,1) = 0; + v(i,2) = 0; + } +}; + +/* ---------------------------------------------------------------------- */ + +DynamicalMatrixKokkos::DynamicalMatrixKokkos(LAMMPS *lmp) : DynamicalMatrix(lmp) +{ + atomKK = (AtomKokkos *) atom; +} + +/* ---------------------------------------------------------------------- */ + +DynamicalMatrixKokkos::~DynamicalMatrixKokkos() +{ + +} + +/* ---------------------------------------------------------------------- */ + +void DynamicalMatrixKokkos::command(int narg, char **arg) +{ + atomKK->sync(Host, X_MASK|RMASS_MASK|TYPE_MASK); + DynamicalMatrix::command(narg, arg); +} + +/* ---------------------------------------------------------------------- + setup without output or one-time post-init setup + flag = 0 = just force calculation + flag = 1 = reneighbor and force calculation +------------------------------------------------------------------------- */ + +void DynamicalMatrixKokkos::setup() +{ + lmp->kokkos->auto_sync = 1; + + // setup domain, communication and neighboring + // acquire ghosts + // build neighbor lists + if (triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (neighbor->style) neighbor->setup_bins(); + comm->exchange(); + comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + domain->image_check(); + domain->box_too_small_check(); + neighbor->build(1); + + // compute all forces + if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; + eflag=0; + vflag=0; + update_force(); + + if (pair_compute_flag) { + atomKK->sync(force->pair->execution_space,force->pair->datamask_read); + force->pair->compute(eflag,vflag); + atomKK->modified(force->pair->execution_space,force->pair->datamask_modify); + } + else if (force->pair) force->pair->compute_dummy(eflag,vflag); + update->setupflag = 0; + + lmp->kokkos->auto_sync = 0; +} + +/* ---------------------------------------------------------------------- + evaluate potential energy and forces + may migrate atoms due to reneighboring + return new energy, which should include nextra_global dof + return negative gradient stored in atom->f + return negative gradient for nextra_global dof in fextra +------------------------------------------------------------------------- */ + +void DynamicalMatrixKokkos::update_force() +{ + int n_pre_force = modify->n_pre_force; + int n_pre_reverse = modify->n_pre_reverse; + int n_post_force = modify->n_post_force; + + lmp->kokkos->auto_sync = 0; + + f_merge_copy = DAT::t_f_array("DynamicalMatrixKokkos::f_merge_copy",atomKK->k_f.extent(0)); + + atomKK->sync(Device,X_MASK); + + force_clear(); + + neighbor->decide(); // needed for intel potentials to work + + + if (n_pre_force) { + modify->pre_force(vflag); + timer->stamp(Timer::MODIFY); + } + + bool execute_on_host = false; + unsigned int datamask_read_device = 0; + unsigned int datamask_modify_device = 0; + unsigned int datamask_read_host = 0; + + if (pair_compute_flag) { + if (force->pair->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->pair->datamask_read; + datamask_modify_device |= force->pair->datamask_modify; + } else { + datamask_read_device |= force->pair->datamask_read; + datamask_modify_device |= force->pair->datamask_modify; + } + } + if (atomKK->molecular && force->bond) { + if (force->bond->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->bond->datamask_read; + datamask_modify_device |= force->bond->datamask_modify; + } else { + datamask_read_device |= force->bond->datamask_read; + datamask_modify_device |= force->bond->datamask_modify; + } + } + if (atomKK->molecular && force->angle) { + if (force->angle->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->angle->datamask_read; + datamask_modify_device |= force->angle->datamask_modify; + } else { + datamask_read_device |= force->angle->datamask_read; + datamask_modify_device |= force->angle->datamask_modify; + } + } + if (atomKK->molecular && force->dihedral) { + if (force->dihedral->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->dihedral->datamask_read; + datamask_modify_device |= force->dihedral->datamask_modify; + } else { + datamask_read_device |= force->dihedral->datamask_read; + datamask_modify_device |= force->dihedral->datamask_modify; + } + } + if (atomKK->molecular && force->improper) { + if (force->improper->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->improper->datamask_read; + datamask_modify_device |= force->improper->datamask_modify; + } else { + datamask_read_device |= force->improper->datamask_read; + datamask_modify_device |= force->improper->datamask_modify; + } + } + if (kspace_compute_flag) { + if (force->kspace->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->kspace->datamask_read; + datamask_modify_device |= force->kspace->datamask_modify; + } else { + datamask_read_device |= force->kspace->datamask_read; + datamask_modify_device |= force->kspace->datamask_modify; + } + } + + + if (pair_compute_flag) { + atomKK->sync(force->pair->execution_space,force->pair->datamask_read); + atomKK->sync(force->pair->execution_space,~(~force->pair->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + Kokkos::Timer ktimer; + force->pair->compute(eflag,vflag); + atomKK->modified(force->pair->execution_space,force->pair->datamask_modify); + atomKK->modified(force->pair->execution_space,~(~force->pair->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + timer->stamp(Timer::PAIR); + } + + if (execute_on_host) { + if (pair_compute_flag && force->pair->datamask_modify!=(F_MASK | ENERGY_MASK | VIRIAL_MASK)) + Kokkos::fence(); + atomKK->sync_overlapping_device(Host,~(~datamask_read_host|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + if (pair_compute_flag && force->pair->execution_space!=Host) { + Kokkos::deep_copy(LMPHostType(),atomKK->k_f.h_view,0.0); + } + } + + if (atomKK->molecular) { + if (force->bond) { + atomKK->sync(force->bond->execution_space,~(~force->bond->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->bond->compute(eflag,vflag); + atomKK->modified(force->bond->execution_space,~(~force->bond->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + if (force->angle) { + atomKK->sync(force->angle->execution_space,~(~force->angle->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->angle->compute(eflag,vflag); + atomKK->modified(force->angle->execution_space,~(~force->angle->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + if (force->dihedral) { + atomKK->sync(force->dihedral->execution_space,~(~force->dihedral->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->dihedral->compute(eflag,vflag); + atomKK->modified(force->dihedral->execution_space,~(~force->dihedral->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + if (force->improper) { + atomKK->sync(force->improper->execution_space,~(~force->improper->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->improper->compute(eflag,vflag); + atomKK->modified(force->improper->execution_space,~(~force->improper->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + timer->stamp(Timer::BOND); + } + + if (kspace_compute_flag) { + atomKK->sync(force->kspace->execution_space,~(~force->kspace->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->kspace->compute(eflag,vflag); + atomKK->modified(force->kspace->execution_space,~(~force->kspace->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + timer->stamp(Timer::KSPACE); + } + + if (execute_on_host && !std::is_same::value) { + if (f_merge_copy.extent(0)k_f.extent(0)) { + f_merge_copy = DAT::t_f_array("DynamicalMatrixKokkos::f_merge_copy",atomKK->k_f.extent(0)); + } + f = atomKK->k_f.d_view; + Kokkos::deep_copy(LMPHostType(),f_merge_copy,atomKK->k_f.h_view); + Kokkos::parallel_for(atomKK->k_f.extent(0), + ForceAdder(atomKK->k_f.d_view,f_merge_copy)); + atomKK->k_f.clear_sync_state(); // special case + atomKK->k_f.modify(); + } + if (n_pre_reverse) { + modify->pre_reverse(eflag,vflag); + timer->stamp(Timer::MODIFY); + } + if (force->newton) { + comm->reverse_comm(); + timer->stamp(Timer::COMM); + } + // force modifications + + if (n_post_force) modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + + atomKK->sync(Host,F_MASK); + lmp->kokkos->auto_sync = 1; + + ++ update->nsteps; +} + +/* ---------------------------------------------------------------------- + clear force on own & ghost atoms + clear other arrays as needed +------------------------------------------------------------------------- */ + +void DynamicalMatrixKokkos::force_clear() +{ + if (external_force_clear) return; + + atomKK->k_f.clear_sync_state(); // ignore host forces/torques since device views + + // clear force on all particles + // if either newton flag is set, also include ghosts + // when using threads always clear all forces. + + int nall = atomKK->nlocal; + if (force->newton) nall += atomKK->nghost; + + Kokkos::parallel_for(nall, Zero::t_f_array>(atomKK->k_f.view())); + atomKK->modified(Device,F_MASK); + +} diff --git a/src/KOKKOS/dynamical_matrix_kokkos.h b/src/KOKKOS/dynamical_matrix_kokkos.h new file mode 100644 index 0000000000..9e9268423d --- /dev/null +++ b/src/KOKKOS/dynamical_matrix_kokkos.h @@ -0,0 +1,45 @@ +// +// Created by charlie sievers on 6/21/18. +// + +#ifdef COMMAND_CLASS +// clang-format off +CommandStyle(dynamical_matrix/kk,DynamicalMatrixKokkos); +CommandStyle(dynamical_matrix/kk/device,DynamicalMatrixKokkos); +CommandStyle(dynamical_matrix/kk/host,DynamicalMatrixKokkos); +// clang-format on +#else + +#ifndef LMP_DYNAMICAL_MATRIX_KOKKOS_H +#define LMP_DYNAMICAL_MATRIX_KOKKOS_H + +#include "dynamical_matrix.h" +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +class DynamicalMatrixKokkos : public DynamicalMatrix { + public: + DynamicalMatrixKokkos(class LAMMPS *); + virtual ~DynamicalMatrixKokkos(); + void command(int, char **); + void setup(); + + KOKKOS_INLINE_FUNCTION + void operator() (const int& i) const { + f(i,0) += f_merge_copy(i,0); + f(i,1) += f_merge_copy(i,1); + f(i,2) += f_merge_copy(i,2); + } + + protected: + void update_force(); + void force_clear(); + DAT::t_f_array f_merge_copy,f; + + +}; +} // namespace LAMMPS_NS + +#endif //LMP_DYNAMICAL_MATRIX_KOKKOS_H +#endif diff --git a/src/PHONON/dynamical_matrix.h b/src/PHONON/dynamical_matrix.h index 0d1ba0c4d4..ceb717943d 100644 --- a/src/PHONON/dynamical_matrix.h +++ b/src/PHONON/dynamical_matrix.h @@ -19,8 +19,8 @@ class DynamicalMatrix : public Command { public: DynamicalMatrix(class LAMMPS *); virtual ~DynamicalMatrix(); - void command(int, char **); - void setup(); + virtual void command(int, char **); + virtual void setup(); protected: int eflag, vflag; // flags for energy/virial computation @@ -34,11 +34,10 @@ class DynamicalMatrix : public Command { int nvec; // local atomic dof = length of xvec - void update_force(); - void force_clear(); + virtual void update_force(); + virtual void force_clear(); virtual void openfile(const char *filename); - private: void options(int, char **); void calculateMatrix(); void dynmat_clear(double **dynmat); From f733453f0547ecb206e5077f168c313a7a55194a Mon Sep 17 00:00:00 2001 From: Lewis M Russell <71833891+lrussell676@users.noreply.github.com> Date: Wed, 10 Nov 2021 09:25:13 +0000 Subject: [PATCH 026/174] Intpos (#11) * hbond comm added for rsq_hb * lrefpos removed, extract scaled for oxDNA1 * Update pair_oxdna_hbond.cpp * nxyz extract scaled across DNA2/RNA2 * oxDNA2/RNA2 updated to match oxDNA styling from upstream merge * whitespace corrections also removed unnecessary local unit vector from oxRNA2_xstk * whitespace correction in oxdna_coaxstk --- src/CG-DNA/bond_oxdna_fene.cpp | 17 +++++++++++--- src/CG-DNA/pair_oxdna2_coaxstk.cpp | 30 ++++++++++++++++++------- src/CG-DNA/pair_oxdna2_coaxstk.h | 3 +++ src/CG-DNA/pair_oxdna2_dh.cpp | 36 +++++++++++++++++++++++------- src/CG-DNA/pair_oxdna2_dh.h | 3 +++ src/CG-DNA/pair_oxdna_coaxstk.cpp | 10 ++++----- src/CG-DNA/pair_oxdna_coaxstk.h | 2 +- src/CG-DNA/pair_oxdna_excv.cpp | 26 ++++++++++----------- src/CG-DNA/pair_oxdna_hbond.cpp | 12 +++++----- src/CG-DNA/pair_oxdna_hbond.h | 4 ++-- src/CG-DNA/pair_oxdna_stk.cpp | 12 +++++----- src/CG-DNA/pair_oxdna_stk.h | 2 +- src/CG-DNA/pair_oxdna_xstk.cpp | 6 ++--- src/CG-DNA/pair_oxdna_xstk.h | 2 +- src/CG-DNA/pair_oxrna2_stk.cpp | 36 +++++++++++++++++++++++------- src/CG-DNA/pair_oxrna2_stk.h | 3 +++ src/CG-DNA/pair_oxrna2_xstk.cpp | 29 ++++++++++++++++++------ src/CG-DNA/pair_oxrna2_xstk.h | 3 +++ 18 files changed, 164 insertions(+), 72 deletions(-) diff --git a/src/CG-DNA/bond_oxdna_fene.cpp b/src/CG-DNA/bond_oxdna_fene.cpp index 3652856a52..4db0fb4cf1 100644 --- a/src/CG-DNA/bond_oxdna_fene.cpp +++ b/src/CG-DNA/bond_oxdna_fene.cpp @@ -172,8 +172,8 @@ void BondOxdnaFene::compute(int eflag, int vflag) ebond = 0.0; ev_init(eflag, vflag); - - // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv + + // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -190,10 +190,21 @@ void BondOxdnaFene::compute(int eflag, int vflag) ax[0] = nx_xtrct[a][0]; ax[1] = nx_xtrct[a][1]; ax[2] = nx_xtrct[a][2]; + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; bx[0] = nx_xtrct[b][0]; bx[1] = nx_xtrct[b][1]; bx[2] = nx_xtrct[b][2]; - // (a/b)y/z not needed here as oxDNA(1) co-linear + by[0] = ny_xtrct[b][0]; + by[1] = ny_xtrct[b][1]; + by[2] = ny_xtrct[b][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; // vector COM-backbone site a and b compute_interaction_sites(ax, ay, az, ra_cs); diff --git a/src/CG-DNA/pair_oxdna2_coaxstk.cpp b/src/CG-DNA/pair_oxdna2_coaxstk.cpp index e8ab197be1..8b3609983b 100644 --- a/src/CG-DNA/pair_oxdna2_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna2_coaxstk.cpp @@ -118,9 +118,9 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) double ra_cs[3],ra_cst[3]; double rb_cs[3],rb_cst[3]; - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -149,6 +149,11 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; + // n(x/z)_xtrct = extracted local unit vectors from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); + // loop over pair interaction neighbors of my atoms for (ia = 0; ia < anum; ia++) { @@ -156,8 +161,9 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; // vector COM a - stacking site a ra_cst[0] = d_cst*ax[0]; @@ -180,8 +186,9 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; // vector COM b - stacking site b rb_cst[0] = d_cst*bx[0]; @@ -232,6 +239,13 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) // early rejection criterium if (f4f6t1) { + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; + cost4 = MathExtra::dot3(az,bz); if (cost4 > 1.0) cost4 = 1.0; if (cost4 < -1.0) cost4 = -1.0; @@ -306,7 +320,7 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) DF4(theta6p, a_cxst6[atype][btype], theta_cxst6_0[atype][btype], dtheta_cxst6_ast[atype][btype], b_cxst6[atype][btype], dtheta_cxst6_c[atype][btype])*rsint; - // force, torque and virial contribution for forces between stacking sites + // force, torque and virial contribution for forces between stacking sites fpair = 0.0; diff --git a/src/CG-DNA/pair_oxdna2_coaxstk.h b/src/CG-DNA/pair_oxdna2_coaxstk.h index 2a323be579..7b376fa368 100644 --- a/src/CG-DNA/pair_oxdna2_coaxstk.h +++ b/src/CG-DNA/pair_oxdna2_coaxstk.h @@ -61,6 +61,9 @@ class PairOxdna2Coaxstk : public Pair { double **AA_cxst1, **BB_cxst1; + // per-atom arrays for local unit vectors + double **nx_xtrct, **nz_xtrct; + virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna2_dh.cpp b/src/CG-DNA/pair_oxdna2_dh.cpp index 1a587e82e1..cf79fd07cf 100644 --- a/src/CG-DNA/pair_oxdna2_dh.cpp +++ b/src/CG-DNA/pair_oxdna2_dh.cpp @@ -87,10 +87,9 @@ void PairOxdna2Dh::compute(int eflag, int vflag) // vectors COM-backbone sites in lab frame double ra_cs[3],rb_cs[3]; - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; - double *special_lj = force->special_lj; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -100,6 +99,7 @@ void PairOxdna2Dh::compute(int eflag, int vflag) int nlocal = atom->nlocal; int newton_pair = force->newton_pair; int *alist,*blist,*numneigh,**firstneigh; + double *special_lj = force->special_lj; AtomVecEllipsoid *avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); AtomVecEllipsoid::Bonus *bonus = avec->bonus; @@ -115,6 +115,12 @@ void PairOxdna2Dh::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); + // loop over pair interaction neighbors of my atoms for (ia = 0; ia < anum; ia++) { @@ -122,8 +128,15 @@ void PairOxdna2Dh::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; // vector COM-backbone site a compute_interaction_sites(ax,ay,az,ra_cs); @@ -142,8 +155,15 @@ void PairOxdna2Dh::compute(int eflag, int vflag) b &= NEIGHMASK; btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + by[0] = ny_xtrct[b][0]; + by[1] = ny_xtrct[b][1]; + by[2] = ny_xtrct[b][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; // vector COM-backbone site b compute_interaction_sites(bx,by,bz,rb_cs); diff --git a/src/CG-DNA/pair_oxdna2_dh.h b/src/CG-DNA/pair_oxdna2_dh.h index 925b53e322..d7075f2988 100644 --- a/src/CG-DNA/pair_oxdna2_dh.h +++ b/src/CG-DNA/pair_oxdna2_dh.h @@ -46,6 +46,9 @@ class PairOxdna2Dh : public Pair { double **qeff_dh_pf, **kappa_dh; double **b_dh, **cut_dh_ast, **cutsq_dh_ast, **cut_dh_c, **cutsq_dh_c; + // per-atom arrays for local unit vectors + double **nx_xtrct, **ny_xtrct, **nz_xtrct; + virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna_coaxstk.cpp b/src/CG-DNA/pair_oxdna_coaxstk.cpp index e03de69f57..e6cf59f072 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna_coaxstk.cpp @@ -159,7 +159,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; - // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv + // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -252,7 +252,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // early rejection criterium if (f4t1) { - + az[0] = nz_xtrct[a][0]; az[1] = nz_xtrct[a][1]; az[2] = nz_xtrct[a][2]; @@ -395,9 +395,9 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // cosphi3 and cosphi4 (=cosphi3) force and virial if (cosphi3) { - ay[0] = ny_xtrct[a][0]; - ay[1] = ny_xtrct[a][1]; - ay[2] = ny_xtrct[a][2]; + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; finc = -f2 * f4t1* f4t4 * f4t5 * f4t6 * 2.0 * f5c3 * df5c3 * factor_lj; fpair += finc; diff --git a/src/CG-DNA/pair_oxdna_coaxstk.h b/src/CG-DNA/pair_oxdna_coaxstk.h index 050fd5b06a..28813a034f 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.h +++ b/src/CG-DNA/pair_oxdna_coaxstk.h @@ -62,7 +62,7 @@ class PairOxdnaCoaxstk : public Pair { double **a_cxst3p, **cosphi_cxst3p_ast, **b_cxst3p, **cosphi_cxst3p_c; double **a_cxst4p, **cosphi_cxst4p_ast, **b_cxst4p, **cosphi_cxst4p_c; - + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index 2ae5995ebb..ae5752028a 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -39,7 +39,7 @@ PairOxdnaExcv::PairOxdnaExcv(LAMMPS *lmp) : Pair(lmp) { single_enable = 0; writedata = 1; - + // set comm size needed by this Pair comm_forward = 9; } @@ -49,7 +49,7 @@ PairOxdnaExcv::PairOxdnaExcv(LAMMPS *lmp) : Pair(lmp) PairOxdnaExcv::~PairOxdnaExcv() { if (allocated) { - + memory->destroy(nx); memory->destroy(ny); memory->destroy(nz); @@ -127,7 +127,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) // Cartesian unit vectors in lab frame double ax[3],ay[3],az[3]; double bx[3],by[3],bz[3]; - + double *special_lj = force->special_lj; double **x = atom->x; @@ -152,12 +152,12 @@ void PairOxdnaExcv::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - - // loop over all local atoms, calculation of local reference frame + + // loop over all local atoms, calculation of local reference frame for (in = 0; in < atom->nlocal; in++) { - + int n = alist[in]; - double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame + double *qn,nx_temp[3],ny_temp[3],nz_temp[3]; // quaternion and Cartesian unit vectors in lab frame qn=bonus[ellipsoid[n]].quat; MathExtra::q_to_exyz(qn,nx_temp,ny_temp,nz_temp); @@ -171,9 +171,9 @@ void PairOxdnaExcv::compute(int eflag, int vflag) nz[n][0] = nz_temp[0]; nz[n][1] = nz_temp[1]; nz[n][2] = nz_temp[2]; - + } - + comm->forward_comm_pair(this); // loop over pair interaction neighbors of my atoms @@ -181,7 +181,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) for (ia = 0; ia < anum; ia++) { a = alist[ia]; - atype = type[a]; + atype = type[a]; ax[0] = nx[a][0]; ax[1] = nx[a][1]; @@ -191,7 +191,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) ay[2] = ny[a][2]; az[0] = nz[a][0]; az[1] = nz[a][1]; - az[2] = nz[a][2]; + az[2] = nz[a][2]; // vector COM - backbone and base site a compute_interaction_sites(ax,ay,az,ra_cs,ra_cb); @@ -892,7 +892,7 @@ void PairOxdnaExcv::unpack_forward_comm(int n, int first, double *buf) nz[i][0] = buf[m++]; nz[i][1] = buf[m++]; nz[i][2] = buf[m++]; - } + } } /* ---------------------------------------------------------------------- */ @@ -900,7 +900,7 @@ void PairOxdnaExcv::unpack_forward_comm(int n, int first, double *buf) void *PairOxdnaExcv::extract(const char *str, int &dim) { dim = 2; - + if (strcmp(str,"nx") == 0) return (void *) nx; if (strcmp(str,"ny") == 0) return (void *) ny; if (strcmp(str,"nz") == 0) return (void *) nz; diff --git a/src/CG-DNA/pair_oxdna_hbond.cpp b/src/CG-DNA/pair_oxdna_hbond.cpp index eb04d74f2e..3d2e803aa8 100644 --- a/src/CG-DNA/pair_oxdna_hbond.cpp +++ b/src/CG-DNA/pair_oxdna_hbond.cpp @@ -178,8 +178,8 @@ void PairOxdnaHbond::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - - // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv + + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -195,7 +195,7 @@ void PairOxdnaHbond::compute(int eflag, int vflag) ax[0] = nx_xtrct[a][0]; ax[1] = nx_xtrct[a][1]; ax[2] = nx_xtrct[a][2]; - + ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; ra_chb[2] = d_chb*ax[2]; @@ -214,7 +214,7 @@ void PairOxdnaHbond::compute(int eflag, int vflag) bx[0] = nx_xtrct[b][0]; bx[1] = nx_xtrct[b][1]; bx[2] = nx_xtrct[b][2]; - + rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; rb_chb[2] = d_chb*bx[2]; @@ -270,8 +270,8 @@ void PairOxdnaHbond::compute(int eflag, int vflag) b_hb3[atype][btype], dtheta_hb3_c[atype][btype]); // early rejection criterium - if (f4t3) { - + if (f4t3) { + az[0] = nz_xtrct[a][0]; az[1] = nz_xtrct[a][1]; az[2] = nz_xtrct[a][2]; diff --git a/src/CG-DNA/pair_oxdna_hbond.h b/src/CG-DNA/pair_oxdna_hbond.h index 1a138e82de..4afd9b8ad6 100644 --- a/src/CG-DNA/pair_oxdna_hbond.h +++ b/src/CG-DNA/pair_oxdna_hbond.h @@ -66,9 +66,9 @@ class PairOxdnaHbond : public Pair { double **a_hb8, **theta_hb8_0, **dtheta_hb8_ast; double **b_hb8, **dtheta_hb8_c; - + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors - + int seqdepflag; virtual void allocate(); diff --git a/src/CG-DNA/pair_oxdna_stk.cpp b/src/CG-DNA/pair_oxdna_stk.cpp index 7665abbb79..feeb41d78b 100644 --- a/src/CG-DNA/pair_oxdna_stk.cpp +++ b/src/CG-DNA/pair_oxdna_stk.cpp @@ -254,8 +254,8 @@ void PairOxdnaStk::compute(int eflag, int vflag) evdwl = 0.0; ev_init(eflag,vflag); - - // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv + + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -342,13 +342,13 @@ void PairOxdnaStk::compute(int eflag, int vflag) // early rejection criterium if (f1) { - + az[0] = nz_xtrct[a][0]; az[1] = nz_xtrct[a][1]; az[2] = nz_xtrct[a][2]; bz[0] = nz_xtrct[b][0]; bz[1] = nz_xtrct[b][1]; - bz[2] = nz_xtrct[b][2]; + bz[2] = nz_xtrct[b][2]; // theta4 angle and correction cost4 = MathExtra::dot3(bz,az); @@ -373,10 +373,10 @@ void PairOxdnaStk::compute(int eflag, int vflag) // early rejection criterium if (f4t5) { - + ay[0] = ny_xtrct[a][0]; ay[1] = ny_xtrct[a][1]; - ay[2] = ny_xtrct[a][2]; + ay[2] = ny_xtrct[a][2]; by[0] = ny_xtrct[b][0]; by[1] = ny_xtrct[b][1]; by[2] = ny_xtrct[b][2]; diff --git a/src/CG-DNA/pair_oxdna_stk.h b/src/CG-DNA/pair_oxdna_stk.h index 1f8a3a9249..5dbe9ea1e9 100644 --- a/src/CG-DNA/pair_oxdna_stk.h +++ b/src/CG-DNA/pair_oxdna_stk.h @@ -59,7 +59,7 @@ class PairOxdnaStk : public Pair { double **b_st6, **dtheta_st6_c; double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; - + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors diff --git a/src/CG-DNA/pair_oxdna_xstk.cpp b/src/CG-DNA/pair_oxdna_xstk.cpp index bfb0d185a9..61dc1a8100 100644 --- a/src/CG-DNA/pair_oxdna_xstk.cpp +++ b/src/CG-DNA/pair_oxdna_xstk.cpp @@ -155,8 +155,8 @@ void PairOxdnaXstk::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - - // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv + + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); ny_xtrct = (double **) force->pair->extract("ny",dim); @@ -250,7 +250,7 @@ void PairOxdnaXstk::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { - + az[0] = nz_xtrct[a][0]; az[1] = nz_xtrct[a][1]; az[2] = nz_xtrct[a][2]; diff --git a/src/CG-DNA/pair_oxdna_xstk.h b/src/CG-DNA/pair_oxdna_xstk.h index 2ad4c6027c..7695effc89 100644 --- a/src/CG-DNA/pair_oxdna_xstk.h +++ b/src/CG-DNA/pair_oxdna_xstk.h @@ -65,7 +65,7 @@ class PairOxdnaXstk : public Pair { double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; - + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors diff --git a/src/CG-DNA/pair_oxrna2_stk.cpp b/src/CG-DNA/pair_oxrna2_stk.cpp index 18cd798fc7..c5fa47e25e 100644 --- a/src/CG-DNA/pair_oxrna2_stk.cpp +++ b/src/CG-DNA/pair_oxrna2_stk.cpp @@ -245,9 +245,9 @@ void PairOxrna2Stk::compute(int eflag, int vflag) double ra_cs[3],ra_cst[3]; double rb_cs[3],rb_cst[3]; - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -274,6 +274,12 @@ void PairOxrna2Stk::compute(int eflag, int vflag) evdwl = 0.0; ev_init(eflag,vflag); + // n(x/y/z)_xtrct = extracted local unit vectors from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + ny_xtrct = (double **) force->pair->extract("ny",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); + // loop over stacking interaction neighbors using bond topology for (in = 0; in < nbondlist; in++) { @@ -290,12 +296,26 @@ void PairOxrna2Stk::compute(int eflag, int vflag) } - // a now in 3' direction, b in 5' direction + // a now in 3' direction, b in 5' direction - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; + ay[0] = ny_xtrct[a][0]; + ay[1] = ny_xtrct[a][1]; + ay[2] = ny_xtrct[a][2]; + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; + by[0] = ny_xtrct[b][0]; + by[1] = ny_xtrct[b][1]; + by[2] = ny_xtrct[b][2]; + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; // vector COM a - 5'-stacking site a ra_cst[0] = d_cst_x_5p*ax[0] + d_cst_y_5p*ay[0]; diff --git a/src/CG-DNA/pair_oxrna2_stk.h b/src/CG-DNA/pair_oxrna2_stk.h index 23650c98b5..e15614f126 100644 --- a/src/CG-DNA/pair_oxrna2_stk.h +++ b/src/CG-DNA/pair_oxrna2_stk.h @@ -61,6 +61,9 @@ class PairOxrna2Stk : public Pair { double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; + // per-atom arrays for local unit vectors + double **nx_xtrct, **ny_xtrct, **nz_xtrct; + int seqdepflag; virtual void allocate(); diff --git a/src/CG-DNA/pair_oxrna2_xstk.cpp b/src/CG-DNA/pair_oxrna2_xstk.cpp index 8b44a9bde1..1f069e6b2f 100644 --- a/src/CG-DNA/pair_oxrna2_xstk.cpp +++ b/src/CG-DNA/pair_oxrna2_xstk.cpp @@ -120,9 +120,9 @@ void PairOxrna2Xstk::compute(int eflag, int vflag) // vectors COM-h-bonding site in lab frame double ra_chb[3],rb_chb[3]; - // quaternions and Cartesian unit vectors in lab frame - double *qa,ax[3],ay[3],az[3]; - double *qb,bx[3],by[3],bz[3]; + // Cartesian unit vectors in lab frame + double ax[3],ay[3],az[3]; + double bx[3],by[3],bz[3]; double **x = atom->x; double **f = atom->f; @@ -151,6 +151,11 @@ void PairOxrna2Xstk::compute(int eflag, int vflag) numneigh = list->numneigh; firstneigh = list->firstneigh; + // n(x/z)_xtrct = extracted local unit vectors from oxdna_excv + int dim; + nx_xtrct = (double **) force->pair->extract("nx",dim); + nz_xtrct = (double **) force->pair->extract("nz",dim); + // loop over pair interaction neighbors of my atoms for (ia = 0; ia < anum; ia++) { @@ -158,8 +163,9 @@ void PairOxrna2Xstk::compute(int eflag, int vflag) a = alist[ia]; atype = type[a]; - qa=bonus[ellipsoid[a]].quat; - MathExtra::q_to_exyz(qa,ax,ay,az); + ax[0] = nx_xtrct[a][0]; + ax[1] = nx_xtrct[a][1]; + ax[2] = nx_xtrct[a][2]; ra_chb[0] = d_chb*ax[0]; ra_chb[1] = d_chb*ax[1]; @@ -176,8 +182,9 @@ void PairOxrna2Xstk::compute(int eflag, int vflag) btype = type[b]; - qb=bonus[ellipsoid[b]].quat; - MathExtra::q_to_exyz(qb,bx,by,bz); + bx[0] = nx_xtrct[b][0]; + bx[1] = nx_xtrct[b][1]; + bx[2] = nx_xtrct[b][2]; rb_chb[0] = d_chb*bx[0]; rb_chb[1] = d_chb*bx[1]; @@ -236,6 +243,10 @@ void PairOxrna2Xstk::compute(int eflag, int vflag) // early rejection criterium if (f4t3) { + az[0] = nz_xtrct[a][0]; + az[1] = nz_xtrct[a][1]; + az[2] = nz_xtrct[a][2]; + cost7 = -1.0*MathExtra::dot3(az,delr_hb_norm); if (cost7 > 1.0) cost7 = 1.0; if (cost7 < -1.0) cost7 = -1.0; @@ -250,6 +261,10 @@ void PairOxrna2Xstk::compute(int eflag, int vflag) // early rejection criterium if (f4t7) { + bz[0] = nz_xtrct[b][0]; + bz[1] = nz_xtrct[b][1]; + bz[2] = nz_xtrct[b][2]; + cost8 = MathExtra::dot3(bz,delr_hb_norm); if (cost8 > 1.0) cost8 = 1.0; if (cost8 < -1.0) cost8 = -1.0; diff --git a/src/CG-DNA/pair_oxrna2_xstk.h b/src/CG-DNA/pair_oxrna2_xstk.h index 187d0b67ae..6ece8e3f32 100644 --- a/src/CG-DNA/pair_oxrna2_xstk.h +++ b/src/CG-DNA/pair_oxrna2_xstk.h @@ -62,6 +62,9 @@ class PairOxrna2Xstk : public Pair { double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; + // per-atom arrays for local unit vectors + double **nx_xtrct, **nz_xtrct; + virtual void allocate(); }; From d178a5ffa39a35ce67c2faa7c3e4b23826325e42 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Wed, 17 Nov 2021 13:12:44 +0000 Subject: [PATCH 027/174] Extended test script --- examples/PACKAGES/cgdna/examples/test.sh | 224 +++++++++++++++++------ 1 file changed, 168 insertions(+), 56 deletions(-) diff --git a/examples/PACKAGES/cgdna/examples/test.sh b/examples/PACKAGES/cgdna/examples/test.sh index 795be9ef88..2e68ccab08 100755 --- a/examples/PACKAGES/cgdna/examples/test.sh +++ b/examples/PACKAGES/cgdna/examples/test.sh @@ -1,8 +1,9 @@ #! /bin/bash -DATE='2Jul21' -LMPDIR=/Users/ohenrich/Work/code/lammps +DATE='27Oct21' +TOL=1e-8 +LMPDIR=/Users/ohenrich/Work/code/lammps SRCDIR=$LMPDIR/src EXDIR=$LMPDIR/examples/PACKAGES/cgdna/examples @@ -11,6 +12,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then cd $SRCDIR make clean-all + make purge + make pu + make ps make -j8 mpi ###################################################### @@ -24,15 +28,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex1 > /dev/null mv log.lammps log.$DATE.duplex1.g++.1 - grep etot log.$DATE.duplex1.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex1.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex1 > /dev/null mv log.lammps log.$DATE.duplex1.g++.4 - grep etot log.$DATE.duplex1.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex1.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### @@ -47,15 +63,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex2 > /dev/null mv log.lammps log.$DATE.duplex2.g++.1 - grep etot log.$DATE.duplex2.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex2.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex2 > /dev/null mv log.lammps log.$DATE.duplex2.g++.4 - grep etot log.$DATE.duplex2.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex2.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### @@ -70,15 +98,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex1 > /dev/null mv log.lammps log.$DATE.duplex1.g++.1 - grep etot log.$DATE.duplex1.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex1.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex1 > /dev/null mv log.lammps log.$DATE.duplex1.g++.4 - grep etot log.$DATE.duplex1.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex1.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### @@ -93,15 +133,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex2 > /dev/null mv log.lammps log.$DATE.duplex2.g++.1 - grep etot log.$DATE.duplex2.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex2.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex2 > /dev/null mv log.lammps log.$DATE.duplex2.g++.4 - grep etot log.$DATE.duplex2.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex2.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### @@ -116,15 +168,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex3 > /dev/null mv log.lammps log.$DATE.duplex3.g++.1 - grep etot log.$DATE.duplex3.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex3.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex3 > /dev/null mv log.lammps log.$DATE.duplex3.g++.4 - grep etot log.$DATE.duplex3.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex3.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### @@ -141,27 +205,51 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex4.4type > /dev/null mv log.lammps log.$DATE.duplex4.4type.g++.1 - grep etot log.$DATE.duplex4.4type.g++.1 > e_test.dat - grep etot ../log*4type*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex4.4type.g++.1 > e_test.4type.1.dat + grep etot ../log*4type*1 > e_old.4type.1.dat + ndiff -relerr $TOL e_test.4type.1.dat e_old.4type.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task 4 types passed" + else + echo "# 1 MPI-task 4 types unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex4.4type > /dev/null mv log.lammps log.$DATE.duplex4.4type.g++.4 - grep etot log.$DATE.duplex4.4type.g++.4 > e_test.dat - grep etot ../log*4type*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex4.4type.g++.4 > e_test.4type.4.dat + grep etot ../log*4type*4 > e_old.4type.4.dat + ndiff -relerr $TOL e_test.4type.4.dat e_old.4type.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks 4 types passed" + else + echo "# 4 MPI-tasks 4 types unsuccessful" + fi mpirun -np 1 ./lmp_mpi < in.duplex4.8type > /dev/null mv log.lammps log.$DATE.duplex4.8type.g++.1 - grep etot log.$DATE.duplex4.8type.g++.1 > e_test.dat - grep etot ../log*8type*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex4.8type.g++.1 > e_test.8type.1.dat + grep etot ../log*8type*1 > e_old.8type.1.dat + ndiff -relerr $TOL e_test.8type.1.dat e_old.8type.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task 8 types passed" + else + echo "# 1 MPI-task 8 types unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex4.8type > /dev/null mv log.lammps log.$DATE.duplex4.8type.g++.4 - grep etot log.$DATE.duplex4.8type.g++.4 > e_test.dat - grep etot ../log*8type*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex4.8type.g++.4 > e_test.8type.4.dat + grep etot ../log*8type*4 > e_old.8type.4.dat + ndiff -relerr $TOL e_test.8type.4.dat e_old.8type.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks 8 types passed" + else + echo "# 4 MPI-tasks 8 types unsuccessful" + fi ###################################################### @@ -176,15 +264,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.dsring > /dev/null mv log.lammps log.$DATE.dsring.g++.1 - grep etot log.$DATE.dsring.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.dsring.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.dsring > /dev/null mv log.lammps log.$DATE.dsring.g++.4 - grep etot log.$DATE.dsring.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.dsring.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### @@ -199,15 +299,27 @@ if [ $# -eq 1 ] && [ $1 = run ]; then mpirun -np 1 ./lmp_mpi < in.duplex2 > /dev/null mv log.lammps log.$DATE.duplex2.g++.1 - grep etot log.$DATE.duplex2.g++.1 > e_test.dat - grep etot ../log*1 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex2.g++.1 > e_test.1.dat + grep etot ../log*1 > e_old.1.dat + ndiff -relerr $TOL e_test.1.dat e_old.1.dat + if [ $? -eq 0 ]; + then + echo "# 1 MPI-task passed" + else + echo "# 1 MPI-task unsuccessful" + fi mpirun -np 4 ./lmp_mpi < in.duplex2 > /dev/null mv log.lammps log.$DATE.duplex2.g++.4 - grep etot log.$DATE.duplex2.g++.4 > e_test.dat - grep etot ../log*4 > e_old.dat - ndiff -relerr 1e-8 e_test.dat e_old.dat + grep etot log.$DATE.duplex2.g++.4 > e_test.4.dat + grep etot ../log*4 > e_old.4.dat + ndiff -relerr $TOL e_test.4.dat e_old.4.dat + if [ $? -eq 0 ]; + then + echo "# 4 MPI-tasks passed" + else + echo "# 4 MPI-tasks unsuccessful" + fi ###################################################### echo '# Done' From 7544f1bcf8f11c8314e261fcf52774f7b0101247 Mon Sep 17 00:00:00 2001 From: Sievers Date: Wed, 17 Nov 2021 11:48:35 -0800 Subject: [PATCH 028/174] Fixed comm setup bug and external forces bug, still must look into if package omp needs to set external force flag to zero --- src/PHONON/dynamical_matrix.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index d7c0ab17b0..61734bcc82 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -78,6 +78,7 @@ void DynamicalMatrix::setup() if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); domain->reset_box(); + comm->setup(); if (neighbor->style) neighbor->setup_bins(); comm->exchange(); comm->borders(); @@ -87,13 +88,13 @@ void DynamicalMatrix::setup() neighbor->build(1); // compute all forces - if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; + // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; update_force(); - if (pair_compute_flag) force->pair->compute(eflag,vflag); - else if (force->pair) force->pair->compute_dummy(eflag,vflag); + // if (pair_compute_flag) force->pair->compute(eflag,vflag); + // else if (force->pair) force->pair->compute_dummy(eflag,vflag); update->setupflag = 0; //if all then skip communication groupmap population @@ -460,8 +461,10 @@ void DynamicalMatrix::update_force() } // force modifications - if (n_post_force) modify->post_force(vflag); - timer->stamp(Timer::MODIFY); + if (n_post_force) { + modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + } ++ update->nsteps; } From a887d880c6d28e3ab7fa78712de26741ce0edc1b Mon Sep 17 00:00:00 2001 From: Sievers Date: Mon, 13 Dec 2021 14:14:14 -0800 Subject: [PATCH 029/174] debugged kokkos support to dynamical_matrix command --- src/KOKKOS/dynamical_matrix_kokkos.cpp | 14 ++++++++++++-- src/input.cpp | 13 +++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp index f9f871d01a..7100830c89 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.cpp +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -135,6 +135,13 @@ void DynamicalMatrixKokkos::setup() update->setupflag = 0; lmp->kokkos->auto_sync = 0; + + //if all then skip communication groupmap population + if (gcount == atom->natoms) + for (bigint i=0; inatoms; i++) + groupmap[i] = i; + else + create_groupmap(); } /* ---------------------------------------------------------------------- @@ -155,6 +162,7 @@ void DynamicalMatrixKokkos::update_force() f_merge_copy = DAT::t_f_array("DynamicalMatrixKokkos::f_merge_copy",atomKK->k_f.extent(0)); + atomKK->modified(Host,X_MASK); atomKK->sync(Device,X_MASK); force_clear(); @@ -305,8 +313,10 @@ void DynamicalMatrixKokkos::update_force() } // force modifications - if (n_post_force) modify->post_force(vflag); - timer->stamp(Timer::MODIFY); + if (n_post_force) { + modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + } atomKK->sync(Host,F_MASK); lmp->kokkos->auto_sync = 1; diff --git a/src/input.cpp b/src/input.cpp index 08f62bdb42..89fddc7f21 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -783,6 +783,19 @@ int Input::execute_command() // invoke commands added via style_command.h + if (lmp && lmp->suffix_enable && utils::strmatch(command,"^dynamical_matrix")) { + if (utils::strmatch(lmp->suffix, "^kk")) { + std::string cstyle = command + std::string("/") + lmp->suffix; + if (command_map->find(command) != command_map->end()) { + CommandCreator &command_creator = (*command_map)[cstyle]; + Command *cmd = command_creator(lmp); + cmd->command(narg, arg); + delete cmd; + return 0; + } + } + } + if (command_map->find(command) != command_map->end()) { CommandCreator &command_creator = (*command_map)[command]; Command *cmd = command_creator(lmp); From d6048ba57620457dbe48538746f8a1f7a4b109c2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Dec 2021 08:41:49 -0500 Subject: [PATCH 030/174] added copyright/license header and updated author attribution --- src/KOKKOS/dynamical_matrix_kokkos.cpp | 2 +- src/KOKKOS/dynamical_matrix_kokkos.h | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp index 7100830c89..c72e113033 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.cpp +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -13,7 +13,7 @@ ----------------------------------------------------------------------- */ // -// Created by charlie sievers on 6/21/18. +// Contributing author: Charlie Sievers UC Davis (charliesievers at cox.net) // #include "dynamical_matrix_kokkos.h" diff --git a/src/KOKKOS/dynamical_matrix_kokkos.h b/src/KOKKOS/dynamical_matrix_kokkos.h index 9e9268423d..b0930e440c 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.h +++ b/src/KOKKOS/dynamical_matrix_kokkos.h @@ -1,6 +1,15 @@ -// -// Created by charlie sievers on 6/21/18. -// +/* -*- 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 COMMAND_CLASS // clang-format off From dee995f918a66d25e918c333563d0d848cd01418 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Dec 2021 09:05:28 -0500 Subject: [PATCH 031/174] consistent author attribution --- src/PHONON/dynamical_matrix.cpp | 2 +- src/PHONON/third_order.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index 61734bcc82..d866b4e306 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -13,7 +13,7 @@ ----------------------------------------------------------------------- */ // -// Created by charlie sievers on 6/21/18. +// Contributing author: Charlie Sievers, UC Davis (charliesievers at cox.net) // #include "dynamical_matrix.h" diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 69f5e5c930..ca69113b7d 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -13,7 +13,7 @@ ----------------------------------------------------------------------- */ // -// Created by charlie sievers on 7/5/18. +// Contributing author: Charlie Sievers, UC Davis (charliesievers at cox.net) // #include "third_order.h" From 1c38b7633febb867bc1ea2cb4a9cfea3007a6f78 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Dec 2021 09:06:04 -0500 Subject: [PATCH 032/174] generalize and simplify support for accelerated commands with suffixes --- src/input.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 89fddc7f21..af6107317a 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -782,22 +782,21 @@ int Input::execute_command() if (flag) return 0; // invoke commands added via style_command.h + // try suffixed version first - if (lmp && lmp->suffix_enable && utils::strmatch(command,"^dynamical_matrix")) { - if (utils::strmatch(lmp->suffix, "^kk")) { - std::string cstyle = command + std::string("/") + lmp->suffix; - if (command_map->find(command) != command_map->end()) { - CommandCreator &command_creator = (*command_map)[cstyle]; - Command *cmd = command_creator(lmp); - cmd->command(narg, arg); - delete cmd; - return 0; - } + std::string mycmd = command; + if (lmp->suffix_enable) { + mycmd = command + std::string("/") + lmp->suffix; + if (command_map->find(mycmd) == command_map->end()) { + if (lmp->suffix2) { + mycmd = command + std::string("/") + lmp->suffix2; + if (command_map->find(mycmd) == command_map->end()) + mycmd = command; + } else mycmd = command; } } - - if (command_map->find(command) != command_map->end()) { - CommandCreator &command_creator = (*command_map)[command]; + if (command_map->find(mycmd) != command_map->end()) { + CommandCreator &command_creator = (*command_map)[mycmd]; Command *cmd = command_creator(lmp); cmd->command(narg,arg); delete cmd; From 62cdf7ab2d31bf4df1c753e440a2a476a64bcba3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 14 Dec 2021 09:13:05 -0500 Subject: [PATCH 033/174] update docs --- doc/src/Commands_all.rst | 2 +- doc/src/dynamical_matrix.rst | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index c708228be7..080ad0886d 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -47,7 +47,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`displace_atoms ` * :doc:`dump ` * :doc:`dump_modify ` - * :doc:`dynamical_matrix ` + * :doc:`dynamical_matrix (k) ` * :doc:`echo ` * :doc:`fix ` * :doc:`fix_modify ` diff --git a/doc/src/dynamical_matrix.rst b/doc/src/dynamical_matrix.rst index 37b9e5b4a5..93e4c2a1aa 100644 --- a/doc/src/dynamical_matrix.rst +++ b/doc/src/dynamical_matrix.rst @@ -1,8 +1,11 @@ .. index:: dynamical_matrix +.. index:: dynamical_matrix/kk dynamical_matrix command ======================== +Accelerator Variants: dynamical_matrix/kk + Syntax """""" @@ -56,6 +59,12 @@ If the style eskm is selected, the dynamical matrix will be in units of inverse squared femtoseconds. These units will then conveniently leave frequencies in THz. +---------- + +.. include:: accel_styles.rst + +---------- + Restrictions """""""""""" From 40c0925cb41725c4ecf23fe6b6d20f44d3793794 Mon Sep 17 00:00:00 2001 From: Sievers Date: Tue, 14 Dec 2021 14:25:49 -0800 Subject: [PATCH 034/174] Updated and added third order kokkos --- cmake/Modules/Packages/KOKKOS.cmake | 1 + doc/src/Commands_all.rst | 2 +- doc/src/third_order.rst | 9 + src/KOKKOS/Install.sh | 2 + src/KOKKOS/third_order_kokkos.cpp | 349 ++++++++++++++++++++++++++++ src/KOKKOS/third_order_kokkos.h | 54 +++++ src/PHONON/third_order.cpp | 18 +- src/PHONON/third_order.h | 10 +- 8 files changed, 437 insertions(+), 8 deletions(-) create mode 100644 src/KOKKOS/third_order_kokkos.cpp create mode 100644 src/KOKKOS/third_order_kokkos.h diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index 93a0726a67..ebc5adff5b 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -112,6 +112,7 @@ endif() if(PKG_PHONON) list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/dynamical_matrix_kokkos.cpp) + list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/third_order_kokkos.cpp) endif() set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}") diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index 080ad0886d..8995ffdcc4 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -117,7 +117,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`thermo ` * :doc:`thermo_modify ` * :doc:`thermo_style ` - * :doc:`third_order ` + * :doc:`third_order (k) ` * :doc:`timer ` * :doc:`timestep ` * :doc:`uncompute ` diff --git a/doc/src/third_order.rst b/doc/src/third_order.rst index f020511aad..b163844365 100644 --- a/doc/src/third_order.rst +++ b/doc/src/third_order.rst @@ -1,8 +1,11 @@ .. index:: third_order +.. index:: third_order/kk third_order command =================== +Accelerator Variants: third_order/kk + Syntax """""" @@ -49,6 +52,12 @@ If the style eskm is selected, the tensor will be using energy units of 10 J/mol These units conform to eskm style from the dynamical_matrix command, which will simplify operations using dynamical matrices with third order tensors. +---------- + +.. include:: accel_styles.rst + +---------- + Restrictions """""""""""" diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index cc3f3907af..c23dc6bbc0 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -312,6 +312,8 @@ action remap_kokkos.cpp remap.cpp action remap_kokkos.h remap.h action sna_kokkos.h sna.h action sna_kokkos_impl.h sna.cpp +action third_order_kokkos.cpp dynamical_matrix.cpp +action third_order_kokkos.h dynamical_matrix.h action verlet_kokkos.cpp action verlet_kokkos.h diff --git a/src/KOKKOS/third_order_kokkos.cpp b/src/KOKKOS/third_order_kokkos.cpp new file mode 100644 index 0000000000..9a5a5ba7f6 --- /dev/null +++ b/src/KOKKOS/third_order_kokkos.cpp @@ -0,0 +1,349 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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. + ----------------------------------------------------------------------- */ + +// +// Contributing author: Charlie Sievers UC Davis (charliesievers at cox.net) +// + +#include "third_order_kokkos.h" + +#include "angle.h" +#include "atom_kokkos.h" +#include "atom_masks.h" +#include "bond.h" +#include "comm.h" +#include "compute.h" +#include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "force.h" +#include "group.h" +#include "improper.h" +#include "kokkos.h" +#include "kspace.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" +#include "pair.h" +#include "timer.h" +#include "update.h" + +#include +#include +#include + +using namespace LAMMPS_NS; +enum{REGULAR,ESKM}; + +template +struct ForceAdder { + ViewA a; + ViewB b; + ForceAdder(const ViewA& a_, const ViewB& b_):a(a_),b(b_) {} + KOKKOS_INLINE_FUNCTION + void operator() (const int& i) const { + a(i,0) += b(i,0); + a(i,1) += b(i,1); + a(i,2) += b(i,2); + } +}; + +/* ---------------------------------------------------------------------- */ + +template +struct Zero { + View v; + Zero(const View &v_):v(v_) {} + KOKKOS_INLINE_FUNCTION + void operator()(const int &i) const { + v(i,0) = 0; + v(i,1) = 0; + v(i,2) = 0; + } +}; + +/* ---------------------------------------------------------------------- */ + +ThirdOrderKokkos::ThirdOrderKokkos(LAMMPS *lmp) : ThirdOrder(lmp) +{ + atomKK = (AtomKokkos *) atom; +} + +/* ---------------------------------------------------------------------- */ + +ThirdOrderKokkos::~ThirdOrderKokkos() +{ + +} + +/* ---------------------------------------------------------------------- */ + +void ThirdOrderKokkos::command(int narg, char **arg) +{ + atomKK->sync(Host, X_MASK|RMASS_MASK|TYPE_MASK); + ThirdOrder::command(narg, arg); +} + +/* ---------------------------------------------------------------------- + setup without output or one-time post-init setup + flag = 0 = just force calculation + flag = 1 = reneighbor and force calculation +------------------------------------------------------------------------- */ + +void ThirdOrderKokkos::setup() +{ + lmp->kokkos->auto_sync = 1; + + // setup domain, communication and neighboring + // acquire ghosts + // build neighbor lists + if (triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (neighbor->style) neighbor->setup_bins(); + comm->exchange(); + comm->borders(); + if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + domain->image_check(); + domain->box_too_small_check(); + neighbor->build(1); + + // compute all forces + if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; + eflag=0; + vflag=0; + update_force(); + + if (pair_compute_flag) { + atomKK->sync(force->pair->execution_space,force->pair->datamask_read); + force->pair->compute(eflag,vflag); + atomKK->modified(force->pair->execution_space,force->pair->datamask_modify); + } + else if (force->pair) force->pair->compute_dummy(eflag,vflag); + update->setupflag = 0; + + lmp->kokkos->auto_sync = 0; + + //if all then skip communication groupmap population + if (gcount == atom->natoms) + for (bigint i=0; inatoms; i++) + groupmap[i] = i; + else + create_groupmap(); + +} + +/* ---------------------------------------------------------------------- + evaluate potential energy and forces + may migrate atoms due to reneighboring + return new energy, which should include nextra_global dof + return negative gradient stored in atom->f + return negative gradient for nextra_global dof in fextra +------------------------------------------------------------------------- */ + +void ThirdOrderKokkos::update_force() +{ + int n_pre_force = modify->n_pre_force; + int n_pre_reverse = modify->n_pre_reverse; + int n_post_force = modify->n_post_force; + + lmp->kokkos->auto_sync = 0; + + f_merge_copy = DAT::t_f_array("ThirdOrderKokkos::f_merge_copy",atomKK->k_f.extent(0)); + + atomKK->modified(Host,X_MASK); + atomKK->sync(Device,X_MASK); + + force_clear(); + + neighbor->decide(); // needed for intel potentials to work + + + if (n_pre_force) { + modify->pre_force(vflag); + timer->stamp(Timer::MODIFY); + } + + bool execute_on_host = false; + unsigned int datamask_read_device = 0; + unsigned int datamask_modify_device = 0; + unsigned int datamask_read_host = 0; + + if (pair_compute_flag) { + if (force->pair->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->pair->datamask_read; + datamask_modify_device |= force->pair->datamask_modify; + } else { + datamask_read_device |= force->pair->datamask_read; + datamask_modify_device |= force->pair->datamask_modify; + } + } + if (atomKK->molecular && force->bond) { + if (force->bond->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->bond->datamask_read; + datamask_modify_device |= force->bond->datamask_modify; + } else { + datamask_read_device |= force->bond->datamask_read; + datamask_modify_device |= force->bond->datamask_modify; + } + } + if (atomKK->molecular && force->angle) { + if (force->angle->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->angle->datamask_read; + datamask_modify_device |= force->angle->datamask_modify; + } else { + datamask_read_device |= force->angle->datamask_read; + datamask_modify_device |= force->angle->datamask_modify; + } + } + if (atomKK->molecular && force->dihedral) { + if (force->dihedral->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->dihedral->datamask_read; + datamask_modify_device |= force->dihedral->datamask_modify; + } else { + datamask_read_device |= force->dihedral->datamask_read; + datamask_modify_device |= force->dihedral->datamask_modify; + } + } + if (atomKK->molecular && force->improper) { + if (force->improper->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->improper->datamask_read; + datamask_modify_device |= force->improper->datamask_modify; + } else { + datamask_read_device |= force->improper->datamask_read; + datamask_modify_device |= force->improper->datamask_modify; + } + } + if (kspace_compute_flag) { + if (force->kspace->execution_space==Host) { + execute_on_host = true; + datamask_read_host |= force->kspace->datamask_read; + datamask_modify_device |= force->kspace->datamask_modify; + } else { + datamask_read_device |= force->kspace->datamask_read; + datamask_modify_device |= force->kspace->datamask_modify; + } + } + + + if (pair_compute_flag) { + atomKK->sync(force->pair->execution_space,force->pair->datamask_read); + atomKK->sync(force->pair->execution_space,~(~force->pair->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + Kokkos::Timer ktimer; + force->pair->compute(eflag,vflag); + atomKK->modified(force->pair->execution_space,force->pair->datamask_modify); + atomKK->modified(force->pair->execution_space,~(~force->pair->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + timer->stamp(Timer::PAIR); + } + + if (execute_on_host) { + if (pair_compute_flag && force->pair->datamask_modify!=(F_MASK | ENERGY_MASK | VIRIAL_MASK)) + Kokkos::fence(); + atomKK->sync_overlapping_device(Host,~(~datamask_read_host|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + if (pair_compute_flag && force->pair->execution_space!=Host) { + Kokkos::deep_copy(LMPHostType(),atomKK->k_f.h_view,0.0); + } + } + + if (atomKK->molecular) { + if (force->bond) { + atomKK->sync(force->bond->execution_space,~(~force->bond->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->bond->compute(eflag,vflag); + atomKK->modified(force->bond->execution_space,~(~force->bond->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + if (force->angle) { + atomKK->sync(force->angle->execution_space,~(~force->angle->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->angle->compute(eflag,vflag); + atomKK->modified(force->angle->execution_space,~(~force->angle->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + if (force->dihedral) { + atomKK->sync(force->dihedral->execution_space,~(~force->dihedral->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->dihedral->compute(eflag,vflag); + atomKK->modified(force->dihedral->execution_space,~(~force->dihedral->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + if (force->improper) { + atomKK->sync(force->improper->execution_space,~(~force->improper->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->improper->compute(eflag,vflag); + atomKK->modified(force->improper->execution_space,~(~force->improper->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + } + timer->stamp(Timer::BOND); + } + + if (kspace_compute_flag) { + atomKK->sync(force->kspace->execution_space,~(~force->kspace->datamask_read|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + force->kspace->compute(eflag,vflag); + atomKK->modified(force->kspace->execution_space,~(~force->kspace->datamask_modify|(F_MASK | ENERGY_MASK | VIRIAL_MASK))); + timer->stamp(Timer::KSPACE); + } + + if (execute_on_host && !std::is_same::value) { + if (f_merge_copy.extent(0)k_f.extent(0)) { + f_merge_copy = DAT::t_f_array("ThirdOrderKokkos::f_merge_copy",atomKK->k_f.extent(0)); + } + f = atomKK->k_f.d_view; + Kokkos::deep_copy(LMPHostType(),f_merge_copy,atomKK->k_f.h_view); + Kokkos::parallel_for(atomKK->k_f.extent(0), + ForceAdder(atomKK->k_f.d_view,f_merge_copy)); + atomKK->k_f.clear_sync_state(); // special case + atomKK->k_f.modify(); + } + if (n_pre_reverse) { + modify->pre_reverse(eflag,vflag); + timer->stamp(Timer::MODIFY); + } + if (force->newton) { + comm->reverse_comm(); + timer->stamp(Timer::COMM); + } + // force modifications + + if (n_post_force) { + modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + } + + atomKK->sync(Host,F_MASK); + lmp->kokkos->auto_sync = 1; + + ++ update->nsteps; +} + +/* ---------------------------------------------------------------------- + clear force on own & ghost atoms + clear other arrays as needed +------------------------------------------------------------------------- */ + +void ThirdOrderKokkos::force_clear() +{ + if (external_force_clear) return; + + atomKK->k_f.clear_sync_state(); // ignore host forces/torques since device views + + // clear force on all particles + // if either newton flag is set, also include ghosts + // when using threads always clear all forces. + + int nall = atomKK->nlocal; + if (force->newton) nall += atomKK->nghost; + + Kokkos::parallel_for(nall, Zero::t_f_array>(atomKK->k_f.view())); + atomKK->modified(Device,F_MASK); + +} diff --git a/src/KOKKOS/third_order_kokkos.h b/src/KOKKOS/third_order_kokkos.h new file mode 100644 index 0000000000..6845cf67fb --- /dev/null +++ b/src/KOKKOS/third_order_kokkos.h @@ -0,0 +1,54 @@ +/* -*- 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 COMMAND_CLASS +// clang-format off +CommandStyle(third_order/kk,ThirdOrderKokkos); +CommandStyle(third_order/kk/device,ThirdOrderKokkos); +CommandStyle(third_order/kk/host,ThirdOrderKokkos); +// clang-format on +#else + +#ifndef LMP_THIRD_ORDER_KOKKOS_H +#define LMP_THIRD_ORDER_KOKKOS_H + +#include "third_order.h" +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +class ThirdOrderKokkos : public ThirdOrder { + public: + ThirdOrderKokkos(class LAMMPS *); + virtual ~ThirdOrderKokkos(); + void command(int, char **); + void setup(); + + KOKKOS_INLINE_FUNCTION + void operator() (const int& i) const { + f(i,0) += f_merge_copy(i,0); + f(i,1) += f_merge_copy(i,1); + f(i,2) += f_merge_copy(i,2); + } + + protected: + void update_force(); + void force_clear(); + DAT::t_f_array f_merge_copy,f; + + +}; +} // namespace LAMMPS_NS + +#endif //LMP_THIRD_ORDER_KOKKOS_H +#endif diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index ca69113b7d..1f13b2227f 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -498,8 +498,16 @@ void ThirdOrder::displace_atom(int local_idx, int direction, int magnitude) void ThirdOrder::update_force() { + neighbor->decide(); // needed for intel potentials to work force_clear(); int n_post_force = modify->n_post_force; + int n_pre_force = modify->n_pre_force; + int n_pre_reverse = modify->n_pre_reverse; + + if (n_pre_force) { + modify->pre_force(vflag); + timer->stamp(Timer::MODIFY); + } if (pair_compute_flag) { force->pair->compute(eflag,vflag); @@ -516,6 +524,10 @@ void ThirdOrder::update_force() force->kspace->compute(eflag,vflag); timer->stamp(Timer::KSPACE); } + if (n_pre_reverse) { + modify->pre_reverse(eflag,vflag); + timer->stamp(Timer::MODIFY); + } if (force->newton) { comm->reverse_comm(); timer->stamp(Timer::COMM); @@ -523,8 +535,10 @@ void ThirdOrder::update_force() // force modifications - if (n_post_force) modify->post_force(vflag); - timer->stamp(Timer::MODIFY); + if (n_post_force) { + modify->post_force(vflag); + timer->stamp(Timer::MODIFY); + } ++ update->nsteps; } diff --git a/src/PHONON/third_order.h b/src/PHONON/third_order.h index 41fe2759ac..9c3744fc4c 100644 --- a/src/PHONON/third_order.h +++ b/src/PHONON/third_order.h @@ -19,8 +19,8 @@ class ThirdOrder : public Command { public: ThirdOrder(class LAMMPS *); virtual ~ThirdOrder(); - void command(int, char **); - void setup(); + virtual void command(int, char **); + virtual void setup(); protected: int eflag,vflag; // flags for energy/virial computation @@ -35,12 +35,12 @@ class ThirdOrder : public Command { int nvec; // local atomic dof = length of xvec - void update_force(); - void force_clear(); + virtual void update_force(); + virtual void force_clear(); virtual void openfile(const char* filename); - private: + protected: void options(int, char **); void create_groupmap(); void calculateMatrix(); From 9fbca5111d822fac70d560dd491d07c34dd7b6e0 Mon Sep 17 00:00:00 2001 From: Sievers Date: Wed, 15 Dec 2021 11:52:38 -0800 Subject: [PATCH 035/174] fix runtime error from lack of comm->setup() --- src/KOKKOS/dynamical_matrix_kokkos.cpp | 2 ++ src/KOKKOS/third_order_kokkos.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp index c72e113033..4068912da9 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.cpp +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -1,3 +1,4 @@ +// // clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator @@ -112,6 +113,7 @@ void DynamicalMatrixKokkos::setup() if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); domain->reset_box(); + comm->setup(); if (neighbor->style) neighbor->setup_bins(); comm->exchange(); comm->borders(); diff --git a/src/KOKKOS/third_order_kokkos.cpp b/src/KOKKOS/third_order_kokkos.cpp index 9a5a5ba7f6..0ceea63fe2 100644 --- a/src/KOKKOS/third_order_kokkos.cpp +++ b/src/KOKKOS/third_order_kokkos.cpp @@ -1,3 +1,4 @@ +// // clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator @@ -112,6 +113,7 @@ void ThirdOrderKokkos::setup() if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); domain->reset_box(); + comm->setup(); if (neighbor->style) neighbor->setup_bins(); comm->exchange(); comm->borders(); From 1f81e2afad621c426472bd5753d4ead30121d70d Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Fri, 7 Jan 2022 13:45:54 +0000 Subject: [PATCH 036/174] Added duplication of stdout into logfile --- examples/PACKAGES/cgdna/examples/test.sh | 105 ++++++++++++----------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/examples/PACKAGES/cgdna/examples/test.sh b/examples/PACKAGES/cgdna/examples/test.sh index 2e68ccab08..152047b94b 100755 --- a/examples/PACKAGES/cgdna/examples/test.sh +++ b/examples/PACKAGES/cgdna/examples/test.sh @@ -1,6 +1,6 @@ #! /bin/bash -DATE='27Oct21' +DATE='14Dec21' TOL=1e-8 LMPDIR=/Users/ohenrich/Work/code/lammps @@ -8,17 +8,17 @@ SRCDIR=$LMPDIR/src EXDIR=$LMPDIR/examples/PACKAGES/cgdna/examples if [ $# -eq 1 ] && [ $1 = run ]; then - echo '# Compiling executable in' $SRCDIR + echo '# Compiling executable in' $SRCDIR | tee -a $EXDIR/test.log cd $SRCDIR - make clean-all - make purge - make pu - make ps - make -j8 mpi + make clean-all | tee -a $EXDIR/test.log + make purge | tee -a $EXDIR/test.log + make pu | tee -a $EXDIR/test.log + make ps | tee -a $EXDIR/test.log + make -j8 mpi | tee -a $EXDIR/test.log ###################################################### - echo '# Running oxDNA duplex1 test' + echo '# Running oxDNA duplex1 test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA/duplex1 mkdir test cd test @@ -33,9 +33,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex1 > /dev/null @@ -45,15 +45,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxDNA duplex2 test' + echo '# Running oxDNA duplex2 test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA/duplex2 mkdir test cd test @@ -68,9 +68,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex2 > /dev/null @@ -80,15 +80,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxDNA2 duplex1 test' + echo '# Running oxDNA2 duplex1 test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA2/duplex1 mkdir test cd test @@ -103,9 +103,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex1 > /dev/null @@ -115,15 +115,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxDNA2 duplex2 test' + echo '# Running oxDNA2 duplex2 test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA2/duplex2 mkdir test cd test @@ -138,9 +138,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex2 > /dev/null @@ -150,15 +150,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxDNA2 duplex3 test' + echo '# Running oxDNA2 duplex3 test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA2/duplex3 mkdir test cd test @@ -173,9 +173,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex3 > /dev/null @@ -185,15 +185,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxDNA2 unique_bp test' + echo '# Running oxDNA2 unique_bp test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA2/unique_bp mkdir test cd test @@ -210,9 +210,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4type.1.dat e_old.4type.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task 4 types passed" + echo "# 1 MPI-task 4 types passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task 4 types unsuccessful" + echo "# 1 MPI-task 4 types unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex4.4type > /dev/null @@ -222,9 +222,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4type.4.dat e_old.4type.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks 4 types passed" + echo "# 4 MPI-tasks 4 types passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks 4 types unsuccessful" + echo "# 4 MPI-tasks 4 types unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 1 ./lmp_mpi < in.duplex4.8type > /dev/null @@ -234,9 +234,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.8type.1.dat e_old.8type.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task 8 types passed" + echo "# 1 MPI-task 8 types passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task 8 types unsuccessful" + echo "# 1 MPI-task 8 types unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex4.8type > /dev/null @@ -246,15 +246,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.8type.4.dat e_old.8type.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks 8 types passed" + echo "# 4 MPI-tasks 8 types passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks 8 types unsuccessful" + echo "# 4 MPI-tasks 8 types unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxDNA2 dsring test' + echo '# Running oxDNA2 dsring test' | tee -a $EXDIR/test.log cd $EXDIR/oxDNA2/dsring mkdir test cd test @@ -269,9 +269,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.dsring > /dev/null @@ -281,15 +281,15 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### ###################################################### - echo '# Running oxRNA2 duplex2 test' + echo '# Running oxRNA2 duplex2 test' | tee -a $EXDIR/test.log cd $EXDIR/oxRNA2/duplex2 mkdir test cd test @@ -304,9 +304,9 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.1.dat e_old.1.dat if [ $? -eq 0 ]; then - echo "# 1 MPI-task passed" + echo "# 1 MPI-task passed" | tee -a $EXDIR/test.log else - echo "# 1 MPI-task unsuccessful" + echo "# 1 MPI-task unsuccessful" | tee -a $EXDIR/test.log fi mpirun -np 4 ./lmp_mpi < in.duplex2 > /dev/null @@ -316,13 +316,13 @@ if [ $# -eq 1 ] && [ $1 = run ]; then ndiff -relerr $TOL e_test.4.dat e_old.4.dat if [ $? -eq 0 ]; then - echo "# 4 MPI-tasks passed" + echo "# 4 MPI-tasks passed" | tee -a $EXDIR/test.log else - echo "# 4 MPI-tasks unsuccessful" + echo "# 4 MPI-tasks unsuccessful" | tee -a $EXDIR/test.log fi ###################################################### - echo '# Done' + echo '# Done' | tee -a $EXDIR/test.log elif [ $# -eq 1 ] && [ $1 = clean ]; then echo '# Deleting test directories' @@ -334,6 +334,7 @@ elif [ $# -eq 1 ] && [ $1 = clean ]; then rm -rf $EXDIR/oxDNA2/unique_bp/test rm -rf $EXDIR/oxDNA2/dsring/test rm -rf $EXDIR/oxRNA2/duplex2/test + rm -rf $EXDIR/test.log echo '# Done' else From 40c140e56e481af941624dd73dfd8e69d67e494b Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Fri, 7 Jan 2022 14:48:07 -0700 Subject: [PATCH 037/174] Improve PairReaxFFKokkos neigh list algorithm --- src/KOKKOS/pair_reaxff_kokkos.cpp | 149 ++++++++++++++---------------- 1 file changed, 71 insertions(+), 78 deletions(-) diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index 8d9c498005..02af958b5e 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -843,12 +843,12 @@ void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) k_resize_bo.modify(); k_resize_bo.sync(); int resize_bo = k_resize_bo.h_view(); - if (resize_bo) maxbo++; + if (resize_bo) maxbo = MAX(maxbo+1,resize_bo); k_resize_hb.modify(); k_resize_hb.sync(); int resize_hb = k_resize_hb.h_view(); - if (resize_hb) maxhb++; + if (resize_hb) maxhb = MAX(maxhb+1,resize_hb); resize = resize_bo || resize_hb; if (resize) { @@ -1711,9 +1711,6 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int &ii) const { - if (d_resize_bo() || d_resize_hb()) - return; - auto v_dDeltap_self = ScatterViewHelper::value,decltype(dup_dDeltap_self),decltype(ndup_dDeltap_self)>::get(dup_dDeltap_self,ndup_dDeltap_self); auto a_dDeltap_self = v_dDeltap_self.template access::value>(); @@ -1777,12 +1774,10 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int jj_index = j_index - hb_first_i; - if (jj_index >= maxhb) { - d_resize_hb() = 1; - return; - } - - d_hb_list[j_index] = j; + if (jj_index >= maxhb) + d_resize_hb() = MAX(d_resize_hb(),jj_index); + else + d_hb_list[j_index] = j; } else if (j < nlocal && ihb == 2 && jhb == 1) { if (NEIGHFLAG == HALF) { i_index = d_hb_first[j] + d_hb_num[j]; @@ -1793,12 +1788,10 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int ii_index = i_index - d_hb_first[j]; - if (ii_index >= maxhb) { - d_resize_hb() = 1; - return; - } - - d_hb_list[i_index] = i; + if (ii_index >= maxhb) + d_resize_hb() = MAX(d_resize_hb(),ii_index); + else + d_hb_list[i_index] = i; } } @@ -1851,68 +1844,68 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int ii_index = i_index - d_bo_first[j]; if (jj_index >= maxbo || ii_index >= maxbo) { - d_resize_bo() = 1; - return; + const int max_val = MAX(ii_index,jj_index); + d_resize_bo() = MAX(d_resize_bo(),max_val); + } else { + d_bo_list[j_index] = j; + d_bo_list[i_index] = i; + + // from BondOrder1 + + d_BO(i,jj_index) = BO; + d_BO_s(i,jj_index) = BO_s; + d_BO_pi(i,jj_index) = BO_pi; + d_BO_pi2(i,jj_index) = BO_pi2; + + d_BO(j,ii_index) = BO; + d_BO_s(j,ii_index) = BO_s; + d_BO_pi(j,ii_index) = BO_pi; + d_BO_pi2(j,ii_index) = BO_pi2; + + F_FLOAT Cln_BOp_s = p_bo2 * C12 / rij / rij; + F_FLOAT Cln_BOp_pi = p_bo4 * C34 / rij / rij; + F_FLOAT Cln_BOp_pi2 = p_bo6 * C56 / rij / rij; + + if (nlocal == 0) + Cln_BOp_s = Cln_BOp_pi = Cln_BOp_pi2 = 0.0; + + for (int d = 0; d < 3; d++) dln_BOp_pi_i[d] = -(BO_pi*Cln_BOp_pi)*delij[d]; + for (int d = 0; d < 3; d++) dln_BOp_pi2_i[d] = -(BO_pi2*Cln_BOp_pi2)*delij[d]; + for (int d = 0; d < 3; d++) dBOp_i[d] = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2)*delij[d]; + for (int d = 0; d < 3; d++) a_dDeltap_self(i,d) += dBOp_i[d]; + for (int d = 0; d < 3; d++) a_dDeltap_self(j,d) += -dBOp_i[d]; + + d_dln_BOp_pix(i,jj_index) = dln_BOp_pi_i[0]; + d_dln_BOp_piy(i,jj_index) = dln_BOp_pi_i[1]; + d_dln_BOp_piz(i,jj_index) = dln_BOp_pi_i[2]; + + d_dln_BOp_pix(j,ii_index) = -dln_BOp_pi_i[0]; + d_dln_BOp_piy(j,ii_index) = -dln_BOp_pi_i[1]; + d_dln_BOp_piz(j,ii_index) = -dln_BOp_pi_i[2]; + + d_dln_BOp_pi2x(i,jj_index) = dln_BOp_pi2_i[0]; + d_dln_BOp_pi2y(i,jj_index) = dln_BOp_pi2_i[1]; + d_dln_BOp_pi2z(i,jj_index) = dln_BOp_pi2_i[2]; + + d_dln_BOp_pi2x(j,ii_index) = -dln_BOp_pi2_i[0]; + d_dln_BOp_pi2y(j,ii_index) = -dln_BOp_pi2_i[1]; + d_dln_BOp_pi2z(j,ii_index) = -dln_BOp_pi2_i[2]; + + d_dBOpx(i,jj_index) = dBOp_i[0]; + d_dBOpy(i,jj_index) = dBOp_i[1]; + d_dBOpz(i,jj_index) = dBOp_i[2]; + + d_dBOpx(j,ii_index) = -dBOp_i[0]; + d_dBOpy(j,ii_index) = -dBOp_i[1]; + d_dBOpz(j,ii_index) = -dBOp_i[2]; + + d_BO(i,jj_index) -= bo_cut; + d_BO(j,ii_index) -= bo_cut; + d_BO_s(i,jj_index) -= bo_cut; + d_BO_s(j,ii_index) -= bo_cut; + total_bo += d_BO(i,jj_index); + a_total_bo[j] += d_BO(j,ii_index); } - - d_bo_list[j_index] = j; - d_bo_list[i_index] = i; - - // from BondOrder1 - - d_BO(i,jj_index) = BO; - d_BO_s(i,jj_index) = BO_s; - d_BO_pi(i,jj_index) = BO_pi; - d_BO_pi2(i,jj_index) = BO_pi2; - - d_BO(j,ii_index) = BO; - d_BO_s(j,ii_index) = BO_s; - d_BO_pi(j,ii_index) = BO_pi; - d_BO_pi2(j,ii_index) = BO_pi2; - - F_FLOAT Cln_BOp_s = p_bo2 * C12 / rij / rij; - F_FLOAT Cln_BOp_pi = p_bo4 * C34 / rij / rij; - F_FLOAT Cln_BOp_pi2 = p_bo6 * C56 / rij / rij; - - if (nlocal == 0) - Cln_BOp_s = Cln_BOp_pi = Cln_BOp_pi2 = 0.0; - - for (int d = 0; d < 3; d++) dln_BOp_pi_i[d] = -(BO_pi*Cln_BOp_pi)*delij[d]; - for (int d = 0; d < 3; d++) dln_BOp_pi2_i[d] = -(BO_pi2*Cln_BOp_pi2)*delij[d]; - for (int d = 0; d < 3; d++) dBOp_i[d] = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2)*delij[d]; - for (int d = 0; d < 3; d++) a_dDeltap_self(i,d) += dBOp_i[d]; - for (int d = 0; d < 3; d++) a_dDeltap_self(j,d) += -dBOp_i[d]; - - d_dln_BOp_pix(i,jj_index) = dln_BOp_pi_i[0]; - d_dln_BOp_piy(i,jj_index) = dln_BOp_pi_i[1]; - d_dln_BOp_piz(i,jj_index) = dln_BOp_pi_i[2]; - - d_dln_BOp_pix(j,ii_index) = -dln_BOp_pi_i[0]; - d_dln_BOp_piy(j,ii_index) = -dln_BOp_pi_i[1]; - d_dln_BOp_piz(j,ii_index) = -dln_BOp_pi_i[2]; - - d_dln_BOp_pi2x(i,jj_index) = dln_BOp_pi2_i[0]; - d_dln_BOp_pi2y(i,jj_index) = dln_BOp_pi2_i[1]; - d_dln_BOp_pi2z(i,jj_index) = dln_BOp_pi2_i[2]; - - d_dln_BOp_pi2x(j,ii_index) = -dln_BOp_pi2_i[0]; - d_dln_BOp_pi2y(j,ii_index) = -dln_BOp_pi2_i[1]; - d_dln_BOp_pi2z(j,ii_index) = -dln_BOp_pi2_i[2]; - - d_dBOpx(i,jj_index) = dBOp_i[0]; - d_dBOpy(i,jj_index) = dBOp_i[1]; - d_dBOpz(i,jj_index) = dBOp_i[2]; - - d_dBOpx(j,ii_index) = -dBOp_i[0]; - d_dBOpy(j,ii_index) = -dBOp_i[1]; - d_dBOpz(j,ii_index) = -dBOp_i[2]; - - d_BO(i,jj_index) -= bo_cut; - d_BO(j,ii_index) -= bo_cut; - d_BO_s(i,jj_index) -= bo_cut; - d_BO_s(j,ii_index) -= bo_cut; - total_bo += d_BO(i,jj_index); - a_total_bo[j] += d_BO(j,ii_index); } a_total_bo[i] += total_bo; From 8aaae8e6ee26dea0c6f41c46ff2c62dfb7041f4c Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Fri, 7 Jan 2022 15:22:53 -0700 Subject: [PATCH 038/174] Fix count issue --- src/KOKKOS/pair_reaxff_kokkos.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index 02af958b5e..ebcd66e83c 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -1775,7 +1775,7 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int jj_index = j_index - hb_first_i; if (jj_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),jj_index); + d_resize_hb() = MAX(d_resize_hb(),jj_index+1); else d_hb_list[j_index] = j; } else if (j < nlocal && ihb == 2 && jhb == 1) { @@ -1789,7 +1789,7 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int ii_index = i_index - d_hb_first[j]; if (ii_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),ii_index); + d_resize_hb() = MAX(d_resize_hb(),ii_index+1); else d_hb_list[i_index] = i; } @@ -1844,7 +1844,7 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, const int ii_index = i_index - d_bo_first[j]; if (jj_index >= maxbo || ii_index >= maxbo) { - const int max_val = MAX(ii_index,jj_index); + const int max_val = MAX(ii_index+1,jj_index+1); d_resize_bo() = MAX(d_resize_bo(),max_val); } else { d_bo_list[j_index] = j; From 576f2266ae0b554faf0ca2c7e7610112c5329914 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 18 Jan 2022 14:28:09 -0500 Subject: [PATCH 039/174] Mark virtual destructors in derived as override Following C++ Core Guideline C.128 --- src/comm.h | 2 +- src/domain.h | 2 +- src/input.h | 2 +- src/pointers.h | 2 +- src/region.h | 2 +- src/update.h | 2 +- src/variable.h | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/comm.h b/src/comm.h index 43a30675f3..e2df05a938 100644 --- a/src/comm.h +++ b/src/comm.h @@ -63,7 +63,7 @@ class Comm : protected Pointers { // methods Comm(class LAMMPS *); - virtual ~Comm(); + ~Comm() override; // NOTE: copy_arrays is called from a constructor and must not be made virtual void copy_arrays(class Comm *); virtual void init(); diff --git a/src/domain.h b/src/domain.h index 234bdbb837..a3a526610e 100644 --- a/src/domain.h +++ b/src/domain.h @@ -110,7 +110,7 @@ class Domain : protected Pointers { RegionCreatorMap *region_map; Domain(class LAMMPS *); - virtual ~Domain(); + ~Domain() override; virtual void init(); void set_initial_box(int expandflag = 1); virtual void set_global_box(); diff --git a/src/input.h b/src/input.h index faf45ab305..1fe79ba561 100644 --- a/src/input.h +++ b/src/input.h @@ -33,7 +33,7 @@ class Input : protected Pointers { class Variable *variable; // defined variables Input(class LAMMPS *, int, char **); - ~Input(); + ~Input() override; void file(); // process all input void file(const char *); // process an input script char *one(const std::string &); // process a single command diff --git a/src/pointers.h b/src/pointers.h index 44820d06eb..5f82872514 100644 --- a/src/pointers.h +++ b/src/pointers.h @@ -91,7 +91,7 @@ class Pointers { atomKK(ptr->atomKK), memoryKK(ptr->memoryKK), python(ptr->python) {} - virtual ~Pointers() {} + virtual ~Pointers() = default; // remove default members execept for the copy constructor diff --git a/src/region.h b/src/region.h index 043d3bdd36..83810f5be3 100644 --- a/src/region.h +++ b/src/region.h @@ -69,7 +69,7 @@ class Region : protected Pointers { int *list; Region(class LAMMPS *, int, char **); - virtual ~Region(); + ~Region() override; virtual void init(); int dynamic_check(); diff --git a/src/update.h b/src/update.h index b3fd1e4a3d..25af895bf3 100644 --- a/src/update.h +++ b/src/update.h @@ -60,7 +60,7 @@ class Update : protected Pointers { MinimizeCreatorMap *minimize_map; Update(class LAMMPS *); - ~Update(); + ~Update() override; void init(); void set_units(const char *); void create_integrate(int, char **, int); diff --git a/src/variable.h b/src/variable.h index dbad793b57..7b51b45f38 100644 --- a/src/variable.h +++ b/src/variable.h @@ -23,7 +23,7 @@ class Variable : protected Pointers { public: Variable(class LAMMPS *); - ~Variable(); + ~Variable() override; void set(int, char **); void set(const std::string &); void set(char *, int, char **); @@ -152,7 +152,7 @@ class VarReader : protected Pointers { char *id_fix; VarReader(class LAMMPS *, char *, char *, int); - ~VarReader(); + ~VarReader() override; int read_scalar(char *); int read_peratom(); From d19f799585a6dd193e4110f9784af7e31110b368 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 18 Jan 2022 14:31:29 -0500 Subject: [PATCH 040/174] Apply override to Region classes --- src/region_block.h | 8 ++++---- src/region_cone.h | 8 ++++---- src/region_cylinder.h | 16 ++++++++-------- src/region_deprecated.h | 10 +++++----- src/region_intersect.h | 24 ++++++++++++------------ src/region_plane.h | 8 ++++---- src/region_prism.h | 8 ++++---- src/region_sphere.h | 16 ++++++++-------- src/region_union.h | 24 ++++++++++++------------ 9 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/region_block.h b/src/region_block.h index 943e6ce40f..bcd54b5849 100644 --- a/src/region_block.h +++ b/src/region_block.h @@ -29,10 +29,10 @@ class RegBlock : public Region { public: RegBlock(class LAMMPS *, int, char **); - ~RegBlock(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); + ~RegBlock() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; protected: double xlo, xhi, ylo, yhi, zlo, zhi; diff --git a/src/region_cone.h b/src/region_cone.h index 917144613f..ff03568ea9 100644 --- a/src/region_cone.h +++ b/src/region_cone.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class RegCone : public Region { public: RegCone(class LAMMPS *, int, char **); - ~RegCone(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); + ~RegCone() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; private: char axis; diff --git a/src/region_cylinder.h b/src/region_cylinder.h index 70635e0a3f..e293a4f1cc 100644 --- a/src/region_cylinder.h +++ b/src/region_cylinder.h @@ -29,14 +29,14 @@ class RegCylinder : public Region { public: RegCylinder(class LAMMPS *, int, char **); - ~RegCylinder(); - void init(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); - void shape_update(); - void set_velocity_shape(); - void velocity_contact_shape(double *, double *); + ~RegCylinder() override; + void init() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; + void shape_update() override; + void set_velocity_shape() override; + void velocity_contact_shape(double *, double *) override; private: char axis; diff --git a/src/region_deprecated.h b/src/region_deprecated.h index 2c473e05f0..c8951eee45 100644 --- a/src/region_deprecated.h +++ b/src/region_deprecated.h @@ -28,11 +28,11 @@ namespace LAMMPS_NS { class RegionDeprecated : public Region { public: RegionDeprecated(class LAMMPS *, int, char **); - ~RegionDeprecated() {} - virtual void init() {} - virtual int inside(double, double, double) { return 0; } - virtual int surface_interior(double *, double) { return 0; } - virtual int surface_exterior(double *, double) { return 0; } + ~RegionDeprecated() override {} + void init() override {} + int inside(double, double, double) override { return 0; } + int surface_interior(double *, double) override { return 0; } + int surface_exterior(double *, double) override { return 0; } }; } // namespace LAMMPS_NS diff --git a/src/region_intersect.h b/src/region_intersect.h index e1c35bb594..b5eafec861 100644 --- a/src/region_intersect.h +++ b/src/region_intersect.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class RegIntersect : public Region { public: RegIntersect(class LAMMPS *, int, char **); - ~RegIntersect(); - void init(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); - void shape_update(); - void pretransform(); - void set_velocity(); - void length_restart_string(int &); - void write_restart(FILE *); - int restart(char *, int &); - void reset_vel(); + ~RegIntersect() override; + void init() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; + void shape_update() override; + void pretransform() override; + void set_velocity() override; + void length_restart_string(int &) override; + void write_restart(FILE *) override; + int restart(char *, int &) override; + void reset_vel() override; private: char **idsub; diff --git a/src/region_plane.h b/src/region_plane.h index b327498363..a96353ff30 100644 --- a/src/region_plane.h +++ b/src/region_plane.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class RegPlane : public Region { public: RegPlane(class LAMMPS *, int, char **); - ~RegPlane(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); + ~RegPlane() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; private: double xp, yp, zp; diff --git a/src/region_prism.h b/src/region_prism.h index 0bc02079e8..fe021f6dc3 100644 --- a/src/region_prism.h +++ b/src/region_prism.h @@ -29,10 +29,10 @@ class RegPrism : public Region { public: RegPrism(class LAMMPS *, int, char **); - ~RegPrism(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); + ~RegPrism() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; private: double xlo, xhi, ylo, yhi, zlo, zhi; diff --git a/src/region_sphere.h b/src/region_sphere.h index 3cec54512e..9139a07db7 100644 --- a/src/region_sphere.h +++ b/src/region_sphere.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class RegSphere : public Region { public: RegSphere(class LAMMPS *, int, char **); - ~RegSphere(); - void init(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); - void shape_update(); - void set_velocity_shape(); - void velocity_contact_shape(double *, double *); + ~RegSphere() override; + void init() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; + void shape_update() override; + void set_velocity_shape() override; + void velocity_contact_shape(double *, double *) override; private: double xc, yc, zc; diff --git a/src/region_union.h b/src/region_union.h index b9099d9f86..32a54b357c 100644 --- a/src/region_union.h +++ b/src/region_union.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class RegUnion : public Region { public: RegUnion(class LAMMPS *, int, char **); - ~RegUnion(); - void init(); - int inside(double, double, double); - int surface_interior(double *, double); - int surface_exterior(double *, double); - void shape_update(); - void pretransform(); - void set_velocity(); - void length_restart_string(int &); - void write_restart(FILE *); - int restart(char *, int &); - void reset_vel(); + ~RegUnion() override; + void init() override; + int inside(double, double, double) override; + int surface_interior(double *, double) override; + int surface_exterior(double *, double) override; + void shape_update() override; + void pretransform() override; + void set_velocity() override; + void length_restart_string(int &) override; + void write_restart(FILE *) override; + int restart(char *, int &) override; + void reset_vel() override; private: char **idsub; From 1792b3b0cfa95bab2ef66f6bc3106d404bbfa2e5 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 18 Jan 2022 14:39:31 -0500 Subject: [PATCH 041/174] Apply override to Reader classes --- src/reader.h | 2 +- src/reader_native.h | 10 +++++----- src/reader_xyz.h | 10 +++++----- src/tokenizer.h | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/reader.h b/src/reader.h index 097fa2526b..6429cd40de 100644 --- a/src/reader.h +++ b/src/reader.h @@ -23,7 +23,7 @@ namespace LAMMPS_NS { class Reader : protected Pointers { public: Reader(class LAMMPS *); - virtual ~Reader() {} + ~Reader() override {} virtual void settings(int, char **); diff --git a/src/reader_native.h b/src/reader_native.h index f888509dfb..6566df0680 100644 --- a/src/reader_native.h +++ b/src/reader_native.h @@ -32,13 +32,13 @@ namespace LAMMPS_NS { class ReaderNative : public Reader { public: ReaderNative(class LAMMPS *); - ~ReaderNative(); + ~ReaderNative() override; - int read_time(bigint &); - void skip(); + int read_time(bigint &) override; + void skip() override; bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, int &, - int &, int &); - void read_atoms(int, int, double **); + int &, int &) override; + void read_atoms(int, int, double **) override; private: int revision; diff --git a/src/reader_xyz.h b/src/reader_xyz.h index 0807be719e..9a1478a0c6 100644 --- a/src/reader_xyz.h +++ b/src/reader_xyz.h @@ -29,13 +29,13 @@ namespace LAMMPS_NS { class ReaderXYZ : public Reader { public: ReaderXYZ(class LAMMPS *); - ~ReaderXYZ(); + ~ReaderXYZ() override; - int read_time(bigint &); - void skip(); + int read_time(bigint &) override; + void skip() override; bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, int &, - int &, int &); - void read_atoms(int, int, double **); + int &, int &) override; + void read_atoms(int, int, double **) override; private: char *line; // line read from dump file diff --git a/src/tokenizer.h b/src/tokenizer.h index 060e1bf6e3..0b6d773aad 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -62,11 +62,11 @@ class TokenizerException : public std::exception { * \param token String of the token/word that caused the error */ explicit TokenizerException(const std::string &msg, const std::string &token); - ~TokenizerException() noexcept {} + ~TokenizerException() noexcept override {} /** Retrieve message describing the thrown exception * \return string with error message */ - virtual const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; class InvalidIntegerException : public TokenizerException { From 778879a0eb4455bc9c245d2ac32698919a5d9907 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 18 Jan 2022 14:56:44 -0500 Subject: [PATCH 042/174] Apply override to Body classes --- src/BODY/body_nparticle.h | 22 +++++++++++----------- src/BODY/body_rounded_polygon.h | 22 +++++++++++----------- src/BODY/body_rounded_polyhedron.h | 22 +++++++++++----------- src/body.h | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/BODY/body_nparticle.h b/src/BODY/body_nparticle.h index 0c4c590673..24db6a68bb 100644 --- a/src/BODY/body_nparticle.h +++ b/src/BODY/body_nparticle.h @@ -28,21 +28,21 @@ namespace LAMMPS_NS { class BodyNparticle : public Body { public: BodyNparticle(class LAMMPS *, int, char **); - ~BodyNparticle(); + ~BodyNparticle() override; int nsub(struct AtomVecBody::Bonus *); double *coords(struct AtomVecBody::Bonus *); - int pack_border_body(struct AtomVecBody::Bonus *, double *); - int unpack_border_body(struct AtomVecBody::Bonus *, double *); - void data_body(int, int, int, int *, double *); - int pack_data_body(tagint, int, double *); - int write_data_body(FILE *, double *); - double radius_body(int, int, int *, double *); + int pack_border_body(struct AtomVecBody::Bonus *, double *) override; + int unpack_border_body(struct AtomVecBody::Bonus *, double *) override; + void data_body(int, int, int, int *, double *) override; + int pack_data_body(tagint, int, double *) override; + int write_data_body(FILE *, double *) override; + double radius_body(int, int, int *, double *) override; - int noutrow(int); - int noutcol(); - void output(int, int, double *); - int image(int, double, double, int *&, double **&); + int noutrow(int) override; + int noutcol() override; + void output(int, int, double *) override; + int image(int, double, double, int *&, double **&) override; private: int *imflag; diff --git a/src/BODY/body_rounded_polygon.h b/src/BODY/body_rounded_polygon.h index b76a0afaff..284965c466 100644 --- a/src/BODY/body_rounded_polygon.h +++ b/src/BODY/body_rounded_polygon.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class BodyRoundedPolygon : public Body { public: BodyRoundedPolygon(class LAMMPS *, int, char **); - ~BodyRoundedPolygon(); + ~BodyRoundedPolygon() override; int nsub(struct AtomVecBody::Bonus *); double *coords(struct AtomVecBody::Bonus *); int nedges(struct AtomVecBody::Bonus *); @@ -36,17 +36,17 @@ class BodyRoundedPolygon : public Body { double enclosing_radius(struct AtomVecBody::Bonus *); double rounded_radius(struct AtomVecBody::Bonus *); - int pack_border_body(struct AtomVecBody::Bonus *, double *); - int unpack_border_body(struct AtomVecBody::Bonus *, double *); - void data_body(int, int, int, int *, double *); - int pack_data_body(tagint, int, double *); - int write_data_body(FILE *, double *); - double radius_body(int, int, int *, double *); + int pack_border_body(struct AtomVecBody::Bonus *, double *) override; + int unpack_border_body(struct AtomVecBody::Bonus *, double *) override; + void data_body(int, int, int, int *, double *) override; + int pack_data_body(tagint, int, double *) override; + int write_data_body(FILE *, double *) override; + double radius_body(int, int, int *, double *) override; - int noutrow(int); - int noutcol(); - void output(int, int, double *); - int image(int, double, double, int *&, double **&); + int noutrow(int) override; + int noutcol() override; + void output(int, int, double *) override; + int image(int, double, double, int *&, double **&) override; private: int *imflag; diff --git a/src/BODY/body_rounded_polyhedron.h b/src/BODY/body_rounded_polyhedron.h index 47c0943299..56392391fa 100644 --- a/src/BODY/body_rounded_polyhedron.h +++ b/src/BODY/body_rounded_polyhedron.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class BodyRoundedPolyhedron : public Body { public: BodyRoundedPolyhedron(class LAMMPS *, int, char **); - ~BodyRoundedPolyhedron(); + ~BodyRoundedPolyhedron() override; int nsub(struct AtomVecBody::Bonus *); double *coords(struct AtomVecBody::Bonus *); int nedges(struct AtomVecBody::Bonus *); @@ -38,17 +38,17 @@ class BodyRoundedPolyhedron : public Body { double enclosing_radius(struct AtomVecBody::Bonus *); double rounded_radius(struct AtomVecBody::Bonus *); - int pack_border_body(struct AtomVecBody::Bonus *, double *); - int unpack_border_body(struct AtomVecBody::Bonus *, double *); - void data_body(int, int, int, int *, double *); - int pack_data_body(tagint, int, double *); - int write_data_body(FILE *, double *); - double radius_body(int, int, int *, double *); + int pack_border_body(struct AtomVecBody::Bonus *, double *) override; + int unpack_border_body(struct AtomVecBody::Bonus *, double *) override; + void data_body(int, int, int, int *, double *) override; + int pack_data_body(tagint, int, double *) override; + int write_data_body(FILE *, double *) override; + double radius_body(int, int, int *, double *) override; - int noutrow(int); - int noutcol(); - void output(int, int, double *); - int image(int, double, double, int *&, double **&); + int noutrow(int) override; + int noutcol() override; + void output(int, int, double *) override; + int image(int, double, double, int *&, double **&) override; private: int *imflag; diff --git a/src/body.h b/src/body.h index 27832d2eda..b2cbbee345 100644 --- a/src/body.h +++ b/src/body.h @@ -32,7 +32,7 @@ class Body : protected Pointers { AtomVecBody *avec; // ptr to class that stores body bonus info Body(class LAMMPS *, int, char **); - virtual ~Body(); + ~Body() override; // methods implemented by child classes From 0099d2584b8cb5731cc80202d8da70fa11086c92 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 18 Jan 2022 15:10:35 -0500 Subject: [PATCH 043/174] Apply override to Integrator classes --- src/INTEL/verlet_lrt_intel.h | 8 ++++---- src/KOKKOS/verlet_kokkos.h | 8 ++++---- src/OPENMP/respa_omp.h | 10 +++++----- src/REPLICA/verlet_split.h | 12 ++++++------ src/respa.h | 14 +++++++------- src/verlet.h | 12 ++++++------ 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/INTEL/verlet_lrt_intel.h b/src/INTEL/verlet_lrt_intel.h index e13d2b44f6..c58d4916d2 100644 --- a/src/INTEL/verlet_lrt_intel.h +++ b/src/INTEL/verlet_lrt_intel.h @@ -46,10 +46,10 @@ namespace LAMMPS_NS { class VerletLRTIntel : public Verlet { public: VerletLRTIntel(class LAMMPS *, int, char **); - virtual ~VerletLRTIntel(); - virtual void init(); - virtual void setup(int flag); - virtual void run(int); + ~VerletLRTIntel() override; + void init() override; + void setup(int flag) override; + void run(int) override; protected: PPPMIntel *_intel_kspace; diff --git a/src/KOKKOS/verlet_kokkos.h b/src/KOKKOS/verlet_kokkos.h index b90a114370..7487da9cca 100644 --- a/src/KOKKOS/verlet_kokkos.h +++ b/src/KOKKOS/verlet_kokkos.h @@ -31,10 +31,10 @@ namespace LAMMPS_NS { class VerletKokkos : public Verlet { public: VerletKokkos(class LAMMPS *, int, char **); - ~VerletKokkos() {} - void setup(int); - void setup_minimal(int); - void run(int); + ~VerletKokkos() override = default; + void setup(int) override; + void setup_minimal(int) override; + void run(int) override; KOKKOS_INLINE_FUNCTION void operator() (const int& i) const { diff --git a/src/OPENMP/respa_omp.h b/src/OPENMP/respa_omp.h index 9d20ec23cb..a4fc9561a9 100644 --- a/src/OPENMP/respa_omp.h +++ b/src/OPENMP/respa_omp.h @@ -28,13 +28,13 @@ namespace LAMMPS_NS { class RespaOMP : public Respa, public ThrOMP { public: RespaOMP(class LAMMPS *, int, char **); - virtual ~RespaOMP() {} - virtual void init(); - virtual void setup(int); - virtual void setup_minimal(int); + ~RespaOMP() override = default; + void init() override; + void setup(int) override; + void setup_minimal(int) override; protected: - virtual void recurse(int); + void recurse(int) override; }; } // namespace LAMMPS_NS diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h index 57561a9daf..f7adeaf536 100644 --- a/src/REPLICA/verlet_split.h +++ b/src/REPLICA/verlet_split.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class VerletSplit : public Verlet { public: VerletSplit(class LAMMPS *, int, char **); - ~VerletSplit(); - void init(); - void setup(int); - void setup_minimal(int); - void run(int); - double memory_usage(); + ~VerletSplit() override; + void init() override; + void setup(int) override; + void setup_minimal(int) override; + void run(int) override; + double memory_usage() override; private: int master; // 1 if an Rspace proc, 0 if Kspace diff --git a/src/respa.h b/src/respa.h index 5b6b9140e7..ed3dfa4ba4 100644 --- a/src/respa.h +++ b/src/respa.h @@ -46,13 +46,13 @@ class Respa : public Integrate { int pair_compute; // 1 if pair force need to be computed Respa(class LAMMPS *, int, char **); - virtual ~Respa(); - virtual void init(); - virtual void setup(int); - virtual void setup_minimal(int); - virtual void run(int); - virtual void cleanup(); - virtual void reset_dt(); + ~Respa() override; + void init() override; + void setup(int) override; + void setup_minimal(int) override; + void run(int) override; + void cleanup() override; + void reset_dt() override; void copy_f_flevel(int); void copy_flevel_f(int); diff --git a/src/verlet.h b/src/verlet.h index 4348bcfa07..26fb038ce6 100644 --- a/src/verlet.h +++ b/src/verlet.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class Verlet : public Integrate { public: Verlet(class LAMMPS *, int, char **); - virtual ~Verlet() {} - virtual void init(); - virtual void setup(int flag); - virtual void setup_minimal(int); - virtual void run(int); - void cleanup(); + ~Verlet() override = default; + void init() override; + void setup(int flag) override; + void setup_minimal(int) override; + void run(int) override; + void cleanup() override; protected: int triclinic; // 0 if domain is orthog, 1 if triclinic From e283bfa1fabd1490207fc421eaef8b5c75550708 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 19 Jan 2022 13:23:28 -0500 Subject: [PATCH 044/174] Apply override to Minimize classes --- src/min.h | 2 +- src/min_cg.h | 2 +- src/min_fire.h | 10 +++++----- src/min_fire_old.h | 10 +++++----- src/min_hftn.h | 10 +++++----- src/min_linesearch.h | 8 ++++---- src/min_quickmin.h | 10 +++++----- src/min_sd.h | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/min.h b/src/min.h index 61af3e23b3..82e14910d7 100644 --- a/src/min.h +++ b/src/min.h @@ -29,7 +29,7 @@ class Min : protected Pointers { int searchflag; // 0 if damped dynamics, 1 if sub-cycles on local search Min(class LAMMPS *); - virtual ~Min(); + ~Min() override; virtual void init(); virtual void setup(int flag = 1); virtual void setup_minimal(int); diff --git a/src/min_cg.h b/src/min_cg.h index 9b50068509..f203c0fbd6 100644 --- a/src/min_cg.h +++ b/src/min_cg.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class MinCG : public MinLineSearch { public: MinCG(class LAMMPS *); - int iterate(int); + int iterate(int) override; }; } // namespace LAMMPS_NS diff --git a/src/min_fire.h b/src/min_fire.h index 7e961b766a..0119972734 100644 --- a/src/min_fire.h +++ b/src/min_fire.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class MinFire : public Min { public: MinFire(class LAMMPS *); - ~MinFire() {} - void init(); - void setup_style(); - void reset_vectors(); - int iterate(int); + ~MinFire() override = default; + void init() override; + void setup_style() override; + void reset_vectors() override; + int iterate(int) override; private: double dt, dtmax, dtmin; diff --git a/src/min_fire_old.h b/src/min_fire_old.h index 06fe13daec..f32d66907d 100644 --- a/src/min_fire_old.h +++ b/src/min_fire_old.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class MinFireOld : public Min { public: MinFireOld(class LAMMPS *); - ~MinFireOld() {} - void init(); - void setup_style(); - void reset_vectors(); - int iterate(int); + ~MinFireOld() override = default; + void init() override; + void setup_style() override; + void reset_vectors() override; + int iterate(int) override; private: double dt, dtmax; diff --git a/src/min_hftn.h b/src/min_hftn.h index 4b909c3112..360f52a03d 100644 --- a/src/min_hftn.h +++ b/src/min_hftn.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class MinHFTN : public Min { public: MinHFTN(LAMMPS *); - ~MinHFTN(); - void init(); - void setup_style(); - void reset_vectors(); - int iterate(int); + ~MinHFTN() override; + void init() override; + void setup_style() override; + void reset_vectors() override; + int iterate(int) override; private: //---- THE ALGORITHM NEEDS TO STORE THIS MANY ATOM-BASED VECTORS, diff --git a/src/min_linesearch.h b/src/min_linesearch.h index 505de7494e..ff8a24fab0 100644 --- a/src/min_linesearch.h +++ b/src/min_linesearch.h @@ -21,10 +21,10 @@ namespace LAMMPS_NS { class MinLineSearch : public Min { public: MinLineSearch(class LAMMPS *); - ~MinLineSearch(); - void init(); - void setup_style(); - void reset_vectors(); + ~MinLineSearch() override; + void init() override; + void setup_style() override; + void reset_vectors() override; protected: // vectors needed by linesearch minimizers diff --git a/src/min_quickmin.h b/src/min_quickmin.h index 89022aa95b..8a199fb472 100644 --- a/src/min_quickmin.h +++ b/src/min_quickmin.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class MinQuickMin : public Min { public: MinQuickMin(class LAMMPS *); - ~MinQuickMin() {} - void init(); - void setup_style(); - void reset_vectors(); - int iterate(int); + ~MinQuickMin() override = default; + void init() override; + void setup_style() override; + void reset_vectors() override; + int iterate(int) override; private: double dt; diff --git a/src/min_sd.h b/src/min_sd.h index 2ccc1ba698..39d2c5f529 100644 --- a/src/min_sd.h +++ b/src/min_sd.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class MinSD : public MinLineSearch { public: MinSD(class LAMMPS *); - int iterate(int); + int iterate(int) override; }; } // namespace LAMMPS_NS From b8d403098314093a759fb0ffa30647c0d1d4fa74 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 19 Jan 2022 13:26:48 -0500 Subject: [PATCH 045/174] Update more core class destructors --- src/angle.h | 2 +- src/atom.h | 2 +- src/atom_vec.h | 2 +- src/bond.h | 2 +- src/compute.h | 2 +- src/dihedral.h | 2 +- src/fix.h | 2 +- src/force.h | 2 +- src/improper.h | 2 +- src/integrate.h | 2 +- src/kspace.h | 2 +- src/modify.h | 2 +- src/neigh_list.h | 2 +- src/neighbor.h | 2 +- src/output.h | 2 +- src/pair.h | 2 +- src/thermo.h | 2 +- src/timer.h | 2 +- src/universe.h | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/angle.h b/src/angle.h index 3a6521003e..12443fa4f3 100644 --- a/src/angle.h +++ b/src/angle.h @@ -43,7 +43,7 @@ class Angle : protected Pointers { int copymode; Angle(class LAMMPS *); - virtual ~Angle(); + ~Angle() override; virtual void init(); virtual void compute(int, int) = 0; virtual void settings(int, char **) {} diff --git a/src/atom.h b/src/atom.h index 25a56de1c4..ad8349d11c 100644 --- a/src/atom.h +++ b/src/atom.h @@ -284,7 +284,7 @@ class Atom : protected Pointers { // functions Atom(class LAMMPS *); - virtual ~Atom(); + ~Atom() override; void settings(class Atom *); void peratom_create(); diff --git a/src/atom_vec.h b/src/atom_vec.h index 6bc7f23532..ad1c7f3315 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -68,7 +68,7 @@ class AtomVec : protected Pointers { // methods AtomVec(class LAMMPS *); - virtual ~AtomVec(); + ~AtomVec() override; void store_args(int, char **); virtual void process_args(int, char **); diff --git a/src/bond.h b/src/bond.h index b2b2008b9e..9b9f35180a 100644 --- a/src/bond.h +++ b/src/bond.h @@ -39,7 +39,7 @@ class Bond : protected Pointers { int copymode; Bond(class LAMMPS *); - virtual ~Bond(); + ~Bond() override; virtual void init(); virtual void init_style() {} virtual void compute(int, int) = 0; diff --git a/src/compute.h b/src/compute.h index 05fded9b44..ef57754b18 100644 --- a/src/compute.h +++ b/src/compute.h @@ -104,7 +104,7 @@ class Compute : protected Pointers { int copymode, kokkosable; Compute(class LAMMPS *, int, char **); - virtual ~Compute(); + ~Compute() override; void modify_params(int, char **); void reset_extra_dof(); diff --git a/src/dihedral.h b/src/dihedral.h index 81daeef201..7bb7eb2650 100644 --- a/src/dihedral.h +++ b/src/dihedral.h @@ -43,7 +43,7 @@ class Dihedral : protected Pointers { int copymode; Dihedral(class LAMMPS *); - virtual ~Dihedral(); + ~Dihedral() override; virtual void init(); virtual void init_style() {} virtual void compute(int, int) = 0; diff --git a/src/fix.h b/src/fix.h index 339da03734..a83b032172 100644 --- a/src/fix.h +++ b/src/fix.h @@ -130,7 +130,7 @@ class Fix : protected Pointers { unsigned int datamask_read, datamask_modify; Fix(class LAMMPS *, int, char **); - virtual ~Fix(); + ~Fix() override; void modify_params(int, char **); virtual int setmask() = 0; diff --git a/src/force.h b/src/force.h index 09e13c7bd1..df00887ed0 100644 --- a/src/force.h +++ b/src/force.h @@ -117,7 +117,7 @@ class Force : protected Pointers { int special_extra; // extra space for added bonds Force(class LAMMPS *); - ~Force(); + ~Force() override; void init(); void setup(); diff --git a/src/improper.h b/src/improper.h index 1f88204a6b..dbe8bee3f1 100644 --- a/src/improper.h +++ b/src/improper.h @@ -43,7 +43,7 @@ class Improper : protected Pointers { int copymode; Improper(class LAMMPS *); - virtual ~Improper(); + ~Improper() override; virtual void init(); virtual void init_style() {} virtual void compute(int, int) = 0; diff --git a/src/integrate.h b/src/integrate.h index e38fad79dc..e2bf3d33e1 100644 --- a/src/integrate.h +++ b/src/integrate.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class Integrate : protected Pointers { public: Integrate(class LAMMPS *, int, char **); - virtual ~Integrate(); + ~Integrate() override; virtual void init(); virtual void setup(int flag) = 0; virtual void setup_minimal(int) = 0; diff --git a/src/kspace.h b/src/kspace.h index 22453d51a8..68d169ea97 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -100,7 +100,7 @@ class KSpace : protected Pointers { double splittol; // tolerance for when to truncate splitting KSpace(class LAMMPS *); - virtual ~KSpace(); + ~KSpace() override; void two_charge(); void triclinic_check(); void modify_params(int, char **); diff --git a/src/modify.h b/src/modify.h index c4f8c2ef02..e340012b04 100644 --- a/src/modify.h +++ b/src/modify.h @@ -53,7 +53,7 @@ class Modify : protected Pointers { Compute **compute; // list of computes Modify(class LAMMPS *); - virtual ~Modify(); + ~Modify() override; virtual void init(); virtual void setup(int); virtual void setup_pre_exchange(); diff --git a/src/neigh_list.h b/src/neigh_list.h index 8b920bbe50..abd9b8205e 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -102,7 +102,7 @@ class NeighList : protected Pointers { // methods NeighList(class LAMMPS *); - virtual ~NeighList(); + ~NeighList() override; void post_constructor(class NeighRequest *); void setup_pages(int, int); // setup page data structures void grow(int, int); // grow all data structs diff --git a/src/neighbor.h b/src/neighbor.h index a64e52fdbb..60687525a3 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -117,7 +117,7 @@ class Neighbor : protected Pointers { // public methods Neighbor(class LAMMPS *); - virtual ~Neighbor(); + ~Neighbor() override; virtual void init(); int request(void *, int instance = 0); int decide(); // decide whether to build or not diff --git a/src/output.h b/src/output.h index 3f557bdef5..14c1de6522 100644 --- a/src/output.h +++ b/src/output.h @@ -71,7 +71,7 @@ class Output : protected Pointers { DumpCreatorMap *dump_map; Output(class LAMMPS *); - ~Output(); + ~Output() override; void init(); void setup(int memflag = 1); // initial output before run/min void write(bigint); // output for current timestep diff --git a/src/pair.h b/src/pair.h index 00e6734773..a61af0c1da 100644 --- a/src/pair.h +++ b/src/pair.h @@ -123,7 +123,7 @@ class Pair : protected Pointers { int kokkosable; // 1 if Kokkos pair Pair(class LAMMPS *); - virtual ~Pair(); + ~Pair() override; // top-level Pair methods diff --git a/src/thermo.h b/src/thermo.h index 89678614a7..9eca4df18b 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -34,7 +34,7 @@ class Thermo : protected Pointers { enum { INT, FLOAT, BIGINT }; Thermo(class LAMMPS *, int, char **); - ~Thermo(); + ~Thermo() override; void init(); bigint lost_check(); void modify_params(int, char **); diff --git a/src/timer.h b/src/timer.h index a1fb592e43..245a81d660 100644 --- a/src/timer.h +++ b/src/timer.h @@ -44,7 +44,7 @@ class Timer : protected Pointers { enum tlevel { OFF = 0, LOOP, NORMAL, FULL }; Timer(class LAMMPS *); - ~Timer(){}; + ~Timer() override = default; void init(); // inline function to reduce overhead if we want no detailed timings diff --git a/src/universe.h b/src/universe.h index 30644dcd6d..3e5710a301 100644 --- a/src/universe.h +++ b/src/universe.h @@ -37,7 +37,7 @@ class Universe : protected Pointers { // proc uni2orig[I] in original communicator Universe(class LAMMPS *, MPI_Comm); - ~Universe(); + ~Universe() override; void reorder(char *, char *); void add_world(char *); int consistent(); From c166549c74d276591f5254bc55fa761aa895c78d Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 19 Jan 2022 14:26:25 -0500 Subject: [PATCH 046/174] Apply override to KOKKOS classes up to this point --- src/KOKKOS/atom_kokkos.h | 20 ++++++++++---------- src/KOKKOS/domain_kokkos.h | 14 +++++++------- src/KOKKOS/fix_minimize_kokkos.h | 12 ++++++------ src/KOKKOS/kokkos.h | 2 +- src/KOKKOS/min_cg_kokkos.h | 2 +- src/KOKKOS/min_kokkos.h | 28 ++++++++++++++-------------- src/KOKKOS/min_linesearch_kokkos.h | 8 ++++---- src/KOKKOS/neigh_bond_kokkos.h | 2 +- src/KOKKOS/neighbor_kokkos.h | 26 +++++++++++++------------- src/KOKKOS/region_block_kokkos.h | 4 ++-- src/KOKKOS/verlet_kokkos.h | 2 +- src/fix_minimize.h | 16 ++++++++-------- 12 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/KOKKOS/atom_kokkos.h b/src/KOKKOS/atom_kokkos.h index d3d73a6a90..624e6c05ff 100644 --- a/src/KOKKOS/atom_kokkos.h +++ b/src/KOKKOS/atom_kokkos.h @@ -67,11 +67,11 @@ class AtomKokkos : public Atom { AtomKokkos(class LAMMPS *); - virtual ~AtomKokkos(); + ~AtomKokkos() override; - void map_init(int check = 1); - void map_set(); - void map_delete(); + void map_init(int check = 1) override; + void map_set() override; + void map_delete() override; DAT::tdual_int_1d k_sametag; DAT::tdual_int_1d k_map_array; @@ -105,18 +105,18 @@ class AtomKokkos : public Atom { return local; } - virtual void allocate_type_arrays(); + void allocate_type_arrays() override; void sync(const ExecutionSpace space, unsigned int mask); void modified(const ExecutionSpace space, unsigned int mask); void sync_overlapping_device(const ExecutionSpace space, unsigned int mask); - virtual void sort(); + void sort() override; virtual void grow(unsigned int mask); - int add_custom(const char *, int, int); - void remove_custom(int, int, int); + int add_custom(const char *, int, int) override; + void remove_custom(int, int, int) override; virtual void deallocate_topology(); - void sync_modify(ExecutionSpace, unsigned int, unsigned int); + void sync_modify(ExecutionSpace, unsigned int, unsigned int) override; private: - class AtomVec *new_avec(const std::string &, int, int &); + class AtomVec *new_avec(const std::string &, int, int &) override; }; template diff --git a/src/KOKKOS/domain_kokkos.h b/src/KOKKOS/domain_kokkos.h index 50c7542e82..60e7c1c550 100644 --- a/src/KOKKOS/domain_kokkos.h +++ b/src/KOKKOS/domain_kokkos.h @@ -29,16 +29,16 @@ struct TagDomain_x2lamda{}; class DomainKokkos : public Domain { public: DomainKokkos(class LAMMPS *); - ~DomainKokkos() {} - void reset_box(); - void pbc(); + ~DomainKokkos() override = default; + void reset_box() override; + void pbc() override; void remap_all(); void image_flip(int, int, int); - void x2lamda(int); - void lamda2x(int); + void x2lamda(int) override; + void lamda2x(int) override; // forward remaining x2lamda() and lambda2x() variants to parent class - void x2lamda(double *a, double *b) { Domain::x2lamda(a,b); } - void lamda2x(double *a, double *b) { Domain::lamda2x(a,b); } + void x2lamda(double *a, double *b) override { Domain::x2lamda(a,b); } + void lamda2x(double *a, double *b) override { Domain::lamda2x(a,b); } void x2lamda(double *a, double *b, double *c, double *d) { Domain::x2lamda(a,b,c,d); } diff --git a/src/KOKKOS/fix_minimize_kokkos.h b/src/KOKKOS/fix_minimize_kokkos.h index a86788cc02..00d37d5b80 100644 --- a/src/KOKKOS/fix_minimize_kokkos.h +++ b/src/KOKKOS/fix_minimize_kokkos.h @@ -33,13 +33,13 @@ class FixMinimizeKokkos : public FixMinimize { public: FixMinimizeKokkos(class LAMMPS *, int, char **); - virtual ~FixMinimizeKokkos(); - void init() {} + ~FixMinimizeKokkos() override; + void init() override {} - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; void add_vector_kokkos(); DAT::t_float_1d request_vector_kokkos(int); diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index af35d95b9e..b2cc37dd71 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -54,7 +54,7 @@ class KokkosLMP : protected Pointers { static int init_ngpus; KokkosLMP(class LAMMPS *, int, char **); - ~KokkosLMP(); + ~KokkosLMP() override; static void initialize(Kokkos::InitArguments, Error *); static void finalize(); void accelerator(int, char **); diff --git a/src/KOKKOS/min_cg_kokkos.h b/src/KOKKOS/min_cg_kokkos.h index 3947693a9b..4eded98003 100644 --- a/src/KOKKOS/min_cg_kokkos.h +++ b/src/KOKKOS/min_cg_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class MinCGKokkos : public MinLineSearchKokkos { public: MinCGKokkos(class LAMMPS *); - int iterate(int); + int iterate(int) override; }; } diff --git a/src/KOKKOS/min_kokkos.h b/src/KOKKOS/min_kokkos.h index 3d06010517..53e9e8c198 100644 --- a/src/KOKKOS/min_kokkos.h +++ b/src/KOKKOS/min_kokkos.h @@ -23,19 +23,19 @@ namespace LAMMPS_NS { class MinKokkos : public Min { public: MinKokkos(class LAMMPS *); - virtual ~MinKokkos(); - void init(); - void setup(int flag=1); - void setup_minimal(int); - void run(int); - double fnorm_sqr(); - double fnorm_inf(); - double fnorm_max(); + ~MinKokkos() override; + void init() override; + void setup(int flag=1) override; + void setup_minimal(int) override; + void run(int) override; + double fnorm_sqr() override; + double fnorm_inf() override; + double fnorm_max() override; - virtual void init_style() {} - virtual void setup_style() = 0; - virtual void reset_vectors() = 0; - virtual int iterate(int) = 0; + void init_style() override {} + void setup_style() override = 0; + void reset_vectors() override = 0; + int iterate(int) override = 0; // possible return values of iterate() method enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE, @@ -47,8 +47,8 @@ class MinKokkos : public Min { DAT::t_ffloat_1d xvec; // variables for atomic dof, as 1d vector DAT::t_ffloat_1d fvec; // force vector for atomic dof, as 1d vector - double energy_force(int); - void force_clear(); + double energy_force(int) override; + void force_clear() override; }; } diff --git a/src/KOKKOS/min_linesearch_kokkos.h b/src/KOKKOS/min_linesearch_kokkos.h index 852d6cdaa8..67cfe9bcd1 100644 --- a/src/KOKKOS/min_linesearch_kokkos.h +++ b/src/KOKKOS/min_linesearch_kokkos.h @@ -43,10 +43,10 @@ namespace LAMMPS_NS { class MinLineSearchKokkos : public MinKokkos { public: MinLineSearchKokkos(class LAMMPS *); - ~MinLineSearchKokkos(); - void init(); - void setup_style(); - void reset_vectors(); + ~MinLineSearchKokkos() override; + void init() override; + void setup_style() override; + void reset_vectors() override; //protected: // won't compile with CUDA // vectors needed by linesearch minimizers diff --git a/src/KOKKOS/neigh_bond_kokkos.h b/src/KOKKOS/neigh_bond_kokkos.h index d2e5d0fc62..17c87dd5dc 100644 --- a/src/KOKKOS/neigh_bond_kokkos.h +++ b/src/KOKKOS/neigh_bond_kokkos.h @@ -42,7 +42,7 @@ class NeighBondKokkos : protected Pointers { typedef int value_type; NeighBondKokkos(class LAMMPS *); - ~NeighBondKokkos() {} + ~NeighBondKokkos() override = default; void init_topology_kk(); void build_topology_kk(); diff --git a/src/KOKKOS/neighbor_kokkos.h b/src/KOKKOS/neighbor_kokkos.h index ef885535ed..16c0c5369a 100644 --- a/src/KOKKOS/neighbor_kokkos.h +++ b/src/KOKKOS/neighbor_kokkos.h @@ -33,10 +33,10 @@ class NeighborKokkos : public Neighbor { typedef int value_type; NeighborKokkos(class LAMMPS *); - ~NeighborKokkos(); - void init(); - void init_topology(); - void build_topology(); + ~NeighborKokkos() override; + void init() override; + void init_topology() override; + void build_topology() override; template KOKKOS_INLINE_FUNCTION @@ -73,22 +73,22 @@ class NeighborKokkos : public Neighbor { X_FLOAT deltasq; - void init_cutneighsq_kokkos(int); - void create_kokkos_list(int); - void init_ex_type_kokkos(int); - void init_ex_bit_kokkos(); - void init_ex_mol_bit_kokkos(); - void grow_ex_mol_intra_kokkos(); - virtual int check_distance(); + void init_cutneighsq_kokkos(int) override; + void create_kokkos_list(int) override; + void init_ex_type_kokkos(int) override; + void init_ex_bit_kokkos() override; + void init_ex_mol_bit_kokkos() override; + void grow_ex_mol_intra_kokkos() override; + int check_distance() override; template int check_distance_kokkos(); - virtual void build(int); + void build(int) override; template void build_kokkos(int); void setup_bins_kokkos(int); void modify_ex_type_grow_kokkos(); void modify_ex_group_grow_kokkos(); void modify_mol_group_grow_kokkos(); void modify_mol_intra_grow_kokkos(); - void set_binsize_kokkos(); + void set_binsize_kokkos() override; }; } diff --git a/src/KOKKOS/region_block_kokkos.h b/src/KOKKOS/region_block_kokkos.h index dc57a09bda..720a266524 100644 --- a/src/KOKKOS/region_block_kokkos.h +++ b/src/KOKKOS/region_block_kokkos.h @@ -40,8 +40,8 @@ class RegBlockKokkos : public RegBlock, public KokkosBase { typedef ArrayTypes AT; RegBlockKokkos(class LAMMPS *, int, char **); - ~RegBlockKokkos(); - void match_all_kokkos(int, DAT::tdual_int_1d); + ~RegBlockKokkos() override; + void match_all_kokkos(int, DAT::tdual_int_1d) override; KOKKOS_INLINE_FUNCTION void operator()(TagRegBlockMatchAll, const int&) const; diff --git a/src/KOKKOS/verlet_kokkos.h b/src/KOKKOS/verlet_kokkos.h index 7487da9cca..95c58e2c6b 100644 --- a/src/KOKKOS/verlet_kokkos.h +++ b/src/KOKKOS/verlet_kokkos.h @@ -47,7 +47,7 @@ class VerletKokkos : public Verlet { protected: DAT::t_f_array f_merge_copy,f; - void force_clear(); + void force_clear() override; }; } diff --git a/src/fix_minimize.h b/src/fix_minimize.h index 690b2790de..8b5536dc68 100644 --- a/src/fix_minimize.h +++ b/src/fix_minimize.h @@ -29,15 +29,15 @@ class FixMinimize : public Fix { public: FixMinimize(class LAMMPS *, int, char **); - virtual ~FixMinimize(); - int setmask(); - virtual void init() {} + ~FixMinimize() override; + int setmask() override; + void init() override {} - double memory_usage(); - virtual void grow_arrays(int); - virtual void copy_arrays(int, int, int); - virtual int pack_exchange(int, double *); - virtual int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; virtual void add_vector(int); double *request_vector(int); From 9d8394fe63d84fa0e344a70260b63686b20bbd9a Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 19 Jan 2022 14:45:32 -0500 Subject: [PATCH 047/174] Apply override to text_file_reader.h --- src/text_file_reader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 34556d7eb3..77c5abada5 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -52,9 +52,9 @@ class FileReaderException : public std::exception { public: FileReaderException(const std::string &msg) : message(msg) {} - ~FileReaderException() noexcept {} + ~FileReaderException() noexcept override {} - virtual const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; class EOFException : public FileReaderException { From b45a6d77203ccf94544c4594e01322ea10ae1dc9 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 19 Jan 2022 17:01:24 -0500 Subject: [PATCH 048/174] Apply override to AtomVec classes --- src/AWPMD/atom_vec_wavepacket.h | 12 +-- src/CG-DNA/atom_vec_oxdna.h | 8 +- src/DIELECTRIC/atom_vec_dielectric.h | 12 +-- src/DIPOLE/atom_vec_dipole.h | 4 +- src/DPD-MESO/atom_vec_edpd.h | 10 +-- src/DPD-MESO/atom_vec_mdpd.h | 12 +-- src/DPD-MESO/atom_vec_tdpd.h | 10 +-- src/DPD-REACT/atom_vec_dpd.h | 6 +- src/EFF/atom_vec_electron.h | 12 +-- src/KOKKOS/atom_vec_angle_kokkos.h | 78 +++++++++--------- src/KOKKOS/atom_vec_atomic_kokkos.h | 50 ++++++------ src/KOKKOS/atom_vec_bond_kokkos.h | 60 +++++++------- src/KOKKOS/atom_vec_charge_kokkos.h | 60 +++++++------- src/KOKKOS/atom_vec_dpd_kokkos.h | 82 +++++++++---------- src/KOKKOS/atom_vec_full_kokkos.h | 60 +++++++------- src/KOKKOS/atom_vec_hybrid_kokkos.h | 88 ++++++++++---------- src/KOKKOS/atom_vec_kokkos.h | 22 ++--- src/KOKKOS/atom_vec_molecular_kokkos.h | 78 +++++++++--------- src/KOKKOS/atom_vec_sphere_kokkos.h | 108 ++++++++++++------------- src/KOKKOS/atom_vec_spin_kokkos.h | 60 +++++++------- src/MACHDYN/atom_vec_smd.h | 8 +- src/MOLECULE/atom_vec_angle.h | 12 +-- src/MOLECULE/atom_vec_bond.h | 12 +-- src/MOLECULE/atom_vec_full.h | 12 +-- src/MOLECULE/atom_vec_molecular.h | 12 +-- src/MOLECULE/atom_vec_template.h | 12 +-- src/PERI/atom_vec_peri.h | 10 +-- src/SPH/atom_vec_sph.h | 12 +-- src/SPIN/atom_vec_spin.h | 6 +- src/atom_vec_atomic.h | 2 +- src/atom_vec_body.h | 44 +++++----- src/atom_vec_ellipsoid.h | 42 +++++----- src/atom_vec_hybrid.h | 58 ++++++------- src/atom_vec_line.h | 44 +++++----- src/atom_vec_sphere.h | 14 ++-- src/atom_vec_tri.h | 44 +++++----- src/molecule.h | 2 +- 37 files changed, 589 insertions(+), 589 deletions(-) diff --git a/src/AWPMD/atom_vec_wavepacket.h b/src/AWPMD/atom_vec_wavepacket.h index 310180b1b4..0a23e23019 100644 --- a/src/AWPMD/atom_vec_wavepacket.h +++ b/src/AWPMD/atom_vec_wavepacket.h @@ -28,12 +28,12 @@ class AtomVecWavepacket : public AtomVec { public: AtomVecWavepacket(class LAMMPS *); - void grow_pointers(); - void force_clear(int, size_t); - void create_atom_post(int); - void data_atom_post(int); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void create_atom_post(int) override; + void data_atom_post(int) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; private: int *spin; diff --git a/src/CG-DNA/atom_vec_oxdna.h b/src/CG-DNA/atom_vec_oxdna.h index c100abdfff..338c1adca3 100644 --- a/src/CG-DNA/atom_vec_oxdna.h +++ b/src/CG-DNA/atom_vec_oxdna.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class AtomVecOxdna : public AtomVec { public: AtomVecOxdna(class LAMMPS *); - ~AtomVecOxdna() = default; + ~AtomVecOxdna() override = default; - void grow_pointers(); - void data_atom_post(int); - void data_bonds_post(int, int, tagint, tagint, tagint); + void grow_pointers() override; + void data_atom_post(int) override; + void data_bonds_post(int, int, tagint, tagint, tagint) override; private: tagint *id5p; diff --git a/src/DIELECTRIC/atom_vec_dielectric.h b/src/DIELECTRIC/atom_vec_dielectric.h index 8e342eda08..2d4510b330 100644 --- a/src/DIELECTRIC/atom_vec_dielectric.h +++ b/src/DIELECTRIC/atom_vec_dielectric.h @@ -31,12 +31,12 @@ class AtomVecDielectric : public AtomVec { public: AtomVecDielectric(class LAMMPS *); - void grow_pointers(); - void create_atom_post(int); - void data_atom_post(int); - void unpack_restart_init(int); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + void grow_pointers() override; + void create_atom_post(int) override; + void data_atom_post(int) override; + void unpack_restart_init(int) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; protected: int *num_bond, *num_angle, *num_dihedral, *num_improper; diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h index d47e39beb5..0c76bb54bf 100644 --- a/src/DIPOLE/atom_vec_dipole.h +++ b/src/DIPOLE/atom_vec_dipole.h @@ -28,8 +28,8 @@ class AtomVecDipole : public AtomVec { public: AtomVecDipole(class LAMMPS *); - void grow_pointers(); - void data_atom_post(int); + void grow_pointers() override; + void data_atom_post(int) override; private: double **mu; diff --git a/src/DPD-MESO/atom_vec_edpd.h b/src/DPD-MESO/atom_vec_edpd.h index da17a855eb..fb47fba628 100644 --- a/src/DPD-MESO/atom_vec_edpd.h +++ b/src/DPD-MESO/atom_vec_edpd.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class AtomVecEDPD : public AtomVec { public: AtomVecEDPD(class LAMMPS *); - void init(); + void init() override; - void grow_pointers(); - void force_clear(int, size_t); - void create_atom_post(int); - void data_atom_post(int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void create_atom_post(int) override; + void data_atom_post(int) override; private: double *edpd_cv, *edpd_temp, *edpd_flux; diff --git a/src/DPD-MESO/atom_vec_mdpd.h b/src/DPD-MESO/atom_vec_mdpd.h index 67134f30f0..4e8aefeebe 100644 --- a/src/DPD-MESO/atom_vec_mdpd.h +++ b/src/DPD-MESO/atom_vec_mdpd.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class AtomVecMDPD : public AtomVec { public: AtomVecMDPD(class LAMMPS *); - void init(); + void init() override; - void grow_pointers(); - void force_clear(int, size_t); - void data_atom_post(int); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void data_atom_post(int) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; private: double *rho, *drho; diff --git a/src/DPD-MESO/atom_vec_tdpd.h b/src/DPD-MESO/atom_vec_tdpd.h index 898c48c160..0ebffbe0de 100644 --- a/src/DPD-MESO/atom_vec_tdpd.h +++ b/src/DPD-MESO/atom_vec_tdpd.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class AtomVecTDPD : public AtomVec { public: AtomVecTDPD(class LAMMPS *); - void process_args(int, char **); - void init(); + void process_args(int, char **) override; + void init() override; - void grow_pointers(); - void force_clear(int, size_t); - void data_atom_post(int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void data_atom_post(int) override; protected: double **cc_flux; diff --git a/src/DPD-REACT/atom_vec_dpd.h b/src/DPD-REACT/atom_vec_dpd.h index 3a4e4ecec1..da4387f553 100644 --- a/src/DPD-REACT/atom_vec_dpd.h +++ b/src/DPD-REACT/atom_vec_dpd.h @@ -28,9 +28,9 @@ class AtomVecDPD : public AtomVec { public: AtomVecDPD(class LAMMPS *); - void grow_pointers(); - void unpack_restart_init(int); - void data_atom_post(int); + void grow_pointers() override; + void unpack_restart_init(int) override; + void data_atom_post(int) override; private: double *rho, *dpdTheta; diff --git a/src/EFF/atom_vec_electron.h b/src/EFF/atom_vec_electron.h index 50883e0764..6c9b11cccb 100644 --- a/src/EFF/atom_vec_electron.h +++ b/src/EFF/atom_vec_electron.h @@ -28,12 +28,12 @@ class AtomVecElectron : public AtomVec { public: AtomVecElectron(class LAMMPS *); - void grow_pointers(); - void force_clear(int, size_t); - void create_atom_post(int); - void data_atom_post(int); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void create_atom_post(int) override; + void data_atom_post(int) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; private: int *spin; diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index 9bc7753889..c5cd639cf5 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -30,63 +30,63 @@ namespace LAMMPS_NS { class AtomVecAngleKokkos : public AtomVecKokkos { public: AtomVecAngleKokkos(class LAMMPS *); - virtual ~AtomVecAngleKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_comm(int, int *, double *, int, int *); - int pack_comm_vel(int, int *, double *, int, int *); - void unpack_comm(int, int, double *); - void unpack_comm_vel(int, int, double *); - int pack_reverse(int, int, double *); - void unpack_reverse(int, int *, double *); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecAngleKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_comm(int, int *, double *, int, int *) override; + int pack_comm_vel(int, int *, double *, int, int *) override; + void unpack_comm(int, int, double *) override; + void unpack_comm_vel(int, int, double *) override; + int pack_reverse(int, int, double *) override; + void unpack_reverse(int, int *, double *) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; void unpack_comm_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf); + const DAT::tdual_xfloat_2d &buf) override; int pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap, const int nfirst, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index 1197bc04e7..d14e9e6c85 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -31,43 +31,43 @@ namespace LAMMPS_NS { class AtomVecAtomicKokkos : public AtomVecKokkos { public: AtomVecAtomicKokkos(class LAMMPS *); - virtual ~AtomVecAtomicKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - void pack_data(double **); - void write_data(FILE *, int, double **); - double memory_usage(); + ~AtomVecAtomicKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + void pack_data(double **) override; + void write_data(FILE *, int, double **) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: tagint *tag; diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index a9bc5a1092..e8522887a1 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -30,48 +30,48 @@ namespace LAMMPS_NS { class AtomVecBondKokkos : public AtomVecKokkos { public: AtomVecBondKokkos(class LAMMPS *); - virtual ~AtomVecBondKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecBondKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index 866b836350..438f3106a7 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -31,48 +31,48 @@ namespace LAMMPS_NS { class AtomVecChargeKokkos : public AtomVecKokkos { public: AtomVecChargeKokkos(class LAMMPS *); - virtual ~AtomVecChargeKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int , const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecChargeKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int , const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: tagint *tag; diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index 2168fa630c..79d8c5a59f 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -31,65 +31,65 @@ namespace LAMMPS_NS { class AtomVecDPDKokkos : public AtomVecKokkos { public: AtomVecDPDKokkos(class LAMMPS *); - virtual ~AtomVecDPDKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_comm(int, int *, double *, int, int *); - int pack_comm_vel(int, int *, double *, int, int *); - int pack_comm_hybrid(int, int *, double *); - void unpack_comm(int, int, double *); - void unpack_comm_vel(int, int, double *); - int unpack_comm_hybrid(int, int, double *); - int pack_reverse(int, int, double *); - void unpack_reverse(int, int *, double *); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecDPDKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_comm(int, int *, double *, int, int *) override; + int pack_comm_vel(int, int *, double *, int, int *) override; + int pack_comm_hybrid(int, int *, double *) override; + void unpack_comm(int, int, double *) override; + void unpack_comm_vel(int, int, double *) override; + int unpack_comm_hybrid(int, int, double *) override; + int pack_reverse(int, int, double *) override; + void unpack_reverse(int, int *, double *) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; void unpack_comm_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf); + const DAT::tdual_xfloat_2d &buf) override; int pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap, const int nfirst, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; double *uCond,*uMech,*uChem,*uCG,*uCGnew,*rho,*dpdTheta; double *duChem; diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index b5ce032c4f..95e35ef85f 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -30,48 +30,48 @@ namespace LAMMPS_NS { class AtomVecFullKokkos : public AtomVecKokkos { public: AtomVecFullKokkos(class LAMMPS *); - virtual ~AtomVecFullKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecFullKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index 567b98695f..29417f1e05 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -33,68 +33,68 @@ class AtomVecHybridKokkos : public AtomVecKokkos { char **keywords; AtomVecHybridKokkos(class LAMMPS *); - ~AtomVecHybridKokkos(); - void process_args(int, char **); - void init(); - void grow(int); - void grow_pointers(); - void copy(int, int, int); - void clear_bonus(); - void force_clear(int, size_t); - int pack_comm(int, int *, double *, int, int *); - int pack_comm_vel(int, int *, double *, int, int *); - void unpack_comm(int, int, double *); - void unpack_comm_vel(int, int, double *); - int pack_reverse(int, int, double *); - void unpack_reverse(int, int *, double *); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int) {return 0;} - void data_vel(int, const std::vector &); - void pack_data(double **); - void write_data(FILE *, int, double **); - void pack_vel(double **); - void write_vel(FILE *, int, double **); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); - double memory_usage(); + ~AtomVecHybridKokkos() override; + void process_args(int, char **) override; + void init() override; + void grow(int) override; + void grow_pointers() override; + void copy(int, int, int) override; + void clear_bonus() override; + void force_clear(int, size_t) override; + int pack_comm(int, int *, double *, int, int *) override; + int pack_comm_vel(int, int *, double *, int, int *) override; + void unpack_comm(int, int, double *) override; + void unpack_comm_vel(int, int, double *) override; + int pack_reverse(int, int, double *) override; + void unpack_reverse(int, int *, double *) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override {return 0;} + void data_vel(int, const std::vector &) override; + void pack_data(double **) override; + void write_data(FILE *, int, double **) override; + void pack_vel(double **) override; + void write_vel(FILE *, int, double **) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; + double memory_usage() override; int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; void unpack_comm_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf); + const DAT::tdual_xfloat_2d &buf) override; int pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap, const int nfirst, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; private: tagint *tag; diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index 20dd41dd75..4b91740cb9 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -36,17 +36,17 @@ union d_ubuf { class AtomVecKokkos : public AtomVec { public: AtomVecKokkos(class LAMMPS *); - virtual ~AtomVecKokkos() {} - bigint roundup(bigint); - virtual int pack_comm(int, int *, double *, int, int *); - virtual int pack_comm_vel(int, int *, double *, int, int *); - virtual void unpack_comm(int, int, double *); - virtual void unpack_comm_vel(int, int, double *); - virtual int pack_reverse(int, int, double *); - virtual void unpack_reverse(int, int *, double *); - virtual void data_vel(int, const std::vector &); - virtual void pack_vel(double **); - virtual void write_vel(FILE *, int, double **); + ~AtomVecKokkos() override = default; + bigint roundup(bigint) override; + int pack_comm(int, int *, double *, int, int *) override; + int pack_comm_vel(int, int *, double *, int, int *) override; + void unpack_comm(int, int, double *) override; + void unpack_comm_vel(int, int, double *) override; + int pack_reverse(int, int, double *) override; + void unpack_reverse(int, int *, double *) override; + void data_vel(int, const std::vector &) override; + void pack_vel(double **) override; + void write_vel(FILE *, int, double **) override; virtual void sync(ExecutionSpace space, unsigned int mask) = 0; virtual void modified(ExecutionSpace space, unsigned int mask) = 0; diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index abd04f905b..435d004a71 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -30,63 +30,63 @@ namespace LAMMPS_NS { class AtomVecMolecularKokkos : public AtomVecKokkos { public: AtomVecMolecularKokkos(class LAMMPS *); - virtual ~AtomVecMolecularKokkos() {} - void grow(int); - void copy(int, int, int); - int pack_comm(int, int *, double *, int, int *); - int pack_comm_vel(int, int *, double *, int, int *); - void unpack_comm(int, int, double *); - void unpack_comm_vel(int, int, double *); - int pack_reverse(int, int, double *); - void unpack_reverse(int, int *, double *); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecMolecularKokkos() override = default; + void grow(int) override; + void copy(int, int, int) override; + int pack_comm(int, int *, double *, int, int *) override; + int pack_comm_vel(int, int *, double *, int, int *) override; + void unpack_comm(int, int, double *) override; + void unpack_comm_vel(int, int, double *) override; + int pack_reverse(int, int, double *) override; + void unpack_reverse(int, int *, double *) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; - void grow_pointers(); + void grow_pointers() override; int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; void unpack_comm_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf); + const DAT::tdual_xfloat_2d &buf) override; int pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap, const int nfirst, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index a9ba4baa24..107e21005b 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -31,86 +31,86 @@ namespace LAMMPS_NS { class AtomVecSphereKokkos : public AtomVecKokkos { public: AtomVecSphereKokkos(class LAMMPS *); - ~AtomVecSphereKokkos() {} - void init(); - void grow(int); - void grow_pointers(); - void copy(int, int, int); - int pack_comm(int, int *, double *, int, int *); - int pack_comm_vel(int, int *, double *, int, int *); - int pack_comm_hybrid(int, int *, double *); - void unpack_comm(int, int, double *); - void unpack_comm_vel(int, int, double *); - int unpack_comm_hybrid(int, int, double *); - int pack_reverse(int, int, double *); - int pack_reverse_hybrid(int, int, double *); - void unpack_reverse(int, int *, double *); - int unpack_reverse_hybrid(int, int *, double *); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void data_vel(int, const std::vector &); - int data_vel_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - void pack_vel(double **); - int pack_vel_hybrid(int, double *); - void write_vel(FILE *, int, double **); - int write_vel_hybrid(FILE *, double *); - double memory_usage(); + ~AtomVecSphereKokkos() override = default; + void init() override; + void grow(int) override; + void grow_pointers() override; + void copy(int, int, int) override; + int pack_comm(int, int *, double *, int, int *) override; + int pack_comm_vel(int, int *, double *, int, int *) override; + int pack_comm_hybrid(int, int *, double *) override; + void unpack_comm(int, int, double *) override; + void unpack_comm_vel(int, int, double *) override; + int unpack_comm_hybrid(int, int, double *) override; + int pack_reverse(int, int, double *) override; + int pack_reverse_hybrid(int, int, double *) override; + void unpack_reverse(int, int *, double *) override; + int unpack_reverse_hybrid(int, int *, double *) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void data_vel(int, const std::vector &) override; + int data_vel_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + void pack_vel(double **) override; + int pack_vel_hybrid(int, double *) override; + void write_vel(FILE *, int, double **) override; + int write_vel_hybrid(FILE *, double *) override; + double memory_usage() override; int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; void unpack_comm_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf); + const DAT::tdual_xfloat_2d &buf) override; int pack_comm_vel_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; void unpack_comm_vel_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf); + const DAT::tdual_xfloat_2d &buf) override; int pack_comm_self(const int &n, const DAT::tdual_int_2d &list, const int & iswap, const int nfirst, - const int &pbc_flag, const int pbc[]); + const int &pbc_flag, const int pbc[]) override; int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_border_vel_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_vel_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; private: tagint *tag; diff --git a/src/KOKKOS/atom_vec_spin_kokkos.h b/src/KOKKOS/atom_vec_spin_kokkos.h index 38d206c007..329e2bf9e6 100644 --- a/src/KOKKOS/atom_vec_spin_kokkos.h +++ b/src/KOKKOS/atom_vec_spin_kokkos.h @@ -31,52 +31,52 @@ namespace LAMMPS_NS { class AtomVecSpinKokkos : public AtomVecKokkos { public: AtomVecSpinKokkos(class LAMMPS *); - void grow(int); - void copy(int, int, int); - int pack_border(int, int *, double *, int, int *); - int pack_border_vel(int, int *, double *, int, int *); - int pack_border_hybrid(int, int *, double *); - void unpack_border(int, int, double *); - void unpack_border_vel(int, int, double *); - int unpack_border_hybrid(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(double *); - int size_restart(); - int pack_restart(int, double *); - int unpack_restart(double *); - void create_atom(int, double *); - void data_atom(double *, imageint, const std::vector &); - int data_atom_hybrid(int, const std::vector &, int); - void pack_data(double **); - int pack_data_hybrid(int, double *); - void write_data(FILE *, int, double **); - int write_data_hybrid(FILE *, double *); - double memory_usage(); + void grow(int) override; + void copy(int, int, int) override; + int pack_border(int, int *, double *, int, int *) override; + int pack_border_vel(int, int *, double *, int, int *) override; + int pack_border_hybrid(int, int *, double *) override; + void unpack_border(int, int, double *) override; + void unpack_border_vel(int, int, double *) override; + int unpack_border_hybrid(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(double *) override; + int size_restart() override; + int pack_restart(int, double *) override; + int unpack_restart(double *) override; + void create_atom(int, double *) override; + void data_atom(double *, imageint, const std::vector &) override; + int data_atom_hybrid(int, const std::vector &, int) override; + void pack_data(double **) override; + int pack_data_hybrid(int, double *) override; + void write_data(FILE *, int, double **) override; + int write_data_hybrid(FILE *, double *) override; + double memory_usage() override; // clear magnetic and mechanic forces - void force_clear(int, size_t); + void force_clear(int, size_t) override; - void grow_pointers(); + void grow_pointers() override; // input lists to be checked int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space); + int pbc_flag, int *pbc, ExecutionSpace space) override; void unpack_border_kokkos(const int &n, const int &nfirst, const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space); + ExecutionSpace space) override; int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, DAT::tdual_int_1d k_sendlist, DAT::tdual_int_1d k_copylist, ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi); + X_FLOAT lo, X_FLOAT hi) override; int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space); + ExecutionSpace space) override; - void sync(ExecutionSpace space, unsigned int mask); - void modified(ExecutionSpace space, unsigned int mask); - void sync_overlapping_device(ExecutionSpace space, unsigned int mask); + void sync(ExecutionSpace space, unsigned int mask) override; + void modified(ExecutionSpace space, unsigned int mask) override; + void sync_overlapping_device(ExecutionSpace space, unsigned int mask) override; protected: tagint *tag; diff --git a/src/MACHDYN/atom_vec_smd.h b/src/MACHDYN/atom_vec_smd.h index ada2c2c936..a1ed384f1d 100644 --- a/src/MACHDYN/atom_vec_smd.h +++ b/src/MACHDYN/atom_vec_smd.h @@ -39,10 +39,10 @@ class AtomVecSMD : public AtomVec { public: AtomVecSMD(class LAMMPS *); - void grow_pointers(); - void force_clear(int, size_t); - void create_atom_post(int); - void data_atom_post(int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void create_atom_post(int) override; + void data_atom_post(int) override; private: tagint *molecule; diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h index 5ec0166f98..89d810063f 100644 --- a/src/MOLECULE/atom_vec_angle.h +++ b/src/MOLECULE/atom_vec_angle.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class AtomVecAngle : public AtomVec { public: AtomVecAngle(class LAMMPS *); - ~AtomVecAngle(); + ~AtomVecAngle() override; - void grow_pointers(); - void pack_restart_pre(int); - void pack_restart_post(int); - void unpack_restart_init(int); - void data_atom_post(int); + void grow_pointers() override; + void pack_restart_pre(int) override; + void pack_restart_post(int) override; + void unpack_restart_init(int) override; + void data_atom_post(int) override; private: int *num_bond, *num_angle; diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h index 4aa8ff5edc..3c9e429ada 100644 --- a/src/MOLECULE/atom_vec_bond.h +++ b/src/MOLECULE/atom_vec_bond.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class AtomVecBond : public AtomVec { public: AtomVecBond(class LAMMPS *); - ~AtomVecBond(); + ~AtomVecBond() override; - void grow_pointers(); - void pack_restart_pre(int); - void pack_restart_post(int); - void unpack_restart_init(int); - void data_atom_post(int); + void grow_pointers() override; + void pack_restart_pre(int) override; + void pack_restart_post(int) override; + void unpack_restart_init(int) override; + void data_atom_post(int) override; private: int *num_bond; diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h index 5fff686e78..a337ad3244 100644 --- a/src/MOLECULE/atom_vec_full.h +++ b/src/MOLECULE/atom_vec_full.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class AtomVecFull : public AtomVec { public: AtomVecFull(class LAMMPS *); - ~AtomVecFull(); + ~AtomVecFull() override; - void grow_pointers(); - void pack_restart_pre(int); - void pack_restart_post(int); - void unpack_restart_init(int); - void data_atom_post(int); + void grow_pointers() override; + void pack_restart_pre(int) override; + void pack_restart_post(int) override; + void unpack_restart_init(int) override; + void data_atom_post(int) override; private: int *num_bond, *num_angle, *num_dihedral, *num_improper; diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h index b98b3114f0..9428a8491a 100644 --- a/src/MOLECULE/atom_vec_molecular.h +++ b/src/MOLECULE/atom_vec_molecular.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class AtomVecMolecular : public AtomVec { public: AtomVecMolecular(class LAMMPS *); - ~AtomVecMolecular(); + ~AtomVecMolecular() override; - void grow_pointers(); - void pack_restart_pre(int); - void pack_restart_post(int); - void unpack_restart_init(int); - void data_atom_post(int); + void grow_pointers() override; + void pack_restart_pre(int) override; + void pack_restart_post(int) override; + void unpack_restart_init(int) override; + void data_atom_post(int) override; private: int *num_bond, *num_angle, *num_dihedral, *num_improper; diff --git a/src/MOLECULE/atom_vec_template.h b/src/MOLECULE/atom_vec_template.h index 0050190eb6..2d7a2e12ac 100644 --- a/src/MOLECULE/atom_vec_template.h +++ b/src/MOLECULE/atom_vec_template.h @@ -28,12 +28,12 @@ class AtomVecTemplate : public AtomVec { public: AtomVecTemplate(class LAMMPS *); - void grow_pointers(); - void process_args(int, char **); - void create_atom_post(int); - void pack_data_pre(int); - void pack_data_post(int); - void data_atom_post(int); + void grow_pointers() override; + void process_args(int, char **) override; + void create_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; + void data_atom_post(int) override; private: int *molindex, *molatom; diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h index 10c68bbb41..0d37138b36 100644 --- a/src/PERI/atom_vec_peri.h +++ b/src/PERI/atom_vec_peri.h @@ -28,11 +28,11 @@ class AtomVecPeri : public AtomVec { public: AtomVecPeri(class LAMMPS *); - void grow_pointers(); - void create_atom_post(int); - void data_atom_post(int); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + void grow_pointers() override; + void create_atom_post(int) override; + void data_atom_post(int) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; private: double *rmass, *vfrac, *s0; diff --git a/src/SPH/atom_vec_sph.h b/src/SPH/atom_vec_sph.h index 2ff254da68..8af3ac2fc3 100644 --- a/src/SPH/atom_vec_sph.h +++ b/src/SPH/atom_vec_sph.h @@ -28,12 +28,12 @@ class AtomVecSPH : public AtomVec { public: AtomVecSPH(class LAMMPS *); - void grow_pointers(); - void force_clear(int, size_t); - void create_atom_post(int); - void data_atom_post(int); - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void create_atom_post(int) override; + void data_atom_post(int) override; + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; private: double *rho, *drho, *esph, *desph, *cv; diff --git a/src/SPIN/atom_vec_spin.h b/src/SPIN/atom_vec_spin.h index ff995d2f13..de376475ea 100644 --- a/src/SPIN/atom_vec_spin.h +++ b/src/SPIN/atom_vec_spin.h @@ -28,9 +28,9 @@ class AtomVecSpin : public AtomVec { public: AtomVecSpin(class LAMMPS *); - void grow_pointers(); - void force_clear(int, size_t); - void data_atom_post(int); + void grow_pointers() override; + void force_clear(int, size_t) override; + void data_atom_post(int) override; private: double **sp, **fm, **fm_long; diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h index c4132f8201..4ce56ff873 100644 --- a/src/atom_vec_atomic.h +++ b/src/atom_vec_atomic.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class AtomVecAtomic : public AtomVec { public: AtomVecAtomic(class LAMMPS *); - ~AtomVecAtomic() {} + ~AtomVecAtomic() override = default; }; } // namespace LAMMPS_NS diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index 3168c5d23a..89137cc2b6 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -40,31 +40,31 @@ class AtomVecBody : public AtomVec { struct Bonus *bonus; AtomVecBody(class LAMMPS *); - ~AtomVecBody(); - void process_args(int, char **); + ~AtomVecBody() override; + void process_args(int, char **) override; - void grow_pointers(); - void copy_bonus(int, int, int); - void clear_bonus(); - int pack_comm_bonus(int, int *, double *); - void unpack_comm_bonus(int, int, double *); - int pack_border_bonus(int, int *, double *); - int unpack_border_bonus(int, int, double *); - int pack_exchange_bonus(int, double *); - int unpack_exchange_bonus(int, double *); - int size_restart_bonus(); - int pack_restart_bonus(int, double *); - int unpack_restart_bonus(int, double *); - void data_body(int, int, int, int *, double *); - double memory_usage_bonus(); + void grow_pointers() override; + void copy_bonus(int, int, int) override; + void clear_bonus() override; + int pack_comm_bonus(int, int *, double *) override; + void unpack_comm_bonus(int, int, double *) override; + int pack_border_bonus(int, int *, double *) override; + int unpack_border_bonus(int, int, double *) override; + int pack_exchange_bonus(int, double *) override; + int unpack_exchange_bonus(int, double *) override; + int size_restart_bonus() override; + int pack_restart_bonus(int, double *) override; + int unpack_restart_bonus(int, double *) override; + void data_body(int, int, int, int *, double *) override; + double memory_usage_bonus() override; - void create_atom_post(int); - void data_atom_post(int); - void pack_data_pre(int); - void pack_data_post(int); + void create_atom_post(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; - int pack_data_bonus(double *, int); - void write_data_bonus(FILE *, int, double *, int); + int pack_data_bonus(double *, int) override; + void write_data_bonus(FILE *, int, double *, int) override; // methods used by other classes to query/set body info diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h index bb50944f30..1d344b8b60 100644 --- a/src/atom_vec_ellipsoid.h +++ b/src/atom_vec_ellipsoid.h @@ -34,30 +34,30 @@ class AtomVecEllipsoid : public AtomVec { struct Bonus *bonus; AtomVecEllipsoid(class LAMMPS *); - ~AtomVecEllipsoid(); + ~AtomVecEllipsoid() override; - void grow_pointers(); - void copy_bonus(int, int, int); - void clear_bonus(); - int pack_comm_bonus(int, int *, double *); - void unpack_comm_bonus(int, int, double *); - int pack_border_bonus(int, int *, double *); - int unpack_border_bonus(int, int, double *); - int pack_exchange_bonus(int, double *); - int unpack_exchange_bonus(int, double *); - int size_restart_bonus(); - int pack_restart_bonus(int, double *); - int unpack_restart_bonus(int, double *); - void data_atom_bonus(int, const std::vector &); - double memory_usage_bonus(); + void grow_pointers() override; + void copy_bonus(int, int, int) override; + void clear_bonus() override; + int pack_comm_bonus(int, int *, double *) override; + void unpack_comm_bonus(int, int, double *) override; + int pack_border_bonus(int, int *, double *) override; + int unpack_border_bonus(int, int, double *) override; + int pack_exchange_bonus(int, double *) override; + int unpack_exchange_bonus(int, double *) override; + int size_restart_bonus() override; + int pack_restart_bonus(int, double *) override; + int unpack_restart_bonus(int, double *) override; + void data_atom_bonus(int, const std::vector &) override; + double memory_usage_bonus() override; - void create_atom_post(int); - void data_atom_post(int); - void pack_data_pre(int); - void pack_data_post(int); + void create_atom_post(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; - int pack_data_bonus(double *, int); - void write_data_bonus(FILE *, int, double *, int); + int pack_data_bonus(double *, int) override; + void write_data_bonus(FILE *, int, double *, int) override; // unique to AtomVecEllipsoid diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index 949ae37319..8d1a791044 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -31,41 +31,41 @@ class AtomVecHybrid : public AtomVec { char **keywords; AtomVecHybrid(class LAMMPS *); - ~AtomVecHybrid(); - void process_args(int, char **); - void init(); + ~AtomVecHybrid() override; + void process_args(int, char **) override; + void init() override; - void grow_pointers(); - void force_clear(int, size_t); - void copy_bonus(int, int, int); - void clear_bonus(); - int pack_comm_bonus(int, int *, double *); - void unpack_comm_bonus(int, int, double *); - int pack_border_bonus(int, int *, double *); - int unpack_border_bonus(int, int, double *); - int pack_exchange_bonus(int, double *); - int unpack_exchange_bonus(int, double *); - int size_restart_bonus(); - int pack_restart_bonus(int, double *); - int unpack_restart_bonus(int, double *); - double memory_usage_bonus(); + void grow_pointers() override; + void force_clear(int, size_t) override; + void copy_bonus(int, int, int) override; + void clear_bonus() override; + int pack_comm_bonus(int, int *, double *) override; + void unpack_comm_bonus(int, int, double *) override; + int pack_border_bonus(int, int *, double *) override; + int unpack_border_bonus(int, int, double *) override; + int pack_exchange_bonus(int, double *) override; + int unpack_exchange_bonus(int, double *) override; + int size_restart_bonus() override; + int pack_restart_bonus(int, double *) override; + int unpack_restart_bonus(int, double *) override; + double memory_usage_bonus() override; - void pack_restart_pre(int); - void pack_restart_post(int); - void unpack_restart_init(int); - void create_atom_post(int); - void data_atom_post(int); + void pack_restart_pre(int) override; + void pack_restart_post(int) override; + void unpack_restart_init(int) override; + void create_atom_post(int) override; + void data_atom_post(int) override; - void data_bonds_post(int, int, tagint, tagint, tagint); + void data_bonds_post(int, int, tagint, tagint, tagint) override; - void pack_data_pre(int); - void pack_data_post(int); + void pack_data_pre(int) override; + void pack_data_post(int) override; - int pack_data_bonus(double *, int); - void write_data_bonus(FILE *, int, double *, int); + int pack_data_bonus(double *, int) override; + void write_data_bonus(FILE *, int, double *, int) override; - int property_atom(char *); - void pack_property_atom(int, double *, int, int); + int property_atom(char *) override; + void pack_property_atom(int, double *, int, int) override; private: int nallstyles; diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h index 5903349700..1af2f7ee2d 100644 --- a/src/atom_vec_line.h +++ b/src/atom_vec_line.h @@ -33,31 +33,31 @@ class AtomVecLine : public AtomVec { struct Bonus *bonus; AtomVecLine(class LAMMPS *); - ~AtomVecLine(); - void init(); + ~AtomVecLine() override; + void init() override; - void grow_pointers(); - void copy_bonus(int, int, int); - void clear_bonus(); - int pack_comm_bonus(int, int *, double *); - void unpack_comm_bonus(int, int, double *); - int pack_border_bonus(int, int *, double *); - int unpack_border_bonus(int, int, double *); - int pack_exchange_bonus(int, double *); - int unpack_exchange_bonus(int, double *); - int size_restart_bonus(); - int pack_restart_bonus(int, double *); - int unpack_restart_bonus(int, double *); - void data_atom_bonus(int, const std::vector &); - double memory_usage_bonus(); + void grow_pointers() override; + void copy_bonus(int, int, int) override; + void clear_bonus() override; + int pack_comm_bonus(int, int *, double *) override; + void unpack_comm_bonus(int, int, double *) override; + int pack_border_bonus(int, int *, double *) override; + int unpack_border_bonus(int, int, double *) override; + int pack_exchange_bonus(int, double *) override; + int unpack_exchange_bonus(int, double *) override; + int size_restart_bonus() override; + int pack_restart_bonus(int, double *) override; + int unpack_restart_bonus(int, double *) override; + void data_atom_bonus(int, const std::vector &) override; + double memory_usage_bonus() override; - void create_atom_post(int); - void data_atom_post(int); - void pack_data_pre(int); - void pack_data_post(int); + void create_atom_post(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; - int pack_data_bonus(double *, int); - void write_data_bonus(FILE *, int, double *, int); + int pack_data_bonus(double *, int) override; + void write_data_bonus(FILE *, int, double *, int) override; // unique to AtomVecLine diff --git a/src/atom_vec_sphere.h b/src/atom_vec_sphere.h index cf33bea364..2c3fdd84bc 100644 --- a/src/atom_vec_sphere.h +++ b/src/atom_vec_sphere.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AtomVecSphere : public AtomVec { public: AtomVecSphere(class LAMMPS *); - void process_args(int, char **); - void init(); + void process_args(int, char **) override; + void init() override; - void grow_pointers(); - void create_atom_post(int); - void data_atom_post(int); - void pack_data_pre(int); - void pack_data_post(int); + void grow_pointers() override; + void create_atom_post(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; private: double *radius, *rmass; diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h index f9f0bae386..76f0d29207 100644 --- a/src/atom_vec_tri.h +++ b/src/atom_vec_tri.h @@ -35,31 +35,31 @@ class AtomVecTri : public AtomVec { struct Bonus *bonus; AtomVecTri(class LAMMPS *); - ~AtomVecTri(); - void init(); + ~AtomVecTri() override; + void init() override; - void grow_pointers(); - void copy_bonus(int, int, int); - void clear_bonus(); - int pack_comm_bonus(int, int *, double *); - void unpack_comm_bonus(int, int, double *); - int pack_border_bonus(int, int *, double *); - int unpack_border_bonus(int, int, double *); - int pack_exchange_bonus(int, double *); - int unpack_exchange_bonus(int, double *); - int size_restart_bonus(); - int pack_restart_bonus(int, double *); - int unpack_restart_bonus(int, double *); - void data_atom_bonus(int, const std::vector &); - double memory_usage_bonus(); + void grow_pointers() override; + void copy_bonus(int, int, int) override; + void clear_bonus() override; + int pack_comm_bonus(int, int *, double *) override; + void unpack_comm_bonus(int, int, double *) override; + int pack_border_bonus(int, int *, double *) override; + int unpack_border_bonus(int, int, double *) override; + int pack_exchange_bonus(int, double *) override; + int unpack_exchange_bonus(int, double *) override; + int size_restart_bonus() override; + int pack_restart_bonus(int, double *) override; + int unpack_restart_bonus(int, double *) override; + void data_atom_bonus(int, const std::vector &) override; + double memory_usage_bonus() override; - void create_atom_post(int); - void data_atom_post(int); - void pack_data_pre(int); - void pack_data_post(int); + void create_atom_post(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; - int pack_data_bonus(double *, int); - void write_data_bonus(FILE *, int, double *, int); + int pack_data_bonus(double *, int) override; + void write_data_bonus(FILE *, int, double *, int) override; // unique to AtomVecTri diff --git a/src/molecule.h b/src/molecule.h index 14db9f3197..c1334f6488 100644 --- a/src/molecule.h +++ b/src/molecule.h @@ -119,7 +119,7 @@ class Molecule : protected Pointers { // e.g. FixPour or CreateAtoms Molecule(class LAMMPS *, int, char **, int &); - ~Molecule(); + ~Molecule() override; void compute_center(); void compute_mass(); void compute_com(); From 7ee3171d16360dd5055bb6c77babf0277a7b41bd Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 19 Jan 2022 19:26:27 -0500 Subject: [PATCH 049/174] Apply override to NPair classes --- src/DPD-REACT/npair_half_bin_newton_ssa.h | 4 ++-- src/INTEL/npair_full_bin_ghost_intel.h | 3 +-- src/INTEL/npair_full_bin_intel.h | 3 +-- src/INTEL/npair_half_bin_newton_intel.h | 3 +-- src/INTEL/npair_half_bin_newton_tri_intel.h | 3 +-- src/INTEL/npair_halffull_newton_intel.h | 3 +-- src/INTEL/npair_intel.h | 4 ++-- src/INTEL/npair_skip_intel.h | 6 +++--- src/KOKKOS/npair_copy_kokkos.h | 3 +-- src/KOKKOS/npair_halffull_kokkos.h | 3 +-- src/KOKKOS/npair_kokkos.h | 9 ++++----- src/KOKKOS/npair_skip_kokkos.h | 3 +-- src/KOKKOS/npair_ssa_kokkos.h | 9 ++++----- src/OPENMP/npair_full_bin_atomonly_omp.h | 3 +-- src/OPENMP/npair_full_bin_ghost_omp.h | 3 +-- src/OPENMP/npair_full_bin_omp.h | 3 +-- src/OPENMP/npair_full_multi_old_omp.h | 3 +-- src/OPENMP/npair_full_multi_omp.h | 3 +-- src/OPENMP/npair_full_nsq_ghost_omp.h | 3 +-- src/OPENMP/npair_full_nsq_omp.h | 3 +-- src/OPENMP/npair_half_bin_atomonly_newton_omp.h | 3 +-- src/OPENMP/npair_half_bin_newtoff_ghost_omp.h | 3 +-- src/OPENMP/npair_half_bin_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_bin_newton_omp.h | 3 +-- src/OPENMP/npair_half_bin_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_multi_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_multi_newton_omp.h | 3 +-- src/OPENMP/npair_half_multi_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_multi_old_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_multi_old_newton_omp.h | 3 +-- src/OPENMP/npair_half_multi_old_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_nsq_newtoff_ghost_omp.h | 3 +-- src/OPENMP/npair_half_nsq_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_nsq_newton_omp.h | 3 +-- src/OPENMP/npair_half_respa_bin_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_respa_bin_newton_omp.h | 3 +-- src/OPENMP/npair_half_respa_bin_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_respa_nsq_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_respa_nsq_newton_omp.h | 3 +-- src/OPENMP/npair_half_size_bin_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_size_bin_newton_omp.h | 3 +-- src/OPENMP/npair_half_size_bin_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_size_multi_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_size_multi_newton_omp.h | 3 +-- src/OPENMP/npair_half_size_multi_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_size_multi_old_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_size_multi_old_newton_omp.h | 3 +-- src/OPENMP/npair_half_size_multi_old_newton_tri_omp.h | 3 +-- src/OPENMP/npair_half_size_nsq_newtoff_omp.h | 3 +-- src/OPENMP/npair_half_size_nsq_newton_omp.h | 3 +-- src/OPENMP/npair_halffull_newtoff_omp.h | 3 +-- src/OPENMP/npair_halffull_newton_omp.h | 3 +-- src/npair.h | 2 +- src/npair_copy.h | 3 +-- src/npair_full_bin.h | 3 +-- src/npair_full_bin_atomonly.h | 3 +-- src/npair_full_bin_ghost.h | 3 +-- src/npair_full_multi.h | 3 +-- src/npair_full_multi_old.h | 3 +-- src/npair_full_nsq.h | 3 +-- src/npair_full_nsq_ghost.h | 3 +-- src/npair_half_bin_atomonly_newton.h | 3 +-- src/npair_half_bin_newtoff.h | 3 +-- src/npair_half_bin_newtoff_ghost.h | 3 +-- src/npair_half_bin_newton.h | 3 +-- src/npair_half_bin_newton_tri.h | 3 +-- src/npair_half_multi_newtoff.h | 3 +-- src/npair_half_multi_newton.h | 3 +-- src/npair_half_multi_newton_tri.h | 3 +-- src/npair_half_multi_old_newtoff.h | 3 +-- src/npair_half_multi_old_newton.h | 3 +-- src/npair_half_multi_old_newton_tri.h | 3 +-- src/npair_half_nsq_newtoff.h | 3 +-- src/npair_half_nsq_newtoff_ghost.h | 3 +-- src/npair_half_nsq_newton.h | 3 +-- src/npair_half_respa_bin_newtoff.h | 3 +-- src/npair_half_respa_bin_newton.h | 3 +-- src/npair_half_respa_bin_newton_tri.h | 3 +-- src/npair_half_respa_nsq_newtoff.h | 3 +-- src/npair_half_respa_nsq_newton.h | 3 +-- src/npair_half_size_bin_newtoff.h | 3 +-- src/npair_half_size_bin_newton.h | 3 +-- src/npair_half_size_bin_newton_tri.h | 3 +-- src/npair_half_size_multi_newtoff.h | 3 +-- src/npair_half_size_multi_newton.h | 3 +-- src/npair_half_size_multi_newton_tri.h | 3 +-- src/npair_half_size_multi_old_newtoff.h | 3 +-- src/npair_half_size_multi_old_newton.h | 3 +-- src/npair_half_size_multi_old_newton_tri.h | 3 +-- src/npair_half_size_nsq_newtoff.h | 3 +-- src/npair_half_size_nsq_newton.h | 3 +-- src/npair_halffull_newtoff.h | 3 +-- src/npair_halffull_newton.h | 3 +-- src/npair_skip.h | 3 +-- src/npair_skip_respa.h | 3 +-- src/npair_skip_size.h | 3 +-- src/npair_skip_size_off2on.h | 3 +-- src/npair_skip_size_off2on_oneside.h | 3 +-- 98 files changed, 108 insertions(+), 202 deletions(-) diff --git a/src/DPD-REACT/npair_half_bin_newton_ssa.h b/src/DPD-REACT/npair_half_bin_newton_ssa.h index 52f3bb5142..265087e7ed 100644 --- a/src/DPD-REACT/npair_half_bin_newton_ssa.h +++ b/src/DPD-REACT/npair_half_bin_newton_ssa.h @@ -41,8 +41,8 @@ class NPairHalfBinNewtonSSA : public NPair { int ssa_maxPhaseLen; NPairHalfBinNewtonSSA(class LAMMPS *); - ~NPairHalfBinNewtonSSA(); - void build(class NeighList *); + ~NPairHalfBinNewtonSSA() override; + void build(class NeighList *) override; private: int ssa_maxPhaseCt; diff --git a/src/INTEL/npair_full_bin_ghost_intel.h b/src/INTEL/npair_full_bin_ghost_intel.h index 3830b07e6d..a14ac18909 100644 --- a/src/INTEL/npair_full_bin_ghost_intel.h +++ b/src/INTEL/npair_full_bin_ghost_intel.h @@ -35,8 +35,7 @@ namespace LAMMPS_NS { class NPairFullBinGhostIntel : public NPairIntel { public: NPairFullBinGhostIntel(class LAMMPS *); - ~NPairFullBinGhostIntel() {} - void build(class NeighList *); + void build(class NeighList *) override; private: template diff --git a/src/INTEL/npair_full_bin_intel.h b/src/INTEL/npair_full_bin_intel.h index 720780898c..ce23b0d475 100644 --- a/src/INTEL/npair_full_bin_intel.h +++ b/src/INTEL/npair_full_bin_intel.h @@ -32,8 +32,7 @@ namespace LAMMPS_NS { class NPairFullBinIntel : public NPairIntel { public: NPairFullBinIntel(class LAMMPS *); - ~NPairFullBinIntel() {} - void build(class NeighList *); + void build(class NeighList *) override; private: template void fbi(NeighList *, IntelBuffers *); diff --git a/src/INTEL/npair_half_bin_newton_intel.h b/src/INTEL/npair_half_bin_newton_intel.h index 9c9dcab703..3830847954 100644 --- a/src/INTEL/npair_half_bin_newton_intel.h +++ b/src/INTEL/npair_half_bin_newton_intel.h @@ -31,8 +31,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtonIntel : public NPairIntel { public: NPairHalfBinNewtonIntel(class LAMMPS *); - ~NPairHalfBinNewtonIntel() {} - void build(class NeighList *); + void build(class NeighList *) override; private: template void hbni(NeighList *, IntelBuffers *); diff --git a/src/INTEL/npair_half_bin_newton_tri_intel.h b/src/INTEL/npair_half_bin_newton_tri_intel.h index 0d6f577b3d..e6e3c6ce16 100644 --- a/src/INTEL/npair_half_bin_newton_tri_intel.h +++ b/src/INTEL/npair_half_bin_newton_tri_intel.h @@ -31,8 +31,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtonTriIntel : public NPairIntel { public: NPairHalfBinNewtonTriIntel(class LAMMPS *); - ~NPairHalfBinNewtonTriIntel() {} - void build(class NeighList *); + void build(class NeighList *) override; private: template void hbnti(NeighList *, IntelBuffers *); diff --git a/src/INTEL/npair_halffull_newton_intel.h b/src/INTEL/npair_halffull_newton_intel.h index ea751c2421..7514adbe25 100644 --- a/src/INTEL/npair_halffull_newton_intel.h +++ b/src/INTEL/npair_halffull_newton_intel.h @@ -45,8 +45,7 @@ namespace LAMMPS_NS { class NPairHalffullNewtonIntel : public NPair { public: NPairHalffullNewtonIntel(class LAMMPS *); - ~NPairHalffullNewtonIntel() {} - void build(class NeighList *); + void build(class NeighList *) override; protected: FixIntel *_fix; diff --git a/src/INTEL/npair_intel.h b/src/INTEL/npair_intel.h index 8035f6f9be..a17733aed7 100644 --- a/src/INTEL/npair_intel.h +++ b/src/INTEL/npair_intel.h @@ -76,8 +76,8 @@ namespace LAMMPS_NS { class NPairIntel : public NPair { public: NPairIntel(class LAMMPS *); - ~NPairIntel(); - virtual void copy_neighbor_info(); + ~NPairIntel() override; + void copy_neighbor_info() override; #ifdef _LMP_INTEL_OFFLOAD void grow_stencil(); diff --git a/src/INTEL/npair_skip_intel.h b/src/INTEL/npair_skip_intel.h index 2c77b24cd5..b7ca847eee 100644 --- a/src/INTEL/npair_skip_intel.h +++ b/src/INTEL/npair_skip_intel.h @@ -43,9 +43,9 @@ namespace LAMMPS_NS { class NPairSkipIntel : public NPair { public: NPairSkipIntel(class LAMMPS *); - ~NPairSkipIntel(); - virtual void copy_neighbor_info(); - void build(class NeighList *); + ~NPairSkipIntel() override; + void copy_neighbor_info() override; + void build(class NeighList *) override; protected: FixIntel *_fix; diff --git a/src/KOKKOS/npair_copy_kokkos.h b/src/KOKKOS/npair_copy_kokkos.h index b272275650..af8e1962d8 100644 --- a/src/KOKKOS/npair_copy_kokkos.h +++ b/src/KOKKOS/npair_copy_kokkos.h @@ -35,8 +35,7 @@ template class NPairCopyKokkos : public NPair { public: NPairCopyKokkos(class LAMMPS *); - ~NPairCopyKokkos() {} - void build(class NeighList *); + void build(class NeighList *) override; private: void copy_to_kokkos(class NeighList *); void copy_to_cpu(class NeighList *); diff --git a/src/KOKKOS/npair_halffull_kokkos.h b/src/KOKKOS/npair_halffull_kokkos.h index f6b1fbf08e..2bd3daf365 100644 --- a/src/KOKKOS/npair_halffull_kokkos.h +++ b/src/KOKKOS/npair_halffull_kokkos.h @@ -139,8 +139,7 @@ class NPairHalffullKokkos : public NPair { typedef ArrayTypes AT; NPairHalffullKokkos(class LAMMPS *); - ~NPairHalffullKokkos() {} - void build(class NeighList *); + void build(class NeighList *) override; KOKKOS_INLINE_FUNCTION void operator()(TagNPairHalffullCompute, const int&) const; diff --git a/src/KOKKOS/npair_kokkos.h b/src/KOKKOS/npair_kokkos.h index 339d7e425d..e78a0f6a85 100644 --- a/src/KOKKOS/npair_kokkos.h +++ b/src/KOKKOS/npair_kokkos.h @@ -100,11 +100,10 @@ class NPairKokkos : public NPair { public: NPairKokkos(class LAMMPS *); - ~NPairKokkos() {} - void copy_neighbor_info(); - void copy_bin_info(); - void copy_stencil_info(); - void build(class NeighList *); + void copy_neighbor_info() override; + void copy_bin_info() override; + void copy_stencil_info() override; + void build(class NeighList *) override; private: int newton_pair; diff --git a/src/KOKKOS/npair_skip_kokkos.h b/src/KOKKOS/npair_skip_kokkos.h index 2024a1e214..695641a8d6 100644 --- a/src/KOKKOS/npair_skip_kokkos.h +++ b/src/KOKKOS/npair_skip_kokkos.h @@ -63,8 +63,7 @@ class NPairSkipKokkos : public NPair { typedef ArrayTypes AT; NPairSkipKokkos(class LAMMPS *); - ~NPairSkipKokkos() {} - void build(class NeighList *); + void build(class NeighList *) override; KOKKOS_INLINE_FUNCTION void operator()(TagNPairSkipCompute, const int&, int&, const bool&) const; diff --git a/src/KOKKOS/npair_ssa_kokkos.h b/src/KOKKOS/npair_ssa_kokkos.h index ed99f54e1e..4b17ae881a 100644 --- a/src/KOKKOS/npair_ssa_kokkos.h +++ b/src/KOKKOS/npair_ssa_kokkos.h @@ -59,11 +59,10 @@ class NPairSSAKokkos : public NPair { typename AT::t_int_2d ssa_gitemLen; NPairSSAKokkos(class LAMMPS *); - ~NPairSSAKokkos() {} - void copy_neighbor_info(); - void copy_bin_info(); - void copy_stencil_info(); - void build(class NeighList *); + void copy_neighbor_info() override; + void copy_bin_info() override; + void copy_stencil_info() override; + void build(class NeighList *) override; private: // data from Neighbor class diff --git a/src/OPENMP/npair_full_bin_atomonly_omp.h b/src/OPENMP/npair_full_bin_atomonly_omp.h index 2cdc5d086d..0b17edd6ec 100644 --- a/src/OPENMP/npair_full_bin_atomonly_omp.h +++ b/src/OPENMP/npair_full_bin_atomonly_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullBinAtomonlyOmp : public NPair { public: NPairFullBinAtomonlyOmp(class LAMMPS *); - ~NPairFullBinAtomonlyOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_full_bin_ghost_omp.h b/src/OPENMP/npair_full_bin_ghost_omp.h index 0483cf7575..e53b4f6a8e 100644 --- a/src/OPENMP/npair_full_bin_ghost_omp.h +++ b/src/OPENMP/npair_full_bin_ghost_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullBinGhostOmp : public NPair { public: NPairFullBinGhostOmp(class LAMMPS *); - ~NPairFullBinGhostOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_full_bin_omp.h b/src/OPENMP/npair_full_bin_omp.h index f701556950..1ce8a70e13 100644 --- a/src/OPENMP/npair_full_bin_omp.h +++ b/src/OPENMP/npair_full_bin_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullBinOmp : public NPair { public: NPairFullBinOmp(class LAMMPS *); - ~NPairFullBinOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_full_multi_old_omp.h b/src/OPENMP/npair_full_multi_old_omp.h index 0b28db12d6..e8430623e1 100644 --- a/src/OPENMP/npair_full_multi_old_omp.h +++ b/src/OPENMP/npair_full_multi_old_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullMultiOldOmp : public NPair { public: NPairFullMultiOldOmp(class LAMMPS *); - ~NPairFullMultiOldOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_full_multi_omp.h b/src/OPENMP/npair_full_multi_omp.h index 8ee3cadbc8..9d0067703f 100644 --- a/src/OPENMP/npair_full_multi_omp.h +++ b/src/OPENMP/npair_full_multi_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullMultiOmp : public NPair { public: NPairFullMultiOmp(class LAMMPS *); - ~NPairFullMultiOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_full_nsq_ghost_omp.h b/src/OPENMP/npair_full_nsq_ghost_omp.h index b34d1fb74d..c19f7c5a0a 100644 --- a/src/OPENMP/npair_full_nsq_ghost_omp.h +++ b/src/OPENMP/npair_full_nsq_ghost_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullNsqGhostOmp : public NPair { public: NPairFullNsqGhostOmp(class LAMMPS *); - ~NPairFullNsqGhostOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_full_nsq_omp.h b/src/OPENMP/npair_full_nsq_omp.h index e16f830e97..bb0849e8a6 100644 --- a/src/OPENMP/npair_full_nsq_omp.h +++ b/src/OPENMP/npair_full_nsq_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullNsqOmp : public NPair { public: NPairFullNsqOmp(class LAMMPS *); - ~NPairFullNsqOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_bin_atomonly_newton_omp.h b/src/OPENMP/npair_half_bin_atomonly_newton_omp.h index 9ebf5c6f65..42d92b6e16 100644 --- a/src/OPENMP/npair_half_bin_atomonly_newton_omp.h +++ b/src/OPENMP/npair_half_bin_atomonly_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinAtomonlyNewtonOmp : public NPair { public: NPairHalfBinAtomonlyNewtonOmp(class LAMMPS *); - ~NPairHalfBinAtomonlyNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_bin_newtoff_ghost_omp.h b/src/OPENMP/npair_half_bin_newtoff_ghost_omp.h index 2c94ff83f3..319fac9b35 100644 --- a/src/OPENMP/npair_half_bin_newtoff_ghost_omp.h +++ b/src/OPENMP/npair_half_bin_newtoff_ghost_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtoffGhostOmp : public NPair { public: NPairHalfBinNewtoffGhostOmp(class LAMMPS *); - ~NPairHalfBinNewtoffGhostOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_bin_newtoff_omp.h b/src/OPENMP/npair_half_bin_newtoff_omp.h index 849766e803..83dd355b2a 100644 --- a/src/OPENMP/npair_half_bin_newtoff_omp.h +++ b/src/OPENMP/npair_half_bin_newtoff_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtoffOmp : public NPair { public: NPairHalfBinNewtoffOmp(class LAMMPS *); - ~NPairHalfBinNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_bin_newton_omp.h b/src/OPENMP/npair_half_bin_newton_omp.h index ddbb46b57e..f80df43b22 100644 --- a/src/OPENMP/npair_half_bin_newton_omp.h +++ b/src/OPENMP/npair_half_bin_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtonOmp : public NPair { public: NPairHalfBinNewtonOmp(class LAMMPS *); - ~NPairHalfBinNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_bin_newton_tri_omp.h b/src/OPENMP/npair_half_bin_newton_tri_omp.h index 0506b1a561..6b40d6b95f 100644 --- a/src/OPENMP/npair_half_bin_newton_tri_omp.h +++ b/src/OPENMP/npair_half_bin_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtonTriOmp : public NPair { public: NPairHalfBinNewtonTriOmp(class LAMMPS *); - ~NPairHalfBinNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_multi_newtoff_omp.h b/src/OPENMP/npair_half_multi_newtoff_omp.h index 1be3c8d0e7..c166c34ce0 100644 --- a/src/OPENMP/npair_half_multi_newtoff_omp.h +++ b/src/OPENMP/npair_half_multi_newtoff_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiNewtoffOmp : public NPair { public: NPairHalfMultiNewtoffOmp(class LAMMPS *); - ~NPairHalfMultiNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_multi_newton_omp.h b/src/OPENMP/npair_half_multi_newton_omp.h index a665f788dc..c1684bb282 100644 --- a/src/OPENMP/npair_half_multi_newton_omp.h +++ b/src/OPENMP/npair_half_multi_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiNewtonOmp : public NPair { public: NPairHalfMultiNewtonOmp(class LAMMPS *); - ~NPairHalfMultiNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_multi_newton_tri_omp.h b/src/OPENMP/npair_half_multi_newton_tri_omp.h index a4cb2245b0..44aed7a09c 100644 --- a/src/OPENMP/npair_half_multi_newton_tri_omp.h +++ b/src/OPENMP/npair_half_multi_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiNewtonTriOmp : public NPair { public: NPairHalfMultiNewtonTriOmp(class LAMMPS *); - ~NPairHalfMultiNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_multi_old_newtoff_omp.h b/src/OPENMP/npair_half_multi_old_newtoff_omp.h index 1ad1f2c91c..7964e53a88 100644 --- a/src/OPENMP/npair_half_multi_old_newtoff_omp.h +++ b/src/OPENMP/npair_half_multi_old_newtoff_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiOldNewtoffOmp : public NPair { public: NPairHalfMultiOldNewtoffOmp(class LAMMPS *); - ~NPairHalfMultiOldNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_multi_old_newton_omp.h b/src/OPENMP/npair_half_multi_old_newton_omp.h index 66e67ec818..3486712933 100644 --- a/src/OPENMP/npair_half_multi_old_newton_omp.h +++ b/src/OPENMP/npair_half_multi_old_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiOldNewtonOmp : public NPair { public: NPairHalfMultiOldNewtonOmp(class LAMMPS *); - ~NPairHalfMultiOldNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_multi_old_newton_tri_omp.h b/src/OPENMP/npair_half_multi_old_newton_tri_omp.h index 2147a88ee6..007c936c33 100644 --- a/src/OPENMP/npair_half_multi_old_newton_tri_omp.h +++ b/src/OPENMP/npair_half_multi_old_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiOldNewtonTriOmp : public NPair { public: NPairHalfMultiOldNewtonTriOmp(class LAMMPS *); - ~NPairHalfMultiOldNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.h b/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.h index 84e066b618..f3ee492dec 100644 --- a/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.h +++ b/src/OPENMP/npair_half_nsq_newtoff_ghost_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfNsqNewtoffGhostOmp : public NPair { public: NPairHalfNsqNewtoffGhostOmp(class LAMMPS *); - ~NPairHalfNsqNewtoffGhostOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_nsq_newtoff_omp.h b/src/OPENMP/npair_half_nsq_newtoff_omp.h index 68ed500e9f..80b56188f2 100644 --- a/src/OPENMP/npair_half_nsq_newtoff_omp.h +++ b/src/OPENMP/npair_half_nsq_newtoff_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfNsqNewtoffOmp : public NPair { public: NPairHalfNsqNewtoffOmp(class LAMMPS *); - ~NPairHalfNsqNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_nsq_newton_omp.h b/src/OPENMP/npair_half_nsq_newton_omp.h index 94575915d2..5905af9b26 100644 --- a/src/OPENMP/npair_half_nsq_newton_omp.h +++ b/src/OPENMP/npair_half_nsq_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfNsqNewtonOmp : public NPair { public: NPairHalfNsqNewtonOmp(class LAMMPS *); - ~NPairHalfNsqNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_respa_bin_newtoff_omp.h b/src/OPENMP/npair_half_respa_bin_newtoff_omp.h index 1d2a7f31e5..c9fae76f58 100644 --- a/src/OPENMP/npair_half_respa_bin_newtoff_omp.h +++ b/src/OPENMP/npair_half_respa_bin_newtoff_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfRespaBinNewtoffOmp : public NPair { public: NPairHalfRespaBinNewtoffOmp(class LAMMPS *); - ~NPairHalfRespaBinNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_respa_bin_newton_omp.h b/src/OPENMP/npair_half_respa_bin_newton_omp.h index f6e30722f0..56c6b3bf1e 100644 --- a/src/OPENMP/npair_half_respa_bin_newton_omp.h +++ b/src/OPENMP/npair_half_respa_bin_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaBinNewtonOmp : public NPair { public: NPairHalfRespaBinNewtonOmp(class LAMMPS *); - ~NPairHalfRespaBinNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_respa_bin_newton_tri_omp.h b/src/OPENMP/npair_half_respa_bin_newton_tri_omp.h index f1a4d16b21..e43a9ecddc 100644 --- a/src/OPENMP/npair_half_respa_bin_newton_tri_omp.h +++ b/src/OPENMP/npair_half_respa_bin_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaBinNewtonTriOmp : public NPair { public: NPairHalfRespaBinNewtonTriOmp(class LAMMPS *); - ~NPairHalfRespaBinNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_respa_nsq_newtoff_omp.h b/src/OPENMP/npair_half_respa_nsq_newtoff_omp.h index 7c9a3cc8d2..4d1b524b7c 100644 --- a/src/OPENMP/npair_half_respa_nsq_newtoff_omp.h +++ b/src/OPENMP/npair_half_respa_nsq_newtoff_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfRespaNsqNewtoffOmp : public NPair { public: NPairHalfRespaNsqNewtoffOmp(class LAMMPS *); - ~NPairHalfRespaNsqNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_respa_nsq_newton_omp.h b/src/OPENMP/npair_half_respa_nsq_newton_omp.h index 7adda81885..b9a879c134 100644 --- a/src/OPENMP/npair_half_respa_nsq_newton_omp.h +++ b/src/OPENMP/npair_half_respa_nsq_newton_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfRespaNsqNewtonOmp : public NPair { public: NPairHalfRespaNsqNewtonOmp(class LAMMPS *); - ~NPairHalfRespaNsqNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_bin_newtoff_omp.h b/src/OPENMP/npair_half_size_bin_newtoff_omp.h index 728a435ffe..ac226a798a 100644 --- a/src/OPENMP/npair_half_size_bin_newtoff_omp.h +++ b/src/OPENMP/npair_half_size_bin_newtoff_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfSizeBinNewtoffOmp : public NPair { public: NPairHalfSizeBinNewtoffOmp(class LAMMPS *); - ~NPairHalfSizeBinNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_bin_newton_omp.h b/src/OPENMP/npair_half_size_bin_newton_omp.h index 0902f0f417..03143e3353 100644 --- a/src/OPENMP/npair_half_size_bin_newton_omp.h +++ b/src/OPENMP/npair_half_size_bin_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeBinNewtonOmp : public NPair { public: NPairHalfSizeBinNewtonOmp(class LAMMPS *); - ~NPairHalfSizeBinNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_bin_newton_tri_omp.h b/src/OPENMP/npair_half_size_bin_newton_tri_omp.h index 4b1ca9e71b..4924f4d157 100644 --- a/src/OPENMP/npair_half_size_bin_newton_tri_omp.h +++ b/src/OPENMP/npair_half_size_bin_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeBinNewtonTriOmp : public NPair { public: NPairHalfSizeBinNewtonTriOmp(class LAMMPS *); - ~NPairHalfSizeBinNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_multi_newtoff_omp.h b/src/OPENMP/npair_half_size_multi_newtoff_omp.h index 5865a977ed..29e5945454 100644 --- a/src/OPENMP/npair_half_size_multi_newtoff_omp.h +++ b/src/OPENMP/npair_half_size_multi_newtoff_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiNewtoffOmp : public NPair { public: NPairHalfSizeMultiNewtoffOmp(class LAMMPS *); - ~NPairHalfSizeMultiNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_multi_newton_omp.h b/src/OPENMP/npair_half_size_multi_newton_omp.h index 3f9e76adbf..e3200d094e 100644 --- a/src/OPENMP/npair_half_size_multi_newton_omp.h +++ b/src/OPENMP/npair_half_size_multi_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiNewtonOmp : public NPair { public: NPairHalfSizeMultiNewtonOmp(class LAMMPS *); - ~NPairHalfSizeMultiNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_multi_newton_tri_omp.h b/src/OPENMP/npair_half_size_multi_newton_tri_omp.h index fa0b2ead6c..8eee91e055 100644 --- a/src/OPENMP/npair_half_size_multi_newton_tri_omp.h +++ b/src/OPENMP/npair_half_size_multi_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiNewtonTriOmp : public NPair { public: NPairHalfSizeMultiNewtonTriOmp(class LAMMPS *); - ~NPairHalfSizeMultiNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_multi_old_newtoff_omp.h b/src/OPENMP/npair_half_size_multi_old_newtoff_omp.h index fa61e86b92..2ace70c519 100644 --- a/src/OPENMP/npair_half_size_multi_old_newtoff_omp.h +++ b/src/OPENMP/npair_half_size_multi_old_newtoff_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiOldNewtoffOmp : public NPair { public: NPairHalfSizeMultiOldNewtoffOmp(class LAMMPS *); - ~NPairHalfSizeMultiOldNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_multi_old_newton_omp.h b/src/OPENMP/npair_half_size_multi_old_newton_omp.h index c406e3524e..b6df50980c 100644 --- a/src/OPENMP/npair_half_size_multi_old_newton_omp.h +++ b/src/OPENMP/npair_half_size_multi_old_newton_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiOldNewtonOmp : public NPair { public: NPairHalfSizeMultiOldNewtonOmp(class LAMMPS *); - ~NPairHalfSizeMultiOldNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.h b/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.h index 37156c7a43..e9635de08a 100644 --- a/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.h +++ b/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiOldNewtonTriOmp : public NPair { public: NPairHalfSizeMultiOldNewtonTriOmp(class LAMMPS *); - ~NPairHalfSizeMultiOldNewtonTriOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_nsq_newtoff_omp.h b/src/OPENMP/npair_half_size_nsq_newtoff_omp.h index 2d3c21aa73..bc6f2ebf8c 100644 --- a/src/OPENMP/npair_half_size_nsq_newtoff_omp.h +++ b/src/OPENMP/npair_half_size_nsq_newtoff_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfSizeNsqNewtoffOmp : public NPair { public: NPairHalfSizeNsqNewtoffOmp(class LAMMPS *); - ~NPairHalfSizeNsqNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_half_size_nsq_newton_omp.h b/src/OPENMP/npair_half_size_nsq_newton_omp.h index bb7eb3e071..19b16afc30 100644 --- a/src/OPENMP/npair_half_size_nsq_newton_omp.h +++ b/src/OPENMP/npair_half_size_nsq_newton_omp.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairHalfSizeNsqNewtonOmp : public NPair { public: NPairHalfSizeNsqNewtonOmp(class LAMMPS *); - ~NPairHalfSizeNsqNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_halffull_newtoff_omp.h b/src/OPENMP/npair_halffull_newtoff_omp.h index 8cd7b64004..272fb8f570 100644 --- a/src/OPENMP/npair_halffull_newtoff_omp.h +++ b/src/OPENMP/npair_halffull_newtoff_omp.h @@ -35,8 +35,7 @@ namespace LAMMPS_NS { class NPairHalffullNewtoffOmp : public NPair { public: NPairHalffullNewtoffOmp(class LAMMPS *); - ~NPairHalffullNewtoffOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/npair_halffull_newton_omp.h b/src/OPENMP/npair_halffull_newton_omp.h index 78ca839a43..bd54ec03fe 100644 --- a/src/OPENMP/npair_halffull_newton_omp.h +++ b/src/OPENMP/npair_halffull_newton_omp.h @@ -35,8 +35,7 @@ namespace LAMMPS_NS { class NPairHalffullNewtonOmp : public NPair { public: NPairHalffullNewtonOmp(class LAMMPS *); - ~NPairHalffullNewtonOmp() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair.h b/src/npair.h index 35e08786ef..bd14dc3b24 100644 --- a/src/npair.h +++ b/src/npair.h @@ -28,7 +28,7 @@ class NPair : protected Pointers { double cutoff_custom; // cutoff set by requestor NPair(class LAMMPS *); - virtual ~NPair(); + ~NPair() override; void post_constructor(class NeighRequest *); virtual void copy_neighbor_info(); void build_setup(); diff --git a/src/npair_copy.h b/src/npair_copy.h index d21b6610bd..36b80f83d9 100644 --- a/src/npair_copy.h +++ b/src/npair_copy.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairCopy : public NPair { public: NPairCopy(class LAMMPS *); - ~NPairCopy() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_bin.h b/src/npair_full_bin.h index 7bc1c11fa9..4d40763271 100644 --- a/src/npair_full_bin.h +++ b/src/npair_full_bin.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullBin : public NPair { public: NPairFullBin(class LAMMPS *); - ~NPairFullBin() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_bin_atomonly.h b/src/npair_full_bin_atomonly.h index a348f4f734..8e3f96e59b 100644 --- a/src/npair_full_bin_atomonly.h +++ b/src/npair_full_bin_atomonly.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullBinAtomonly : public NPair { public: NPairFullBinAtomonly(class LAMMPS *); - ~NPairFullBinAtomonly() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_bin_ghost.h b/src/npair_full_bin_ghost.h index 215ee75703..4b7e08a0e1 100644 --- a/src/npair_full_bin_ghost.h +++ b/src/npair_full_bin_ghost.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullBinGhost : public NPair { public: NPairFullBinGhost(class LAMMPS *); - ~NPairFullBinGhost() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_multi.h b/src/npair_full_multi.h index 4a1aa09fa1..dcd1b5d8a9 100644 --- a/src/npair_full_multi.h +++ b/src/npair_full_multi.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairFullMulti : public NPair { public: NPairFullMulti(class LAMMPS *); - ~NPairFullMulti() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_multi_old.h b/src/npair_full_multi_old.h index cd94eb9c9f..0dd825fcce 100644 --- a/src/npair_full_multi_old.h +++ b/src/npair_full_multi_old.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairFullMultiOld : public NPair { public: NPairFullMultiOld(class LAMMPS *); - ~NPairFullMultiOld() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_nsq.h b/src/npair_full_nsq.h index a3fdc498f1..0e65fcd027 100644 --- a/src/npair_full_nsq.h +++ b/src/npair_full_nsq.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairFullNsq : public NPair { public: NPairFullNsq(class LAMMPS *); - ~NPairFullNsq() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_full_nsq_ghost.h b/src/npair_full_nsq_ghost.h index 5b5e86fe9f..6ae517ccf7 100644 --- a/src/npair_full_nsq_ghost.h +++ b/src/npair_full_nsq_ghost.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairFullNsqGhost : public NPair { public: NPairFullNsqGhost(class LAMMPS *); - ~NPairFullNsqGhost() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_bin_atomonly_newton.h b/src/npair_half_bin_atomonly_newton.h index 68c51ebcdb..7a3eaf34bc 100644 --- a/src/npair_half_bin_atomonly_newton.h +++ b/src/npair_half_bin_atomonly_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinAtomonlyNewton : public NPair { public: NPairHalfBinAtomonlyNewton(class LAMMPS *); - ~NPairHalfBinAtomonlyNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_bin_newtoff.h b/src/npair_half_bin_newtoff.h index fd1b9d6cdf..db240f8bd9 100644 --- a/src/npair_half_bin_newtoff.h +++ b/src/npair_half_bin_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtoff : public NPair { public: NPairHalfBinNewtoff(class LAMMPS *); - ~NPairHalfBinNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_bin_newtoff_ghost.h b/src/npair_half_bin_newtoff_ghost.h index 1abc3e0c0a..b11e0f4802 100644 --- a/src/npair_half_bin_newtoff_ghost.h +++ b/src/npair_half_bin_newtoff_ghost.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtoffGhost : public NPair { public: NPairHalfBinNewtoffGhost(class LAMMPS *); - ~NPairHalfBinNewtoffGhost() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_bin_newton.h b/src/npair_half_bin_newton.h index 7849aa741f..19f7b93ae4 100644 --- a/src/npair_half_bin_newton.h +++ b/src/npair_half_bin_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewton : public NPair { public: NPairHalfBinNewton(class LAMMPS *); - ~NPairHalfBinNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_bin_newton_tri.h b/src/npair_half_bin_newton_tri.h index d90cf41023..ad270ae173 100644 --- a/src/npair_half_bin_newton_tri.h +++ b/src/npair_half_bin_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfBinNewtonTri : public NPair { public: NPairHalfBinNewtonTri(class LAMMPS *); - ~NPairHalfBinNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_multi_newtoff.h b/src/npair_half_multi_newtoff.h index 4837108667..3142587da6 100644 --- a/src/npair_half_multi_newtoff.h +++ b/src/npair_half_multi_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiNewtoff : public NPair { public: NPairHalfMultiNewtoff(class LAMMPS *); - ~NPairHalfMultiNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_multi_newton.h b/src/npair_half_multi_newton.h index 15cf6ee9c8..55439eacca 100644 --- a/src/npair_half_multi_newton.h +++ b/src/npair_half_multi_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiNewton : public NPair { public: NPairHalfMultiNewton(class LAMMPS *); - ~NPairHalfMultiNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_multi_newton_tri.h b/src/npair_half_multi_newton_tri.h index 4c4f920718..2b6d69f332 100644 --- a/src/npair_half_multi_newton_tri.h +++ b/src/npair_half_multi_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiNewtonTri : public NPair { public: NPairHalfMultiNewtonTri(class LAMMPS *); - ~NPairHalfMultiNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_multi_old_newtoff.h b/src/npair_half_multi_old_newtoff.h index 97d6a7ea69..9418cf5a4c 100644 --- a/src/npair_half_multi_old_newtoff.h +++ b/src/npair_half_multi_old_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiOldNewtoff : public NPair { public: NPairHalfMultiOldNewtoff(class LAMMPS *); - ~NPairHalfMultiOldNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_multi_old_newton.h b/src/npair_half_multi_old_newton.h index c689aea70b..5c84b8ef98 100644 --- a/src/npair_half_multi_old_newton.h +++ b/src/npair_half_multi_old_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiOldNewton : public NPair { public: NPairHalfMultiOldNewton(class LAMMPS *); - ~NPairHalfMultiOldNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_multi_old_newton_tri.h b/src/npair_half_multi_old_newton_tri.h index 6fc2c49f11..016746cf12 100644 --- a/src/npair_half_multi_old_newton_tri.h +++ b/src/npair_half_multi_old_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfMultiOldNewtonTri : public NPair { public: NPairHalfMultiOldNewtonTri(class LAMMPS *); - ~NPairHalfMultiOldNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_nsq_newtoff.h b/src/npair_half_nsq_newtoff.h index 26a50c2f11..45bef5b0b0 100644 --- a/src/npair_half_nsq_newtoff.h +++ b/src/npair_half_nsq_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfNsqNewtoff : public NPair { public: NPairHalfNsqNewtoff(class LAMMPS *); - ~NPairHalfNsqNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_nsq_newtoff_ghost.h b/src/npair_half_nsq_newtoff_ghost.h index 034b452540..5d6cb69450 100644 --- a/src/npair_half_nsq_newtoff_ghost.h +++ b/src/npair_half_nsq_newtoff_ghost.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfNsqNewtoffGhost : public NPair { public: NPairHalfNsqNewtoffGhost(class LAMMPS *); - ~NPairHalfNsqNewtoffGhost() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_nsq_newton.h b/src/npair_half_nsq_newton.h index 11170cec18..6b7ec89b82 100644 --- a/src/npair_half_nsq_newton.h +++ b/src/npair_half_nsq_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfNsqNewton : public NPair { public: NPairHalfNsqNewton(class LAMMPS *); - ~NPairHalfNsqNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_respa_bin_newtoff.h b/src/npair_half_respa_bin_newtoff.h index 7c8f592645..2782ae239e 100644 --- a/src/npair_half_respa_bin_newtoff.h +++ b/src/npair_half_respa_bin_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaBinNewtoff : public NPair { public: NPairHalfRespaBinNewtoff(class LAMMPS *); - ~NPairHalfRespaBinNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_respa_bin_newton.h b/src/npair_half_respa_bin_newton.h index 5483e946a1..c83ca89891 100644 --- a/src/npair_half_respa_bin_newton.h +++ b/src/npair_half_respa_bin_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaBinNewton : public NPair { public: NPairHalfRespaBinNewton(class LAMMPS *); - ~NPairHalfRespaBinNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_respa_bin_newton_tri.h b/src/npair_half_respa_bin_newton_tri.h index a45e89dff1..a5b573103c 100644 --- a/src/npair_half_respa_bin_newton_tri.h +++ b/src/npair_half_respa_bin_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaBinNewtonTri : public NPair { public: NPairHalfRespaBinNewtonTri(class LAMMPS *); - ~NPairHalfRespaBinNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_respa_nsq_newtoff.h b/src/npair_half_respa_nsq_newtoff.h index 5bdd0f0abe..d13fb810da 100644 --- a/src/npair_half_respa_nsq_newtoff.h +++ b/src/npair_half_respa_nsq_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaNsqNewtoff : public NPair { public: NPairHalfRespaNsqNewtoff(class LAMMPS *); - ~NPairHalfRespaNsqNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_respa_nsq_newton.h b/src/npair_half_respa_nsq_newton.h index bfa27fbfef..9050ca0fde 100644 --- a/src/npair_half_respa_nsq_newton.h +++ b/src/npair_half_respa_nsq_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfRespaNsqNewton : public NPair { public: NPairHalfRespaNsqNewton(class LAMMPS *); - ~NPairHalfRespaNsqNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_bin_newtoff.h b/src/npair_half_size_bin_newtoff.h index 6f2cb2424c..f1f9b2a34b 100644 --- a/src/npair_half_size_bin_newtoff.h +++ b/src/npair_half_size_bin_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeBinNewtoff : public NPair { public: NPairHalfSizeBinNewtoff(class LAMMPS *); - ~NPairHalfSizeBinNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_bin_newton.h b/src/npair_half_size_bin_newton.h index 8023361a29..a592969c46 100644 --- a/src/npair_half_size_bin_newton.h +++ b/src/npair_half_size_bin_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeBinNewton : public NPair { public: NPairHalfSizeBinNewton(class LAMMPS *); - ~NPairHalfSizeBinNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_bin_newton_tri.h b/src/npair_half_size_bin_newton_tri.h index 86ce3a2b7d..50861d560e 100644 --- a/src/npair_half_size_bin_newton_tri.h +++ b/src/npair_half_size_bin_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeBinNewtonTri : public NPair { public: NPairHalfSizeBinNewtonTri(class LAMMPS *); - ~NPairHalfSizeBinNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_multi_newtoff.h b/src/npair_half_size_multi_newtoff.h index ccb395b24b..b33634e5be 100644 --- a/src/npair_half_size_multi_newtoff.h +++ b/src/npair_half_size_multi_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiNewtoff : public NPair { public: NPairHalfSizeMultiNewtoff(class LAMMPS *); - ~NPairHalfSizeMultiNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_multi_newton.h b/src/npair_half_size_multi_newton.h index 4584dd9f62..32139136e6 100644 --- a/src/npair_half_size_multi_newton.h +++ b/src/npair_half_size_multi_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiNewton : public NPair { public: NPairHalfSizeMultiNewton(class LAMMPS *); - ~NPairHalfSizeMultiNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_multi_newton_tri.h b/src/npair_half_size_multi_newton_tri.h index 789c4c3dac..10e7a90d16 100644 --- a/src/npair_half_size_multi_newton_tri.h +++ b/src/npair_half_size_multi_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiNewtonTri : public NPair { public: NPairHalfSizeMultiNewtonTri(class LAMMPS *); - ~NPairHalfSizeMultiNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_multi_old_newtoff.h b/src/npair_half_size_multi_old_newtoff.h index 743ef3225d..c2ca814129 100644 --- a/src/npair_half_size_multi_old_newtoff.h +++ b/src/npair_half_size_multi_old_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiOldNewtoff : public NPair { public: NPairHalfSizeMultiOldNewtoff(class LAMMPS *); - ~NPairHalfSizeMultiOldNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_multi_old_newton.h b/src/npair_half_size_multi_old_newton.h index 749275814e..2322b5bc42 100644 --- a/src/npair_half_size_multi_old_newton.h +++ b/src/npair_half_size_multi_old_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiOldNewton : public NPair { public: NPairHalfSizeMultiOldNewton(class LAMMPS *); - ~NPairHalfSizeMultiOldNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_multi_old_newton_tri.h b/src/npair_half_size_multi_old_newton_tri.h index e4099e655f..1658abc717 100644 --- a/src/npair_half_size_multi_old_newton_tri.h +++ b/src/npair_half_size_multi_old_newton_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeMultiOldNewtonTri : public NPair { public: NPairHalfSizeMultiOldNewtonTri(class LAMMPS *); - ~NPairHalfSizeMultiOldNewtonTri() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_nsq_newtoff.h b/src/npair_half_size_nsq_newtoff.h index dbfdadd5a8..b263a907ed 100644 --- a/src/npair_half_size_nsq_newtoff.h +++ b/src/npair_half_size_nsq_newtoff.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeNsqNewtoff : public NPair { public: NPairHalfSizeNsqNewtoff(class LAMMPS *); - ~NPairHalfSizeNsqNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_half_size_nsq_newton.h b/src/npair_half_size_nsq_newton.h index f3e6e7cdf8..17735ccc45 100644 --- a/src/npair_half_size_nsq_newton.h +++ b/src/npair_half_size_nsq_newton.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NPairHalfSizeNsqNewton : public NPair { public: NPairHalfSizeNsqNewton(class LAMMPS *); - ~NPairHalfSizeNsqNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_halffull_newtoff.h b/src/npair_halffull_newtoff.h index 7662ee42fc..0a00267449 100644 --- a/src/npair_halffull_newtoff.h +++ b/src/npair_halffull_newtoff.h @@ -45,8 +45,7 @@ namespace LAMMPS_NS { class NPairHalffullNewtoff : public NPair { public: NPairHalffullNewtoff(class LAMMPS *); - ~NPairHalffullNewtoff() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_halffull_newton.h b/src/npair_halffull_newton.h index 0dfe220972..95cc09ec0b 100644 --- a/src/npair_halffull_newton.h +++ b/src/npair_halffull_newton.h @@ -35,8 +35,7 @@ namespace LAMMPS_NS { class NPairHalffullNewton : public NPair { public: NPairHalffullNewton(class LAMMPS *); - ~NPairHalffullNewton() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_skip.h b/src/npair_skip.h index 5827d8a856..aa2b14e12a 100644 --- a/src/npair_skip.h +++ b/src/npair_skip.h @@ -37,8 +37,7 @@ namespace LAMMPS_NS { class NPairSkip : public NPair { public: NPairSkip(class LAMMPS *); - ~NPairSkip() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_skip_respa.h b/src/npair_skip_respa.h index 64b3f7c7da..b0938287b5 100644 --- a/src/npair_skip_respa.h +++ b/src/npair_skip_respa.h @@ -31,8 +31,7 @@ namespace LAMMPS_NS { class NPairSkipRespa : public NPair { public: NPairSkipRespa(class LAMMPS *); - ~NPairSkipRespa() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_skip_size.h b/src/npair_skip_size.h index 0864b568a1..df8d479185 100644 --- a/src/npair_skip_size.h +++ b/src/npair_skip_size.h @@ -30,8 +30,7 @@ namespace LAMMPS_NS { class NPairSkipSize : public NPair { public: NPairSkipSize(class LAMMPS *); - ~NPairSkipSize() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_skip_size_off2on.h b/src/npair_skip_size_off2on.h index a0205a3865..39aee76b09 100644 --- a/src/npair_skip_size_off2on.h +++ b/src/npair_skip_size_off2on.h @@ -31,8 +31,7 @@ namespace LAMMPS_NS { class NPairSkipSizeOff2on : public NPair { public: NPairSkipSizeOff2on(class LAMMPS *); - ~NPairSkipSizeOff2on() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS diff --git a/src/npair_skip_size_off2on_oneside.h b/src/npair_skip_size_off2on_oneside.h index 2c3ec6f4ca..3f1cd6ef34 100644 --- a/src/npair_skip_size_off2on_oneside.h +++ b/src/npair_skip_size_off2on_oneside.h @@ -31,8 +31,7 @@ namespace LAMMPS_NS { class NPairSkipSizeOff2onOneside : public NPair { public: NPairSkipSizeOff2onOneside(class LAMMPS *); - ~NPairSkipSizeOff2onOneside() {} - void build(class NeighList *); + void build(class NeighList *) override; }; } // namespace LAMMPS_NS From 222ea31d8dc29581fdef14cfaf29e362cfd12458 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 15:28:47 -0500 Subject: [PATCH 050/174] Remove override = default destructor lines --- src/CG-DNA/atom_vec_oxdna.h | 1 - src/KOKKOS/atom_vec_angle_kokkos.h | 2 +- src/KOKKOS/atom_vec_atomic_kokkos.h | 2 +- src/KOKKOS/atom_vec_bond_kokkos.h | 2 +- src/KOKKOS/atom_vec_charge_kokkos.h | 2 +- src/KOKKOS/atom_vec_dpd_kokkos.h | 2 +- src/KOKKOS/atom_vec_full_kokkos.h | 2 +- src/KOKKOS/atom_vec_kokkos.h | 2 +- src/KOKKOS/atom_vec_molecular_kokkos.h | 2 +- src/KOKKOS/atom_vec_sphere_kokkos.h | 2 +- src/KOKKOS/verlet_kokkos.h | 2 +- src/OPENMP/respa_omp.h | 2 +- src/atom_vec_atomic.h | 1 - src/group.h | 2 +- src/min_fire.h | 2 +- src/min_fire_old.h | 2 +- src/min_quickmin.h | 2 +- src/timer.h | 2 +- src/verlet.h | 2 +- 19 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/CG-DNA/atom_vec_oxdna.h b/src/CG-DNA/atom_vec_oxdna.h index 338c1adca3..7830aeaf33 100644 --- a/src/CG-DNA/atom_vec_oxdna.h +++ b/src/CG-DNA/atom_vec_oxdna.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class AtomVecOxdna : public AtomVec { public: AtomVecOxdna(class LAMMPS *); - ~AtomVecOxdna() override = default; void grow_pointers() override; void data_atom_post(int) override; diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index c5cd639cf5..8a315d666c 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class AtomVecAngleKokkos : public AtomVecKokkos { public: AtomVecAngleKokkos(class LAMMPS *); - ~AtomVecAngleKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_comm(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index d14e9e6c85..e0134f8952 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { class AtomVecAtomicKokkos : public AtomVecKokkos { public: AtomVecAtomicKokkos(class LAMMPS *); - ~AtomVecAtomicKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_border(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index e8522887a1..3daef1dbbe 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class AtomVecBondKokkos : public AtomVecKokkos { public: AtomVecBondKokkos(class LAMMPS *); - ~AtomVecBondKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_border(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index 438f3106a7..c2d85e4bd6 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { class AtomVecChargeKokkos : public AtomVecKokkos { public: AtomVecChargeKokkos(class LAMMPS *); - ~AtomVecChargeKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_border(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index 79d8c5a59f..4dfa2bfbe0 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { class AtomVecDPDKokkos : public AtomVecKokkos { public: AtomVecDPDKokkos(class LAMMPS *); - ~AtomVecDPDKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_comm(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index 95e35ef85f..54671e47e3 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class AtomVecFullKokkos : public AtomVecKokkos { public: AtomVecFullKokkos(class LAMMPS *); - ~AtomVecFullKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_border(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index 4b91740cb9..53a1b7ec30 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -36,7 +36,7 @@ union d_ubuf { class AtomVecKokkos : public AtomVec { public: AtomVecKokkos(class LAMMPS *); - ~AtomVecKokkos() override = default; + bigint roundup(bigint) override; int pack_comm(int, int *, double *, int, int *) override; int pack_comm_vel(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index 435d004a71..82ad490abc 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class AtomVecMolecularKokkos : public AtomVecKokkos { public: AtomVecMolecularKokkos(class LAMMPS *); - ~AtomVecMolecularKokkos() override = default; + void grow(int) override; void copy(int, int, int) override; int pack_comm(int, int *, double *, int, int *) override; diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index 107e21005b..26664484dc 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { class AtomVecSphereKokkos : public AtomVecKokkos { public: AtomVecSphereKokkos(class LAMMPS *); - ~AtomVecSphereKokkos() override = default; + void init() override; void grow(int) override; void grow_pointers() override; diff --git a/src/KOKKOS/verlet_kokkos.h b/src/KOKKOS/verlet_kokkos.h index 95c58e2c6b..5159ef00ef 100644 --- a/src/KOKKOS/verlet_kokkos.h +++ b/src/KOKKOS/verlet_kokkos.h @@ -31,7 +31,7 @@ namespace LAMMPS_NS { class VerletKokkos : public Verlet { public: VerletKokkos(class LAMMPS *, int, char **); - ~VerletKokkos() override = default; + void setup(int) override; void setup_minimal(int) override; void run(int) override; diff --git a/src/OPENMP/respa_omp.h b/src/OPENMP/respa_omp.h index a4fc9561a9..5e6af71102 100644 --- a/src/OPENMP/respa_omp.h +++ b/src/OPENMP/respa_omp.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class RespaOMP : public Respa, public ThrOMP { public: RespaOMP(class LAMMPS *, int, char **); - ~RespaOMP() override = default; + void init() override; void setup(int) override; void setup_minimal(int) override; diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h index 4ce56ff873..28d773a30a 100644 --- a/src/atom_vec_atomic.h +++ b/src/atom_vec_atomic.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class AtomVecAtomic : public AtomVec { public: AtomVecAtomic(class LAMMPS *); - ~AtomVecAtomic() override = default; }; } // namespace LAMMPS_NS diff --git a/src/group.h b/src/group.h index 8d4270bbad..8c4d10a24f 100644 --- a/src/group.h +++ b/src/group.h @@ -29,7 +29,7 @@ class Group : protected Pointers { int *dynamic; // 1 if dynamic, 0 if not Group(class LAMMPS *); - ~Group(); + ~Group() override; void assign(int, char **); // assign atoms to a group void assign(const std::string &); // convenience function void create(const std::string &, int *); // add flagged atoms to a group diff --git a/src/min_fire.h b/src/min_fire.h index 0119972734..c415ec8fb9 100644 --- a/src/min_fire.h +++ b/src/min_fire.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class MinFire : public Min { public: MinFire(class LAMMPS *); - ~MinFire() override = default; + void init() override; void setup_style() override; void reset_vectors() override; diff --git a/src/min_fire_old.h b/src/min_fire_old.h index f32d66907d..0d9d7ee2ec 100644 --- a/src/min_fire_old.h +++ b/src/min_fire_old.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class MinFireOld : public Min { public: MinFireOld(class LAMMPS *); - ~MinFireOld() override = default; + void init() override; void setup_style() override; void reset_vectors() override; diff --git a/src/min_quickmin.h b/src/min_quickmin.h index 8a199fb472..d1b415313b 100644 --- a/src/min_quickmin.h +++ b/src/min_quickmin.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class MinQuickMin : public Min { public: MinQuickMin(class LAMMPS *); - ~MinQuickMin() override = default; + void init() override; void setup_style() override; void reset_vectors() override; diff --git a/src/timer.h b/src/timer.h index 245a81d660..1cd7b1ce05 100644 --- a/src/timer.h +++ b/src/timer.h @@ -44,7 +44,7 @@ class Timer : protected Pointers { enum tlevel { OFF = 0, LOOP, NORMAL, FULL }; Timer(class LAMMPS *); - ~Timer() override = default; + void init(); // inline function to reduce overhead if we want no detailed timings diff --git a/src/verlet.h b/src/verlet.h index 26fb038ce6..e93f5917de 100644 --- a/src/verlet.h +++ b/src/verlet.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Verlet : public Integrate { public: Verlet(class LAMMPS *, int, char **); - ~Verlet() override = default; + void init() override; void setup(int flag) override; void setup_minimal(int) override; From 32a19d982acb07f8e3e27e41abab31a7b7e41077 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 15:37:15 -0500 Subject: [PATCH 051/174] Apply override to NStencil classes --- src/DPD-REACT/nstencil_half_bin_2d_ssa.h | 3 +-- src/DPD-REACT/nstencil_half_bin_3d_ssa.h | 3 +-- src/DPD-REACT/nstencil_ssa.h | 3 +-- src/nstencil.h | 2 +- src/nstencil_full_bin_2d.h | 3 +-- src/nstencil_full_bin_3d.h | 3 +-- src/nstencil_full_ghost_bin_2d.h | 3 +-- src/nstencil_full_ghost_bin_3d.h | 3 +-- src/nstencil_full_multi_2d.h | 5 ++--- src/nstencil_full_multi_3d.h | 5 ++--- src/nstencil_full_multi_old_2d.h | 3 +-- src/nstencil_full_multi_old_3d.h | 3 +-- src/nstencil_half_bin_2d.h | 3 +-- src/nstencil_half_bin_2d_tri.h | 3 +-- src/nstencil_half_bin_3d.h | 3 +-- src/nstencil_half_bin_3d_tri.h | 3 +-- src/nstencil_half_multi_2d.h | 5 ++--- src/nstencil_half_multi_2d_tri.h | 5 ++--- src/nstencil_half_multi_3d.h | 5 ++--- src/nstencil_half_multi_3d_tri.h | 5 ++--- src/nstencil_half_multi_old_2d.h | 3 +-- src/nstencil_half_multi_old_2d_tri.h | 3 +-- src/nstencil_half_multi_old_3d.h | 3 +-- src/nstencil_half_multi_old_3d_tri.h | 3 +-- 24 files changed, 30 insertions(+), 53 deletions(-) diff --git a/src/DPD-REACT/nstencil_half_bin_2d_ssa.h b/src/DPD-REACT/nstencil_half_bin_2d_ssa.h index 252a59d806..b53deb5e4d 100644 --- a/src/DPD-REACT/nstencil_half_bin_2d_ssa.h +++ b/src/DPD-REACT/nstencil_half_bin_2d_ssa.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilHalfBin2dSSA : public NStencilSSA { public: NStencilHalfBin2dSSA(class LAMMPS *); - ~NStencilHalfBin2dSSA() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/DPD-REACT/nstencil_half_bin_3d_ssa.h b/src/DPD-REACT/nstencil_half_bin_3d_ssa.h index 97c1b891ae..0d3cfd6a26 100644 --- a/src/DPD-REACT/nstencil_half_bin_3d_ssa.h +++ b/src/DPD-REACT/nstencil_half_bin_3d_ssa.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilHalfBin3dSSA : public NStencilSSA { public: NStencilHalfBin3dSSA(class LAMMPS *); - ~NStencilHalfBin3dSSA() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/DPD-REACT/nstencil_ssa.h b/src/DPD-REACT/nstencil_ssa.h index 6cb0868c19..237a9d982f 100644 --- a/src/DPD-REACT/nstencil_ssa.h +++ b/src/DPD-REACT/nstencil_ssa.h @@ -21,8 +21,7 @@ namespace LAMMPS_NS { class NStencilSSA : public NStencil { public: NStencilSSA(class LAMMPS *lmp) : NStencil(lmp) { xyzflag = 1; } - ~NStencilSSA() {} - virtual void create() = 0; + void create() override = 0; // first stencil index for each subphase, with last index at end int nstencil_ssa[5]; diff --git a/src/nstencil.h b/src/nstencil.h index d8febe356b..480cd9c5b4 100644 --- a/src/nstencil.h +++ b/src/nstencil.h @@ -48,7 +48,7 @@ class NStencil : protected Pointers { int **bin_collection_multi; // what collection to use for bin information NStencil(class LAMMPS *); - virtual ~NStencil(); + ~NStencil() override; void post_constructor(class NeighRequest *); void copy_neighbor_info(); virtual void create_setup(); diff --git a/src/nstencil_full_bin_2d.h b/src/nstencil_full_bin_2d.h index fa691bba89..f4c630d3c2 100644 --- a/src/nstencil_full_bin_2d.h +++ b/src/nstencil_full_bin_2d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilFullBin2d : public NStencil { public: NStencilFullBin2d(class LAMMPS *); - ~NStencilFullBin2d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_bin_3d.h b/src/nstencil_full_bin_3d.h index 8753d10ed2..463dda1f62 100644 --- a/src/nstencil_full_bin_3d.h +++ b/src/nstencil_full_bin_3d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilFullBin3d : public NStencil { public: NStencilFullBin3d(class LAMMPS *); - ~NStencilFullBin3d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_ghost_bin_2d.h b/src/nstencil_full_ghost_bin_2d.h index 4a69f8accd..6326aae5ea 100644 --- a/src/nstencil_full_ghost_bin_2d.h +++ b/src/nstencil_full_ghost_bin_2d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilFullGhostBin2d : public NStencil { public: NStencilFullGhostBin2d(class LAMMPS *); - ~NStencilFullGhostBin2d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_ghost_bin_3d.h b/src/nstencil_full_ghost_bin_3d.h index 829bece6d0..eed98279aa 100644 --- a/src/nstencil_full_ghost_bin_3d.h +++ b/src/nstencil_full_ghost_bin_3d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilFullGhostBin3d : public NStencil { public: NStencilFullGhostBin3d(class LAMMPS *); - ~NStencilFullGhostBin3d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_multi_2d.h b/src/nstencil_full_multi_2d.h index cc50314f93..2ef43f1999 100644 --- a/src/nstencil_full_multi_2d.h +++ b/src/nstencil_full_multi_2d.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class NStencilFullMulti2d : public NStencil { public: NStencilFullMulti2d(class LAMMPS *); - ~NStencilFullMulti2d() {} - void create(); + void create() override; protected: - void set_stencil_properties(); + void set_stencil_properties() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_multi_3d.h b/src/nstencil_full_multi_3d.h index ba80d602ab..894c688a9f 100644 --- a/src/nstencil_full_multi_3d.h +++ b/src/nstencil_full_multi_3d.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class NStencilFullMulti3d : public NStencil { public: NStencilFullMulti3d(class LAMMPS *); - ~NStencilFullMulti3d() {} - void create(); + void create() override; protected: - void set_stencil_properties(); + void set_stencil_properties() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_multi_old_2d.h b/src/nstencil_full_multi_old_2d.h index 1929fa09e5..9b56be0793 100644 --- a/src/nstencil_full_multi_old_2d.h +++ b/src/nstencil_full_multi_old_2d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilFullMultiOld2d : public NStencil { public: NStencilFullMultiOld2d(class LAMMPS *); - ~NStencilFullMultiOld2d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_full_multi_old_3d.h b/src/nstencil_full_multi_old_3d.h index 33d4166251..d19da9c95f 100644 --- a/src/nstencil_full_multi_old_3d.h +++ b/src/nstencil_full_multi_old_3d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilFullMultiOld3d : public NStencil { public: NStencilFullMultiOld3d(class LAMMPS *); - ~NStencilFullMultiOld3d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_bin_2d.h b/src/nstencil_half_bin_2d.h index c7e07e1472..f11138dd54 100644 --- a/src/nstencil_half_bin_2d.h +++ b/src/nstencil_half_bin_2d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilHalfBin2d : public NStencil { public: NStencilHalfBin2d(class LAMMPS *); - ~NStencilHalfBin2d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_bin_2d_tri.h b/src/nstencil_half_bin_2d_tri.h index 9d980a5ed6..5088bc2edc 100644 --- a/src/nstencil_half_bin_2d_tri.h +++ b/src/nstencil_half_bin_2d_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilHalfBin2dTri : public NStencil { public: NStencilHalfBin2dTri(class LAMMPS *); - ~NStencilHalfBin2dTri() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_bin_3d.h b/src/nstencil_half_bin_3d.h index 10d4eaa44b..f235d6688b 100644 --- a/src/nstencil_half_bin_3d.h +++ b/src/nstencil_half_bin_3d.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilHalfBin3d : public NStencil { public: NStencilHalfBin3d(class LAMMPS *); - ~NStencilHalfBin3d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_bin_3d_tri.h b/src/nstencil_half_bin_3d_tri.h index 33158f32ae..fa2975ef0a 100644 --- a/src/nstencil_half_bin_3d_tri.h +++ b/src/nstencil_half_bin_3d_tri.h @@ -29,8 +29,7 @@ namespace LAMMPS_NS { class NStencilHalfBin3dTri : public NStencil { public: NStencilHalfBin3dTri(class LAMMPS *); - ~NStencilHalfBin3dTri() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_2d.h b/src/nstencil_half_multi_2d.h index be98e0a027..043d160b9e 100644 --- a/src/nstencil_half_multi_2d.h +++ b/src/nstencil_half_multi_2d.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class NStencilHalfMulti2d : public NStencil { public: NStencilHalfMulti2d(class LAMMPS *); - ~NStencilHalfMulti2d() {} - void create(); + void create() override; protected: - void set_stencil_properties(); + void set_stencil_properties() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_2d_tri.h b/src/nstencil_half_multi_2d_tri.h index 0404b8195b..1d1a469e72 100644 --- a/src/nstencil_half_multi_2d_tri.h +++ b/src/nstencil_half_multi_2d_tri.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class NStencilHalfMulti2dTri : public NStencil { public: NStencilHalfMulti2dTri(class LAMMPS *); - ~NStencilHalfMulti2dTri() {} - void create(); + void create() override; protected: - void set_stencil_properties(); + void set_stencil_properties() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_3d.h b/src/nstencil_half_multi_3d.h index 020bf1310f..246d71f3e4 100644 --- a/src/nstencil_half_multi_3d.h +++ b/src/nstencil_half_multi_3d.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class NStencilHalfMulti3d : public NStencil { public: NStencilHalfMulti3d(class LAMMPS *); - ~NStencilHalfMulti3d() {} - void create(); + void create() override; protected: - void set_stencil_properties(); + void set_stencil_properties() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_3d_tri.h b/src/nstencil_half_multi_3d_tri.h index 1e3058d50c..2ced4b0c20 100644 --- a/src/nstencil_half_multi_3d_tri.h +++ b/src/nstencil_half_multi_3d_tri.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class NStencilHalfMulti3dTri : public NStencil { public: NStencilHalfMulti3dTri(class LAMMPS *); - ~NStencilHalfMulti3dTri() {} - void create(); + void create() override; protected: - void set_stencil_properties(); + void set_stencil_properties() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_old_2d.h b/src/nstencil_half_multi_old_2d.h index 8d16b1a8f2..387429d160 100644 --- a/src/nstencil_half_multi_old_2d.h +++ b/src/nstencil_half_multi_old_2d.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class NStencilHalfMultiOld2d : public NStencil { public: NStencilHalfMultiOld2d(class LAMMPS *); - ~NStencilHalfMultiOld2d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_old_2d_tri.h b/src/nstencil_half_multi_old_2d_tri.h index 72f9e41083..a81d37062c 100644 --- a/src/nstencil_half_multi_old_2d_tri.h +++ b/src/nstencil_half_multi_old_2d_tri.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class NStencilHalfMultiOld2dTri : public NStencil { public: NStencilHalfMultiOld2dTri(class LAMMPS *); - ~NStencilHalfMultiOld2dTri() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_old_3d.h b/src/nstencil_half_multi_old_3d.h index 7b050f3538..d7d8157afa 100644 --- a/src/nstencil_half_multi_old_3d.h +++ b/src/nstencil_half_multi_old_3d.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class NStencilHalfMultiOld3d : public NStencil { public: NStencilHalfMultiOld3d(class LAMMPS *); - ~NStencilHalfMultiOld3d() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS diff --git a/src/nstencil_half_multi_old_3d_tri.h b/src/nstencil_half_multi_old_3d_tri.h index 3ab71b5c61..2a7a5a22bb 100644 --- a/src/nstencil_half_multi_old_3d_tri.h +++ b/src/nstencil_half_multi_old_3d_tri.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class NStencilHalfMultiOld3dTri : public NStencil { public: NStencilHalfMultiOld3dTri(class LAMMPS *); - ~NStencilHalfMultiOld3dTri() {} - void create(); + void create() override; }; } // namespace LAMMPS_NS From 7aaa85c3a1dc5f87f0087f12b39718732b4cdb7b Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 15:44:16 -0500 Subject: [PATCH 052/174] Apply override to NBin classes --- src/DPD-REACT/nbin_ssa.h | 7 +++---- src/INTEL/nbin_intel.h | 9 +++++---- src/KOKKOS/nbin_kokkos.h | 6 +++--- src/KOKKOS/nbin_ssa_kokkos.h | 6 +++--- src/nbin.h | 2 +- src/nbin_multi.h | 10 +++++----- src/nbin_standard.h | 10 +++++----- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/DPD-REACT/nbin_ssa.h b/src/DPD-REACT/nbin_ssa.h index 5285c5b44d..ca04ed4bd5 100644 --- a/src/DPD-REACT/nbin_ssa.h +++ b/src/DPD-REACT/nbin_ssa.h @@ -41,12 +41,11 @@ class NBinSSA : public NBinStandard { int lbinzhi; // highest local bin z-dim coordinate NBinSSA(class LAMMPS *); - virtual ~NBinSSA() = default; - void bin_atoms_setup(int); - void bin_atoms(); + void bin_atoms_setup(int) override; + void bin_atoms() override; - double memory_usage(); + double memory_usage() override; inline int coord2bin(const double &x, const double &y, const double &z, int &ixo, int &iyo, int &izo) const diff --git a/src/INTEL/nbin_intel.h b/src/INTEL/nbin_intel.h index dbed37b347..8e4e387581 100644 --- a/src/INTEL/nbin_intel.h +++ b/src/INTEL/nbin_intel.h @@ -32,16 +32,17 @@ namespace LAMMPS_NS { class NBinIntel : public NBinStandard { public: NBinIntel(class LAMMPS *); - ~NBinIntel(); - void bin_atoms_setup(int); - void bin_atoms(); + ~NBinIntel() override; + + void bin_atoms_setup(int) override; + void bin_atoms() override; int *get_binpacked() { return _binpacked; } private: FixIntel *_fix; int *_atombin, *_binpacked; int _precision_mode; - double memory_usage(); + double memory_usage() override; template void bin_atoms(IntelBuffers *); diff --git a/src/KOKKOS/nbin_kokkos.h b/src/KOKKOS/nbin_kokkos.h index 1f6569177c..35bf50f48a 100644 --- a/src/KOKKOS/nbin_kokkos.h +++ b/src/KOKKOS/nbin_kokkos.h @@ -38,9 +38,9 @@ class NBinKokkos : public NBinStandard { typedef ArrayTypes AT; NBinKokkos(class LAMMPS *); - ~NBinKokkos() {} - void bin_atoms_setup(int); - void bin_atoms(); + + void bin_atoms_setup(int) override; + void bin_atoms() override; int atoms_per_bin; DAT::tdual_int_1d k_bincount; diff --git a/src/KOKKOS/nbin_ssa_kokkos.h b/src/KOKKOS/nbin_ssa_kokkos.h index eb5ade3e48..a31c57d67c 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.h +++ b/src/KOKKOS/nbin_ssa_kokkos.h @@ -38,9 +38,9 @@ class NBinSSAKokkos : public NBinStandard { typedef ArrayTypes AT; NBinSSAKokkos(class LAMMPS *); - ~NBinSSAKokkos() {} - void bin_atoms_setup(int); - void bin_atoms(); + + void bin_atoms_setup(int) override; + void bin_atoms() override; // temporary array to hold the binID for each atom DAT::tdual_int_1d k_binID; diff --git a/src/nbin.h b/src/nbin.h index 6755158bc2..5d410cb46f 100644 --- a/src/nbin.h +++ b/src/nbin.h @@ -50,7 +50,7 @@ class NBin : protected Pointers { int **binhead_multi; NBin(class LAMMPS *); - ~NBin(); + ~NBin() override; void post_constructor(class NeighRequest *); virtual void copy_neighbor_info(); diff --git a/src/nbin_multi.h b/src/nbin_multi.h index cc58ee0649..ca2e66c28b 100644 --- a/src/nbin_multi.h +++ b/src/nbin_multi.h @@ -29,11 +29,11 @@ namespace LAMMPS_NS { class NBinMulti : public NBin { public: NBinMulti(class LAMMPS *); - ~NBinMulti() {} - void bin_atoms_setup(int); - void setup_bins(int); - void bin_atoms(); - double memory_usage(); + + void bin_atoms_setup(int) override; + void setup_bins(int) override; + void bin_atoms() override; + double memory_usage() override; }; } // namespace LAMMPS_NS diff --git a/src/nbin_standard.h b/src/nbin_standard.h index 405c7c88f1..ebd7d37024 100644 --- a/src/nbin_standard.h +++ b/src/nbin_standard.h @@ -29,11 +29,11 @@ namespace LAMMPS_NS { class NBinStandard : public NBin { public: NBinStandard(class LAMMPS *); - ~NBinStandard() {} - void bin_atoms_setup(int); - void setup_bins(int); - void bin_atoms(); - double memory_usage(); + + void bin_atoms_setup(int) override; + void setup_bins(int) override; + void bin_atoms() override; + double memory_usage() override; }; } // namespace LAMMPS_NS From 06cb86dfb96ff92e591728a895c8b3f427522c2e Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 15:53:01 -0500 Subject: [PATCH 053/174] Apply override to NTopo classes --- src/ntopo.h | 2 +- src/ntopo_angle_all.h | 3 +-- src/ntopo_angle_partial.h | 3 +-- src/ntopo_angle_template.h | 3 +-- src/ntopo_bond_all.h | 3 +-- src/ntopo_bond_partial.h | 3 +-- src/ntopo_bond_template.h | 3 +-- src/ntopo_dihedral_all.h | 3 +-- src/ntopo_dihedral_partial.h | 3 +-- src/ntopo_dihedral_template.h | 3 +-- src/ntopo_improper_all.h | 3 +-- src/ntopo_improper_partial.h | 3 +-- src/ntopo_improper_template.h | 3 +-- 13 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/ntopo.h b/src/ntopo.h index 9d8fe988fb..8015054490 100644 --- a/src/ntopo.h +++ b/src/ntopo.h @@ -24,7 +24,7 @@ class NTopo : protected Pointers { int **bondlist, **anglelist, **dihedrallist, **improperlist; NTopo(class LAMMPS *); - virtual ~NTopo(); + ~NTopo() override; virtual void build() = 0; diff --git a/src/ntopo_angle_all.h b/src/ntopo_angle_all.h index ec8d08dd1c..8ef0d17c3b 100644 --- a/src/ntopo_angle_all.h +++ b/src/ntopo_angle_all.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoAngleAll : public NTopo { public: NTopoAngleAll(class LAMMPS *); - ~NTopoAngleAll() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_angle_partial.h b/src/ntopo_angle_partial.h index ee29a9dd98..6d12975948 100644 --- a/src/ntopo_angle_partial.h +++ b/src/ntopo_angle_partial.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoAnglePartial : public NTopo { public: NTopoAnglePartial(class LAMMPS *); - ~NTopoAnglePartial() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_angle_template.h b/src/ntopo_angle_template.h index cfd48b0450..027659fde3 100644 --- a/src/ntopo_angle_template.h +++ b/src/ntopo_angle_template.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoAngleTemplate : public NTopo { public: NTopoAngleTemplate(class LAMMPS *); - ~NTopoAngleTemplate() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_bond_all.h b/src/ntopo_bond_all.h index de404446e8..a62fc5f43c 100644 --- a/src/ntopo_bond_all.h +++ b/src/ntopo_bond_all.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoBondAll : public NTopo { public: NTopoBondAll(class LAMMPS *); - ~NTopoBondAll() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_bond_partial.h b/src/ntopo_bond_partial.h index 4d334d1f0f..e0181e4491 100644 --- a/src/ntopo_bond_partial.h +++ b/src/ntopo_bond_partial.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoBondPartial : public NTopo { public: NTopoBondPartial(class LAMMPS *); - ~NTopoBondPartial() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_bond_template.h b/src/ntopo_bond_template.h index b725ac85f9..5899ded8b0 100644 --- a/src/ntopo_bond_template.h +++ b/src/ntopo_bond_template.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoBondTemplate : public NTopo { public: NTopoBondTemplate(class LAMMPS *); - ~NTopoBondTemplate() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_dihedral_all.h b/src/ntopo_dihedral_all.h index 0568bc9708..002c11a385 100644 --- a/src/ntopo_dihedral_all.h +++ b/src/ntopo_dihedral_all.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoDihedralAll : public NTopo { public: NTopoDihedralAll(class LAMMPS *); - ~NTopoDihedralAll() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_dihedral_partial.h b/src/ntopo_dihedral_partial.h index f439fe1dcd..c75b52fa44 100644 --- a/src/ntopo_dihedral_partial.h +++ b/src/ntopo_dihedral_partial.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoDihedralPartial : public NTopo { public: NTopoDihedralPartial(class LAMMPS *); - ~NTopoDihedralPartial() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_dihedral_template.h b/src/ntopo_dihedral_template.h index 67fe1c9072..e9bb1e355a 100644 --- a/src/ntopo_dihedral_template.h +++ b/src/ntopo_dihedral_template.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoDihedralTemplate : public NTopo { public: NTopoDihedralTemplate(class LAMMPS *); - ~NTopoDihedralTemplate() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_improper_all.h b/src/ntopo_improper_all.h index 26bbb1a642..af8d10cb44 100644 --- a/src/ntopo_improper_all.h +++ b/src/ntopo_improper_all.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoImproperAll : public NTopo { public: NTopoImproperAll(class LAMMPS *); - ~NTopoImproperAll() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_improper_partial.h b/src/ntopo_improper_partial.h index cc4baf1642..da88d81a41 100644 --- a/src/ntopo_improper_partial.h +++ b/src/ntopo_improper_partial.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoImproperPartial : public NTopo { public: NTopoImproperPartial(class LAMMPS *); - ~NTopoImproperPartial() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS diff --git a/src/ntopo_improper_template.h b/src/ntopo_improper_template.h index 510f067d66..1a1a4ade23 100644 --- a/src/ntopo_improper_template.h +++ b/src/ntopo_improper_template.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class NTopoImproperTemplate : public NTopo { public: NTopoImproperTemplate(class LAMMPS *); - ~NTopoImproperTemplate() {} - void build(); + void build() override; }; } // namespace LAMMPS_NS From 0b24c5b498a882a3fcc1aec450f1103f73d2693c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 20 Jan 2022 16:04:07 -0500 Subject: [PATCH 054/174] workaround for segfaults due to NULL pointer dereference with hybrid styles --- src/INTEL/npair_intel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/INTEL/npair_intel.cpp b/src/INTEL/npair_intel.cpp index 395e50006c..76a56ef90f 100644 --- a/src/INTEL/npair_intel.cpp +++ b/src/INTEL/npair_intel.cpp @@ -367,7 +367,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, ty[u] = x[j].y; tz[u] = x[j].z; tjtype[u] = x[j].w; - if (THREE) ttag[u] = tag[j]; + if (THREE && ttag) ttag[u] = tag[j]; } if (FULL == 0 && TRI != 1) { @@ -515,7 +515,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, } if (THREE) { - const tagint jtag = ttag[u]; + const tagint jtag = ttag ? ttag[u] : tag[j]; int flist = 0; if (itag > jtag) { if (((itag+jtag) & 1) == 0) flist = 1; From dbe267cb88ace551797d0258d24cdc183d998606 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 20 Jan 2022 16:04:26 -0500 Subject: [PATCH 055/174] join lines, whitespace --- src/INTEL/fix_intel.cpp | 45 +++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 519181be52..2fe6b94515 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -303,8 +303,7 @@ void FixIntel::init() if (force->pair_match("^hybrid", 0) != nullptr) { _pair_hybrid_flag = 1; if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute) - error->all(FLERR, - "Intel package requires fdotr virial with newton on."); + error->all(FLERR,"Intel package requires fdotr virial with newton on."); } else _pair_hybrid_flag = 0; @@ -325,8 +324,7 @@ void FixIntel::init() _pair_hybrid_zero = 0; if (force->newton_pair == 0) _pair_hybrid_flag = 0; if (nstyles > 1) - error->all(FLERR, - "Currently, cannot offload more than one intel style with hybrid."); + error->all(FLERR,"Currently, cannot offload more than one intel style with hybrid."); } #endif @@ -356,15 +354,12 @@ void FixIntel::init() void FixIntel::setup(int vflag) { if (neighbor->style != Neighbor::BIN) - error->all(FLERR, - "Currently, neighbor style BIN must be used with Intel package."); + error->all(FLERR,"Currently, neighbor style BIN must be used with Intel package."); if (vflag > 3) - error->all(FLERR, - "Cannot currently get per-atom virials with Intel package."); + error->all(FLERR,"Cannot currently get per-atom virials with Intel package."); #ifdef _LMP_INTEL_OFFLOAD if (neighbor->exclude_setting() != 0) - error->all(FLERR, - "Currently, cannot use neigh_modify exclude with Intel package offload."); + error->all(FLERR,"Currently, cannot use neigh_modify exclude with Intel package offload."); post_force(vflag); #endif } @@ -425,14 +420,14 @@ void FixIntel::pair_init_check(const bool cdmessage) if (_offload_balance != 0.0 && comm->me == 0) { #ifndef __INTEL_COMPILER_BUILD_DATE - error->warning(FLERR, "Unknown Intel Compiler Version\n"); + error->warning(FLERR,"Unknown Intel Compiler Version\n"); #else if (__INTEL_COMPILER_BUILD_DATE != 20131008 && __INTEL_COMPILER_BUILD_DATE < 20141023) - error->warning(FLERR, "Unsupported Intel Compiler."); + error->warning(FLERR,"Unsupported Intel Compiler."); #endif #if !defined(__INTEL_COMPILER) - error->warning(FLERR, "Unsupported Intel Compiler."); + error->warning(FLERR,"Unsupported Intel Compiler."); #endif } @@ -505,8 +500,7 @@ void FixIntel::bond_init_check() { if ((_offload_balance != 0.0) && (atom->molecular != Atom::ATOMIC) && (force->newton_pair != force->newton_bond)) - error->all(FLERR, - "INTEL package requires same setting for newton bond and non-bond."); + error->all(FLERR,"INTEL package requires same setting for newton bond and non-bond."); int intel_pair = 0; if (force->pair_match("/intel$", 0) != nullptr) @@ -517,7 +511,7 @@ void FixIntel::bond_init_check() } if (intel_pair == 0) - error->all(FLERR, "Intel styles for bond/angle/dihedral/improper " + error->all(FLERR,"Intel styles for bond/angle/dihedral/improper " "require intel pair style."); } @@ -534,7 +528,7 @@ void FixIntel::kspace_init_check() } if (intel_pair == 0) - error->all(FLERR, "Intel styles for kspace require intel pair style."); + error->all(FLERR,"Intel styles for kspace require intel pair style."); } /* ---------------------------------------------------------------------- */ @@ -551,7 +545,7 @@ void FixIntel::check_neighbor_intel() _offload_noghost = 0; } if (neighbor->requests[i]->skip && _offload_balance != 0.0) - error->all(FLERR, "Cannot yet use hybrid styles with Intel offload."); + error->all(FLERR,"Cannot yet use hybrid styles with Intel offload."); // avoid flagging a neighbor list as both INTEL and OPENMP if (neighbor->requests[i]->intel) @@ -786,8 +780,7 @@ void FixIntel::add_oresults(const ft * _noalias const f_in, if (f_in[1].w == 1) error->all(FLERR,"Bad matrix inversion in mldivide3"); else - error->all(FLERR, - "Sphere particles not yet supported for gayberne/intel"); + error->all(FLERR,"Sphere particles not yet supported for gayberne/intel"); } } @@ -926,7 +919,7 @@ void FixIntel::add_off_results(const ft * _noalias const f_in, int nlocal = atom->nlocal; if (neighbor->ago == 0) { if (_off_overflow_flag[LMP_OVERFLOW]) - error->one(FLERR, "Neighbor list overflow, boost neigh_modify one"); + error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); _offload_nlocal = _off_overflow_flag[LMP_LOCAL_MAX] + 1; _offload_min_ghost = _off_overflow_flag[LMP_GHOST_MIN]; _offload_nghost = _off_overflow_flag[LMP_GHOST_MAX] + 1 - @@ -938,7 +931,7 @@ void FixIntel::add_off_results(const ft * _noalias const f_in, if (atom->torque) if (f_in[1].w < 0.0) - error->all(FLERR, "Bad matrix inversion in mldivide3"); + error->all(FLERR,"Bad matrix inversion in mldivide3"); add_results(f_in, ev_global, _off_results_eatom, _off_results_vatom, 1); // Load balance? @@ -1043,8 +1036,7 @@ void FixIntel::output_timing_data() { timers[TIME_OFFLOAD_PAIR]; double tt = MAX(ht,ct); if (timers[TIME_OFFLOAD_LATENCY] / tt > 0.07 && _separate_coi == 0) - error->warning(FLERR, - "Leaving a core free can improve performance for offload"); + error->warning(FLERR,"Leaving a core free can improve performance for offload"); } fprintf(_tscreen, "------------------------------------------------\n"); } @@ -1109,7 +1101,7 @@ void FixIntel::set_offload_affinity() int ppn = get_ppn(node_rank); if (ppn % _ncops != 0) - error->all(FLERR, "MPI tasks per node must be multiple of offload_cards"); + error->all(FLERR,"MPI tasks per node must be multiple of offload_cards"); ppn = ppn / _ncops; _cop = node_rank / ppn; node_rank = node_rank % ppn; @@ -1214,8 +1206,7 @@ int FixIntel::set_host_affinity(const int nomp) int subscription = nthreads * ppn; if (subscription > ncores) { if (rank == 0) - error->warning(FLERR, - "More MPI tasks/OpenMP threads than available cores"); + error->warning(FLERR,"More MPI tasks/OpenMP threads than available cores"); return 0; } if (subscription == ncores) From c9776dad6f7a12962feda0eda7e719b9398201ea Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 16:35:59 -0500 Subject: [PATCH 056/174] Apply override to Command classes --- src/COLVARS/group_ndx.h | 2 +- src/COLVARS/ndx_group.h | 2 +- src/KIM/kim_command.h | 2 +- src/MESSAGE/message.h | 2 +- src/MESSAGE/server.h | 2 +- src/MESSAGE/server_md.h | 2 +- src/PHONON/dynamical_matrix.h | 4 ++-- src/PHONON/third_order.h | 4 ++-- src/PLUGIN/plugin.h | 2 +- src/REPLICA/hyper.h | 4 ++-- src/REPLICA/neb.h | 4 ++-- src/REPLICA/prd.h | 4 ++-- src/REPLICA/tad.h | 4 ++-- src/REPLICA/temper.h | 4 ++-- src/REPLICA/temper_grem.h | 4 ++-- src/REPLICA/temper_npt.h | 4 ++-- src/SPIN/neb_spin.h | 4 ++-- src/accelerator_kokkos.h | 7 ------- src/balance.h | 4 ++-- src/change_box.h | 2 +- src/citeme.h | 2 +- src/create_atoms.h | 2 +- src/create_bonds.h | 2 +- src/create_box.h | 2 +- src/delete_atoms.h | 2 +- src/delete_bonds.h | 2 +- src/deprecated.h | 2 +- src/displace_atoms.h | 4 ++-- src/info.h | 2 +- src/minimize.h | 2 +- src/read_data.h | 4 ++-- src/read_dump.h | 4 ++-- src/read_restart.h | 2 +- src/replicate.h | 2 +- src/rerun.h | 2 +- src/reset_atom_ids.h | 2 +- src/reset_mol_ids.h | 4 ++-- src/run.h | 2 +- src/set.h | 2 +- src/velocity.h | 2 +- src/write_coeff.h | 2 +- src/write_data.h | 2 +- src/write_dump.h | 2 +- src/write_restart.h | 2 +- 44 files changed, 58 insertions(+), 65 deletions(-) diff --git a/src/COLVARS/group_ndx.h b/src/COLVARS/group_ndx.h index 4c1e7e93e5..c1d7c5298b 100644 --- a/src/COLVARS/group_ndx.h +++ b/src/COLVARS/group_ndx.h @@ -29,7 +29,7 @@ namespace LAMMPS_NS { class Group2Ndx : public Command { public: Group2Ndx(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; private: void write_group(FILE *, int); diff --git a/src/COLVARS/ndx_group.h b/src/COLVARS/ndx_group.h index 85831accaf..ef30f53b17 100644 --- a/src/COLVARS/ndx_group.h +++ b/src/COLVARS/ndx_group.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class Ndx2Group : public Command { public: Ndx2Group(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; private: void create(const std::string &, const std::vector &); diff --git a/src/KIM/kim_command.h b/src/KIM/kim_command.h index 98a9420c31..25611d4b50 100644 --- a/src/KIM/kim_command.h +++ b/src/KIM/kim_command.h @@ -69,7 +69,7 @@ namespace LAMMPS_NS { class KimCommand : public Command { public: KimCommand(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/MESSAGE/message.h b/src/MESSAGE/message.h index cb86fa62e5..ff832f1145 100644 --- a/src/MESSAGE/message.h +++ b/src/MESSAGE/message.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Message : public Command { public: Message(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; private: void quit(); diff --git a/src/MESSAGE/server.h b/src/MESSAGE/server.h index c06aaa6f12..e82ac7e8b0 100644 --- a/src/MESSAGE/server.h +++ b/src/MESSAGE/server.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Server : public Command { public: Server(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/MESSAGE/server_md.h b/src/MESSAGE/server_md.h index e50027f0ea..bd227286b4 100644 --- a/src/MESSAGE/server_md.h +++ b/src/MESSAGE/server_md.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class ServerMD : protected Pointers { public: ServerMD(class LAMMPS *); - ~ServerMD(); + ~ServerMD() override; void loop(); private: diff --git a/src/PHONON/dynamical_matrix.h b/src/PHONON/dynamical_matrix.h index cc70cd026e..122d158d55 100644 --- a/src/PHONON/dynamical_matrix.h +++ b/src/PHONON/dynamical_matrix.h @@ -18,8 +18,8 @@ namespace LAMMPS_NS { class DynamicalMatrix : public Command { public: DynamicalMatrix(class LAMMPS *); - virtual ~DynamicalMatrix(); - void command(int, char **); + ~DynamicalMatrix() override; + void command(int, char **) override; void setup(); protected: diff --git a/src/PHONON/third_order.h b/src/PHONON/third_order.h index fa8741cfc6..1961d52355 100644 --- a/src/PHONON/third_order.h +++ b/src/PHONON/third_order.h @@ -18,8 +18,8 @@ namespace LAMMPS_NS { class ThirdOrder : public Command { public: ThirdOrder(class LAMMPS *); - virtual ~ThirdOrder(); - void command(int, char **); + ~ThirdOrder() override; + void command(int, char **) override; void setup(); protected: diff --git a/src/PLUGIN/plugin.h b/src/PLUGIN/plugin.h index d98430bae6..cc1a3bf2dc 100644 --- a/src/PLUGIN/plugin.h +++ b/src/PLUGIN/plugin.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class Plugin : public Command { public: Plugin(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; void plugin_load(const char *, LAMMPS *); diff --git a/src/REPLICA/hyper.h b/src/REPLICA/hyper.h index c17fc7a6d8..a6a7cc45da 100644 --- a/src/REPLICA/hyper.h +++ b/src/REPLICA/hyper.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class Hyper : public Command { public: Hyper(class LAMMPS *); - ~Hyper() {} - void command(int, char **); + ~Hyper() override {} + void command(int, char **) override; private: int me, nprocs; diff --git a/src/REPLICA/neb.h b/src/REPLICA/neb.h index 26d3b72541..c99ab60904 100644 --- a/src/REPLICA/neb.h +++ b/src/REPLICA/neb.h @@ -28,8 +28,8 @@ class NEB : public Command { public: NEB(class LAMMPS *); NEB(class LAMMPS *, double, double, int, int, int, double *, double *); - ~NEB(); - void command(int, char **); // process neb command + ~NEB() override; + void command(int, char **) override; // process neb command void run(); // run NEB double ebf, ebr; // forward and reverse energy barriers diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h index a5342c47b8..5166380b1c 100644 --- a/src/REPLICA/prd.h +++ b/src/REPLICA/prd.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PRD : public Command { public: PRD(class LAMMPS *); - ~PRD() {} - void command(int, char **); + ~PRD() override {} + void command(int, char **) override; private: int me, nprocs; diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h index 7e528acfbb..e0432db9fd 100644 --- a/src/REPLICA/tad.h +++ b/src/REPLICA/tad.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class TAD : public Command { public: TAD(class LAMMPS *); - ~TAD(); - void command(int, char **); + ~TAD() override; + void command(int, char **) override; private: int me, nprocs; diff --git a/src/REPLICA/temper.h b/src/REPLICA/temper.h index d7ebf79c33..0bce33a5f8 100644 --- a/src/REPLICA/temper.h +++ b/src/REPLICA/temper.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class Temper : public Command { public: Temper(class LAMMPS *); - ~Temper(); - void command(int, char **); + ~Temper() override; + void command(int, char **) override; private: int me, me_universe; // my proc ID in world and universe diff --git a/src/REPLICA/temper_grem.h b/src/REPLICA/temper_grem.h index cdcf6a26aa..2aea1e1414 100644 --- a/src/REPLICA/temper_grem.h +++ b/src/REPLICA/temper_grem.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class TemperGrem : public Command { public: TemperGrem(class LAMMPS *); - ~TemperGrem(); - void command(int, char **); + ~TemperGrem() override; + void command(int, char **) override; private: int me, me_universe; // my proc ID in world and universe diff --git a/src/REPLICA/temper_npt.h b/src/REPLICA/temper_npt.h index 47eec7053b..b6f37ea8c1 100644 --- a/src/REPLICA/temper_npt.h +++ b/src/REPLICA/temper_npt.h @@ -28,8 +28,8 @@ namespace LAMMPS_NS { class TemperNPT : public Command { public: TemperNPT(class LAMMPS *); - ~TemperNPT(); - void command(int, char **); + ~TemperNPT() override; + void command(int, char **) override; private: int me, me_universe; // my proc ID in world and universe diff --git a/src/SPIN/neb_spin.h b/src/SPIN/neb_spin.h index 8de68830d6..b667215520 100644 --- a/src/SPIN/neb_spin.h +++ b/src/SPIN/neb_spin.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class NEBSpin : public Command { public: NEBSpin(class LAMMPS *); - ~NEBSpin(); - void command(int, char **); // process neb/spin command + ~NEBSpin() override; + void command(int, char **) override; // process neb/spin command void run(); // run NEBSpin double ebf, ebr; // forward and reverse energy barriers diff --git a/src/accelerator_kokkos.h b/src/accelerator_kokkos.h index 0cea855f1e..a6cfdd12df 100644 --- a/src/accelerator_kokkos.h +++ b/src/accelerator_kokkos.h @@ -66,7 +66,6 @@ class AtomKokkos : public Atom { public: tagint **k_special; AtomKokkos(class LAMMPS *lmp) : Atom(lmp) {} - ~AtomKokkos() {} void sync(const ExecutionSpace /*space*/, unsigned int /*mask*/) {} void modified(const ExecutionSpace /*space*/, unsigned int /*mask*/) {} }; @@ -74,39 +73,33 @@ class AtomKokkos : public Atom { class CommKokkos : public CommBrick { public: CommKokkos(class LAMMPS *lmp) : CommBrick(lmp) {} - ~CommKokkos() {} }; class CommTiledKokkos : public CommTiled { public: CommTiledKokkos(class LAMMPS *lmp) : CommTiled(lmp) {} CommTiledKokkos(class LAMMPS *lmp, Comm *oldcomm) : CommTiled(lmp, oldcomm) {} - ~CommTiledKokkos() {} }; class DomainKokkos : public Domain { public: DomainKokkos(class LAMMPS *lmp) : Domain(lmp) {} - ~DomainKokkos() {} }; class NeighborKokkos : public Neighbor { public: NeighborKokkos(class LAMMPS *lmp) : Neighbor(lmp) {} - ~NeighborKokkos() {} }; class MemoryKokkos : public Memory { public: MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} - ~MemoryKokkos() {} void grow_kokkos(tagint **, tagint **, int, int, const char *) {} }; class ModifyKokkos : public Modify { public: ModifyKokkos(class LAMMPS *lmp) : Modify(lmp) {} - ~ModifyKokkos() {} }; class DAT { diff --git a/src/balance.h b/src/balance.h index df8ac307b4..f7a3c60df5 100644 --- a/src/balance.h +++ b/src/balance.h @@ -33,8 +33,8 @@ class Balance : public Command { int outflag; // 1 for output of balance results to file Balance(class LAMMPS *); - ~Balance(); - void command(int, char **); + ~Balance() override; + void command(int, char **) override; void options(int, int, char **); void weight_storage(char *); void init_imbalance(int); diff --git a/src/change_box.h b/src/change_box.h index cfa3a2f3e1..772a8150e5 100644 --- a/src/change_box.h +++ b/src/change_box.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class ChangeBox : public Command { public: ChangeBox(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; private: int scaleflag; diff --git a/src/citeme.h b/src/citeme.h index 8f0e6c4bca..0d9f40f57f 100644 --- a/src/citeme.h +++ b/src/citeme.h @@ -22,7 +22,7 @@ namespace LAMMPS_NS { class CiteMe : protected Pointers { public: CiteMe(class LAMMPS *, int, int, const char *); - virtual ~CiteMe(); + ~CiteMe() override; void add(const std::string &); // register publication for output void flush(); // flush buffers to screen and logfile enum { VERBOSE, TERSE }; diff --git a/src/create_atoms.h b/src/create_atoms.h index 1d62c801e8..5b71394447 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class CreateAtoms : public Command { public: CreateAtoms(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; private: int me, nprocs; diff --git a/src/create_bonds.h b/src/create_bonds.h index eae90bef7f..aec0f14c6a 100644 --- a/src/create_bonds.h +++ b/src/create_bonds.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class CreateBonds : public Command { public: CreateBonds(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; private: int igroup, group1bit, group2bit; diff --git a/src/create_box.h b/src/create_box.h index c5a24f280a..dd74755cf8 100644 --- a/src/create_box.h +++ b/src/create_box.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class CreateBox : public Command { public: CreateBox(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/delete_atoms.h b/src/delete_atoms.h index 07d1b1352a..161427e4ef 100644 --- a/src/delete_atoms.h +++ b/src/delete_atoms.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DeleteAtoms : public Command { public: DeleteAtoms(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; private: int *dlist; diff --git a/src/delete_bonds.h b/src/delete_bonds.h index 6146104161..aff891e1ca 100644 --- a/src/delete_bonds.h +++ b/src/delete_bonds.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DeleteBonds : public Command { public: DeleteBonds(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/deprecated.h b/src/deprecated.h index b06599edf4..609d0f9326 100644 --- a/src/deprecated.h +++ b/src/deprecated.h @@ -33,7 +33,7 @@ namespace LAMMPS_NS { class Deprecated : public Command { public: Deprecated(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/displace_atoms.h b/src/displace_atoms.h index e1a0947125..3d04262a73 100644 --- a/src/displace_atoms.h +++ b/src/displace_atoms.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class DisplaceAtoms : public Command { public: DisplaceAtoms(class LAMMPS *); - ~DisplaceAtoms(); - void command(int, char **); + ~DisplaceAtoms() override; + void command(int, char **) override; private: int igroup, groupbit; diff --git a/src/info.h b/src/info.h index c1e10a2336..8c2ebb1167 100644 --- a/src/info.h +++ b/src/info.h @@ -29,7 +29,7 @@ namespace LAMMPS_NS { class Info : public Command { public: Info(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; bool is_active(const char *, const char *); bool is_defined(const char *, const char *); diff --git a/src/minimize.h b/src/minimize.h index f1dc539388..8fa1e6170b 100644 --- a/src/minimize.h +++ b/src/minimize.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Minimize : public Command { public: Minimize(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/read_data.h b/src/read_data.h index 090e70484b..2466f2df19 100644 --- a/src/read_data.h +++ b/src/read_data.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class ReadData : public Command { public: ReadData(class LAMMPS *); - ~ReadData(); - void command(int, char **); + ~ReadData() override; + void command(int, char **) override; static bool is_data_section(const std::string &); private: diff --git a/src/read_dump.h b/src/read_dump.h index 92e5e69c47..21c9f8d862 100644 --- a/src/read_dump.h +++ b/src/read_dump.h @@ -29,8 +29,8 @@ namespace LAMMPS_NS { class ReadDump : public Command { public: ReadDump(class LAMMPS *); - ~ReadDump(); - void command(int, char **); + ~ReadDump() override; + void command(int, char **) override; void store_files(int, char **); void setup_reader(int, char **); diff --git a/src/read_restart.h b/src/read_restart.h index 9de52a5f28..88b8709744 100644 --- a/src/read_restart.h +++ b/src/read_restart.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class ReadRestart : public Command { public: ReadRestart(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; private: int me, nprocs; diff --git a/src/replicate.h b/src/replicate.h index 48abd7b4be..9eaae1d763 100644 --- a/src/replicate.h +++ b/src/replicate.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Replicate : public Command { public: Replicate(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/rerun.h b/src/rerun.h index 272df6bb0a..a3474a1827 100644 --- a/src/rerun.h +++ b/src/rerun.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Rerun : public Command { public: Rerun(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/reset_atom_ids.h b/src/reset_atom_ids.h index b62dc25b77..abb20bae4f 100644 --- a/src/reset_atom_ids.h +++ b/src/reset_atom_ids.h @@ -43,7 +43,7 @@ class ResetIDs : public Command { #endif ResetIDs(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; private: bigint binlo, binhi; diff --git a/src/reset_mol_ids.h b/src/reset_mol_ids.h index 6fff49bb72..787edfc4f6 100644 --- a/src/reset_mol_ids.h +++ b/src/reset_mol_ids.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class ResetMolIDs : public Command { public: ResetMolIDs(class LAMMPS *); - ~ResetMolIDs(); - void command(int, char **); + ~ResetMolIDs() override; + void command(int, char **) override; void create_computes(char *, char *); void reset(); diff --git a/src/run.h b/src/run.h index 55af0cf6a0..6b0df49fff 100644 --- a/src/run.h +++ b/src/run.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Run : public Command { public: Run(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/set.h b/src/set.h index f3ccefbd9d..8831ad131c 100644 --- a/src/set.h +++ b/src/set.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Set : public Command { public: Set(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; private: char *id; diff --git a/src/velocity.h b/src/velocity.h index cce8508021..2f27cd9152 100644 --- a/src/velocity.h +++ b/src/velocity.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Velocity : public Command { public: Velocity(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; void init_external(const char *); void options(int, char **); void create(double, int); diff --git a/src/write_coeff.h b/src/write_coeff.h index d6a447080f..5381a9fe0b 100644 --- a/src/write_coeff.h +++ b/src/write_coeff.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class WriteCoeff : public Command { public: WriteCoeff(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/write_data.h b/src/write_data.h index d62f048894..023d270b43 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class WriteData : public Command { public: WriteData(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; void write(const std::string &); private: diff --git a/src/write_dump.h b/src/write_dump.h index bea5660a29..c2e75b2484 100644 --- a/src/write_dump.h +++ b/src/write_dump.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class WriteDump : public Command { public: WriteDump(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **); + void command(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/write_restart.h b/src/write_restart.h index 54d90405b2..a01d61863c 100644 --- a/src/write_restart.h +++ b/src/write_restart.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class WriteRestart : public Command { public: WriteRestart(class LAMMPS *); - void command(int, char **); + void command(int, char **) override; void multiproc_options(int, int, int, char **); void write(const std::string &); From 5c62dc0986484625f25f1e36908fbe4c31fbf854 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 16:39:36 -0500 Subject: [PATCH 057/174] Apply override to Comm classes --- src/KOKKOS/comm_kokkos.h | 38 +++++++++++++++--------------- src/KOKKOS/comm_tiled_kokkos.h | 32 +++++++++++++------------- src/comm_brick.h | 40 ++++++++++++++++---------------- src/comm_tiled.h | 42 +++++++++++++++++----------------- 4 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/KOKKOS/comm_kokkos.h b/src/KOKKOS/comm_kokkos.h index aeacdb71cd..91d0c9de0b 100644 --- a/src/KOKKOS/comm_kokkos.h +++ b/src/KOKKOS/comm_kokkos.h @@ -34,24 +34,24 @@ class CommKokkos : public CommBrick { bool reverse_comm_on_host; CommKokkos(class LAMMPS *); - ~CommKokkos(); - void init(); + ~CommKokkos() override; + void init() override; - void forward_comm(int dummy = 0); // forward comm of atom coords - void reverse_comm(); // reverse comm of atom coords - void exchange(); // move atoms to new procs - void borders(); // setup list of atoms to comm + void forward_comm(int dummy = 0) override; // forward comm of atom coords + void reverse_comm() override; // reverse comm of atom coords + void exchange() override; // move atoms to new procs + void borders() override; // setup list of atoms to comm - void forward_comm_pair(class Pair *); // forward comm from a Pair - void reverse_comm_pair(class Pair *); // reverse comm from a Pair - void forward_comm_fix(class Fix *, int size=0); // forward comm from a Fix - void reverse_comm_fix(class Fix *, int size=0); // reverse comm from a Fix - void forward_comm_compute(class Compute *); // forward from a Compute - void reverse_comm_compute(class Compute *); // reverse from a Compute - void forward_comm_dump(class Dump *); // forward comm from a Dump - void reverse_comm_dump(class Dump *); // reverse comm from a Dump + void forward_comm_pair(class Pair *) override; // forward comm from a Pair + void reverse_comm_pair(class Pair *) override; // reverse comm from a Pair + void forward_comm_fix(class Fix *, int size=0) override; // forward comm from a Fix + void reverse_comm_fix(class Fix *, int size=0) override; // reverse comm from a Fix + void forward_comm_compute(class Compute *) override; // forward from a Compute + void reverse_comm_compute(class Compute *) override; // reverse from a Compute + void forward_comm_dump(class Dump *) override; // forward comm from a Dump + void reverse_comm_dump(class Dump *) override; // reverse comm from a Dump - void forward_comm_array(int, double **); // forward comm of array + void forward_comm_array(int, double **) override; // forward comm of array template void forward_comm_device(int dummy); template void reverse_comm_device(); @@ -85,12 +85,12 @@ class CommKokkos : public CommBrick { void grow_buf_pair(int); void grow_buf_fix(int); - void grow_send(int, int); - void grow_recv(int); + void grow_send(int, int) override; + void grow_recv(int) override; void grow_send_kokkos(int, int, ExecutionSpace space = Host); void grow_recv_kokkos(int, ExecutionSpace space = Host); - void grow_list(int, int); - void grow_swap(int); + void grow_list(int, int) override; + void grow_swap(int) override; void copy_swap_info(); }; diff --git a/src/KOKKOS/comm_tiled_kokkos.h b/src/KOKKOS/comm_tiled_kokkos.h index 8877feec75..90d508ec4b 100644 --- a/src/KOKKOS/comm_tiled_kokkos.h +++ b/src/KOKKOS/comm_tiled_kokkos.h @@ -24,28 +24,28 @@ class CommTiledKokkos : public CommTiled { public: CommTiledKokkos(class LAMMPS *); CommTiledKokkos(class LAMMPS *, class Comm *); - virtual ~CommTiledKokkos(); + ~CommTiledKokkos() override; - void forward_comm(int dummy = 0); // forward comm of atom coords - void reverse_comm(); // reverse comm of forces - void exchange(); // move atoms to new procs - void borders(); // setup list of atoms to comm + void forward_comm(int dummy = 0) override; // forward comm of atom coords + void reverse_comm() override; // reverse comm of forces + void exchange() override; // move atoms to new procs + void borders() override; // setup list of atoms to comm - void forward_comm_pair(class Pair *); // forward comm from a Pair - void reverse_comm_pair(class Pair *); // reverse comm from a Pair - void forward_comm_fix(class Fix *, int size=0); + void forward_comm_pair(class Pair *) override; // forward comm from a Pair + void reverse_comm_pair(class Pair *) override; // reverse comm from a Pair + void forward_comm_fix(class Fix *, int size=0) override; // forward comm from a Fix - void reverse_comm_fix(class Fix *, int size=0); + void reverse_comm_fix(class Fix *, int size=0) override; // reverse comm from a Fix - void reverse_comm_fix_variable(class Fix *); + void reverse_comm_fix_variable(class Fix *) override; // variable size reverse comm from a Fix - void forward_comm_compute(class Compute *); // forward from a Compute - void reverse_comm_compute(class Compute *); // reverse from a Compute - void forward_comm_dump(class Dump *); // forward comm from a Dump - void reverse_comm_dump(class Dump *); // reverse comm from a Dump + void forward_comm_compute(class Compute *) override; // forward from a Compute + void reverse_comm_compute(class Compute *) override; // reverse from a Compute + void forward_comm_dump(class Dump *) override; // forward comm from a Dump + void reverse_comm_dump(class Dump *) override; // reverse comm from a Dump - void forward_comm_array(int, double **); // forward comm of array - int exchange_variable(int, double *, double *&); // exchange on neigh stencil + void forward_comm_array(int, double **) override; // forward comm of array + int exchange_variable(int, double *, double *&) override; // exchange on neigh stencil private: diff --git a/src/comm_brick.h b/src/comm_brick.h index dbb082a70b..43325846e5 100644 --- a/src/comm_brick.h +++ b/src/comm_brick.h @@ -22,32 +22,32 @@ class CommBrick : public Comm { public: CommBrick(class LAMMPS *); CommBrick(class LAMMPS *, class Comm *); - virtual ~CommBrick(); + ~CommBrick() override; - virtual void init(); - virtual void setup(); // setup 3d comm pattern - virtual void forward_comm(int dummy = 0); // forward comm of atom coords - virtual void reverse_comm(); // reverse comm of forces - virtual void exchange(); // move atoms to new procs - virtual void borders(); // setup list of atoms to comm + void init() override; + void setup() override; // setup 3d comm pattern + void forward_comm(int dummy = 0) override; // forward comm of atom coords + void reverse_comm() override; // reverse comm of forces + void exchange() override; // move atoms to new procs + void borders() override; // setup list of atoms to comm - virtual void forward_comm_pair(class Pair *); // forward comm from a Pair - virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair - virtual void forward_comm_fix(class Fix *, int size = 0); + void forward_comm_pair(class Pair *) override; // forward comm from a Pair + void reverse_comm_pair(class Pair *) override; // reverse comm from a Pair + void forward_comm_fix(class Fix *, int size = 0) override; // forward comm from a Fix - virtual void reverse_comm_fix(class Fix *, int size = 0); + void reverse_comm_fix(class Fix *, int size = 0) override; // reverse comm from a Fix - virtual void reverse_comm_fix_variable(class Fix *); + void reverse_comm_fix_variable(class Fix *) override; // variable size reverse comm from a Fix - virtual void forward_comm_compute(class Compute *); // forward from a Compute - virtual void reverse_comm_compute(class Compute *); // reverse from a Compute - virtual void forward_comm_dump(class Dump *); // forward comm from a Dump - virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump + void forward_comm_compute(class Compute *) override; // forward from a Compute + void reverse_comm_compute(class Compute *) override; // reverse from a Compute + void forward_comm_dump(class Dump *) override; // forward comm from a Dump + void reverse_comm_dump(class Dump *) override; // reverse comm from a Dump - virtual void forward_comm_array(int, double **); // forward comm of array - int exchange_variable(int, double *, double *&); // exchange on neigh stencil - void *extract(const char *, int &); - virtual double memory_usage(); + void forward_comm_array(int, double **) override; // forward comm of array + int exchange_variable(int, double *, double *&) override; // exchange on neigh stencil + void *extract(const char *, int &) override; + double memory_usage() override; protected: int nswap; // # of swaps to perform = sum of maxneed diff --git a/src/comm_tiled.h b/src/comm_tiled.h index 75109e097d..2094e3e931 100644 --- a/src/comm_tiled.h +++ b/src/comm_tiled.h @@ -22,35 +22,35 @@ class CommTiled : public Comm { public: CommTiled(class LAMMPS *); CommTiled(class LAMMPS *, class Comm *); - virtual ~CommTiled(); + ~CommTiled() override; - void init(); - void setup(); // setup comm pattern - virtual void forward_comm(int dummy = 0); // forward comm of atom coords - virtual void reverse_comm(); // reverse comm of forces - virtual void exchange(); // move atoms to new procs - virtual void borders(); // setup list of atoms to comm + void init() override; + void setup() override; // setup comm pattern + void forward_comm(int dummy = 0) override; // forward comm of atom coords + void reverse_comm() override; // reverse comm of forces + void exchange() override; // move atoms to new procs + void borders() override; // setup list of atoms to comm - virtual void forward_comm_pair(class Pair *); // forward comm from a Pair - virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair - virtual void forward_comm_fix(class Fix *, int size = 0); + void forward_comm_pair(class Pair *) override; // forward comm from a Pair + void reverse_comm_pair(class Pair *) override; // reverse comm from a Pair + void forward_comm_fix(class Fix *, int size = 0) override; // forward comm from a Fix - virtual void reverse_comm_fix(class Fix *, int size = 0); + void reverse_comm_fix(class Fix *, int size = 0) override; // reverse comm from a Fix - virtual void reverse_comm_fix_variable(class Fix *); + void reverse_comm_fix_variable(class Fix *) override; // variable size reverse comm from a Fix - virtual void forward_comm_compute(class Compute *); // forward from a Compute - virtual void reverse_comm_compute(class Compute *); // reverse from a Compute - virtual void forward_comm_dump(class Dump *); // forward comm from a Dump - virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump + void forward_comm_compute(class Compute *) override; // forward from a Compute + void reverse_comm_compute(class Compute *) override; // reverse from a Compute + void forward_comm_dump(class Dump *) override; // forward comm from a Dump + void reverse_comm_dump(class Dump *) override; // reverse comm from a Dump - virtual void forward_comm_array(int, double **); // forward comm of array - virtual int exchange_variable(int, double *, double *&); // exchange on neigh stencil + void forward_comm_array(int, double **) override; // forward comm of array + int exchange_variable(int, double *, double *&) override; // exchange on neigh stencil - void coord2proc_setup(); - int coord2proc(double *, int &, int &, int &); + void coord2proc_setup() override; + int coord2proc(double *, int &, int &, int &) override; - double memory_usage(); + double memory_usage() override; private: int nswap; // # of swaps to perform = 2*dim From 7c9b0c1e8e9a161e18181025a89d5b923b7bb4c8 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 16:43:04 -0500 Subject: [PATCH 058/174] Apply override to more core classes --- src/imbalance.h | 1 - src/imbalance_group.h | 8 ++++---- src/imbalance_neigh.h | 7 +++---- src/imbalance_store.h | 8 ++++---- src/imbalance_time.h | 9 ++++----- src/imbalance_var.h | 10 +++++----- src/irregular.h | 2 +- src/lattice.h | 2 +- src/neigh_request.h | 2 +- src/random_mars.h | 2 +- src/rcb.h | 2 +- src/special.h | 2 +- 12 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/imbalance.h b/src/imbalance.h index 06cbc97933..72037d110c 100644 --- a/src/imbalance.h +++ b/src/imbalance.h @@ -22,7 +22,6 @@ namespace LAMMPS_NS { class Imbalance : protected Pointers { public: Imbalance(class LAMMPS *); - virtual ~Imbalance(){}; // parse options. return number of arguments consumed (required) virtual int options(int, char **) = 0; diff --git a/src/imbalance_group.h b/src/imbalance_group.h index 0a8eab4363..7d459491a7 100644 --- a/src/imbalance_group.h +++ b/src/imbalance_group.h @@ -21,14 +21,14 @@ namespace LAMMPS_NS { class ImbalanceGroup : public Imbalance { public: ImbalanceGroup(class LAMMPS *); - virtual ~ImbalanceGroup(); + ~ImbalanceGroup() override; // parse options, return number of arguments consumed - virtual int options(int, char **) override; + int options(int, char **) override; // compute and apply weight factors to local atom array - virtual void compute(double *) override; + void compute(double *) override; // print information about the state of this imbalance compute - virtual std::string info() override; + std::string info() override; private: int num; // number of groups with weights diff --git a/src/imbalance_neigh.h b/src/imbalance_neigh.h index e5422076fa..1d9ddfb7a3 100644 --- a/src/imbalance_neigh.h +++ b/src/imbalance_neigh.h @@ -21,15 +21,14 @@ namespace LAMMPS_NS { class ImbalanceNeigh : public Imbalance { public: ImbalanceNeigh(class LAMMPS *); - virtual ~ImbalanceNeigh() {} public: // parse options, return number of arguments consumed - virtual int options(int, char **) override; + int options(int, char **) override; // compute and apply weight factors to local atom array - virtual void compute(double *) override; + void compute(double *) override; // print information about the state of this imbalance compute - virtual std::string info() override; + std::string info() override; private: double factor; // weight factor for neighbor imbalance diff --git a/src/imbalance_store.h b/src/imbalance_store.h index 55f6873645..aa7b80bb1c 100644 --- a/src/imbalance_store.h +++ b/src/imbalance_store.h @@ -21,15 +21,15 @@ namespace LAMMPS_NS { class ImbalanceStore : public Imbalance { public: ImbalanceStore(class LAMMPS *); - virtual ~ImbalanceStore(); + ~ImbalanceStore() override; public: // parse options, return number of arguments consumed - virtual int options(int, char **) override; + int options(int, char **) override; // compute per-atom imbalance and apply to weight array - virtual void compute(double *) override; + void compute(double *) override; // print information about the state of this imbalance compute (required) - virtual std::string info() override; + std::string info() override; private: char *name; // property name diff --git a/src/imbalance_time.h b/src/imbalance_time.h index cd000a6c4f..078124853a 100644 --- a/src/imbalance_time.h +++ b/src/imbalance_time.h @@ -21,17 +21,16 @@ namespace LAMMPS_NS { class ImbalanceTime : public Imbalance { public: ImbalanceTime(class LAMMPS *); - virtual ~ImbalanceTime() {} public: // parse options, return number of arguments consumed - virtual int options(int, char **) override; + int options(int, char **) override; // reinitialize internal data - virtual void init(int) override; + void init(int) override; // compute and apply weight factors to local atom array - virtual void compute(double *) override; + void compute(double *) override; // print information about the state of this imbalance compute - virtual std::string info() override; + std::string info() override; private: double factor; // weight factor for time imbalance diff --git a/src/imbalance_var.h b/src/imbalance_var.h index d1959f311d..dff399dee9 100644 --- a/src/imbalance_var.h +++ b/src/imbalance_var.h @@ -21,17 +21,17 @@ namespace LAMMPS_NS { class ImbalanceVar : public Imbalance { public: ImbalanceVar(class LAMMPS *); - virtual ~ImbalanceVar(); + ~ImbalanceVar() override; public: // parse options. return number of arguments consumed. - virtual int options(int, char **) override; + int options(int, char **) override; // re-initialize internal data, e.g. variable ID - virtual void init(int) override; + void init(int) override; // compute per-atom imbalance and apply to weight array - virtual void compute(double *) override; + void compute(double *) override; // print information about the state of this imbalance compute (required) - virtual std::string info() override; + std::string info() override; private: char *name; // variable name diff --git a/src/irregular.h b/src/irregular.h index f874a82c57..b1abab67f1 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -27,7 +27,7 @@ class Irregular : protected Pointers { #endif Irregular(class LAMMPS *); - ~Irregular(); + ~Irregular() override; void migrate_atoms(int sortflag = 0, int preassign = 0, int *procassign = nullptr); int migrate_check(); int create_data(int, int *, int sortflag = 0); diff --git a/src/lattice.h b/src/lattice.h index 07df77e630..1e81401240 100644 --- a/src/lattice.h +++ b/src/lattice.h @@ -30,7 +30,7 @@ class Lattice : protected Pointers { // within unit cell (0 <= coord < 1) Lattice(class LAMMPS *, int, char **); - ~Lattice(); + ~Lattice() override; void lattice2box(double &, double &, double &); void box2lattice(double &, double &, double &); void bbox(int, double, double, double, double &, double &, double &, double &, double &, diff --git a/src/neigh_request.h b/src/neigh_request.h index 4bdc368317..ff86cfa7fe 100644 --- a/src/neigh_request.h +++ b/src/neigh_request.h @@ -112,7 +112,7 @@ class NeighRequest : protected Pointers { // methods NeighRequest(class LAMMPS *); - ~NeighRequest(); + ~NeighRequest() override; void archive(); int identical(NeighRequest *); int same_skip(NeighRequest *); diff --git a/src/random_mars.h b/src/random_mars.h index ea241d4501..f2b9e17e8b 100644 --- a/src/random_mars.h +++ b/src/random_mars.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class RanMars : protected Pointers { public: RanMars(class LAMMPS *, int); - ~RanMars(); + ~RanMars() override; double uniform(); double gaussian(); double gaussian(double mu, double sigma); diff --git a/src/rcb.h b/src/rcb.h index 4201247c59..e6f187799a 100644 --- a/src/rcb.h +++ b/src/rcb.h @@ -39,7 +39,7 @@ class RCB : protected Pointers { int *sendindex; // index of dot in receiver's nfinal list RCB(class LAMMPS *); - ~RCB(); + ~RCB() override; void compute(int, int, double **, double *, double *, double *); void compute_old(int, int, double **, double *, double *, double *); void invert(int sortflag = 0); diff --git a/src/special.h b/src/special.h index 8fb39ea563..58ee0cef3f 100644 --- a/src/special.h +++ b/src/special.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class Special : protected Pointers { public: Special(class LAMMPS *); - ~Special(); + ~Special() override; void build(); private: From 49dca516ea74d8d675f5fb534f790e1550485a57 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 20 Jan 2022 16:48:44 -0500 Subject: [PATCH 059/174] simplify API of Force::store_style() --- src/angle_hybrid.cpp | 2 +- src/bond_hybrid.cpp | 2 +- src/dihedral_hybrid.cpp | 2 +- src/force.cpp | 16 ++++++++-------- src/force.h | 2 +- src/improper_hybrid.cpp | 2 +- src/pair_hybrid.cpp | 2 +- src/pair_hybrid_scaled.cpp | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 12bc9aa97a..41f46ae878 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -240,7 +240,7 @@ void AngleHybrid::settings(int narg, char **arg) error->all(FLERR, "Angle style hybrid cannot have none as an argument"); styles[nstyles] = force->new_angle(arg[i], 1, dummy); - force->store_style(keywords[nstyles], arg[i], 0); + keywords[nstyles] = force->store_style(arg[i], 0); istyle = i; if (strcmp(arg[i], "table") == 0) i++; diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index dad1010a1e..3139d9ecd8 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -242,7 +242,7 @@ void BondHybrid::settings(int narg, char **arg) if (strncmp(arg[i], "quartic", 7) == 0) has_quartic = m; styles[nstyles] = force->new_bond(arg[i], 1, dummy); - force->store_style(keywords[nstyles], arg[i], 0); + keywords[nstyles] = force->store_style(arg[i], 0); istyle = i; if (strcmp(arg[i], "table") == 0) i++; diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index 24a18e6783..0f72f999c9 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -241,7 +241,7 @@ void DihedralHybrid::settings(int narg, char **arg) error->all(FLERR, "Dihedral style hybrid cannot have none as an argument"); styles[nstyles] = force->new_dihedral(arg[i], 1, dummy); - force->store_style(keywords[nstyles], arg[i], 0); + keywords[nstyles] = force->store_style(arg[i], 0); istyle = i; if (strcmp(arg[i], "table") == 0) i++; diff --git a/src/force.cpp b/src/force.cpp index 6b7e9033ca..928b95ee78 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -229,7 +229,7 @@ void Force::create_pair(const std::string &style, int trysuffix) int sflag; pair = new_pair(style,trysuffix,sflag); - store_style(pair_style,style,sflag); + pair_style = store_style(style,sflag); } /* ---------------------------------------------------------------------- @@ -350,7 +350,7 @@ void Force::create_bond(const std::string &style, int trysuffix) int sflag; bond = new_bond(style,trysuffix,sflag); - store_style(bond_style,style,sflag); + bond_style = store_style(style,sflag); } /* ---------------------------------------------------------------------- @@ -427,7 +427,7 @@ void Force::create_angle(const std::string &style, int trysuffix) int sflag; angle = new_angle(style,trysuffix,sflag); - store_style(angle_style,style,sflag); + angle_style = store_style(style,sflag); } /* ---------------------------------------------------------------------- @@ -504,7 +504,7 @@ void Force::create_dihedral(const std::string &style, int trysuffix) int sflag; dihedral = new_dihedral(style,trysuffix,sflag); - store_style(dihedral_style,style,sflag); + dihedral_style = store_style(style,sflag); } /* ---------------------------------------------------------------------- @@ -581,7 +581,7 @@ void Force::create_improper(const std::string &style, int trysuffix) int sflag; improper = new_improper(style,trysuffix,sflag); - store_style(improper_style,style,sflag); + improper_style = store_style(style,sflag); } /* ---------------------------------------------------------------------- @@ -658,7 +658,7 @@ void Force::create_kspace(const std::string &style, int trysuffix) int sflag; kspace = new_kspace(style,trysuffix,sflag); - store_style(kspace_style,style,sflag); + kspace_style = store_style(style,sflag); } /* ---------------------------------------------------------------------- @@ -729,14 +729,14 @@ KSpace *Force::kspace_match(const std::string &word, int exact) if sflag = 1/2/3, append suffix or suffix2 or suffixp to style ------------------------------------------------------------------------- */ -void Force::store_style(char *&str, const std::string &style, int sflag) +char *Force::store_style(const std::string &style, int sflag) { std::string estyle = style; if (sflag == 1) estyle += std::string("/") + lmp->suffix; else if (sflag == 2) estyle += std::string("/") + lmp->suffix2; else if (sflag == 3) estyle += std::string("/") + lmp->suffixp; - str = utils::strdup(estyle); + return utils::strdup(estyle); } /* ---------------------------------------------------------------------- diff --git a/src/force.h b/src/force.h index 09e13c7bd1..cc9ad06282 100644 --- a/src/force.h +++ b/src/force.h @@ -146,7 +146,7 @@ class Force : protected Pointers { KSpace *new_kspace(const std::string &, int, int &); KSpace *kspace_match(const std::string &, int); - void store_style(char *&, const std::string &, int); + char *store_style(const std::string &, int); void set_special(int, char **); double memory_usage(); diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index d3a9403a6b..0354f8e92e 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -241,7 +241,7 @@ void ImproperHybrid::settings(int narg, char **arg) error->all(FLERR, "Improper style hybrid cannot have none as an argument"); styles[nstyles] = force->new_improper(arg[i], 1, dummy); - force->store_style(keywords[nstyles], arg[i], 0); + keywords[nstyles] = force->store_style(arg[i], 0); istyle = i; if (strcmp(arg[i], "table") == 0) i++; diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index e962e02c9e..8c0326d7b8 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -322,7 +322,7 @@ void PairHybrid::settings(int narg, char **arg) error->all(FLERR,"Pair style hybrid cannot have none as an argument"); styles[nstyles] = force->new_pair(arg[iarg],1,dummy); - force->store_style(keywords[nstyles],arg[iarg],0); + keywords[nstyles] = force->store_style(arg[iarg],0); special_lj[nstyles] = special_coul[nstyles] = nullptr; compute_tally[nstyles] = 1; diff --git a/src/pair_hybrid_scaled.cpp b/src/pair_hybrid_scaled.cpp index 0a4be44be0..68a6199e19 100644 --- a/src/pair_hybrid_scaled.cpp +++ b/src/pair_hybrid_scaled.cpp @@ -328,7 +328,7 @@ void PairHybridScaled::settings(int narg, char **arg) error->all(FLERR, "Pair style hybrid/scaled cannot have none as an argument"); styles[nstyles] = force->new_pair(arg[iarg], 1, dummy); - force->store_style(keywords[nstyles], arg[iarg], 0); + keywords[nstyles] = force->store_style(arg[iarg], 0); special_lj[nstyles] = special_coul[nstyles] = nullptr; compute_tally[nstyles] = 1; From 4104353d7a2971cf9cde79e20341b26a9a1cbcc6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 20 Jan 2022 16:55:59 -0500 Subject: [PATCH 060/174] plug memory leak --- src/read_data.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index 89b3ecadec..dda418b8a2 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -903,23 +903,28 @@ void ReadData::command(int narg, char **arg) // restore old styles, when reading with nocoeff flag given if (coeffflag == 0) { - if (force->pair) delete force->pair; + delete force->pair; + delete[] force->pair_style; force->pair = saved_pair; force->pair_style = saved_pair_style; - if (force->bond) delete force->bond; + delete force->bond; + delete[] force->bond_style; force->bond = saved_bond; force->bond_style = saved_bond_style; - if (force->angle) delete force->angle; + delete force->angle; + delete[] force->angle_style; force->angle = saved_angle; force->angle_style = saved_angle_style; - if (force->dihedral) delete force->dihedral; + delete force->dihedral; + delete[] force->dihedral_style; force->dihedral = saved_dihedral; force->dihedral_style = saved_dihedral_style; - if (force->improper) delete force->improper; + delete force->improper; + delete[] force->improper_style; force->improper = saved_improper; force->improper_style = saved_improper_style; From e73158bd7ee77025117ab54b0c79f7043f205ab7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 20 Jan 2022 16:56:12 -0500 Subject: [PATCH 061/174] whitespace/formatting --- src/force.cpp | 28 ++++++++++++++-------------- src/pair_hybrid.cpp | 36 ++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/force.cpp b/src/force.cpp index 928b95ee78..333a6e4715 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -133,14 +133,14 @@ void _noopt Force::create_factories() Force::~Force() { - delete [] pair_style; - delete [] bond_style; - delete [] angle_style; - delete [] dihedral_style; - delete [] improper_style; - delete [] kspace_style; + delete[] pair_style; + delete[] bond_style; + delete[] angle_style; + delete[] dihedral_style; + delete[] improper_style; + delete[] kspace_style; - delete [] pair_restart; + delete[] pair_restart; if (pair) delete pair; if (bond) delete bond; @@ -220,9 +220,9 @@ void Force::setup() void Force::create_pair(const std::string &style, int trysuffix) { - delete [] pair_style; + delete[] pair_style; if (pair) delete pair; - if (pair_restart) delete [] pair_restart; + if (pair_restart) delete[] pair_restart; pair_style = nullptr; pair = nullptr; pair_restart = nullptr; @@ -345,7 +345,7 @@ char *Force::pair_match_ptr(Pair *ptr) void Force::create_bond(const std::string &style, int trysuffix) { - delete [] bond_style; + delete[] bond_style; if (bond) delete bond; int sflag; @@ -422,7 +422,7 @@ Bond *Force::bond_match(const std::string &style) void Force::create_angle(const std::string &style, int trysuffix) { - delete [] angle_style; + delete[] angle_style; if (angle) delete angle; int sflag; @@ -499,7 +499,7 @@ Angle *Force::angle_match(const std::string &style) void Force::create_dihedral(const std::string &style, int trysuffix) { - delete [] dihedral_style; + delete[] dihedral_style; if (dihedral) delete dihedral; int sflag; @@ -576,7 +576,7 @@ Dihedral *Force::dihedral_match(const std::string &style) void Force::create_improper(const std::string &style, int trysuffix) { - delete [] improper_style; + delete[] improper_style; if (improper) delete improper; int sflag; @@ -653,7 +653,7 @@ Improper *Force::improper_match(const std::string &style) void Force::create_kspace(const std::string &style, int trysuffix) { - delete [] kspace_style; + delete[] kspace_style; if (kspace) delete kspace; int sflag; diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 8c0326d7b8..6287fb97db 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -50,20 +50,20 @@ PairHybrid::~PairHybrid() if (nstyles > 0) { for (int m = 0; m < nstyles; m++) { delete styles[m]; - delete [] keywords[m]; - if (special_lj[m]) delete [] special_lj[m]; - if (special_coul[m]) delete [] special_coul[m]; + delete[] keywords[m]; + if (special_lj[m]) delete[] special_lj[m]; + if (special_coul[m]) delete[] special_coul[m]; } } - delete [] styles; - delete [] keywords; - delete [] multiple; + delete[] styles; + delete[] keywords; + delete[] multiple; - delete [] special_lj; - delete [] special_coul; - delete [] compute_tally; + delete[] special_lj; + delete[] special_coul; + delete[] compute_tally; - delete [] svector; + delete[] svector; if (allocated) { memory->destroy(setflag); @@ -187,7 +187,7 @@ void PairHybrid::compute(int eflag, int vflag) } - delete [] saved_special; + delete[] saved_special; if (vflag_fdotr) virial_fdotr_compute(); } @@ -274,9 +274,9 @@ void PairHybrid::settings(int narg, char **arg) if (nstyles > 0) { for (int m = 0; m < nstyles; m++) { delete styles[m]; - delete [] keywords[m]; - if (special_lj[m]) delete [] special_lj[m]; - if (special_coul[m]) delete [] special_coul[m]; + delete[] keywords[m]; + if (special_lj[m]) delete[] special_lj[m]; + if (special_coul[m]) delete[] special_coul[m]; } delete[] styles; delete[] keywords; @@ -297,8 +297,8 @@ void PairHybrid::settings(int narg, char **arg) // allocate list of sub-styles as big as possibly needed if no extra args - styles = new Pair*[narg]; - keywords = new char*[narg]; + styles = new Pair *[narg]; + keywords = new char *[narg]; multiple = new int[narg]; special_lj = new double*[narg]; @@ -454,7 +454,7 @@ void PairHybrid::init_svector() single_extra = MAX(single_extra,styles[m]->single_extra); if (single_extra) { - delete [] svector; + delete[] svector; svector = new double[single_extra]; } } @@ -667,7 +667,7 @@ void PairHybrid::init_style() neighbor->requests[i]->iskip = iskip; neighbor->requests[i]->ijskip = ijskip; } else { - delete [] iskip; + delete[] iskip; memory->destroy(ijskip); } } From 586cf6c3bfec6b50a48f2dc91ca5eeda38d061d9 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 16:58:23 -0500 Subject: [PATCH 062/174] Apply override to Dump classes --- src/COMPRESS/dump_atom_gz.h | 11 +++++------ src/COMPRESS/dump_atom_zstd.h | 11 +++++------ src/COMPRESS/dump_cfg_gz.h | 11 +++++------ src/COMPRESS/dump_cfg_zstd.h | 11 +++++------ src/COMPRESS/dump_custom_gz.h | 11 +++++------ src/COMPRESS/dump_custom_zstd.h | 11 +++++------ src/COMPRESS/dump_local_gz.h | 11 +++++------ src/COMPRESS/dump_local_zstd.h | 11 +++++------ src/COMPRESS/dump_xyz_gz.h | 11 +++++------ src/COMPRESS/dump_xyz_zstd.h | 11 +++++------ src/COMPRESS/gz_file_writer.h | 12 ++++++------ src/COMPRESS/zstd_file_writer.h | 12 ++++++------ src/EXTRA-DUMP/dump_dcd.h | 16 ++++++++-------- src/EXTRA-DUMP/dump_xtc.h | 16 ++++++++-------- src/MOLFILE/dump_molfile.h | 18 ++++++++--------- src/UEF/dump_cfg_uef.h | 4 ++-- src/UEF/fix_nh_uef.h | 34 ++++++++++++++++----------------- src/dump.h | 2 +- src/dump_atom.h | 12 ++++++------ src/dump_cfg.h | 10 +++++----- src/dump_custom.h | 18 ++++++++--------- src/dump_deprecated.h | 10 +++++----- src/dump_image.h | 12 ++++++------ src/dump_local.h | 16 ++++++++-------- src/dump_movie.h | 8 ++++---- src/dump_xyz.h | 14 +++++++------- src/file_writer.h | 4 ++-- src/image.h | 4 ++-- 28 files changed, 161 insertions(+), 171 deletions(-) diff --git a/src/COMPRESS/dump_atom_gz.h b/src/COMPRESS/dump_atom_gz.h index 2b87e36f1d..b7cd1bf476 100644 --- a/src/COMPRESS/dump_atom_gz.h +++ b/src/COMPRESS/dump_atom_gz.h @@ -28,17 +28,16 @@ namespace LAMMPS_NS { class DumpAtomGZ : public DumpAtom { public: DumpAtomGZ(class LAMMPS *, int, char **); - virtual ~DumpAtomGZ() = default; protected: GzFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_atom_zstd.h b/src/COMPRESS/dump_atom_zstd.h index fb2da0c83b..9bc9796915 100644 --- a/src/COMPRESS/dump_atom_zstd.h +++ b/src/COMPRESS/dump_atom_zstd.h @@ -34,17 +34,16 @@ namespace LAMMPS_NS { class DumpAtomZstd : public DumpAtom { public: DumpAtomZstd(class LAMMPS *, int, char **); - virtual ~DumpAtomZstd() = default; protected: ZstdFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_cfg_gz.h b/src/COMPRESS/dump_cfg_gz.h index 153a4490c6..ca88600b51 100644 --- a/src/COMPRESS/dump_cfg_gz.h +++ b/src/COMPRESS/dump_cfg_gz.h @@ -28,17 +28,16 @@ namespace LAMMPS_NS { class DumpCFGGZ : public DumpCFG { public: DumpCFGGZ(class LAMMPS *, int, char **); - virtual ~DumpCFGGZ() = default; protected: GzFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_cfg_zstd.h b/src/COMPRESS/dump_cfg_zstd.h index 32013b274e..88541503f8 100644 --- a/src/COMPRESS/dump_cfg_zstd.h +++ b/src/COMPRESS/dump_cfg_zstd.h @@ -33,17 +33,16 @@ namespace LAMMPS_NS { class DumpCFGZstd : public DumpCFG { public: DumpCFGZstd(class LAMMPS *, int, char **); - virtual ~DumpCFGZstd() = default; protected: ZstdFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_custom_gz.h b/src/COMPRESS/dump_custom_gz.h index 660af8bfae..ba0a1a83fc 100644 --- a/src/COMPRESS/dump_custom_gz.h +++ b/src/COMPRESS/dump_custom_gz.h @@ -28,17 +28,16 @@ namespace LAMMPS_NS { class DumpCustomGZ : public DumpCustom { public: DumpCustomGZ(class LAMMPS *, int, char **); - virtual ~DumpCustomGZ() = default; protected: GzFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_custom_zstd.h b/src/COMPRESS/dump_custom_zstd.h index f179223265..d9b836c365 100644 --- a/src/COMPRESS/dump_custom_zstd.h +++ b/src/COMPRESS/dump_custom_zstd.h @@ -34,17 +34,16 @@ namespace LAMMPS_NS { class DumpCustomZstd : public DumpCustom { public: DumpCustomZstd(class LAMMPS *, int, char **); - virtual ~DumpCustomZstd() = default; protected: ZstdFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_local_gz.h b/src/COMPRESS/dump_local_gz.h index e2e7a028aa..b2e2c55127 100644 --- a/src/COMPRESS/dump_local_gz.h +++ b/src/COMPRESS/dump_local_gz.h @@ -28,17 +28,16 @@ namespace LAMMPS_NS { class DumpLocalGZ : public DumpLocal { public: DumpLocalGZ(class LAMMPS *, int, char **); - virtual ~DumpLocalGZ() = default; protected: GzFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_local_zstd.h b/src/COMPRESS/dump_local_zstd.h index fb4f017b3d..cc04c6512a 100644 --- a/src/COMPRESS/dump_local_zstd.h +++ b/src/COMPRESS/dump_local_zstd.h @@ -34,17 +34,16 @@ namespace LAMMPS_NS { class DumpLocalZstd : public DumpLocal { public: DumpLocalZstd(class LAMMPS *, int, char **); - virtual ~DumpLocalZstd() = default; protected: ZstdFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_xyz_gz.h b/src/COMPRESS/dump_xyz_gz.h index 62a25cfc66..714911c735 100644 --- a/src/COMPRESS/dump_xyz_gz.h +++ b/src/COMPRESS/dump_xyz_gz.h @@ -28,17 +28,16 @@ namespace LAMMPS_NS { class DumpXYZGZ : public DumpXYZ { public: DumpXYZGZ(class LAMMPS *, int, char **); - virtual ~DumpXYZGZ() = default; protected: GzFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/dump_xyz_zstd.h b/src/COMPRESS/dump_xyz_zstd.h index 110e27ab8f..fe93be1156 100644 --- a/src/COMPRESS/dump_xyz_zstd.h +++ b/src/COMPRESS/dump_xyz_zstd.h @@ -34,17 +34,16 @@ namespace LAMMPS_NS { class DumpXYZZstd : public DumpXYZ { public: DumpXYZZstd(class LAMMPS *, int, char **); - virtual ~DumpXYZZstd() = default; protected: ZstdFileWriter writer; - virtual void openfile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); - virtual void write(); + void openfile() override; + void write_header(bigint) override; + void write_data(int, double *) override; + void write() override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/COMPRESS/gz_file_writer.h b/src/COMPRESS/gz_file_writer.h index 3de1d0d2b8..2356675921 100644 --- a/src/COMPRESS/gz_file_writer.h +++ b/src/COMPRESS/gz_file_writer.h @@ -31,12 +31,12 @@ class GzFileWriter : public FileWriter { gzFile gzFp; // file pointer for the compressed output stream public: GzFileWriter(); - virtual ~GzFileWriter(); - virtual void open(const std::string &path, bool append = false) override; - virtual void close() override; - virtual void flush() override; - virtual size_t write(const void *buffer, size_t length) override; - virtual bool isopen() const override; + ~GzFileWriter() override; + void open(const std::string &path, bool append = false) override; + void close() override; + void flush() override; + size_t write(const void *buffer, size_t length) override; + bool isopen() const override; void setCompressionLevel(int level); }; diff --git a/src/COMPRESS/zstd_file_writer.h b/src/COMPRESS/zstd_file_writer.h index 3fde376b47..77b3838f83 100644 --- a/src/COMPRESS/zstd_file_writer.h +++ b/src/COMPRESS/zstd_file_writer.h @@ -42,12 +42,12 @@ class ZstdFileWriter : public FileWriter { public: ZstdFileWriter(); - virtual ~ZstdFileWriter(); - virtual void open(const std::string &path, bool append = false) override; - virtual void close() override; - virtual void flush() override; - virtual size_t write(const void *buffer, size_t length) override; - virtual bool isopen() const override; + ~ZstdFileWriter() override; + void open(const std::string &path, bool append = false) override; + void close() override; + void flush() override; + size_t write(const void *buffer, size_t length) override; + bool isopen() const override; void setCompressionLevel(int level); void setChecksum(bool enabled); diff --git a/src/EXTRA-DUMP/dump_dcd.h b/src/EXTRA-DUMP/dump_dcd.h index b445742104..e6e7e3c766 100644 --- a/src/EXTRA-DUMP/dump_dcd.h +++ b/src/EXTRA-DUMP/dump_dcd.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DumpDCD : public Dump { public: DumpDCD(LAMMPS *, int, char **); - virtual ~DumpDCD(); + ~DumpDCD() override; private: int natoms, ntotal; @@ -36,13 +36,13 @@ class DumpDCD : public Dump { float *coords, *xf, *yf, *zf; int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no - void init_style(); - void openfile(); - void write_header(bigint); - void pack(tagint *); - void write_data(int, double *); - int modify_param(int, char **); - double memory_usage(); + void init_style() override; + void openfile() override; + void write_header(bigint) override; + void pack(tagint *) override; + void write_data(int, double *) override; + int modify_param(int, char **) override; + double memory_usage() override; void write_frame(); void write_dcd_header(const char *); diff --git a/src/EXTRA-DUMP/dump_xtc.h b/src/EXTRA-DUMP/dump_xtc.h index ef26b70295..4fd5ee57ff 100644 --- a/src/EXTRA-DUMP/dump_xtc.h +++ b/src/EXTRA-DUMP/dump_xtc.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpXTC : public Dump { public: DumpXTC(class LAMMPS *, int, char **); - virtual ~DumpXTC(); + ~DumpXTC() override; private: int natoms, ntotal; @@ -39,13 +39,13 @@ class DumpXTC : public Dump { double sfactor, tfactor; // scaling factors for positions and time unit XDR xd; - void init_style(); - int modify_param(int, char **); - void openfile(); - void write_header(bigint); - void pack(tagint *); - void write_data(int, double *); - double memory_usage(); + void init_style() override; + int modify_param(int, char **) override; + void openfile() override; + void write_header(bigint) override; + void pack(tagint *) override; + void write_data(int, double *) override; + double memory_usage() override; void write_frame(); }; diff --git a/src/MOLFILE/dump_molfile.h b/src/MOLFILE/dump_molfile.h index 968ed783ca..3f627835e6 100644 --- a/src/MOLFILE/dump_molfile.h +++ b/src/MOLFILE/dump_molfile.h @@ -29,8 +29,8 @@ namespace LAMMPS_NS { class DumpMolfile : public Dump { public: DumpMolfile(LAMMPS *, int, char **); - virtual ~DumpMolfile(); - virtual void write(); + ~DumpMolfile() override; + void write() override; protected: class MolfileInterface *mf; //< handles low-level I/O @@ -46,13 +46,13 @@ class DumpMolfile : public Dump { int topology_flag; // 1 if writing topology data, 0 if not float cell[6]; // cell parameters: A, B, C, alpha, beta, gamma - virtual void init_style(); - virtual int modify_param(int, char **); - virtual void write_header(bigint){}; - virtual void pack(tagint *); - virtual void write_data(int, double *); - virtual double memory_usage(); - virtual void openfile(); + void init_style() override; + int modify_param(int, char **) override; + void write_header(bigint) override{}; + void pack(tagint *) override; + void write_data(int, double *) override; + double memory_usage() override; + void openfile() override; }; } // namespace LAMMPS_NS diff --git a/src/UEF/dump_cfg_uef.h b/src/UEF/dump_cfg_uef.h index 56df6db033..d4fa3bfc02 100644 --- a/src/UEF/dump_cfg_uef.h +++ b/src/UEF/dump_cfg_uef.h @@ -29,8 +29,8 @@ namespace LAMMPS_NS { class DumpCFGUef : public DumpCFG { public: DumpCFGUef(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg) {} - void init_style(); - void write_header(bigint); + void init_style() override; + void write_header(bigint) override; protected: int ifix_uef; diff --git a/src/UEF/fix_nh_uef.h b/src/UEF/fix_nh_uef.h index b8fb776366..8f74de7bbb 100644 --- a/src/UEF/fix_nh_uef.h +++ b/src/UEF/fix_nh_uef.h @@ -27,28 +27,28 @@ namespace UEF_utils { class FixNHUef : public FixNH { public: FixNHUef(class LAMMPS *, int, char **); - virtual ~FixNHUef(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void pre_exchange(); - virtual int pack_restart_data(double *); - virtual void restart(char *); - virtual void end_of_step(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - virtual void post_run(); + ~FixNHUef() override; + int setmask() override; + void init() override; + void setup(int) override; + void pre_exchange() override; + int pack_restart_data(double *) override; + void restart(char *) override; + void end_of_step() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void post_run() override; void get_rot(double[3][3]); void get_ext_flags(bool *); void get_box(double[3][3]); protected: - virtual void remap(); - virtual int size_restart_global(); - virtual void nve_x(); - virtual void nve_v(); + void remap() override; + int size_restart_global() override; + void nve_x() override; + void nve_v() override; void rotate_x(double[3][3]); void inv_rotate_x(double[3][3]); void rotate_v(double[3][3]); diff --git a/src/dump.h b/src/dump.h index 35da154d7c..b18b7293c0 100644 --- a/src/dump.h +++ b/src/dump.h @@ -37,7 +37,7 @@ class Dump : protected Pointers { #endif Dump(class LAMMPS *, int, char **); - virtual ~Dump(); + ~Dump() override; void init(); virtual void write(); diff --git a/src/dump_atom.h b/src/dump_atom.h index b960bf3665..1e1a9315d7 100644 --- a/src/dump_atom.h +++ b/src/dump_atom.h @@ -38,12 +38,12 @@ class DumpAtom : public Dump { char *columns; // column labels - void init_style(); - int modify_param(int, char **); - void write_header(bigint); - void pack(tagint *); - int convert_string(int, double *); - void write_data(int, double *); + void init_style() override; + int modify_param(int, char **) override; + void write_header(bigint) override; + void pack(tagint *) override; + int convert_string(int, double *) override; + void write_data(int, double *) override; void header_format_binary(); void header_unit_style_binary(); diff --git a/src/dump_cfg.h b/src/dump_cfg.h index 49699a2789..21b5396677 100644 --- a/src/dump_cfg.h +++ b/src/dump_cfg.h @@ -29,16 +29,16 @@ class DumpCFG : public DumpCustom { int multifile_override; // used by write_dump command DumpCFG(class LAMMPS *, int, char **); - virtual ~DumpCFG(); + ~DumpCFG() override; protected: char **auxname; // name strings of auxiliary properties int unwrapflag; // 1 if unwrapped coordinates are requested - void init_style(); - virtual void write_header(bigint); - int convert_string(int, double *); - virtual void write_data(int, double *); + void init_style() override; + void write_header(bigint) override; + int convert_string(int, double *) override; + void write_data(int, double *) override; typedef void (DumpCFG::*FnPtrWrite)(int, double *); FnPtrWrite write_choice; // ptr to write data functions diff --git a/src/dump_custom.h b/src/dump_custom.h index 4209d8e46f..5a99cca009 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DumpCustom : public Dump { public: DumpCustom(class LAMMPS *, int, char **); - virtual ~DumpCustom(); + ~DumpCustom() override; const char *MAGIC_STRING = "DUMPCUSTOM"; const int FORMAT_REVISION = 0x0002; @@ -97,20 +97,20 @@ class DumpCustom : public Dump { // private methods - virtual void init_style(); - virtual void write_header(bigint); - int count(); - void pack(tagint *); - virtual int convert_string(int, double *); - virtual void write_data(int, double *); - double memory_usage(); + void init_style() override; + void write_header(bigint) override; + int count() override; + void pack(tagint *) override; + int convert_string(int, double *) override; + void write_data(int, double *) override; + double memory_usage() override; int parse_fields(int, char **); int add_compute(const char *); int add_fix(const char *); int add_variable(const char *); int add_custom(const char *, int); - virtual int modify_param(int, char **); + int modify_param(int, char **) override; void header_format_binary(); void header_unit_style_binary(); diff --git a/src/dump_deprecated.h b/src/dump_deprecated.h index 811fde2edb..3e51f19dda 100644 --- a/src/dump_deprecated.h +++ b/src/dump_deprecated.h @@ -28,11 +28,11 @@ namespace LAMMPS_NS { class DumpDeprecated : public Dump { public: DumpDeprecated(class LAMMPS *, int, char **); - ~DumpDeprecated() {} - virtual void init_style() {} - virtual void write_header(bigint) {} - virtual void pack(tagint *) {} - virtual void write_data(int, double *) {} + ~DumpDeprecated() override {} + void init_style() override {} + void write_header(bigint) override {} + void pack(tagint *) override {} + void write_data(int, double *) override {} }; } // namespace LAMMPS_NS diff --git a/src/dump_image.h b/src/dump_image.h index e3bf1a9183..6c2f419f2e 100644 --- a/src/dump_image.h +++ b/src/dump_image.h @@ -29,9 +29,9 @@ class DumpImage : public DumpCustom { int multifile_override; // used by write_dump command DumpImage(class LAMMPS *, int, char **); - virtual ~DumpImage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~DumpImage() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: int filetype; @@ -91,9 +91,9 @@ class DumpImage : public DumpCustom { double **bufcopy; // buffer for communicating bond/atom info int maxbufcopy; - virtual void init_style(); - int modify_param(int, char **); - void write(); + void init_style() override; + int modify_param(int, char **) override; + void write() override; void box_center(); void view_params(); diff --git a/src/dump_local.h b/src/dump_local.h index 1bbdbb1db7..7cd441c8e7 100644 --- a/src/dump_local.h +++ b/src/dump_local.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DumpLocal : public Dump { public: DumpLocal(LAMMPS *, int, char **); - virtual ~DumpLocal(); + ~DumpLocal() override; protected: int nevery; // dump frequency to check Fix against @@ -53,13 +53,13 @@ class DumpLocal : public Dump { char **id_fix; // their IDs class Fix **fix; // list of ptrs to the Fix objects - void init_style(); - int modify_param(int, char **); - virtual void write_header(bigint); - int count(); - void pack(tagint *); - int convert_string(int, double *); - virtual void write_data(int, double *); + void init_style() override; + int modify_param(int, char **) override; + void write_header(bigint) override; + int count() override; + void pack(tagint *) override; + int convert_string(int, double *) override; + void write_data(int, double *) override; void parse_fields(int, char **); int add_compute(const char *); diff --git a/src/dump_movie.h b/src/dump_movie.h index 770193e039..dd302d40b3 100644 --- a/src/dump_movie.h +++ b/src/dump_movie.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class DumpMovie : public DumpImage { public: DumpMovie(LAMMPS *, int, char **); - virtual ~DumpMovie(); + ~DumpMovie() override; - virtual void openfile(); - virtual void init_style(); - virtual int modify_param(int, char **); + void openfile() override; + void init_style() override; + int modify_param(int, char **) override; protected: double framerate; // frame rate of animation diff --git a/src/dump_xyz.h b/src/dump_xyz.h index b517a1db13..e9d43a5d91 100644 --- a/src/dump_xyz.h +++ b/src/dump_xyz.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class DumpXYZ : public Dump { public: DumpXYZ(class LAMMPS *, int, char **); - virtual ~DumpXYZ(); + ~DumpXYZ() override; protected: int ntypes; char **typenames; - void init_style(); - void write_header(bigint); - void pack(tagint *); - int convert_string(int, double *); - void write_data(int, double *); - int modify_param(int, char **); + void init_style() override; + void write_header(bigint) override; + void pack(tagint *) override; + int convert_string(int, double *) override; + void write_data(int, double *) override; + int modify_param(int, char **) override; typedef void (DumpXYZ::*FnPtrWrite)(int, double *); FnPtrWrite write_choice; // ptr to write data functions diff --git a/src/file_writer.h b/src/file_writer.h index 42e636d16f..ff54371d2e 100644 --- a/src/file_writer.h +++ b/src/file_writer.h @@ -39,9 +39,9 @@ class FileWriterException : public std::exception { public: FileWriterException(const std::string &msg) : message(msg) {} - ~FileWriterException() noexcept {} + ~FileWriterException() noexcept override {} - virtual const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; } // namespace LAMMPS_NS diff --git a/src/image.h b/src/image.h index f9937cacfa..9eb5c899cb 100644 --- a/src/image.h +++ b/src/image.h @@ -35,7 +35,7 @@ class Image : protected Pointers { int background[3]; // RGB values of background Image(class LAMMPS *, int); - ~Image(); + ~Image() override; void buffers(); void clear(); void merge(); @@ -150,7 +150,7 @@ class ColorMap : protected Pointers { int dynamic; // 0/1 if lo/hi bounds are static/dynamic ColorMap(class LAMMPS *, class Image *); - ~ColorMap(); + ~ColorMap() override; int reset(int, char **); int minmax(double, double); double *value2color(double); From 5e37f9d5a7a0177729601179cdc6f2431f2b4141 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 17:14:33 -0500 Subject: [PATCH 063/174] Apply override to KSpace classes --- src/DIELECTRIC/msm_dielectric.h | 6 +-- src/DIELECTRIC/pppm_dielectric.h | 10 ++--- src/DIELECTRIC/pppm_disp_dielectric.h | 12 +++--- src/GPU/pppm_gpu.h | 26 +++++------ src/INTEL/pppm_disp_intel.h | 6 +-- src/INTEL/pppm_intel.h | 10 ++--- src/KOKKOS/fft3d_kokkos.h | 2 +- src/KOKKOS/gridcomm_kokkos.h | 8 ++-- src/KOKKOS/pppm_kokkos.h | 62 +++++++++++++-------------- src/KOKKOS/remap_kokkos.h | 2 +- src/KSPACE/ewald.h | 14 +++--- src/KSPACE/ewald_dipole.h | 10 ++--- src/KSPACE/ewald_dipole_spin.h | 10 ++--- src/KSPACE/ewald_disp.h | 12 +++--- src/KSPACE/fft3d_wrap.h | 2 +- src/KSPACE/msm.h | 22 +++++----- src/KSPACE/msm_cg.h | 8 ++-- src/KSPACE/pppm.h | 28 ++++++------ src/KSPACE/pppm_cg.h | 22 +++++----- src/KSPACE/pppm_dipole.h | 40 ++++++++--------- src/KSPACE/pppm_dipole_spin.h | 8 ++-- src/KSPACE/pppm_disp.h | 26 +++++------ src/KSPACE/pppm_disp_tip4p.h | 16 +++---- src/KSPACE/pppm_stagger.h | 28 ++++++------ src/KSPACE/pppm_tip4p.h | 13 +++--- src/KSPACE/remap_wrap.h | 2 +- src/OPENMP/ewald_omp.h | 8 ++-- src/OPENMP/msm_cg_omp.h | 8 ++-- src/OPENMP/msm_omp.h | 5 +-- src/OPENMP/pppm_cg_omp.h | 18 ++++---- src/OPENMP/pppm_disp_omp.h | 34 +++++++-------- src/OPENMP/pppm_disp_tip4p_omp.h | 36 ++++++++-------- src/OPENMP/pppm_omp.h | 18 ++++---- src/OPENMP/pppm_tip4p_omp.h | 18 ++++---- src/gridcomm.h | 2 +- src/kspace_deprecated.h | 9 ++-- 36 files changed, 279 insertions(+), 282 deletions(-) diff --git a/src/DIELECTRIC/msm_dielectric.h b/src/DIELECTRIC/msm_dielectric.h index 9874f5e0b2..cfc0cb43e2 100644 --- a/src/DIELECTRIC/msm_dielectric.h +++ b/src/DIELECTRIC/msm_dielectric.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class MSMDielectric : public MSM { public: MSMDielectric(class LAMMPS *); - virtual ~MSMDielectric(); - virtual void init(); - virtual void compute(int, int); + ~MSMDielectric() override; + void init() override; + void compute(int, int) override; void fieldforce(); double **efield; diff --git a/src/DIELECTRIC/pppm_dielectric.h b/src/DIELECTRIC/pppm_dielectric.h index 7ea6a831eb..f2427e83f6 100644 --- a/src/DIELECTRIC/pppm_dielectric.h +++ b/src/DIELECTRIC/pppm_dielectric.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PPPMDielectric : public PPPM { public: PPPMDielectric(class LAMMPS *); - virtual ~PPPMDielectric(); - virtual void compute(int, int); + ~PPPMDielectric() override; + void compute(int, int) override; double **efield; double *phi; @@ -37,10 +37,10 @@ class PPPMDielectric : public PPPM { void qsum_qsq(); protected: - void slabcorr(); + void slabcorr() override; - void fieldforce_ik(); - void fieldforce_ad(); + void fieldforce_ik() override; + void fieldforce_ad() override; class AtomVecDielectric *avec; }; diff --git a/src/DIELECTRIC/pppm_disp_dielectric.h b/src/DIELECTRIC/pppm_disp_dielectric.h index 8f0476ab40..46b46904f0 100644 --- a/src/DIELECTRIC/pppm_disp_dielectric.h +++ b/src/DIELECTRIC/pppm_disp_dielectric.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class PPPMDispDielectric : public PPPMDisp { public: PPPMDispDielectric(class LAMMPS *); - virtual ~PPPMDispDielectric(); - virtual double memory_usage(); - virtual void compute(int, int); + ~PPPMDispDielectric() override; + double memory_usage() override; + void compute(int, int) override; void qsum_qsq(); void slabcorr(int); @@ -38,9 +38,9 @@ class PPPMDispDielectric : public PPPMDisp { int potflag; // 1/0 if per-atom electrostatic potential phi is needed protected: - virtual void fieldforce_c_ik(); - virtual void fieldforce_c_ad(); - virtual void fieldforce_c_peratom(); + void fieldforce_c_ik() override; + void fieldforce_c_ad() override; + void fieldforce_c_peratom() override; class AtomVecDielectric *avec; int mu_flag; diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h index 9e39c50151..7835a4ec30 100644 --- a/src/GPU/pppm_gpu.h +++ b/src/GPU/pppm_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PPPMGPU : public PPPM { public: PPPMGPU(class LAMMPS *); - virtual ~PPPMGPU(); - void init(); - void setup(); - void compute(int, int); - int timing_1d(int, double &); - int timing_3d(int, double &); - double memory_usage(); + ~PPPMGPU() override; + void init() override; + void setup() override; + void compute(int, int) override; + int timing_1d(int, double &) override; + int timing_3d(int, double &) override; + double memory_usage() override; - virtual void compute_group_group(int, int, int); + void compute_group_group(int, int, int) override; protected: FFT_SCALAR ***density_brick_gpu, ***vd_brick; @@ -44,12 +44,12 @@ class PPPMGPU : public PPPM { double poisson_time; void brick2fft_gpu(); - virtual void poisson_ik(); + void poisson_ik() override; - void pack_forward_grid(int, void *, int, int *); - void unpack_forward_grid(int, void *, int, int *); - void pack_reverse_grid(int, void *, int, int *); - void unpack_reverse_grid(int, void *, int, int *); + void pack_forward_grid(int, void *, int, int *) override; + void unpack_forward_grid(int, void *, int, int *) override; + void pack_reverse_grid(int, void *, int, int *) override; + void unpack_reverse_grid(int, void *, int, int *) override; FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *, FFT_SCALAR *, int); void destroy_3d_offset(FFT_SCALAR ***, int, int); diff --git a/src/INTEL/pppm_disp_intel.h b/src/INTEL/pppm_disp_intel.h index 2bac82ec9a..7543688154 100644 --- a/src/INTEL/pppm_disp_intel.h +++ b/src/INTEL/pppm_disp_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class PPPMDispIntel : public PPPMDisp { public: PPPMDispIntel(class LAMMPS *); - virtual ~PPPMDispIntel(); - virtual void init(); - virtual void compute(int, int); + ~PPPMDispIntel() override; + void init() override; + void compute(int, int) override; #ifdef _LMP_INTEL_OFFLOAD int use_base(); diff --git a/src/INTEL/pppm_intel.h b/src/INTEL/pppm_intel.h index c6b3d83aa5..7679c8988f 100644 --- a/src/INTEL/pppm_intel.h +++ b/src/INTEL/pppm_intel.h @@ -36,10 +36,10 @@ namespace LAMMPS_NS { class PPPMIntel : public PPPM { public: PPPMIntel(class LAMMPS *); - virtual ~PPPMIntel(); - virtual void init(); - virtual void compute(int, int); - virtual double memory_usage(); + ~PPPMIntel() override; + void init() override; + void compute(int, int) override; + double memory_usage() override; void compute_first(int, int); void compute_second(int, int); void pack_buffers(); @@ -67,7 +67,7 @@ class PPPMIntel : public PPPM { int _use_base; #endif - virtual void allocate(); + void allocate() override; template void test_function(IntelBuffers *buffers); diff --git a/src/KOKKOS/fft3d_kokkos.h b/src/KOKKOS/fft3d_kokkos.h index 387574b198..1cd6e9ced2 100644 --- a/src/KOKKOS/fft3d_kokkos.h +++ b/src/KOKKOS/fft3d_kokkos.h @@ -80,7 +80,7 @@ class FFT3dKokkos : protected Pointers { FFT3dKokkos(class LAMMPS *, MPI_Comm, int,int,int,int,int,int,int,int,int,int,int,int,int,int,int, int,int,int *,int,int); - ~FFT3dKokkos(); + ~FFT3dKokkos() override; void compute(typename FFT_AT::t_FFT_SCALAR_1d, typename FFT_AT::t_FFT_SCALAR_1d, int); void timing1d(typename FFT_AT::t_FFT_SCALAR_1d, int, int); diff --git a/src/KOKKOS/gridcomm_kokkos.h b/src/KOKKOS/gridcomm_kokkos.h index d1f4ccb5e9..e067dd27e5 100644 --- a/src/KOKKOS/gridcomm_kokkos.h +++ b/src/KOKKOS/gridcomm_kokkos.h @@ -34,7 +34,7 @@ class GridCommKokkos : public GridComm { int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); - virtual ~GridCommKokkos(); + ~GridCommKokkos() override; void forward_comm_kspace(class KSpace *, int, int, FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); void reverse_comm_kspace(class KSpace *, int, int, @@ -55,8 +55,8 @@ class GridCommKokkos : public GridComm { // internal methods // ------------------------------------------- - void setup_regular(int &, int &); - void setup_tiled(int &, int &); + void setup_regular(int &, int &) override; + void setup_tiled(int &, int &) override; void forward_comm_kspace_regular(class KSpace *, int, int, FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); @@ -67,7 +67,7 @@ class GridCommKokkos : public GridComm { void reverse_comm_kspace_tiled(class KSpace *, int, int, FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); - void grow_swap(); + void grow_swap() override; int indices(DAT::tdual_int_2d &, int, int, int, int, int, int, int); }; diff --git a/src/KOKKOS/pppm_kokkos.h b/src/KOKKOS/pppm_kokkos.h index 25f74f1b7d..1b9ec05535 100644 --- a/src/KOKKOS/pppm_kokkos.h +++ b/src/KOKKOS/pppm_kokkos.h @@ -121,15 +121,15 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT { typedef FFTArrayTypes FFT_AT; PPPMKokkos(class LAMMPS *); - virtual ~PPPMKokkos(); - virtual void init(); - virtual void setup(); - void setup_grid(); - virtual void settings(int, char **); - virtual void compute(int, int); - virtual int timing_1d(int, double &); - virtual int timing_3d(int, double &); - virtual double memory_usage(); + ~PPPMKokkos() override; + void init() override; + void setup() override; + void setup_grid() override; + void settings(int, char **) override; + void compute(int, int) override; + int timing_1d(int, double &) override; + int timing_3d(int, double &) override; + double memory_usage() override; KOKKOS_INLINE_FUNCTION void operator()(TagPPPM_setup1, const int&) const; @@ -398,49 +398,49 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT { //double *boxlo; double boxlo[3]; - void set_grid_global(); + void set_grid_global() override; void set_grid_local(); void adjust_gewald(); - double newton_raphson_f(); + double newton_raphson_f() override; double derivf(); double final_accuracy(); - virtual void allocate(); - virtual void allocate_peratom(); - virtual void deallocate(); - virtual void deallocate_peratom(); + void allocate() override; + void allocate_peratom() override; + void deallocate() override; + void deallocate_peratom() override; int factorable(int); double compute_df_kspace(); double estimate_ik_error(double, double, bigint); - virtual void compute_gf_denom(); - virtual void compute_gf_ik(); + void compute_gf_denom() override; + void compute_gf_ik() override; - virtual void particle_map(); - virtual void make_rho(); - virtual void brick2fft(); + void particle_map() override; + void make_rho() override; + void brick2fft() override; - virtual void poisson(); - virtual void poisson_ik(); + void poisson() override; + void poisson_ik() override; - virtual void fieldforce(); - virtual void fieldforce_ik(); + void fieldforce() override; + void fieldforce_ik() override; - virtual void poisson_peratom(); - virtual void fieldforce_peratom(); + void poisson_peratom() override; + void fieldforce_peratom() override; void procs2grid2d(int,int,int,int *, int*); KOKKOS_INLINE_FUNCTION void compute_rho1d(const int i, const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &) const; void compute_rho_coeff(); - void slabcorr(); + void slabcorr() override; // grid communication - void pack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); - void unpack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int); - void pack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); - void unpack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int); + void pack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) override; + void unpack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int) override; + void pack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) override; + void unpack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int) override; // triclinic diff --git a/src/KOKKOS/remap_kokkos.h b/src/KOKKOS/remap_kokkos.h index 316c96e359..eff85f9ebd 100644 --- a/src/KOKKOS/remap_kokkos.h +++ b/src/KOKKOS/remap_kokkos.h @@ -65,7 +65,7 @@ class RemapKokkos : protected Pointers { RemapKokkos(class LAMMPS *); RemapKokkos(class LAMMPS *, MPI_Comm,int,int,int,int,int,int, int,int,int,int,int,int,int,int,int,int,int,int); - ~RemapKokkos(); + ~RemapKokkos() override; void perform(typename FFT_AT::t_FFT_SCALAR_1d, typename FFT_AT::t_FFT_SCALAR_1d, typename FFT_AT::t_FFT_SCALAR_1d); struct remap_plan_3d_kokkos *plan; diff --git a/src/KSPACE/ewald.h b/src/KSPACE/ewald.h index b429d18729..9d4b555939 100644 --- a/src/KSPACE/ewald.h +++ b/src/KSPACE/ewald.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class Ewald : public KSpace { public: Ewald(class LAMMPS *); - virtual ~Ewald(); - void init(); - void setup(); - virtual void settings(int, char **); - virtual void compute(int, int); - double memory_usage(); + ~Ewald() override; + void init() override; + void setup() override; + void settings(int, char **) override; + void compute(int, int) override; + double memory_usage() override; - void compute_group_group(int, int, int); + void compute_group_group(int, int, int) override; protected: int kxmax, kymax, kzmax; diff --git a/src/KSPACE/ewald_dipole.h b/src/KSPACE/ewald_dipole.h index f1cb619442..7bf75eaf5b 100644 --- a/src/KSPACE/ewald_dipole.h +++ b/src/KSPACE/ewald_dipole.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class EwaldDipole : public Ewald { public: EwaldDipole(class LAMMPS *); - virtual ~EwaldDipole(); - void init(); - void setup(); - virtual void compute(int, int); + ~EwaldDipole() override; + void init() override; + void setup() override; + void compute(int, int) override; protected: double musum, musqsum, mu2; @@ -39,7 +39,7 @@ class EwaldDipole : public Ewald { void musum_musq(); double rms_dipole(int, double, bigint); - virtual void eik_dot_r(); + void eik_dot_r() override; void slabcorr(); double NewtonSolve(double, double, bigint, double, double); double f(double, double, bigint, double, double); diff --git a/src/KSPACE/ewald_dipole_spin.h b/src/KSPACE/ewald_dipole_spin.h index 4660dde987..61b24b9eb8 100644 --- a/src/KSPACE/ewald_dipole_spin.h +++ b/src/KSPACE/ewald_dipole_spin.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class EwaldDipoleSpin : public EwaldDipole { public: EwaldDipoleSpin(class LAMMPS *); - virtual ~EwaldDipoleSpin() = default; - void init(); - void setup(); - void compute(int, int); + + void init() override; + void setup() override; + void compute(int, int) override; protected: double hbar; // reduced Planck's constant @@ -40,7 +40,7 @@ class EwaldDipoleSpin : public EwaldDipole { double mub2mu0hbinv; // prefactor for mag force void spsum_musq(); - virtual void eik_dot_r(); + void eik_dot_r() override; void slabcorr(); }; diff --git a/src/KSPACE/ewald_disp.h b/src/KSPACE/ewald_disp.h index 760baa726d..04d76c0b94 100644 --- a/src/KSPACE/ewald_disp.h +++ b/src/KSPACE/ewald_disp.h @@ -36,12 +36,12 @@ namespace LAMMPS_NS { class EwaldDisp : public KSpace { public: EwaldDisp(class LAMMPS *); - ~EwaldDisp(); - void init(); - void setup(); - void settings(int, char **); - void compute(int, int); - double memory_usage() { return bytes; } + ~EwaldDisp() override; + void init() override; + void setup() override; + void settings(int, char **) override; + void compute(int, int) override; + double memory_usage() override { return bytes; } private: double unit[6]; diff --git a/src/KSPACE/fft3d_wrap.h b/src/KSPACE/fft3d_wrap.h index 1deccc801b..351bf5713d 100644 --- a/src/KSPACE/fft3d_wrap.h +++ b/src/KSPACE/fft3d_wrap.h @@ -25,7 +25,7 @@ class FFT3d : protected Pointers { FFT3d(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int *, int); - ~FFT3d(); + ~FFT3d() override; void compute(FFT_SCALAR *, FFT_SCALAR *, int); void timing1d(FFT_SCALAR *, int, int); diff --git a/src/KSPACE/msm.h b/src/KSPACE/msm.h index ac44dd2894..75cba695fd 100644 --- a/src/KSPACE/msm.h +++ b/src/KSPACE/msm.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class MSM : public KSpace { public: MSM(class LAMMPS *); - virtual ~MSM(); - void init(); - void setup(); - virtual void settings(int, char **); - virtual void compute(int, int); - virtual double memory_usage(); + ~MSM() override; + void init() override; + void setup() override; + void settings(int, char **) override; + void compute(int, int) override; + double memory_usage() override; protected: int me, nprocs; @@ -100,7 +100,7 @@ class MSM : public KSpace { void set_grid_global(); void set_proc_grid(int); void set_grid_local(); - void setup_grid(); + void setup_grid() override; double estimate_1d_error(double, double); double estimate_3d_error(); double estimate_total_error(); @@ -134,10 +134,10 @@ class MSM : public KSpace { // grid communication - void pack_forward_grid(int, void *, int, int *); - void unpack_forward_grid(int, void *, int, int *); - void pack_reverse_grid(int, void *, int, int *); - void unpack_reverse_grid(int, void *, int, int *); + void pack_forward_grid(int, void *, int, int *) override; + void unpack_forward_grid(int, void *, int, int *) override; + void pack_reverse_grid(int, void *, int, int *) override; + void unpack_reverse_grid(int, void *, int, int *) override; }; } // namespace LAMMPS_NS diff --git a/src/KSPACE/msm_cg.h b/src/KSPACE/msm_cg.h index 67a77ec622..00680589b5 100644 --- a/src/KSPACE/msm_cg.h +++ b/src/KSPACE/msm_cg.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class MSMCG : public MSM { public: MSMCG(class LAMMPS *); - virtual ~MSMCG(); - virtual void settings(int, char **); - virtual void compute(int, int); - virtual double memory_usage(); + ~MSMCG() override; + void settings(int, char **) override; + void compute(int, int) override; + double memory_usage() override; protected: int num_charged; diff --git a/src/KSPACE/pppm.h b/src/KSPACE/pppm.h index 4fa41fa311..88fc58f286 100644 --- a/src/KSPACE/pppm.h +++ b/src/KSPACE/pppm.h @@ -48,17 +48,17 @@ namespace LAMMPS_NS { class PPPM : public KSpace { public: PPPM(class LAMMPS *); - virtual ~PPPM(); - virtual void settings(int, char **); - virtual void init(); - virtual void setup(); - virtual void setup_grid(); - virtual void compute(int, int); - virtual int timing_1d(int, double &); - virtual int timing_3d(int, double &); - virtual double memory_usage(); + ~PPPM() override; + void settings(int, char **) override; + void init() override; + void setup() override; + void setup_grid() override; + void compute(int, int) override; + int timing_1d(int, double &) override; + int timing_3d(int, double &) override; + double memory_usage() override; - virtual void compute_group_group(int, int, int); + void compute_group_group(int, int, int) override; protected: int me, nprocs; @@ -162,10 +162,10 @@ class PPPM : public KSpace { // grid communication - virtual void pack_forward_grid(int, void *, int, int *); - virtual void unpack_forward_grid(int, void *, int, int *); - virtual void pack_reverse_grid(int, void *, int, int *); - virtual void unpack_reverse_grid(int, void *, int, int *); + void pack_forward_grid(int, void *, int, int *) override; + void unpack_forward_grid(int, void *, int, int *) override; + void pack_reverse_grid(int, void *, int, int *) override; + void unpack_reverse_grid(int, void *, int, int *) override; // triclinic diff --git a/src/KSPACE/pppm_cg.h b/src/KSPACE/pppm_cg.h index 83c75b5f53..83cd19536c 100644 --- a/src/KSPACE/pppm_cg.h +++ b/src/KSPACE/pppm_cg.h @@ -27,23 +27,23 @@ namespace LAMMPS_NS { class PPPMCG : public PPPM { public: PPPMCG(class LAMMPS *); - virtual ~PPPMCG(); - virtual void settings(int, char **); - virtual void compute(int, int); - virtual double memory_usage(); + ~PPPMCG() override; + void settings(int, char **) override; + void compute(int, int) override; + double memory_usage() override; protected: int num_charged; int *is_charged; double smallq; - virtual void particle_map(); - virtual void make_rho(); - virtual void fieldforce_ik(); - virtual void fieldforce_ad(); - virtual void fieldforce_peratom(); - virtual void slabcorr(); - virtual void make_rho_groups(int, int, int); + void particle_map() override; + void make_rho() override; + void fieldforce_ik() override; + void fieldforce_ad() override; + void fieldforce_peratom() override; + void slabcorr() override; + void make_rho_groups(int, int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/KSPACE/pppm_dipole.h b/src/KSPACE/pppm_dipole.h index 7ae2e9a7ef..ae16047194 100644 --- a/src/KSPACE/pppm_dipole.h +++ b/src/KSPACE/pppm_dipole.h @@ -27,33 +27,33 @@ namespace LAMMPS_NS { class PPPMDipole : public PPPM { public: PPPMDipole(class LAMMPS *); - virtual ~PPPMDipole(); - void init(); - void setup(); - void setup_grid(); - void compute(int, int); - int timing_1d(int, double &); - int timing_3d(int, double &); - double memory_usage(); + ~PPPMDipole() override; + void init() override; + void setup() override; + void setup_grid() override; + void compute(int, int) override; + int timing_1d(int, double &) override; + int timing_3d(int, double &) override; + double memory_usage() override; protected: - void set_grid_global(); - double newton_raphson_f(); + void set_grid_global() override; + double newton_raphson_f() override; - void allocate(); - void allocate_peratom(); - void deallocate(); - void deallocate_peratom(); - void compute_gf_denom(); + void allocate() override; + void allocate_peratom() override; + void deallocate() override; + void deallocate_peratom() override; + void compute_gf_denom() override; - void slabcorr(); + void slabcorr() override; // grid communication - void pack_forward_grid(int, void *, int, int *); - void unpack_forward_grid(int, void *, int, int *); - void pack_reverse_grid(int, void *, int, int *); - void unpack_reverse_grid(int, void *, int, int *); + void pack_forward_grid(int, void *, int, int *) override; + void unpack_forward_grid(int, void *, int, int *) override; + void pack_reverse_grid(int, void *, int, int *) override; + void unpack_reverse_grid(int, void *, int, int *) override; // dipole diff --git a/src/KSPACE/pppm_dipole_spin.h b/src/KSPACE/pppm_dipole_spin.h index eea43db15d..c0b0a635be 100644 --- a/src/KSPACE/pppm_dipole_spin.h +++ b/src/KSPACE/pppm_dipole_spin.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class PPPMDipoleSpin : public PPPMDipole { public: PPPMDipoleSpin(class LAMMPS *); - virtual ~PPPMDipoleSpin(); - void init(); - void compute(int, int); + ~PPPMDipoleSpin() override; + void init() override; + void compute(int, int) override; protected: double hbar; // reduced Planck's constant @@ -38,7 +38,7 @@ class PPPMDipoleSpin : public PPPMDipole { double mub2mu0; // prefactor for mech force double mub2mu0hbinv; // prefactor for mag force - void slabcorr(); + void slabcorr() override; // spin diff --git a/src/KSPACE/pppm_disp.h b/src/KSPACE/pppm_disp.h index 985ca5e0b2..de05a2f551 100644 --- a/src/KSPACE/pppm_disp.h +++ b/src/KSPACE/pppm_disp.h @@ -48,15 +48,15 @@ namespace LAMMPS_NS { class PPPMDisp : public KSpace { public: PPPMDisp(class LAMMPS *); - virtual ~PPPMDisp(); - virtual void init(); - virtual void setup(); - void setup_grid(); - virtual void settings(int, char **); - virtual void compute(int, int); - virtual int timing_1d(int, double &); - virtual int timing_3d(int, double &); - virtual double memory_usage(); + ~PPPMDisp() override; + void init() override; + void setup() override; + void setup_grid() override; + void settings(int, char **) override; + void compute(int, int) override; + int timing_1d(int, double &) override; + int timing_3d(int, double &) override; + double memory_usage() override; protected: int me, nprocs; @@ -341,10 +341,10 @@ class PPPMDisp : public KSpace { // grid communication - void pack_forward_grid(int, void *, int, int *); - void unpack_forward_grid(int, void *, int, int *); - void pack_reverse_grid(int, void *, int, int *); - void unpack_reverse_grid(int, void *, int, int *); + void pack_forward_grid(int, void *, int, int *) override; + void unpack_forward_grid(int, void *, int, int *) override; + void pack_reverse_grid(int, void *, int, int *) override; + void unpack_reverse_grid(int, void *, int, int *) override; }; } // namespace LAMMPS_NS diff --git a/src/KSPACE/pppm_disp_tip4p.h b/src/KSPACE/pppm_disp_tip4p.h index a8bb90ca54..fcb5f5ef81 100644 --- a/src/KSPACE/pppm_disp_tip4p.h +++ b/src/KSPACE/pppm_disp_tip4p.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class PPPMDispTIP4P : public PPPMDisp { public: PPPMDispTIP4P(class LAMMPS *); - virtual ~PPPMDispTIP4P(){}; - void init(); + ~PPPMDispTIP4P() override{}; + void init() override; protected: - virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, - int, int); - virtual void make_rho_c(); - virtual void fieldforce_c_ik(); - virtual void fieldforce_c_ad(); - virtual void fieldforce_c_peratom(); + void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int) override; + void make_rho_c() override; + void fieldforce_c_ik() override; + void fieldforce_c_ad() override; + void fieldforce_c_peratom() override; private: void find_M(int, int &, int &, double *); diff --git a/src/KSPACE/pppm_stagger.h b/src/KSPACE/pppm_stagger.h index 2467b1a161..77b7478d42 100644 --- a/src/KSPACE/pppm_stagger.h +++ b/src/KSPACE/pppm_stagger.h @@ -27,28 +27,28 @@ namespace LAMMPS_NS { class PPPMStagger : public PPPM { public: PPPMStagger(class LAMMPS *); - virtual ~PPPMStagger(); - virtual void init(); - virtual void compute(int, int); - virtual int timing_1d(int, double &); - virtual int timing_3d(int, double &); + ~PPPMStagger() override; + void init() override; + void compute(int, int) override; + int timing_1d(int, double &) override; + int timing_3d(int, double &) override; protected: int nstagger; double stagger; double **gf_b2; - virtual double compute_qopt(); + double compute_qopt() override; double compute_qopt_ad(); - virtual void compute_gf_denom(); - virtual void compute_gf_ik(); - virtual void compute_gf_ad(); + void compute_gf_denom() override; + void compute_gf_ik() override; + void compute_gf_ad() override; - virtual void particle_map(); - virtual void make_rho(); - virtual void fieldforce_ik(); - virtual void fieldforce_ad(); - virtual void fieldforce_peratom(); + void particle_map() override; + void make_rho() override; + void fieldforce_ik() override; + void fieldforce_ad() override; + void fieldforce_peratom() override; inline double gf_denom2(const double &x, const double &y, const double &z) const { diff --git a/src/KSPACE/pppm_tip4p.h b/src/KSPACE/pppm_tip4p.h index 9d3d70c0c6..3087f895dd 100644 --- a/src/KSPACE/pppm_tip4p.h +++ b/src/KSPACE/pppm_tip4p.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class PPPMTIP4P : public PPPM { public: PPPMTIP4P(class LAMMPS *); - virtual ~PPPMTIP4P(){}; - void init(); + void init() override; protected: - virtual void particle_map(); - virtual void make_rho(); - virtual void fieldforce_ik(); - virtual void fieldforce_ad(); - virtual void fieldforce_peratom(); + void particle_map() override; + void make_rho() override; + void fieldforce_ik() override; + void fieldforce_ad() override; + void fieldforce_peratom() override; private: void find_M(int, int &, int &, double *); diff --git a/src/KSPACE/remap_wrap.h b/src/KSPACE/remap_wrap.h index d42c8d4c5e..d5846bae76 100644 --- a/src/KSPACE/remap_wrap.h +++ b/src/KSPACE/remap_wrap.h @@ -23,7 +23,7 @@ class Remap : protected Pointers { public: Remap(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); - ~Remap(); + ~Remap() override; void perform(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *); private: diff --git a/src/OPENMP/ewald_omp.h b/src/OPENMP/ewald_omp.h index 6547b0fbf6..a938360e2f 100644 --- a/src/OPENMP/ewald_omp.h +++ b/src/OPENMP/ewald_omp.h @@ -28,12 +28,12 @@ namespace LAMMPS_NS { class EwaldOMP : public Ewald, public ThrOMP { public: EwaldOMP(class LAMMPS *); - virtual ~EwaldOMP(){}; - virtual void allocate(); - virtual void compute(int, int); + + void allocate() override; + void compute(int, int) override; protected: - virtual void eik_dot_r(); + void eik_dot_r() override; virtual void eik_dot_r_triclinic(); }; diff --git a/src/OPENMP/msm_cg_omp.h b/src/OPENMP/msm_cg_omp.h index ae38dc8027..253851bb5a 100644 --- a/src/OPENMP/msm_cg_omp.h +++ b/src/OPENMP/msm_cg_omp.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class MSMCGOMP : public MSMOMP { public: MSMCGOMP(class LAMMPS *); - virtual ~MSMCGOMP(); - virtual void settings(int, char **); - virtual void compute(int, int); - virtual double memory_usage(); + ~MSMCGOMP() override; + void settings(int, char **) override; + void compute(int, int) override; + double memory_usage() override; protected: int num_charged; diff --git a/src/OPENMP/msm_omp.h b/src/OPENMP/msm_omp.h index 3beaab4bcd..2925a21688 100644 --- a/src/OPENMP/msm_omp.h +++ b/src/OPENMP/msm_omp.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class MSMOMP : public MSM, public ThrOMP { public: MSMOMP(class LAMMPS *); - virtual ~MSMOMP(){}; protected: - virtual void direct(int); - virtual void compute(int, int); + void direct(int) override; + void compute(int, int) override; private: template void direct_eval(int); diff --git a/src/OPENMP/pppm_cg_omp.h b/src/OPENMP/pppm_cg_omp.h index ca21b2ccc5..6ecceed759 100644 --- a/src/OPENMP/pppm_cg_omp.h +++ b/src/OPENMP/pppm_cg_omp.h @@ -28,19 +28,19 @@ namespace LAMMPS_NS { class PPPMCGOMP : public PPPMCG, public ThrOMP { public: PPPMCGOMP(class LAMMPS *); - virtual ~PPPMCGOMP(); - virtual void compute(int, int); + ~PPPMCGOMP() override; + void compute(int, int) override; protected: - virtual void allocate(); + void allocate() override; - virtual void compute_gf_ik(); - virtual void compute_gf_ad(); + void compute_gf_ik() override; + void compute_gf_ad() override; - virtual void make_rho(); - virtual void fieldforce_ik(); - virtual void fieldforce_ad(); - virtual void fieldforce_peratom(); + void make_rho() override; + void fieldforce_ik() override; + void fieldforce_ad() override; + void fieldforce_peratom() override; private: void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, diff --git a/src/OPENMP/pppm_disp_omp.h b/src/OPENMP/pppm_disp_omp.h index 384b359523..bc463e60b4 100644 --- a/src/OPENMP/pppm_disp_omp.h +++ b/src/OPENMP/pppm_disp_omp.h @@ -28,31 +28,31 @@ namespace LAMMPS_NS { class PPPMDispOMP : public PPPMDisp, public ThrOMP { public: PPPMDispOMP(class LAMMPS *); - virtual ~PPPMDispOMP(); - virtual void compute(int, int); + ~PPPMDispOMP() override; + void compute(int, int) override; protected: - virtual void allocate(); + void allocate() override; virtual void compute_gf(); virtual void compute_gf_6(); - virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, - int, int); + void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int) override; - virtual void fieldforce_c_ik(); - virtual void fieldforce_c_ad(); - virtual void fieldforce_c_peratom(); - virtual void fieldforce_g_ik(); - virtual void fieldforce_g_ad(); - virtual void fieldforce_g_peratom(); - virtual void fieldforce_a_ik(); - virtual void fieldforce_a_ad(); - virtual void fieldforce_a_peratom(); + void fieldforce_c_ik() override; + void fieldforce_c_ad() override; + void fieldforce_c_peratom() override; + void fieldforce_g_ik() override; + void fieldforce_g_ad() override; + void fieldforce_g_peratom() override; + void fieldforce_a_ik() override; + void fieldforce_a_ad() override; + void fieldforce_a_peratom() override; - virtual void make_rho_c(); - virtual void make_rho_g(); - virtual void make_rho_a(); + void make_rho_c() override; + void make_rho_g() override; + void make_rho_a() override; void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &, const int, FFT_SCALAR *const *const); diff --git a/src/OPENMP/pppm_disp_tip4p_omp.h b/src/OPENMP/pppm_disp_tip4p_omp.h index c85bbe9437..9b08f5966e 100644 --- a/src/OPENMP/pppm_disp_tip4p_omp.h +++ b/src/OPENMP/pppm_disp_tip4p_omp.h @@ -28,33 +28,33 @@ namespace LAMMPS_NS { class PPPMDispTIP4POMP : public PPPMDispTIP4P, public ThrOMP { public: PPPMDispTIP4POMP(class LAMMPS *); - virtual ~PPPMDispTIP4POMP(); + ~PPPMDispTIP4POMP() override; protected: - virtual void allocate(); + void allocate() override; virtual void compute_gf(); virtual void compute_gf_6(); - virtual void compute(int, int); + void compute(int, int) override; - virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, - int, int); - virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, - int, int); - virtual void make_rho_c(); // XXX: not (yet) multi-threaded - virtual void make_rho_g(); - virtual void make_rho_a(); + void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int) override; + void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int) override; + void make_rho_c() override; // XXX: not (yet) multi-threaded + void make_rho_g() override; + void make_rho_a() override; - virtual void fieldforce_c_ik(); - virtual void fieldforce_c_ad(); + void fieldforce_c_ik() override; + void fieldforce_c_ad() override; // virtual void fieldforce_peratom(); XXX: need to benchmark first. - virtual void fieldforce_g_ik(); - virtual void fieldforce_g_ad(); - virtual void fieldforce_g_peratom(); - virtual void fieldforce_a_ik(); - virtual void fieldforce_a_ad(); - virtual void fieldforce_a_peratom(); + void fieldforce_g_ik() override; + void fieldforce_g_ad() override; + void fieldforce_g_peratom() override; + void fieldforce_a_ik() override; + void fieldforce_a_ad() override; + void fieldforce_a_peratom() override; private: void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, diff --git a/src/OPENMP/pppm_omp.h b/src/OPENMP/pppm_omp.h index 3c17ede721..8da1f26bfd 100644 --- a/src/OPENMP/pppm_omp.h +++ b/src/OPENMP/pppm_omp.h @@ -28,19 +28,19 @@ namespace LAMMPS_NS { class PPPMOMP : public PPPM, public ThrOMP { public: PPPMOMP(class LAMMPS *); - virtual ~PPPMOMP(); - virtual void compute(int, int); + ~PPPMOMP() override; + void compute(int, int) override; protected: - virtual void allocate(); + void allocate() override; - virtual void compute_gf_ik(); - virtual void compute_gf_ad(); + void compute_gf_ik() override; + void compute_gf_ad() override; - virtual void make_rho(); - virtual void fieldforce_ik(); - virtual void fieldforce_ad(); - virtual void fieldforce_peratom(); + void make_rho() override; + void fieldforce_ik() override; + void fieldforce_ad() override; + void fieldforce_peratom() override; private: void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, diff --git a/src/OPENMP/pppm_tip4p_omp.h b/src/OPENMP/pppm_tip4p_omp.h index ba445b0353..bcb5890269 100644 --- a/src/OPENMP/pppm_tip4p_omp.h +++ b/src/OPENMP/pppm_tip4p_omp.h @@ -28,20 +28,20 @@ namespace LAMMPS_NS { class PPPMTIP4POMP : public PPPMTIP4P, public ThrOMP { public: PPPMTIP4POMP(class LAMMPS *); - virtual ~PPPMTIP4POMP(); - virtual void compute(int, int); + ~PPPMTIP4POMP() override; + void compute(int, int) override; protected: - virtual void allocate(); + void allocate() override; - virtual void compute_gf_ik(); - virtual void compute_gf_ad(); + void compute_gf_ik() override; + void compute_gf_ad() override; - virtual void particle_map(); - virtual void make_rho(); // XXX: not (yet) multi-threaded + void particle_map() override; + void make_rho() override; // XXX: not (yet) multi-threaded - virtual void fieldforce_ik(); - virtual void fieldforce_ad(); + void fieldforce_ik() override; + void fieldforce_ad() override; // virtual void fieldforce_peratom(); XXX: need to benchmark first. private: diff --git a/src/gridcomm.h b/src/gridcomm.h index 37751a88a7..dec43a789a 100644 --- a/src/gridcomm.h +++ b/src/gridcomm.h @@ -26,7 +26,7 @@ class GridComm : protected Pointers { int, int, int); GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); - virtual ~GridComm(); + ~GridComm() override; void setup(int &, int &); int ghost_adjacent(); void forward_comm(int, void *, int, int, int, void *, void *, MPI_Datatype); diff --git a/src/kspace_deprecated.h b/src/kspace_deprecated.h index 09c3a90e33..cfd1af66de 100644 --- a/src/kspace_deprecated.h +++ b/src/kspace_deprecated.h @@ -27,12 +27,11 @@ namespace LAMMPS_NS { class KSpaceDeprecated : public KSpace { public: KSpaceDeprecated(class LAMMPS *lmp) : KSpace(lmp) {} - virtual ~KSpaceDeprecated() {} - virtual void init() {} - virtual void settings(int, char **); - virtual void setup() {} - virtual void compute(int, int) {} + void init() override {} + void settings(int, char **) override; + void setup() override {} + void compute(int, int) override {} }; } // namespace LAMMPS_NS From 7387643b870aff5b2203722fbea649e70df75111 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 17:36:43 -0500 Subject: [PATCH 064/174] Apply override to Improper classes --- src/CLASS2/improper_class2.h | 12 ++++++------ src/EXTRA-MOLECULE/improper_cossq.h | 12 ++++++------ src/EXTRA-MOLECULE/improper_distance.h | 12 ++++++------ src/EXTRA-MOLECULE/improper_fourier.h | 12 ++++++------ src/EXTRA-MOLECULE/improper_ring.h | 12 ++++++------ src/INTEL/improper_cvff_intel.h | 6 +++--- src/INTEL/improper_harmonic_intel.h | 6 +++--- src/KOKKOS/improper_class2_kokkos.h | 8 ++++---- src/KOKKOS/improper_harmonic_kokkos.h | 10 +++++----- src/MOFFF/improper_inversion_harmonic.h | 12 ++++++------ src/MOLECULE/improper_cvff.h | 12 ++++++------ src/MOLECULE/improper_harmonic.h | 12 ++++++------ src/MOLECULE/improper_umbrella.h | 12 ++++++------ src/OPENMP/improper_class2_omp.h | 2 +- src/OPENMP/improper_cossq_omp.h | 2 +- src/OPENMP/improper_cvff_omp.h | 2 +- src/OPENMP/improper_fourier_omp.h | 2 +- src/OPENMP/improper_harmonic_omp.h | 2 +- src/OPENMP/improper_ring_omp.h | 2 +- src/OPENMP/improper_umbrella_omp.h | 2 +- src/YAFF/improper_distharm.h | 10 +++++----- src/YAFF/improper_sqdistharm.h | 10 +++++----- src/improper_deprecated.h | 11 +++++------ src/improper_hybrid.h | 16 ++++++++-------- src/improper_zero.h | 14 +++++++------- 25 files changed, 106 insertions(+), 107 deletions(-) diff --git a/src/CLASS2/improper_class2.h b/src/CLASS2/improper_class2.h index fc845cbf51..0017c04892 100644 --- a/src/CLASS2/improper_class2.h +++ b/src/CLASS2/improper_class2.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperClass2 : public Improper { public: ImproperClass2(class LAMMPS *); - virtual ~ImproperClass2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); + ~ImproperClass2() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k0, *chi0; diff --git a/src/EXTRA-MOLECULE/improper_cossq.h b/src/EXTRA-MOLECULE/improper_cossq.h index fd22e438ce..854aa3ed05 100644 --- a/src/EXTRA-MOLECULE/improper_cossq.h +++ b/src/EXTRA-MOLECULE/improper_cossq.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperCossq : public Improper { public: ImproperCossq(class LAMMPS *); - virtual ~ImproperCossq(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperCossq() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *chi; diff --git a/src/EXTRA-MOLECULE/improper_distance.h b/src/EXTRA-MOLECULE/improper_distance.h index fbf8060c9f..d814405906 100644 --- a/src/EXTRA-MOLECULE/improper_distance.h +++ b/src/EXTRA-MOLECULE/improper_distance.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperDistance : public Improper { public: ImproperDistance(class LAMMPS *); - ~ImproperDistance(); - void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperDistance() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; private: double *k, *chi; diff --git a/src/EXTRA-MOLECULE/improper_fourier.h b/src/EXTRA-MOLECULE/improper_fourier.h index 25d03e623b..f420c534a2 100644 --- a/src/EXTRA-MOLECULE/improper_fourier.h +++ b/src/EXTRA-MOLECULE/improper_fourier.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperFourier : public Improper { public: ImproperFourier(class LAMMPS *); - ~ImproperFourier(); - void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperFourier() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *C0, *C1, *C2; diff --git a/src/EXTRA-MOLECULE/improper_ring.h b/src/EXTRA-MOLECULE/improper_ring.h index f428a7bfd6..3afb5a8d98 100644 --- a/src/EXTRA-MOLECULE/improper_ring.h +++ b/src/EXTRA-MOLECULE/improper_ring.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperRing : public Improper { public: ImproperRing(class LAMMPS *); - virtual ~ImproperRing(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperRing() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *chi; diff --git a/src/INTEL/improper_cvff_intel.h b/src/INTEL/improper_cvff_intel.h index 6ea95d0ff4..f09cc06a0d 100644 --- a/src/INTEL/improper_cvff_intel.h +++ b/src/INTEL/improper_cvff_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class ImproperCvffIntel : public ImproperCvff { public: ImproperCvffIntel(class LAMMPS *); - virtual ~ImproperCvffIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~ImproperCvffIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; diff --git a/src/INTEL/improper_harmonic_intel.h b/src/INTEL/improper_harmonic_intel.h index 3b9c5d2ec9..b8218614e1 100644 --- a/src/INTEL/improper_harmonic_intel.h +++ b/src/INTEL/improper_harmonic_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class ImproperHarmonicIntel : public ImproperHarmonic { public: ImproperHarmonicIntel(class LAMMPS *); - virtual ~ImproperHarmonicIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~ImproperHarmonicIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; diff --git a/src/KOKKOS/improper_class2_kokkos.h b/src/KOKKOS/improper_class2_kokkos.h index 9656526e49..179a7b61a9 100644 --- a/src/KOKKOS/improper_class2_kokkos.h +++ b/src/KOKKOS/improper_class2_kokkos.h @@ -42,10 +42,10 @@ class ImproperClass2Kokkos : public ImproperClass2 { typedef ArrayTypes AT; ImproperClass2Kokkos(class LAMMPS *); - virtual ~ImproperClass2Kokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~ImproperClass2Kokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/improper_harmonic_kokkos.h b/src/KOKKOS/improper_harmonic_kokkos.h index ad683f314d..02cbb9d15a 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.h +++ b/src/KOKKOS/improper_harmonic_kokkos.h @@ -39,10 +39,10 @@ class ImproperHarmonicKokkos : public ImproperHarmonic { typedef ArrayTypes AT; ImproperHarmonicKokkos(class LAMMPS *); - virtual ~ImproperHarmonicKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~ImproperHarmonicKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -87,7 +87,7 @@ class ImproperHarmonicKokkos : public ImproperHarmonic { typename Kokkos::DualView::t_dev d_k; typename Kokkos::DualView::t_dev d_chi; - void allocate(); + void allocate() override; }; } diff --git a/src/MOFFF/improper_inversion_harmonic.h b/src/MOFFF/improper_inversion_harmonic.h index 5ab8e78a3c..e3bf1a0bc5 100644 --- a/src/MOFFF/improper_inversion_harmonic.h +++ b/src/MOFFF/improper_inversion_harmonic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperInversionHarmonic : public Improper { public: ImproperInversionHarmonic(class LAMMPS *); - virtual ~ImproperInversionHarmonic(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperInversionHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *kw, *w0; diff --git a/src/MOLECULE/improper_cvff.h b/src/MOLECULE/improper_cvff.h index 821d29e607..1e724bc84b 100644 --- a/src/MOLECULE/improper_cvff.h +++ b/src/MOLECULE/improper_cvff.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperCvff : public Improper { public: ImproperCvff(class LAMMPS *); - virtual ~ImproperCvff(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperCvff() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k; diff --git a/src/MOLECULE/improper_harmonic.h b/src/MOLECULE/improper_harmonic.h index d81a81f951..64966b477c 100644 --- a/src/MOLECULE/improper_harmonic.h +++ b/src/MOLECULE/improper_harmonic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperHarmonic : public Improper { public: ImproperHarmonic(class LAMMPS *); - virtual ~ImproperHarmonic(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); + ~ImproperHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *chi; diff --git a/src/MOLECULE/improper_umbrella.h b/src/MOLECULE/improper_umbrella.h index 836527ee3c..fb671646e7 100644 --- a/src/MOLECULE/improper_umbrella.h +++ b/src/MOLECULE/improper_umbrella.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ImproperUmbrella : public Improper { public: ImproperUmbrella(class LAMMPS *); - virtual ~ImproperUmbrella(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~ImproperUmbrella() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *kw, *w0, *C; diff --git a/src/OPENMP/improper_class2_omp.h b/src/OPENMP/improper_class2_omp.h index 4930e5795d..efb1f67c4c 100644 --- a/src/OPENMP/improper_class2_omp.h +++ b/src/OPENMP/improper_class2_omp.h @@ -33,7 +33,7 @@ class ImproperClass2OMP : public ImproperClass2, public ThrOMP { public: ImproperClass2OMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/improper_cossq_omp.h b/src/OPENMP/improper_cossq_omp.h index 98069222b3..515ee0d076 100644 --- a/src/OPENMP/improper_cossq_omp.h +++ b/src/OPENMP/improper_cossq_omp.h @@ -33,7 +33,7 @@ class ImproperCossqOMP : public ImproperCossq, public ThrOMP { public: ImproperCossqOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/improper_cvff_omp.h b/src/OPENMP/improper_cvff_omp.h index b994ec0547..04faba38ac 100644 --- a/src/OPENMP/improper_cvff_omp.h +++ b/src/OPENMP/improper_cvff_omp.h @@ -33,7 +33,7 @@ class ImproperCvffOMP : public ImproperCvff, public ThrOMP { public: ImproperCvffOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/improper_fourier_omp.h b/src/OPENMP/improper_fourier_omp.h index 734b17e101..e9b63b68dc 100644 --- a/src/OPENMP/improper_fourier_omp.h +++ b/src/OPENMP/improper_fourier_omp.h @@ -33,7 +33,7 @@ class ImproperFourierOMP : public ImproperFourier, public ThrOMP { public: ImproperFourierOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/improper_harmonic_omp.h b/src/OPENMP/improper_harmonic_omp.h index 78eb32e505..4caf47d56e 100644 --- a/src/OPENMP/improper_harmonic_omp.h +++ b/src/OPENMP/improper_harmonic_omp.h @@ -33,7 +33,7 @@ class ImproperHarmonicOMP : public ImproperHarmonic, public ThrOMP { public: ImproperHarmonicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/improper_ring_omp.h b/src/OPENMP/improper_ring_omp.h index 9199830be7..7adce7014c 100644 --- a/src/OPENMP/improper_ring_omp.h +++ b/src/OPENMP/improper_ring_omp.h @@ -33,7 +33,7 @@ class ImproperRingOMP : public ImproperRing, public ThrOMP { public: ImproperRingOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/improper_umbrella_omp.h b/src/OPENMP/improper_umbrella_omp.h index 17dd81ca80..81f1a05787 100644 --- a/src/OPENMP/improper_umbrella_omp.h +++ b/src/OPENMP/improper_umbrella_omp.h @@ -33,7 +33,7 @@ class ImproperUmbrellaOMP : public ImproperUmbrella, public ThrOMP { public: ImproperUmbrellaOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/YAFF/improper_distharm.h b/src/YAFF/improper_distharm.h index e30c63981c..ebc4c701d5 100644 --- a/src/YAFF/improper_distharm.h +++ b/src/YAFF/improper_distharm.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ImproperDistHarm : public Improper { public: ImproperDistHarm(class LAMMPS *); - ~ImproperDistHarm(); - void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); + ~ImproperDistHarm() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; private: double *k, *chi; diff --git a/src/YAFF/improper_sqdistharm.h b/src/YAFF/improper_sqdistharm.h index 57727929de..e7a1e62661 100644 --- a/src/YAFF/improper_sqdistharm.h +++ b/src/YAFF/improper_sqdistharm.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ImproperSQDistHarm : public Improper { public: ImproperSQDistHarm(class LAMMPS *); - ~ImproperSQDistHarm(); - void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); + ~ImproperSQDistHarm() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; private: double *k, *chi; diff --git a/src/improper_deprecated.h b/src/improper_deprecated.h index ea080ba3cb..d2f0be0dc3 100644 --- a/src/improper_deprecated.h +++ b/src/improper_deprecated.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class ImproperDeprecated : public Improper { public: ImproperDeprecated(class LAMMPS *lmp) : Improper(lmp) {} - virtual ~ImproperDeprecated() {} - virtual void compute(int, int) {} - virtual void settings(int, char **); - virtual void coeff(int, char **) {} - virtual void write_restart(FILE *) {} - virtual void read_restart(FILE *) {} + void compute(int, int) override {} + void settings(int, char **) override; + void coeff(int, char **) override {} + void write_restart(FILE *) override {} + void read_restart(FILE *) override {} }; } // namespace LAMMPS_NS diff --git a/src/improper_hybrid.h b/src/improper_hybrid.h index e680ec9119..caa9e0b762 100644 --- a/src/improper_hybrid.h +++ b/src/improper_hybrid.h @@ -31,14 +31,14 @@ class ImproperHybrid : public Improper { char **keywords; // keyword for each improper style ImproperHybrid(class LAMMPS *); - ~ImproperHybrid(); - void init_style(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - double memory_usage(); + ~ImproperHybrid() override; + void init_style() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double memory_usage() override; private: int *map; // which style each improper type points to diff --git a/src/improper_zero.h b/src/improper_zero.h index 9b1dfa4e73..5acf34c6d4 100644 --- a/src/improper_zero.h +++ b/src/improper_zero.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class ImproperZero : public Improper { public: ImproperZero(class LAMMPS *); - virtual ~ImproperZero(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void settings(int, char **); + ~ImproperZero() override; + void compute(int, int) override; + void coeff(int, char **) override; + void settings(int, char **) override; - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int coeffflag; From d4ec93199181ffd4a037cc5ee0ac9ed597ec04de Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 17:49:23 -0500 Subject: [PATCH 065/174] Apply override to FileReader classes --- src/potential_file_reader.h | 2 +- src/table_file_reader.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/potential_file_reader.h b/src/potential_file_reader.h index c72bf6e48f..a9d7fa8383 100644 --- a/src/potential_file_reader.h +++ b/src/potential_file_reader.h @@ -39,7 +39,7 @@ class PotentialFileReader : protected Pointers { PotentialFileReader(class LAMMPS *lmp, const std::string &filename, const std::string &potential_name, const std::string &name_suffix, const int auto_convert = 0); - virtual ~PotentialFileReader(); + ~PotentialFileReader() override; void ignore_comments(bool value); diff --git a/src/table_file_reader.h b/src/table_file_reader.h index 832e68a34f..51e10189ee 100644 --- a/src/table_file_reader.h +++ b/src/table_file_reader.h @@ -25,7 +25,6 @@ class TableFileReader : public PotentialFileReader { public: TableFileReader(class LAMMPS *lmp, const std::string &filename, const std::string &type, const int auto_convert = 0); - virtual ~TableFileReader() = default; char *find_section_start(const std::string &keyword); }; From 4e89488f27a5fe7d5cac1039827114a2fff8d7dc Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 17:53:38 -0500 Subject: [PATCH 066/174] Apply override to Angle classes --- src/CG-SDK/angle_sdk.h | 18 +++++++++--------- src/CLASS2/angle_class2.h | 16 ++++++++-------- src/DIPOLE/angle_dipole.h | 18 +++++++++--------- src/EXTRA-MOLECULE/angle_cosine_delta.h | 4 ++-- src/EXTRA-MOLECULE/angle_cosine_periodic.h | 16 ++++++++-------- src/EXTRA-MOLECULE/angle_cosine_shift.h | 16 ++++++++-------- src/EXTRA-MOLECULE/angle_cosine_shift_exp.h | 16 ++++++++-------- src/EXTRA-MOLECULE/angle_fourier.h | 16 ++++++++-------- src/EXTRA-MOLECULE/angle_fourier_simple.h | 16 ++++++++-------- src/EXTRA-MOLECULE/angle_gaussian.h | 16 ++++++++-------- src/EXTRA-MOLECULE/angle_quartic.h | 16 ++++++++-------- src/INTEL/angle_charmm_intel.h | 6 +++--- src/INTEL/angle_harmonic_intel.h | 6 +++--- src/KOKKOS/angle_charmm_kokkos.h | 10 +++++----- src/KOKKOS/angle_class2_kokkos.h | 8 ++++---- src/KOKKOS/angle_cosine_kokkos.h | 10 +++++----- src/KOKKOS/angle_harmonic_kokkos.h | 10 +++++----- src/MOFFF/angle_class2_p6.h | 16 ++++++++-------- src/MOFFF/angle_cosine_buck6d.h | 18 +++++++++--------- src/MOLECULE/angle_charmm.h | 16 ++++++++-------- src/MOLECULE/angle_cosine.h | 16 ++++++++-------- src/MOLECULE/angle_cosine_squared.h | 16 ++++++++-------- src/MOLECULE/angle_harmonic.h | 16 ++++++++-------- src/MOLECULE/angle_table.h | 20 ++++++++++---------- src/OPENMP/angle_charmm_omp.h | 2 +- src/OPENMP/angle_class2_omp.h | 2 +- src/OPENMP/angle_cosine_delta_omp.h | 2 +- src/OPENMP/angle_cosine_omp.h | 2 +- src/OPENMP/angle_cosine_periodic_omp.h | 2 +- src/OPENMP/angle_cosine_shift_exp_omp.h | 2 +- src/OPENMP/angle_cosine_shift_omp.h | 2 +- src/OPENMP/angle_cosine_squared_omp.h | 2 +- src/OPENMP/angle_dipole_omp.h | 2 +- src/OPENMP/angle_fourier_omp.h | 2 +- src/OPENMP/angle_fourier_simple_omp.h | 2 +- src/OPENMP/angle_harmonic_omp.h | 2 +- src/OPENMP/angle_quartic_omp.h | 2 +- src/OPENMP/angle_sdk_omp.h | 2 +- src/OPENMP/angle_table_omp.h | 2 +- src/YAFF/angle_cross.h | 16 ++++++++-------- src/YAFF/angle_mm3.h | 16 ++++++++-------- src/angle_deprecated.h | 15 +++++++-------- src/angle_hybrid.h | 20 ++++++++++---------- src/angle_zero.h | 18 +++++++++--------- 44 files changed, 225 insertions(+), 226 deletions(-) diff --git a/src/CG-SDK/angle_sdk.h b/src/CG-SDK/angle_sdk.h index 880f086be4..0db35444bf 100644 --- a/src/CG-SDK/angle_sdk.h +++ b/src/CG-SDK/angle_sdk.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class AngleSDK : public Angle { public: AngleSDK(class LAMMPS *); - virtual ~AngleSDK(); - virtual void compute(int, int); - void coeff(int, char **); - void init_style(); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleSDK() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *theta0; diff --git a/src/CLASS2/angle_class2.h b/src/CLASS2/angle_class2.h index 9af64ac754..9c33e2c265 100644 --- a/src/CLASS2/angle_class2.h +++ b/src/CLASS2/angle_class2.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleClass2 : public Angle { public: AngleClass2(class LAMMPS *); - virtual ~AngleClass2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_angle(int); - virtual void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleClass2() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *theta0, *k2, *k3, *k4; diff --git a/src/DIPOLE/angle_dipole.h b/src/DIPOLE/angle_dipole.h index d94315c5aa..d65ae84e20 100644 --- a/src/DIPOLE/angle_dipole.h +++ b/src/DIPOLE/angle_dipole.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class AngleDipole : public Angle { public: AngleDipole(class LAMMPS *); - virtual ~AngleDipole(); - virtual void compute(int, int); - virtual void init_style(); - virtual void coeff(int, char **); - virtual double equilibrium_angle(int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_data(FILE *); - virtual double single(int, int, int, int); + ~AngleDipole() override; + void compute(int, int) override; + void init_style() override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *gamma0; diff --git a/src/EXTRA-MOLECULE/angle_cosine_delta.h b/src/EXTRA-MOLECULE/angle_cosine_delta.h index ce5b001073..fda3821beb 100644 --- a/src/EXTRA-MOLECULE/angle_cosine_delta.h +++ b/src/EXTRA-MOLECULE/angle_cosine_delta.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class AngleCosineDelta : public AngleCosineSquared { public: AngleCosineDelta(class LAMMPS *); - virtual void compute(int, int); - double single(int, int, int, int); + void compute(int, int) override; + double single(int, int, int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-MOLECULE/angle_cosine_periodic.h b/src/EXTRA-MOLECULE/angle_cosine_periodic.h index e5c9673b78..52404b885d 100644 --- a/src/EXTRA-MOLECULE/angle_cosine_periodic.h +++ b/src/EXTRA-MOLECULE/angle_cosine_periodic.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCosinePeriodic : public Angle { public: AngleCosinePeriodic(class LAMMPS *); - virtual ~AngleCosinePeriodic(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCosinePeriodic() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k; diff --git a/src/EXTRA-MOLECULE/angle_cosine_shift.h b/src/EXTRA-MOLECULE/angle_cosine_shift.h index 038d31e501..f52c532bba 100644 --- a/src/EXTRA-MOLECULE/angle_cosine_shift.h +++ b/src/EXTRA-MOLECULE/angle_cosine_shift.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCosineShift : public Angle { public: AngleCosineShift(class LAMMPS *); - virtual ~AngleCosineShift(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCosineShift() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k; diff --git a/src/EXTRA-MOLECULE/angle_cosine_shift_exp.h b/src/EXTRA-MOLECULE/angle_cosine_shift_exp.h index 6ebbb1185b..f372d9bc30 100644 --- a/src/EXTRA-MOLECULE/angle_cosine_shift_exp.h +++ b/src/EXTRA-MOLECULE/angle_cosine_shift_exp.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCosineShiftExp : public Angle { public: AngleCosineShiftExp(class LAMMPS *); - virtual ~AngleCosineShiftExp(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCosineShiftExp() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: bool *doExpansion; diff --git a/src/EXTRA-MOLECULE/angle_fourier.h b/src/EXTRA-MOLECULE/angle_fourier.h index daaab5351f..84859fc216 100644 --- a/src/EXTRA-MOLECULE/angle_fourier.h +++ b/src/EXTRA-MOLECULE/angle_fourier.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleFourier : public Angle { public: AngleFourier(class LAMMPS *); - virtual ~AngleFourier(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - virtual double single(int, int, int, int); + ~AngleFourier() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *C0, *C1, *C2; diff --git a/src/EXTRA-MOLECULE/angle_fourier_simple.h b/src/EXTRA-MOLECULE/angle_fourier_simple.h index 815ed99109..d66f32f13f 100644 --- a/src/EXTRA-MOLECULE/angle_fourier_simple.h +++ b/src/EXTRA-MOLECULE/angle_fourier_simple.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleFourierSimple : public Angle { public: AngleFourierSimple(class LAMMPS *); - virtual ~AngleFourierSimple(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - virtual double single(int, int, int, int); + ~AngleFourierSimple() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *C, *N; diff --git a/src/EXTRA-MOLECULE/angle_gaussian.h b/src/EXTRA-MOLECULE/angle_gaussian.h index 654872205f..76c7552c31 100644 --- a/src/EXTRA-MOLECULE/angle_gaussian.h +++ b/src/EXTRA-MOLECULE/angle_gaussian.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleGaussian : public Angle { public: AngleGaussian(class LAMMPS *); - virtual ~AngleGaussian(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleGaussian() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: int *nterms; diff --git a/src/EXTRA-MOLECULE/angle_quartic.h b/src/EXTRA-MOLECULE/angle_quartic.h index 0d352fac52..1253ec2f0f 100644 --- a/src/EXTRA-MOLECULE/angle_quartic.h +++ b/src/EXTRA-MOLECULE/angle_quartic.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleQuartic : public Angle { public: AngleQuartic(class LAMMPS *); - virtual ~AngleQuartic(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleQuartic() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k2, *k3, *k4, *theta0; diff --git a/src/INTEL/angle_charmm_intel.h b/src/INTEL/angle_charmm_intel.h index 942ac942a1..6758602843 100644 --- a/src/INTEL/angle_charmm_intel.h +++ b/src/INTEL/angle_charmm_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class AngleCharmmIntel : public AngleCharmm { public: AngleCharmmIntel(class LAMMPS *); - virtual ~AngleCharmmIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~AngleCharmmIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; diff --git a/src/INTEL/angle_harmonic_intel.h b/src/INTEL/angle_harmonic_intel.h index 10bdcd9546..650e5363a3 100644 --- a/src/INTEL/angle_harmonic_intel.h +++ b/src/INTEL/angle_harmonic_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class AngleHarmonicIntel : public AngleHarmonic { public: AngleHarmonicIntel(class LAMMPS *); - virtual ~AngleHarmonicIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~AngleHarmonicIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; diff --git a/src/KOKKOS/angle_charmm_kokkos.h b/src/KOKKOS/angle_charmm_kokkos.h index 73f2e7447c..b74b1e2886 100644 --- a/src/KOKKOS/angle_charmm_kokkos.h +++ b/src/KOKKOS/angle_charmm_kokkos.h @@ -38,10 +38,10 @@ class AngleCharmmKokkos : public AngleCharmm { typedef EV_FLOAT value_type; AngleCharmmKokkos(class LAMMPS *); - virtual ~AngleCharmmKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~AngleCharmmKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -82,7 +82,7 @@ class AngleCharmmKokkos : public AngleCharmm { typename AT::t_ffloat_1d d_k_ub; typename AT::t_ffloat_1d d_r_ub; - void allocate(); + void allocate() override; }; } diff --git a/src/KOKKOS/angle_class2_kokkos.h b/src/KOKKOS/angle_class2_kokkos.h index 26b147e1b1..e708b0ebad 100644 --- a/src/KOKKOS/angle_class2_kokkos.h +++ b/src/KOKKOS/angle_class2_kokkos.h @@ -40,10 +40,10 @@ class AngleClass2Kokkos : public AngleClass2 { typedef EV_FLOAT value_type; AngleClass2Kokkos(class LAMMPS *); - virtual ~AngleClass2Kokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~AngleClass2Kokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/angle_cosine_kokkos.h b/src/KOKKOS/angle_cosine_kokkos.h index e23fe622a7..0235c087b0 100644 --- a/src/KOKKOS/angle_cosine_kokkos.h +++ b/src/KOKKOS/angle_cosine_kokkos.h @@ -39,10 +39,10 @@ class AngleCosineKokkos : public AngleCosine { typedef EV_FLOAT value_type; AngleCosineKokkos(class LAMMPS *); - virtual ~AngleCosineKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~AngleCosineKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -78,7 +78,7 @@ class AngleCosineKokkos : public AngleCosine { typename ArrayTypes::tdual_ffloat_1d k_k; typename ArrayTypes::t_ffloat_1d d_k; - void allocate(); + void allocate() override; }; } diff --git a/src/KOKKOS/angle_harmonic_kokkos.h b/src/KOKKOS/angle_harmonic_kokkos.h index f32aca6044..1c1f0b1830 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.h +++ b/src/KOKKOS/angle_harmonic_kokkos.h @@ -39,10 +39,10 @@ class AngleHarmonicKokkos : public AngleHarmonic { typedef EV_FLOAT value_type; AngleHarmonicKokkos(class LAMMPS *); - virtual ~AngleHarmonicKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~AngleHarmonicKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -81,7 +81,7 @@ class AngleHarmonicKokkos : public AngleHarmonic { typename ArrayTypes::t_ffloat_1d d_k; typename ArrayTypes::t_ffloat_1d d_theta0; - void allocate(); + void allocate() override; }; } diff --git a/src/MOFFF/angle_class2_p6.h b/src/MOFFF/angle_class2_p6.h index fcefa99eb2..b4f2e9ff6a 100644 --- a/src/MOFFF/angle_class2_p6.h +++ b/src/MOFFF/angle_class2_p6.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleClass2P6 : public Angle { public: AngleClass2P6(class LAMMPS *); - virtual ~AngleClass2P6(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleClass2P6() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *theta0, *k2, *k3, *k4, *k5, *k6; diff --git a/src/MOFFF/angle_cosine_buck6d.h b/src/MOFFF/angle_cosine_buck6d.h index 44d47ea39d..268ae71141 100644 --- a/src/MOFFF/angle_cosine_buck6d.h +++ b/src/MOFFF/angle_cosine_buck6d.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class AngleCosineBuck6d : public Angle { public: AngleCosineBuck6d(class LAMMPS *); - virtual ~AngleCosineBuck6d(); - virtual void compute(int, int); - void coeff(int, char **); - void init_style(); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCosineBuck6d() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *th0; diff --git a/src/MOLECULE/angle_charmm.h b/src/MOLECULE/angle_charmm.h index 72bae696cb..f864573ce7 100644 --- a/src/MOLECULE/angle_charmm.h +++ b/src/MOLECULE/angle_charmm.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCharmm : public Angle { public: AngleCharmm(class LAMMPS *); - virtual ~AngleCharmm(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCharmm() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *theta0, *k_ub, *r_ub; diff --git a/src/MOLECULE/angle_cosine.h b/src/MOLECULE/angle_cosine.h index 2c7b0ddbc4..19b6222c87 100644 --- a/src/MOLECULE/angle_cosine.h +++ b/src/MOLECULE/angle_cosine.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCosine : public Angle { public: AngleCosine(class LAMMPS *); - virtual ~AngleCosine(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCosine() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k; diff --git a/src/MOLECULE/angle_cosine_squared.h b/src/MOLECULE/angle_cosine_squared.h index d36aac64dd..d8f282ac47 100644 --- a/src/MOLECULE/angle_cosine_squared.h +++ b/src/MOLECULE/angle_cosine_squared.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCosineSquared : public Angle { public: AngleCosineSquared(class LAMMPS *); - virtual ~AngleCosineSquared(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - virtual double single(int, int, int, int); + ~AngleCosineSquared() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *theta0; diff --git a/src/MOLECULE/angle_harmonic.h b/src/MOLECULE/angle_harmonic.h index e722f7d065..718ac4bd0a 100644 --- a/src/MOLECULE/angle_harmonic.h +++ b/src/MOLECULE/angle_harmonic.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleHarmonic : public Angle { public: AngleHarmonic(class LAMMPS *); - virtual ~AngleHarmonic(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *k, *theta0; diff --git a/src/MOLECULE/angle_table.h b/src/MOLECULE/angle_table.h index 6b95cb6a23..83a53ecdd5 100644 --- a/src/MOLECULE/angle_table.h +++ b/src/MOLECULE/angle_table.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class AngleTable : public Angle { public: AngleTable(class LAMMPS *); - virtual ~AngleTable(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int); + ~AngleTable() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int) override; protected: int tabstyle, tablength; diff --git a/src/OPENMP/angle_charmm_omp.h b/src/OPENMP/angle_charmm_omp.h index 80e3777071..f478dfdc89 100644 --- a/src/OPENMP/angle_charmm_omp.h +++ b/src/OPENMP/angle_charmm_omp.h @@ -33,7 +33,7 @@ class AngleCharmmOMP : public AngleCharmm, public ThrOMP { public: AngleCharmmOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_class2_omp.h b/src/OPENMP/angle_class2_omp.h index 03ab80ce23..a9753c2e6b 100644 --- a/src/OPENMP/angle_class2_omp.h +++ b/src/OPENMP/angle_class2_omp.h @@ -33,7 +33,7 @@ class AngleClass2OMP : public AngleClass2, public ThrOMP { public: AngleClass2OMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_cosine_delta_omp.h b/src/OPENMP/angle_cosine_delta_omp.h index 5cd17c5c17..e5e70a24f9 100644 --- a/src/OPENMP/angle_cosine_delta_omp.h +++ b/src/OPENMP/angle_cosine_delta_omp.h @@ -33,7 +33,7 @@ class AngleCosineDeltaOMP : public AngleCosineDelta, public ThrOMP { public: AngleCosineDeltaOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_cosine_omp.h b/src/OPENMP/angle_cosine_omp.h index a02f5340ff..25d07fc565 100644 --- a/src/OPENMP/angle_cosine_omp.h +++ b/src/OPENMP/angle_cosine_omp.h @@ -33,7 +33,7 @@ class AngleCosineOMP : public AngleCosine, public ThrOMP { public: AngleCosineOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_cosine_periodic_omp.h b/src/OPENMP/angle_cosine_periodic_omp.h index 30507be888..45a02cf2c4 100644 --- a/src/OPENMP/angle_cosine_periodic_omp.h +++ b/src/OPENMP/angle_cosine_periodic_omp.h @@ -33,7 +33,7 @@ class AngleCosinePeriodicOMP : public AngleCosinePeriodic, public ThrOMP { public: AngleCosinePeriodicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_cosine_shift_exp_omp.h b/src/OPENMP/angle_cosine_shift_exp_omp.h index e8003e6168..b394e7e529 100644 --- a/src/OPENMP/angle_cosine_shift_exp_omp.h +++ b/src/OPENMP/angle_cosine_shift_exp_omp.h @@ -33,7 +33,7 @@ class AngleCosineShiftExpOMP : public AngleCosineShiftExp, public ThrOMP { public: AngleCosineShiftExpOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_cosine_shift_omp.h b/src/OPENMP/angle_cosine_shift_omp.h index 2502534c28..073f5288f3 100644 --- a/src/OPENMP/angle_cosine_shift_omp.h +++ b/src/OPENMP/angle_cosine_shift_omp.h @@ -33,7 +33,7 @@ class AngleCosineShiftOMP : public AngleCosineShift, public ThrOMP { public: AngleCosineShiftOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_cosine_squared_omp.h b/src/OPENMP/angle_cosine_squared_omp.h index 028fe66be3..50b22fe5e4 100644 --- a/src/OPENMP/angle_cosine_squared_omp.h +++ b/src/OPENMP/angle_cosine_squared_omp.h @@ -33,7 +33,7 @@ class AngleCosineSquaredOMP : public AngleCosineSquared, public ThrOMP { public: AngleCosineSquaredOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_dipole_omp.h b/src/OPENMP/angle_dipole_omp.h index fd3376d80f..ddd7aac6ea 100644 --- a/src/OPENMP/angle_dipole_omp.h +++ b/src/OPENMP/angle_dipole_omp.h @@ -33,7 +33,7 @@ class AngleDipoleOMP : public AngleDipole, public ThrOMP { public: AngleDipoleOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template void eval(int ifrom, int ito, ThrData *const thr); diff --git a/src/OPENMP/angle_fourier_omp.h b/src/OPENMP/angle_fourier_omp.h index 94ea79aaa0..9a5964df49 100644 --- a/src/OPENMP/angle_fourier_omp.h +++ b/src/OPENMP/angle_fourier_omp.h @@ -33,7 +33,7 @@ class AngleFourierOMP : public AngleFourier, public ThrOMP { public: AngleFourierOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_fourier_simple_omp.h b/src/OPENMP/angle_fourier_simple_omp.h index 43893732d3..db96dbfb86 100644 --- a/src/OPENMP/angle_fourier_simple_omp.h +++ b/src/OPENMP/angle_fourier_simple_omp.h @@ -33,7 +33,7 @@ class AngleFourierSimpleOMP : public AngleFourierSimple, public ThrOMP { public: AngleFourierSimpleOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_harmonic_omp.h b/src/OPENMP/angle_harmonic_omp.h index 4e292deed9..8c6cc39f7a 100644 --- a/src/OPENMP/angle_harmonic_omp.h +++ b/src/OPENMP/angle_harmonic_omp.h @@ -33,7 +33,7 @@ class AngleHarmonicOMP : public AngleHarmonic, public ThrOMP { public: AngleHarmonicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_quartic_omp.h b/src/OPENMP/angle_quartic_omp.h index a2bb6666ea..7953891d55 100644 --- a/src/OPENMP/angle_quartic_omp.h +++ b/src/OPENMP/angle_quartic_omp.h @@ -33,7 +33,7 @@ class AngleQuarticOMP : public AngleQuartic, public ThrOMP { public: AngleQuarticOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_sdk_omp.h b/src/OPENMP/angle_sdk_omp.h index 1c32222488..c4d12787f9 100644 --- a/src/OPENMP/angle_sdk_omp.h +++ b/src/OPENMP/angle_sdk_omp.h @@ -33,7 +33,7 @@ class AngleSDKOMP : public AngleSDK, public ThrOMP { public: AngleSDKOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/angle_table_omp.h b/src/OPENMP/angle_table_omp.h index 1e8a55c56a..585e40a934 100644 --- a/src/OPENMP/angle_table_omp.h +++ b/src/OPENMP/angle_table_omp.h @@ -33,7 +33,7 @@ class AngleTableOMP : public AngleTable, public ThrOMP { public: AngleTableOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/YAFF/angle_cross.h b/src/YAFF/angle_cross.h index a23aea3f38..c2cb07b143 100644 --- a/src/YAFF/angle_cross.h +++ b/src/YAFF/angle_cross.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleCross : public Angle { public: AngleCross(class LAMMPS *); - virtual ~AngleCross(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleCross() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *kss, *kbs0, *kbs1, *r00, *r01, *theta0; diff --git a/src/YAFF/angle_mm3.h b/src/YAFF/angle_mm3.h index c61823813e..18ff0a59fc 100644 --- a/src/YAFF/angle_mm3.h +++ b/src/YAFF/angle_mm3.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class AngleMM3 : public Angle { public: AngleMM3(class LAMMPS *); - virtual ~AngleMM3(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, int, int, int); + ~AngleMM3() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, int, int, int) override; protected: double *theta0, *k2; diff --git a/src/angle_deprecated.h b/src/angle_deprecated.h index ba94e0ef10..70e834bf9e 100644 --- a/src/angle_deprecated.h +++ b/src/angle_deprecated.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class AngleDeprecated : public Angle { public: AngleDeprecated(class LAMMPS *lmp) : Angle(lmp) {} - virtual ~AngleDeprecated() {} - virtual void compute(int, int) {} - virtual void settings(int, char **); - virtual void coeff(int, char **) {} - virtual double equilibrium_angle(int) { return 0.0; } - virtual void write_restart(FILE *) {} - virtual void read_restart(FILE *) {} - virtual double single(int, int, int, int) { return 0.0; } + void compute(int, int) override {} + void settings(int, char **) override; + void coeff(int, char **) override {} + double equilibrium_angle(int) override { return 0.0; } + void write_restart(FILE *) override {} + void read_restart(FILE *) override {} + double single(int, int, int, int) override { return 0.0; } }; } // namespace LAMMPS_NS diff --git a/src/angle_hybrid.h b/src/angle_hybrid.h index f0286af6f5..1deb9a6a14 100644 --- a/src/angle_hybrid.h +++ b/src/angle_hybrid.h @@ -31,16 +31,16 @@ class AngleHybrid : public Angle { char **keywords; // keyword for each Angle style AngleHybrid(class LAMMPS *); - ~AngleHybrid(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - double single(int, int, int, int); - double memory_usage(); + ~AngleHybrid() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double single(int, int, int, int) override; + double memory_usage() override; private: int *map; // which style each angle type points to diff --git a/src/angle_zero.h b/src/angle_zero.h index c41fc1a6ff..47bc4aac4f 100644 --- a/src/angle_zero.h +++ b/src/angle_zero.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class AngleZero : public Angle { public: AngleZero(class LAMMPS *); - virtual ~AngleZero(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void settings(int, char **); + ~AngleZero() override; + void compute(int, int) override; + void coeff(int, char **) override; + void settings(int, char **) override; - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; - double single(int, int, int, int); + double single(int, int, int, int) override; protected: double *theta0; From 557e25d6fbe6faf6a230d9cc6884eeaca5aded71 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 20 Jan 2022 18:00:16 -0500 Subject: [PATCH 067/174] Apply override to Bond classes --- src/CG-DNA/bond_oxdna2_fene.h | 3 +-- src/CG-DNA/bond_oxdna_fene.h | 18 ++++++++-------- src/CG-DNA/bond_oxrna2_fene.h | 3 +-- src/CLASS2/bond_class2.h | 18 ++++++++-------- src/EXTRA-MOLECULE/bond_fene_nm.h | 22 ++++++++++---------- src/EXTRA-MOLECULE/bond_gaussian.h | 16 +++++++------- src/EXTRA-MOLECULE/bond_harmonic_shift.h | 16 +++++++------- src/EXTRA-MOLECULE/bond_harmonic_shift_cut.h | 16 +++++++------- src/EXTRA-MOLECULE/bond_nonlinear.h | 18 ++++++++-------- src/INTEL/bond_fene_intel.h | 6 +++--- src/INTEL/bond_harmonic_intel.h | 6 +++--- src/INTEL/fix_intel.h | 20 +++++++++--------- src/KOKKOS/bond_class2_kokkos.h | 8 +++---- src/KOKKOS/bond_fene_kokkos.h | 10 ++++----- src/KOKKOS/bond_harmonic_kokkos.h | 10 ++++----- src/MISC/bond_special.h | 18 ++++++++-------- src/MOLECULE/bond_fene.h | 20 +++++++++--------- src/MOLECULE/bond_fene_expand.h | 18 ++++++++-------- src/MOLECULE/bond_gromos.h | 18 ++++++++-------- src/MOLECULE/bond_harmonic.h | 18 ++++++++-------- src/MOLECULE/bond_morse.h | 18 ++++++++-------- src/MOLECULE/bond_quartic.h | 18 ++++++++-------- src/MOLECULE/bond_table.h | 20 +++++++++--------- src/OPENMP/bond_class2_omp.h | 2 +- src/OPENMP/bond_fene_expand_omp.h | 2 +- src/OPENMP/bond_fene_omp.h | 2 +- src/OPENMP/bond_gromos_omp.h | 2 +- src/OPENMP/bond_harmonic_omp.h | 2 +- src/OPENMP/bond_harmonic_shift_cut_omp.h | 2 +- src/OPENMP/bond_harmonic_shift_omp.h | 2 +- src/OPENMP/bond_morse_omp.h | 2 +- src/OPENMP/bond_nonlinear_omp.h | 2 +- src/OPENMP/bond_quartic_omp.h | 2 +- src/OPENMP/bond_table_omp.h | 2 +- src/YAFF/bond_mm3.h | 16 +++++++------- src/bond_deprecated.h | 15 +++++++------ src/bond_hybrid.h | 20 +++++++++--------- src/bond_zero.h | 20 +++++++++--------- 38 files changed, 214 insertions(+), 217 deletions(-) diff --git a/src/CG-DNA/bond_oxdna2_fene.h b/src/CG-DNA/bond_oxdna2_fene.h index 6c932f9421..3b0c5e0a36 100644 --- a/src/CG-DNA/bond_oxdna2_fene.h +++ b/src/CG-DNA/bond_oxdna2_fene.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class BondOxdna2Fene : public BondOxdnaFene { public: BondOxdna2Fene(class LAMMPS *lmp) : BondOxdnaFene(lmp) {} - virtual ~BondOxdna2Fene() {} - virtual void compute_interaction_sites(double *, double *, double *, double *) const; + void compute_interaction_sites(double *, double *, double *, double *) const override; }; } // namespace LAMMPS_NS diff --git a/src/CG-DNA/bond_oxdna_fene.h b/src/CG-DNA/bond_oxdna_fene.h index 42b542a6fb..d2e4eed183 100644 --- a/src/CG-DNA/bond_oxdna_fene.h +++ b/src/CG-DNA/bond_oxdna_fene.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class BondOxdnaFene : public Bond { public: BondOxdnaFene(class LAMMPS *lmp) : Bond(lmp) {} - virtual ~BondOxdnaFene(); + ~BondOxdnaFene() override; virtual void compute_interaction_sites(double *, double *, double *, double *) const; - virtual void compute(int, int); - void coeff(int, char **); - void init_style(); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double *k, *Delta, *r0; // FENE diff --git a/src/CG-DNA/bond_oxrna2_fene.h b/src/CG-DNA/bond_oxrna2_fene.h index a805cd005f..4260b69174 100644 --- a/src/CG-DNA/bond_oxrna2_fene.h +++ b/src/CG-DNA/bond_oxrna2_fene.h @@ -27,9 +27,8 @@ namespace LAMMPS_NS { class BondOxrna2Fene : public BondOxdnaFene { public: BondOxrna2Fene(class LAMMPS *lmp) : BondOxdnaFene(lmp) {} - virtual ~BondOxrna2Fene() {} - virtual void compute_interaction_sites(double *, double *, double *, double *) const; + void compute_interaction_sites(double *, double *, double *, double *) const override; }; } // namespace LAMMPS_NS diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h index 75c1d52c1f..3708bcef95 100644 --- a/src/CLASS2/bond_class2.h +++ b/src/CLASS2/bond_class2.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondClass2 : public Bond { public: BondClass2(class LAMMPS *); - virtual ~BondClass2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondClass2() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *r0, *k2, *k3, *k4; diff --git a/src/EXTRA-MOLECULE/bond_fene_nm.h b/src/EXTRA-MOLECULE/bond_fene_nm.h index f00394c6d8..048b7f4c94 100644 --- a/src/EXTRA-MOLECULE/bond_fene_nm.h +++ b/src/EXTRA-MOLECULE/bond_fene_nm.h @@ -26,22 +26,22 @@ namespace LAMMPS_NS { class BondFENENM : public BondFENE { public: BondFENENM(class LAMMPS *); - virtual ~BondFENENM(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void init_style(); - double equilibrium_distance(int); - virtual void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondFENENM() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double TWO_1_3; double *nn, *mm; - virtual void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-MOLECULE/bond_gaussian.h b/src/EXTRA-MOLECULE/bond_gaussian.h index 07ed5d771d..4287a6a388 100644 --- a/src/EXTRA-MOLECULE/bond_gaussian.h +++ b/src/EXTRA-MOLECULE/bond_gaussian.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class BondGaussian : public Bond { public: BondGaussian(class LAMMPS *); - virtual ~BondGaussian(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondGaussian() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: int *nterms; diff --git a/src/EXTRA-MOLECULE/bond_harmonic_shift.h b/src/EXTRA-MOLECULE/bond_harmonic_shift.h index 484a00b787..0b7d0ab6b8 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_shift.h +++ b/src/EXTRA-MOLECULE/bond_harmonic_shift.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class BondHarmonicShift : public Bond { public: BondHarmonicShift(class LAMMPS *); - virtual ~BondHarmonicShift(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondHarmonicShift() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double *k, *r0, *r1; diff --git a/src/EXTRA-MOLECULE/bond_harmonic_shift_cut.h b/src/EXTRA-MOLECULE/bond_harmonic_shift_cut.h index 01dc9cb593..74d97143f7 100644 --- a/src/EXTRA-MOLECULE/bond_harmonic_shift_cut.h +++ b/src/EXTRA-MOLECULE/bond_harmonic_shift_cut.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class BondHarmonicShiftCut : public Bond { public: BondHarmonicShiftCut(class LAMMPS *); - virtual ~BondHarmonicShiftCut(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondHarmonicShiftCut() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double *k, *r0, *r1; diff --git a/src/EXTRA-MOLECULE/bond_nonlinear.h b/src/EXTRA-MOLECULE/bond_nonlinear.h index 4fcf87cdf0..63e6279462 100644 --- a/src/EXTRA-MOLECULE/bond_nonlinear.h +++ b/src/EXTRA-MOLECULE/bond_nonlinear.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondNonlinear : public Bond { public: BondNonlinear(class LAMMPS *); - virtual ~BondNonlinear(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondNonlinear() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *epsilon, *r0, *lamda; diff --git a/src/INTEL/bond_fene_intel.h b/src/INTEL/bond_fene_intel.h index 0c71f1a9d0..0bb5479ede 100644 --- a/src/INTEL/bond_fene_intel.h +++ b/src/INTEL/bond_fene_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class BondFENEIntel : public BondFENE { public: BondFENEIntel(class LAMMPS *); - virtual ~BondFENEIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~BondFENEIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; diff --git a/src/INTEL/bond_harmonic_intel.h b/src/INTEL/bond_harmonic_intel.h index 612f4e7ca1..7568dbe6e7 100644 --- a/src/INTEL/bond_harmonic_intel.h +++ b/src/INTEL/bond_harmonic_intel.h @@ -33,9 +33,9 @@ namespace LAMMPS_NS { class BondHarmonicIntel : public BondHarmonic { public: BondHarmonicIntel(class LAMMPS *); - virtual ~BondHarmonicIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~BondHarmonicIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; diff --git a/src/INTEL/fix_intel.h b/src/INTEL/fix_intel.h index 8e2ca5e7d1..18d8563a1e 100644 --- a/src/INTEL/fix_intel.h +++ b/src/INTEL/fix_intel.h @@ -40,27 +40,27 @@ template class IntelBuffers; class FixIntel : public Fix { public: FixIntel(class LAMMPS *, int, char **); - virtual ~FixIntel(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - inline void min_setup(int in) { setup(in); } - void setup_pre_reverse(int eflag = 0, int vflag = 0); + ~FixIntel() override; + int setmask() override; + void init() override; + void setup(int) override; + inline void min_setup(int in) override { setup(in); } + void setup_pre_reverse(int eflag = 0, int vflag = 0) override; bool pair_hybrid_check(); void pair_init_check(const bool cdmessage = false); void bond_init_check(); void kspace_init_check(); - void pre_reverse(int eflag = 0, int vflag = 0); - inline void min_pre_reverse(int eflag = 0, int vflag = 0) { pre_reverse(eflag, vflag); } + void pre_reverse(int eflag = 0, int vflag = 0) override; + inline void min_pre_reverse(int eflag = 0, int vflag = 0) override { pre_reverse(eflag, vflag); } - void post_run() { _print_pkg_info = 1; } + void post_run() override { _print_pkg_info = 1; } // Get all forces, calculation results from coprocesser void sync_coprocessor(); - double memory_usage(); + double memory_usage() override; typedef struct { double x, y, z; diff --git a/src/KOKKOS/bond_class2_kokkos.h b/src/KOKKOS/bond_class2_kokkos.h index 529046845f..8a4222ee0b 100644 --- a/src/KOKKOS/bond_class2_kokkos.h +++ b/src/KOKKOS/bond_class2_kokkos.h @@ -40,10 +40,10 @@ class BondClass2Kokkos : public BondClass2 { typedef EV_FLOAT value_type; BondClass2Kokkos(class LAMMPS *); - virtual ~BondClass2Kokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~BondClass2Kokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/bond_fene_kokkos.h b/src/KOKKOS/bond_fene_kokkos.h index d52289990c..fbf1459dae 100644 --- a/src/KOKKOS/bond_fene_kokkos.h +++ b/src/KOKKOS/bond_fene_kokkos.h @@ -39,10 +39,10 @@ class BondFENEKokkos : public BondFENE { typedef ArrayTypes AT; BondFENEKokkos(class LAMMPS *); - virtual ~BondFENEKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~BondFENEKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -92,7 +92,7 @@ class BondFENEKokkos : public BondFENE { typename AT::t_ffloat_1d d_epsilon; typename AT::t_ffloat_1d d_sigma; - void allocate(); + void allocate() override; }; } diff --git a/src/KOKKOS/bond_harmonic_kokkos.h b/src/KOKKOS/bond_harmonic_kokkos.h index 8bd6dc4477..301adf69d0 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.h +++ b/src/KOKKOS/bond_harmonic_kokkos.h @@ -39,10 +39,10 @@ class BondHarmonicKokkos : public BondHarmonic { typedef EV_FLOAT value_type; BondHarmonicKokkos(class LAMMPS *); - virtual ~BondHarmonicKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~BondHarmonicKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -79,7 +79,7 @@ class BondHarmonicKokkos : public BondHarmonic { typename AT::t_ffloat_1d d_k; typename AT::t_ffloat_1d d_r0; - void allocate(); + void allocate() override; }; } diff --git a/src/MISC/bond_special.h b/src/MISC/bond_special.h index 80a32b7896..e510486271 100644 --- a/src/MISC/bond_special.h +++ b/src/MISC/bond_special.h @@ -29,15 +29,15 @@ namespace LAMMPS_NS { class BondSpecial : public Bond { public: BondSpecial(class LAMMPS *); - virtual ~BondSpecial(); - void init_style(); - void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondSpecial() override; + void init_style() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double *factor_lj, *factor_coul; diff --git a/src/MOLECULE/bond_fene.h b/src/MOLECULE/bond_fene.h index 76ee2ea34f..1770893331 100644 --- a/src/MOLECULE/bond_fene.h +++ b/src/MOLECULE/bond_fene.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class BondFENE : public Bond { public: BondFENE(class LAMMPS *lmp) : Bond(lmp) {} - virtual ~BondFENE(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void init_style(); - double equilibrium_distance(int); - virtual void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondFENE() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *k, *r0, *epsilon, *sigma; diff --git a/src/MOLECULE/bond_fene_expand.h b/src/MOLECULE/bond_fene_expand.h index 9252165293..6ebd213a7f 100644 --- a/src/MOLECULE/bond_fene_expand.h +++ b/src/MOLECULE/bond_fene_expand.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondFENEExpand : public Bond { public: BondFENEExpand(class LAMMPS *lmp) : Bond(lmp) {} - virtual ~BondFENEExpand(); - virtual void compute(int, int); - void coeff(int, char **); - void init_style(); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondFENEExpand() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double *k, *r0, *epsilon, *sigma, *shift; diff --git a/src/MOLECULE/bond_gromos.h b/src/MOLECULE/bond_gromos.h index 1f555d09a8..bd73e11172 100644 --- a/src/MOLECULE/bond_gromos.h +++ b/src/MOLECULE/bond_gromos.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondGromos : public Bond { public: BondGromos(class LAMMPS *); - virtual ~BondGromos(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondGromos() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *k, *r0; diff --git a/src/MOLECULE/bond_harmonic.h b/src/MOLECULE/bond_harmonic.h index eb6c5e062e..443290aec1 100644 --- a/src/MOLECULE/bond_harmonic.h +++ b/src/MOLECULE/bond_harmonic.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondHarmonic : public Bond { public: BondHarmonic(class LAMMPS *); - virtual ~BondHarmonic(); - virtual void compute(int, int); - virtual void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *k, *r0; diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h index 10e99c16a3..26073cd449 100644 --- a/src/MOLECULE/bond_morse.h +++ b/src/MOLECULE/bond_morse.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondMorse : public Bond { public: BondMorse(class LAMMPS *); - virtual ~BondMorse(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + ~BondMorse() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *d0, *alpha, *r0; diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h index 35ec705849..9feed38b09 100644 --- a/src/MOLECULE/bond_quartic.h +++ b/src/MOLECULE/bond_quartic.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class BondQuartic : public Bond { public: BondQuartic(class LAMMPS *); - virtual ~BondQuartic(); - virtual void compute(int, int); - void coeff(int, char **); - void init_style(); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondQuartic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double TWO_1_3; diff --git a/src/MOLECULE/bond_table.h b/src/MOLECULE/bond_table.h index b1b506a2a4..205397516a 100644 --- a/src/MOLECULE/bond_table.h +++ b/src/MOLECULE/bond_table.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class BondTable : public Bond { public: BondTable(class LAMMPS *); - virtual ~BondTable(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, double, int, int, double &); + ~BondTable() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, double, int, int, double &) override; protected: int tabstyle, tablength; diff --git a/src/OPENMP/bond_class2_omp.h b/src/OPENMP/bond_class2_omp.h index 0a868c6ef4..24a1ccebbc 100644 --- a/src/OPENMP/bond_class2_omp.h +++ b/src/OPENMP/bond_class2_omp.h @@ -33,7 +33,7 @@ class BondClass2OMP : public BondClass2, public ThrOMP { public: BondClass2OMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_fene_expand_omp.h b/src/OPENMP/bond_fene_expand_omp.h index e44444dd06..8995b2a00e 100644 --- a/src/OPENMP/bond_fene_expand_omp.h +++ b/src/OPENMP/bond_fene_expand_omp.h @@ -33,7 +33,7 @@ class BondFENEExpandOMP : public BondFENEExpand, public ThrOMP { public: BondFENEExpandOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_fene_omp.h b/src/OPENMP/bond_fene_omp.h index 65ef8e993d..0029cc7db5 100644 --- a/src/OPENMP/bond_fene_omp.h +++ b/src/OPENMP/bond_fene_omp.h @@ -33,7 +33,7 @@ class BondFENEOMP : public BondFENE, public ThrOMP { public: BondFENEOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_gromos_omp.h b/src/OPENMP/bond_gromos_omp.h index 8077dad2ba..c9ff442fa6 100644 --- a/src/OPENMP/bond_gromos_omp.h +++ b/src/OPENMP/bond_gromos_omp.h @@ -33,7 +33,7 @@ class BondGromosOMP : public BondGromos, public ThrOMP { public: BondGromosOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_harmonic_omp.h b/src/OPENMP/bond_harmonic_omp.h index eab41e6515..a607d810b8 100644 --- a/src/OPENMP/bond_harmonic_omp.h +++ b/src/OPENMP/bond_harmonic_omp.h @@ -33,7 +33,7 @@ class BondHarmonicOMP : public BondHarmonic, public ThrOMP { public: BondHarmonicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_harmonic_shift_cut_omp.h b/src/OPENMP/bond_harmonic_shift_cut_omp.h index 3f467b943d..976013cad4 100644 --- a/src/OPENMP/bond_harmonic_shift_cut_omp.h +++ b/src/OPENMP/bond_harmonic_shift_cut_omp.h @@ -33,7 +33,7 @@ class BondHarmonicShiftCutOMP : public BondHarmonicShiftCut, public ThrOMP { public: BondHarmonicShiftCutOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_harmonic_shift_omp.h b/src/OPENMP/bond_harmonic_shift_omp.h index b7004b7d14..cfbdc7d9f6 100644 --- a/src/OPENMP/bond_harmonic_shift_omp.h +++ b/src/OPENMP/bond_harmonic_shift_omp.h @@ -33,7 +33,7 @@ class BondHarmonicShiftOMP : public BondHarmonicShift, public ThrOMP { public: BondHarmonicShiftOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_morse_omp.h b/src/OPENMP/bond_morse_omp.h index 2184488e0f..592328fc0c 100644 --- a/src/OPENMP/bond_morse_omp.h +++ b/src/OPENMP/bond_morse_omp.h @@ -33,7 +33,7 @@ class BondMorseOMP : public BondMorse, public ThrOMP { public: BondMorseOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_nonlinear_omp.h b/src/OPENMP/bond_nonlinear_omp.h index bdf496093f..8799b159c6 100644 --- a/src/OPENMP/bond_nonlinear_omp.h +++ b/src/OPENMP/bond_nonlinear_omp.h @@ -33,7 +33,7 @@ class BondNonlinearOMP : public BondNonlinear, public ThrOMP { public: BondNonlinearOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_quartic_omp.h b/src/OPENMP/bond_quartic_omp.h index 169da27562..dd010537de 100644 --- a/src/OPENMP/bond_quartic_omp.h +++ b/src/OPENMP/bond_quartic_omp.h @@ -33,7 +33,7 @@ class BondQuarticOMP : public BondQuartic, public ThrOMP { public: BondQuarticOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/bond_table_omp.h b/src/OPENMP/bond_table_omp.h index d6147709e3..886fb0c9d7 100644 --- a/src/OPENMP/bond_table_omp.h +++ b/src/OPENMP/bond_table_omp.h @@ -33,7 +33,7 @@ class BondTableOMP : public BondTable, public ThrOMP { public: BondTableOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/YAFF/bond_mm3.h b/src/YAFF/bond_mm3.h index aece32e359..799677d360 100644 --- a/src/YAFF/bond_mm3.h +++ b/src/YAFF/bond_mm3.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class BondMM3 : public Bond { public: BondMM3(class LAMMPS *); - virtual ~BondMM3(); - virtual void compute(int, int); - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - double single(int, double, int, int, double &); + ~BondMM3() override; + void compute(int, int) override; + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; protected: double *r0, *k2; diff --git a/src/bond_deprecated.h b/src/bond_deprecated.h index 43f58da093..cfc770cf20 100644 --- a/src/bond_deprecated.h +++ b/src/bond_deprecated.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class BondDeprecated : public Bond { public: BondDeprecated(class LAMMPS *lmp) : Bond(lmp) {} - virtual ~BondDeprecated() {} - virtual void compute(int, int) {} - virtual void settings(int, char **); - virtual void coeff(int, char **) {} - virtual double equilibrium_distance(int) { return 0.0; } - virtual void write_restart(FILE *) {} - virtual void read_restart(FILE *) {} - virtual double single(int, double, int, int, double &) { return 0.0; } + void compute(int, int) override {} + void settings(int, char **) override; + void coeff(int, char **) override {} + double equilibrium_distance(int) override { return 0.0; } + void write_restart(FILE *) override {} + void read_restart(FILE *) override {} + double single(int, double, int, int, double &) override { return 0.0; } }; } // namespace LAMMPS_NS diff --git a/src/bond_hybrid.h b/src/bond_hybrid.h index d5e059b317..ba795c2867 100644 --- a/src/bond_hybrid.h +++ b/src/bond_hybrid.h @@ -33,16 +33,16 @@ class BondHybrid : public Bond { char **keywords; // keyword for each Bond style BondHybrid(class LAMMPS *); - ~BondHybrid(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - double single(int, double, int, int, double &); - double memory_usage(); + ~BondHybrid() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double single(int, double, int, int, double &) override; + double memory_usage() override; private: int *map; // which style each bond type points to diff --git a/src/bond_zero.h b/src/bond_zero.h index c8ed3a666e..050b4f1a9b 100644 --- a/src/bond_zero.h +++ b/src/bond_zero.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class BondZero : public Bond { public: BondZero(class LAMMPS *); - virtual ~BondZero(); - virtual void compute(int, int); - virtual void settings(int, char **); + ~BondZero() override; + void compute(int, int) override; + void settings(int, char **) override; - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *r0; From 9c8431bf87dda3d7b87f5acbfc99f7dc79890225 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 06:55:06 -0500 Subject: [PATCH 068/174] correct calls to memset() --- src/EXTRA-FIX/fix_gle.cpp | 5 ++--- src/EXTRA-PAIR/pair_e3b.cpp | 3 +-- src/EXTRA-PAIR/pair_e3b.h | 1 - src/MOLECULE/fix_cmap.cpp | 2 +- src/REAXFF/fix_acks2_reaxff.cpp | 2 +- src/REAXFF/fix_qeq_reaxff.cpp | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/EXTRA-FIX/fix_gle.cpp b/src/EXTRA-FIX/fix_gle.cpp index d7061e199c..acb7b84fe1 100644 --- a/src/EXTRA-FIX/fix_gle.cpp +++ b/src/EXTRA-FIX/fix_gle.cpp @@ -211,6 +211,8 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : S = new double[ns1sq]; TT = new double[ns1sq]; ST = new double[ns1sq]; + memset(A,0,sizeof(double)*ns1sq); + memset(C,0,sizeof(double)*ns1sq); // start temperature (t ramp) t_start = utils::numeric(FLERR,arg[4],false,lmp); @@ -223,7 +225,6 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : // LOADING A matrix char *fname = arg[7]; - memset(A, ns1sq, sizeof(double)); if (comm->me == 0) { PotentialFileReader reader(lmp,fname,"fix gle A matrix"); try { @@ -256,14 +257,12 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : if (fnoneq == 0) { t_target=t_start; const double kT = t_target * force->boltz / force->mvv2e; - memset(C,0,sizeof(double)*ns1sq); for (int i=0; ime == 0) { PotentialFileReader reader(lmp,fname,"fix gle C matrix"); try { diff --git a/src/EXTRA-PAIR/pair_e3b.cpp b/src/EXTRA-PAIR/pair_e3b.cpp index 7e865ac6f8..3af8e754c0 100644 --- a/src/EXTRA-PAIR/pair_e3b.cpp +++ b/src/EXTRA-PAIR/pair_e3b.cpp @@ -99,7 +99,7 @@ void PairE3B::compute(int eflag, int vflag) ev_init(eflag, vflag); //clear sumExp array - memset(sumExp, 0.0, nbytes); + memset(sumExp, 0, sizeof(double)*maxID); evdwl = 0.0; pvector[0] = pvector[1] = pvector[2] = pvector[3] = 0.0; @@ -364,7 +364,6 @@ void PairE3B::allocateE3B() maxID = find_maxID(); if (!natoms) error->all(FLERR, "No atoms found"); memory->create(sumExp, maxID, "pair:sumExp"); - nbytes = sizeof(double) * maxID; } /* ---------------------------------------------------------------------- diff --git a/src/EXTRA-PAIR/pair_e3b.h b/src/EXTRA-PAIR/pair_e3b.h index f6cf916918..1f38c18293 100644 --- a/src/EXTRA-PAIR/pair_e3b.h +++ b/src/EXTRA-PAIR/pair_e3b.h @@ -50,7 +50,6 @@ class PairE3B : public Pair { int **pairO, ***pairH; // pair lists double ***exps, ****del3, ***fpair3, *sumExp; int maxID; //size of global sumExp array - size_t nbytes; //size of sumExp array in bytes int natoms; //to make sure number of atoms is constant virtual void allocate(); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index c6e356e829..34f54ef26c 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -637,7 +637,7 @@ void FixCMAP::read_grid_map(char *cmapfile) { if (comm->me == 0) { try { - memset(&cmapgrid[0][0][0], 6*CMAPDIM*CMAPDIM, sizeof(double)); + memset(&cmapgrid[0][0][0], 0, 6*CMAPDIM*CMAPDIM*sizeof(double)); PotentialFileReader reader(lmp, cmapfile, "cmap grid"); // there are six maps in this order. diff --git a/src/REAXFF/fix_acks2_reaxff.cpp b/src/REAXFF/fix_acks2_reaxff.cpp index b6789b1b2e..21cce5b55a 100644 --- a/src/REAXFF/fix_acks2_reaxff.cpp +++ b/src/REAXFF/fix_acks2_reaxff.cpp @@ -429,7 +429,7 @@ void FixACKS2ReaxFF::compute_X() double **x = atom->x; int *mask = atom->mask; - memset(X_diag,0.0,atom->nmax*sizeof(double)); + memset(X_diag,0,atom->nmax*sizeof(double)); // fill in the X matrix m_fill = 0; diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index fa8fa79e00..08a4e21fe5 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -1084,7 +1084,7 @@ void FixQEqReaxFF::vector_add(double* dest, double c, double* v, int k) void FixQEqReaxFF::get_chi_field() { - memset(&chi_field[0],0.0,atom->nmax*sizeof(double)); + memset(&chi_field[0],0,atom->nmax*sizeof(double)); if (!efield) return; const double * const *x = (const double * const *)atom->x; From 67dec40afa7aafccfdb629835e34ad93a58b1b36 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 06:55:20 -0500 Subject: [PATCH 069/174] make certain pointers are initialized --- src/EXTRA-PAIR/pair_harmonic_cut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-PAIR/pair_harmonic_cut.cpp b/src/EXTRA-PAIR/pair_harmonic_cut.cpp index bd0e48efdc..f2e1c422fe 100644 --- a/src/EXTRA-PAIR/pair_harmonic_cut.cpp +++ b/src/EXTRA-PAIR/pair_harmonic_cut.cpp @@ -35,7 +35,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -PairHarmonicCut::PairHarmonicCut(LAMMPS *lmp) : Pair(lmp) +PairHarmonicCut::PairHarmonicCut(LAMMPS *lmp) : Pair(lmp), k(nullptr), cut(nullptr) { writedata = 1; } From 3a6bd2e698b06efca393294ac2f212527b4acc1a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 10:47:49 -0500 Subject: [PATCH 070/174] update comment about pair_write restrictions --- doc/src/pair_write.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/pair_write.rst b/doc/src/pair_write.rst index 1d88137255..b62383cb7b 100644 --- a/doc/src/pair_write.rst +++ b/doc/src/pair_write.rst @@ -76,8 +76,10 @@ must be set before this command can be invoked. Due to how the pairwise force is computed, an inner value > 0.0 must be specified even if the potential has a finite value at r = 0.0. -For EAM potentials, the pair_write command only tabulates the -pairwise portion of the potential, not the embedding portion. +The *pair_write* command can only be used for pairwise additive +interactions for which a `Pair::single()` function can be and has +been implemented. This excludes for example manybody potentials +or TIP4P coulomb styles. Related commands """""""""""""""" From 3311b1344cee3676468ebe06679c6b95c28639cb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 10:48:35 -0500 Subject: [PATCH 071/174] consolidate pair-wise vs pairwise spelling --- doc/src/Developer_org.rst | 2 +- doc/src/Errors_warnings.rst | 2 +- doc/src/Run_output.rst | 4 ++-- doc/src/Speed_kokkos.rst | 2 +- doc/src/balance.rst | 2 +- doc/src/compute_pressure_cylinder.rst | 2 +- doc/src/package.rst | 2 +- doc/src/pair_charmm.rst | 2 +- doc/src/pair_dpd.rst | 2 +- doc/src/pair_python.rst | 2 +- doc/src/pair_style.rst | 4 ++-- doc/src/pair_sw.rst | 2 +- doc/src/run_style.rst | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/Developer_org.rst b/doc/src/Developer_org.rst index b5acdf5631..ce36d9a590 100644 --- a/doc/src/Developer_org.rst +++ b/doc/src/Developer_org.rst @@ -225,7 +225,7 @@ follows: commands in an input script. - The Force class computes various forces between atoms. The Pair - parent class is for non-bonded or pair-wise forces, which in LAMMPS + parent class is for non-bonded or pairwise forces, which in LAMMPS also includes many-body forces such as the Tersoff 3-body potential if those are computed by walking pairwise neighbor lists. The Bond, Angle, Dihedral, Improper parent classes are styles for bonded diff --git a/doc/src/Errors_warnings.rst b/doc/src/Errors_warnings.rst index d7a97c1507..2d588a1b77 100644 --- a/doc/src/Errors_warnings.rst +++ b/doc/src/Errors_warnings.rst @@ -416,7 +416,7 @@ This will most likely cause errors in kinetic fluctuations. not defined for the specified atom style. *Molecule has bond topology but no special bond settings* - This means the bonded atoms will not be excluded in pair-wise + This means the bonded atoms will not be excluded in pairwise interactions. *Molecule template for create_atoms has multiple molecules* diff --git a/doc/src/Run_output.rst b/doc/src/Run_output.rst index 8adfd4b293..a988be94ad 100644 --- a/doc/src/Run_output.rst +++ b/doc/src/Run_output.rst @@ -106,7 +106,7 @@ individual ranks. Here is an example output for this section: ---------- The third section above lists the number of owned atoms (Nlocal), -ghost atoms (Nghost), and pair-wise neighbors stored per processor. +ghost atoms (Nghost), and pairwise neighbors stored per processor. The max and min values give the spread of these values across processors with a 10-bin histogram showing the distribution. The total number of histogram counts is equal to the number of processors. @@ -114,7 +114,7 @@ number of histogram counts is equal to the number of processors. ---------- The last section gives aggregate statistics (across all processors) -for pair-wise neighbors and special neighbors that LAMMPS keeps track +for pairwise neighbors and special neighbors that LAMMPS keeps track of (see the :doc:`special_bonds ` command). The number of times neighbor lists were rebuilt is tallied, as is the number of potentially *dangerous* rebuilds. If atom movement triggered neighbor diff --git a/doc/src/Speed_kokkos.rst b/doc/src/Speed_kokkos.rst index 14c2ec680e..8b9b2e99af 100644 --- a/doc/src/Speed_kokkos.rst +++ b/doc/src/Speed_kokkos.rst @@ -214,7 +214,7 @@ threads/task as Nt. The product of these two values should be N, i.e. The default for the :doc:`package kokkos ` command when running on KNL is to use "half" neighbor lists and set the Newton flag to "on" for both pairwise and bonded interactions. This will typically - be best for many-body potentials. For simpler pair-wise potentials, it + be best for many-body potentials. For simpler pairwise potentials, it may be faster to use a "full" neighbor list with Newton flag to "off". Use the "-pk kokkos" :doc:`command-line switch ` to change the default :doc:`package kokkos ` options. See its page for diff --git a/doc/src/balance.rst b/doc/src/balance.rst index 5063a502bb..1d24e467d8 100644 --- a/doc/src/balance.rst +++ b/doc/src/balance.rst @@ -383,7 +383,7 @@ multiple groups, its weight is the product of the weight factors. This weight style is useful in combination with pair style :doc:`hybrid `, e.g. when combining a more costly many-body -potential with a fast pair-wise potential. It is also useful when +potential with a fast pairwise potential. It is also useful when using :doc:`run_style respa ` where some portions of the system have many bonded interactions and others none. It assumes that the computational cost for each group remains constant over time. diff --git a/doc/src/compute_pressure_cylinder.rst b/doc/src/compute_pressure_cylinder.rst index a008254540..9913ef159b 100644 --- a/doc/src/compute_pressure_cylinder.rst +++ b/doc/src/compute_pressure_cylinder.rst @@ -61,7 +61,7 @@ Restrictions This compute currently calculates the pressure tensor contributions for pair styles only (i.e. no bond, angle, dihedral, etc. contributions and in the presence of bonded interactions, the result will be incorrect -due to exclusions for special bonds) and requires pair-wise force +due to exclusions for special bonds) and requires pairwise force calculations not available for most many-body pair styles. K-space calculations are also excluded. Note that this pressure compute outputs the configurational terms only; the kinetic contribution is not included diff --git a/doc/src/package.rst b/doc/src/package.rst index 2cf772ea5a..437601dc60 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -460,7 +460,7 @@ using *neigh/thread* *on*, a full neighbor list must also be used. Using is turned on by default only when there are 16K atoms or less owned by an MPI rank and when using a full neighbor list. Not all KOKKOS-enabled potentials support this keyword yet, and only thread over atoms. Many -simple pair-wise potentials such as Lennard-Jones do support threading +simple pairwise potentials such as Lennard-Jones do support threading over both atoms and neighbors. The *newton* keyword sets the Newton flags for pairwise and bonded diff --git a/doc/src/pair_charmm.rst b/doc/src/pair_charmm.rst index d45ef58060..e1469ae323 100644 --- a/doc/src/pair_charmm.rst +++ b/doc/src/pair_charmm.rst @@ -119,7 +119,7 @@ name are the older, original LAMMPS implementations. They compute the LJ and Coulombic interactions with an energy switching function (esw, shown in the formula below as S(r)), which ramps the energy smoothly to zero between the inner and outer cutoff. This can cause -irregularities in pair-wise forces (due to the discontinuous second +irregularities in pairwise forces (due to the discontinuous second derivative of energy at the boundaries of the switching region), which in some cases can result in detectable artifacts in an MD simulation. diff --git a/doc/src/pair_dpd.rst b/doc/src/pair_dpd.rst index 8a8b35e50a..8c61c789a6 100644 --- a/doc/src/pair_dpd.rst +++ b/doc/src/pair_dpd.rst @@ -50,7 +50,7 @@ Style *dpd* computes a force field for dissipative particle dynamics Style *dpd/tstat* invokes a DPD thermostat on pairwise interactions, which is equivalent to the non-conservative portion of the DPD force -field. This pair-wise thermostat can be used in conjunction with any +field. This pairwise thermostat can be used in conjunction with any :doc:`pair style `, and in leiu of per-particle thermostats like :doc:`fix langevin ` or ensemble thermostats like Nose Hoover as implemented by :doc:`fix nvt `. To use diff --git a/doc/src/pair_python.rst b/doc/src/pair_python.rst index 35e07dbd11..65e1cd1611 100644 --- a/doc/src/pair_python.rst +++ b/doc/src/pair_python.rst @@ -164,7 +164,7 @@ Following the *LJCutMelt* example, here are the two functions: .. note:: The evaluation of scripted python code will slow down the - computation pair-wise interactions quite significantly. However, this + computation pairwise interactions quite significantly. However, this can be largely worked around through using the python pair style not for the actual simulation, but to generate tabulated potentials on the fly using the :doc:`pair_write ` command. Please see below diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index f657e29aa3..4f1f1e733f 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -154,10 +154,10 @@ accelerated styles exist. * :doc:`coul/wolf/cs ` - Coulomb via Wolf potential with core/shell adjustments * :doc:`dpd ` - dissipative particle dynamics (DPD) * :doc:`dpd/ext ` - generalized force field for DPD -* :doc:`dpd/ext/tstat ` - pair-wise DPD thermostatting with generalized force field +* :doc:`dpd/ext/tstat ` - pairwise DPD thermostatting with generalized force field * :doc:`dpd/fdt ` - DPD for constant temperature and pressure * :doc:`dpd/fdt/energy ` - DPD for constant energy and enthalpy -* :doc:`dpd/tstat ` - pair-wise DPD thermostatting +* :doc:`dpd/tstat ` - pairwise DPD thermostatting * :doc:`dsmc ` - Direct Simulation Monte Carlo (DSMC) * :doc:`e3b ` - Explicit-three body (E3B) water model * :doc:`drip ` - Dihedral-angle-corrected registry-dependent interlayer potential (DRIP) diff --git a/doc/src/pair_sw.rst b/doc/src/pair_sw.rst index d71999b2d4..d87da43b2c 100644 --- a/doc/src/pair_sw.rst +++ b/doc/src/pair_sw.rst @@ -202,7 +202,7 @@ elements are the same. Thus the two-body parameters for Si interacting with C, comes from the SiCC entry. The three-body parameters can in principle be specific to the three elements of the configuration. In the literature, however, the three-body parameters -are usually defined by simple formulas involving two sets of pair-wise +are usually defined by simple formulas involving two sets of pairwise parameters, corresponding to the ij and ik pairs, where i is the center atom. The user must ensure that the correct combining rule is used to calculate the values of the three-body parameters for diff --git a/doc/src/run_style.rst b/doc/src/run_style.rst index b4d1c22113..fd63c82b90 100644 --- a/doc/src/run_style.rst +++ b/doc/src/run_style.rst @@ -89,7 +89,7 @@ in its 3d FFTs. In this scenario, splitting your P total processors into 2 subsets of processors, P1 in the first partition and P2 in the second partition, can enable your simulation to run faster. This is because the long-range forces in PPPM can be calculated at the same -time as pair-wise and bonded forces are being calculated, and the FFTs +time as pairwise and bonded forces are being calculated, and the FFTs can actually speed up when running on fewer processors. To use this style, you must define 2 partitions where P1 is a multiple From 75d20c40ed4e2c03d5f675f9c201f21688532247 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 11:26:26 -0500 Subject: [PATCH 072/174] remove threebody tag caching altogether since it is not reliable --- src/INTEL/npair_intel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/INTEL/npair_intel.cpp b/src/INTEL/npair_intel.cpp index 76a56ef90f..9578de9965 100644 --- a/src/INTEL/npair_intel.cpp +++ b/src/INTEL/npair_intel.cpp @@ -310,7 +310,6 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, flt_t * _noalias const tz = ncachez + toffs; int * _noalias const tj = ncachej + toffs; int * _noalias const tjtype = ncachejtype + toffs; - tagint * _noalias const ttag = ncachetag + toffs; flt_t * _noalias itx; flt_t * _noalias ity; @@ -367,7 +366,6 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, ty[u] = x[j].y; tz[u] = x[j].z; tjtype[u] = x[j].w; - if (THREE && ttag) ttag[u] = tag[j]; } if (FULL == 0 && TRI != 1) { @@ -515,7 +513,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, } if (THREE) { - const tagint jtag = ttag ? ttag[u] : tag[j]; + const tagint jtag = tag[j]; int flist = 0; if (itag > jtag) { if (((itag+jtag) & 1) == 0) flist = 1; From 57def1a2d5497c67cc2722437b8f7fc411b07191 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 11:26:55 -0500 Subject: [PATCH 073/174] output reformatting and refactoring --- src/INTEL/fix_intel.cpp | 41 +++++++++++++++++++------------------ src/INTEL/npair_intel.cpp | 4 ++-- src/INTEL/pair_sw_intel.cpp | 3 +-- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 2fe6b94515..97d4f21788 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -469,27 +469,28 @@ void FixIntel::pair_init_check(const bool cdmessage) #endif if (_print_pkg_info && comm->me == 0) { - if (screen) { - fprintf(screen, - "----------------------------------------------------------\n"); - if (_offload_balance != 0.0) { - fprintf(screen,"Using Intel Coprocessor with %d threads per core, ", - _offload_tpc); - fprintf(screen,"%d threads per task\n",_offload_threads); - } else { - fprintf(screen,"Using Intel Package without Coprocessor.\n"); - } - fprintf(screen,"Precision: %s\n",kmode); - if (cdmessage) { - #ifdef LMP_USE_AVXCD - fprintf(screen,"AVX512 CD Optimizations: Enabled\n"); - #else - fprintf(screen,"AVX512 CD Optimizations: Disabled\n"); - #endif - } - fprintf(screen, - "----------------------------------------------------------\n"); + utils::logmesg(lmp, "----------------------------------------------------------\n"); + if (_offload_balance != 0.0) { + utils::logmesg(lmp,"Using Intel Coprocessor with {} threads per core, " + "{} threads per task\n",_offload_tpc, _offload_threads); + } else { + utils::logmesg(lmp,"Using INTEL Package without Coprocessor.\n"); } + utils::logmesg(lmp,"Compiler: {}\n",platform::compiler_info()); + #ifdef LMP_SIMD_COMPILER + utils::logmesg(lmp,"SIMD compiler directives: Enabled\n"); + #else + utils::logmesg(lmp,"SIMD compiler directives: Disabled\n"); + #endif + utils::logmesg(lmp,"Precision: {}\n",kmode); + if (cdmessage) { + #ifdef LMP_USE_AVXCD + utils::logmesg(lmp,"AVX512 CD Optimizations: Enabled\n"); + #else + utils::logmesg(lmp,"AVX512 CD Optimizations: Disabled\n"); + #endif + } + utils::logmesg(lmp, "----------------------------------------------------------\n"); } _print_pkg_info = 0; } diff --git a/src/INTEL/npair_intel.cpp b/src/INTEL/npair_intel.cpp index 9578de9965..67cd2517e4 100644 --- a/src/INTEL/npair_intel.cpp +++ b/src/INTEL/npair_intel.cpp @@ -31,8 +31,7 @@ using namespace LAMMPS_NS; NPairIntel::NPairIntel(LAMMPS *lmp) : NPair(lmp) { int ifix = modify->find_fix("package_intel"); if (ifix < 0) - error->all(FLERR, - "The 'package intel' command is required for /intel styles"); + error->all(FLERR,"The 'package intel' command is required for /intel styles"); _fix = static_cast(modify->fix[ifix]); #ifdef _LMP_INTEL_OFFLOAD _cop = _fix->coprocessor_number(); @@ -657,6 +656,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, ns += n2 - pack_offset - maxnbors; #ifdef LMP_INTEL_3BODY_FAST + int alln = n; n = lane; for (int u = pack_offset; u < alln; u++) { neighptr[n] = neighptr2[u]; diff --git a/src/INTEL/pair_sw_intel.cpp b/src/INTEL/pair_sw_intel.cpp index fd043ae5a1..8743fbe54c 100644 --- a/src/INTEL/pair_sw_intel.cpp +++ b/src/INTEL/pair_sw_intel.cpp @@ -1115,8 +1115,7 @@ void PairSWIntel::init_style() int ifix = modify->find_fix("package_intel"); if (ifix < 0) - error->all(FLERR, - "The 'package intel' command is required for /intel styles"); + error->all(FLERR,"The 'package intel' command is required for /intel styles"); fix = static_cast(modify->fix[ifix]); fix->pair_init_check(true); From 0d4bbf60e63036fb7e4ca2bd1a428b649bf56123 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 21 Jan 2022 12:48:11 -0500 Subject: [PATCH 074/174] Apply override to Dihedral classes --- src/CLASS2/dihedral_class2.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_cosine_shift_exp.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_fourier.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_helix.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_nharmonic.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_quadratic.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_spherical.h | 12 ++++++------ src/EXTRA-MOLECULE/dihedral_table_cut.h | 8 ++++---- src/INTEL/dihedral_charmm_intel.h | 4 ++-- src/INTEL/dihedral_fourier_intel.h | 4 ++-- src/INTEL/dihedral_harmonic_intel.h | 4 ++-- src/INTEL/dihedral_opls_intel.h | 4 ++-- src/KOKKOS/dihedral_charmm_kokkos.h | 12 ++++++------ src/KOKKOS/dihedral_class2_kokkos.h | 8 ++++---- src/KOKKOS/dihedral_harmonic_kokkos.h | 10 +++++----- src/KOKKOS/dihedral_opls_kokkos.h | 10 +++++----- src/MOLECULE/dihedral_charmm.h | 14 +++++++------- src/MOLECULE/dihedral_charmmfsw.h | 14 +++++++------- src/MOLECULE/dihedral_harmonic.h | 12 ++++++------ src/MOLECULE/dihedral_multi_harmonic.h | 12 ++++++------ src/MOLECULE/dihedral_opls.h | 12 ++++++------ src/MOLECULE/dihedral_table.h | 16 ++++++++-------- src/OPENMP/dihedral_charmm_omp.h | 2 +- src/OPENMP/dihedral_class2_omp.h | 2 +- src/OPENMP/dihedral_cosine_shift_exp_omp.h | 2 +- src/OPENMP/dihedral_fourier_omp.h | 2 +- src/OPENMP/dihedral_harmonic_omp.h | 2 +- src/OPENMP/dihedral_helix_omp.h | 2 +- src/OPENMP/dihedral_multi_harmonic_omp.h | 2 +- src/OPENMP/dihedral_nharmonic_omp.h | 2 +- src/OPENMP/dihedral_opls_omp.h | 2 +- src/OPENMP/dihedral_quadratic_omp.h | 2 +- src/OPENMP/dihedral_table_omp.h | 2 +- src/dihedral_deprecated.h | 11 +++++------ src/dihedral_hybrid.h | 16 ++++++++-------- src/dihedral_zero.h | 14 +++++++------- 36 files changed, 145 insertions(+), 146 deletions(-) diff --git a/src/CLASS2/dihedral_class2.h b/src/CLASS2/dihedral_class2.h index 4cf71f6a71..226981b746 100644 --- a/src/CLASS2/dihedral_class2.h +++ b/src/CLASS2/dihedral_class2.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralClass2 : public Dihedral { public: DihedralClass2(class LAMMPS *); - virtual ~DihedralClass2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); + ~DihedralClass2() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k1, *k2, *k3; diff --git a/src/EXTRA-MOLECULE/dihedral_cosine_shift_exp.h b/src/EXTRA-MOLECULE/dihedral_cosine_shift_exp.h index 31bc3332f5..f45eefdceb 100644 --- a/src/EXTRA-MOLECULE/dihedral_cosine_shift_exp.h +++ b/src/EXTRA-MOLECULE/dihedral_cosine_shift_exp.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralCosineShiftExp : public Dihedral { public: DihedralCosineShiftExp(class LAMMPS *); - virtual ~DihedralCosineShiftExp(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralCosineShiftExp() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: bool *doExpansion; diff --git a/src/EXTRA-MOLECULE/dihedral_fourier.h b/src/EXTRA-MOLECULE/dihedral_fourier.h index 557d4b5277..18116af25c 100644 --- a/src/EXTRA-MOLECULE/dihedral_fourier.h +++ b/src/EXTRA-MOLECULE/dihedral_fourier.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralFourier : public Dihedral { public: DihedralFourier(class LAMMPS *); - virtual ~DihedralFourier(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralFourier() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double **k, **cos_shift, **sin_shift, **shift; diff --git a/src/EXTRA-MOLECULE/dihedral_helix.h b/src/EXTRA-MOLECULE/dihedral_helix.h index dad281fa2e..729d1ec861 100644 --- a/src/EXTRA-MOLECULE/dihedral_helix.h +++ b/src/EXTRA-MOLECULE/dihedral_helix.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralHelix : public Dihedral { public: DihedralHelix(class LAMMPS *); - virtual ~DihedralHelix(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralHelix() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *aphi, *bphi, *cphi; diff --git a/src/EXTRA-MOLECULE/dihedral_nharmonic.h b/src/EXTRA-MOLECULE/dihedral_nharmonic.h index ff41bd7ef5..184cf1f740 100644 --- a/src/EXTRA-MOLECULE/dihedral_nharmonic.h +++ b/src/EXTRA-MOLECULE/dihedral_nharmonic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralNHarmonic : public Dihedral { public: DihedralNHarmonic(class LAMMPS *); - ~DihedralNHarmonic(); - void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralNHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int *nterms; diff --git a/src/EXTRA-MOLECULE/dihedral_quadratic.h b/src/EXTRA-MOLECULE/dihedral_quadratic.h index b61c29c1d9..7ea7839c1f 100644 --- a/src/EXTRA-MOLECULE/dihedral_quadratic.h +++ b/src/EXTRA-MOLECULE/dihedral_quadratic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralQuadratic : public Dihedral { public: DihedralQuadratic(class LAMMPS *); - ~DihedralQuadratic(); - void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralQuadratic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *phi0; diff --git a/src/EXTRA-MOLECULE/dihedral_spherical.h b/src/EXTRA-MOLECULE/dihedral_spherical.h index 0143e6348c..993f12ceb3 100644 --- a/src/EXTRA-MOLECULE/dihedral_spherical.h +++ b/src/EXTRA-MOLECULE/dihedral_spherical.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class DihedralSpherical : public Dihedral { public: DihedralSpherical(class LAMMPS *); - virtual ~DihedralSpherical(); - virtual void compute(int, int); + ~DihedralSpherical() override; + void compute(int, int) override; double CalcGeneralizedForces(int, double, double, double, double *, double *, double *); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int *nterms; diff --git a/src/EXTRA-MOLECULE/dihedral_table_cut.h b/src/EXTRA-MOLECULE/dihedral_table_cut.h index 99607a9e0b..f713af1f72 100644 --- a/src/EXTRA-MOLECULE/dihedral_table_cut.h +++ b/src/EXTRA-MOLECULE/dihedral_table_cut.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class DihedralTableCut : public DihedralTable { public: DihedralTableCut(class LAMMPS *); - virtual ~DihedralTableCut(); - virtual void compute(int, int); - virtual void coeff(int, char **); + ~DihedralTableCut() override; + void compute(int, int) override; + void coeff(int, char **) override; protected: double *aat_k, *aat_theta0_1, *aat_theta0_2; - virtual void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/INTEL/dihedral_charmm_intel.h b/src/INTEL/dihedral_charmm_intel.h index ec213f5d75..9de87826f7 100644 --- a/src/INTEL/dihedral_charmm_intel.h +++ b/src/INTEL/dihedral_charmm_intel.h @@ -34,8 +34,8 @@ class DihedralCharmmIntel : public DihedralCharmm { public: DihedralCharmmIntel(class LAMMPS *lmp); - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; private: FixIntel *fix; diff --git a/src/INTEL/dihedral_fourier_intel.h b/src/INTEL/dihedral_fourier_intel.h index 3b1f594c28..57412c65a8 100644 --- a/src/INTEL/dihedral_fourier_intel.h +++ b/src/INTEL/dihedral_fourier_intel.h @@ -34,8 +34,8 @@ class DihedralFourierIntel : public DihedralFourier { public: DihedralFourierIntel(class LAMMPS *lmp); - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; private: FixIntel *fix; diff --git a/src/INTEL/dihedral_harmonic_intel.h b/src/INTEL/dihedral_harmonic_intel.h index 388df11e4f..bd98ec6b61 100644 --- a/src/INTEL/dihedral_harmonic_intel.h +++ b/src/INTEL/dihedral_harmonic_intel.h @@ -34,8 +34,8 @@ class DihedralHarmonicIntel : public DihedralHarmonic { public: DihedralHarmonicIntel(class LAMMPS *lmp); - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; private: FixIntel *fix; diff --git a/src/INTEL/dihedral_opls_intel.h b/src/INTEL/dihedral_opls_intel.h index 98206b184f..e11aae76f6 100644 --- a/src/INTEL/dihedral_opls_intel.h +++ b/src/INTEL/dihedral_opls_intel.h @@ -34,8 +34,8 @@ class DihedralOPLSIntel : public DihedralOPLS { public: DihedralOPLSIntel(class LAMMPS *lmp); - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; private: FixIntel *fix; diff --git a/src/KOKKOS/dihedral_charmm_kokkos.h b/src/KOKKOS/dihedral_charmm_kokkos.h index bea6cb9995..09b979d02d 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.h +++ b/src/KOKKOS/dihedral_charmm_kokkos.h @@ -96,11 +96,11 @@ class DihedralCharmmKokkos : public DihedralCharmm { typedef ArrayTypes AT; DihedralCharmmKokkos(class LAMMPS *); - virtual ~DihedralCharmmKokkos(); - void compute(int, int); - void coeff(int, char **); - void init_style(); - void read_restart(FILE *); + ~DihedralCharmmKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -164,7 +164,7 @@ class DihedralCharmmKokkos : public DihedralCharmm { typename AT::t_ffloat_1d d_cos_shift; typename AT::t_ffloat_1d d_weight; - void allocate(); + void allocate() override; }; } diff --git a/src/KOKKOS/dihedral_class2_kokkos.h b/src/KOKKOS/dihedral_class2_kokkos.h index 8f4fbc2c8a..0b7251edf5 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.h +++ b/src/KOKKOS/dihedral_class2_kokkos.h @@ -39,10 +39,10 @@ class DihedralClass2Kokkos : public DihedralClass2 { typedef ArrayTypes AT; DihedralClass2Kokkos(class LAMMPS *); - virtual ~DihedralClass2Kokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~DihedralClass2Kokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/dihedral_harmonic_kokkos.h b/src/KOKKOS/dihedral_harmonic_kokkos.h index 874a517402..8e66f82add 100644 --- a/src/KOKKOS/dihedral_harmonic_kokkos.h +++ b/src/KOKKOS/dihedral_harmonic_kokkos.h @@ -39,10 +39,10 @@ class DihedralHarmonicKokkos : public DihedralHarmonic { typedef ArrayTypes AT; DihedralHarmonicKokkos(class LAMMPS *); - virtual ~DihedralHarmonicKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~DihedralHarmonicKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -92,7 +92,7 @@ class DihedralHarmonicKokkos : public DihedralHarmonic { typename AT::t_int_1d d_sign; typename AT::t_int_1d d_multiplicity; - void allocate(); + void allocate() override; }; } diff --git a/src/KOKKOS/dihedral_opls_kokkos.h b/src/KOKKOS/dihedral_opls_kokkos.h index b0e468f993..6f01359650 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.h +++ b/src/KOKKOS/dihedral_opls_kokkos.h @@ -39,10 +39,10 @@ class DihedralOPLSKokkos : public DihedralOPLS { typedef ArrayTypes AT; DihedralOPLSKokkos(class LAMMPS *); - virtual ~DihedralOPLSKokkos(); - void compute(int, int); - void coeff(int, char **); - void read_restart(FILE *); + ~DihedralOPLSKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void read_restart(FILE *) override; template KOKKOS_INLINE_FUNCTION @@ -90,7 +90,7 @@ class DihedralOPLSKokkos : public DihedralOPLS { typename AT::t_ffloat_1d d_k3; typename AT::t_ffloat_1d d_k4; - void allocate(); + void allocate() override; }; } diff --git a/src/MOLECULE/dihedral_charmm.h b/src/MOLECULE/dihedral_charmm.h index 9d0bd69606..2f9f297a3b 100644 --- a/src/MOLECULE/dihedral_charmm.h +++ b/src/MOLECULE/dihedral_charmm.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class DihedralCharmm : public Dihedral { public: DihedralCharmm(class LAMMPS *); - virtual ~DihedralCharmm(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void init_style(); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); + ~DihedralCharmm() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *weight, *cos_shift, *sin_shift; diff --git a/src/MOLECULE/dihedral_charmmfsw.h b/src/MOLECULE/dihedral_charmmfsw.h index afbcf66ade..01ee30c5d0 100644 --- a/src/MOLECULE/dihedral_charmmfsw.h +++ b/src/MOLECULE/dihedral_charmmfsw.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class DihedralCharmmfsw : public Dihedral { public: DihedralCharmmfsw(class LAMMPS *); - virtual ~DihedralCharmmfsw(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void init_style(); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralCharmmfsw() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int implicit, weightflag, dihedflag; diff --git a/src/MOLECULE/dihedral_harmonic.h b/src/MOLECULE/dihedral_harmonic.h index e3c29b34bd..a80ea4ee84 100644 --- a/src/MOLECULE/dihedral_harmonic.h +++ b/src/MOLECULE/dihedral_harmonic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralHarmonic : public Dihedral { public: DihedralHarmonic(class LAMMPS *); - virtual ~DihedralHarmonic(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); + ~DihedralHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k, *cos_shift, *sin_shift; diff --git a/src/MOLECULE/dihedral_multi_harmonic.h b/src/MOLECULE/dihedral_multi_harmonic.h index 9f79262da9..4534f0c697 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.h +++ b/src/MOLECULE/dihedral_multi_harmonic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralMultiHarmonic : public Dihedral { public: DihedralMultiHarmonic(class LAMMPS *); - virtual ~DihedralMultiHarmonic(); - virtual void compute(int, int); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + ~DihedralMultiHarmonic() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *a1, *a2, *a3, *a4, *a5; diff --git a/src/MOLECULE/dihedral_opls.h b/src/MOLECULE/dihedral_opls.h index 723fbb987b..ebd8b79ea5 100644 --- a/src/MOLECULE/dihedral_opls.h +++ b/src/MOLECULE/dihedral_opls.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class DihedralOPLS : public Dihedral { public: DihedralOPLS(class LAMMPS *); - virtual ~DihedralOPLS(); - virtual void compute(int, int); - virtual void coeff(int, char **); - void write_restart(FILE *); - virtual void read_restart(FILE *); - void write_data(FILE *); + ~DihedralOPLS() override; + void compute(int, int) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: double *k1, *k2, *k3, *k4; diff --git a/src/MOLECULE/dihedral_table.h b/src/MOLECULE/dihedral_table.h index a6fced46bb..e55579a528 100644 --- a/src/MOLECULE/dihedral_table.h +++ b/src/MOLECULE/dihedral_table.h @@ -30,14 +30,14 @@ namespace LAMMPS_NS { class DihedralTable : public Dihedral { public: DihedralTable(class LAMMPS *); - virtual ~DihedralTable(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + ~DihedralTable() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double single(int type, int i1, int i2, int i3, int i4); protected: diff --git a/src/OPENMP/dihedral_charmm_omp.h b/src/OPENMP/dihedral_charmm_omp.h index b326cf9329..40c5f10e43 100644 --- a/src/OPENMP/dihedral_charmm_omp.h +++ b/src/OPENMP/dihedral_charmm_omp.h @@ -33,7 +33,7 @@ class DihedralCharmmOMP : public DihedralCharmm, public ThrOMP { public: DihedralCharmmOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_class2_omp.h b/src/OPENMP/dihedral_class2_omp.h index f80dbafdec..4465792da4 100644 --- a/src/OPENMP/dihedral_class2_omp.h +++ b/src/OPENMP/dihedral_class2_omp.h @@ -33,7 +33,7 @@ class DihedralClass2OMP : public DihedralClass2, public ThrOMP { public: DihedralClass2OMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_cosine_shift_exp_omp.h b/src/OPENMP/dihedral_cosine_shift_exp_omp.h index 862a2d6428..2259e1fcfc 100644 --- a/src/OPENMP/dihedral_cosine_shift_exp_omp.h +++ b/src/OPENMP/dihedral_cosine_shift_exp_omp.h @@ -33,7 +33,7 @@ class DihedralCosineShiftExpOMP : public DihedralCosineShiftExp, public ThrOMP { public: DihedralCosineShiftExpOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_fourier_omp.h b/src/OPENMP/dihedral_fourier_omp.h index d493f4a2b9..01e11122b0 100644 --- a/src/OPENMP/dihedral_fourier_omp.h +++ b/src/OPENMP/dihedral_fourier_omp.h @@ -33,7 +33,7 @@ class DihedralFourierOMP : public DihedralFourier, public ThrOMP { public: DihedralFourierOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_harmonic_omp.h b/src/OPENMP/dihedral_harmonic_omp.h index 5a29dbc647..c664eccadb 100644 --- a/src/OPENMP/dihedral_harmonic_omp.h +++ b/src/OPENMP/dihedral_harmonic_omp.h @@ -33,7 +33,7 @@ class DihedralHarmonicOMP : public DihedralHarmonic, public ThrOMP { public: DihedralHarmonicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_helix_omp.h b/src/OPENMP/dihedral_helix_omp.h index 1361519be2..9528ccdb42 100644 --- a/src/OPENMP/dihedral_helix_omp.h +++ b/src/OPENMP/dihedral_helix_omp.h @@ -33,7 +33,7 @@ class DihedralHelixOMP : public DihedralHelix, public ThrOMP { public: DihedralHelixOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_multi_harmonic_omp.h b/src/OPENMP/dihedral_multi_harmonic_omp.h index 977915e2b2..b0f7b9183b 100644 --- a/src/OPENMP/dihedral_multi_harmonic_omp.h +++ b/src/OPENMP/dihedral_multi_harmonic_omp.h @@ -33,7 +33,7 @@ class DihedralMultiHarmonicOMP : public DihedralMultiHarmonic, public ThrOMP { public: DihedralMultiHarmonicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_nharmonic_omp.h b/src/OPENMP/dihedral_nharmonic_omp.h index f7bff45358..c19dff9c0b 100644 --- a/src/OPENMP/dihedral_nharmonic_omp.h +++ b/src/OPENMP/dihedral_nharmonic_omp.h @@ -33,7 +33,7 @@ class DihedralNHarmonicOMP : public DihedralNHarmonic, public ThrOMP { public: DihedralNHarmonicOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_opls_omp.h b/src/OPENMP/dihedral_opls_omp.h index cec4229e09..d71f2a8b43 100644 --- a/src/OPENMP/dihedral_opls_omp.h +++ b/src/OPENMP/dihedral_opls_omp.h @@ -33,7 +33,7 @@ class DihedralOPLSOMP : public DihedralOPLS, public ThrOMP { public: DihedralOPLSOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_quadratic_omp.h b/src/OPENMP/dihedral_quadratic_omp.h index 9f31bc88ed..00054f7de0 100644 --- a/src/OPENMP/dihedral_quadratic_omp.h +++ b/src/OPENMP/dihedral_quadratic_omp.h @@ -33,7 +33,7 @@ class DihedralQuadraticOMP : public DihedralQuadratic, public ThrOMP { public: DihedralQuadraticOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/dihedral_table_omp.h b/src/OPENMP/dihedral_table_omp.h index b1a121e7be..1e2d0e63ef 100644 --- a/src/OPENMP/dihedral_table_omp.h +++ b/src/OPENMP/dihedral_table_omp.h @@ -33,7 +33,7 @@ class DihedralTableOMP : public DihedralTable, public ThrOMP { public: DihedralTableOMP(class LAMMPS *lmp); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/dihedral_deprecated.h b/src/dihedral_deprecated.h index a0a287931e..2ee1544743 100644 --- a/src/dihedral_deprecated.h +++ b/src/dihedral_deprecated.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class DihedralDeprecated : public Dihedral { public: DihedralDeprecated(class LAMMPS *lmp) : Dihedral(lmp) {} - virtual ~DihedralDeprecated() {} - virtual void compute(int, int) {} - virtual void settings(int, char **); - virtual void coeff(int, char **) {} - virtual void write_restart(FILE *) {} - virtual void read_restart(FILE *) {} + void compute(int, int) override {} + void settings(int, char **) override; + void coeff(int, char **) override {} + void write_restart(FILE *) override {} + void read_restart(FILE *) override {} }; } // namespace LAMMPS_NS diff --git a/src/dihedral_hybrid.h b/src/dihedral_hybrid.h index 04a88e7651..bbdeb526b3 100644 --- a/src/dihedral_hybrid.h +++ b/src/dihedral_hybrid.h @@ -31,14 +31,14 @@ class DihedralHybrid : public Dihedral { char **keywords; // keyword for each dihedral style DihedralHybrid(class LAMMPS *); - ~DihedralHybrid(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void write_restart(FILE *); - void read_restart(FILE *); - double memory_usage(); + ~DihedralHybrid() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double memory_usage() override; private: int *map; // which style each dihedral type points to diff --git a/src/dihedral_zero.h b/src/dihedral_zero.h index 7349f95130..6428834a54 100644 --- a/src/dihedral_zero.h +++ b/src/dihedral_zero.h @@ -31,14 +31,14 @@ namespace LAMMPS_NS { class DihedralZero : public Dihedral { public: DihedralZero(class LAMMPS *); - virtual ~DihedralZero(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void settings(int, char **); + ~DihedralZero() override; + void compute(int, int) override; + void coeff(int, char **) override; + void settings(int, char **) override; - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int coeffflag; From f83271aa4077ef9ff2852c313b9bcfc4a77ab6bb Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 21 Jan 2022 13:23:36 -0500 Subject: [PATCH 075/174] Apply override to Compute classes --- src/ASPHERE/compute_erotate_asphere.h | 4 +-- src/ASPHERE/compute_temp_asphere.h | 18 +++++------ src/BOCS/compute_pressure_bocs.h | 10 +++---- src/BODY/compute_body_local.h | 8 ++--- src/BODY/compute_temp_body.h | 14 ++++----- src/CORESHELL/compute_temp_cs.h | 26 ++++++++-------- src/DIELECTRIC/compute_efield_atom.h | 14 ++++----- src/DIFFRACTION/compute_saed.h | 8 ++--- src/DIFFRACTION/compute_xrd.h | 8 ++--- src/DPD-MESO/compute_edpd_temp_atom.h | 8 ++--- src/DPD-MESO/compute_tdpd_cc_atom.h | 8 ++--- src/DPD-REACT/compute_dpd.h | 6 ++-- src/DPD-REACT/compute_dpd_atom.h | 8 ++--- src/DRUDE/compute_temp_drude.h | 10 +++---- src/EFF/compute_ke_atom_eff.h | 8 ++--- src/EFF/compute_ke_eff.h | 5 ++-- src/EFF/compute_temp_deform_eff.h | 20 ++++++------- src/EFF/compute_temp_eff.h | 10 +++---- src/EFF/compute_temp_region_eff.h | 24 +++++++-------- src/EXTRA-COMPUTE/compute_ackland_atom.h | 10 +++---- src/EXTRA-COMPUTE/compute_adf.h | 8 ++--- src/EXTRA-COMPUTE/compute_ave_sphere_atom.h | 14 ++++----- src/EXTRA-COMPUTE/compute_basal_atom.h | 10 +++---- src/EXTRA-COMPUTE/compute_cnp_atom.h | 10 +++---- src/EXTRA-COMPUTE/compute_entropy_atom.h | 10 +++---- src/EXTRA-COMPUTE/compute_gyration_shape.h | 6 ++-- .../compute_gyration_shape_chunk.h | 12 ++++---- src/EXTRA-COMPUTE/compute_hexorder_atom.h | 10 +++---- src/EXTRA-COMPUTE/compute_hma.h | 18 +++++------ src/EXTRA-COMPUTE/compute_momentum.h | 6 ++-- src/EXTRA-COMPUTE/compute_msd_nongauss.h | 3 +- src/EXTRA-COMPUTE/compute_pressure_cylinder.h | 10 +++---- src/EXTRA-COMPUTE/compute_stress_mop.h | 8 ++--- .../compute_stress_mop_profile.h | 8 ++--- src/EXTRA-COMPUTE/compute_temp_rotate.h | 24 +++++++-------- src/EXTRA-COMPUTE/compute_ti.h | 6 ++-- src/FEP/compute_fep.h | 6 ++-- src/GRANULAR/compute_contact_atom.h | 14 ++++----- src/GRANULAR/compute_fabric.h | 10 +++---- src/KOKKOS/compute_ave_sphere_atom_kokkos.h | 6 ++-- src/KOKKOS/compute_coord_atom_kokkos.h | 6 ++-- src/KOKKOS/compute_orientorder_atom_kokkos.h | 8 ++--- src/KOKKOS/compute_temp_deform_kokkos.h | 10 +++---- src/KOKKOS/compute_temp_kokkos.h | 6 ++-- src/MACHDYN/compute_smd_contact_radius.h | 8 ++--- src/MACHDYN/compute_smd_damage.h | 8 ++--- src/MACHDYN/compute_smd_hourglass_error.h | 8 ++--- src/MACHDYN/compute_smd_internal_energy.h | 8 ++--- src/MACHDYN/compute_smd_plastic_strain.h | 8 ++--- src/MACHDYN/compute_smd_plastic_strain_rate.h | 8 ++--- src/MACHDYN/compute_smd_rho.h | 8 ++--- src/MACHDYN/compute_smd_tlsph_dt.h | 8 ++--- src/MACHDYN/compute_smd_tlsph_num_neighs.h | 8 ++--- src/MACHDYN/compute_smd_triangle_vertices.h | 8 ++--- src/MACHDYN/compute_smd_ulsph_effm.h | 8 ++--- src/MACHDYN/compute_smd_ulsph_num_neighs.h | 8 ++--- src/MACHDYN/compute_smd_ulsph_strain.h | 8 ++--- src/MACHDYN/compute_smd_vol.h | 10 +++---- src/MESONT/compute_mesont.h | 14 ++++----- src/MISC/compute_viscosity_cos.h | 22 +++++++------- src/ML-IAP/compute_mliap.h | 10 +++---- src/ML-IAP/mliap_data.h | 2 +- src/ML-IAP/mliap_descriptor.h | 2 +- src/ML-IAP/mliap_descriptor_snap.h | 14 ++++----- src/ML-IAP/mliap_model.h | 8 ++--- src/ML-IAP/mliap_model_linear.h | 12 ++++---- src/ML-IAP/mliap_model_quadratic.h | 12 ++++---- src/ML-SNAP/compute_sna_atom.h | 10 +++---- src/ML-SNAP/compute_snad_atom.h | 14 ++++----- src/ML-SNAP/compute_snap.h | 10 +++---- src/ML-SNAP/compute_snav_atom.h | 14 ++++----- src/ML-SNAP/sna.h | 2 +- src/PERI/compute_damage_atom.h | 8 ++--- src/PERI/compute_dilatation_atom.h | 8 ++--- src/PERI/compute_plasticity_atom.h | 8 ++--- src/PTM/compute_ptm_atom.h | 10 +++---- src/REAXFF/compute_spec_atom.h | 8 ++--- src/REPLICA/compute_event_displace.h | 8 ++--- src/REPLICA/compute_pressure_grem.h | 8 ++--- src/RIGID/compute_erotate_rigid.h | 6 ++-- src/RIGID/compute_ke_rigid.h | 6 ++-- src/RIGID/compute_rigid_local.h | 8 ++--- src/SPH/compute_sph_e_atom.h | 8 ++--- src/SPH/compute_sph_rho_atom.h | 8 ++--- src/SPH/compute_sph_t_atom.h | 8 ++--- src/SPIN/compute_spin.h | 6 ++-- src/TALLY/compute_force_tally.h | 18 +++++------ src/TALLY/compute_heat_flux_tally.h | 16 +++++----- src/TALLY/compute_heat_flux_virial_tally.h | 18 +++++------ src/TALLY/compute_pe_mol_tally.h | 10 +++---- src/TALLY/compute_pe_tally.h | 18 +++++------ src/TALLY/compute_stress_tally.h | 18 +++++------ src/UEF/compute_pressure_uef.h | 8 ++--- src/UEF/compute_temp_uef.h | 6 ++-- src/compute_aggregate_atom.h | 18 +++++------ src/compute_angle.h | 6 ++-- src/compute_angle_local.h | 8 ++--- src/compute_angmom_chunk.h | 18 +++++------ src/compute_bond.h | 6 ++-- src/compute_bond_local.h | 12 ++++---- src/compute_centro_atom.h | 10 +++---- src/compute_centroid_stress_atom.h | 12 ++++---- src/compute_chunk_atom.h | 18 +++++------ src/compute_chunk_spread_atom.h | 8 ++--- src/compute_cluster_atom.h | 14 ++++----- src/compute_cna_atom.h | 10 +++---- src/compute_com.h | 6 ++-- src/compute_com_chunk.h | 20 ++++++------- src/compute_coord_atom.h | 14 ++++----- src/compute_deprecated.h | 3 +- src/compute_dihedral.h | 6 ++-- src/compute_dihedral_local.h | 8 ++--- src/compute_dipole.h | 8 ++--- src/compute_dipole_chunk.h | 18 +++++------ src/compute_displace_atom.h | 12 ++++---- src/compute_erotate_sphere.h | 6 ++-- src/compute_erotate_sphere_atom.h | 8 ++--- src/compute_fragment_atom.h | 12 ++++---- src/compute_global_atom.h | 8 ++--- src/compute_group_group.h | 10 +++---- src/compute_gyration.h | 8 ++--- src/compute_gyration_chunk.h | 20 ++++++------- src/compute_heat_flux.h | 6 ++-- src/compute_improper.h | 6 ++-- src/compute_improper_local.h | 8 ++--- src/compute_inertia_chunk.h | 18 +++++------ src/compute_ke.h | 4 +-- src/compute_ke_atom.h | 8 ++--- src/compute_msd.h | 8 ++--- src/compute_msd_chunk.h | 20 ++++++------- src/compute_omega_chunk.h | 18 +++++------ src/compute_orientorder_atom.h | 10 +++---- src/compute_pair.h | 8 ++--- src/compute_pair_local.h | 10 +++---- src/compute_pe.h | 5 ++-- src/compute_pe_atom.h | 12 ++++---- src/compute_pressure.h | 10 +++---- src/compute_property_atom.h | 8 ++--- src/compute_property_chunk.h | 20 ++++++------- src/compute_property_local.h | 10 +++---- src/compute_rdf.h | 8 ++--- src/compute_reduce.h | 10 +++---- src/compute_reduce_chunk.h | 20 ++++++------- src/compute_reduce_region.h | 5 ++-- src/compute_slice.h | 8 ++--- src/compute_stress_atom.h | 12 ++++---- src/compute_temp.h | 10 +++---- src/compute_temp_chunk.h | 30 +++++++++---------- src/compute_temp_com.h | 22 +++++++------- src/compute_temp_deform.h | 24 +++++++-------- src/compute_temp_partial.h | 28 ++++++++--------- src/compute_temp_profile.h | 26 ++++++++-------- src/compute_temp_ramp.h | 24 +++++++-------- src/compute_temp_region.h | 28 ++++++++--------- src/compute_temp_sphere.h | 18 +++++------ src/compute_torque_chunk.h | 18 +++++------ src/compute_vacf.h | 8 ++--- src/compute_vcm_chunk.h | 20 ++++++------- 158 files changed, 873 insertions(+), 878 deletions(-) diff --git a/src/ASPHERE/compute_erotate_asphere.h b/src/ASPHERE/compute_erotate_asphere.h index 0805770bb6..895da694b2 100644 --- a/src/ASPHERE/compute_erotate_asphere.h +++ b/src/ASPHERE/compute_erotate_asphere.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class ComputeERotateAsphere : public Compute { public: ComputeERotateAsphere(class LAMMPS *, int, char **); - void init(); - double compute_scalar(); + void init() override; + double compute_scalar() override; private: double pfactor; diff --git a/src/ASPHERE/compute_temp_asphere.h b/src/ASPHERE/compute_temp_asphere.h index 18c0768fd0..f479459728 100644 --- a/src/ASPHERE/compute_temp_asphere.h +++ b/src/ASPHERE/compute_temp_asphere.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class ComputeTempAsphere : public Compute { public: ComputeTempAsphere(class LAMMPS *, int, char **); - ~ComputeTempAsphere(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempAsphere() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void restore_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void restore_bias_thr(int, double *, double *); + void remove_bias(int, double *) override; + void restore_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void restore_bias_thr(int, double *, double *) override; private: int mode; diff --git a/src/BOCS/compute_pressure_bocs.h b/src/BOCS/compute_pressure_bocs.h index ccae6ce0e3..d44127ca50 100644 --- a/src/BOCS/compute_pressure_bocs.h +++ b/src/BOCS/compute_pressure_bocs.h @@ -38,11 +38,11 @@ const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to co class ComputePressureBocs : public Compute { public: ComputePressureBocs(class LAMMPS *, int, char **); - virtual ~ComputePressureBocs(); - virtual void init(); - virtual double compute_scalar(); - virtual void compute_vector(); - void reset_extra_compute_fix(const char *); + ~ComputePressureBocs() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; + void reset_extra_compute_fix(const char *) override; double compute_cg_scalar(); double get_cg_p_corr(int, double *, int, double, double); diff --git a/src/BODY/compute_body_local.h b/src/BODY/compute_body_local.h index b0016aebaf..824d562637 100644 --- a/src/BODY/compute_body_local.h +++ b/src/BODY/compute_body_local.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeBodyLocal : public Compute { public: ComputeBodyLocal(class LAMMPS *, int, char **); - ~ComputeBodyLocal(); - void init(); - void compute_local(); - double memory_usage(); + ~ComputeBodyLocal() override; + void init() override; + void compute_local() override; + double memory_usage() override; private: int nvalues; diff --git a/src/BODY/compute_temp_body.h b/src/BODY/compute_temp_body.h index 19115ad209..5e6275ae12 100644 --- a/src/BODY/compute_temp_body.h +++ b/src/BODY/compute_temp_body.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class ComputeTempBody : public Compute { public: ComputeTempBody(class LAMMPS *, int, char **); - ~ComputeTempBody(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempBody() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void restore_bias(int, double *); + void remove_bias(int, double *) override; + void restore_bias(int, double *) override; private: int mode; diff --git a/src/CORESHELL/compute_temp_cs.h b/src/CORESHELL/compute_temp_cs.h index 70c681a264..34449afb47 100644 --- a/src/CORESHELL/compute_temp_cs.h +++ b/src/CORESHELL/compute_temp_cs.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class ComputeTempCS : public Compute { public: ComputeTempCS(class LAMMPS *, int, char **); - ~ComputeTempCS(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); - double memory_usage(); + ~ComputeTempCS() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; + double memory_usage() override; - void remove_bias(int, double *); - void remove_bias_all(); - void reapply_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); + void remove_bias(int, double *) override; + void remove_bias_all() override; + void reapply_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; private: int groupbit_c, groupbit_s; diff --git a/src/DIELECTRIC/compute_efield_atom.h b/src/DIELECTRIC/compute_efield_atom.h index 1961e15d69..212893b385 100644 --- a/src/DIELECTRIC/compute_efield_atom.h +++ b/src/DIELECTRIC/compute_efield_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeEfieldAtom : public Compute { public: ComputeEfieldAtom(class LAMMPS *, int, char **); - ~ComputeEfieldAtom(); - void init(); - void setup(); - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeEfieldAtom() override; + void init() override; + void setup() override; + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int pairflag; diff --git a/src/DIFFRACTION/compute_saed.h b/src/DIFFRACTION/compute_saed.h index 371e5c9c7f..379cb0d1e7 100644 --- a/src/DIFFRACTION/compute_saed.h +++ b/src/DIFFRACTION/compute_saed.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeSAED : public Compute { public: ComputeSAED(class LAMMPS *, int, char **); - ~ComputeSAED(); - void init(); - void compute_vector(); - double memory_usage(); + ~ComputeSAED() override; + void init() override; + void compute_vector() override; + double memory_usage() override; //testing double saed_var[10]; diff --git a/src/DIFFRACTION/compute_xrd.h b/src/DIFFRACTION/compute_xrd.h index 4254e50bf9..115ecfb6b4 100644 --- a/src/DIFFRACTION/compute_xrd.h +++ b/src/DIFFRACTION/compute_xrd.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeXRD : public Compute { public: ComputeXRD(class LAMMPS *, int, char **); - ~ComputeXRD(); - void init(); - void compute_array(); - double memory_usage(); + ~ComputeXRD() override; + void init() override; + void compute_array() override; + double memory_usage() override; private: int me; diff --git a/src/DPD-MESO/compute_edpd_temp_atom.h b/src/DPD-MESO/compute_edpd_temp_atom.h index 0dd7464bca..a361698be9 100644 --- a/src/DPD-MESO/compute_edpd_temp_atom.h +++ b/src/DPD-MESO/compute_edpd_temp_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeEDPDTempAtom : public Compute { public: ComputeEDPDTempAtom(class LAMMPS *, int, char **); - ~ComputeEDPDTempAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeEDPDTempAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/DPD-MESO/compute_tdpd_cc_atom.h b/src/DPD-MESO/compute_tdpd_cc_atom.h index 1f9fe76b25..403e32c6d5 100644 --- a/src/DPD-MESO/compute_tdpd_cc_atom.h +++ b/src/DPD-MESO/compute_tdpd_cc_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeTDPDCCAtom : public Compute { public: ComputeTDPDCCAtom(class LAMMPS *, int, char **); - ~ComputeTDPDCCAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeTDPDCCAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/DPD-REACT/compute_dpd.h b/src/DPD-REACT/compute_dpd.h index e010ad8288..94c69d0a13 100644 --- a/src/DPD-REACT/compute_dpd.h +++ b/src/DPD-REACT/compute_dpd.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeDpd : public Compute { public: ComputeDpd(class LAMMPS *, int, char **); - ~ComputeDpd(); - void init() {} - void compute_vector(); + ~ComputeDpd() override; + void init() override {} + void compute_vector() override; private: double *dpdU; diff --git a/src/DPD-REACT/compute_dpd_atom.h b/src/DPD-REACT/compute_dpd_atom.h index 7525e1cfab..4889987052 100644 --- a/src/DPD-REACT/compute_dpd_atom.h +++ b/src/DPD-REACT/compute_dpd_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeDpdAtom : public Compute { public: ComputeDpdAtom(class LAMMPS *, int, char **); - ~ComputeDpdAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeDpdAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/DRUDE/compute_temp_drude.h b/src/DRUDE/compute_temp_drude.h index e1cd54edc8..7a16b208cc 100644 --- a/src/DRUDE/compute_temp_drude.h +++ b/src/DRUDE/compute_temp_drude.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeTempDrude : public Compute { public: ComputeTempDrude(class LAMMPS *, int, char **); - ~ComputeTempDrude(); - void init(); - void setup(); - void compute_vector(); - double compute_scalar(); + ~ComputeTempDrude() override; + void init() override; + void setup() override; + void compute_vector() override; + double compute_scalar() override; int modify_param(int, char **); private: diff --git a/src/EFF/compute_ke_atom_eff.h b/src/EFF/compute_ke_atom_eff.h index 160b8ac96e..b5ad27b524 100644 --- a/src/EFF/compute_ke_atom_eff.h +++ b/src/EFF/compute_ke_atom_eff.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeKEAtomEff : public Compute { public: ComputeKEAtomEff(class LAMMPS *, int, char **); - ~ComputeKEAtomEff(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeKEAtomEff() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/EFF/compute_ke_eff.h b/src/EFF/compute_ke_eff.h index 7e8063ba18..cc5baa863f 100644 --- a/src/EFF/compute_ke_eff.h +++ b/src/EFF/compute_ke_eff.h @@ -27,9 +27,8 @@ namespace LAMMPS_NS { class ComputeKEEff : public Compute { public: ComputeKEEff(class LAMMPS *, int, char **); - ~ComputeKEEff(){}; - void init(); - double compute_scalar(); + void init() override; + double compute_scalar() override; private: double pfactor; diff --git a/src/EFF/compute_temp_deform_eff.h b/src/EFF/compute_temp_deform_eff.h index e90ba0465e..5490abd9ca 100644 --- a/src/EFF/compute_temp_deform_eff.h +++ b/src/EFF/compute_temp_deform_eff.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class ComputeTempDeformEff : public Compute { public: ComputeTempDeformEff(class LAMMPS *, int, char **); - virtual ~ComputeTempDeformEff(); - void init(); - void setup(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputeTempDeformEff() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); - double memory_usage(); + void remove_bias(int, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; + double memory_usage() override; protected: double tfactor; diff --git a/src/EFF/compute_temp_eff.h b/src/EFF/compute_temp_eff.h index 112b51d9d7..bc2bbc3597 100644 --- a/src/EFF/compute_temp_eff.h +++ b/src/EFF/compute_temp_eff.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeTempEff : public Compute { public: ComputeTempEff(class LAMMPS *, int, char **); - virtual ~ComputeTempEff(); - void init() {} - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempEff() override; + void init() override {} + void setup() override; + double compute_scalar() override; + void compute_vector() override; private: double tfactor; diff --git a/src/EFF/compute_temp_region_eff.h b/src/EFF/compute_temp_region_eff.h index 08211c63c8..bc8f930374 100644 --- a/src/EFF/compute_temp_region_eff.h +++ b/src/EFF/compute_temp_region_eff.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class ComputeTempRegionEff : public Compute { public: ComputeTempRegionEff(class LAMMPS *, int, char **); - virtual ~ComputeTempRegionEff(); - void init(); - void setup(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputeTempRegionEff() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void dof_remove_pre(); - int dof_remove(int); - void remove_bias(int, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); - double memory_usage(); + void dof_remove_pre() override; + int dof_remove(int) override; + void remove_bias(int, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; + double memory_usage() override; protected: int iregion; diff --git a/src/EXTRA-COMPUTE/compute_ackland_atom.h b/src/EXTRA-COMPUTE/compute_ackland_atom.h index 657f419c86..5c4234e728 100644 --- a/src/EXTRA-COMPUTE/compute_ackland_atom.h +++ b/src/EXTRA-COMPUTE/compute_ackland_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeAcklandAtom : public Compute { public: ComputeAcklandAtom(class LAMMPS *, int, char **); - ~ComputeAcklandAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeAcklandAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax, maxneigh, legacy; diff --git a/src/EXTRA-COMPUTE/compute_adf.h b/src/EXTRA-COMPUTE/compute_adf.h index 6f7f8f35a4..817fbfa01e 100644 --- a/src/EXTRA-COMPUTE/compute_adf.h +++ b/src/EXTRA-COMPUTE/compute_adf.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeADF : public Compute { public: ComputeADF(class LAMMPS *, int, char **); - ~ComputeADF(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); + ~ComputeADF() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; private: int nbin; // # of adf bins diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h index 9b5e38750b..8e8ab0282d 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeAveSphereAtom : public Compute { public: ComputeAveSphereAtom(class LAMMPS *, int, char **); - virtual ~ComputeAveSphereAtom(); - virtual void init(); - void init_list(int, class NeighList *); - virtual void compute_peratom(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~ComputeAveSphereAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; protected: int nmax; diff --git a/src/EXTRA-COMPUTE/compute_basal_atom.h b/src/EXTRA-COMPUTE/compute_basal_atom.h index 45527411ec..75dabb22f9 100644 --- a/src/EXTRA-COMPUTE/compute_basal_atom.h +++ b/src/EXTRA-COMPUTE/compute_basal_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeBasalAtom : public Compute { public: ComputeBasalAtom(class LAMMPS *, int, char **); - ~ComputeBasalAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeBasalAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax, maxneigh; diff --git a/src/EXTRA-COMPUTE/compute_cnp_atom.h b/src/EXTRA-COMPUTE/compute_cnp_atom.h index 03c52c401a..050a1a7fb2 100644 --- a/src/EXTRA-COMPUTE/compute_cnp_atom.h +++ b/src/EXTRA-COMPUTE/compute_cnp_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeCNPAtom : public Compute { public: ComputeCNPAtom(class LAMMPS *, int, char **); - ~ComputeCNPAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeCNPAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: //revise diff --git a/src/EXTRA-COMPUTE/compute_entropy_atom.h b/src/EXTRA-COMPUTE/compute_entropy_atom.h index a122b2595d..eaca1ee395 100644 --- a/src/EXTRA-COMPUTE/compute_entropy_atom.h +++ b/src/EXTRA-COMPUTE/compute_entropy_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeEntropyAtom : public Compute { public: ComputeEntropyAtom(class LAMMPS *, int, char **); - ~ComputeEntropyAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeEntropyAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax, maxneigh, nbin; diff --git a/src/EXTRA-COMPUTE/compute_gyration_shape.h b/src/EXTRA-COMPUTE/compute_gyration_shape.h index 8f74082eec..60419d2324 100644 --- a/src/EXTRA-COMPUTE/compute_gyration_shape.h +++ b/src/EXTRA-COMPUTE/compute_gyration_shape.h @@ -29,9 +29,9 @@ class ComputeGyrationShape : public Compute { char *id_gyration; // fields accessed by other classes ComputeGyrationShape(class LAMMPS *, int, char **); - ~ComputeGyrationShape(); - void init(); - void compute_vector(); + ~ComputeGyrationShape() override; + void init() override; + void compute_vector() override; private: class Compute *c_gyration; diff --git a/src/EXTRA-COMPUTE/compute_gyration_shape_chunk.h b/src/EXTRA-COMPUTE/compute_gyration_shape_chunk.h index bfabfaa46d..f6437873f3 100644 --- a/src/EXTRA-COMPUTE/compute_gyration_shape_chunk.h +++ b/src/EXTRA-COMPUTE/compute_gyration_shape_chunk.h @@ -29,14 +29,14 @@ class ComputeGyrationShapeChunk : public Compute { char *id_gyration_chunk; // fields accessed by other classes ComputeGyrationShapeChunk(class LAMMPS *, int, char **); - ~ComputeGyrationShapeChunk(); - void init(); - void setup(); - void compute_array(); + ~ComputeGyrationShapeChunk() override; + void init() override; + void setup() override; + void compute_array() override; - int lock_length(); + int lock_length() override; - double memory_usage(); + double memory_usage() override; private: int current_nchunks, former_nchunks; diff --git a/src/EXTRA-COMPUTE/compute_hexorder_atom.h b/src/EXTRA-COMPUTE/compute_hexorder_atom.h index 34653621ea..ad1fd45e15 100644 --- a/src/EXTRA-COMPUTE/compute_hexorder_atom.h +++ b/src/EXTRA-COMPUTE/compute_hexorder_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeHexOrderAtom : public Compute { public: ComputeHexOrderAtom(class LAMMPS *, int, char **); - ~ComputeHexOrderAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeHexOrderAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax, maxneigh, ncol, nnn, ndegree; diff --git a/src/EXTRA-COMPUTE/compute_hma.h b/src/EXTRA-COMPUTE/compute_hma.h index 750f5fc242..d15c6f4317 100644 --- a/src/EXTRA-COMPUTE/compute_hma.h +++ b/src/EXTRA-COMPUTE/compute_hma.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class ComputeHMA : public Compute { public: ComputeHMA(class LAMMPS *, int, char **); - ~ComputeHMA(); - void setup(); - void init(); - void init_list(int, class NeighList *); - void compute_vector(); - void set_arrays(int); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~ComputeHMA() override; + void setup() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_vector() override; + void set_arrays(int) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: int nmax; diff --git a/src/EXTRA-COMPUTE/compute_momentum.h b/src/EXTRA-COMPUTE/compute_momentum.h index b6cfec95f6..60d5616d53 100644 --- a/src/EXTRA-COMPUTE/compute_momentum.h +++ b/src/EXTRA-COMPUTE/compute_momentum.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeMomentum : public Compute { public: ComputeMomentum(class LAMMPS *, int, char **); - virtual ~ComputeMomentum(); + ~ComputeMomentum() override; - virtual void init(); - virtual void compute_vector(); + void init() override; + void compute_vector() override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-COMPUTE/compute_msd_nongauss.h b/src/EXTRA-COMPUTE/compute_msd_nongauss.h index d94adf74c4..56edc90e3b 100644 --- a/src/EXTRA-COMPUTE/compute_msd_nongauss.h +++ b/src/EXTRA-COMPUTE/compute_msd_nongauss.h @@ -27,8 +27,7 @@ namespace LAMMPS_NS { class ComputeMSDNonGauss : public ComputeMSD { public: ComputeMSDNonGauss(class LAMMPS *, int, char **); - ~ComputeMSDNonGauss() {} - void compute_vector(); + void compute_vector() override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-COMPUTE/compute_pressure_cylinder.h b/src/EXTRA-COMPUTE/compute_pressure_cylinder.h index 11202f6f85..871c820910 100644 --- a/src/EXTRA-COMPUTE/compute_pressure_cylinder.h +++ b/src/EXTRA-COMPUTE/compute_pressure_cylinder.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputePressureCyl : public Compute { public: ComputePressureCyl(class LAMMPS *, int, char **); - ~ComputePressureCyl(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); - double memory_usage(); + ~ComputePressureCyl() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; + double memory_usage() override; private: int nbins, nphi, nzbins; diff --git a/src/EXTRA-COMPUTE/compute_stress_mop.h b/src/EXTRA-COMPUTE/compute_stress_mop.h index 29e85e190c..c247450019 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop.h @@ -31,10 +31,10 @@ namespace LAMMPS_NS { class ComputeStressMop : public Compute { public: ComputeStressMop(class LAMMPS *, int, char **); - virtual ~ComputeStressMop(); - void init(); - void init_list(int, class NeighList *); - void compute_vector(); + ~ComputeStressMop() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_vector() override; private: void compute_pairs(); diff --git a/src/EXTRA-COMPUTE/compute_stress_mop_profile.h b/src/EXTRA-COMPUTE/compute_stress_mop_profile.h index 8269fff269..f67448ca40 100644 --- a/src/EXTRA-COMPUTE/compute_stress_mop_profile.h +++ b/src/EXTRA-COMPUTE/compute_stress_mop_profile.h @@ -31,10 +31,10 @@ namespace LAMMPS_NS { class ComputeStressMopProfile : public Compute { public: ComputeStressMopProfile(class LAMMPS *, int, char **); - virtual ~ComputeStressMopProfile(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); + ~ComputeStressMopProfile() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; private: void compute_pairs(); diff --git a/src/EXTRA-COMPUTE/compute_temp_rotate.h b/src/EXTRA-COMPUTE/compute_temp_rotate.h index af218e756c..76eec14c31 100644 --- a/src/EXTRA-COMPUTE/compute_temp_rotate.h +++ b/src/EXTRA-COMPUTE/compute_temp_rotate.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class ComputeTempRotate : public Compute { public: ComputeTempRotate(class LAMMPS *, int, char **); - ~ComputeTempRotate(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempRotate() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); - void restore_bias_thr(int, double *, double *); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; + void restore_bias_thr(int, double *, double *) override; - double memory_usage(); + double memory_usage() override; private: double tfactor, masstotal; diff --git a/src/EXTRA-COMPUTE/compute_ti.h b/src/EXTRA-COMPUTE/compute_ti.h index 55d10c446c..e68decdceb 100644 --- a/src/EXTRA-COMPUTE/compute_ti.h +++ b/src/EXTRA-COMPUTE/compute_ti.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeTI : public Compute { public: ComputeTI(class LAMMPS *, int, char **); - ~ComputeTI(); - void init(); - double compute_scalar(); + ~ComputeTI() override; + void init() override; + double compute_scalar() override; private: int nterms; diff --git a/src/FEP/compute_fep.h b/src/FEP/compute_fep.h index d7f17abaf0..8f576124e0 100644 --- a/src/FEP/compute_fep.h +++ b/src/FEP/compute_fep.h @@ -31,9 +31,9 @@ namespace LAMMPS_NS { class ComputeFEP : public Compute { public: ComputeFEP(class LAMMPS *, int, char **); - ~ComputeFEP(); - void init(); - void compute_vector(); + ~ComputeFEP() override; + void init() override; + void compute_vector() override; private: int npert; diff --git a/src/GRANULAR/compute_contact_atom.h b/src/GRANULAR/compute_contact_atom.h index 6be62e4b31..784bff568f 100644 --- a/src/GRANULAR/compute_contact_atom.h +++ b/src/GRANULAR/compute_contact_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeContactAtom : public Compute { public: ComputeContactAtom(class LAMMPS *, int, char **); - ~ComputeContactAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeContactAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int nmax; diff --git a/src/GRANULAR/compute_fabric.h b/src/GRANULAR/compute_fabric.h index 5e20ea6562..b92f14bd2b 100644 --- a/src/GRANULAR/compute_fabric.h +++ b/src/GRANULAR/compute_fabric.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeFabric : public Compute { public: ComputeFabric(class LAMMPS *, int, char **); - ~ComputeFabric(); - void init(); - void init_list(int, class NeighList *); - void compute_vector(); - double compute_scalar(); + ~ComputeFabric() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_vector() override; + double compute_scalar() override; private: int ntensors, pstyle, cutstyle; diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h index 42607e5239..e935dc6a94 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h @@ -36,9 +36,9 @@ class ComputeAveSphereAtomKokkos : public ComputeAveSphereAtom { typedef ArrayTypes AT; ComputeAveSphereAtomKokkos(class LAMMPS *, int, char **); - virtual ~ComputeAveSphereAtomKokkos(); - void init(); - void compute_peratom(); + ~ComputeAveSphereAtomKokkos() override; + void init() override; + void compute_peratom() override; KOKKOS_INLINE_FUNCTION void operator()(TagComputeAveSphereAtom, const int&) const; diff --git a/src/KOKKOS/compute_coord_atom_kokkos.h b/src/KOKKOS/compute_coord_atom_kokkos.h index f67b52564c..1835bb6550 100644 --- a/src/KOKKOS/compute_coord_atom_kokkos.h +++ b/src/KOKKOS/compute_coord_atom_kokkos.h @@ -38,9 +38,9 @@ class ComputeCoordAtomKokkos : public ComputeCoordAtom { typedef ArrayTypes AT; ComputeCoordAtomKokkos(class LAMMPS *, int, char **); - virtual ~ComputeCoordAtomKokkos(); - void init(); - void compute_peratom(); + ~ComputeCoordAtomKokkos() override; + void init() override; + void compute_peratom() override; enum {NONE,CUTOFF,ORIENT}; template diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.h b/src/KOKKOS/compute_orientorder_atom_kokkos.h index 56d06b7936..f5ff8b2af7 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.h +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.h @@ -67,9 +67,9 @@ class ComputeOrientOrderAtomKokkos : public ComputeOrientOrderAtom { typedef int value_type; ComputeOrientOrderAtomKokkos(class LAMMPS *, int, char **); - ~ComputeOrientOrderAtomKokkos(); - void init(); - void compute_peratom(); + ~ComputeOrientOrderAtomKokkos() override; + void init() override; + void compute_peratom() override; t_sna_1i d_qlist; template @@ -127,7 +127,7 @@ class ComputeOrientOrderAtomKokkos : public ComputeOrientOrderAtom { KOKKOS_INLINE_FUNCTION double associated_legendre(int, int, double) const; - void init_clebsch_gordan(); + void init_clebsch_gordan() override; t_sna_1d d_cglist; // Clebsch-Gordan coeffs }; diff --git a/src/KOKKOS/compute_temp_deform_kokkos.h b/src/KOKKOS/compute_temp_deform_kokkos.h index 0292c6776d..e4ccecfe4b 100644 --- a/src/KOKKOS/compute_temp_deform_kokkos.h +++ b/src/KOKKOS/compute_temp_deform_kokkos.h @@ -76,11 +76,11 @@ class ComputeTempDeformKokkos: public ComputeTempDeform { typedef ArrayTypes AT; ComputeTempDeformKokkos(class LAMMPS *, int, char **); - ~ComputeTempDeformKokkos(); - double compute_scalar(); - void compute_vector(); - void remove_bias_all(); - void restore_bias_all(); + ~ComputeTempDeformKokkos() override; + double compute_scalar() override; + void compute_vector() override; + void remove_bias_all() override; + void restore_bias_all() override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/compute_temp_kokkos.h b/src/KOKKOS/compute_temp_kokkos.h index d882ebc8f4..42954a360c 100644 --- a/src/KOKKOS/compute_temp_kokkos.h +++ b/src/KOKKOS/compute_temp_kokkos.h @@ -72,9 +72,9 @@ class ComputeTempKokkos : public ComputeTemp { typedef ArrayTypes AT; ComputeTempKokkos(class LAMMPS *, int, char **); - virtual ~ComputeTempKokkos() {} - double compute_scalar(); - void compute_vector(); + + double compute_scalar() override; + void compute_vector() override; template KOKKOS_INLINE_FUNCTION diff --git a/src/MACHDYN/compute_smd_contact_radius.h b/src/MACHDYN/compute_smd_contact_radius.h index 87f3208dd3..3891bc8800 100644 --- a/src/MACHDYN/compute_smd_contact_radius.h +++ b/src/MACHDYN/compute_smd_contact_radius.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDContactRadius : public Compute { public: ComputeSMDContactRadius(class LAMMPS *, int, char **); - ~ComputeSMDContactRadius(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDContactRadius() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_damage.h b/src/MACHDYN/compute_smd_damage.h index ac1fcb1bb4..0200c2a3e3 100644 --- a/src/MACHDYN/compute_smd_damage.h +++ b/src/MACHDYN/compute_smd_damage.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDDamage : public Compute { public: ComputeSMDDamage(class LAMMPS *, int, char **); - ~ComputeSMDDamage(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDDamage() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_hourglass_error.h b/src/MACHDYN/compute_smd_hourglass_error.h index 32b5b90d56..8654028636 100644 --- a/src/MACHDYN/compute_smd_hourglass_error.h +++ b/src/MACHDYN/compute_smd_hourglass_error.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDHourglassError : public Compute { public: ComputeSMDHourglassError(class LAMMPS *, int, char **); - ~ComputeSMDHourglassError(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDHourglassError() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_internal_energy.h b/src/MACHDYN/compute_smd_internal_energy.h index b4aaaf6b40..774e8f16e3 100644 --- a/src/MACHDYN/compute_smd_internal_energy.h +++ b/src/MACHDYN/compute_smd_internal_energy.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDInternalEnergy : public Compute { public: ComputeSMDInternalEnergy(class LAMMPS *, int, char **); - ~ComputeSMDInternalEnergy(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDInternalEnergy() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_plastic_strain.h b/src/MACHDYN/compute_smd_plastic_strain.h index 7e319610a3..2315b2fcfe 100644 --- a/src/MACHDYN/compute_smd_plastic_strain.h +++ b/src/MACHDYN/compute_smd_plastic_strain.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDPlasticStrain : public Compute { public: ComputeSMDPlasticStrain(class LAMMPS *, int, char **); - ~ComputeSMDPlasticStrain(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDPlasticStrain() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_plastic_strain_rate.h b/src/MACHDYN/compute_smd_plastic_strain_rate.h index d0ea09af26..29fb8b5669 100644 --- a/src/MACHDYN/compute_smd_plastic_strain_rate.h +++ b/src/MACHDYN/compute_smd_plastic_strain_rate.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDPlasticStrainRate : public Compute { public: ComputeSMDPlasticStrainRate(class LAMMPS *, int, char **); - ~ComputeSMDPlasticStrainRate(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDPlasticStrainRate() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_rho.h b/src/MACHDYN/compute_smd_rho.h index 954caade5d..b4d41f1ee7 100644 --- a/src/MACHDYN/compute_smd_rho.h +++ b/src/MACHDYN/compute_smd_rho.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDRho : public Compute { public: ComputeSMDRho(class LAMMPS *, int, char **); - ~ComputeSMDRho(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDRho() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_tlsph_dt.h b/src/MACHDYN/compute_smd_tlsph_dt.h index e57db2dd74..7a4154da9a 100644 --- a/src/MACHDYN/compute_smd_tlsph_dt.h +++ b/src/MACHDYN/compute_smd_tlsph_dt.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTlsphDt : public Compute { public: ComputeSMDTlsphDt(class LAMMPS *, int, char **); - ~ComputeSMDTlsphDt(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTlsphDt() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_tlsph_num_neighs.h b/src/MACHDYN/compute_smd_tlsph_num_neighs.h index e3531a47ea..53efa059b6 100644 --- a/src/MACHDYN/compute_smd_tlsph_num_neighs.h +++ b/src/MACHDYN/compute_smd_tlsph_num_neighs.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTLSPHNumNeighs : public Compute { public: ComputeSMDTLSPHNumNeighs(class LAMMPS *, int, char **); - ~ComputeSMDTLSPHNumNeighs(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTLSPHNumNeighs() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_triangle_vertices.h b/src/MACHDYN/compute_smd_triangle_vertices.h index 06be1a4e1a..b7fa2e4fc2 100644 --- a/src/MACHDYN/compute_smd_triangle_vertices.h +++ b/src/MACHDYN/compute_smd_triangle_vertices.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTriangleVertices : public Compute { public: ComputeSMDTriangleVertices(class LAMMPS *, int, char **); - ~ComputeSMDTriangleVertices(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTriangleVertices() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_ulsph_effm.h b/src/MACHDYN/compute_smd_ulsph_effm.h index 836a3d2a74..5a653b48cd 100644 --- a/src/MACHDYN/compute_smd_ulsph_effm.h +++ b/src/MACHDYN/compute_smd_ulsph_effm.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMD_Ulsph_Effm : public Compute { public: ComputeSMD_Ulsph_Effm(class LAMMPS *, int, char **); - ~ComputeSMD_Ulsph_Effm(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMD_Ulsph_Effm() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_ulsph_num_neighs.h b/src/MACHDYN/compute_smd_ulsph_num_neighs.h index 527ba17737..29f98eac53 100644 --- a/src/MACHDYN/compute_smd_ulsph_num_neighs.h +++ b/src/MACHDYN/compute_smd_ulsph_num_neighs.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDULSPHNumNeighs : public Compute { public: ComputeSMDULSPHNumNeighs(class LAMMPS *, int, char **); - ~ComputeSMDULSPHNumNeighs(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDULSPHNumNeighs() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_ulsph_strain.h b/src/MACHDYN/compute_smd_ulsph_strain.h index 54f53f6782..b958c036fd 100644 --- a/src/MACHDYN/compute_smd_ulsph_strain.h +++ b/src/MACHDYN/compute_smd_ulsph_strain.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDULSPHstrain : public Compute { public: ComputeSMDULSPHstrain(class LAMMPS *, int, char **); - ~ComputeSMDULSPHstrain(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDULSPHstrain() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_vol.h b/src/MACHDYN/compute_smd_vol.h index c0fd4550b4..e368633fba 100644 --- a/src/MACHDYN/compute_smd_vol.h +++ b/src/MACHDYN/compute_smd_vol.h @@ -38,11 +38,11 @@ namespace LAMMPS_NS { class ComputeSMDVol : public Compute { public: ComputeSMDVol(class LAMMPS *, int, char **); - ~ComputeSMDVol(); - void init(); - void compute_peratom(); - double compute_scalar(); - double memory_usage(); + ~ComputeSMDVol() override; + void init() override; + void compute_peratom() override; + double compute_scalar() override; + double memory_usage() override; private: int nmax; diff --git a/src/MESONT/compute_mesont.h b/src/MESONT/compute_mesont.h index ea8df7cf8c..b1ed890139 100644 --- a/src/MESONT/compute_mesont.h +++ b/src/MESONT/compute_mesont.h @@ -29,13 +29,13 @@ namespace LAMMPS_NS { class ComputeMesoNT : public Compute { public: ComputeMesoNT(class LAMMPS *, int, char **); - ~ComputeMesoNT(); - void init() {} - void compute_peratom(); - double compute_scalar(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeMesoNT() override; + void init() override {} + void compute_peratom() override; + double compute_scalar() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int nmax; diff --git a/src/MISC/compute_viscosity_cos.h b/src/MISC/compute_viscosity_cos.h index e6a1894ce3..d30ff5c50a 100644 --- a/src/MISC/compute_viscosity_cos.h +++ b/src/MISC/compute_viscosity_cos.h @@ -31,18 +31,18 @@ namespace LAMMPS_NS { class ComputeViscosityCos : public Compute { public: ComputeViscosityCos(class LAMMPS *, int, char **); - virtual ~ComputeViscosityCos(); - void init() {} - void setup(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputeViscosityCos() override; + void init() override {} + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_thr(int, double *, double *); - void restore_bias_all(); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_thr(int, double *, double *) override; + void restore_bias_all() override; protected: double tfactor; diff --git a/src/ML-IAP/compute_mliap.h b/src/ML-IAP/compute_mliap.h index 6afbc970cb..db1b6c0449 100644 --- a/src/ML-IAP/compute_mliap.h +++ b/src/ML-IAP/compute_mliap.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeMLIAP : public Compute { public: ComputeMLIAP(class LAMMPS *, int, char **); - ~ComputeMLIAP(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); + ~ComputeMLIAP() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; void generate_neigharrays(); void grow_neigharrays(); - double memory_usage(); + double memory_usage() override; private: double **mliaparray, **mliaparrayall; diff --git a/src/ML-IAP/mliap_data.h b/src/ML-IAP/mliap_data.h index 5f689c204c..258261fa1a 100644 --- a/src/ML-IAP/mliap_data.h +++ b/src/ML-IAP/mliap_data.h @@ -23,7 +23,7 @@ class MLIAPData : protected Pointers { public: MLIAPData(class LAMMPS *, int, int *, class MLIAPModel *, class MLIAPDescriptor *, class PairMLIAP * = nullptr); - ~MLIAPData(); + ~MLIAPData() override; void init(); void generate_neighdata(class NeighList *, int = 0, int = 0); diff --git a/src/ML-IAP/mliap_descriptor.h b/src/ML-IAP/mliap_descriptor.h index 1655cc4a82..156f8d1e92 100644 --- a/src/ML-IAP/mliap_descriptor.h +++ b/src/ML-IAP/mliap_descriptor.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPDescriptor : protected Pointers { public: MLIAPDescriptor(LAMMPS *); - virtual ~MLIAPDescriptor(); + ~MLIAPDescriptor() override; virtual void compute_descriptors(class MLIAPData *) = 0; virtual void compute_forces(class MLIAPData *) = 0; virtual void compute_force_gradients(class MLIAPData *) = 0; diff --git a/src/ML-IAP/mliap_descriptor_snap.h b/src/ML-IAP/mliap_descriptor_snap.h index 7d8c3ea98c..9098015a4f 100644 --- a/src/ML-IAP/mliap_descriptor_snap.h +++ b/src/ML-IAP/mliap_descriptor_snap.h @@ -21,13 +21,13 @@ namespace LAMMPS_NS { class MLIAPDescriptorSNAP : public MLIAPDescriptor { public: MLIAPDescriptorSNAP(LAMMPS *, char *); - virtual ~MLIAPDescriptorSNAP(); - virtual void compute_descriptors(class MLIAPData *); - virtual void compute_forces(class MLIAPData *); - virtual void compute_force_gradients(class MLIAPData *); - virtual void compute_descriptor_gradients(class MLIAPData *); - virtual void init(); - virtual double memory_usage(); + ~MLIAPDescriptorSNAP() override; + void compute_descriptors(class MLIAPData *) override; + void compute_forces(class MLIAPData *) override; + void compute_force_gradients(class MLIAPData *) override; + void compute_descriptor_gradients(class MLIAPData *) override; + void init() override; + double memory_usage() override; double rcutfac; diff --git a/src/ML-IAP/mliap_model.h b/src/ML-IAP/mliap_model.h index 3a73065b04..23895f29c3 100644 --- a/src/ML-IAP/mliap_model.h +++ b/src/ML-IAP/mliap_model.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPModel : protected Pointers { public: MLIAPModel(LAMMPS *, char *); - virtual ~MLIAPModel(); + ~MLIAPModel() override; void set_ndescriptors(int); void set_nelements(int); virtual int get_nparams() = 0; @@ -44,11 +44,11 @@ class MLIAPModel : protected Pointers { class MLIAPModelSimple : public MLIAPModel { public: MLIAPModelSimple(LAMMPS *, char *); - ~MLIAPModelSimple(){}; - virtual double memory_usage(); + ~MLIAPModelSimple() override{}; + double memory_usage() override; protected: - virtual void read_coeffs(char *); + void read_coeffs(char *) override; }; } // namespace LAMMPS_NS diff --git a/src/ML-IAP/mliap_model_linear.h b/src/ML-IAP/mliap_model_linear.h index d2abaec31e..cd22ca8d7d 100644 --- a/src/ML-IAP/mliap_model_linear.h +++ b/src/ML-IAP/mliap_model_linear.h @@ -21,12 +21,12 @@ namespace LAMMPS_NS { class MLIAPModelLinear : public MLIAPModelSimple { public: MLIAPModelLinear(LAMMPS *, char * = nullptr); - ~MLIAPModelLinear() = default; - virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData *); - virtual void compute_gradients(class MLIAPData *); - virtual void compute_gradgrads(class MLIAPData *); - virtual void compute_force_gradients(class MLIAPData *); + + int get_nparams() override; + int get_gamma_nnz(class MLIAPData *) override; + void compute_gradients(class MLIAPData *) override; + void compute_gradgrads(class MLIAPData *) override; + void compute_force_gradients(class MLIAPData *) override; protected: }; diff --git a/src/ML-IAP/mliap_model_quadratic.h b/src/ML-IAP/mliap_model_quadratic.h index 74234066c8..36eab165e4 100644 --- a/src/ML-IAP/mliap_model_quadratic.h +++ b/src/ML-IAP/mliap_model_quadratic.h @@ -21,12 +21,12 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModelSimple { public: MLIAPModelQuadratic(LAMMPS *, char * = nullptr); - ~MLIAPModelQuadratic() = default; - virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData *); - virtual void compute_gradients(class MLIAPData *); - virtual void compute_gradgrads(class MLIAPData *); - virtual void compute_force_gradients(class MLIAPData *); + + int get_nparams() override; + int get_gamma_nnz(class MLIAPData *) override; + void compute_gradients(class MLIAPData *) override; + void compute_gradgrads(class MLIAPData *) override; + void compute_force_gradients(class MLIAPData *) override; protected: }; diff --git a/src/ML-SNAP/compute_sna_atom.h b/src/ML-SNAP/compute_sna_atom.h index 3bcf217b51..ca5cd64d47 100644 --- a/src/ML-SNAP/compute_sna_atom.h +++ b/src/ML-SNAP/compute_sna_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeSNAAtom : public Compute { public: ComputeSNAAtom(class LAMMPS *, int, char **); - ~ComputeSNAAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeSNAAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/ML-SNAP/compute_snad_atom.h b/src/ML-SNAP/compute_snad_atom.h index f175538d5f..94dec9b85f 100644 --- a/src/ML-SNAP/compute_snad_atom.h +++ b/src/ML-SNAP/compute_snad_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeSNADAtom : public Compute { public: ComputeSNADAtom(class LAMMPS *, int, char **); - ~ComputeSNADAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeSNADAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int nmax; diff --git a/src/ML-SNAP/compute_snap.h b/src/ML-SNAP/compute_snap.h index 131fafd68c..f092ede729 100644 --- a/src/ML-SNAP/compute_snap.h +++ b/src/ML-SNAP/compute_snap.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeSnap : public Compute { public: ComputeSnap(class LAMMPS *, int, char **); - ~ComputeSnap(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); - double memory_usage(); + ~ComputeSnap() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; + double memory_usage() override; private: int natoms, nmax, size_peratom, lastcol; diff --git a/src/ML-SNAP/compute_snav_atom.h b/src/ML-SNAP/compute_snav_atom.h index 0c3fce54bb..d61d345408 100644 --- a/src/ML-SNAP/compute_snav_atom.h +++ b/src/ML-SNAP/compute_snav_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeSNAVAtom : public Compute { public: ComputeSNAVAtom(class LAMMPS *, int, char **); - ~ComputeSNAVAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeSNAVAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int nmax; diff --git a/src/ML-SNAP/sna.h b/src/ML-SNAP/sna.h index bd2249a101..3b949d564c 100644 --- a/src/ML-SNAP/sna.h +++ b/src/ML-SNAP/sna.h @@ -36,7 +36,7 @@ class SNA : protected Pointers { SNA(LAMMPS *, double, int, double, int, int, int, int, int, int); SNA(LAMMPS *lmp) : Pointers(lmp){}; - ~SNA(); + ~SNA() override; void build_indexlist(); void init(); double memory_usage(); diff --git a/src/PERI/compute_damage_atom.h b/src/PERI/compute_damage_atom.h index 43b28c3794..3195977101 100644 --- a/src/PERI/compute_damage_atom.h +++ b/src/PERI/compute_damage_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeDamageAtom : public Compute { public: ComputeDamageAtom(class LAMMPS *, int, char **); - ~ComputeDamageAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeDamageAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/PERI/compute_dilatation_atom.h b/src/PERI/compute_dilatation_atom.h index 476634753d..b035c79255 100644 --- a/src/PERI/compute_dilatation_atom.h +++ b/src/PERI/compute_dilatation_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeDilatationAtom : public Compute { public: ComputeDilatationAtom(class LAMMPS *, int, char **); - ~ComputeDilatationAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeDilatationAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/PERI/compute_plasticity_atom.h b/src/PERI/compute_plasticity_atom.h index cbb1182dee..ba0e04a48c 100644 --- a/src/PERI/compute_plasticity_atom.h +++ b/src/PERI/compute_plasticity_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputePlasticityAtom : public Compute { public: ComputePlasticityAtom(class LAMMPS *, int, char **); - ~ComputePlasticityAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputePlasticityAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/PTM/compute_ptm_atom.h b/src/PTM/compute_ptm_atom.h index 3df1c2518e..61101f6efa 100644 --- a/src/PTM/compute_ptm_atom.h +++ b/src/PTM/compute_ptm_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputePTMAtom : public Compute { public: ComputePTMAtom(class LAMMPS *, int, char **); - ~ComputePTMAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputePTMAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/REAXFF/compute_spec_atom.h b/src/REAXFF/compute_spec_atom.h index 3974f38354..40f184e3ed 100644 --- a/src/REAXFF/compute_spec_atom.h +++ b/src/REAXFF/compute_spec_atom.h @@ -28,10 +28,10 @@ namespace LAMMPS_NS { class ComputeSpecAtom : public Compute { public: ComputeSpecAtom(class LAMMPS *, int, char **); - ~ComputeSpecAtom(); - void init() {} - void compute_peratom(); - double memory_usage(); + ~ComputeSpecAtom() override; + void init() override {} + void compute_peratom() override; + double memory_usage() override; private: int nvalues; diff --git a/src/REPLICA/compute_event_displace.h b/src/REPLICA/compute_event_displace.h index c8c4c8810d..d4ee68a092 100644 --- a/src/REPLICA/compute_event_displace.h +++ b/src/REPLICA/compute_event_displace.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeEventDisplace : public Compute { public: ComputeEventDisplace(class LAMMPS *, int, char **); - ~ComputeEventDisplace(); - void init(); - double compute_scalar(); + ~ComputeEventDisplace() override; + void init() override; + double compute_scalar() override; int all_events(); - void reset_extra_compute_fix(const char *); + void reset_extra_compute_fix(const char *) override; private: int triclinic; diff --git a/src/REPLICA/compute_pressure_grem.h b/src/REPLICA/compute_pressure_grem.h index 74a504270d..8fa62965ee 100644 --- a/src/REPLICA/compute_pressure_grem.h +++ b/src/REPLICA/compute_pressure_grem.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputePressureGrem : public ComputePressure { public: ComputePressureGrem(class LAMMPS *, int, char **); - virtual ~ComputePressureGrem(); - virtual void init(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputePressureGrem() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; protected: // Access to gREM fix scale factor diff --git a/src/RIGID/compute_erotate_rigid.h b/src/RIGID/compute_erotate_rigid.h index b8571fa21a..3005df8493 100644 --- a/src/RIGID/compute_erotate_rigid.h +++ b/src/RIGID/compute_erotate_rigid.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeERotateRigid : public Compute { public: ComputeERotateRigid(class LAMMPS *, int, char **); - ~ComputeERotateRigid(); - void init(); - double compute_scalar(); + ~ComputeERotateRigid() override; + void init() override; + double compute_scalar() override; private: int irfix; diff --git a/src/RIGID/compute_ke_rigid.h b/src/RIGID/compute_ke_rigid.h index 32ec7e062e..dfdd4d2e21 100644 --- a/src/RIGID/compute_ke_rigid.h +++ b/src/RIGID/compute_ke_rigid.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeKERigid : public Compute { public: ComputeKERigid(class LAMMPS *, int, char **); - ~ComputeKERigid(); - void init(); - double compute_scalar(); + ~ComputeKERigid() override; + void init() override; + double compute_scalar() override; private: int irfix; diff --git a/src/RIGID/compute_rigid_local.h b/src/RIGID/compute_rigid_local.h index 3c8b48f366..1d07f835b2 100644 --- a/src/RIGID/compute_rigid_local.h +++ b/src/RIGID/compute_rigid_local.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeRigidLocal : public Compute { public: ComputeRigidLocal(class LAMMPS *, int, char **); - ~ComputeRigidLocal(); - void init(); - void compute_local(); - double memory_usage(); + ~ComputeRigidLocal() override; + void init() override; + void compute_local() override; + double memory_usage() override; private: int nvalues; diff --git a/src/SPH/compute_sph_e_atom.h b/src/SPH/compute_sph_e_atom.h index fa6d995dcc..00ff5550d7 100644 --- a/src/SPH/compute_sph_e_atom.h +++ b/src/SPH/compute_sph_e_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeSPHEAtom : public Compute { public: ComputeSPHEAtom(class LAMMPS *, int, char **); - ~ComputeSPHEAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSPHEAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/SPH/compute_sph_rho_atom.h b/src/SPH/compute_sph_rho_atom.h index 9c3a367b6c..a3a366df07 100644 --- a/src/SPH/compute_sph_rho_atom.h +++ b/src/SPH/compute_sph_rho_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeSPHRhoAtom : public Compute { public: ComputeSPHRhoAtom(class LAMMPS *, int, char **); - ~ComputeSPHRhoAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSPHRhoAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/SPH/compute_sph_t_atom.h b/src/SPH/compute_sph_t_atom.h index 937ab6da33..786fb8b063 100644 --- a/src/SPH/compute_sph_t_atom.h +++ b/src/SPH/compute_sph_t_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeSPHTAtom : public Compute { public: ComputeSPHTAtom(class LAMMPS *, int, char **); - ~ComputeSPHTAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSPHTAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/SPIN/compute_spin.h b/src/SPIN/compute_spin.h index 766cfa4ccd..7f85053c0c 100644 --- a/src/SPIN/compute_spin.h +++ b/src/SPIN/compute_spin.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeSpin : public Compute { public: ComputeSpin(class LAMMPS *, int, char **); - ~ComputeSpin(); - void init(); - void compute_vector(); + ~ComputeSpin() override; + void init() override; + void compute_vector() override; private: int pair_spin_flag; // magnetic pair flags diff --git a/src/TALLY/compute_force_tally.h b/src/TALLY/compute_force_tally.h index f35ea9ad0a..a46e074103 100644 --- a/src/TALLY/compute_force_tally.h +++ b/src/TALLY/compute_force_tally.h @@ -28,19 +28,19 @@ class ComputeForceTally : public Compute { public: ComputeForceTally(class LAMMPS *, int, char **); - virtual ~ComputeForceTally(); + ~ComputeForceTally() override; - void init(); + void init() override; - double compute_scalar(); - void compute_peratom(); + double compute_scalar() override; + void compute_peratom() override; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; - void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + void pair_setup_callback(int, int) override; + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double) override; private: bigint did_setup; diff --git a/src/TALLY/compute_heat_flux_tally.h b/src/TALLY/compute_heat_flux_tally.h index 234afa8c68..8110ad6fc7 100644 --- a/src/TALLY/compute_heat_flux_tally.h +++ b/src/TALLY/compute_heat_flux_tally.h @@ -28,18 +28,18 @@ class ComputeHeatFluxTally : public Compute { public: ComputeHeatFluxTally(class LAMMPS *, int, char **); - virtual ~ComputeHeatFluxTally(); + ~ComputeHeatFluxTally() override; - void init(); + void init() override; - void compute_vector(); + void compute_vector() override; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; - void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + void pair_setup_callback(int, int) override; + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double) override; private: bigint did_setup; diff --git a/src/TALLY/compute_heat_flux_virial_tally.h b/src/TALLY/compute_heat_flux_virial_tally.h index d2a3d39a7d..1d664ce560 100644 --- a/src/TALLY/compute_heat_flux_virial_tally.h +++ b/src/TALLY/compute_heat_flux_virial_tally.h @@ -28,19 +28,19 @@ class ComputeHeatFluxVirialTally : public Compute { public: ComputeHeatFluxVirialTally(class LAMMPS *, int, char **); - virtual ~ComputeHeatFluxVirialTally(); + ~ComputeHeatFluxVirialTally() override; - void init(); + void init() override; - double compute_scalar(); - void compute_peratom(); + double compute_scalar() override; + void compute_peratom() override; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; - void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + void pair_setup_callback(int, int) override; + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double) override; private: bigint did_setup; diff --git a/src/TALLY/compute_pe_mol_tally.h b/src/TALLY/compute_pe_mol_tally.h index 3f7457aad5..b123d7cf78 100644 --- a/src/TALLY/compute_pe_mol_tally.h +++ b/src/TALLY/compute_pe_mol_tally.h @@ -28,13 +28,13 @@ class ComputePEMolTally : public Compute { public: ComputePEMolTally(class LAMMPS *, int, char **); - virtual ~ComputePEMolTally(); + ~ComputePEMolTally() override; - void init(); - void compute_vector(); + void init() override; + void compute_vector() override; - void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + void pair_setup_callback(int, int) override; + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double) override; private: bigint did_setup; diff --git a/src/TALLY/compute_pe_tally.h b/src/TALLY/compute_pe_tally.h index 8f6f42a685..dfccce5f7e 100644 --- a/src/TALLY/compute_pe_tally.h +++ b/src/TALLY/compute_pe_tally.h @@ -28,19 +28,19 @@ class ComputePETally : public Compute { public: ComputePETally(class LAMMPS *, int, char **); - virtual ~ComputePETally(); + ~ComputePETally() override; - void init(); + void init() override; - double compute_scalar(); - void compute_peratom(); + double compute_scalar() override; + void compute_peratom() override; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; - void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + void pair_setup_callback(int, int) override; + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double) override; private: bigint did_setup; diff --git a/src/TALLY/compute_stress_tally.h b/src/TALLY/compute_stress_tally.h index 709a8caa8f..9910667df3 100644 --- a/src/TALLY/compute_stress_tally.h +++ b/src/TALLY/compute_stress_tally.h @@ -28,19 +28,19 @@ class ComputeStressTally : public Compute { public: ComputeStressTally(class LAMMPS *, int, char **); - virtual ~ComputeStressTally(); + ~ComputeStressTally() override; - void init(); + void init() override; - double compute_scalar(); - void compute_peratom(); + double compute_scalar() override; + void compute_peratom() override; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; - void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + void pair_setup_callback(int, int) override; + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double) override; private: bigint did_setup; diff --git a/src/UEF/compute_pressure_uef.h b/src/UEF/compute_pressure_uef.h index cbbd241119..d969f2f7ad 100644 --- a/src/UEF/compute_pressure_uef.h +++ b/src/UEF/compute_pressure_uef.h @@ -29,10 +29,10 @@ namespace LAMMPS_NS { class ComputePressureUef : public ComputePressure { public: ComputePressureUef(class LAMMPS *, int, char **); - virtual ~ComputePressureUef() {} - virtual void init(); - virtual void compute_vector(); - virtual double compute_scalar(); + + void init() override; + void compute_vector() override; + double compute_scalar() override; void update_rot(); bool in_fix; //true if this compute is used in fix/nvt/npt diff --git a/src/UEF/compute_temp_uef.h b/src/UEF/compute_temp_uef.h index 92e9293040..eb5bdac37d 100644 --- a/src/UEF/compute_temp_uef.h +++ b/src/UEF/compute_temp_uef.h @@ -29,9 +29,9 @@ namespace LAMMPS_NS { class ComputeTempUef : public ComputeTemp { public: ComputeTempUef(class LAMMPS *, int, char **); - virtual ~ComputeTempUef() {} - virtual void init(); - virtual void compute_vector(); + + void init() override; + void compute_vector() override; void yes_rot(); void no_rot(); diff --git a/src/compute_aggregate_atom.h b/src/compute_aggregate_atom.h index 9bacf37ae1..dc044c0b1a 100644 --- a/src/compute_aggregate_atom.h +++ b/src/compute_aggregate_atom.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class ComputeAggregateAtom : public Compute { public: ComputeAggregateAtom(class LAMMPS *, int, char **); - ~ComputeAggregateAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeAggregateAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int nmax, commflag; diff --git a/src/compute_angle.h b/src/compute_angle.h index efdbebee10..62a5ea1fdf 100644 --- a/src/compute_angle.h +++ b/src/compute_angle.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeAngle : public Compute { public: ComputeAngle(class LAMMPS *, int, char **); - ~ComputeAngle(); - void init(); - void compute_vector(); + ~ComputeAngle() override; + void init() override; + void compute_vector() override; private: int nsub; diff --git a/src/compute_angle_local.h b/src/compute_angle_local.h index 3aebfae0a8..bea7b0c682 100644 --- a/src/compute_angle_local.h +++ b/src/compute_angle_local.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeAngleLocal : public Compute { public: ComputeAngleLocal(class LAMMPS *, int, char **); - ~ComputeAngleLocal(); - void init(); - void compute_local(); - double memory_usage(); + ~ComputeAngleLocal() override; + void init() override; + void compute_local() override; + double memory_usage() override; private: int nvalues, nvar, ncount, setflag, tflag; diff --git a/src/compute_angmom_chunk.h b/src/compute_angmom_chunk.h index 384de5cc33..f401b8abd0 100644 --- a/src/compute_angmom_chunk.h +++ b/src/compute_angmom_chunk.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class ComputeAngmomChunk : public Compute { public: ComputeAngmomChunk(class LAMMPS *, int, char **); - ~ComputeAngmomChunk(); - void init(); - void compute_array(); + ~ComputeAngmomChunk() override; + void init() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_bond.h b/src/compute_bond.h index 174fcb06f3..4981782972 100644 --- a/src/compute_bond.h +++ b/src/compute_bond.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeBond : public Compute { public: ComputeBond(class LAMMPS *, int, char **); - ~ComputeBond(); - void init(); - void compute_vector(); + ~ComputeBond() override; + void init() override; + void compute_vector() override; private: int nsub; diff --git a/src/compute_bond_local.h b/src/compute_bond_local.h index 5ecbaac2a0..0f028f05e8 100644 --- a/src/compute_bond_local.h +++ b/src/compute_bond_local.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeBondLocal : public Compute { public: ComputeBondLocal(class LAMMPS *, int, char **); - ~ComputeBondLocal(); - void init(); - void compute_local(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~ComputeBondLocal() override; + void init() override; + void compute_local() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: int nvalues, nvar, ncount, setflag; diff --git a/src/compute_centro_atom.h b/src/compute_centro_atom.h index c7e66cfad1..8eb1df696b 100644 --- a/src/compute_centro_atom.h +++ b/src/compute_centro_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeCentroAtom : public Compute { public: ComputeCentroAtom(class LAMMPS *, int, char **); - ~ComputeCentroAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeCentroAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax, maxneigh, nnn; diff --git a/src/compute_centroid_stress_atom.h b/src/compute_centroid_stress_atom.h index d332788aa4..429d565419 100644 --- a/src/compute_centroid_stress_atom.h +++ b/src/compute_centroid_stress_atom.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeCentroidStressAtom : public Compute { public: ComputeCentroidStressAtom(class LAMMPS *, int, char **); - ~ComputeCentroidStressAtom(); - void init(); - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeCentroidStressAtom() override; + void init() override; + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index e2c3ebe96b..528829f9a5 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -35,16 +35,16 @@ class ComputeChunkAtom : public Compute { int *ichunk, *chunkID; ComputeChunkAtom(class LAMMPS *, int, char **); - ~ComputeChunkAtom(); - void init(); - void setup(); - void compute_peratom(); - double compute_scalar(); - void set_arrays(int); - double memory_usage(); + ~ComputeChunkAtom() override; + void init() override; + void setup() override; + void compute_peratom() override; + double compute_scalar() override; + void set_arrays(int) override; + double memory_usage() override; - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; int setup_chunks(); void compute_ichunk(); diff --git a/src/compute_chunk_spread_atom.h b/src/compute_chunk_spread_atom.h index b7cc1d4739..e1e2a2a584 100644 --- a/src/compute_chunk_spread_atom.h +++ b/src/compute_chunk_spread_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeChunkSpreadAtom : public Compute { public: ComputeChunkSpreadAtom(class LAMMPS *, int, char **); - ~ComputeChunkSpreadAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeChunkSpreadAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; protected: int mode, nvalues; diff --git a/src/compute_cluster_atom.h b/src/compute_cluster_atom.h index 2f9bd8955c..1d5c03277d 100644 --- a/src/compute_cluster_atom.h +++ b/src/compute_cluster_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeClusterAtom : public Compute { public: ComputeClusterAtom(class LAMMPS *, int, char **); - ~ComputeClusterAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~ComputeClusterAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: int nmax, commflag; diff --git a/src/compute_cna_atom.h b/src/compute_cna_atom.h index 4546a3f66e..eab6fae0f3 100644 --- a/src/compute_cna_atom.h +++ b/src/compute_cna_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeCNAAtom : public Compute { public: ComputeCNAAtom(class LAMMPS *, int, char **); - ~ComputeCNAAtom(); - void init(); - void init_list(int, class NeighList *); - void compute_peratom(); - double memory_usage(); + ~ComputeCNAAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/compute_com.h b/src/compute_com.h index 73cd0739e9..762e63d84a 100644 --- a/src/compute_com.h +++ b/src/compute_com.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeCOM : public Compute { public: ComputeCOM(class LAMMPS *, int, char **); - ~ComputeCOM(); - void init(); - void compute_vector(); + ~ComputeCOM() override; + void init() override; + void compute_vector() override; private: double masstotal; diff --git a/src/compute_com_chunk.h b/src/compute_com_chunk.h index c2aedaabed..78a74a1937 100644 --- a/src/compute_com_chunk.h +++ b/src/compute_com_chunk.h @@ -30,18 +30,18 @@ class ComputeCOMChunk : public Compute { double *masstotal; ComputeCOMChunk(class LAMMPS *, int, char **); - ~ComputeCOMChunk(); - void init(); - void setup(); - void compute_array(); + ~ComputeCOMChunk() override; + void init() override; + void setup() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_coord_atom.h b/src/compute_coord_atom.h index 9ac0a8c3b3..563baef973 100644 --- a/src/compute_coord_atom.h +++ b/src/compute_coord_atom.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class ComputeCoordAtom : public Compute { public: ComputeCoordAtom(class LAMMPS *, int, char **); - virtual ~ComputeCoordAtom(); - virtual void init(); - void init_list(int, class NeighList *); - virtual void compute_peratom(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~ComputeCoordAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; enum { NONE, CUTOFF, ORIENT }; protected: diff --git a/src/compute_deprecated.h b/src/compute_deprecated.h index 74dd997f2a..3770a9978e 100644 --- a/src/compute_deprecated.h +++ b/src/compute_deprecated.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class ComputeDeprecated : public Compute { public: ComputeDeprecated(class LAMMPS *, int, char **); - ~ComputeDeprecated() {} - void init() {} + void init() override {} }; } // namespace LAMMPS_NS diff --git a/src/compute_dihedral.h b/src/compute_dihedral.h index f5bf756d0e..d7e7662ec9 100644 --- a/src/compute_dihedral.h +++ b/src/compute_dihedral.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeDihedral : public Compute { public: ComputeDihedral(class LAMMPS *, int, char **); - ~ComputeDihedral(); - void init(); - void compute_vector(); + ~ComputeDihedral() override; + void init() override; + void compute_vector() override; private: int nsub; diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h index a74d277776..99274a7265 100644 --- a/src/compute_dihedral_local.h +++ b/src/compute_dihedral_local.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeDihedralLocal : public Compute { public: ComputeDihedralLocal(class LAMMPS *, int, char **); - ~ComputeDihedralLocal(); - void init(); - void compute_local(); - double memory_usage(); + ~ComputeDihedralLocal() override; + void init() override; + void compute_local() override; + double memory_usage() override; private: int nvalues, nvar, ncount, setflag; diff --git a/src/compute_dipole.h b/src/compute_dipole.h index 39dcd929e9..9e16f6c998 100644 --- a/src/compute_dipole.h +++ b/src/compute_dipole.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeDipole : public Compute { public: ComputeDipole(class LAMMPS *, int, char **); - virtual ~ComputeDipole(); - void init(){}; - void compute_vector(); - double compute_scalar(); + ~ComputeDipole() override; + void init() override{}; + void compute_vector() override; + double compute_scalar() override; private: int usecenter; diff --git a/src/compute_dipole_chunk.h b/src/compute_dipole_chunk.h index b44852d543..fbe97c481b 100644 --- a/src/compute_dipole_chunk.h +++ b/src/compute_dipole_chunk.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class ComputeDipoleChunk : public Compute { public: ComputeDipoleChunk(class LAMMPS *, int, char **); - ~ComputeDipoleChunk(); - void init(); - void compute_array(); + ~ComputeDipoleChunk() override; + void init() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_displace_atom.h b/src/compute_displace_atom.h index 79e0a67f7a..4eac39d5b0 100644 --- a/src/compute_displace_atom.h +++ b/src/compute_displace_atom.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeDisplaceAtom : public Compute { public: ComputeDisplaceAtom(class LAMMPS *, int, char **); - ~ComputeDisplaceAtom(); - void init(); - void compute_peratom(); - void set_arrays(int); - void refresh(); - double memory_usage(); + ~ComputeDisplaceAtom() override; + void init() override; + void compute_peratom() override; + void set_arrays(int) override; + void refresh() override; + double memory_usage() override; private: int nmax; diff --git a/src/compute_erotate_sphere.h b/src/compute_erotate_sphere.h index 09f0604dbd..3fb47afbe8 100644 --- a/src/compute_erotate_sphere.h +++ b/src/compute_erotate_sphere.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeERotateSphere : public Compute { public: ComputeERotateSphere(class LAMMPS *, int, char **); - ~ComputeERotateSphere() {} - void init(); - double compute_scalar(); + ~ComputeERotateSphere() override {} + void init() override; + double compute_scalar() override; private: double pfactor; diff --git a/src/compute_erotate_sphere_atom.h b/src/compute_erotate_sphere_atom.h index b44576d523..5ec58d44be 100644 --- a/src/compute_erotate_sphere_atom.h +++ b/src/compute_erotate_sphere_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeErotateSphereAtom : public Compute { public: ComputeErotateSphereAtom(class LAMMPS *, int, char **); - ~ComputeErotateSphereAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeErotateSphereAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/compute_fragment_atom.h b/src/compute_fragment_atom.h index 4cf7478d61..5ba430ee30 100644 --- a/src/compute_fragment_atom.h +++ b/src/compute_fragment_atom.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeFragmentAtom : public Compute { public: ComputeFragmentAtom(class LAMMPS *, int, char **); - ~ComputeFragmentAtom(); - void init(); - void compute_peratom(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~ComputeFragmentAtom() override; + void init() override; + void compute_peratom() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: int nmax, commflag, singleflag; diff --git a/src/compute_global_atom.h b/src/compute_global_atom.h index 4f5d5ea00d..1cf9a7322a 100644 --- a/src/compute_global_atom.h +++ b/src/compute_global_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeGlobalAtom : public Compute { public: ComputeGlobalAtom(class LAMMPS *, int, char **); - virtual ~ComputeGlobalAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeGlobalAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; protected: int whichref, indexref, ref2index; diff --git a/src/compute_group_group.h b/src/compute_group_group.h index 1a34a19fe6..c5505f51ee 100644 --- a/src/compute_group_group.h +++ b/src/compute_group_group.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeGroupGroup : public Compute { public: ComputeGroupGroup(class LAMMPS *, int, char **); - ~ComputeGroupGroup(); - void init(); - void init_list(int, class NeighList *); - double compute_scalar(); - void compute_vector(); + ~ComputeGroupGroup() override; + void init() override; + void init_list(int, class NeighList *) override; + double compute_scalar() override; + void compute_vector() override; private: char *group2; diff --git a/src/compute_gyration.h b/src/compute_gyration.h index 2eccb46409..f6dd748640 100644 --- a/src/compute_gyration.h +++ b/src/compute_gyration.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeGyration : public Compute { public: ComputeGyration(class LAMMPS *, int, char **); - ~ComputeGyration(); - void init(); - double compute_scalar(); - void compute_vector(); + ~ComputeGyration() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; private: double masstotal; diff --git a/src/compute_gyration_chunk.h b/src/compute_gyration_chunk.h index 1ac6fec341..ce990c9416 100644 --- a/src/compute_gyration_chunk.h +++ b/src/compute_gyration_chunk.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class ComputeGyrationChunk : public Compute { public: ComputeGyrationChunk(class LAMMPS *, int, char **); - ~ComputeGyrationChunk(); - void init(); - void compute_vector(); - void compute_array(); + ~ComputeGyrationChunk() override; + void init() override; + void compute_vector() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_heat_flux.h b/src/compute_heat_flux.h index d8466106e3..bdfc8252a3 100644 --- a/src/compute_heat_flux.h +++ b/src/compute_heat_flux.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeHeatFlux : public Compute { public: ComputeHeatFlux(class LAMMPS *, int, char **); - ~ComputeHeatFlux(); - void init(); - void compute_vector(); + ~ComputeHeatFlux() override; + void init() override; + void compute_vector() override; private: char *id_ke, *id_pe, *id_stress; diff --git a/src/compute_improper.h b/src/compute_improper.h index 4d7597bcd2..ddafc50e4e 100644 --- a/src/compute_improper.h +++ b/src/compute_improper.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class ComputeImproper : public Compute { public: ComputeImproper(class LAMMPS *, int, char **); - ~ComputeImproper(); - void init(); - void compute_vector(); + ~ComputeImproper() override; + void init() override; + void compute_vector() override; private: int nsub; diff --git a/src/compute_improper_local.h b/src/compute_improper_local.h index 7fe64d12c3..ff27dde4e9 100644 --- a/src/compute_improper_local.h +++ b/src/compute_improper_local.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeImproperLocal : public Compute { public: ComputeImproperLocal(class LAMMPS *, int, char **); - ~ComputeImproperLocal(); - void init(); - void compute_local(); - double memory_usage(); + ~ComputeImproperLocal() override; + void init() override; + void compute_local() override; + double memory_usage() override; private: int nvalues, cflag; diff --git a/src/compute_inertia_chunk.h b/src/compute_inertia_chunk.h index 8f8a1c522d..87e6bedb78 100644 --- a/src/compute_inertia_chunk.h +++ b/src/compute_inertia_chunk.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class ComputeInertiaChunk : public Compute { public: ComputeInertiaChunk(class LAMMPS *, int, char **); - ~ComputeInertiaChunk(); - void init(); - void compute_array(); + ~ComputeInertiaChunk() override; + void init() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_ke.h b/src/compute_ke.h index f9043e2a84..b84ffde1ef 100644 --- a/src/compute_ke.h +++ b/src/compute_ke.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class ComputeKE : public Compute { public: ComputeKE(class LAMMPS *, int, char **); - void init(); - double compute_scalar(); + void init() override; + double compute_scalar() override; private: double pfactor; diff --git a/src/compute_ke_atom.h b/src/compute_ke_atom.h index e676dec920..8b773f7f24 100644 --- a/src/compute_ke_atom.h +++ b/src/compute_ke_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeKEAtom : public Compute { public: ComputeKEAtom(class LAMMPS *, int, char **); - ~ComputeKEAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeKEAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/compute_msd.h b/src/compute_msd.h index 9649559756..33338b86d4 100644 --- a/src/compute_msd.h +++ b/src/compute_msd.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeMSD : public Compute { public: ComputeMSD(class LAMMPS *, int, char **); - virtual ~ComputeMSD(); - void init(); - virtual void compute_vector(); - void set_arrays(int); + ~ComputeMSD() override; + void init() override; + void compute_vector() override; + void set_arrays(int) override; protected: int comflag; // comflag = 1 if reference moves with center of mass diff --git a/src/compute_msd_chunk.h b/src/compute_msd_chunk.h index 3dbf994909..18fd91b6d5 100644 --- a/src/compute_msd_chunk.h +++ b/src/compute_msd_chunk.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class ComputeMSDChunk : public Compute { public: ComputeMSDChunk(class LAMMPS *, int, char **); - ~ComputeMSDChunk(); - void init(); - void setup(); - void compute_array(); + ~ComputeMSDChunk() override; + void init() override; + void setup() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk; diff --git a/src/compute_omega_chunk.h b/src/compute_omega_chunk.h index f1fc87f0ed..b058796067 100644 --- a/src/compute_omega_chunk.h +++ b/src/compute_omega_chunk.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class ComputeOmegaChunk : public Compute { public: ComputeOmegaChunk(class LAMMPS *, int, char **); - ~ComputeOmegaChunk(); - void init(); - void compute_array(); + ~ComputeOmegaChunk() override; + void init() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_orientorder_atom.h b/src/compute_orientorder_atom.h index 3394feb4ab..b88b01fbc9 100644 --- a/src/compute_orientorder_atom.h +++ b/src/compute_orientorder_atom.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeOrientOrderAtom : public Compute { public: ComputeOrientOrderAtom(class LAMMPS *, int, char **); - ~ComputeOrientOrderAtom(); - virtual void init(); - void init_list(int, class NeighList *); - virtual void compute_peratom(); - double memory_usage(); + ~ComputeOrientOrderAtom() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_peratom() override; + double memory_usage() override; double cutsq; int iqlcomp, qlcomp, qlcompflag, wlflag, wlhatflag; int *qlist; diff --git a/src/compute_pair.h b/src/compute_pair.h index c2de4b7bc4..5918f89111 100644 --- a/src/compute_pair.h +++ b/src/compute_pair.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputePair : public Compute { public: ComputePair(class LAMMPS *, int, char **); - ~ComputePair(); - void init(); - double compute_scalar(); - void compute_vector(); + ~ComputePair() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; private: int evalue, npair, nsub; diff --git a/src/compute_pair_local.h b/src/compute_pair_local.h index 8a3f5860fd..1d356c71a2 100644 --- a/src/compute_pair_local.h +++ b/src/compute_pair_local.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputePairLocal : public Compute { public: ComputePairLocal(class LAMMPS *, int, char **); - ~ComputePairLocal(); - void init(); - void init_list(int, class NeighList *); - void compute_local(); - double memory_usage(); + ~ComputePairLocal() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_local() override; + double memory_usage() override; private: int nvalues, ncount, cutstyle; diff --git a/src/compute_pe.h b/src/compute_pe.h index 7dbced863d..31e4747850 100644 --- a/src/compute_pe.h +++ b/src/compute_pe.h @@ -27,9 +27,8 @@ namespace LAMMPS_NS { class ComputePE : public Compute { public: ComputePE(class LAMMPS *, int, char **); - ~ComputePE() {} - void init() {} - double compute_scalar(); + void init() override {} + double compute_scalar() override; private: int pairflag, bondflag, angleflag, dihedralflag, improperflag, kspaceflag, fixflag; diff --git a/src/compute_pe_atom.h b/src/compute_pe_atom.h index 57015550ac..b89be3e853 100644 --- a/src/compute_pe_atom.h +++ b/src/compute_pe_atom.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputePEAtom : public Compute { public: ComputePEAtom(class LAMMPS *, int, char **); - ~ComputePEAtom(); - void init() {} - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputePEAtom() override; + void init() override {} + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int pairflag, bondflag, angleflag, dihedralflag, improperflag; diff --git a/src/compute_pressure.h b/src/compute_pressure.h index f0dcda7330..ebffd3a4fc 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputePressure : public Compute { public: ComputePressure(class LAMMPS *, int, char **); - virtual ~ComputePressure(); - virtual void init(); - virtual double compute_scalar(); - virtual void compute_vector(); - void reset_extra_compute_fix(const char *); + ~ComputePressure() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; + void reset_extra_compute_fix(const char *) override; protected: double boltz, nktv2p, inv_volume; diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h index 5a7fe787bd..903fece488 100644 --- a/src/compute_property_atom.h +++ b/src/compute_property_atom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputePropertyAtom : public Compute { public: ComputePropertyAtom(class LAMMPS *, int, char **); - ~ComputePropertyAtom(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputePropertyAtom() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nvalues; diff --git a/src/compute_property_chunk.h b/src/compute_property_chunk.h index 2f882f1930..83db5d6256 100644 --- a/src/compute_property_chunk.h +++ b/src/compute_property_chunk.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class ComputePropertyChunk : public Compute { public: ComputePropertyChunk(class LAMMPS *, int, char **); - ~ComputePropertyChunk(); - void init(); - void compute_vector(); - void compute_array(); + ~ComputePropertyChunk() override; + void init() override; + void compute_vector() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_property_local.h b/src/compute_property_local.h index 419c31eeb2..eec8e8ce94 100644 --- a/src/compute_property_local.h +++ b/src/compute_property_local.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputePropertyLocal : public Compute { public: ComputePropertyLocal(class LAMMPS *, int, char **); - ~ComputePropertyLocal(); - void init(); - void init_list(int, class NeighList *); - void compute_local(); - double memory_usage(); + ~ComputePropertyLocal() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_local() override; + double memory_usage() override; private: int nvalues, kindflag, cutstyle; diff --git a/src/compute_rdf.h b/src/compute_rdf.h index 4a0de6522f..77dd0cc0c7 100644 --- a/src/compute_rdf.h +++ b/src/compute_rdf.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeRDF : public Compute { public: ComputeRDF(class LAMMPS *, int, char **); - ~ComputeRDF(); - void init(); - void init_list(int, class NeighList *); - void compute_array(); + ~ComputeRDF() override; + void init() override; + void init_list(int, class NeighList *) override; + void compute_array() override; private: int nbin; // # of rdf bins diff --git a/src/compute_reduce.h b/src/compute_reduce.h index 24745a456a..ac2b1e60a2 100644 --- a/src/compute_reduce.h +++ b/src/compute_reduce.h @@ -30,11 +30,11 @@ class ComputeReduce : public Compute { enum { PERATOM, LOCAL }; ComputeReduce(class LAMMPS *, int, char **); - virtual ~ComputeReduce(); - void init(); - double compute_scalar(); - void compute_vector(); - double memory_usage(); + ~ComputeReduce() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; + double memory_usage() override; protected: int me; diff --git a/src/compute_reduce_chunk.h b/src/compute_reduce_chunk.h index 350db72df7..b595558bc7 100644 --- a/src/compute_reduce_chunk.h +++ b/src/compute_reduce_chunk.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class ComputeReduceChunk : public Compute { public: ComputeReduceChunk(class LAMMPS *, int, char **); - ~ComputeReduceChunk(); - void init(); - void compute_vector(); - void compute_array(); + ~ComputeReduceChunk() override; + void init() override; + void compute_vector() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int mode, nvalues; diff --git a/src/compute_reduce_region.h b/src/compute_reduce_region.h index 08d7e9a55f..04dd8b82e8 100644 --- a/src/compute_reduce_region.h +++ b/src/compute_reduce_region.h @@ -27,11 +27,10 @@ namespace LAMMPS_NS { class ComputeReduceRegion : public ComputeReduce { public: ComputeReduceRegion(class LAMMPS *, int, char **); - ~ComputeReduceRegion() {} private: - double compute_one(int, int); - bigint count(int); + double compute_one(int, int) override; + bigint count(int) override; }; } // namespace LAMMPS_NS diff --git a/src/compute_slice.h b/src/compute_slice.h index cd70516f11..742f5a9b10 100644 --- a/src/compute_slice.h +++ b/src/compute_slice.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeSlice : public Compute { public: ComputeSlice(class LAMMPS *, int, char **); - virtual ~ComputeSlice(); - void init(); - void compute_vector(); - void compute_array(); + ~ComputeSlice() override; + void init() override; + void compute_vector() override; + void compute_array() override; private: int me; diff --git a/src/compute_stress_atom.h b/src/compute_stress_atom.h index 4d126df0b4..4f636ed9bd 100644 --- a/src/compute_stress_atom.h +++ b/src/compute_stress_atom.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeStressAtom : public Compute { public: ComputeStressAtom(class LAMMPS *, int, char **); - ~ComputeStressAtom(); - void init(); - void compute_peratom(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + ~ComputeStressAtom() override; + void init() override; + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; diff --git a/src/compute_temp.h b/src/compute_temp.h index efc7ff2ab0..674144be83 100644 --- a/src/compute_temp.h +++ b/src/compute_temp.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class ComputeTemp : public Compute { public: ComputeTemp(class LAMMPS *, int, char **); - virtual ~ComputeTemp(); - void init() {} - void setup(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputeTemp() override; + void init() override {} + void setup() override; + double compute_scalar() override; + void compute_vector() override; protected: double tfactor; diff --git a/src/compute_temp_chunk.h b/src/compute_temp_chunk.h index 7a84cad902..b283de9dbc 100644 --- a/src/compute_temp_chunk.h +++ b/src/compute_temp_chunk.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class ComputeTempChunk : public Compute { public: ComputeTempChunk(class LAMMPS *, int, char **); - ~ComputeTempChunk(); - void init(); - double compute_scalar(); - void compute_vector(); - void compute_array(); + ~ComputeTempChunk() override; + void init() override; + double compute_scalar() override; + void compute_vector() override; + void compute_array() override; - void remove_bias(int, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); + void remove_bias(int, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk, comflag, biasflag; diff --git a/src/compute_temp_com.h b/src/compute_temp_com.h index 3887bcdbd2..595c50502d 100644 --- a/src/compute_temp_com.h +++ b/src/compute_temp_com.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class ComputeTempCOM : public Compute { public: ComputeTempCOM(class LAMMPS *, int, char **); - ~ComputeTempCOM(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempCOM() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); - void restore_bias_thr(int, double *, double *); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; + void restore_bias_thr(int, double *, double *) override; private: double tfactor, masstotal; diff --git a/src/compute_temp_deform.h b/src/compute_temp_deform.h index 572d09d041..a120108669 100644 --- a/src/compute_temp_deform.h +++ b/src/compute_temp_deform.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class ComputeTempDeform : public Compute { public: ComputeTempDeform(class LAMMPS *, int, char **); - virtual ~ComputeTempDeform(); - void init(); - void setup(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputeTempDeform() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_thr(int, double *, double *); - void restore_bias_all(); - double memory_usage(); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_thr(int, double *, double *) override; + void restore_bias_all() override; + double memory_usage() override; protected: double tfactor; diff --git a/src/compute_temp_partial.h b/src/compute_temp_partial.h index 8021e8cc57..55c7ceb5e8 100644 --- a/src/compute_temp_partial.h +++ b/src/compute_temp_partial.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class ComputeTempPartial : public Compute { public: ComputeTempPartial(class LAMMPS *, int, char **); - virtual ~ComputeTempPartial(); - void init() {} - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempPartial() override; + void init() override {} + void setup() override; + double compute_scalar() override; + void compute_vector() override; - int dof_remove(int); - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void reapply_bias_all(); - void restore_bias(int, double *); - void restore_bias_thr(int, double *, double *); - void restore_bias_all(); - double memory_usage(); + int dof_remove(int) override; + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void reapply_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_thr(int, double *, double *) override; + void restore_bias_all() override; + double memory_usage() override; protected: int xflag, yflag, zflag; diff --git a/src/compute_temp_profile.h b/src/compute_temp_profile.h index 9cad1f26ec..f9f2e42156 100644 --- a/src/compute_temp_profile.h +++ b/src/compute_temp_profile.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class ComputeTempProfile : public Compute { public: ComputeTempProfile(class LAMMPS *, int, char **); - ~ComputeTempProfile(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); - void compute_array(); + ~ComputeTempProfile() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; + void compute_array() override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_thr(int, double *, double *); - void restore_bias_all(); - double memory_usage(); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_thr(int, double *, double *) override; + void restore_bias_all() override; + double memory_usage() override; private: int xflag, yflag, zflag, ncount, outflag; diff --git a/src/compute_temp_ramp.h b/src/compute_temp_ramp.h index 55fc989c3c..e2d790fff1 100644 --- a/src/compute_temp_ramp.h +++ b/src/compute_temp_ramp.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class ComputeTempRamp : public Compute { public: ComputeTempRamp(class LAMMPS *, int, char **); - ~ComputeTempRamp(); - void init() {} - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempRamp() override; + void init() override {} + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_all(); - void remove_bias_thr(int, double *, double *); - void restore_bias(int, double *); - void restore_bias_thr(int, double *, double *); - void restore_bias_all(); - double memory_usage(); + void remove_bias(int, double *) override; + void remove_bias_all() override; + void remove_bias_thr(int, double *, double *) override; + void restore_bias(int, double *) override; + void restore_bias_thr(int, double *, double *) override; + void restore_bias_all() override; + double memory_usage() override; private: int coord_dim; diff --git a/src/compute_temp_region.h b/src/compute_temp_region.h index ba730f91ab..8129f01023 100644 --- a/src/compute_temp_region.h +++ b/src/compute_temp_region.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class ComputeTempRegion : public Compute { public: ComputeTempRegion(class LAMMPS *, int, char **); - virtual ~ComputeTempRegion(); - void init(); - void setup(); - virtual double compute_scalar(); - virtual void compute_vector(); + ~ComputeTempRegion() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void dof_remove_pre(); - int dof_remove(int); + void dof_remove_pre() override; + int dof_remove(int) override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void remove_bias_all(); - void restore_bias(int, double *); - void restore_bias_all(); - void restore_bias_thr(int, double *, double *); - double memory_usage(); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void remove_bias_all() override; + void restore_bias(int, double *) override; + void restore_bias_all() override; + void restore_bias_thr(int, double *, double *) override; + double memory_usage() override; protected: int iregion; diff --git a/src/compute_temp_sphere.h b/src/compute_temp_sphere.h index 0e0ae0bc59..7b91a890a2 100644 --- a/src/compute_temp_sphere.h +++ b/src/compute_temp_sphere.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class ComputeTempSphere : public Compute { public: ComputeTempSphere(class LAMMPS *, int, char **); - ~ComputeTempSphere(); - void init(); - void setup(); - double compute_scalar(); - void compute_vector(); + ~ComputeTempSphere() override; + void init() override; + void setup() override; + double compute_scalar() override; + void compute_vector() override; - void remove_bias(int, double *); - void remove_bias_thr(int, double *, double *); - void restore_bias(int, double *); - void restore_bias_thr(int, double *, double *); + void remove_bias(int, double *) override; + void remove_bias_thr(int, double *, double *) override; + void restore_bias(int, double *) override; + void restore_bias_thr(int, double *, double *) override; private: int mode; diff --git a/src/compute_torque_chunk.h b/src/compute_torque_chunk.h index 928af35236..a1fce2d0d4 100644 --- a/src/compute_torque_chunk.h +++ b/src/compute_torque_chunk.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class ComputeTorqueChunk : public Compute { public: ComputeTorqueChunk(class LAMMPS *, int, char **); - ~ComputeTorqueChunk(); - void init(); - void compute_array(); + ~ComputeTorqueChunk() override; + void init() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; diff --git a/src/compute_vacf.h b/src/compute_vacf.h index bb318a2b1a..7bc93dbaaa 100644 --- a/src/compute_vacf.h +++ b/src/compute_vacf.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class ComputeVACF : public Compute { public: ComputeVACF(class LAMMPS *, int, char **); - ~ComputeVACF(); - void init(); - virtual void compute_vector(); - void set_arrays(int); + ~ComputeVACF() override; + void init() override; + void compute_vector() override; + void set_arrays(int) override; protected: bigint nvacf; diff --git a/src/compute_vcm_chunk.h b/src/compute_vcm_chunk.h index 3f25a73585..42ae0de7ef 100644 --- a/src/compute_vcm_chunk.h +++ b/src/compute_vcm_chunk.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class ComputeVCMChunk : public Compute { public: ComputeVCMChunk(class LAMMPS *, int, char **); - ~ComputeVCMChunk(); - void init(); - void setup(); - void compute_array(); + ~ComputeVCMChunk() override; + void init() override; + void setup() override; + void compute_array() override; - void lock_enable(); - void lock_disable(); - int lock_length(); - void lock(class Fix *, bigint, bigint); - void unlock(class Fix *); + void lock_enable() override; + void lock_disable() override; + int lock_length() override; + void lock(class Fix *, bigint, bigint) override; + void unlock(class Fix *) override; - double memory_usage(); + double memory_usage() override; private: int nchunk, maxchunk; From ff3f7624995278a331579f10e4b38428b87fcb98 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 21 Jan 2022 14:45:53 -0500 Subject: [PATCH 076/174] Apply override to Fix classes --- src/ASPHERE/fix_nh_asphere.h | 9 ++- src/ASPHERE/fix_nph_asphere.h | 1 - src/ASPHERE/fix_npt_asphere.h | 1 - src/ASPHERE/fix_nve_asphere.h | 6 +- src/ASPHERE/fix_nve_asphere_noforce.h | 4 +- src/ASPHERE/fix_nve_line.h | 9 ++- src/ASPHERE/fix_nve_tri.h | 9 ++- src/ASPHERE/fix_nvt_asphere.h | 1 - src/BOCS/fix_bocs.h | 38 +++++------ src/BODY/fix_nh_body.h | 9 ++- src/BODY/fix_nph_body.h | 1 - src/BODY/fix_npt_body.h | 1 - src/BODY/fix_nve_body.h | 6 +- src/BODY/fix_nvt_body.h | 1 - src/BODY/fix_wall_body_polygon.h | 12 ++-- src/BODY/fix_wall_body_polyhedron.h | 12 ++-- src/BROWNIAN/fix_brownian.h | 6 +- src/BROWNIAN/fix_brownian_asphere.h | 6 +- src/BROWNIAN/fix_brownian_base.h | 8 +-- src/BROWNIAN/fix_brownian_sphere.h | 6 +- src/BROWNIAN/fix_propel_self.h | 10 +-- src/CG-DNA/fix_nve_dot.h | 6 +- src/CG-DNA/fix_nve_dotc_langevin.h | 8 +-- src/COLLOID/fix_wall_colloid.h | 6 +- src/DIELECTRIC/fix_polarize_bem_gmres.h | 30 ++++----- src/DIELECTRIC/fix_polarize_bem_icc.h | 18 ++--- src/DIELECTRIC/fix_polarize_functional.h | 32 ++++----- src/DIFFRACTION/fix_saed_vtk.h | 12 ++-- src/DPD-MESO/fix_edpd_source.h | 7 +- src/DPD-MESO/fix_mvv_dpd.h | 11 ++-- src/DPD-MESO/fix_mvv_edpd.h | 11 ++-- src/DPD-MESO/fix_mvv_tdpd.h | 11 ++-- src/DPD-MESO/fix_tdpd_source.h | 7 +- src/DPD-REACT/fix_dpd_energy.h | 7 +- src/DPD-REACT/fix_eos_cv.h | 9 ++- src/DPD-REACT/fix_eos_table.h | 10 +-- src/DPD-REACT/fix_eos_table_rx.h | 20 +++--- src/DPD-REACT/fix_rx.h | 22 +++---- src/DPD-REACT/fix_shardlow.h | 22 +++---- src/DPD-SMOOTH/fix_meso_move.h | 38 +++++------ src/DPD-SMOOTH/fix_rigid_meso.h | 14 ++-- src/DRUDE/fix_drude.h | 22 +++---- src/DRUDE/fix_drude_transform.h | 16 ++--- src/DRUDE/fix_langevin_drude.h | 20 +++--- src/DRUDE/fix_tgnh_drude.h | 36 +++++----- src/DRUDE/fix_tgnpt_drude.h | 1 - src/DRUDE/fix_tgnvt_drude.h | 1 - src/EFF/fix_langevin_eff.h | 8 +-- src/EFF/fix_nh_eff.h | 7 +- src/EFF/fix_nph_eff.h | 1 - src/EFF/fix_npt_eff.h | 1 - src/EFF/fix_nve_eff.h | 14 ++-- src/EFF/fix_nvt_eff.h | 1 - src/EFF/fix_nvt_sllod_eff.h | 5 +- src/EFF/fix_temp_rescale_eff.h | 14 ++-- src/EXTRA-FIX/fix_addtorque.h | 20 +++--- src/EXTRA-FIX/fix_ave_correlate_long.h | 16 ++--- src/EXTRA-FIX/fix_controller.h | 12 ++-- src/EXTRA-FIX/fix_drag.h | 12 ++-- src/EXTRA-FIX/fix_electron_stopping.h | 12 ++-- src/EXTRA-FIX/fix_electron_stopping_fit.h | 14 ++-- src/EXTRA-FIX/fix_ffl.h | 28 ++++---- src/EXTRA-FIX/fix_filter_corotate.h | 38 +++++------ src/EXTRA-FIX/fix_flow_gauss.h | 14 ++-- src/EXTRA-FIX/fix_gld.h | 36 +++++----- src/EXTRA-FIX/fix_gle.h | 42 ++++++------ src/EXTRA-FIX/fix_momentum_chunk.h | 10 +-- src/EXTRA-FIX/fix_npt_cauchy.h | 40 +++++------ src/EXTRA-FIX/fix_numdiff.h | 18 ++--- src/EXTRA-FIX/fix_nvk.h | 16 ++--- src/EXTRA-FIX/fix_oneway.h | 8 +-- src/EXTRA-FIX/fix_pafi.h | 30 ++++----- src/EXTRA-FIX/fix_rhok.h | 19 +++--- src/EXTRA-FIX/fix_smd.h | 16 ++--- src/EXTRA-FIX/fix_spring_rg.h | 16 ++--- src/EXTRA-FIX/fix_temp_csld.h | 20 +++--- src/EXTRA-FIX/fix_temp_csvr.h | 20 +++--- src/EXTRA-FIX/fix_ti_spring.h | 40 +++++------ src/EXTRA-FIX/fix_tmd.h | 22 +++---- src/EXTRA-FIX/fix_ttm.h | 36 +++++----- src/EXTRA-FIX/fix_ttm_grid.h | 38 +++++------ src/EXTRA-FIX/fix_ttm_mod.h | 34 +++++----- src/EXTRA-FIX/fix_viscosity.h | 10 +-- src/EXTRA-FIX/fix_wall_ees.h | 6 +- src/EXTRA-FIX/fix_wall_reflect_stochastic.h | 4 +- src/EXTRA-FIX/fix_wall_region_ees.h | 20 +++--- src/FEP/fix_adapt_fep.h | 20 +++--- src/GPU/fix_gpu.h | 18 ++--- src/GPU/fix_nh_gpu.h | 20 +++--- src/GPU/fix_npt_gpu.h | 1 - src/GPU/fix_nve_asphere_gpu.h | 12 ++-- src/GPU/fix_nve_gpu.h | 12 ++-- src/GPU/fix_nvt_gpu.h | 1 - src/GRANULAR/fix_freeze.h | 12 ++-- src/GRANULAR/fix_pour.h | 14 ++-- src/GRANULAR/fix_wall_gran.h | 34 +++++----- src/GRANULAR/fix_wall_gran_region.h | 30 ++++----- src/INTEL/fix_nh_intel.h | 18 ++--- src/INTEL/fix_npt_intel.h | 1 - src/INTEL/fix_nve_asphere_intel.h | 12 ++-- src/INTEL/fix_nve_intel.h | 12 ++-- src/INTEL/fix_nvt_intel.h | 1 - src/INTEL/fix_nvt_sllod_intel.h | 5 +- src/KOKKOS/fix_deform_kokkos.h | 7 +- src/KOKKOS/fix_dpd_energy_kokkos.h | 6 +- src/KOKKOS/fix_enforce2d_kokkos.h | 4 +- src/KOKKOS/fix_eos_table_rx_kokkos.h | 18 ++--- src/KOKKOS/fix_freeze_kokkos.h | 2 +- src/KOKKOS/fix_gravity_kokkos.h | 4 +- src/KOKKOS/fix_momentum_kokkos.h | 2 +- src/KOKKOS/fix_neigh_history_kokkos.h | 20 +++--- src/KOKKOS/fix_nh_kokkos.h | 22 +++---- src/KOKKOS/fix_nph_kokkos.h | 1 - src/KOKKOS/fix_npt_kokkos.h | 1 - src/KOKKOS/fix_nve_kokkos.h | 8 +-- src/KOKKOS/fix_nve_sphere_kokkos.h | 8 +-- src/KOKKOS/fix_nvt_kokkos.h | 1 - src/KOKKOS/fix_nvt_sllod_kokkos.h | 6 +- src/KOKKOS/fix_property_atom_kokkos.h | 3 +- src/KOKKOS/fix_qeq_reaxff_kokkos.h | 34 +++++----- src/KOKKOS/fix_reaxff_bonds_kokkos.h | 5 +- src/KOKKOS/fix_reaxff_species_kokkos.h | 5 +- src/KOKKOS/fix_rx_kokkos.h | 20 +++--- src/KOKKOS/fix_setforce_kokkos.h | 6 +- src/KOKKOS/fix_shake_kokkos.h | 38 +++++------ src/KOKKOS/fix_wall_lj93_kokkos.h | 2 +- src/KOKKOS/fix_wall_reflect_kokkos.h | 2 +- src/KSPACE/fix_tune_kspace.h | 8 +-- src/LATTE/fix_latte.h | 30 ++++----- src/MACHDYN/fix_smd_adjust_dt.h | 18 ++--- src/MACHDYN/fix_smd_integrate_tlsph.h | 12 ++-- src/MACHDYN/fix_smd_integrate_ulsph.h | 11 ++-- .../fix_smd_move_triangulated_surface.h | 14 ++-- src/MACHDYN/fix_smd_setvel.h | 16 ++--- .../fix_smd_tlsph_reference_configuration.h | 33 +++++----- src/MACHDYN/fix_smd_wall_surface.h | 11 ++-- src/MANIFOLD/fix_manifoldforce.h | 14 ++-- src/MANIFOLD/fix_nve_manifold_rattle.h | 20 +++--- src/MANIFOLD/fix_nvt_manifold_rattle.h | 16 ++--- src/MANIFOLD/manifold.h | 2 +- src/MANYBODY/fix_qeq_comb.h | 20 +++--- src/MC/fix_atom_swap.h | 20 +++--- src/MC/fix_bond_break.h | 22 +++---- src/MC/fix_bond_create.h | 34 +++++----- src/MC/fix_bond_create_angle.h | 2 +- src/MC/fix_bond_swap.h | 16 ++--- src/MC/fix_charge_regulation.h | 16 ++--- src/MC/fix_gcmc.h | 16 ++--- src/MC/fix_mol_swap.h | 18 ++--- src/MC/fix_tfmc.h | 8 +-- src/MC/fix_widom.h | 16 ++--- src/MESSAGE/fix_client_md.h | 16 ++--- src/MISC/fix_accelerate_cos.h | 10 +-- src/MISC/fix_imd.h | 14 ++-- src/MISC/fix_ipi.h | 10 +-- src/MISC/fix_pair_tracker.h | 10 +-- src/MISC/fix_srp.h | 42 ++++++------ src/MOLECULE/fix_cmap.h | 66 +++++++++---------- src/OPENMP/fix_gravity_omp.h | 4 +- src/OPENMP/fix_neigh_history_omp.h | 8 +-- src/OPENMP/fix_nh_asphere_omp.h | 10 +-- src/OPENMP/fix_nh_omp.h | 11 ++-- src/OPENMP/fix_nh_sphere_omp.h | 8 +-- src/OPENMP/fix_nph_asphere_omp.h | 1 - src/OPENMP/fix_nph_omp.h | 1 - src/OPENMP/fix_nph_sphere_omp.h | 1 - src/OPENMP/fix_npt_asphere_omp.h | 1 - src/OPENMP/fix_npt_omp.h | 1 - src/OPENMP/fix_npt_sphere_omp.h | 1 - src/OPENMP/fix_nve_omp.h | 6 +- src/OPENMP/fix_nve_sphere_omp.h | 4 +- src/OPENMP/fix_nvt_asphere_omp.h | 1 - src/OPENMP/fix_nvt_omp.h | 1 - src/OPENMP/fix_nvt_sllod_omp.h | 5 +- src/OPENMP/fix_nvt_sphere_omp.h | 1 - src/OPENMP/fix_omp.h | 22 +++---- src/OPENMP/fix_peri_neigh_omp.h | 2 +- src/OPENMP/fix_qeq_comb_omp.h | 4 +- src/OPENMP/fix_qeq_reaxff_omp.h | 28 ++++---- src/OPENMP/fix_rigid_nh_omp.h | 5 +- src/OPENMP/fix_rigid_nph_omp.h | 1 - src/OPENMP/fix_rigid_npt_omp.h | 1 - src/OPENMP/fix_rigid_nve_omp.h | 1 - src/OPENMP/fix_rigid_nvt_omp.h | 1 - src/OPENMP/fix_rigid_omp.h | 5 +- src/OPENMP/fix_rigid_small_omp.h | 5 +- src/ORIENT/fix_orient_bcc.h | 22 +++---- src/ORIENT/fix_orient_eco.h | 22 +++---- src/ORIENT/fix_orient_fcc.h | 22 +++---- src/PERI/fix_peri_neigh.h | 38 +++++------ src/PHONON/fix_phonon.h | 16 ++--- src/QEQ/fix_qeq.h | 38 +++++------ src/QEQ/fix_qeq_dynamic.h | 14 ++-- src/QEQ/fix_qeq_fire.h | 14 ++-- src/QEQ/fix_qeq_point.h | 6 +- src/QEQ/fix_qeq_shielded.h | 6 +- src/QEQ/fix_qeq_slater.h | 8 +-- src/QTB/fix_qbmsst.h | 32 ++++----- src/QTB/fix_qtb.h | 24 +++---- src/REACTION/fix_bond_react.h | 30 ++++----- src/REAXFF/fix_acks2_reaxff.h | 52 +++++++-------- src/REAXFF/fix_qeq_reaxff.h | 40 +++++------ src/REAXFF/fix_reaxff.h | 18 ++--- src/REAXFF/fix_reaxff_bonds.h | 12 ++-- src/REAXFF/fix_reaxff_species.h | 20 +++--- src/REPLICA/fix_event.h | 18 ++--- src/REPLICA/fix_event_hyper.h | 5 +- src/REPLICA/fix_event_prd.h | 5 +- src/REPLICA/fix_event_tad.h | 5 +- src/REPLICA/fix_grem.h | 16 ++--- src/REPLICA/fix_hyper.h | 3 +- src/REPLICA/fix_hyper_global.h | 28 ++++---- src/REPLICA/fix_hyper_local.h | 40 +++++------ src/REPLICA/fix_neb.h | 10 +-- src/REPLICA/fix_pimd.h | 38 +++++------ src/RIGID/fix_ehex.h | 14 ++-- src/RIGID/fix_rattle.h | 32 ++++----- src/RIGID/fix_rigid.h | 56 ++++++++-------- src/RIGID/fix_rigid_nh.h | 22 +++---- src/RIGID/fix_rigid_nh_small.h | 22 +++---- src/RIGID/fix_rigid_nph.h | 1 - src/RIGID/fix_rigid_nph_small.h | 1 - src/RIGID/fix_rigid_npt.h | 1 - src/RIGID/fix_rigid_npt_small.h | 1 - src/RIGID/fix_rigid_nve.h | 1 - src/RIGID/fix_rigid_nve_small.h | 1 - src/RIGID/fix_rigid_nvt.h | 1 - src/RIGID/fix_rigid_nvt_small.h | 1 - src/RIGID/fix_rigid_small.h | 64 +++++++++--------- src/RIGID/fix_shake.h | 40 +++++------ src/SHOCK/fix_append_atoms.h | 12 ++-- src/SHOCK/fix_msst.h | 24 +++---- src/SHOCK/fix_nphug.h | 18 ++--- src/SHOCK/fix_wall_piston.h | 8 +-- src/SPH/fix_sph.h | 12 ++-- src/SPH/fix_sph_stationary.h | 10 +-- src/SPIN/fix_langevin_spin.h | 8 +-- src/SPIN/fix_neb_spin.h | 10 +-- src/SPIN/fix_nve_spin.h | 14 ++-- src/SPIN/fix_precession_spin.h | 18 ++--- src/SPIN/fix_setforce_spin.h | 4 +- src/SRD/fix_srd.h | 20 +++--- src/SRD/fix_wall_srd.h | 8 +-- src/UEF/fix_npt_uef.h | 1 - src/UEF/fix_nvt_uef.h | 1 - src/fix_adapt.h | 24 +++---- src/fix_addforce.h | 22 +++---- src/fix_ave_atom.h | 20 +++--- src/fix_ave_chunk.h | 14 ++-- src/fix_ave_correlate.h | 12 ++-- src/fix_ave_histo.h | 14 ++-- src/fix_ave_histo_weight.h | 4 +- src/fix_ave_time.h | 16 ++--- src/fix_aveforce.h | 18 ++--- src/fix_balance.h | 22 +++---- src/fix_box_relax.h | 28 ++++---- src/fix_deform.h | 16 ++--- src/fix_deposit.h | 16 ++--- src/fix_deprecated.h | 6 +- src/fix_dt_reset.h | 12 ++-- src/fix_dummy.h | 4 +- src/fix_efield.h | 22 +++---- src/fix_enforce2d.h | 16 ++--- src/fix_evaporate.h | 12 ++-- src/fix_external.h | 34 +++++----- src/fix_gravity.h | 16 ++--- src/fix_group.h | 14 ++-- src/fix_halt.h | 12 ++-- src/fix_heat.h | 12 ++-- src/fix_indent.h | 20 +++--- src/fix_langevin.h | 36 +++++----- src/fix_lineforce.h | 12 ++-- src/fix_momentum.h | 6 +- src/fix_move.h | 40 +++++------ src/fix_neigh_history.h | 46 ++++++------- src/fix_nh.h | 38 +++++------ src/fix_nh_sphere.h | 10 +-- src/fix_nph.h | 1 - src/fix_nph_sphere.h | 1 - src/fix_npt.h | 1 - src/fix_npt_sphere.h | 1 - src/fix_nve.h | 16 ++--- src/fix_nve_limit.h | 16 ++--- src/fix_nve_noforce.h | 10 +-- src/fix_nve_sphere.h | 8 +-- src/fix_nvt.h | 1 - src/fix_nvt_sllod.h | 6 +- src/fix_nvt_sphere.h | 1 - src/fix_planeforce.h | 12 ++-- src/fix_press_berendsen.h | 12 ++-- src/fix_print.h | 10 +-- src/fix_property_atom.h | 40 +++++------ src/fix_read_restart.h | 14 ++-- src/fix_recenter.h | 12 ++-- src/fix_respa.h | 16 ++--- src/fix_restrain.h | 20 +++--- src/fix_setforce.h | 20 +++--- src/fix_spring.h | 20 +++--- src/fix_spring_chunk.h | 22 +++---- src/fix_spring_self.h | 36 +++++----- src/fix_store.h | 26 ++++---- src/fix_store_force.h | 18 ++--- src/fix_store_state.h | 28 ++++---- src/fix_temp_berendsen.h | 20 +++--- src/fix_temp_rescale.h | 20 +++--- src/fix_thermal_conductivity.h | 10 +-- src/fix_vector.h | 14 ++-- src/fix_viscous.h | 16 ++--- src/fix_wall.h | 22 +++---- src/fix_wall_harmonic.h | 4 +- src/fix_wall_lj1043.h | 4 +- src/fix_wall_lj126.h | 4 +- src/fix_wall_lj93.h | 4 +- src/fix_wall_morse.h | 4 +- src/fix_wall_reflect.h | 8 +-- src/fix_wall_region.h | 20 +++--- 316 files changed, 2246 insertions(+), 2314 deletions(-) diff --git a/src/ASPHERE/fix_nh_asphere.h b/src/ASPHERE/fix_nh_asphere.h index cc4020ecf5..89e9d7d96e 100644 --- a/src/ASPHERE/fix_nh_asphere.h +++ b/src/ASPHERE/fix_nh_asphere.h @@ -21,16 +21,15 @@ namespace LAMMPS_NS { class FixNHAsphere : public FixNH { public: FixNHAsphere(class LAMMPS *, int, char **); - virtual ~FixNHAsphere() {} - void init(); + void init() override; protected: double dtq; class AtomVecEllipsoid *avec; - void nve_v(); - void nve_x(); - void nh_v_temp(); + void nve_v() override; + void nve_x() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/ASPHERE/fix_nph_asphere.h b/src/ASPHERE/fix_nph_asphere.h index 5fed646f63..db1d085384 100644 --- a/src/ASPHERE/fix_nph_asphere.h +++ b/src/ASPHERE/fix_nph_asphere.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHAsphere : public FixNHAsphere { public: FixNPHAsphere(class LAMMPS *, int, char **); - ~FixNPHAsphere() {} }; } // namespace LAMMPS_NS diff --git a/src/ASPHERE/fix_npt_asphere.h b/src/ASPHERE/fix_npt_asphere.h index 43410b78da..c0b54a3d82 100644 --- a/src/ASPHERE/fix_npt_asphere.h +++ b/src/ASPHERE/fix_npt_asphere.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTAsphere : public FixNHAsphere { public: FixNPTAsphere(class LAMMPS *, int, char **); - ~FixNPTAsphere() {} }; } // namespace LAMMPS_NS diff --git a/src/ASPHERE/fix_nve_asphere.h b/src/ASPHERE/fix_nve_asphere.h index fa7547af4b..8adfbac010 100644 --- a/src/ASPHERE/fix_nve_asphere.h +++ b/src/ASPHERE/fix_nve_asphere.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixNVEAsphere : public FixNVE { public: FixNVEAsphere(class LAMMPS *, int, char **); - void init(); - void initial_integrate(int); - void final_integrate(); + void init() override; + void initial_integrate(int) override; + void final_integrate() override; private: double dtq; diff --git a/src/ASPHERE/fix_nve_asphere_noforce.h b/src/ASPHERE/fix_nve_asphere_noforce.h index 90b84a79d6..0467d443c0 100644 --- a/src/ASPHERE/fix_nve_asphere_noforce.h +++ b/src/ASPHERE/fix_nve_asphere_noforce.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixNVEAsphereNoforce : public FixNVENoforce { public: FixNVEAsphereNoforce(class LAMMPS *, int, char **); - void initial_integrate(int); - void init(); + void initial_integrate(int) override; + void init() override; private: double dtq; diff --git a/src/ASPHERE/fix_nve_line.h b/src/ASPHERE/fix_nve_line.h index c706072a18..d5076dea51 100644 --- a/src/ASPHERE/fix_nve_line.h +++ b/src/ASPHERE/fix_nve_line.h @@ -27,11 +27,10 @@ namespace LAMMPS_NS { class FixNVELine : public FixNVE { public: FixNVELine(class LAMMPS *, int, char **); - ~FixNVELine() {} - int setmask(); - void init(); - void initial_integrate(int); - void final_integrate(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; private: double MINUSPI, TWOPI; diff --git a/src/ASPHERE/fix_nve_tri.h b/src/ASPHERE/fix_nve_tri.h index 1fc11c5d7e..daba41b538 100644 --- a/src/ASPHERE/fix_nve_tri.h +++ b/src/ASPHERE/fix_nve_tri.h @@ -27,11 +27,10 @@ namespace LAMMPS_NS { class FixNVETri : public FixNVE { public: FixNVETri(class LAMMPS *, int, char **); - ~FixNVETri() {} - int setmask(); - void init(); - void initial_integrate(int); - void final_integrate(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; private: double dtq; diff --git a/src/ASPHERE/fix_nvt_asphere.h b/src/ASPHERE/fix_nvt_asphere.h index 24b070ba78..cd6c3f8d63 100644 --- a/src/ASPHERE/fix_nvt_asphere.h +++ b/src/ASPHERE/fix_nvt_asphere.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTAsphere : public FixNHAsphere { public: FixNVTAsphere(class LAMMPS *, int, char **); - ~FixNVTAsphere() {} }; } // namespace LAMMPS_NS diff --git a/src/BOCS/fix_bocs.h b/src/BOCS/fix_bocs.h index 69b32d4cd0..ee5c70e432 100644 --- a/src/BOCS/fix_bocs.h +++ b/src/BOCS/fix_bocs.h @@ -30,26 +30,26 @@ namespace LAMMPS_NS { class FixBocs : public Fix { public: FixBocs(class LAMMPS *, int, char **); // MRD NJD - virtual ~FixBocs(); // MRD NJD - int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void pre_force_respa(int, int, int); - void final_integrate_respa(int, int); - virtual void pre_exchange(); - double compute_scalar(); - virtual double compute_vector(int); - void write_restart(FILE *); + ~FixBocs() override; // MRD NJD + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void pre_force_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void pre_exchange() override; + double compute_scalar() override; + double compute_vector(int) override; + void write_restart(FILE *) override; virtual int pack_restart_data(double *); // pack restart data - virtual void restart(char *); - int modify_param(int, char **); - void reset_target(double); - void reset_dt(); - virtual void *extract(const char *, int &); - double memory_usage(); + void restart(char *) override; + int modify_param(int, char **) override; + void reset_target(double) override; + void reset_dt() override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int dimension, which; diff --git a/src/BODY/fix_nh_body.h b/src/BODY/fix_nh_body.h index f5fb545e05..899a12c3d6 100644 --- a/src/BODY/fix_nh_body.h +++ b/src/BODY/fix_nh_body.h @@ -21,16 +21,15 @@ namespace LAMMPS_NS { class FixNHBody : public FixNH { public: FixNHBody(class LAMMPS *, int, char **); - virtual ~FixNHBody() {} - void init(); + void init() override; protected: double dtq; class AtomVecBody *avec; - void nve_v(); - void nve_x(); - void nh_v_temp(); + void nve_v() override; + void nve_x() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/BODY/fix_nph_body.h b/src/BODY/fix_nph_body.h index da59bd93e2..38247e93cb 100644 --- a/src/BODY/fix_nph_body.h +++ b/src/BODY/fix_nph_body.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHBody : public FixNHBody { public: FixNPHBody(class LAMMPS *, int, char **); - ~FixNPHBody() {} }; } // namespace LAMMPS_NS diff --git a/src/BODY/fix_npt_body.h b/src/BODY/fix_npt_body.h index e5d6b44da6..5fe0c45994 100644 --- a/src/BODY/fix_npt_body.h +++ b/src/BODY/fix_npt_body.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTBody : public FixNHBody { public: FixNPTBody(class LAMMPS *, int, char **); - ~FixNPTBody() {} }; } // namespace LAMMPS_NS diff --git a/src/BODY/fix_nve_body.h b/src/BODY/fix_nve_body.h index 504a86e0d0..c0ea6d8f7d 100644 --- a/src/BODY/fix_nve_body.h +++ b/src/BODY/fix_nve_body.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixNVEBody : public FixNVE { public: FixNVEBody(class LAMMPS *, int, char **); - void init(); - void initial_integrate(int); - void final_integrate(); + void init() override; + void initial_integrate(int) override; + void final_integrate() override; private: double dtq; diff --git a/src/BODY/fix_nvt_body.h b/src/BODY/fix_nvt_body.h index e5fef9d30d..19a75dfd2a 100644 --- a/src/BODY/fix_nvt_body.h +++ b/src/BODY/fix_nvt_body.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTBody : public FixNHBody { public: FixNVTBody(class LAMMPS *, int, char **); - ~FixNVTBody() {} }; } // namespace LAMMPS_NS diff --git a/src/BODY/fix_wall_body_polygon.h b/src/BODY/fix_wall_body_polygon.h index 7da2655c9c..caf57b45bf 100644 --- a/src/BODY/fix_wall_body_polygon.h +++ b/src/BODY/fix_wall_body_polygon.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixWallBodyPolygon : public Fix { public: FixWallBodyPolygon(class LAMMPS *, int, char **); - virtual ~FixWallBodyPolygon(); - int setmask(); - void init(); - void setup(int); - virtual void post_force(int); - void reset_dt(); + ~FixWallBodyPolygon() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void reset_dt() override; struct Contact { int ibody, jbody; // body (i.e. atom) indices (not tags) diff --git a/src/BODY/fix_wall_body_polyhedron.h b/src/BODY/fix_wall_body_polyhedron.h index 54c290b255..c931f963d2 100644 --- a/src/BODY/fix_wall_body_polyhedron.h +++ b/src/BODY/fix_wall_body_polyhedron.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixWallBodyPolyhedron : public Fix { public: FixWallBodyPolyhedron(class LAMMPS *, int, char **); - virtual ~FixWallBodyPolyhedron(); - int setmask(); - void init(); - void setup(int); - virtual void post_force(int); - void reset_dt(); + ~FixWallBodyPolyhedron() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void reset_dt() override; struct Contact { int ibody, jbody; // body (i.e. atom) indices (not tags) diff --git a/src/BROWNIAN/fix_brownian.h b/src/BROWNIAN/fix_brownian.h index 5847c1e8dc..f9f4ab9cd1 100644 --- a/src/BROWNIAN/fix_brownian.h +++ b/src/BROWNIAN/fix_brownian.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixBrownian : public FixBrownianBase { public: FixBrownian(class LAMMPS *, int, char **); - virtual ~FixBrownian(){}; - void init(); - void initial_integrate(int); + + void init() override; + void initial_integrate(int) override; private: template void initial_integrate_templated(); diff --git a/src/BROWNIAN/fix_brownian_asphere.h b/src/BROWNIAN/fix_brownian_asphere.h index b40f797dd3..f20b80a5be 100644 --- a/src/BROWNIAN/fix_brownian_asphere.h +++ b/src/BROWNIAN/fix_brownian_asphere.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixBrownianAsphere : public FixBrownianBase { public: FixBrownianAsphere(class LAMMPS *, int, char **); - virtual ~FixBrownianAsphere(){}; - void initial_integrate(int); - void init(); + + void initial_integrate(int) override; + void init() override; protected: class AtomVecEllipsoid *avec; diff --git a/src/BROWNIAN/fix_brownian_base.h b/src/BROWNIAN/fix_brownian_base.h index c13fc71a84..f26fc301b0 100644 --- a/src/BROWNIAN/fix_brownian_base.h +++ b/src/BROWNIAN/fix_brownian_base.h @@ -21,10 +21,10 @@ namespace LAMMPS_NS { class FixBrownianBase : public Fix { public: FixBrownianBase(class LAMMPS *, int, char **); - virtual ~FixBrownianBase(); - void init(); - int setmask(); - void reset_dt(); + ~FixBrownianBase() override; + void init() override; + int setmask() override; + void reset_dt() override; protected: int seed; // RNG seed diff --git a/src/BROWNIAN/fix_brownian_sphere.h b/src/BROWNIAN/fix_brownian_sphere.h index 73befb07f5..8f2e2de568 100644 --- a/src/BROWNIAN/fix_brownian_sphere.h +++ b/src/BROWNIAN/fix_brownian_sphere.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixBrownianSphere : public FixBrownianBase { public: FixBrownianSphere(class LAMMPS *, int, char **); - virtual ~FixBrownianSphere(){}; - void init(); - void initial_integrate(int); + + void init() override; + void initial_integrate(int) override; private: template void initial_integrate_templated(); diff --git a/src/BROWNIAN/fix_propel_self.h b/src/BROWNIAN/fix_propel_self.h index 7932e8af99..0b8ee4f4b1 100644 --- a/src/BROWNIAN/fix_propel_self.h +++ b/src/BROWNIAN/fix_propel_self.h @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class FixPropelSelf : public Fix { public: FixPropelSelf(class LAMMPS *, int, char **); - virtual ~FixPropelSelf(){}; - void init(); - void post_force(int); - void setup(int); - int setmask(); + + void init() override; + void post_force(int) override; + void setup(int) override; + int setmask() override; private: double magnitude; diff --git a/src/CG-DNA/fix_nve_dot.h b/src/CG-DNA/fix_nve_dot.h index 1f02536f51..baebaece22 100644 --- a/src/CG-DNA/fix_nve_dot.h +++ b/src/CG-DNA/fix_nve_dot.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixNVEDot : public FixNVE { public: FixNVEDot(class LAMMPS *, int, char **); - void init(); - void initial_integrate(int); - void final_integrate(); + void init() override; + void initial_integrate(int) override; + void final_integrate() override; private: double dt, dthlf, dthlfm; diff --git a/src/CG-DNA/fix_nve_dotc_langevin.h b/src/CG-DNA/fix_nve_dotc_langevin.h index 018db64c13..9353ae75b9 100644 --- a/src/CG-DNA/fix_nve_dotc_langevin.h +++ b/src/CG-DNA/fix_nve_dotc_langevin.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixNVEDotcLangevin : public FixNVE { public: FixNVEDotcLangevin(class LAMMPS *, int, char **); - virtual ~FixNVEDotcLangevin(); - void init(); - void initial_integrate(int); - void final_integrate(); + ~FixNVEDotcLangevin() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; private: double dt, dthlf, dthlfm, dtqrt; diff --git a/src/COLLOID/fix_wall_colloid.h b/src/COLLOID/fix_wall_colloid.h index 4c287052c0..4ccec8afb4 100644 --- a/src/COLLOID/fix_wall_colloid.h +++ b/src/COLLOID/fix_wall_colloid.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixWallColloid : public FixWall { public: FixWallColloid(class LAMMPS *, int, char **); - void init(); - void precompute(int); - void wall_particle(int, int, double); + void init() override; + void precompute(int) override; + void wall_particle(int, int, double) override; private: double coeff1[6], coeff2[6], coeff3[6], coeff4[6]; diff --git a/src/DIELECTRIC/fix_polarize_bem_gmres.h b/src/DIELECTRIC/fix_polarize_bem_gmres.h index 7671ddf1c2..421fe8afb9 100644 --- a/src/DIELECTRIC/fix_polarize_bem_gmres.h +++ b/src/DIELECTRIC/fix_polarize_bem_gmres.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class FixPolarizeBEMGMRES : public Fix { public: FixPolarizeBEMGMRES(class LAMMPS *, int, char **); - ~FixPolarizeBEMGMRES(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void pre_force(int); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - virtual double compute_vector(int); + ~FixPolarizeBEMGMRES() override; + int setmask() override; + void init() override; + void setup(int) override; + void pre_force(int) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + double compute_vector(int) override; - int modify_param(int, char **); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); + int modify_param(int, char **) override; + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; virtual void allocate(); virtual void deallocate(); diff --git a/src/DIELECTRIC/fix_polarize_bem_icc.h b/src/DIELECTRIC/fix_polarize_bem_icc.h index df04b52fdf..e7af6edd08 100644 --- a/src/DIELECTRIC/fix_polarize_bem_icc.h +++ b/src/DIELECTRIC/fix_polarize_bem_icc.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixPolarizeBEMICC : public Fix { public: FixPolarizeBEMICC(class LAMMPS *, int, char **); - ~FixPolarizeBEMICC() = default; - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void pre_force(int); - virtual double compute_vector(int); - int modify_param(int, char **); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + + int setmask() override; + void init() override; + void setup(int) override; + void pre_force(int) override; + double compute_vector(int) override; + int modify_param(int, char **) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; virtual void compute_induced_charges(); void set_dielectric_params(double, double, double, double, int, double); diff --git a/src/DIELECTRIC/fix_polarize_functional.h b/src/DIELECTRIC/fix_polarize_functional.h index 7a4b8c00da..010e958542 100644 --- a/src/DIELECTRIC/fix_polarize_functional.h +++ b/src/DIELECTRIC/fix_polarize_functional.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class FixPolarizeFunctional : public Fix { public: FixPolarizeFunctional(class LAMMPS *, int, char **); - ~FixPolarizeFunctional(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void setup_pre_force(int vflag); - void pre_force(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~FixPolarizeFunctional() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void setup_pre_force(int vflag) override; + void pre_force(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; - int modify_param(int, char **); - double memory_usage(); + int modify_param(int, char **) override; + double memory_usage() override; void allocate(); void deallocate(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; protected: int nmax; diff --git a/src/DIFFRACTION/fix_saed_vtk.h b/src/DIFFRACTION/fix_saed_vtk.h index a5691ea986..24be1d939c 100644 --- a/src/DIFFRACTION/fix_saed_vtk.h +++ b/src/DIFFRACTION/fix_saed_vtk.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixSAEDVTK : public Fix { public: FixSAEDVTK(class LAMMPS *, int, char **); - ~FixSAEDVTK(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - double compute_vector(int); + ~FixSAEDVTK() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_vector(int) override; void reset_timestep(bigint); private: diff --git a/src/DPD-MESO/fix_edpd_source.h b/src/DPD-MESO/fix_edpd_source.h index 13eecc7c56..73c0e13c56 100644 --- a/src/DPD-MESO/fix_edpd_source.h +++ b/src/DPD-MESO/fix_edpd_source.h @@ -27,10 +27,9 @@ namespace LAMMPS_NS { class FixEDPDSource : public Fix { public: FixEDPDSource(class LAMMPS *, int, char **); - ~FixEDPDSource() = default; - int setmask(); - void init(); - void post_force(int); + int setmask() override; + void init() override; + void post_force(int) override; protected: int option; diff --git a/src/DPD-MESO/fix_mvv_dpd.h b/src/DPD-MESO/fix_mvv_dpd.h index c8d1626a42..e6cf370de6 100644 --- a/src/DPD-MESO/fix_mvv_dpd.h +++ b/src/DPD-MESO/fix_mvv_dpd.h @@ -27,12 +27,11 @@ namespace LAMMPS_NS { class FixMvvDPD : public Fix { public: FixMvvDPD(class LAMMPS *, int, char **); - virtual ~FixMvvDPD() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/DPD-MESO/fix_mvv_edpd.h b/src/DPD-MESO/fix_mvv_edpd.h index 06fc373ca5..00b52e02b8 100644 --- a/src/DPD-MESO/fix_mvv_edpd.h +++ b/src/DPD-MESO/fix_mvv_edpd.h @@ -27,12 +27,11 @@ namespace LAMMPS_NS { class FixMvvEDPD : public Fix { public: FixMvvEDPD(class LAMMPS *, int, char **); - virtual ~FixMvvEDPD() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/DPD-MESO/fix_mvv_tdpd.h b/src/DPD-MESO/fix_mvv_tdpd.h index e30b285f6f..4cdd66b01e 100644 --- a/src/DPD-MESO/fix_mvv_tdpd.h +++ b/src/DPD-MESO/fix_mvv_tdpd.h @@ -27,12 +27,11 @@ namespace LAMMPS_NS { class FixMvvTDPD : public Fix { public: FixMvvTDPD(class LAMMPS *, int, char **); - virtual ~FixMvvTDPD() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/DPD-MESO/fix_tdpd_source.h b/src/DPD-MESO/fix_tdpd_source.h index 8bd9778ed0..f20bed4f74 100644 --- a/src/DPD-MESO/fix_tdpd_source.h +++ b/src/DPD-MESO/fix_tdpd_source.h @@ -27,10 +27,9 @@ namespace LAMMPS_NS { class FixTDPDSource : public Fix { public: FixTDPDSource(class LAMMPS *, int, char **); - ~FixTDPDSource() = default; - int setmask(); - void init(); - void post_force(int); + int setmask() override; + void init() override; + void post_force(int) override; protected: int option; diff --git a/src/DPD-REACT/fix_dpd_energy.h b/src/DPD-REACT/fix_dpd_energy.h index 7a463f64a0..3787b770cd 100644 --- a/src/DPD-REACT/fix_dpd_energy.h +++ b/src/DPD-REACT/fix_dpd_energy.h @@ -27,10 +27,9 @@ namespace LAMMPS_NS { class FixDPDenergy : public Fix { public: FixDPDenergy(class LAMMPS *, int, char **); - virtual ~FixDPDenergy() {} - int setmask(); - virtual void initial_integrate(int); - virtual void final_integrate(); + int setmask() override; + void initial_integrate(int) override; + void final_integrate() override; protected: class PairDPDfdtEnergy *pairDPDE; diff --git a/src/DPD-REACT/fix_eos_cv.h b/src/DPD-REACT/fix_eos_cv.h index 129984b390..b6b663029b 100644 --- a/src/DPD-REACT/fix_eos_cv.h +++ b/src/DPD-REACT/fix_eos_cv.h @@ -27,11 +27,10 @@ namespace LAMMPS_NS { class FixEOScv : public Fix { public: FixEOScv(class LAMMPS *, int, char **); - virtual ~FixEOScv() {} - int setmask(); - virtual void init(); - virtual void post_integrate(); - virtual void end_of_step(); + int setmask() override; + void init() override; + void post_integrate() override; + void end_of_step() override; protected: double cvEOS; diff --git a/src/DPD-REACT/fix_eos_table.h b/src/DPD-REACT/fix_eos_table.h index 4aad90402a..8d6a8c03db 100644 --- a/src/DPD-REACT/fix_eos_table.h +++ b/src/DPD-REACT/fix_eos_table.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixEOStable : public Fix { public: FixEOStable(class LAMMPS *, int, char **); - virtual ~FixEOStable(); - int setmask(); - virtual void init(); - virtual void post_integrate(); - virtual void end_of_step(); + ~FixEOStable() override; + int setmask() override; + void init() override; + void post_integrate() override; + void end_of_step() override; void energy_lookup(double, double &); void temperature_lookup(double, double &); diff --git a/src/DPD-REACT/fix_eos_table_rx.h b/src/DPD-REACT/fix_eos_table_rx.h index a2c4d7860e..3724923276 100644 --- a/src/DPD-REACT/fix_eos_table_rx.h +++ b/src/DPD-REACT/fix_eos_table_rx.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixEOStableRX : public Fix { public: FixEOStableRX(class LAMMPS *, int, char **); - virtual ~FixEOStableRX(); - int setmask(); - void setup(int); - virtual void init(); - virtual void post_integrate(); - virtual void end_of_step(); + ~FixEOStableRX() override; + int setmask() override; + void setup(int) override; + void init() override; + void post_integrate() override; + void end_of_step() override; void energy_lookup(int, double, double &); void temperature_lookup(int, double, double &); @@ -69,10 +69,10 @@ class FixEOStableRX : public Fix { double *dHf, *energyCorr, *tempCorrCoeff, *moleculeCorrCoeff; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; int *eosSpecies; int ncolumn; diff --git a/src/DPD-REACT/fix_rx.h b/src/DPD-REACT/fix_rx.h index bd3122e81d..d82eaa8419 100644 --- a/src/DPD-REACT/fix_rx.h +++ b/src/DPD-REACT/fix_rx.h @@ -30,19 +30,19 @@ enum { ODE_LAMMPS_RK4, ODE_LAMMPS_RKF45 }; class FixRX : public Fix { public: FixRX(class LAMMPS *, int, char **); - ~FixRX(); - int setmask(); - void post_constructor(); - virtual void init(); - void init_list(int, class NeighList *); - virtual void setup_pre_force(int); - virtual void pre_force(int); + ~FixRX() override; + int setmask() override; + void post_constructor() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup_pre_force(int) override; + void pre_force(int) override; protected: - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; class NeighList *list; diff --git a/src/DPD-REACT/fix_shardlow.h b/src/DPD-REACT/fix_shardlow.h index c95b90d964..a5481aea92 100644 --- a/src/DPD-REACT/fix_shardlow.h +++ b/src/DPD-REACT/fix_shardlow.h @@ -30,14 +30,14 @@ class FixShardlow : public Fix { class NeighList *list; // The SSA specific neighbor list FixShardlow(class LAMMPS *, int, char **); - ~FixShardlow(); - int setmask(); - virtual void init(); - virtual void init_list(int, class NeighList *); - virtual void setup(int); - virtual void initial_integrate(int); + ~FixShardlow() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void initial_integrate(int) override; - double memory_usage(); + double memory_usage() override; #ifdef DEBUG_SSA_PAIR_CT int counters[2][3]; @@ -45,10 +45,10 @@ class FixShardlow : public Fix { #endif protected: - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; class PairDPDfdt *pairDPD; class PairDPDfdtEnergy *pairDPDE; diff --git a/src/DPD-SMOOTH/fix_meso_move.h b/src/DPD-SMOOTH/fix_meso_move.h index 5a649128e5..5b05741fe5 100644 --- a/src/DPD-SMOOTH/fix_meso_move.h +++ b/src/DPD-SMOOTH/fix_meso_move.h @@ -27,27 +27,27 @@ namespace LAMMPS_NS { class FixMesoMove : public Fix { public: FixMesoMove(class LAMMPS *, int, char **); - ~FixMesoMove(); - int setmask(); - void init(); - void setup_pre_force(int); - void initial_integrate(int); - void final_integrate(); + ~FixMesoMove() override; + int setmask() override; + void init() override; + void setup_pre_force(int) override; + void initial_integrate(int) override; + void final_integrate() override; - double memory_usage(); - void write_restart(FILE *); - void restart(char *); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int maxsize_restart(); - int size_restart(int); + double memory_usage() override; + void write_restart(FILE *) override; + void restart(char *) override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int maxsize_restart() override; + int size_restart(int) override; - void reset_dt(); + void reset_dt() override; private: char *xvarstr, *yvarstr, *zvarstr, *vxvarstr, *vyvarstr, *vzvarstr; diff --git a/src/DPD-SMOOTH/fix_rigid_meso.h b/src/DPD-SMOOTH/fix_rigid_meso.h index 02f6ca74da..3f44a81f03 100644 --- a/src/DPD-SMOOTH/fix_rigid_meso.h +++ b/src/DPD-SMOOTH/fix_rigid_meso.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixRigidMeso : public FixRigid { public: FixRigidMeso(class LAMMPS *, int, char **); - ~FixRigidMeso(); - int setmask(); - void setup(int); - void initial_integrate(int); - void final_integrate(); - double compute_scalar() { return 0.0; } - double compute_array(int, int); + ~FixRigidMeso() override; + int setmask() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + double compute_scalar() override { return 0.0; } + double compute_array(int, int) override; protected: void set_xv(); diff --git a/src/DRUDE/fix_drude.h b/src/DRUDE/fix_drude.h index b563de485d..fcec09a419 100644 --- a/src/DRUDE/fix_drude.h +++ b/src/DRUDE/fix_drude.h @@ -36,17 +36,17 @@ class FixDrude : public Fix { bool is_reduced; FixDrude(class LAMMPS *, int, char **); - virtual ~FixDrude(); - int setmask(); - void init(); + ~FixDrude() override; + int setmask() override; + void init() override; - void grow_arrays(int nmax); - void copy_arrays(int i, int j, int delflag); - void set_arrays(int i); - int pack_exchange(int i, double *buf); - int unpack_exchange(int nlocal, double *buf); - int pack_border(int n, int *list, double *buf); - int unpack_border(int n, int first, double *buf); + void grow_arrays(int nmax) override; + void copy_arrays(int i, int j, int delflag) override; + void set_arrays(int i) override; + int pack_exchange(int i, double *buf) override; + int unpack_exchange(int nlocal, double *buf) override; + int pack_border(int n, int *list, double *buf) override; + int unpack_border(int n, int first, double *buf) override; private: int rebuildflag; @@ -55,7 +55,7 @@ class FixDrude : public Fix { void build_drudeid(); static void ring_search_drudeid(int size, char *cbuf, void *ptr); static void ring_build_partner(int size, char *cbuf, void *ptr); - void rebuild_special(); + void rebuild_special() override; static void ring_remove_drude(int size, char *cbuf, void *ptr); static void ring_add_drude(int size, char *cbuf, void *ptr); static void ring_copy_drude(int size, char *cbuf, void *ptr); diff --git a/src/DRUDE/fix_drude_transform.h b/src/DRUDE/fix_drude_transform.h index 495ec8b175..cfe159c236 100644 --- a/src/DRUDE/fix_drude_transform.h +++ b/src/DRUDE/fix_drude_transform.h @@ -28,16 +28,16 @@ namespace LAMMPS_NS { template class FixDrudeTransform: public Fix { public: FixDrudeTransform(class LAMMPS *, int, char **); - ~FixDrudeTransform(); - int setmask(); - void init(); - void setup(int vflag); + ~FixDrudeTransform() override; + int setmask() override; + void init() override; + void setup(int vflag) override; void reduced_to_real(); void real_to_reduced(); - void initial_integrate(int vflag); - void final_integrate(); - int pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc); - void unpack_forward_comm(int n, int first, double *buf); + void initial_integrate(int vflag) override; + void final_integrate() override; + int pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) override; + void unpack_forward_comm(int n, int first, double *buf) override; protected: double *mcoeff; diff --git a/src/DRUDE/fix_langevin_drude.h b/src/DRUDE/fix_langevin_drude.h index 939de2db48..38bc417929 100644 --- a/src/DRUDE/fix_langevin_drude.h +++ b/src/DRUDE/fix_langevin_drude.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixLangevinDrude : public Fix { public: FixLangevinDrude(class LAMMPS *, int, char **); - virtual ~FixLangevinDrude(); - int setmask(); - void init(); - void setup(int vflag); - virtual void post_force(int vflag); - void reset_target(double); - virtual void *extract(const char *, int &); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int modify_param(int, char **); + ~FixLangevinDrude() override; + int setmask() override; + void init() override; + void setup(int vflag) override; + void post_force(int vflag) override; + void reset_target(double) override; + void *extract(const char *, int &) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int modify_param(int, char **) override; protected: double t_start_core, t_period_core, t_target_core; diff --git a/src/DRUDE/fix_tgnh_drude.h b/src/DRUDE/fix_tgnh_drude.h index 598a407ff4..c486c301f7 100644 --- a/src/DRUDE/fix_tgnh_drude.h +++ b/src/DRUDE/fix_tgnh_drude.h @@ -21,25 +21,25 @@ namespace LAMMPS_NS { class FixTGNHDrude : public Fix { public: FixTGNHDrude(class LAMMPS *, int, char **); - virtual ~FixTGNHDrude(); - int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - void pre_force_respa(int, int, int); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); - virtual void pre_exchange(); - double compute_scalar(); - virtual double compute_vector(int); - void write_restart(FILE *); + ~FixTGNHDrude() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void pre_force_respa(int, int, int) override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void pre_exchange() override; + double compute_scalar() override; + double compute_vector(int) override; + void write_restart(FILE *) override; virtual int pack_restart_data(double *); // pack restart data - virtual void restart(char *); - int modify_param(int, char **); - void reset_target(double); - void reset_dt(); - double memory_usage(); + void restart(char *) override; + int modify_param(int, char **) override; + void reset_target(double) override; + void reset_dt() override; + double memory_usage() override; protected: int dimension, which; diff --git a/src/DRUDE/fix_tgnpt_drude.h b/src/DRUDE/fix_tgnpt_drude.h index 1fe30705eb..c777cc1134 100644 --- a/src/DRUDE/fix_tgnpt_drude.h +++ b/src/DRUDE/fix_tgnpt_drude.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixTGNPTDrude : public FixTGNHDrude { public: FixTGNPTDrude(class LAMMPS *, int, char **); - ~FixTGNPTDrude() {} }; } // namespace LAMMPS_NS diff --git a/src/DRUDE/fix_tgnvt_drude.h b/src/DRUDE/fix_tgnvt_drude.h index 9c06df66a8..d192b2353c 100644 --- a/src/DRUDE/fix_tgnvt_drude.h +++ b/src/DRUDE/fix_tgnvt_drude.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixTGNVTDrude : public FixTGNHDrude { public: FixTGNVTDrude(class LAMMPS *, int, char **); - ~FixTGNVTDrude() {} }; } // namespace LAMMPS_NS diff --git a/src/EFF/fix_langevin_eff.h b/src/EFF/fix_langevin_eff.h index 3176fdf9c1..c7681fc4cf 100644 --- a/src/EFF/fix_langevin_eff.h +++ b/src/EFF/fix_langevin_eff.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixLangevinEff : public FixLangevin { public: FixLangevinEff(class LAMMPS *, int, char **); - ~FixLangevinEff(); - void end_of_step(); - double compute_scalar(); - void post_force(int); + ~FixLangevinEff() override; + void end_of_step() override; + double compute_scalar() override; + void post_force(int) override; private: double *erforcelangevin; diff --git a/src/EFF/fix_nh_eff.h b/src/EFF/fix_nh_eff.h index 32a96efd96..9860f81ba2 100644 --- a/src/EFF/fix_nh_eff.h +++ b/src/EFF/fix_nh_eff.h @@ -21,12 +21,11 @@ namespace LAMMPS_NS { class FixNHEff : public FixNH { public: FixNHEff(class LAMMPS *, int, char **); - virtual ~FixNHEff() {} protected: - void nve_v(); - void nve_x(); - virtual void nh_v_temp(); + void nve_v() override; + void nve_x() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/EFF/fix_nph_eff.h b/src/EFF/fix_nph_eff.h index 7fdbe38d5a..45e8c02ea5 100644 --- a/src/EFF/fix_nph_eff.h +++ b/src/EFF/fix_nph_eff.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHEff : public FixNHEff { public: FixNPHEff(class LAMMPS *, int, char **); - ~FixNPHEff() {} }; } // namespace LAMMPS_NS diff --git a/src/EFF/fix_npt_eff.h b/src/EFF/fix_npt_eff.h index 060b24b38a..107130685d 100644 --- a/src/EFF/fix_npt_eff.h +++ b/src/EFF/fix_npt_eff.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTEff : public FixNHEff { public: FixNPTEff(class LAMMPS *, int, char **); - ~FixNPTEff() {} }; } // namespace LAMMPS_NS diff --git a/src/EFF/fix_nve_eff.h b/src/EFF/fix_nve_eff.h index cab149ee36..b4fea154af 100644 --- a/src/EFF/fix_nve_eff.h +++ b/src/EFF/fix_nve_eff.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixNVEEff : public Fix { public: FixNVEEff(class LAMMPS *, int, char **); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); - void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/EFF/fix_nvt_eff.h b/src/EFF/fix_nvt_eff.h index 96e4cab6eb..602ff97eee 100644 --- a/src/EFF/fix_nvt_eff.h +++ b/src/EFF/fix_nvt_eff.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTEff : public FixNHEff { public: FixNVTEff(class LAMMPS *, int, char **); - ~FixNVTEff() {} }; } // namespace LAMMPS_NS diff --git a/src/EFF/fix_nvt_sllod_eff.h b/src/EFF/fix_nvt_sllod_eff.h index 8ac3357627..f014f9c956 100644 --- a/src/EFF/fix_nvt_sllod_eff.h +++ b/src/EFF/fix_nvt_sllod_eff.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class FixNVTSllodEff : public FixNHEff { public: FixNVTSllodEff(class LAMMPS *, int, char **); - ~FixNVTSllodEff() {} - void init(); + void init() override; private: int nondeformbias; - void nh_v_temp(); + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/EFF/fix_temp_rescale_eff.h b/src/EFF/fix_temp_rescale_eff.h index d4e29d1c8c..bbcc3396aa 100644 --- a/src/EFF/fix_temp_rescale_eff.h +++ b/src/EFF/fix_temp_rescale_eff.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixTempRescaleEff : public Fix { public: FixTempRescaleEff(class LAMMPS *, int, char **); - virtual ~FixTempRescaleEff(); - int setmask(); - void init(); - virtual void end_of_step(); - int modify_param(int, char **); - void reset_target(double); - double compute_scalar(); + ~FixTempRescaleEff() override; + int setmask() override; + void init() override; + void end_of_step() override; + int modify_param(int, char **) override; + void reset_target(double) override; + double compute_scalar() override; protected: int which; diff --git a/src/EXTRA-FIX/fix_addtorque.h b/src/EXTRA-FIX/fix_addtorque.h index 74f6fa2495..827e47ab80 100644 --- a/src/EXTRA-FIX/fix_addtorque.h +++ b/src/EXTRA-FIX/fix_addtorque.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixAddTorque : public Fix { public: FixAddTorque(class LAMMPS *, int, char **); - ~FixAddTorque(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixAddTorque() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; private: double xvalue, yvalue, zvalue; diff --git a/src/EXTRA-FIX/fix_ave_correlate_long.h b/src/EXTRA-FIX/fix_ave_correlate_long.h index a31ae78217..6c0ca63a39 100644 --- a/src/EXTRA-FIX/fix_ave_correlate_long.h +++ b/src/EXTRA-FIX/fix_ave_correlate_long.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixAveCorrelateLong : public Fix { public: FixAveCorrelateLong(class LAMMPS *, int, char **); - ~FixAveCorrelateLong(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); + ~FixAveCorrelateLong() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; - void write_restart(FILE *); - void restart(char *); - double memory_usage(); + void write_restart(FILE *) override; + void restart(char *) override; + double memory_usage() override; double *t; // Time steps for result arrays double **f; // Result arrays diff --git a/src/EXTRA-FIX/fix_controller.h b/src/EXTRA-FIX/fix_controller.h index b5678690bd..f8f7c826b3 100644 --- a/src/EXTRA-FIX/fix_controller.h +++ b/src/EXTRA-FIX/fix_controller.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixController : public Fix { public: FixController(class LAMMPS *, int, char **); - ~FixController(); - int setmask(); - void init(); - void end_of_step(); - void reset_dt(); - double compute_vector(int); + ~FixController() override; + int setmask() override; + void init() override; + void end_of_step() override; + void reset_dt() override; + double compute_vector(int) override; private: double kp, ki, kd, alpha, tau; diff --git a/src/EXTRA-FIX/fix_drag.h b/src/EXTRA-FIX/fix_drag.h index b5e978f590..9c2739cfe9 100644 --- a/src/EXTRA-FIX/fix_drag.h +++ b/src/EXTRA-FIX/fix_drag.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixDrag : public Fix { public: FixDrag(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_vector(int); + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_vector(int) override; private: double xc, yc, zc; diff --git a/src/EXTRA-FIX/fix_electron_stopping.h b/src/EXTRA-FIX/fix_electron_stopping.h index f978164b67..015d444996 100644 --- a/src/EXTRA-FIX/fix_electron_stopping.h +++ b/src/EXTRA-FIX/fix_electron_stopping.h @@ -32,12 +32,12 @@ namespace LAMMPS_NS { class FixElectronStopping : public Fix { public: FixElectronStopping(class LAMMPS *, int, char **); - ~FixElectronStopping(); - int setmask(); - void init(); - void post_force(int); - void init_list(int, class NeighList *); - double compute_scalar(); + ~FixElectronStopping() override; + int setmask() override; + void init() override; + void post_force(int) override; + void init_list(int, class NeighList *) override; + double compute_scalar() override; private: void read_table(const char *); diff --git a/src/EXTRA-FIX/fix_electron_stopping_fit.h b/src/EXTRA-FIX/fix_electron_stopping_fit.h index 304ea79cfa..f6d5a279fd 100644 --- a/src/EXTRA-FIX/fix_electron_stopping_fit.h +++ b/src/EXTRA-FIX/fix_electron_stopping_fit.h @@ -32,13 +32,13 @@ namespace LAMMPS_NS { class FixElectronStoppingFit : public Fix { public: FixElectronStoppingFit(class LAMMPS *, int, char **); - ~FixElectronStoppingFit(); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); + ~FixElectronStoppingFit() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_scalar() override; private: double *energy_coh_in, *v_min_sq, *v_max_sq, *drag_fac_in_1, *drag_fac_in_2, *drag_fac_1, diff --git a/src/EXTRA-FIX/fix_ffl.h b/src/EXTRA-FIX/fix_ffl.h index 26e076cb8b..bd29254106 100644 --- a/src/EXTRA-FIX/fix_ffl.h +++ b/src/EXTRA-FIX/fix_ffl.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class FixFFL : public Fix { public: FixFFL(class LAMMPS *, int, char **); - virtual ~FixFFL(); - int setmask(); - void init(); - void setup(int); + ~FixFFL() override; + int setmask() override; + void init() override; + void setup(int) override; void ffl_integrate(); - void initial_integrate_respa(int vflag, int ilevel, int iloop); - void final_integrate_respa(int ilevel, int iloop); - void initial_integrate(int vflag); - void final_integrate(); - double compute_scalar(); - void reset_target(double); - virtual void reset_dt(); - double memory_usage(); - void grow_arrays(int); + void initial_integrate_respa(int vflag, int ilevel, int iloop) override; + void final_integrate_respa(int ilevel, int iloop) override; + void initial_integrate(int vflag) override; + void final_integrate() override; + double compute_scalar() override; + void reset_target(double) override; + void reset_dt() override; + double memory_usage() override; + void grow_arrays(int) override; - virtual void *extract(const char *, int &); + void *extract(const char *, int &) override; void init_ffl(); diff --git a/src/EXTRA-FIX/fix_filter_corotate.h b/src/EXTRA-FIX/fix_filter_corotate.h index d0af7bc2db..d7853aea88 100644 --- a/src/EXTRA-FIX/fix_filter_corotate.h +++ b/src/EXTRA-FIX/fix_filter_corotate.h @@ -32,31 +32,31 @@ namespace LAMMPS_NS { class FixFilterCorotate : public Fix { public: FixFilterCorotate(class LAMMPS *, int, char **); - ~FixFilterCorotate(); - void setup(int); - void setup_pre_neighbor(); - void pre_neighbor(); - void setup_pre_force_respa(int, int); + ~FixFilterCorotate() override; + void setup(int) override; + void setup_pre_neighbor() override; + void pre_neighbor() override; + void setup_pre_force_respa(int, int) override; // void setup_post_force_respa(int,int); - void pre_force_respa(int, int, int); - void post_force_respa(int, int, int); + void pre_force_respa(int, int, int) override; + void post_force_respa(int, int, int) override; - void init(); - int setmask(); + void init() override; + int setmask() override; - double compute_array(int, int); + double compute_array(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void grow_arrays(int); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + void grow_arrays(int) override; + double memory_usage() override; - void copy_arrays(int, int, int); - void set_arrays(int); - void update_arrays(int, int); + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + void update_arrays(int, int) override; - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; protected: int me, nprocs; diff --git a/src/EXTRA-FIX/fix_flow_gauss.h b/src/EXTRA-FIX/fix_flow_gauss.h index 9ca12b61cc..d8482a67b0 100644 --- a/src/EXTRA-FIX/fix_flow_gauss.h +++ b/src/EXTRA-FIX/fix_flow_gauss.h @@ -29,13 +29,13 @@ namespace LAMMPS_NS { class FixFlowGauss : public Fix { public: FixFlowGauss(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - double compute_vector(int n); + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_scalar() override; + double compute_vector(int n) override; protected: int dimension; diff --git a/src/EXTRA-FIX/fix_gld.h b/src/EXTRA-FIX/fix_gld.h index 1424e5c5f4..538106939c 100644 --- a/src/EXTRA-FIX/fix_gld.h +++ b/src/EXTRA-FIX/fix_gld.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class FixGLD : public Fix { public: FixGLD(class LAMMPS *, int, char **); - virtual ~FixGLD(); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - void reset_target(double); - virtual void reset_dt(); + ~FixGLD() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_target(double) override; + void reset_dt() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; void init_s_gld(); protected: diff --git a/src/EXTRA-FIX/fix_gle.h b/src/EXTRA-FIX/fix_gle.h index 17150ea2be..e29daf76e8 100644 --- a/src/EXTRA-FIX/fix_gle.h +++ b/src/EXTRA-FIX/fix_gle.h @@ -27,30 +27,30 @@ namespace LAMMPS_NS { class FixGLE : public Fix { public: FixGLE(class LAMMPS *, int, char **); - virtual ~FixGLE(); - int setmask(); - void init(); - void setup(int); + ~FixGLE() override; + int setmask() override; + void init() override; + void setup(int) override; void gle_integrate(); - void initial_integrate_respa(int vflag, int ilevel, int iloop); - void final_integrate_respa(int ilevel, int iloop); - void initial_integrate(int vflag); - void final_integrate(); - double compute_scalar(); - void reset_target(double); - virtual void reset_dt(); + void initial_integrate_respa(int vflag, int ilevel, int iloop) override; + void final_integrate_respa(int ilevel, int iloop) override; + void initial_integrate(int vflag) override; + void final_integrate() override; + double compute_scalar() override; + void reset_target(double) override; + void reset_dt() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; - virtual void *extract(const char *, int &); + void *extract(const char *, int &) override; void init_gle(); void init_gles(); diff --git a/src/EXTRA-FIX/fix_momentum_chunk.h b/src/EXTRA-FIX/fix_momentum_chunk.h index d290582187..b3641a204a 100644 --- a/src/EXTRA-FIX/fix_momentum_chunk.h +++ b/src/EXTRA-FIX/fix_momentum_chunk.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixMomentumChunk : public Fix { public: FixMomentumChunk(class LAMMPS *, int, char **); - virtual ~FixMomentumChunk(); - int setmask(); - void init(); - void end_of_step(); - void post_run(); + ~FixMomentumChunk() override; + int setmask() override; + void init() override; + void end_of_step() override; + void post_run() override; protected: std::string id_chunk, id_com, id_vcm, id_omega; diff --git a/src/EXTRA-FIX/fix_npt_cauchy.h b/src/EXTRA-FIX/fix_npt_cauchy.h index 80122ad0ac..8150e59f6f 100644 --- a/src/EXTRA-FIX/fix_npt_cauchy.h +++ b/src/EXTRA-FIX/fix_npt_cauchy.h @@ -27,27 +27,27 @@ namespace LAMMPS_NS { class FixNPTCauchy : public Fix { public: FixNPTCauchy(class LAMMPS *, int, char **); - virtual void post_constructor(); - virtual ~FixNPTCauchy(); - int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void pre_force_respa(int, int, int); - void final_integrate_respa(int, int); - virtual void pre_exchange(); - double compute_scalar(); - virtual double compute_vector(int); - void write_restart(FILE *); + void post_constructor() override; + ~FixNPTCauchy() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void pre_force_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void pre_exchange() override; + double compute_scalar() override; + double compute_vector(int) override; + void write_restart(FILE *) override; virtual int pack_restart_data(double *); // pack restart data - virtual void restart(char *); - int modify_param(int, char **); - void reset_target(double); - void reset_dt(); - virtual void *extract(const char *, int &); - double memory_usage(); + void restart(char *) override; + int modify_param(int, char **) override; + void reset_target(double) override; + void reset_dt() override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int dimension, which; diff --git a/src/EXTRA-FIX/fix_numdiff.h b/src/EXTRA-FIX/fix_numdiff.h index b6b97c21bd..1f5fecf421 100644 --- a/src/EXTRA-FIX/fix_numdiff.h +++ b/src/EXTRA-FIX/fix_numdiff.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixNumDiff : public Fix { public: FixNumDiff(class LAMMPS *, int, char **); - ~FixNumDiff(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double memory_usage(); + ~FixNumDiff() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double memory_usage() override; private: double delta; diff --git a/src/EXTRA-FIX/fix_nvk.h b/src/EXTRA-FIX/fix_nvk.h index 90162e2fc0..67b2cb6916 100644 --- a/src/EXTRA-FIX/fix_nvk.h +++ b/src/EXTRA-FIX/fix_nvk.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixNVK : public Fix { public: FixNVK(class LAMMPS *, int, char **); - virtual ~FixNVK() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - virtual void reset_dt(); + + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/EXTRA-FIX/fix_oneway.h b/src/EXTRA-FIX/fix_oneway.h index d3b2cf7b65..ad6a5dc106 100644 --- a/src/EXTRA-FIX/fix_oneway.h +++ b/src/EXTRA-FIX/fix_oneway.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixOneWay : public Fix { public: FixOneWay(class LAMMPS *, int, char **); - virtual ~FixOneWay(); - int setmask(); - virtual void init(); - virtual void end_of_step(); + ~FixOneWay() override; + int setmask() override; + void init() override; + void end_of_step() override; protected: int direction; diff --git a/src/EXTRA-FIX/fix_pafi.h b/src/EXTRA-FIX/fix_pafi.h index 32942bc1e1..7cf0bb9856 100644 --- a/src/EXTRA-FIX/fix_pafi.h +++ b/src/EXTRA-FIX/fix_pafi.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class FixPAFI : public Fix { public: FixPAFI(class LAMMPS *, int, char **); - virtual ~FixPAFI(); - int setmask(); - virtual void init(); + ~FixPAFI() override; + int setmask() override; + void init() override; - void setup(int); - void min_setup(int); - virtual void post_force(int); + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_vector(int); + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_vector(int) override; // nve - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - virtual void reset_dt(); + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; - double memory_usage(); + double memory_usage() override; protected: int varflag, icompute; diff --git a/src/EXTRA-FIX/fix_rhok.h b/src/EXTRA-FIX/fix_rhok.h index 1a69c7a24e..3ddabf1ebb 100644 --- a/src/EXTRA-FIX/fix_rhok.h +++ b/src/EXTRA-FIX/fix_rhok.h @@ -27,32 +27,31 @@ class FixRhok : public Fix { // Constructor: all the parameters to this fix specified in // the LAMMPS input get passed in FixRhok(LAMMPS *inLMP, int inArgc, char **inArgv); - virtual ~FixRhok(){}; // Methods that this fix implements // -------------------------------- // Tells LAMMPS where this fix should act - int setmask(); + int setmask() override; // Initializes the fix at the beginning of a run - void init(); + void init() override; // Initial application of the fix to a system (when doing MD / minimization) - void setup(int inVFlag); - void min_setup(int inVFlag); + void setup(int inVFlag) override; + void min_setup(int inVFlag) override; // Modify the forces calculated in the main force loop, either when // doing usual MD, RESPA MD or minimization - void post_force(int inVFlag); - void post_force_respa(int inVFlag, int inILevel, int inILoop); - void min_post_force(int inVFlag); + void post_force(int inVFlag) override; + void post_force_respa(int inVFlag, int inILevel, int inILoop) override; + void min_post_force(int inVFlag) override; // Compute the change in the potential energy induced by this fix - double compute_scalar(); + double compute_scalar() override; // Compute the ith component of the vector associated with this fix - double compute_vector(int inI); + double compute_vector(int inI) override; private: // RESPA boilerplate diff --git a/src/EXTRA-FIX/fix_smd.h b/src/EXTRA-FIX/fix_smd.h index d26ecd7600..cae1319dc1 100644 --- a/src/EXTRA-FIX/fix_smd.h +++ b/src/EXTRA-FIX/fix_smd.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixSMD : public Fix { public: FixSMD(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_vector(int); + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_vector(int) override; - void write_restart(FILE *); - void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; private: double xc, yc, zc, xn, yn, zn, r0; diff --git a/src/EXTRA-FIX/fix_spring_rg.h b/src/EXTRA-FIX/fix_spring_rg.h index 997580c4c2..d0cb93e25e 100644 --- a/src/EXTRA-FIX/fix_spring_rg.h +++ b/src/EXTRA-FIX/fix_spring_rg.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixSpringRG : public Fix { public: FixSpringRG(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void write_restart(FILE *); - void restart(char *); - double compute_scalar(); + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void write_restart(FILE *) override; + void restart(char *) override; + double compute_scalar() override; private: int ilevel_respa, rg0_flag; diff --git a/src/EXTRA-FIX/fix_temp_csld.h b/src/EXTRA-FIX/fix_temp_csld.h index 687e79079f..f6a2970389 100644 --- a/src/EXTRA-FIX/fix_temp_csld.h +++ b/src/EXTRA-FIX/fix_temp_csld.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixTempCSLD : public Fix { public: FixTempCSLD(class LAMMPS *, int, char **); - ~FixTempCSLD(); - int setmask(); - void init(); - void end_of_step(); - int modify_param(int, char **); - void reset_target(double); - virtual double compute_scalar(); - void write_restart(FILE *); - void restart(char *buf); - virtual void *extract(const char *, int &); + ~FixTempCSLD() override; + int setmask() override; + void init() override; + void end_of_step() override; + int modify_param(int, char **) override; + void reset_target(double) override; + double compute_scalar() override; + void write_restart(FILE *) override; + void restart(char *buf) override; + void *extract(const char *, int &) override; private: double t_start, t_stop, t_period, t_target; diff --git a/src/EXTRA-FIX/fix_temp_csvr.h b/src/EXTRA-FIX/fix_temp_csvr.h index ce6c785841..c1b4dbfd93 100644 --- a/src/EXTRA-FIX/fix_temp_csvr.h +++ b/src/EXTRA-FIX/fix_temp_csvr.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixTempCSVR : public Fix { public: FixTempCSVR(class LAMMPS *, int, char **); - ~FixTempCSVR(); - int setmask(); - void init(); - void end_of_step(); - int modify_param(int, char **); - void reset_target(double); - virtual double compute_scalar(); - void write_restart(FILE *); - void restart(char *buf); - virtual void *extract(const char *, int &); + ~FixTempCSVR() override; + int setmask() override; + void init() override; + void end_of_step() override; + int modify_param(int, char **) override; + void reset_target(double) override; + double compute_scalar() override; + void write_restart(FILE *) override; + void restart(char *buf) override; + void *extract(const char *, int &) override; private: double t_start, t_stop, t_period, t_target; diff --git a/src/EXTRA-FIX/fix_ti_spring.h b/src/EXTRA-FIX/fix_ti_spring.h index 0900a71dee..d2f02f8a3e 100644 --- a/src/EXTRA-FIX/fix_ti_spring.h +++ b/src/EXTRA-FIX/fix_ti_spring.h @@ -34,27 +34,27 @@ namespace LAMMPS_NS { class FixTISpring : public Fix { public: FixTISpring(class LAMMPS *, int, char **); - ~FixTISpring(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - void initial_integrate(int); - double compute_scalar(); - double compute_vector(int); + ~FixTISpring() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + void initial_integrate(int) override; + double compute_scalar() override; + double compute_vector(int) override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; private: double switch_func(double); // Switching function. diff --git a/src/EXTRA-FIX/fix_tmd.h b/src/EXTRA-FIX/fix_tmd.h index b85869930a..9ba8ad6096 100644 --- a/src/EXTRA-FIX/fix_tmd.h +++ b/src/EXTRA-FIX/fix_tmd.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class FixTMD : public Fix { public: FixTMD(class LAMMPS *, int, char **); - ~FixTMD(); - int setmask(); - void init(); - void initial_integrate(int); - void initial_integrate_respa(int, int, int); + ~FixTMD() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void initial_integrate_respa(int, int, int) override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - void reset_dt(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + void reset_dt() override; private: int me; diff --git a/src/EXTRA-FIX/fix_ttm.h b/src/EXTRA-FIX/fix_ttm.h index da782b1f5a..76f2e62ed4 100644 --- a/src/EXTRA-FIX/fix_ttm.h +++ b/src/EXTRA-FIX/fix_ttm.h @@ -28,26 +28,26 @@ namespace LAMMPS_NS { class FixTTM : public Fix { public: FixTTM(class LAMMPS *, int, char **); - virtual ~FixTTM(); - virtual void post_constructor(); - int setmask(); - virtual void init(); - void setup(int); + ~FixTTM() override; + void post_constructor() override; + int setmask() override; + void init() override; + void setup(int) override; void post_force_setup(int); - virtual void post_force(int); + void post_force(int) override; void post_force_respa_setup(int, int, int); - void post_force_respa(int, int, int); - virtual void end_of_step(); - void reset_dt(); - void grow_arrays(int); - virtual void write_restart(FILE *); - virtual void restart(char *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); - virtual double compute_vector(int); - virtual double memory_usage(); + void post_force_respa(int, int, int) override; + void end_of_step() override; + void reset_dt() override; + void grow_arrays(int) override; + void write_restart(FILE *) override; + void restart(char *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; + double compute_vector(int) override; + double memory_usage() override; protected: int nlevels_respa; diff --git a/src/EXTRA-FIX/fix_ttm_grid.h b/src/EXTRA-FIX/fix_ttm_grid.h index 46d5b67ec1..aeb1106e42 100644 --- a/src/EXTRA-FIX/fix_ttm_grid.h +++ b/src/EXTRA-FIX/fix_ttm_grid.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class FixTTMGrid : public FixTTM { public: FixTTMGrid(class LAMMPS *, int, char **); - ~FixTTMGrid(); - void post_constructor(); - void init(); - void post_force(int); - void end_of_step(); + ~FixTTMGrid() override; + void post_constructor() override; + void init() override; + void post_force(int) override; + void end_of_step() override; // grid communication - void pack_forward_grid(int, void *, int, int *); - void unpack_forward_grid(int, void *, int, int *); - void pack_reverse_grid(int, void *, int, int *); - void unpack_reverse_grid(int, void *, int, int *); - void pack_gather_grid(int, void *); - void unpack_gather_grid(int, void *, void *, int, int, int, int, int, int); + void pack_forward_grid(int, void *, int, int *) override; + void unpack_forward_grid(int, void *, int, int *) override; + void pack_reverse_grid(int, void *, int, int *) override; + void unpack_reverse_grid(int, void *, int, int *) override; + void pack_gather_grid(int, void *) override; + void unpack_gather_grid(int, void *, void *, int, int, int, int, int, int) override; - void write_restart(FILE *); - void restart(char *); - double compute_vector(int); - double memory_usage(); + void write_restart(FILE *) override; + void restart(char *) override; + double compute_vector(int) override; + double memory_usage() override; private: int ngridmine,ngridout; @@ -59,10 +59,10 @@ class FixTTMGrid : public FixTTM { int ngc_buf1,ngc_buf2; double *gc_buf1,*gc_buf2; - void allocate_grid(); - void deallocate_grid(); - void read_electron_temperatures(const std::string &); - void write_electron_temperatures(const std::string &); + void allocate_grid() override; + void deallocate_grid() override; + void read_electron_temperatures(const std::string &) override; + void write_electron_temperatures(const std::string &) override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-FIX/fix_ttm_mod.h b/src/EXTRA-FIX/fix_ttm_mod.h index 21eb0efcaa..74ff301ae9 100644 --- a/src/EXTRA-FIX/fix_ttm_mod.h +++ b/src/EXTRA-FIX/fix_ttm_mod.h @@ -33,25 +33,25 @@ struct el_heat_capacity_thermal_conductivity { class FixTTMMod : public Fix { public: FixTTMMod(class LAMMPS *, int, char **); - ~FixTTMMod(); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); + ~FixTTMMod() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; void post_force_setup(int); void post_force_respa_setup(int, int, int); - void end_of_step(); - void reset_dt(); - void write_restart(FILE *); - void restart(char *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); - double memory_usage(); - void grow_arrays(int); - double compute_vector(int); + void end_of_step() override; + void reset_dt() override; + void write_restart(FILE *) override; + void restart(char *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; + double memory_usage() override; + void grow_arrays(int) override; + double compute_vector(int) override; private: int nlevels_respa; diff --git a/src/EXTRA-FIX/fix_viscosity.h b/src/EXTRA-FIX/fix_viscosity.h index 559de6c362..e46dbafe84 100644 --- a/src/EXTRA-FIX/fix_viscosity.h +++ b/src/EXTRA-FIX/fix_viscosity.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixViscosity : public Fix { public: FixViscosity(class LAMMPS *, int, char **); - ~FixViscosity(); - int setmask(); - void init(); - void end_of_step(); - double compute_scalar(); + ~FixViscosity() override; + int setmask() override; + void init() override; + void end_of_step() override; + double compute_scalar() override; private: int me; diff --git a/src/EXTRA-FIX/fix_wall_ees.h b/src/EXTRA-FIX/fix_wall_ees.h index 5bfb821c43..af235af13b 100644 --- a/src/EXTRA-FIX/fix_wall_ees.h +++ b/src/EXTRA-FIX/fix_wall_ees.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixWallEES : public FixWall { public: FixWallEES(class LAMMPS *, int, char **); - void precompute(int); - void init(); - void wall_particle(int, int, double); + void precompute(int) override; + void init() override; + void wall_particle(int, int, double) override; private: double coeff1[6], coeff2[6], coeff3[6], coeff4[6], coeff5[6], coeff6[6]; diff --git a/src/EXTRA-FIX/fix_wall_reflect_stochastic.h b/src/EXTRA-FIX/fix_wall_reflect_stochastic.h index b895a569f0..e1794376cf 100644 --- a/src/EXTRA-FIX/fix_wall_reflect_stochastic.h +++ b/src/EXTRA-FIX/fix_wall_reflect_stochastic.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixWallReflectStochastic : public FixWallReflect { public: FixWallReflectStochastic(class LAMMPS *, int, char **); - virtual ~FixWallReflectStochastic(); + ~FixWallReflectStochastic() override; private: int seedfix; @@ -36,7 +36,7 @@ class FixWallReflectStochastic : public FixWallReflect { class RanMars *random; - void wall_particle(int m, int which, double coord); + void wall_particle(int m, int which, double coord) override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-FIX/fix_wall_region_ees.h b/src/EXTRA-FIX/fix_wall_region_ees.h index b34e8238a8..5163d99e90 100644 --- a/src/EXTRA-FIX/fix_wall_region_ees.h +++ b/src/EXTRA-FIX/fix_wall_region_ees.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixWallRegionEES : public Fix { public: FixWallRegionEES(class LAMMPS *, int, char **); - ~FixWallRegionEES(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixWallRegionEES() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; private: class AtomVecEllipsoid *avec; diff --git a/src/FEP/fix_adapt_fep.h b/src/FEP/fix_adapt_fep.h index 2aadf373b5..a7cfdad868 100644 --- a/src/FEP/fix_adapt_fep.h +++ b/src/FEP/fix_adapt_fep.h @@ -30,16 +30,16 @@ class FixAdaptFEP : public Fix { int chgflag; FixAdaptFEP(class LAMMPS *, int, char **); - ~FixAdaptFEP(); - int setmask(); - void post_constructor(); - void init(); - void setup_pre_force(int); - void pre_force(int); - void post_run(); - void setup_pre_force_respa(int, int); - void pre_force_respa(int, int, int); - void set_arrays(int); + ~FixAdaptFEP() override; + int setmask() override; + void post_constructor() override; + void init() override; + void setup_pre_force(int) override; + void pre_force(int) override; + void post_run() override; + void setup_pre_force_respa(int, int) override; + void pre_force_respa(int, int, int) override; + void set_arrays(int) override; private: int nadapt, resetflag, scaleflag, afterflag; diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h index 4e344c85c7..c152c54fb3 100644 --- a/src/GPU/fix_gpu.h +++ b/src/GPU/fix_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixGPU : public Fix { public: FixGPU(class LAMMPS *, int, char **); - ~FixGPU(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void min_post_force(int); - void post_force_respa(int, int, int); - double memory_usage(); + ~FixGPU() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void min_post_force(int) override; + void post_force_respa(int, int, int) override; + double memory_usage() override; double binsize(const double subx, const double suby, const double subz, const int nlocal, const double cut); diff --git a/src/GPU/fix_nh_gpu.h b/src/GPU/fix_nh_gpu.h index 7a08b0382c..7461b20d64 100644 --- a/src/GPU/fix_nh_gpu.h +++ b/src/GPU/fix_nh_gpu.h @@ -25,21 +25,21 @@ namespace LAMMPS_NS { class FixNHGPU : public FixNH { public: FixNHGPU(class LAMMPS *, int, char **); - virtual ~FixNHGPU(); - virtual void setup(int vflag); - void reset_dt(); - virtual void final_integrate(); - virtual double memory_usage(); + ~FixNHGPU() override; + void setup(int vflag) override; + void reset_dt() override; + void final_integrate() override; + double memory_usage() override; protected: double *_dtfm; int _nlocal3, _nlocal_max, _respa_on; - virtual void remap(); - virtual void nve_x(); - virtual void nve_v(); - virtual void nh_v_press(); - virtual void nh_v_temp(); + void remap() override; + void nve_x() override; + void nve_v() override; + void nh_v_press() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/GPU/fix_npt_gpu.h b/src/GPU/fix_npt_gpu.h index d771acdd01..5068031132 100644 --- a/src/GPU/fix_npt_gpu.h +++ b/src/GPU/fix_npt_gpu.h @@ -31,7 +31,6 @@ namespace LAMMPS_NS { class FixNPTGPU : public FixNHGPU { public: FixNPTGPU(class LAMMPS *, int, char **); - ~FixNPTGPU() {} }; } // namespace LAMMPS_NS diff --git a/src/GPU/fix_nve_asphere_gpu.h b/src/GPU/fix_nve_asphere_gpu.h index d3fd0fb05a..a0420d6577 100644 --- a/src/GPU/fix_nve_asphere_gpu.h +++ b/src/GPU/fix_nve_asphere_gpu.h @@ -31,12 +31,12 @@ namespace LAMMPS_NS { class FixNVEAsphereGPU : public FixNVE { public: FixNVEAsphereGPU(class LAMMPS *, int, char **); - void init(); - void setup(int vflag); - void initial_integrate(int); - void final_integrate(); - void reset_dt(); - virtual double memory_usage(); + void init() override; + void setup(int vflag) override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; + double memory_usage() override; private: double reset_dt_omp(const int, const int, const int); diff --git a/src/GPU/fix_nve_gpu.h b/src/GPU/fix_nve_gpu.h index adeaeeff50..30e805c770 100644 --- a/src/GPU/fix_nve_gpu.h +++ b/src/GPU/fix_nve_gpu.h @@ -31,12 +31,12 @@ namespace LAMMPS_NS { class FixNVEGPU : public FixNVE { public: FixNVEGPU(class LAMMPS *, int, char **); - virtual ~FixNVEGPU(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); - virtual double memory_usage(); + ~FixNVEGPU() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; + double memory_usage() override; protected: void reset_dt_omp(const int, const int, const int); diff --git a/src/GPU/fix_nvt_gpu.h b/src/GPU/fix_nvt_gpu.h index af0ab1de86..310eabdafa 100644 --- a/src/GPU/fix_nvt_gpu.h +++ b/src/GPU/fix_nvt_gpu.h @@ -31,7 +31,6 @@ namespace LAMMPS_NS { class FixNVTGPU : public FixNHGPU { public: FixNVTGPU(class LAMMPS *, int, char **); - ~FixNVTGPU() {} }; } // namespace LAMMPS_NS diff --git a/src/GRANULAR/fix_freeze.h b/src/GRANULAR/fix_freeze.h index 5846bfd769..23cdc7c305 100644 --- a/src/GRANULAR/fix_freeze.h +++ b/src/GRANULAR/fix_freeze.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixFreeze : public Fix { public: FixFreeze(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - virtual void post_force(int); - void post_force_respa(int, int, int); - double compute_vector(int); + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_vector(int) override; protected: int force_flag; diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h index 7c0bd5aff8..16ef3b7f32 100644 --- a/src/GRANULAR/fix_pour.h +++ b/src/GRANULAR/fix_pour.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixPour : public Fix { public: FixPour(class LAMMPS *, int, char **); - ~FixPour(); - int setmask(); - void init(); - void setup_pre_exchange(); - void pre_exchange(); - void reset_dt(); - void *extract(const char *, int &); + ~FixPour() override; + int setmask() override; + void init() override; + void setup_pre_exchange() override; + void pre_exchange() override; + void reset_dt() override; + void *extract(const char *, int &) override; private: int ninsert, ntype, seed; diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 9a7c4055a1..f59a43ae3f 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -30,24 +30,24 @@ class FixWallGran : public Fix { enum { NORMAL_NONE, NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR }; FixWallGran(class LAMMPS *, int, char **); - virtual ~FixWallGran(); - int setmask(); - virtual void init(); - void setup(int); - virtual void post_force(int); - virtual void post_force_respa(int, int, int); + ~FixWallGran() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; - virtual double memory_usage(); - virtual void grow_arrays(int); - virtual void copy_arrays(int, int, int); - virtual void set_arrays(int); - virtual int pack_exchange(int, double *); - virtual int unpack_exchange(int, double *); - virtual int pack_restart(int, double *); - virtual void unpack_restart(int, int); - virtual int size_restart(int); - virtual int maxsize_restart(); - void reset_dt(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; + void reset_dt() override; void hooke(double, double, double, double, double *, double *, double *, double *, double *, double, double, double *); diff --git a/src/GRANULAR/fix_wall_gran_region.h b/src/GRANULAR/fix_wall_gran_region.h index e7f9dc89ef..6e95afeabc 100644 --- a/src/GRANULAR/fix_wall_gran_region.h +++ b/src/GRANULAR/fix_wall_gran_region.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class FixWallGranRegion : public FixWallGran { public: FixWallGranRegion(class LAMMPS *, int, char **); - ~FixWallGranRegion(); - void post_force(int); - void write_restart(FILE *); - void restart(char *); - void init(); + ~FixWallGranRegion() override; + void post_force(int) override; + void write_restart(FILE *) override; + void restart(char *) override; + void init() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; private: class Region *region; diff --git a/src/INTEL/fix_nh_intel.h b/src/INTEL/fix_nh_intel.h index 3d1a9c389f..3893a206f8 100644 --- a/src/INTEL/fix_nh_intel.h +++ b/src/INTEL/fix_nh_intel.h @@ -26,20 +26,20 @@ namespace LAMMPS_NS { class FixNHIntel : public FixNH { public: FixNHIntel(class LAMMPS *, int, char **); - virtual ~FixNHIntel(); - virtual void setup(int vflag); - void reset_dt(); - virtual double memory_usage(); + ~FixNHIntel() override; + void setup(int vflag) override; + void reset_dt() override; + double memory_usage() override; protected: double *_dtfm; int _nlocal3, _nlocal_max; - virtual void remap(); - virtual void nve_x(); - virtual void nve_v(); - virtual void nh_v_press(); - virtual void nh_v_temp(); + void remap() override; + void nve_x() override; + void nve_v() override; + void nh_v_press() override; + void nh_v_temp() override; }; } diff --git a/src/INTEL/fix_npt_intel.h b/src/INTEL/fix_npt_intel.h index 17d3793a9b..22179ec18e 100644 --- a/src/INTEL/fix_npt_intel.h +++ b/src/INTEL/fix_npt_intel.h @@ -32,7 +32,6 @@ namespace LAMMPS_NS { class FixNPTIntel : public FixNHIntel { public: FixNPTIntel(class LAMMPS *, int, char **); - ~FixNPTIntel() {} }; } // namespace LAMMPS_NS diff --git a/src/INTEL/fix_nve_asphere_intel.h b/src/INTEL/fix_nve_asphere_intel.h index 2b09f99548..b2d00de8c0 100644 --- a/src/INTEL/fix_nve_asphere_intel.h +++ b/src/INTEL/fix_nve_asphere_intel.h @@ -32,12 +32,12 @@ namespace LAMMPS_NS { class FixNVEAsphereIntel : public FixNVE { public: FixNVEAsphereIntel(class LAMMPS *, int, char **); - void init(); - void setup(int vflag); - void initial_integrate(int); - void final_integrate(); - void reset_dt(); - virtual double memory_usage(); + void init() override; + void setup(int vflag) override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; + double memory_usage() override; private: double *_dtfm, *_inertia0, *_inertia1, *_inertia2; diff --git a/src/INTEL/fix_nve_intel.h b/src/INTEL/fix_nve_intel.h index b37b5eaf65..ff793e3f20 100644 --- a/src/INTEL/fix_nve_intel.h +++ b/src/INTEL/fix_nve_intel.h @@ -32,12 +32,12 @@ namespace LAMMPS_NS { class FixNVEIntel : public FixNVE { public: FixNVEIntel(class LAMMPS *, int, char **); - virtual ~FixNVEIntel(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); - virtual double memory_usage(); + ~FixNVEIntel() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; + double memory_usage() override; protected: double *_dtfm; diff --git a/src/INTEL/fix_nvt_intel.h b/src/INTEL/fix_nvt_intel.h index 93834c189e..585df9c542 100644 --- a/src/INTEL/fix_nvt_intel.h +++ b/src/INTEL/fix_nvt_intel.h @@ -32,7 +32,6 @@ namespace LAMMPS_NS { class FixNVTIntel : public FixNHIntel { public: FixNVTIntel(class LAMMPS *, int, char **); - ~FixNVTIntel() {} }; } // namespace LAMMPS_NS diff --git a/src/INTEL/fix_nvt_sllod_intel.h b/src/INTEL/fix_nvt_sllod_intel.h index 12f116dcba..aaa2f91a8e 100644 --- a/src/INTEL/fix_nvt_sllod_intel.h +++ b/src/INTEL/fix_nvt_sllod_intel.h @@ -32,13 +32,12 @@ namespace LAMMPS_NS { class FixNVTSllodIntel : public FixNHIntel { public: FixNVTSllodIntel(class LAMMPS *, int, char **); - ~FixNVTSllodIntel() {} - void init(); + void init() override; private: int nondeformbias; - void nh_v_temp(); + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/KOKKOS/fix_deform_kokkos.h b/src/KOKKOS/fix_deform_kokkos.h index e0835b5e0a..c57c493cb0 100644 --- a/src/KOKKOS/fix_deform_kokkos.h +++ b/src/KOKKOS/fix_deform_kokkos.h @@ -29,11 +29,10 @@ namespace LAMMPS_NS { class FixDeformKokkos : public FixDeform { public: - FixDeformKokkos(class LAMMPS *, int, char **); - virtual ~FixDeformKokkos() {} - void pre_exchange(); - void end_of_step(); + + void pre_exchange() override; + void end_of_step() override; private: class DomainKokkos *domainKK; diff --git a/src/KOKKOS/fix_dpd_energy_kokkos.h b/src/KOKKOS/fix_dpd_energy_kokkos.h index 2986b9707c..700089770a 100644 --- a/src/KOKKOS/fix_dpd_energy_kokkos.h +++ b/src/KOKKOS/fix_dpd_energy_kokkos.h @@ -32,9 +32,9 @@ template class FixDPDenergyKokkos : public FixDPDenergy { public: FixDPDenergyKokkos(class LAMMPS *, int, char **); - virtual ~FixDPDenergyKokkos() {} - virtual void initial_integrate(int); - virtual void final_integrate(); + + void initial_integrate(int) override; + void final_integrate() override; void take_half_step(); protected: diff --git a/src/KOKKOS/fix_enforce2d_kokkos.h b/src/KOKKOS/fix_enforce2d_kokkos.h index 9edd332e91..195cc48974 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.h +++ b/src/KOKKOS/fix_enforce2d_kokkos.h @@ -33,8 +33,8 @@ class FixEnforce2DKokkos : public FixEnforce2D { public: FixEnforce2DKokkos(class LAMMPS *, int, char **); // ~FixEnforce2DKokkos() {} - void setup(int); - void post_force(int); + void setup(int) override; + void post_force(int) override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.h b/src/KOKKOS/fix_eos_table_rx_kokkos.h index 66d9a70390..68a854619b 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.h +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.h @@ -41,11 +41,11 @@ class FixEOStableRXKokkos : public FixEOStableRX { typedef EV_FLOAT value_type; FixEOStableRXKokkos(class LAMMPS *, int, char **); - virtual ~FixEOStableRXKokkos(); - void setup(int); - void init(); - void post_integrate(); - void end_of_step(); + ~FixEOStableRXKokkos() override; + void setup(int) override; + void init() override; + void post_integrate() override; + void end_of_step() override; KOKKOS_INLINE_FUNCTION void operator()(TagFixEOStableRXInit, const int&) const; @@ -123,10 +123,10 @@ class FixEOStableRXKokkos : public FixEOStableRX { DAT::tdual_int_scalar k_error_flag; DAT::tdual_int_scalar k_warning_flag; - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int , int *, double *, int, int *) override; + void unpack_forward_comm(int , int , double *) override; }; } diff --git a/src/KOKKOS/fix_freeze_kokkos.h b/src/KOKKOS/fix_freeze_kokkos.h index 67d4f3272c..28438d5f91 100644 --- a/src/KOKKOS/fix_freeze_kokkos.h +++ b/src/KOKKOS/fix_freeze_kokkos.h @@ -59,7 +59,7 @@ class FixFreezeKokkos : public FixFreeze { }; FixFreezeKokkos(class LAMMPS *, int, char **); - void post_force(int); + void post_force(int) override; KOKKOS_INLINE_FUNCTION void operator()(const int i, OriginalForce &original) const; diff --git a/src/KOKKOS/fix_gravity_kokkos.h b/src/KOKKOS/fix_gravity_kokkos.h index 3526b94d4c..779da5a8b0 100644 --- a/src/KOKKOS/fix_gravity_kokkos.h +++ b/src/KOKKOS/fix_gravity_kokkos.h @@ -35,8 +35,8 @@ template class FixGravityKokkos : public FixGravity { public: FixGravityKokkos(class LAMMPS *, int, char **); - virtual ~FixGravityKokkos() {} - void post_force(int); + + void post_force(int) override; KOKKOS_INLINE_FUNCTION void operator()(TagFixGravityRMass, const int, double &) const; diff --git a/src/KOKKOS/fix_momentum_kokkos.h b/src/KOKKOS/fix_momentum_kokkos.h index 8dc3053acf..eaf93e9756 100644 --- a/src/KOKKOS/fix_momentum_kokkos.h +++ b/src/KOKKOS/fix_momentum_kokkos.h @@ -34,7 +34,7 @@ class FixMomentumKokkos : public FixMomentum { typedef ArrayTypes AT; FixMomentumKokkos(class LAMMPS *, int, char **); - void end_of_step(); + void end_of_step() override; }; } diff --git a/src/KOKKOS/fix_neigh_history_kokkos.h b/src/KOKKOS/fix_neigh_history_kokkos.h index 0442b46cbd..e27d92bee8 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.h +++ b/src/KOKKOS/fix_neigh_history_kokkos.h @@ -31,17 +31,17 @@ template class FixNeighHistoryKokkos : public FixNeighHistory { public: FixNeighHistoryKokkos(class LAMMPS *, int, char **); - ~FixNeighHistoryKokkos(); + ~FixNeighHistoryKokkos() override; - void init(); - void pre_exchange(); - void setup_post_neighbor(); - virtual void post_neighbor(); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + void init() override; + void pre_exchange() override; + void setup_post_neighbor() override; + void post_neighbor() override; + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; KOKKOS_INLINE_FUNCTION void zero_partner_count_item(const int &i) const; diff --git a/src/KOKKOS/fix_nh_kokkos.h b/src/KOKKOS/fix_nh_kokkos.h index 00f0b1f769..6155ba2dd3 100644 --- a/src/KOKKOS/fix_nh_kokkos.h +++ b/src/KOKKOS/fix_nh_kokkos.h @@ -36,12 +36,12 @@ class FixNHKokkos : public FixNH { typedef DeviceType device_type; FixNHKokkos(class LAMMPS *, int, char **); - virtual ~FixNHKokkos(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void pre_exchange(); + ~FixNHKokkos() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void pre_exchange() override; template KOKKOS_INLINE_FUNCTION @@ -58,12 +58,12 @@ class FixNHKokkos : public FixNH { void operator()(TagFixNH_nh_v_temp, const int&) const; protected: - virtual void remap(); + void remap() override; - virtual void nve_x(); // may be overwritten by child classes - virtual void nve_v(); - virtual void nh_v_press(); - virtual void nh_v_temp(); + void nve_x() override; // may be overwritten by child classes + void nve_v() override; + void nh_v_press() override; + void nh_v_temp() override; F_FLOAT factor[3]; diff --git a/src/KOKKOS/fix_nph_kokkos.h b/src/KOKKOS/fix_nph_kokkos.h index 8d91930c32..06e689e3c8 100644 --- a/src/KOKKOS/fix_nph_kokkos.h +++ b/src/KOKKOS/fix_nph_kokkos.h @@ -31,7 +31,6 @@ template class FixNPHKokkos : public FixNHKokkos { public: FixNPHKokkos(class LAMMPS *, int, char **); - ~FixNPHKokkos() {} }; } diff --git a/src/KOKKOS/fix_npt_kokkos.h b/src/KOKKOS/fix_npt_kokkos.h index b70e130c35..8cd50b8a54 100644 --- a/src/KOKKOS/fix_npt_kokkos.h +++ b/src/KOKKOS/fix_npt_kokkos.h @@ -31,7 +31,6 @@ template class FixNPTKokkos : public FixNHKokkos { public: FixNPTKokkos(class LAMMPS *, int, char **); - ~FixNPTKokkos() {} }; } diff --git a/src/KOKKOS/fix_nve_kokkos.h b/src/KOKKOS/fix_nve_kokkos.h index 8d2aefb694..fddfcd2bba 100644 --- a/src/KOKKOS/fix_nve_kokkos.h +++ b/src/KOKKOS/fix_nve_kokkos.h @@ -41,11 +41,11 @@ template class FixNVEKokkos : public FixNVE { public: FixNVEKokkos(class LAMMPS *, int, char **); - ~FixNVEKokkos() {} + void cleanup_copy(); - void init(); - void initial_integrate(int); - void final_integrate(); + void init() override; + void initial_integrate(int) override; + void final_integrate() override; KOKKOS_INLINE_FUNCTION void initial_integrate_item(int) const; diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.h b/src/KOKKOS/fix_nve_sphere_kokkos.h index f3e3df13d4..2f85fea1b9 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.h +++ b/src/KOKKOS/fix_nve_sphere_kokkos.h @@ -32,11 +32,11 @@ template class FixNVESphereKokkos : public FixNVESphere { public: FixNVESphereKokkos(class LAMMPS *, int, char **); - virtual ~FixNVESphereKokkos() {} + void cleanup_copy(); - void init(); - void initial_integrate(int); - void final_integrate(); + void init() override; + void initial_integrate(int) override; + void final_integrate() override; KOKKOS_INLINE_FUNCTION void initial_integrate_item(const int i) const; diff --git a/src/KOKKOS/fix_nvt_kokkos.h b/src/KOKKOS/fix_nvt_kokkos.h index 054a083034..72e12ea42f 100644 --- a/src/KOKKOS/fix_nvt_kokkos.h +++ b/src/KOKKOS/fix_nvt_kokkos.h @@ -31,7 +31,6 @@ template class FixNVTKokkos : public FixNHKokkos { public: FixNVTKokkos(class LAMMPS *, int, char **); - ~FixNVTKokkos() {} }; } diff --git a/src/KOKKOS/fix_nvt_sllod_kokkos.h b/src/KOKKOS/fix_nvt_sllod_kokkos.h index 84e57ab2c3..ebac7b1563 100644 --- a/src/KOKKOS/fix_nvt_sllod_kokkos.h +++ b/src/KOKKOS/fix_nvt_sllod_kokkos.h @@ -39,8 +39,8 @@ class FixNVTSllodKokkos : public FixNHKokkos { typedef ArrayTypes AT; FixNVTSllodKokkos(class LAMMPS *, int, char **); - ~FixNVTSllodKokkos() {} - void init(); + + void init() override; KOKKOS_INLINE_FUNCTION void operator()(TagFixNVTSllod_temp1, const int& i) const; @@ -51,7 +51,7 @@ class FixNVTSllodKokkos : public FixNHKokkos { private: int nondeformbias; - void nh_v_temp(); + void nh_v_temp() override; protected: typename AT::t_x_array x; diff --git a/src/KOKKOS/fix_property_atom_kokkos.h b/src/KOKKOS/fix_property_atom_kokkos.h index 7f3e5758b1..a90f672c8f 100644 --- a/src/KOKKOS/fix_property_atom_kokkos.h +++ b/src/KOKKOS/fix_property_atom_kokkos.h @@ -28,9 +28,8 @@ namespace LAMMPS_NS { class FixPropertyAtomKokkos : public FixPropertyAtom { public: FixPropertyAtomKokkos(class LAMMPS *, int, char **); - virtual ~FixPropertyAtomKokkos() {} - void grow_arrays(int); + void grow_arrays(int) override; }; } diff --git a/src/KOKKOS/fix_qeq_reaxff_kokkos.h b/src/KOKKOS/fix_qeq_reaxff_kokkos.h index 3256e56aef..85cc14d617 100644 --- a/src/KOKKOS/fix_qeq_reaxff_kokkos.h +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.h @@ -47,12 +47,12 @@ class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { typedef DeviceType device_type; typedef ArrayTypes AT; FixQEqReaxFFKokkos(class LAMMPS *, int, char **); - ~FixQEqReaxFFKokkos(); + ~FixQEqReaxFFKokkos() override; void cleanup_copy(); - void init(); - void setup_pre_force(int); - void pre_force(int); + void init() override; + void setup_pre_force(int) override; + void pre_force(int) override; KOKKOS_INLINE_FUNCTION void num_neigh_item(int, int&) const; @@ -158,13 +158,13 @@ class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { }; int pack_forward_comm_fix_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, - int, int *); - void unpack_forward_comm_fix_kokkos(int, int, DAT::tdual_xfloat_1d&); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int, int *) override; + void unpack_forward_comm_fix_kokkos(int, int, DAT::tdual_xfloat_1d&) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: int inum,ignum; @@ -226,7 +226,7 @@ class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { void init_shielding_k(); void init_hist(); - void allocate_matrix(); + void allocate_matrix() override; void allocate_array(); int cg_solve1(); int cg_solve2(); @@ -237,11 +237,11 @@ class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { int count, isuccess; double alpha, beta, delta, cutsq; - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - void get_chi_field(); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + void get_chi_field() override; }; template diff --git a/src/KOKKOS/fix_reaxff_bonds_kokkos.h b/src/KOKKOS/fix_reaxff_bonds_kokkos.h index b161f67ced..3d9aa7d3d9 100644 --- a/src/KOKKOS/fix_reaxff_bonds_kokkos.h +++ b/src/KOKKOS/fix_reaxff_bonds_kokkos.h @@ -34,8 +34,9 @@ namespace LAMMPS_NS { class FixReaxFFBondsKokkos : public FixReaxFFBonds { public: FixReaxFFBondsKokkos(class LAMMPS *, int, char **); - virtual ~FixReaxFFBondsKokkos(); - void init(); + ~FixReaxFFBondsKokkos() override; + + void init() override; private: int nbuf; diff --git a/src/KOKKOS/fix_reaxff_species_kokkos.h b/src/KOKKOS/fix_reaxff_species_kokkos.h index 2f7d94cdad..7d463940da 100644 --- a/src/KOKKOS/fix_reaxff_species_kokkos.h +++ b/src/KOKKOS/fix_reaxff_species_kokkos.h @@ -35,8 +35,9 @@ namespace LAMMPS_NS { class FixReaxFFSpeciesKokkos : public FixReaxFFSpecies { public: FixReaxFFSpeciesKokkos(class LAMMPS *, int, char **); - virtual ~FixReaxFFSpeciesKokkos(); - void init(); + ~FixReaxFFSpeciesKokkos() override; + + void init() override; private: void FindMolecule(); diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 61e4a05946..602cb67dbc 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -78,12 +78,12 @@ class FixRxKokkos : public FixRX { typedef ArrayTypes AT; FixRxKokkos(class LAMMPS *, int, char **); - virtual ~FixRxKokkos(); - virtual void init(); - void init_list(int, class NeighList *); - void post_constructor(); - virtual void setup_pre_force(int); - virtual void pre_force(int); + ~FixRxKokkos() override; + void init() override; + void init_list(int, class NeighList *) override; + void post_constructor() override; + void setup_pre_force(int) override; + void pre_force(int) override; // Define a value_type here for the reduction operator on CounterType. typedef CounterType value_type; @@ -263,10 +263,10 @@ class FixRxKokkos : public FixRX { template void computeLocalTemperature(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int , int *, double *, int, int *) override; + void unpack_forward_comm(int , int , double *) override; //private: // replicate a few from FixRX int my_restartFlag; diff --git a/src/KOKKOS/fix_setforce_kokkos.h b/src/KOKKOS/fix_setforce_kokkos.h index e39ef82325..5260ae3421 100644 --- a/src/KOKKOS/fix_setforce_kokkos.h +++ b/src/KOKKOS/fix_setforce_kokkos.h @@ -63,9 +63,9 @@ class FixSetForceKokkos : public FixSetForce { typedef ArrayTypes AT; FixSetForceKokkos(class LAMMPS *, int, char **); - ~FixSetForceKokkos(); - void init(); - void post_force(int); + ~FixSetForceKokkos() override; + void init() override; + void post_force(int) override; KOKKOS_INLINE_FUNCTION void operator()(TagFixSetForceConstant, const int&, double_3&) const; diff --git a/src/KOKKOS/fix_shake_kokkos.h b/src/KOKKOS/fix_shake_kokkos.h index a9967f22ec..8adae5f0a3 100644 --- a/src/KOKKOS/fix_shake_kokkos.h +++ b/src/KOKKOS/fix_shake_kokkos.h @@ -49,31 +49,31 @@ class FixShakeKokkos : public FixShake, public KokkosBase { typedef ArrayTypes AT; FixShakeKokkos(class LAMMPS *, int, char **); - virtual ~FixShakeKokkos(); - void init(); - void pre_neighbor(); - void post_force(int); + ~FixShakeKokkos() override; + void init() override; + void pre_neighbor() override; + void post_force(int) override; - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - void update_arrays(int, int); - void set_molecule(int, tagint, int, double *, double *, double *); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + void update_arrays(int, int) override; + void set_molecule(int, tagint, int, double *, double *, double *) override; - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; int pack_forward_comm_fix_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, - int, int *); - void unpack_forward_comm_fix_kokkos(int, int, DAT::tdual_xfloat_1d&); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int, int *) override; + void unpack_forward_comm_fix_kokkos(int, int, DAT::tdual_xfloat_1d&) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; - void shake_end_of_step(int vflag); - void correct_coordinates(int vflag); + void shake_end_of_step(int vflag) override; + void correct_coordinates(int vflag) override; - int dof(int); + int dof(int) override; - void unconstrained_update(); + void unconstrained_update() override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.h b/src/KOKKOS/fix_wall_lj93_kokkos.h index e07789f378..b4b10a1e13 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.h +++ b/src/KOKKOS/fix_wall_lj93_kokkos.h @@ -36,7 +36,7 @@ class FixWallLJ93Kokkos : public FixWallLJ93 { typedef double value_type[]; FixWallLJ93Kokkos(class LAMMPS *, int, char **); - void wall_particle(int, int, double); + void wall_particle(int, int, double) override; int m; diff --git a/src/KOKKOS/fix_wall_reflect_kokkos.h b/src/KOKKOS/fix_wall_reflect_kokkos.h index 3e068c06df..f4e6eee684 100644 --- a/src/KOKKOS/fix_wall_reflect_kokkos.h +++ b/src/KOKKOS/fix_wall_reflect_kokkos.h @@ -36,7 +36,7 @@ class FixWallReflectKokkos : public FixWallReflect { typedef DeviceType device_type; typedef ArrayTypes AT; FixWallReflectKokkos(class LAMMPS *, int, char **); - void post_integrate(); + void post_integrate() override; KOKKOS_INLINE_FUNCTION void operator()(TagFixWallReflectPostIntegrate, const int&) const; diff --git a/src/KSPACE/fix_tune_kspace.h b/src/KSPACE/fix_tune_kspace.h index 7affe49684..1acf4fcc80 100644 --- a/src/KSPACE/fix_tune_kspace.h +++ b/src/KSPACE/fix_tune_kspace.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixTuneKspace : public Fix { public: FixTuneKspace(class LAMMPS *, int, char **); - ~FixTuneKspace() {} - int setmask(); - void init(); - void pre_exchange(); + + int setmask() override; + void init() override; + void pre_exchange() override; double get_timing_info(); void store_old_kspace_settings(); void update_pair_style(const std::string &, double); diff --git a/src/LATTE/fix_latte.h b/src/LATTE/fix_latte.h index 2797da3599..30a07c42a4 100644 --- a/src/LATTE/fix_latte.h +++ b/src/LATTE/fix_latte.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class FixLatte : public Fix { public: FixLatte(class LAMMPS *, int, char **); - virtual ~FixLatte(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void min_setup(int); - void setup_pre_reverse(int, int); - void initial_integrate(int); - void pre_reverse(int, int); - void post_force(int); - void min_post_force(int); - void final_integrate(); - void reset_dt(); - double compute_scalar(); - double memory_usage(); + ~FixLatte() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void min_setup(int) override; + void setup_pre_reverse(int, int) override; + void initial_integrate(int) override; + void pre_reverse(int, int) override; + void post_force(int) override; + void min_post_force(int) override; + void final_integrate() override; + void reset_dt() override; + double compute_scalar() override; + double memory_usage() override; protected: char *id_pe; diff --git a/src/MACHDYN/fix_smd_adjust_dt.h b/src/MACHDYN/fix_smd_adjust_dt.h index 41203cf472..24b642e603 100644 --- a/src/MACHDYN/fix_smd_adjust_dt.h +++ b/src/MACHDYN/fix_smd_adjust_dt.h @@ -38,15 +38,15 @@ namespace LAMMPS_NS { class FixSMDTlsphDtReset : public Fix { public: FixSMDTlsphDtReset(class LAMMPS *, int, char **); - ~FixSMDTlsphDtReset() {} - int setmask(); - void init(); - void setup(int); - void initial_integrate(int); - void end_of_step(); - double compute_scalar(); - void write_restart(FILE *); - void restart(char *); + + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void end_of_step() override; + double compute_scalar() override; + void write_restart(FILE *) override; + void restart(char *) override; private: double safety_factor; diff --git a/src/MACHDYN/fix_smd_integrate_tlsph.h b/src/MACHDYN/fix_smd_integrate_tlsph.h index 582b4588a4..c2037ee606 100644 --- a/src/MACHDYN/fix_smd_integrate_tlsph.h +++ b/src/MACHDYN/fix_smd_integrate_tlsph.h @@ -41,12 +41,12 @@ class FixSMDIntegrateTlsph : public Fix { public: FixSMDIntegrateTlsph(class LAMMPS *, int, char **); - virtual ~FixSMDIntegrateTlsph() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); + + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; protected: double dtv, dtf, vlimit, vlimitsq; diff --git a/src/MACHDYN/fix_smd_integrate_ulsph.h b/src/MACHDYN/fix_smd_integrate_ulsph.h index af75685a4b..cbba1f5135 100644 --- a/src/MACHDYN/fix_smd_integrate_ulsph.h +++ b/src/MACHDYN/fix_smd_integrate_ulsph.h @@ -38,11 +38,12 @@ namespace LAMMPS_NS { class FixSMDIntegrateUlsph : public Fix { public: FixSMDIntegrateUlsph(class LAMMPS *, int, char **); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - void reset_dt(); + + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; private: class NeighList *list; diff --git a/src/MACHDYN/fix_smd_move_triangulated_surface.h b/src/MACHDYN/fix_smd_move_triangulated_surface.h index e64d2fc409..4ffc3dcc0f 100644 --- a/src/MACHDYN/fix_smd_move_triangulated_surface.h +++ b/src/MACHDYN/fix_smd_move_triangulated_surface.h @@ -39,13 +39,13 @@ namespace LAMMPS_NS { class FixSMDMoveTriSurf : public Fix { public: FixSMDMoveTriSurf(class LAMMPS *, int, char **); - ~FixSMDMoveTriSurf() = default; - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - void reset_dt(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + + int setmask() override; + void init() override; + void initial_integrate(int) override; + void reset_dt() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: double dtv; diff --git a/src/MACHDYN/fix_smd_setvel.h b/src/MACHDYN/fix_smd_setvel.h index 1e91a8d602..30071d0875 100644 --- a/src/MACHDYN/fix_smd_setvel.h +++ b/src/MACHDYN/fix_smd_setvel.h @@ -38,15 +38,15 @@ namespace LAMMPS_NS { class FixSMDSetVel : public Fix { public: FixSMDSetVel(class LAMMPS *, int, char **); - ~FixSMDSetVel(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); + ~FixSMDSetVel() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; //void initial_integrate(int); - void post_force(int); - double compute_vector(int); - double memory_usage(); + void post_force(int) override; + double compute_vector(int) override; + double memory_usage() override; private: double xvalue, yvalue, zvalue; diff --git a/src/MACHDYN/fix_smd_tlsph_reference_configuration.h b/src/MACHDYN/fix_smd_tlsph_reference_configuration.h index 98108b8ffd..45ec11b6b5 100644 --- a/src/MACHDYN/fix_smd_tlsph_reference_configuration.h +++ b/src/MACHDYN/fix_smd_tlsph_reference_configuration.h @@ -43,23 +43,24 @@ class FixSMD_TLSPH_ReferenceConfiguration : public Fix { public: FixSMD_TLSPH_ReferenceConfiguration(class LAMMPS *, int, char **); - ~FixSMD_TLSPH_ReferenceConfiguration(); - int setmask(); - void init(); - void setup(int); - void pre_exchange(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~FixSMD_TLSPH_ReferenceConfiguration() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + int setmask() override; + void init() override; + void setup(int) override; + void pre_exchange() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; bool crack_exclude(int i, int j); bool get_line_intersection(int i, int j); diff --git a/src/MACHDYN/fix_smd_wall_surface.h b/src/MACHDYN/fix_smd_wall_surface.h index 74d7784eee..07d0436417 100644 --- a/src/MACHDYN/fix_smd_wall_surface.h +++ b/src/MACHDYN/fix_smd_wall_surface.h @@ -28,11 +28,12 @@ class FixSMDWallSurface : public Fix { public: FixSMDWallSurface(class LAMMPS *, int, char **); - virtual ~FixSMDWallSurface(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); + ~FixSMDWallSurface() override; + + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; void read_triangles(int pass); diff --git a/src/MANIFOLD/fix_manifoldforce.h b/src/MANIFOLD/fix_manifoldforce.h index d58fe6001b..58822614a9 100644 --- a/src/MANIFOLD/fix_manifoldforce.h +++ b/src/MANIFOLD/fix_manifoldforce.h @@ -52,13 +52,13 @@ namespace user_manifold { class FixManifoldForce : public Fix { public: FixManifoldForce(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; private: user_manifold::manifold *ptr_m; diff --git a/src/MANIFOLD/fix_nve_manifold_rattle.h b/src/MANIFOLD/fix_nve_manifold_rattle.h index e2bf6b5639..91fb17aec1 100644 --- a/src/MANIFOLD/fix_nve_manifold_rattle.h +++ b/src/MANIFOLD/fix_nve_manifold_rattle.h @@ -66,18 +66,18 @@ class FixNVEManifoldRattle : public Fix { }; FixNVEManifoldRattle(LAMMPS *, int &, char **, int = 1); - virtual ~FixNVEManifoldRattle(); + ~FixNVEManifoldRattle() override; // All this stuff is interface, so you DO need to implement them. // Just delegate them to the workhorse classes. - virtual int setmask(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void init(); - virtual void reset_dt(); - virtual void end_of_step(); - virtual int dof(int); - virtual void setup(int) {} // Not needed for fixNVE but is for fixNVT - virtual double memory_usage(); + int setmask() override; + void initial_integrate(int) override; + void final_integrate() override; + void init() override; + void reset_dt() override; + void end_of_step() override; + int dof(int) override; + void setup(int) override {} // Not needed for fixNVE but is for fixNVT + double memory_usage() override; protected: int nevery, next_output; diff --git a/src/MANIFOLD/fix_nvt_manifold_rattle.h b/src/MANIFOLD/fix_nvt_manifold_rattle.h index d8439b1ad0..6a4d9d7b33 100644 --- a/src/MANIFOLD/fix_nvt_manifold_rattle.h +++ b/src/MANIFOLD/fix_nvt_manifold_rattle.h @@ -53,15 +53,15 @@ namespace LAMMPS_NS { class FixNVTManifoldRattle : public FixNVEManifoldRattle { public: FixNVTManifoldRattle(LAMMPS *, int, char **, int = 1); - virtual ~FixNVTManifoldRattle(); + ~FixNVTManifoldRattle() override; - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void init(); - virtual void reset_dt(); - virtual int setmask(); - virtual void setup(int); // Not needed for fixNVE but is for fixNVT - virtual double memory_usage(); + void initial_integrate(int) override; + void final_integrate() override; + void init() override; + void reset_dt() override; + int setmask() override; + void setup(int) override; // Not needed for fixNVE but is for fixNVT + double memory_usage() override; protected: void compute_temp_target(); diff --git a/src/MANIFOLD/manifold.h b/src/MANIFOLD/manifold.h index 92a5a02222..5cabe459b2 100644 --- a/src/MANIFOLD/manifold.h +++ b/src/MANIFOLD/manifold.h @@ -47,7 +47,7 @@ namespace user_manifold { class manifold : protected Pointers { public: manifold(class LAMMPS *lmp) : Pointers(lmp), params(nullptr) {} - virtual ~manifold() { delete[] params; } + ~manifold() override { delete[] params; } virtual double g(const double *) = 0; virtual void n(const double *, double *) = 0; diff --git a/src/MANYBODY/fix_qeq_comb.h b/src/MANYBODY/fix_qeq_comb.h index 320691b7b0..554d5c847b 100644 --- a/src/MANYBODY/fix_qeq_comb.h +++ b/src/MANYBODY/fix_qeq_comb.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixQEQComb : public Fix { public: FixQEQComb(class LAMMPS *, int, char **); - virtual ~FixQEQComb(); - int setmask(); - virtual void init(); - void setup(int); - virtual void post_force(int); - void post_force_respa(int, int, int); - double memory_usage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~FixQEQComb() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double memory_usage() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; - void min_post_force(int); + void min_post_force(int) override; protected: int me, firstflag; diff --git a/src/MC/fix_atom_swap.h b/src/MC/fix_atom_swap.h index 2511fe6544..59145da84f 100644 --- a/src/MC/fix_atom_swap.h +++ b/src/MC/fix_atom_swap.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixAtomSwap : public Fix { public: FixAtomSwap(class LAMMPS *, int, char **); - ~FixAtomSwap(); - int setmask(); - void init(); - void pre_exchange(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double compute_vector(int); - double memory_usage(); - void write_restart(FILE *); - void restart(char *); + ~FixAtomSwap() override; + int setmask() override; + void init() override; + void pre_exchange() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double compute_vector(int) override; + double memory_usage() override; + void write_restart(FILE *) override; + void restart(char *) override; private: int nevery, seed; diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h index d6fdd8850b..f470adcce0 100644 --- a/src/MC/fix_bond_break.h +++ b/src/MC/fix_bond_break.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class FixBondBreak : public Fix { public: FixBondBreak(class LAMMPS *, int, char **); - ~FixBondBreak(); - int setmask(); - void init(); - void post_integrate(); - void post_integrate_respa(int, int); + ~FixBondBreak() override; + int setmask() override; + void init() override; + void post_integrate() override; + void post_integrate_respa(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double compute_vector(int); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double compute_vector(int) override; + double memory_usage() override; private: int me, nprocs; diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h index df29c91369..26505a5906 100644 --- a/src/MC/fix_bond_create.h +++ b/src/MC/fix_bond_create.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class FixBondCreate : public Fix { public: FixBondCreate(class LAMMPS *, int, char **); - virtual ~FixBondCreate(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_integrate(); - void post_integrate_respa(int, int); + ~FixBondCreate() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void post_integrate() override; + void post_integrate_respa(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - double compute_vector(int); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + double compute_vector(int) override; + double memory_usage() override; protected: int me; diff --git a/src/MC/fix_bond_create_angle.h b/src/MC/fix_bond_create_angle.h index d7563f1d78..6c74f0e6d7 100644 --- a/src/MC/fix_bond_create_angle.h +++ b/src/MC/fix_bond_create_angle.h @@ -29,7 +29,7 @@ class FixBondCreateAngle : public FixBondCreate { FixBondCreateAngle(class LAMMPS *, int, char **); private: - int constrain(int, int, double, double); + int constrain(int, int, double, double) override; }; } // namespace LAMMPS_NS diff --git a/src/MC/fix_bond_swap.h b/src/MC/fix_bond_swap.h index e0691233f5..526d35ae22 100644 --- a/src/MC/fix_bond_swap.h +++ b/src/MC/fix_bond_swap.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixBondSwap : public Fix { public: FixBondSwap(class LAMMPS *, int, char **); - ~FixBondSwap(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void post_integrate(); - int modify_param(int, char **); - double compute_vector(int); - double memory_usage(); + ~FixBondSwap() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void post_integrate() override; + int modify_param(int, char **) override; + double compute_vector(int) override; + double memory_usage() override; private: double fraction, cutsq; diff --git a/src/MC/fix_charge_regulation.h b/src/MC/fix_charge_regulation.h index cf518baa03..f3856ed067 100644 --- a/src/MC/fix_charge_regulation.h +++ b/src/MC/fix_charge_regulation.h @@ -31,10 +31,10 @@ namespace LAMMPS_NS { class FixChargeRegulation : public Fix { public: FixChargeRegulation(class LAMMPS *, int, char **); - ~FixChargeRegulation(); - int setmask(); - void init(); - void pre_exchange(); + ~FixChargeRegulation() override; + int setmask() override; + void init() override; + void pre_exchange() override; void forward_acid(); void backward_acid(); void forward_base(); @@ -48,13 +48,13 @@ class FixChargeRegulation : public Fix { double energy_full(); int particle_number(int, double); int particle_number_xrd(int, double, double, double *); - double compute_vector(int n); + double compute_vector(int n) override; void assign_tags(); void options(int, char **); void setThermoTemperaturePointer(); - double memory_usage(); - void write_restart(FILE *); - void restart(char *); + double memory_usage() override; + void write_restart(FILE *) override; + void restart(char *) override; private: int exclusion_group, exclusion_group_bit; diff --git a/src/MC/fix_gcmc.h b/src/MC/fix_gcmc.h index 44b7f2078d..23e22e686a 100644 --- a/src/MC/fix_gcmc.h +++ b/src/MC/fix_gcmc.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixGCMC : public Fix { public: FixGCMC(class LAMMPS *, int, char **); - ~FixGCMC(); - int setmask(); - void init(); - void pre_exchange(); + ~FixGCMC() override; + int setmask() override; + void init() override; + void pre_exchange() override; void attempt_atomic_translation(); void attempt_atomic_deletion(); void attempt_atomic_insertion(); @@ -52,10 +52,10 @@ class FixGCMC : public Fix { tagint pick_random_gas_molecule(); void toggle_intramolecular(int); void update_gas_atoms_list(); - double compute_vector(int); - double memory_usage(); - void write_restart(FILE *); - void restart(char *); + double compute_vector(int) override; + double memory_usage() override; + void write_restart(FILE *) override; + void restart(char *) override; void grow_molecule_arrays(int); private: diff --git a/src/MC/fix_mol_swap.h b/src/MC/fix_mol_swap.h index 3197cbd832..8962ea69a2 100644 --- a/src/MC/fix_mol_swap.h +++ b/src/MC/fix_mol_swap.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixMolSwap : public Fix { public: FixMolSwap(class LAMMPS *, int, char **); - ~FixMolSwap(); - int setmask(); - void init(); - void pre_exchange(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double compute_vector(int); - void write_restart(FILE *); - void restart(char *); + ~FixMolSwap() override; + int setmask() override; + void init() override; + void pre_exchange() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double compute_vector(int) override; + void write_restart(FILE *) override; + void restart(char *) override; private: int nevery, ncycles, seed; diff --git a/src/MC/fix_tfmc.h b/src/MC/fix_tfmc.h index ea68d4fc6a..974cf2b4bf 100644 --- a/src/MC/fix_tfmc.h +++ b/src/MC/fix_tfmc.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixTFMC : public Fix { public: FixTFMC(class LAMMPS *, int, char **); - ~FixTFMC(); - int setmask(); - void init(); - void initial_integrate(int); + ~FixTFMC() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; private: double d_max; diff --git a/src/MC/fix_widom.h b/src/MC/fix_widom.h index 222cb32b3f..d2240fd6c8 100644 --- a/src/MC/fix_widom.h +++ b/src/MC/fix_widom.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixWidom : public Fix { public: FixWidom(class LAMMPS *, int, char **); - ~FixWidom(); - int setmask(); - void init(); - void pre_exchange(); + ~FixWidom() override; + int setmask() override; + void init() override; + void pre_exchange() override; void attempt_atomic_insertion(); void attempt_molecule_insertion(); @@ -41,10 +41,10 @@ class FixWidom : public Fix { double molecule_energy(tagint); double energy_full(); void update_gas_atoms_list(); - double compute_vector(int); - double memory_usage(); - void write_restart(FILE *); - void restart(char *); + double compute_vector(int) override; + double memory_usage() override; + void write_restart(FILE *) override; + void restart(char *) override; void grow_molecule_arrays(int); private: diff --git a/src/MESSAGE/fix_client_md.h b/src/MESSAGE/fix_client_md.h index a9f9b531f1..2a0106fd0e 100644 --- a/src/MESSAGE/fix_client_md.h +++ b/src/MESSAGE/fix_client_md.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixClientMD : public Fix { public: FixClientMD(class LAMMPS *, int, char **); - ~FixClientMD(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void min_post_force(int); - double compute_scalar(); + ~FixClientMD() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void min_post_force(int) override; + double compute_scalar() override; private: int maxatom, units, server_error; diff --git a/src/MISC/fix_accelerate_cos.h b/src/MISC/fix_accelerate_cos.h index cad4a94e2a..48d992b1a2 100644 --- a/src/MISC/fix_accelerate_cos.h +++ b/src/MISC/fix_accelerate_cos.h @@ -31,11 +31,11 @@ namespace LAMMPS_NS { class FixAccelerateCos : public Fix { public: FixAccelerateCos(class LAMMPS *, int, char **); - virtual ~FixAccelerateCos(){}; - int setmask(); - virtual void init(){}; - void setup(int); - virtual void post_force(int); + + int setmask() override; + void init() override{}; + void setup(int) override; + void post_force(int) override; protected: double acceleration; diff --git a/src/MISC/fix_imd.h b/src/MISC/fix_imd.h index 3c4e66f50a..314b629ac1 100644 --- a/src/MISC/fix_imd.h +++ b/src/MISC/fix_imd.h @@ -64,13 +64,13 @@ namespace LAMMPS_NS { class FixIMD : public Fix { public: FixIMD(class LAMMPS *, int, char **); - ~FixIMD(); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double memory_usage(); + ~FixIMD() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double memory_usage() override; protected: int imd_port; diff --git a/src/MISC/fix_ipi.h b/src/MISC/fix_ipi.h index 443dbc8780..07d1c729a9 100644 --- a/src/MISC/fix_ipi.h +++ b/src/MISC/fix_ipi.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixIPI : public Fix { public: FixIPI(class LAMMPS *, int, char **); - virtual ~FixIPI(); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); + ~FixIPI() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; protected: char *host; diff --git a/src/MISC/fix_pair_tracker.h b/src/MISC/fix_pair_tracker.h index 7c2e3ff322..a9743b3b50 100644 --- a/src/MISC/fix_pair_tracker.h +++ b/src/MISC/fix_pair_tracker.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixPairTracker : public Fix { public: FixPairTracker(class LAMMPS *, int, char **); - ~FixPairTracker(); - int setmask(); - void init(); - void post_force(int); - double memory_usage(); + ~FixPairTracker() override; + int setmask() override; + void init() override; + void post_force(int) override; + double memory_usage() override; void lost_contact(int, int, double, double, double, double); private: diff --git a/src/MISC/fix_srp.h b/src/MISC/fix_srp.h index 2167a27340..e6049de893 100644 --- a/src/MISC/fix_srp.h +++ b/src/MISC/fix_srp.h @@ -27,30 +27,30 @@ namespace LAMMPS_NS { class FixSRP : public Fix { public: FixSRP(class LAMMPS *, int, char **); - ~FixSRP(); - int setmask(); - void init(); + ~FixSRP() override; + int setmask() override; + void init() override; - void pre_exchange(); - void setup_pre_force(int); + void pre_exchange() override; + void setup_pre_force(int) override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_border(int, int *, double *); - int unpack_border(int, int, double *); - void post_run(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_border(int, int *, double *) override; + int unpack_border(int, int, double *) override; + void post_run() override; - int pack_restart(int, double *); - void unpack_restart(int, int); - int maxsize_restart(); - int size_restart(int); - void write_restart(FILE *); - void restart(char *); - int modify_param(int, char **); + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int maxsize_restart() override; + int size_restart(int) override; + void write_restart(FILE *) override; + void restart(char *) override; + int modify_param(int, char **) override; double **array; diff --git a/src/MOLECULE/fix_cmap.h b/src/MOLECULE/fix_cmap.h index ae70f9faad..944c311001 100644 --- a/src/MOLECULE/fix_cmap.h +++ b/src/MOLECULE/fix_cmap.h @@ -26,43 +26,43 @@ namespace LAMMPS_NS { class FixCMAP : public Fix { public: FixCMAP(class LAMMPS *, int, char **); - ~FixCMAP(); - int setmask(); - void init(); - void setup(int); - void setup_pre_neighbor(); - void setup_pre_reverse(int, int); - void min_setup(int); - void pre_neighbor(); - void pre_reverse(int, int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); + ~FixCMAP() override; + int setmask() override; + void init() override; + void setup(int) override; + void setup_pre_neighbor() override; + void setup_pre_reverse(int, int) override; + void min_setup(int) override; + void pre_neighbor() override; + void pre_reverse(int, int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; - void read_data_header(char *); - void read_data_section(char *, int, char *, tagint); - bigint read_data_skip_lines(char *); - void write_data_header(FILE *, int); - void write_data_section_size(int, int &, int &); - void write_data_section_pack(int, double **); - void write_data_section_keyword(int, FILE *); - void write_data_section(int, FILE *, int, double **, int); + void read_data_header(char *) override; + void read_data_section(char *, int, char *, tagint) override; + bigint read_data_skip_lines(char *) override; + void write_data_header(FILE *, int) override; + void write_data_section_size(int, int &, int &) override; + void write_data_section_pack(int, double **) override; + void write_data_section_keyword(int, FILE *) override; + void write_data_section(int, FILE *, int, double **, int) override; - void write_restart(FILE *); - void restart(char *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + void write_restart(FILE *) override; + void restart(char *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; - double memory_usage(); + double memory_usage() override; private: int nprocs, me; diff --git a/src/OPENMP/fix_gravity_omp.h b/src/OPENMP/fix_gravity_omp.h index da7187202a..688e92d466 100644 --- a/src/OPENMP/fix_gravity_omp.h +++ b/src/OPENMP/fix_gravity_omp.h @@ -28,8 +28,8 @@ class FixGravityOMP : public FixGravity { public: FixGravityOMP(class LAMMPS *, int, char **); - virtual void post_force(int); - virtual void post_force_respa(int, int, int); + void post_force(int) override; + void post_force_respa(int, int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_neigh_history_omp.h b/src/OPENMP/fix_neigh_history_omp.h index d373cff7c9..f2ba38850b 100644 --- a/src/OPENMP/fix_neigh_history_omp.h +++ b/src/OPENMP/fix_neigh_history_omp.h @@ -28,10 +28,10 @@ class FixNeighHistoryOMP : public FixNeighHistory { public: FixNeighHistoryOMP(class LAMMPS *lmp, int narg, char **argv); - void pre_exchange_onesided(); - void pre_exchange_newton(); - void pre_exchange_no_newton(); - void post_neighbor(); + void pre_exchange_onesided() override; + void pre_exchange_newton() override; + void pre_exchange_no_newton() override; + void post_neighbor() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nh_asphere_omp.h b/src/OPENMP/fix_nh_asphere_omp.h index d6332c2b03..fd39e3dce6 100644 --- a/src/OPENMP/fix_nh_asphere_omp.h +++ b/src/OPENMP/fix_nh_asphere_omp.h @@ -21,16 +21,16 @@ namespace LAMMPS_NS { class FixNHAsphereOMP : public FixNHOMP { public: FixNHAsphereOMP(class LAMMPS *, int, char **); - virtual ~FixNHAsphereOMP() {} - virtual void init(); + + void init() override; protected: double dtq; class AtomVecEllipsoid *avec; - virtual void nve_v(); - virtual void nve_x(); - virtual void nh_v_temp(); + void nve_v() override; + void nve_x() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nh_omp.h b/src/OPENMP/fix_nh_omp.h index 2c16b18987..f95bcf3e54 100644 --- a/src/OPENMP/fix_nh_omp.h +++ b/src/OPENMP/fix_nh_omp.h @@ -21,14 +21,13 @@ namespace LAMMPS_NS { class FixNHOMP : public FixNH { public: FixNHOMP(class LAMMPS *lmp, int narg, char **args) : FixNH(lmp, narg, args){}; - virtual ~FixNHOMP(){}; protected: - virtual void remap(); - virtual void nh_v_press(); - virtual void nh_v_temp(); - virtual void nve_v(); - virtual void nve_x(); + void remap() override; + void nh_v_press() override; + void nh_v_temp() override; + void nve_v() override; + void nve_x() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nh_sphere_omp.h b/src/OPENMP/fix_nh_sphere_omp.h index bbbae69bfa..3cc716450a 100644 --- a/src/OPENMP/fix_nh_sphere_omp.h +++ b/src/OPENMP/fix_nh_sphere_omp.h @@ -21,12 +21,12 @@ namespace LAMMPS_NS { class FixNHSphereOMP : public FixNHOMP { public: FixNHSphereOMP(class LAMMPS *, int, char **); - virtual ~FixNHSphereOMP() {} - virtual void init(); + + void init() override; protected: - virtual void nve_v(); - virtual void nh_v_temp(); + void nve_v() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nph_asphere_omp.h b/src/OPENMP/fix_nph_asphere_omp.h index 7cf5e817db..e2b297e26f 100644 --- a/src/OPENMP/fix_nph_asphere_omp.h +++ b/src/OPENMP/fix_nph_asphere_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHAsphereOMP : public FixNHAsphereOMP { public: FixNPHAsphereOMP(class LAMMPS *, int, char **); - virtual ~FixNPHAsphereOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nph_omp.h b/src/OPENMP/fix_nph_omp.h index 3ad206c688..f494a0e487 100644 --- a/src/OPENMP/fix_nph_omp.h +++ b/src/OPENMP/fix_nph_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHOMP : public FixNHOMP { public: FixNPHOMP(class LAMMPS *, int, char **); - ~FixNPHOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nph_sphere_omp.h b/src/OPENMP/fix_nph_sphere_omp.h index fec448374f..26ec718abb 100644 --- a/src/OPENMP/fix_nph_sphere_omp.h +++ b/src/OPENMP/fix_nph_sphere_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHSphereOMP : public FixNHSphereOMP { public: FixNPHSphereOMP(class LAMMPS *, int, char **); - virtual ~FixNPHSphereOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_npt_asphere_omp.h b/src/OPENMP/fix_npt_asphere_omp.h index 17827c941a..e125d7d707 100644 --- a/src/OPENMP/fix_npt_asphere_omp.h +++ b/src/OPENMP/fix_npt_asphere_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTAsphereOMP : public FixNHAsphereOMP { public: FixNPTAsphereOMP(class LAMMPS *, int, char **); - virtual ~FixNPTAsphereOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_npt_omp.h b/src/OPENMP/fix_npt_omp.h index e6abd4a71c..a726f12313 100644 --- a/src/OPENMP/fix_npt_omp.h +++ b/src/OPENMP/fix_npt_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTOMP : public FixNHOMP { public: FixNPTOMP(class LAMMPS *, int, char **); - ~FixNPTOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_npt_sphere_omp.h b/src/OPENMP/fix_npt_sphere_omp.h index bdd7438418..d806b9ccaf 100644 --- a/src/OPENMP/fix_npt_sphere_omp.h +++ b/src/OPENMP/fix_npt_sphere_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTSphereOMP : public FixNHSphereOMP { public: FixNPTSphereOMP(class LAMMPS *, int, char **); - virtual ~FixNPTSphereOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nve_omp.h b/src/OPENMP/fix_nve_omp.h index 8ad347a00e..47722f0078 100644 --- a/src/OPENMP/fix_nve_omp.h +++ b/src/OPENMP/fix_nve_omp.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixNVEOMP : public FixNVE { public: FixNVEOMP(class LAMMPS *, int, char **); - virtual ~FixNVEOMP() {} - virtual void initial_integrate(int); - virtual void final_integrate(); + + void initial_integrate(int) override; + void final_integrate() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nve_sphere_omp.h b/src/OPENMP/fix_nve_sphere_omp.h index 60b3bd4e49..647668c440 100644 --- a/src/OPENMP/fix_nve_sphere_omp.h +++ b/src/OPENMP/fix_nve_sphere_omp.h @@ -28,8 +28,8 @@ class FixNVESphereOMP : public FixNVESphere { public: FixNVESphereOMP(class LAMMPS *lmp, int narg, char **arg) : FixNVESphere(lmp, narg, arg){}; - virtual void initial_integrate(int); - virtual void final_integrate(); + void initial_integrate(int) override; + void final_integrate() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nvt_asphere_omp.h b/src/OPENMP/fix_nvt_asphere_omp.h index 1e1e5c3198..78104e9800 100644 --- a/src/OPENMP/fix_nvt_asphere_omp.h +++ b/src/OPENMP/fix_nvt_asphere_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTAsphereOMP : public FixNHAsphereOMP { public: FixNVTAsphereOMP(class LAMMPS *, int, char **); - virtual ~FixNVTAsphereOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nvt_omp.h b/src/OPENMP/fix_nvt_omp.h index 94f05d0bcd..4b67a52c3d 100644 --- a/src/OPENMP/fix_nvt_omp.h +++ b/src/OPENMP/fix_nvt_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTOMP : public FixNHOMP { public: FixNVTOMP(class LAMMPS *, int, char **); - ~FixNVTOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nvt_sllod_omp.h b/src/OPENMP/fix_nvt_sllod_omp.h index b24c698c7a..d93941a9a9 100644 --- a/src/OPENMP/fix_nvt_sllod_omp.h +++ b/src/OPENMP/fix_nvt_sllod_omp.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class FixNVTSllodOMP : public FixNHOMP { public: FixNVTSllodOMP(class LAMMPS *, int, char **); - virtual ~FixNVTSllodOMP() {} - virtual void init(); + void init() override; private: int nondeformbias; - virtual void nh_v_temp(); + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_nvt_sphere_omp.h b/src/OPENMP/fix_nvt_sphere_omp.h index 08f93740eb..d436017507 100644 --- a/src/OPENMP/fix_nvt_sphere_omp.h +++ b/src/OPENMP/fix_nvt_sphere_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTSphereOMP : public FixNHSphereOMP { public: FixNVTSphereOMP(class LAMMPS *, int, char **); - virtual ~FixNVTSphereOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_omp.h b/src/OPENMP/fix_omp.h index 3f62cb7876..af57abc85c 100644 --- a/src/OPENMP/fix_omp.h +++ b/src/OPENMP/fix_omp.h @@ -32,20 +32,20 @@ class FixOMP : public Fix { public: FixOMP(class LAMMPS *, int, char **); - virtual ~FixOMP(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void min_setup(int flag) { setup(flag); } - virtual void pre_force(int); + ~FixOMP() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int flag) override { setup(flag); } + void pre_force(int) override; - virtual void setup_pre_force(int vflag) { pre_force(vflag); } + void setup_pre_force(int vflag) override { pre_force(vflag); } virtual void min_setup_pre_force(int vflag) { pre_force(vflag); } - virtual void min_pre_force(int vflag) { pre_force(vflag); } - virtual void setup_pre_force_respa(int vflag, int) { pre_force(vflag); } - virtual void pre_force_respa(int vflag, int, int) { pre_force(vflag); } + void min_pre_force(int vflag) override { pre_force(vflag); } + void setup_pre_force_respa(int vflag, int) override { pre_force(vflag); } + void pre_force_respa(int vflag, int, int) override { pre_force(vflag); } - virtual double memory_usage(); + double memory_usage() override; protected: ThrData **thr; diff --git a/src/OPENMP/fix_peri_neigh_omp.h b/src/OPENMP/fix_peri_neigh_omp.h index c7d4a6be57..1c52132b1c 100644 --- a/src/OPENMP/fix_peri_neigh_omp.h +++ b/src/OPENMP/fix_peri_neigh_omp.h @@ -28,7 +28,7 @@ class FixPeriNeighOMP : public FixPeriNeigh { public: FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) : FixPeriNeigh(lmp, narg, argv){}; - virtual void init(); + void init() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_qeq_comb_omp.h b/src/OPENMP/fix_qeq_comb_omp.h index e7de0d4fa5..2f7188b5e9 100644 --- a/src/OPENMP/fix_qeq_comb_omp.h +++ b/src/OPENMP/fix_qeq_comb_omp.h @@ -22,8 +22,8 @@ namespace LAMMPS_NS { class FixQEQCombOMP : public FixQEQComb { public: FixQEQCombOMP(class LAMMPS *, int, char **); - virtual void init(); - virtual void post_force(int); + void init() override; + void post_force(int) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_qeq_reaxff_omp.h b/src/OPENMP/fix_qeq_reaxff_omp.h index b99034edf0..20bcbdda29 100644 --- a/src/OPENMP/fix_qeq_reaxff_omp.h +++ b/src/OPENMP/fix_qeq_reaxff_omp.h @@ -29,11 +29,11 @@ class FixQEqReaxFFOMP : public FixQEqReaxFF { public: FixQEqReaxFFOMP(class LAMMPS *, int, char **); - ~FixQEqReaxFFOMP(); - virtual void init(); - virtual void init_storage(); - virtual void pre_force(int); - virtual void post_constructor(); + ~FixQEqReaxFFOMP() override; + void init() override; + void init_storage() override; + void pre_force(int) override; + void post_constructor() override; protected: double **b_temp; @@ -43,17 +43,17 @@ class FixQEqReaxFFOMP : public FixQEqReaxFF { double aspc_omega; double *aspc_b; - virtual void allocate_storage(); - virtual void deallocate_storage(); - virtual void init_matvec(); - virtual void compute_H(); + void allocate_storage() override; + void deallocate_storage() override; + void init_matvec() override; + void compute_H() override; - virtual int CG(double *, double *); - virtual void sparse_matvec(sparse_matrix *, double *, double *); - virtual void calculate_Q(); + int CG(double *, double *) override; + void sparse_matvec(sparse_matrix *, double *, double *) override; + void calculate_Q() override; - virtual void vector_sum(double *, double, double *, double, double *, int); - virtual void vector_add(double *, double, double *, int); + void vector_sum(double *, double, double *, double, double *, int) override; + void vector_add(double *, double, double *, int) override; // dual CG support virtual int dual_CG(double *, double *, double *, double *); diff --git a/src/OPENMP/fix_rigid_nh_omp.h b/src/OPENMP/fix_rigid_nh_omp.h index d923257e2f..ce6309213b 100644 --- a/src/OPENMP/fix_rigid_nh_omp.h +++ b/src/OPENMP/fix_rigid_nh_omp.h @@ -21,10 +21,9 @@ namespace LAMMPS_NS { class FixRigidNHOMP : public FixRigidNH { public: FixRigidNHOMP(class LAMMPS *lmp, int narg, char **args) : FixRigidNH(lmp, narg, args) {} - virtual ~FixRigidNHOMP() {} - virtual void initial_integrate(int); - virtual void final_integrate(); + void initial_integrate(int) override; + void final_integrate() override; virtual void remap(); protected: diff --git a/src/OPENMP/fix_rigid_nph_omp.h b/src/OPENMP/fix_rigid_nph_omp.h index e0ac1a2156..b02134df21 100644 --- a/src/OPENMP/fix_rigid_nph_omp.h +++ b/src/OPENMP/fix_rigid_nph_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNPHOMP : public FixRigidNHOMP { public: FixRigidNPHOMP(class LAMMPS *, int, char **); - ~FixRigidNPHOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_rigid_npt_omp.h b/src/OPENMP/fix_rigid_npt_omp.h index 9e6487fac7..8d329d097d 100644 --- a/src/OPENMP/fix_rigid_npt_omp.h +++ b/src/OPENMP/fix_rigid_npt_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNPTOMP : public FixRigidNHOMP { public: FixRigidNPTOMP(class LAMMPS *, int, char **); - ~FixRigidNPTOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_rigid_nve_omp.h b/src/OPENMP/fix_rigid_nve_omp.h index e3276b9974..a9c1dfeaf4 100644 --- a/src/OPENMP/fix_rigid_nve_omp.h +++ b/src/OPENMP/fix_rigid_nve_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNVEOMP : public FixRigidNHOMP { public: FixRigidNVEOMP(class LAMMPS *, int, char **); - ~FixRigidNVEOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_rigid_nvt_omp.h b/src/OPENMP/fix_rigid_nvt_omp.h index 06e71b7de5..f3ee9bcbbc 100644 --- a/src/OPENMP/fix_rigid_nvt_omp.h +++ b/src/OPENMP/fix_rigid_nvt_omp.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNVTOMP : public FixRigidNHOMP { public: FixRigidNVTOMP(class LAMMPS *, int, char **); - ~FixRigidNVTOMP() {} }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/fix_rigid_omp.h b/src/OPENMP/fix_rigid_omp.h index 8b7354642c..657ae681ec 100644 --- a/src/OPENMP/fix_rigid_omp.h +++ b/src/OPENMP/fix_rigid_omp.h @@ -27,10 +27,9 @@ namespace LAMMPS_NS { class FixRigidOMP : public FixRigid { public: FixRigidOMP(class LAMMPS *lmp, int narg, char **args) : FixRigid(lmp, narg, args) {} - ~FixRigidOMP() {} - virtual void initial_integrate(int); - virtual void final_integrate(); + void initial_integrate(int) override; + void final_integrate() override; protected: virtual void compute_forces_and_torques(); diff --git a/src/OPENMP/fix_rigid_small_omp.h b/src/OPENMP/fix_rigid_small_omp.h index 82b0d1b8cd..f318f6cf21 100644 --- a/src/OPENMP/fix_rigid_small_omp.h +++ b/src/OPENMP/fix_rigid_small_omp.h @@ -31,10 +31,9 @@ class FixRigidSmallOMP : public FixRigidSmall { { centroidstressflag = CENTROID_NOTAVAIL; } - virtual ~FixRigidSmallOMP(){}; - virtual void initial_integrate(int); - virtual void final_integrate(); + void initial_integrate(int) override; + void final_integrate() override; protected: virtual void compute_forces_and_torques(); diff --git a/src/ORIENT/fix_orient_bcc.h b/src/ORIENT/fix_orient_bcc.h index 7483cd457f..4a58ae0130 100644 --- a/src/ORIENT/fix_orient_bcc.h +++ b/src/ORIENT/fix_orient_bcc.h @@ -44,17 +44,17 @@ class FixOrientBCC : public Fix { }; FixOrientBCC(class LAMMPS *, int, char **); - ~FixOrientBCC(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~FixOrientBCC() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_scalar() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: int me; diff --git a/src/ORIENT/fix_orient_eco.h b/src/ORIENT/fix_orient_eco.h index d8e593a0ea..ca9fa31d7d 100644 --- a/src/ORIENT/fix_orient_eco.h +++ b/src/ORIENT/fix_orient_eco.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixOrientECO : public Fix { public: FixOrientECO(class LAMMPS *, int, char **); - ~FixOrientECO(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~FixOrientECO() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_scalar() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: struct Nbr; // forward declaration. private struct for managing precomputed terms diff --git a/src/ORIENT/fix_orient_fcc.h b/src/ORIENT/fix_orient_fcc.h index 0c4c2433e5..a38c57daa1 100644 --- a/src/ORIENT/fix_orient_fcc.h +++ b/src/ORIENT/fix_orient_fcc.h @@ -44,17 +44,17 @@ class FixOrientFCC : public Fix { }; FixOrientFCC(class LAMMPS *, int, char **); - ~FixOrientFCC(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + ~FixOrientFCC() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_scalar() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; private: int me; diff --git a/src/PERI/fix_peri_neigh.h b/src/PERI/fix_peri_neigh.h index bde8f3f2da..1ead6a0f97 100644 --- a/src/PERI/fix_peri_neigh.h +++ b/src/PERI/fix_peri_neigh.h @@ -37,26 +37,26 @@ class FixPeriNeigh : public Fix { public: FixPeriNeigh(class LAMMPS *, int, char **); - virtual ~FixPeriNeigh(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void min_setup(int); + ~FixPeriNeigh() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void min_setup(int) override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - void write_restart(FILE *); - void restart(char *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + void write_restart(FILE *) override; + void restart(char *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: int first; // flag for first time initialization diff --git a/src/PHONON/fix_phonon.h b/src/PHONON/fix_phonon.h index 0e3c251528..d61a9d2e03 100644 --- a/src/PHONON/fix_phonon.h +++ b/src/PHONON/fix_phonon.h @@ -49,15 +49,15 @@ namespace LAMMPS_NS { class FixPhonon : public Fix { public: FixPhonon(class LAMMPS *, int, char **); - ~FixPhonon(); + ~FixPhonon() override; - int setmask(); - void init(); - void setup(int); - void end_of_step(); - void post_run(); - double memory_usage(); - int modify_param(int, char **); + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + void post_run() override; + double memory_usage() override; + int modify_param(int, char **) override; private: int me, nprocs; diff --git a/src/QEQ/fix_qeq.h b/src/QEQ/fix_qeq.h index bd25628508..cf1d40ae13 100644 --- a/src/QEQ/fix_qeq.h +++ b/src/QEQ/fix_qeq.h @@ -27,30 +27,30 @@ namespace LAMMPS_NS { class FixQEq : public Fix { public: FixQEq(class LAMMPS *, int, char **); - ~FixQEq(); - int setmask(); - void init_list(int, class NeighList *); - void setup_pre_force(int); - void setup_pre_force_respa(int, int); - void pre_force_respa(int, int, int); - void min_pre_force(int); + ~FixQEq() override; + int setmask() override; + void init_list(int, class NeighList *) override; + void setup_pre_force(int) override; + void setup_pre_force_respa(int, int) override; + void pre_force_respa(int, int, int) override; + void min_pre_force(int) override; - virtual double compute_scalar(); + double compute_scalar() override; // derived child classes must provide these functions - virtual void init(); - virtual void pre_force(int) = 0; + void init() override; + void pre_force(int) override = 0; - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - virtual int pack_reverse_comm(int, int, double *); - virtual void unpack_reverse_comm(int, int *, double *); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + double memory_usage() override; protected: int nevery; diff --git a/src/QEQ/fix_qeq_dynamic.h b/src/QEQ/fix_qeq_dynamic.h index 2ae4ea907b..3a28d10af3 100644 --- a/src/QEQ/fix_qeq_dynamic.h +++ b/src/QEQ/fix_qeq_dynamic.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixQEqDynamic : public FixQEq { public: FixQEqDynamic(class LAMMPS *, int, char **); - ~FixQEqDynamic() {} - void init(); - void pre_force(int); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + void init() override; + void pre_force(int) override; + + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; private: double compute_eneg(); diff --git a/src/QEQ/fix_qeq_fire.h b/src/QEQ/fix_qeq_fire.h index fb910129dc..f331100c15 100644 --- a/src/QEQ/fix_qeq_fire.h +++ b/src/QEQ/fix_qeq_fire.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixQEqFire : public FixQEq { public: FixQEqFire(class LAMMPS *, int, char **); - ~FixQEqFire() {} - void init(); - void pre_force(int); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + void init() override; + void pre_force(int) override; + + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; private: double compute_eneg(); diff --git a/src/QEQ/fix_qeq_point.h b/src/QEQ/fix_qeq_point.h index a680a9416d..2576c6c164 100644 --- a/src/QEQ/fix_qeq_point.h +++ b/src/QEQ/fix_qeq_point.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixQEqPoint : public FixQEq { public: FixQEqPoint(class LAMMPS *, int, char **); - ~FixQEqPoint() {} - void init(); - void pre_force(int); + + void init() override; + void pre_force(int) override; private: void init_matvec(); diff --git a/src/QEQ/fix_qeq_shielded.h b/src/QEQ/fix_qeq_shielded.h index 4d8d3c1395..5a676370e1 100644 --- a/src/QEQ/fix_qeq_shielded.h +++ b/src/QEQ/fix_qeq_shielded.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixQEqShielded : public FixQEq { public: FixQEqShielded(class LAMMPS *, int, char **); - ~FixQEqShielded() {} - void init(); - void pre_force(int); + + void init() override; + void pre_force(int) override; private: void extract_reax(); diff --git a/src/QEQ/fix_qeq_slater.h b/src/QEQ/fix_qeq_slater.h index 3247b0ddd6..6dd9f10e41 100644 --- a/src/QEQ/fix_qeq_slater.h +++ b/src/QEQ/fix_qeq_slater.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixQEqSlater : public FixQEq { public: FixQEqSlater(class LAMMPS *, int, char **); - ~FixQEqSlater() {} - void init(); - void pre_force(int); + + void init() override; + void pre_force(int) override; private: void init_matvec(); - void sparse_matvec(sparse_matrix *, double *, double *); + void sparse_matvec(sparse_matrix *, double *, double *) override; void compute_H(); double calculate_H(double, double, double, double, double &); double calculate_H_wolf(double, double, double, double, double &); diff --git a/src/QTB/fix_qbmsst.h b/src/QTB/fix_qbmsst.h index 819bbd63a3..c3830b0c35 100644 --- a/src/QTB/fix_qbmsst.h +++ b/src/QTB/fix_qbmsst.h @@ -32,22 +32,22 @@ namespace LAMMPS_NS { class FixQBMSST : public Fix { public: FixQBMSST(class LAMMPS *, int, char **); - ~FixQBMSST(); - int setmask(); - void init(); - void setup(int); - void initial_integrate(int); - void final_integrate(); - double compute_scalar(); - double compute_vector(int); - void write_restart(FILE *); - void restart(char *); - int modify_param(int, char **); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + ~FixQBMSST() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + double compute_scalar() override; + double compute_vector(int) override; + void write_restart(FILE *) override; + void restart(char *) override; + int modify_param(int, char **) override; + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: // msst parameters diff --git a/src/QTB/fix_qtb.h b/src/QTB/fix_qtb.h index 1f52e9f4b0..1ee939a68e 100644 --- a/src/QTB/fix_qtb.h +++ b/src/QTB/fix_qtb.h @@ -32,18 +32,18 @@ namespace LAMMPS_NS { class FixQTB : public Fix { public: FixQTB(class LAMMPS *, int, char **); - virtual ~FixQTB(); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - int modify_param(int, char **); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + ~FixQTB() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + int modify_param(int, char **) override; + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: // qtb parameters diff --git a/src/REACTION/fix_bond_react.h b/src/REACTION/fix_bond_react.h index 097133cb00..93a6f76f62 100644 --- a/src/REACTION/fix_bond_react.h +++ b/src/REACTION/fix_bond_react.h @@ -35,20 +35,20 @@ class FixBondReact : public Fix { enum { MAXCONPAR = 5 }; // max # of constraint parameters FixBondReact(class LAMMPS *, int, char **); - ~FixBondReact(); - int setmask(); - void post_constructor(); - void init(); - void init_list(int, class NeighList *); - void post_integrate(); - void post_integrate_respa(int, int); + ~FixBondReact() override; + int setmask() override; + void post_constructor() override; + void init() override; + void init_list(int, class NeighList *) override; + void post_integrate() override; + void post_integrate_respa(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double compute_vector(int); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double compute_vector(int) override; + double memory_usage() override; private: int me, nprocs; @@ -197,8 +197,8 @@ class FixBondReact : public Fix { void unlimit_bond(); void limit_bond(int); void dedup_mega_gloves(int); //dedup global mega_glove - virtual void write_restart(FILE *); - virtual void restart(char *buf); + void write_restart(FILE *) override; + void restart(char *buf) override; struct Set { int nreacts; diff --git a/src/REAXFF/fix_acks2_reaxff.h b/src/REAXFF/fix_acks2_reaxff.h index 6c4b85e23e..2d21f80fe0 100644 --- a/src/REAXFF/fix_acks2_reaxff.h +++ b/src/REAXFF/fix_acks2_reaxff.h @@ -28,11 +28,11 @@ namespace LAMMPS_NS { class FixACKS2ReaxFF : public FixQEqReaxFF { public: FixACKS2ReaxFF(class LAMMPS *, int, char **); - virtual ~FixACKS2ReaxFF(); - void post_constructor(); - virtual void init(); - void init_storage(); - virtual void pre_force(int); + ~FixACKS2ReaxFF() override; + void post_constructor() override; + void init() override; + void init_storage() override; + void pre_force(int) override; double *get_s() { return s; } @@ -49,39 +49,39 @@ class FixACKS2ReaxFF : public FixQEqReaxFF { //BiCGStab storage double *g, *q_hat, *r_hat, *y, *z; - void pertype_parameters(char *); + void pertype_parameters(char *) override; void init_bondcut(); - void allocate_storage(); - void deallocate_storage(); - void allocate_matrix(); - void deallocate_matrix(); + void allocate_storage() override; + void deallocate_storage() override; + void allocate_matrix() override; + void deallocate_matrix() override; - void init_matvec(); + void init_matvec() override; void compute_X(); double calculate_X(double, double); - void calculate_Q(); + void calculate_Q() override; int BiCGStab(double *, double *); void sparse_matvec_acks2(sparse_matrix *, sparse_matrix *, double *, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; void more_forward_comm(double *); void more_reverse_comm(double *); - double memory_usage(); - virtual void grow_arrays(int); - virtual void copy_arrays(int, int, int); - virtual int pack_exchange(int, double *); - virtual int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; - double parallel_norm(double *, int); - double parallel_dot(double *, double *, int); - double parallel_vector_acc(double *, int); + double parallel_norm(double *, int) override; + double parallel_dot(double *, double *, int) override; + double parallel_vector_acc(double *, int) override; - void vector_sum(double *, double, double *, double, double *, int); - void vector_add(double *, double, double *, int); + void vector_sum(double *, double, double *, double, double *, int) override; + void vector_add(double *, double, double *, int) override; void vector_copy(double *, double *, int); }; diff --git a/src/REAXFF/fix_qeq_reaxff.h b/src/REAXFF/fix_qeq_reaxff.h index ac54ff72ca..5ebb410a10 100644 --- a/src/REAXFF/fix_qeq_reaxff.h +++ b/src/REAXFF/fix_qeq_reaxff.h @@ -39,22 +39,22 @@ namespace LAMMPS_NS { class FixQEqReaxFF : public Fix { public: FixQEqReaxFF(class LAMMPS *, int, char **); - ~FixQEqReaxFF(); - int setmask(); - virtual void post_constructor(); - virtual void init(); - void init_list(int, class NeighList *); + ~FixQEqReaxFF() override; + int setmask() override; + void post_constructor() override; + void init() override; + void init_list(int, class NeighList *) override; virtual void init_storage(); - virtual void setup_pre_force(int); - virtual void pre_force(int); + void setup_pre_force(int) override; + void pre_force(int) override; - void setup_pre_force_respa(int, int); - void pre_force_respa(int, int, int); + void setup_pre_force_respa(int, int) override; + void pre_force_respa(int, int, int) override; void min_setup_pre_force(int); - void min_pre_force(int); + void min_pre_force(int) override; - virtual double compute_scalar(); + double compute_scalar() override; protected: int nevery, reaxflag; @@ -119,15 +119,15 @@ class FixQEqReaxFF : public Fix { virtual int CG(double *, double *); virtual void sparse_matvec(sparse_matrix *, double *, double *); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - virtual int pack_reverse_comm(int, int, double *); - virtual void unpack_reverse_comm(int, int *, double *); - virtual double memory_usage(); - virtual void grow_arrays(int); - virtual void copy_arrays(int, int, int); - virtual int pack_exchange(int, double *); - virtual int unpack_exchange(int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; virtual double parallel_norm(double *, int); virtual double parallel_dot(double *, double *, int); diff --git a/src/REAXFF/fix_reaxff.h b/src/REAXFF/fix_reaxff.h index 165be197be..650b75c9d8 100644 --- a/src/REAXFF/fix_reaxff.h +++ b/src/REAXFF/fix_reaxff.h @@ -41,16 +41,16 @@ class FixReaxFF : public Fix { public: FixReaxFF(class LAMMPS *, int, char **); - ~FixReaxFF(); - int setmask(); + ~FixReaxFF() override; + int setmask() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; private: int maxbonds; // max # of bonds for any atom diff --git a/src/REAXFF/fix_reaxff_bonds.h b/src/REAXFF/fix_reaxff_bonds.h index 4c40017e43..7443db8658 100644 --- a/src/REAXFF/fix_reaxff_bonds.h +++ b/src/REAXFF/fix_reaxff_bonds.h @@ -29,11 +29,11 @@ namespace LAMMPS_NS { class FixReaxFFBonds : public Fix { public: FixReaxFFBonds(class LAMMPS *, int, char **); - virtual ~FixReaxFFBonds(); - int setmask(); - virtual void init(); - void setup(int); - void end_of_step(); + ~FixReaxFFBonds() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; protected: int me, nprocs, nmax, ntypes, maxsize, compressed; @@ -49,7 +49,7 @@ class FixReaxFFBonds : public Fix { void PassBuffer(double *, int &); void RecvBuffer(double *, int, int, int, int); int nint(const double &); - virtual double memory_usage(); + double memory_usage() override; bigint nvalid, nextvalid(); struct _reax_list *lists; diff --git a/src/REAXFF/fix_reaxff_species.h b/src/REAXFF/fix_reaxff_species.h index ca5e0e512d..f441c3bc92 100644 --- a/src/REAXFF/fix_reaxff_species.h +++ b/src/REAXFF/fix_reaxff_species.h @@ -35,13 +35,13 @@ typedef struct { class FixReaxFFSpecies : public Fix { public: FixReaxFFSpecies(class LAMMPS *, int, char **); - virtual ~FixReaxFFSpecies(); - int setmask(); - virtual void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_integrate(); - double compute_vector(int); + ~FixReaxFFSpecies() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup(int) override; + void post_integrate() override; + double compute_vector(int) override; protected: int me, nprocs, nmax, nlocal, ntypes, ntotal; @@ -68,11 +68,11 @@ class FixReaxFFSpecies : public Fix { int CheckExistence(int, int); int nint(const double &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; void OpenPos(); void WritePos(int, int); - double memory_usage(); + double memory_usage() override; bigint nvalid; diff --git a/src/REPLICA/fix_event.h b/src/REPLICA/fix_event.h index 963b505c85..d131d7eed2 100644 --- a/src/REPLICA/fix_event.h +++ b/src/REPLICA/fix_event.h @@ -21,16 +21,16 @@ namespace LAMMPS_NS { class FixEvent : public Fix { public: FixEvent(class LAMMPS *, int, char **); - virtual ~FixEvent() = 0; // use destructor to make base class virtual - int setmask(); + ~FixEvent() override = 0; // use destructor to make base class virtual + int setmask() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - virtual void write_restart(FILE *) {} - virtual void restart(char *) {} + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + void write_restart(FILE *) override {} + void restart(char *) override {} // methods specific to FixEvent diff --git a/src/REPLICA/fix_event_hyper.h b/src/REPLICA/fix_event_hyper.h index b86e448775..2bcb6a8218 100644 --- a/src/REPLICA/fix_event_hyper.h +++ b/src/REPLICA/fix_event_hyper.h @@ -34,10 +34,9 @@ class FixEventHyper : public FixEvent { int ncoincident; // # of simultaneous events on different replicas FixEventHyper(class LAMMPS *, int, char **); - ~FixEventHyper() {} - void write_restart(FILE *); - void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; // methods specific to FixEventHyper, invoked by hyper diff --git a/src/REPLICA/fix_event_prd.h b/src/REPLICA/fix_event_prd.h index a5ed2418da..6ed8521a81 100644 --- a/src/REPLICA/fix_event_prd.h +++ b/src/REPLICA/fix_event_prd.h @@ -34,10 +34,9 @@ class FixEventPRD : public FixEvent { int ncoincident; // # of simultaneous events on different replicas FixEventPRD(class LAMMPS *, int, char **); - ~FixEventPRD() {} - void write_restart(FILE *); - void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; // methods specific to FixEventPRD, invoked by PRD diff --git a/src/REPLICA/fix_event_tad.h b/src/REPLICA/fix_event_tad.h index 88f27c20e9..2b44ce45f0 100644 --- a/src/REPLICA/fix_event_tad.h +++ b/src/REPLICA/fix_event_tad.h @@ -32,10 +32,9 @@ class FixEventTAD : public FixEvent { double ebarrier; // energy barrier for this event FixEventTAD(class LAMMPS *, int, char **); - ~FixEventTAD() {} - void write_restart(FILE *); - void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; // methods specific to FixEventTAD, invoked by TAD diff --git a/src/REPLICA/fix_grem.h b/src/REPLICA/fix_grem.h index 71dd5d939d..cd7f0b35b3 100644 --- a/src/REPLICA/fix_grem.h +++ b/src/REPLICA/fix_grem.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixGrem : public Fix { public: FixGrem(class LAMMPS *, int, char **); - ~FixGrem(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void *extract(const char *, int &); - double compute_scalar(); + ~FixGrem() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void *extract(const char *, int &) override; + double compute_scalar() override; double scale_grem, lambda, eta, h0; int pressflag; diff --git a/src/REPLICA/fix_hyper.h b/src/REPLICA/fix_hyper.h index 64552b18c6..b6b35ff031 100644 --- a/src/REPLICA/fix_hyper.h +++ b/src/REPLICA/fix_hyper.h @@ -23,8 +23,7 @@ class FixHyper : public Fix { bigint ntimestep_initial; FixHyper(class LAMMPS *, int, char **); - virtual ~FixHyper() {} - void *extract(const char *, int &); + void *extract(const char *, int &) override; // must be provided by child class diff --git a/src/REPLICA/fix_hyper_global.h b/src/REPLICA/fix_hyper_global.h index 4b9f2886cd..0273c4ce63 100644 --- a/src/REPLICA/fix_hyper_global.h +++ b/src/REPLICA/fix_hyper_global.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class FixHyperGlobal : public FixHyper { public: FixHyperGlobal(class LAMMPS *, int, char **); - ~FixHyperGlobal(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup_pre_neighbor(); - void setup_pre_reverse(int, int); - void pre_neighbor(); - void pre_reverse(int, int); - double compute_scalar(); - double compute_vector(int); - double query(int); + ~FixHyperGlobal() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup_pre_neighbor() override; + void setup_pre_reverse(int, int) override; + void pre_neighbor() override; + void pre_reverse(int, int) override; + double compute_scalar() override; + double compute_vector(int) override; + double query(int) override; - double memory_usage(); + double memory_usage() override; // extra methods visible to callers - void init_hyper(); - void build_bond_list(int); + void init_hyper() override; + void build_bond_list(int) override; private: int me; diff --git a/src/REPLICA/fix_hyper_local.h b/src/REPLICA/fix_hyper_local.h index 91a594fc64..ace74c7eec 100644 --- a/src/REPLICA/fix_hyper_local.h +++ b/src/REPLICA/fix_hyper_local.h @@ -29,31 +29,31 @@ struct HyperOneCoeff; class FixHyperLocal : public FixHyper { public: FixHyperLocal(class LAMMPS *, int, char **); - ~FixHyperLocal(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup_pre_neighbor(); - void setup_pre_reverse(int, int); - void pre_neighbor(); - void pre_reverse(int, int); - void min_pre_neighbor(); - double compute_scalar(); - double compute_vector(int); - double query(int); + ~FixHyperLocal() override; + int setmask() override; + void init() override; + void init_list(int, class NeighList *) override; + void setup_pre_neighbor() override; + void setup_pre_reverse(int, int) override; + void pre_neighbor() override; + void pre_reverse(int, int) override; + void min_pre_neighbor() override; + double compute_scalar() override; + double compute_vector(int) override; + double query(int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - int pack_reverse_comm_size(int, int); - void unpack_reverse_comm(int, int *, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + int pack_reverse_comm_size(int, int) override; + void unpack_reverse_comm(int, int *, double *) override; - double memory_usage(); + double memory_usage() override; // extra methods visible to callers - void init_hyper(); - void build_bond_list(int); + void init_hyper() override; + void build_bond_list(int) override; private: int me; diff --git a/src/REPLICA/fix_neb.h b/src/REPLICA/fix_neb.h index 3bdec0414f..5c9930d73f 100644 --- a/src/REPLICA/fix_neb.h +++ b/src/REPLICA/fix_neb.h @@ -30,11 +30,11 @@ class FixNEB : public Fix { int rclimber; FixNEB(class LAMMPS *, int, char **); - ~FixNEB(); - int setmask(); - void init(); - void min_setup(int); - void min_post_force(int); + ~FixNEB() override; + int setmask() override; + void init() override; + void min_setup(int) override; + void min_post_force(int) override; private: int me, nprocs, nprocs_universe; diff --git a/src/REPLICA/fix_pimd.h b/src/REPLICA/fix_pimd.h index 05a24dedce..ad3c7d31b0 100644 --- a/src/REPLICA/fix_pimd.h +++ b/src/REPLICA/fix_pimd.h @@ -27,29 +27,29 @@ namespace LAMMPS_NS { class FixPIMD : public Fix { public: FixPIMD(class LAMMPS *, int, char **); - virtual ~FixPIMD(); + ~FixPIMD() override; - int setmask(); + int setmask() override; - void init(); - void setup(int); - void post_force(int); - void initial_integrate(int); - void final_integrate(); + void init() override; + void setup(int) override; + void post_force(int) override; + void initial_integrate(int) override; + void final_integrate() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int maxsize_restart(); - int size_restart(int); - double compute_vector(int); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int maxsize_restart() override; + int size_restart(int) override; + double compute_vector(int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; int method; int np; diff --git a/src/RIGID/fix_ehex.h b/src/RIGID/fix_ehex.h index 32ff1b9560..f4ea872533 100644 --- a/src/RIGID/fix_ehex.h +++ b/src/RIGID/fix_ehex.h @@ -29,17 +29,17 @@ class FixEHEX : public Fix { public: FixEHEX(class LAMMPS *, int, char **); - ~FixEHEX(); - int setmask(); - void init(); - void end_of_step(); + ~FixEHEX() override; + int setmask() override; + void init() override; + void end_of_step() override; void rescale(); - double compute_scalar(); - double memory_usage(); + double compute_scalar() override; + double memory_usage() override; void update_scalingmask(); void com_properties(double *, double *, double *, double *, double *, double *); bool rescale_atom(int i, class Region *region); - virtual void grow_arrays(int nmax); + void grow_arrays(int nmax) override; bool check_cluster(tagint *shake_atom, int n, class Region *region); private: diff --git a/src/RIGID/fix_rattle.h b/src/RIGID/fix_rattle.h index d8bcec753c..937a2e1233 100644 --- a/src/RIGID/fix_rattle.h +++ b/src/RIGID/fix_rattle.h @@ -32,23 +32,23 @@ class FixRattle : public FixShake { double verr_max; // velocity error FixRattle(class LAMMPS *, int, char **); - ~FixRattle(); - int setmask(); - virtual void init(); - virtual void post_force(int); - virtual void post_force_respa(int, int, int); - virtual void final_integrate(); - virtual void final_integrate_respa(int, int); + ~FixRattle() override; + int setmask() override; + void init() override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void final_integrate() override; + void final_integrate_respa(int, int) override; - virtual void correct_coordinates(int vflag); - virtual void correct_velocities(); - virtual void shake_end_of_step(int vflag); + void correct_coordinates(int vflag) override; + void correct_velocities() override; + void shake_end_of_step(int vflag) override; - virtual double memory_usage(); - virtual void grow_arrays(int); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - virtual void reset_dt(); + double memory_usage() override; + void grow_arrays(int) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + void reset_dt() override; private: void update_v_half_nocons(); @@ -68,7 +68,7 @@ class FixRattle : public FixShake { bool check3(double **v, int m, bool checkr, bool checkv); bool check4(double **v, int m, bool checkr, bool checkv); bool check_constraints(double **v, bool checkr, bool checkv); - void end_of_step(); + void end_of_step() override; }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid.h b/src/RIGID/fix_rigid.h index 90663acc47..36ab138868 100644 --- a/src/RIGID/fix_rigid.h +++ b/src/RIGID/fix_rigid.h @@ -27,38 +27,38 @@ namespace LAMMPS_NS { class FixRigid : public Fix { public: FixRigid(class LAMMPS *, int, char **); - virtual ~FixRigid(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - void post_force(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); - void write_restart_file(const char *); - virtual double compute_scalar(); + ~FixRigid() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void post_force(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void write_restart_file(const char *) override; + double compute_scalar() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; - void setup_pre_neighbor(); - void pre_neighbor(); - int dof(int); - void deform(int); - void enforce2d(); - void reset_dt(); - void zero_momentum(); - void zero_rotation(); - virtual int modify_param(int, char **); - virtual void *extract(const char *, int &); + void setup_pre_neighbor() override; + void pre_neighbor() override; + int dof(int) override; + void deform(int) override; + void enforce2d() override; + void reset_dt() override; + void zero_momentum() override; + void zero_rotation() override; + int modify_param(int, char **) override; + void *extract(const char *, int &) override; double extract_ke(); double extract_erotational(); - double compute_array(int, int); + double compute_array(int, int) override; protected: int me, nprocs; diff --git a/src/RIGID/fix_rigid_nh.h b/src/RIGID/fix_rigid_nh.h index 0335eecabf..88f27126ef 100644 --- a/src/RIGID/fix_rigid_nh.h +++ b/src/RIGID/fix_rigid_nh.h @@ -21,17 +21,17 @@ namespace LAMMPS_NS { class FixRigidNH : public FixRigid { public: FixRigidNH(class LAMMPS *, int, char **); - virtual ~FixRigidNH(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual double compute_scalar(); - int modify_param(int, char **); - void write_restart(FILE *); - void restart(char *buf); - void reset_target(double); + ~FixRigidNH() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + double compute_scalar() override; + int modify_param(int, char **) override; + void write_restart(FILE *) override; + void restart(char *buf) override; + void reset_target(double) override; protected: double **conjqm; // conjugate quaternion momentum diff --git a/src/RIGID/fix_rigid_nh_small.h b/src/RIGID/fix_rigid_nh_small.h index 11dae8f211..b52797f194 100644 --- a/src/RIGID/fix_rigid_nh_small.h +++ b/src/RIGID/fix_rigid_nh_small.h @@ -21,17 +21,17 @@ namespace LAMMPS_NS { class FixRigidNHSmall : public FixRigidSmall { public: FixRigidNHSmall(class LAMMPS *, int, char **); - virtual ~FixRigidNHSmall(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual double compute_scalar(); - int modify_param(int, char **); - void write_restart(FILE *); - void restart(char *buf); - void reset_target(double); + ~FixRigidNHSmall() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + double compute_scalar() override; + int modify_param(int, char **) override; + void write_restart(FILE *) override; + void restart(char *buf) override; + void reset_target(double) override; protected: double boltz, nktv2p, mvv2e; // boltzman constant, conversion factors diff --git a/src/RIGID/fix_rigid_nph.h b/src/RIGID/fix_rigid_nph.h index 4cdb61c141..0d9de7edc3 100644 --- a/src/RIGID/fix_rigid_nph.h +++ b/src/RIGID/fix_rigid_nph.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNPH : public FixRigidNH { public: FixRigidNPH(class LAMMPS *, int, char **); - ~FixRigidNPH() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_nph_small.h b/src/RIGID/fix_rigid_nph_small.h index ae4d2e6466..3c7245ceae 100644 --- a/src/RIGID/fix_rigid_nph_small.h +++ b/src/RIGID/fix_rigid_nph_small.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNPHSmall : public FixRigidNHSmall { public: FixRigidNPHSmall(class LAMMPS *, int, char **); - ~FixRigidNPHSmall() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_npt.h b/src/RIGID/fix_rigid_npt.h index a4bcda5b3d..a0ba26a06d 100644 --- a/src/RIGID/fix_rigid_npt.h +++ b/src/RIGID/fix_rigid_npt.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNPT : public FixRigidNH { public: FixRigidNPT(class LAMMPS *, int, char **); - ~FixRigidNPT() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_npt_small.h b/src/RIGID/fix_rigid_npt_small.h index 24d4fda374..1d02688bab 100644 --- a/src/RIGID/fix_rigid_npt_small.h +++ b/src/RIGID/fix_rigid_npt_small.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNPTSmall : public FixRigidNHSmall { public: FixRigidNPTSmall(class LAMMPS *, int, char **); - ~FixRigidNPTSmall() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_nve.h b/src/RIGID/fix_rigid_nve.h index b05df5b606..b38203c114 100644 --- a/src/RIGID/fix_rigid_nve.h +++ b/src/RIGID/fix_rigid_nve.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNVE : public FixRigidNH { public: FixRigidNVE(class LAMMPS *, int, char **); - ~FixRigidNVE() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_nve_small.h b/src/RIGID/fix_rigid_nve_small.h index 3cc790befa..0255d1d750 100644 --- a/src/RIGID/fix_rigid_nve_small.h +++ b/src/RIGID/fix_rigid_nve_small.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNVESmall : public FixRigidNHSmall { public: FixRigidNVESmall(class LAMMPS *, int, char **); - ~FixRigidNVESmall() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_nvt.h b/src/RIGID/fix_rigid_nvt.h index 5224fd56ae..7e6bb54937 100644 --- a/src/RIGID/fix_rigid_nvt.h +++ b/src/RIGID/fix_rigid_nvt.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNVT : public FixRigidNH { public: FixRigidNVT(class LAMMPS *, int, char **); - ~FixRigidNVT() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_nvt_small.h b/src/RIGID/fix_rigid_nvt_small.h index edb781884b..0138a3a561 100644 --- a/src/RIGID/fix_rigid_nvt_small.h +++ b/src/RIGID/fix_rigid_nvt_small.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixRigidNVTSmall : public FixRigidNHSmall { public: FixRigidNVTSmall(class LAMMPS *, int, char **); - ~FixRigidNVTSmall() {} }; } // namespace LAMMPS_NS diff --git a/src/RIGID/fix_rigid_small.h b/src/RIGID/fix_rigid_small.h index e289c179d9..1b869afaa4 100644 --- a/src/RIGID/fix_rigid_small.h +++ b/src/RIGID/fix_rigid_small.h @@ -29,43 +29,43 @@ class FixRigidSmall : public Fix { public: FixRigidSmall(class LAMMPS *, int, char **); - virtual ~FixRigidSmall(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - void post_force(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); - void write_restart_file(const char *); + ~FixRigidSmall() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void post_force(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void write_restart_file(const char *) override; - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - virtual void set_molecule(int, tagint, int, double *, double *, double *); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + void set_molecule(int, tagint, int, double *, double *, double *) override; - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; - void setup_pre_neighbor(); - void pre_neighbor(); - int dof(int); - void deform(int); - void enforce2d(); - void reset_dt(); - void zero_momentum(); - void zero_rotation(); - int modify_param(int, char **); - void *extract(const char *, int &); + void setup_pre_neighbor() override; + void pre_neighbor() override; + int dof(int) override; + void deform(int) override; + void enforce2d() override; + void reset_dt() override; + void zero_momentum() override; + void zero_rotation() override; + int modify_param(int, char **) override; + void *extract(const char *, int &) override; double extract_ke(); double extract_erotational(); - double compute_scalar(); - double memory_usage(); + double compute_scalar() override; + double memory_usage() override; protected: int me, nprocs; diff --git a/src/RIGID/fix_shake.h b/src/RIGID/fix_shake.h index 3db415281d..5a956bd798 100644 --- a/src/RIGID/fix_shake.h +++ b/src/RIGID/fix_shake.h @@ -30,33 +30,33 @@ class FixShake : public Fix { public: FixShake(class LAMMPS *, int, char **); - virtual ~FixShake(); - virtual int setmask(); - virtual void init(); - void setup(int); - virtual void pre_neighbor(); - virtual void post_force(int); - virtual void post_force_respa(int, int, int); + ~FixShake() override; + int setmask() override; + void init() override; + void setup(int) override; + void pre_neighbor() override; + void post_force(int) override; + void post_force_respa(int, int, int) override; - virtual double memory_usage(); - virtual void grow_arrays(int); - virtual void copy_arrays(int, int, int); - virtual void set_arrays(int); - virtual void update_arrays(int, int); - virtual void set_molecule(int, tagint, int, double *, double *, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + void update_arrays(int, int) override; + void set_molecule(int, tagint, int, double *, double *, double *) override; - virtual int pack_exchange(int, double *); - virtual int unpack_exchange(int, double *); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; virtual void shake_end_of_step(int vflag); virtual void correct_coordinates(int vflag); virtual void correct_velocities(); - virtual int dof(int); - virtual void reset_dt(); - void *extract(const char *, int &); + int dof(int) override; + void reset_dt() override; + void *extract(const char *, int &) override; protected: int vflag_post_force; // store the vflag of last post_force call diff --git a/src/SHOCK/fix_append_atoms.h b/src/SHOCK/fix_append_atoms.h index a8ba145b97..41c14a2c20 100644 --- a/src/SHOCK/fix_append_atoms.h +++ b/src/SHOCK/fix_append_atoms.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixAppendAtoms : public Fix { public: FixAppendAtoms(class LAMMPS *, int, char **); - ~FixAppendAtoms(); - int setmask(); - void setup(int); - void pre_exchange(); - void initial_integrate(int); - void post_force(int); + ~FixAppendAtoms() override; + int setmask() override; + void setup(int) override; + void pre_exchange() override; + void initial_integrate(int) override; + void post_force(int) override; private: int get_spatial(); diff --git a/src/SHOCK/fix_msst.h b/src/SHOCK/fix_msst.h index 76bfbf6d55..98b47c60f6 100644 --- a/src/SHOCK/fix_msst.h +++ b/src/SHOCK/fix_msst.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class FixMSST : public Fix { public: FixMSST(class LAMMPS *, int, char **); - ~FixMSST(); - int setmask(); - void init(); - void setup(int); - void initial_integrate(int); - void final_integrate(); - double compute_scalar(); - double compute_vector(int); - void write_restart(FILE *); - void restart(char *); - int modify_param(int, char **); - double memory_usage(); + ~FixMSST() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + double compute_scalar() override; + double compute_vector(int) override; + void write_restart(FILE *) override; + void restart(char *) override; + int modify_param(int, char **) override; + double memory_usage() override; private: double dtv, dtf, dthalf; // full and half step sizes diff --git a/src/SHOCK/fix_nphug.h b/src/SHOCK/fix_nphug.h index 57b4dabc9c..9c67b070d3 100644 --- a/src/SHOCK/fix_nphug.h +++ b/src/SHOCK/fix_nphug.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class FixNPHug : public FixNH { public: FixNPHug(class LAMMPS *, int, char **); - ~FixNPHug(); - void init(); - void setup(int); - int modify_param(int, char **); - int pack_restart_data(double *); // pack restart data - void restart(char *); + ~FixNPHug() override; + void init() override; + void setup(int) override; + int modify_param(int, char **) override; + int pack_restart_data(double *) override; // pack restart data + void restart(char *) override; private: class Compute *pe; // PE compute pointer - void compute_temp_target(); - double compute_vector(int); + void compute_temp_target() override; + double compute_vector(int) override; double compute_etotal(); double compute_vol(); double compute_hugoniot(); @@ -52,7 +52,7 @@ class FixNPHug : public FixNH { int idir; int uniaxial; - int size_restart_global(); + int size_restart_global() override; }; } // namespace LAMMPS_NS diff --git a/src/SHOCK/fix_wall_piston.h b/src/SHOCK/fix_wall_piston.h index 5d2e02a21e..3e9f73fd94 100644 --- a/src/SHOCK/fix_wall_piston.h +++ b/src/SHOCK/fix_wall_piston.h @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixWallPiston : public Fix { public: FixWallPiston(class LAMMPS *, int, char **); - virtual ~FixWallPiston(); - int setmask(); - void post_integrate(); - void initial_integrate(int); + ~FixWallPiston() override; + int setmask() override; + void post_integrate() override; + void initial_integrate(int) override; private: int xloflag, xhiflag, yloflag, yhiflag, zloflag, zhiflag; diff --git a/src/SPH/fix_sph.h b/src/SPH/fix_sph.h index 5b3d25f666..0bb9f2f965 100644 --- a/src/SPH/fix_sph.h +++ b/src/SPH/fix_sph.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixSPH : public Fix { public: FixSPH(class LAMMPS *, int, char **); - int setmask(); - virtual void init(); - virtual void setup_pre_force(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - void reset_dt(); + int setmask() override; + void init() override; + void setup_pre_force(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; private: class NeighList *list; diff --git a/src/SPH/fix_sph_stationary.h b/src/SPH/fix_sph_stationary.h index 8dde541b0a..b558aba917 100644 --- a/src/SPH/fix_sph_stationary.h +++ b/src/SPH/fix_sph_stationary.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixSPHStationary : public Fix { public: FixSPHStationary(class LAMMPS *, int, char **); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void reset_dt() override; private: class NeighList *list; diff --git a/src/SPIN/fix_langevin_spin.h b/src/SPIN/fix_langevin_spin.h index c9608748d9..d5262fae64 100644 --- a/src/SPIN/fix_langevin_spin.h +++ b/src/SPIN/fix_langevin_spin.h @@ -29,10 +29,10 @@ class FixLangevinSpin : public Fix { int tdamp_flag, temp_flag; // damping and temperature flags FixLangevinSpin(class LAMMPS *, int, char **); - virtual ~FixLangevinSpin(); - int setmask(); - void init(); - void setup(int); + ~FixLangevinSpin() override; + int setmask() override; + void init() override; + void setup(int) override; void add_tdamping(double *, double *); // add transverse damping void add_temperature(double[3]); void compute_single_langevin(int, double *, double *); diff --git a/src/SPIN/fix_neb_spin.h b/src/SPIN/fix_neb_spin.h index 5ddef9c791..79fbdf454d 100644 --- a/src/SPIN/fix_neb_spin.h +++ b/src/SPIN/fix_neb_spin.h @@ -30,11 +30,11 @@ class FixNEBSpin : public Fix { int rclimber; FixNEBSpin(class LAMMPS *, int, char **); - ~FixNEBSpin(); - int setmask(); - void init(); - void min_setup(int); - void min_post_force(int); + ~FixNEBSpin() override; + int setmask() override; + void init() override; + void min_setup(int) override; + void min_post_force(int) override; private: int me, nprocs, nprocs_universe; diff --git a/src/SPIN/fix_nve_spin.h b/src/SPIN/fix_nve_spin.h index 718eb3a733..b468f60fc0 100644 --- a/src/SPIN/fix_nve_spin.h +++ b/src/SPIN/fix_nve_spin.h @@ -29,11 +29,11 @@ class FixNVESpin : public Fix { public: FixNVESpin(class LAMMPS *, int, char **); - virtual ~FixNVESpin(); - int setmask(); - void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); + ~FixNVESpin() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; void ComputeInteractionsSpin(int); // compute and advance single spin functions void AdvanceSingleSpin(int); @@ -41,8 +41,8 @@ class FixNVESpin : public Fix { void sectoring(); // sectoring operation functions int coords2sector(double *); - void setup_pre_neighbor(); - void pre_neighbor(); + void setup_pre_neighbor() override; + void pre_neighbor() override; int lattice_flag; // lattice_flag = 0 if spins only // lattice_flag = 1 if spin-lattice calc. diff --git a/src/SPIN/fix_precession_spin.h b/src/SPIN/fix_precession_spin.h index dafc729337..96c369b43a 100644 --- a/src/SPIN/fix_precession_spin.h +++ b/src/SPIN/fix_precession_spin.h @@ -29,15 +29,15 @@ class FixPrecessionSpin : public Fix { public: FixPrecessionSpin(class LAMMPS *, int, char **); - ~FixPrecessionSpin(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); + ~FixPrecessionSpin() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; int zeeman_flag, stt_flag, aniso_flag, cubic_flag, hexaniso_flag; void compute_single_precession(int, double *, double *); diff --git a/src/SPIN/fix_setforce_spin.h b/src/SPIN/fix_setforce_spin.h index 678a00da37..bc018e02e5 100644 --- a/src/SPIN/fix_setforce_spin.h +++ b/src/SPIN/fix_setforce_spin.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixSetForceSpin : public FixSetForce { public: FixSetForceSpin(class LAMMPS *, int, char **); - virtual void post_force(int); - void post_force_respa(int, int, int); + void post_force(int) override; + void post_force_respa(int, int, int) override; void single_setforce_spin(int, double *); }; diff --git a/src/SRD/fix_srd.h b/src/SRD/fix_srd.h index e4dd557394..e6a203cba4 100644 --- a/src/SRD/fix_srd.h +++ b/src/SRD/fix_srd.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixSRD : public Fix { public: FixSRD(class LAMMPS *, int, char **); - ~FixSRD(); - int setmask(); - void init(); - void setup(int); - void pre_neighbor(); - void post_force(int); - double compute_vector(int); + ~FixSRD() override; + int setmask() override; + void init() override; + void setup(int) override; + void pre_neighbor() override; + void post_force(int) override; + double compute_vector(int) override; - double memory_usage(); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + double memory_usage() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; private: int me, nprocs; diff --git a/src/SRD/fix_wall_srd.h b/src/SRD/fix_wall_srd.h index 81c0064721..ecd16c6e6d 100644 --- a/src/SRD/fix_wall_srd.h +++ b/src/SRD/fix_wall_srd.h @@ -32,10 +32,10 @@ class FixWallSRD : public Fix { double **fwall; FixWallSRD(class LAMMPS *, int, char **); - ~FixWallSRD(); - int setmask(); - void init(); - double compute_array(int, int); + ~FixWallSRD() override; + int setmask() override; + void init() override; + double compute_array(int, int) override; void wall_params(int); diff --git a/src/UEF/fix_npt_uef.h b/src/UEF/fix_npt_uef.h index a46b388412..565e12e19b 100644 --- a/src/UEF/fix_npt_uef.h +++ b/src/UEF/fix_npt_uef.h @@ -29,7 +29,6 @@ namespace LAMMPS_NS { class FixNPTUef : public FixNHUef { public: FixNPTUef(class LAMMPS *, int, char **); - ~FixNPTUef() {} }; } // namespace LAMMPS_NS diff --git a/src/UEF/fix_nvt_uef.h b/src/UEF/fix_nvt_uef.h index 7192aa6412..f1e7031054 100644 --- a/src/UEF/fix_nvt_uef.h +++ b/src/UEF/fix_nvt_uef.h @@ -29,7 +29,6 @@ namespace LAMMPS_NS { class FixNVTUef : public FixNHUef { public: FixNVTUef(class LAMMPS *, int, char **); - ~FixNVTUef() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_adapt.h b/src/fix_adapt.h index db3dcf269c..939f46f8a2 100644 --- a/src/fix_adapt.h +++ b/src/fix_adapt.h @@ -30,18 +30,18 @@ class FixAdapt : public Fix { int chgflag; FixAdapt(class LAMMPS *, int, char **); - ~FixAdapt(); - int setmask(); - void post_constructor(); - void init(); - void setup_pre_force(int); - void pre_force(int); - void post_run(); - void setup_pre_force_respa(int, int); - void pre_force_respa(int, int, int); - void set_arrays(int); - void write_restart(FILE *); - void restart(char *); + ~FixAdapt() override; + int setmask() override; + void post_constructor() override; + void init() override; + void setup_pre_force(int) override; + void pre_force(int) override; + void post_run() override; + void setup_pre_force_respa(int, int) override; + void pre_force_respa(int, int, int) override; + void set_arrays(int) override; + void write_restart(FILE *) override; + void restart(char *) override; private: int nadapt, resetflag, scaleflag, massflag; diff --git a/src/fix_addforce.h b/src/fix_addforce.h index 507bb26acb..a3d579c495 100644 --- a/src/fix_addforce.h +++ b/src/fix_addforce.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixAddForce : public Fix { public: FixAddForce(class LAMMPS *, int, char **); - ~FixAddForce(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); - double memory_usage(); + ~FixAddForce() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; + double memory_usage() override; private: double xvalue, yvalue, zvalue; diff --git a/src/fix_ave_atom.h b/src/fix_ave_atom.h index 0cb1ad80bc..f55f8abdd1 100644 --- a/src/fix_ave_atom.h +++ b/src/fix_ave_atom.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixAveAtom : public Fix { public: FixAveAtom(class LAMMPS *, int, char **); - ~FixAveAtom(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); + ~FixAveAtom() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: int nvalues; diff --git a/src/fix_ave_chunk.h b/src/fix_ave_chunk.h index 69fdea0f06..b0089e3871 100644 --- a/src/fix_ave_chunk.h +++ b/src/fix_ave_chunk.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixAveChunk : public Fix { public: FixAveChunk(class LAMMPS *, int, char **); - ~FixAveChunk(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - double compute_array(int, int); - double memory_usage(); + ~FixAveChunk() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_array(int, int) override; + double memory_usage() override; private: int nvalues; diff --git a/src/fix_ave_correlate.h b/src/fix_ave_correlate.h index 6dde75c0d3..46781da8c5 100644 --- a/src/fix_ave_correlate.h +++ b/src/fix_ave_correlate.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixAveCorrelate : public Fix { public: FixAveCorrelate(class LAMMPS *, int, char **); - ~FixAveCorrelate(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - double compute_array(int, int); + ~FixAveCorrelate() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_array(int, int) override; private: int me, nvalues; diff --git a/src/fix_ave_histo.h b/src/fix_ave_histo.h index ef64ad74ff..cf9f11a8e5 100644 --- a/src/fix_ave_histo.h +++ b/src/fix_ave_histo.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixAveHisto : public Fix { public: FixAveHisto(class LAMMPS *, int, char **); - virtual ~FixAveHisto(); - int setmask(); - void init(); - void setup(int); - virtual void end_of_step(); - double compute_vector(int); - double compute_array(int, int); + ~FixAveHisto() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_vector(int) override; + double compute_array(int, int) override; protected: int me, nvalues; diff --git a/src/fix_ave_histo_weight.h b/src/fix_ave_histo_weight.h index cd1d1c0465..95a96b13bb 100644 --- a/src/fix_ave_histo_weight.h +++ b/src/fix_ave_histo_weight.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixAveHistoWeight : public FixAveHisto { public: FixAveHistoWeight(class LAMMPS *, int, char **); - ~FixAveHistoWeight() {} - void end_of_step(); + + void end_of_step() override; private: void bin_one_weights(double, double); diff --git a/src/fix_ave_time.h b/src/fix_ave_time.h index 3a26dd6d70..01b6440e5c 100644 --- a/src/fix_ave_time.h +++ b/src/fix_ave_time.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixAveTime : public Fix { public: FixAveTime(class LAMMPS *, int, char **); - ~FixAveTime(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - double compute_scalar(); - double compute_vector(int); - double compute_array(int, int); + ~FixAveTime() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_scalar() override; + double compute_vector(int) override; + double compute_array(int, int) override; private: int me, nvalues; diff --git a/src/fix_aveforce.h b/src/fix_aveforce.h index c9e7735a42..88c83064b0 100644 --- a/src/fix_aveforce.h +++ b/src/fix_aveforce.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixAveForce : public Fix { public: FixAveForce(class LAMMPS *, int, char **); - ~FixAveForce(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_vector(int); + ~FixAveForce() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_vector(int) override; private: double xvalue, yvalue, zvalue; diff --git a/src/fix_balance.h b/src/fix_balance.h index 02e4a159a9..f74ae2dc69 100644 --- a/src/fix_balance.h +++ b/src/fix_balance.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixBalance : public Fix { public: FixBalance(class LAMMPS *, int, char **); - ~FixBalance(); - int setmask(); - void post_constructor(); - void init(); - void setup(int); - void setup_pre_exchange(); - void pre_exchange(); - void pre_neighbor(); - double compute_scalar(); - double compute_vector(int); - double memory_usage(); + ~FixBalance() override; + int setmask() override; + void post_constructor() override; + void init() override; + void setup(int) override; + void setup_pre_exchange() override; + void pre_exchange() override; + void pre_neighbor() override; + double compute_scalar() override; + double compute_vector(int) override; + double memory_usage() override; private: int nevery, lbstyle, nitermax; diff --git a/src/fix_box_relax.h b/src/fix_box_relax.h index 228f1ad88a..00fd77d9a2 100644 --- a/src/fix_box_relax.h +++ b/src/fix_box_relax.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class FixBoxRelax : public Fix { public: FixBoxRelax(class LAMMPS *, int, char **); - ~FixBoxRelax(); - int setmask(); - void init(); + ~FixBoxRelax() override; + int setmask() override; + void init() override; - double min_energy(double *); - void min_store(); - void min_clearstore(); - void min_pushstore(); - void min_popstore(); - int min_reset_ref(); - void min_step(double, double *); - double max_alpha(double *); - int min_dof(); + double min_energy(double *) override; + void min_store() override; + void min_clearstore() override; + void min_pushstore() override; + void min_popstore() override; + int min_reset_ref() override; + void min_step(double, double *) override; + double max_alpha(double *) override; + int min_dof() override; - int modify_param(int, char **); + int modify_param(int, char **) override; private: int p_flag[6]; @@ -89,7 +89,7 @@ class FixBoxRelax : public Fix { void compute_deviatoric(); double compute_strain_energy(); void compute_press_target(); - double compute_scalar(); + double compute_scalar() override; }; } // namespace LAMMPS_NS diff --git a/src/fix_deform.h b/src/fix_deform.h index c1becf58f9..e090490eca 100644 --- a/src/fix_deform.h +++ b/src/fix_deform.h @@ -30,14 +30,14 @@ class FixDeform : public Fix { int dimflag[6]; // which dims are deformed FixDeform(class LAMMPS *, int, char **); - virtual ~FixDeform(); - int setmask(); - void init(); - virtual void pre_exchange(); - virtual void end_of_step(); - virtual void write_restart(FILE *); - virtual void restart(char *buf); - double memory_usage(); + ~FixDeform() override; + int setmask() override; + void init() override; + void pre_exchange() override; + void end_of_step() override; + void write_restart(FILE *) override; + void restart(char *buf) override; + double memory_usage() override; protected: int triclinic, scaleflag, flipflag; diff --git a/src/fix_deposit.h b/src/fix_deposit.h index cc7d482fb0..29f7cbfa43 100644 --- a/src/fix_deposit.h +++ b/src/fix_deposit.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixDeposit : public Fix { public: FixDeposit(class LAMMPS *, int, char **); - ~FixDeposit(); - int setmask(); - void init(); - void setup_pre_exchange(); - void pre_exchange(); - void write_restart(FILE *); - void restart(char *); - void *extract(const char *, int &); + ~FixDeposit() override; + int setmask() override; + void init() override; + void setup_pre_exchange() override; + void pre_exchange() override; + void write_restart(FILE *) override; + void restart(char *) override; + void *extract(const char *, int &) override; private: int ninsert, ntype, nfreq, seed; diff --git a/src/fix_deprecated.h b/src/fix_deprecated.h index a2260ad652..7bbaef4d54 100644 --- a/src/fix_deprecated.h +++ b/src/fix_deprecated.h @@ -30,9 +30,9 @@ namespace LAMMPS_NS { class FixDeprecated : public Fix { public: FixDeprecated(class LAMMPS *, int, char **); - ~FixDeprecated() {} - int setmask() { return 0; } - void init() {} + + int setmask() override { return 0; } + void init() override {} }; } // namespace LAMMPS_NS diff --git a/src/fix_dt_reset.h b/src/fix_dt_reset.h index 01cca3b41f..533e94b80c 100644 --- a/src/fix_dt_reset.h +++ b/src/fix_dt_reset.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixDtReset : public Fix { public: FixDtReset(class LAMMPS *, int, char **); - ~FixDtReset() {} - int setmask(); - void init(); - void setup(int); - void end_of_step(); - double compute_scalar(); + + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_scalar() override; private: bigint laststep; diff --git a/src/fix_dummy.h b/src/fix_dummy.h index 970e9fb23a..05be520a32 100644 --- a/src/fix_dummy.h +++ b/src/fix_dummy.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixDummy : public Fix { public: FixDummy(class LAMMPS *, int, char **); - virtual ~FixDummy() {} - int setmask(); + + int setmask() override; protected: int initial_integrate_flag, final_integrate_flag; diff --git a/src/fix_efield.h b/src/fix_efield.h index 20201518ab..9148a94d99 100644 --- a/src/fix_efield.h +++ b/src/fix_efield.h @@ -28,17 +28,17 @@ class FixEfield : public Fix { friend class FixQEqReaxFF; public: FixEfield(class LAMMPS *, int, char **); - ~FixEfield(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double memory_usage(); - double compute_scalar(); - double compute_vector(int); + ~FixEfield() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double memory_usage() override; + double compute_scalar() override; + double compute_vector(int) override; enum { NONE, CONSTANT, EQUAL, ATOM }; diff --git a/src/fix_enforce2d.h b/src/fix_enforce2d.h index afaa28f06f..5826657f40 100644 --- a/src/fix_enforce2d.h +++ b/src/fix_enforce2d.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixEnforce2D : public Fix { public: FixEnforce2D(class LAMMPS *, int, char **); - ~FixEnforce2D(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); + ~FixEnforce2D() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; protected: int nfixlist; diff --git a/src/fix_evaporate.h b/src/fix_evaporate.h index 6005a80257..e350c91608 100644 --- a/src/fix_evaporate.h +++ b/src/fix_evaporate.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixEvaporate : public Fix { public: FixEvaporate(class LAMMPS *, int, char **); - ~FixEvaporate(); - int setmask(); - void init(); - void pre_exchange(); - double compute_scalar(); - double memory_usage(); + ~FixEvaporate() override; + int setmask() override; + void init() override; + void pre_exchange() override; + double compute_scalar() override; + double memory_usage() override; private: int nevery, nflux, iregion; diff --git a/src/fix_external.h b/src/fix_external.h index 16db5d5015..efc017708c 100644 --- a/src/fix_external.h +++ b/src/fix_external.h @@ -29,17 +29,17 @@ class FixExternal : public Fix { double **fexternal; FixExternal(class LAMMPS *, int, char **); - ~FixExternal(); - int setmask(); - void init(); - void setup(int); - void setup_pre_reverse(int, int); - void min_setup(int); - void pre_reverse(int, int); - void post_force(int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixExternal() override; + int setmask() override; + void init() override; + void setup(int) override; + void setup_pre_reverse(int, int) override; + void min_setup(int) override; + void pre_reverse(int, int) override; + void post_force(int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; void set_energy_global(double); void set_virial_global(double *); @@ -48,16 +48,16 @@ class FixExternal : public Fix { void set_vector_length(int); void set_vector(int, double); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; typedef void (*FnPtr)(void *, bigint, int, tagint *, double **, double **); void set_callback(FnPtr, void *); - void *extract(const char *, int &); + void *extract(const char *, int &) override; private: int mode, ncall, napply, eflag_caller; diff --git a/src/fix_gravity.h b/src/fix_gravity.h index 389c5a1af1..e4309501ef 100644 --- a/src/fix_gravity.h +++ b/src/fix_gravity.h @@ -29,14 +29,14 @@ class FixGravity : public Fix { public: FixGravity(class LAMMPS *, int, char **); - virtual ~FixGravity(); - int setmask(); - void init(); - void setup(int); - virtual void post_force(int); - virtual void post_force_respa(int, int, int); - double compute_scalar(); - void *extract(const char *, int &); + ~FixGravity() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + double compute_scalar() override; + void *extract(const char *, int &) override; enum { CONSTANT, EQUAL }; protected: diff --git a/src/fix_group.h b/src/fix_group.h index b94cb1ee21..ffa2afcfc3 100644 --- a/src/fix_group.h +++ b/src/fix_group.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixGroup : public Fix { public: FixGroup(class LAMMPS *, int, char **); - ~FixGroup(); - int setmask(); - void init(); - void setup(int); - void post_integrate(); - void post_integrate_respa(int, int); - void *extract(const char *, int &); + ~FixGroup() override; + int setmask() override; + void init() override; + void setup(int) override; + void post_integrate() override; + void post_integrate_respa(int, int) override; + void *extract(const char *, int &) override; private: int gbit, gbitinverse; diff --git a/src/fix_halt.h b/src/fix_halt.h index 73eab2d930..1776e029e9 100644 --- a/src/fix_halt.h +++ b/src/fix_halt.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixHalt : public Fix { public: FixHalt(class LAMMPS *, int, char **); - ~FixHalt(); - int setmask(); - void init(); - void end_of_step(); - void min_post_force(int); - void post_run(); + ~FixHalt() override; + int setmask() override; + void init() override; + void end_of_step() override; + void min_post_force(int) override; + void post_run() override; private: int attribute, operation, eflag, msgflag, ivar; diff --git a/src/fix_heat.h b/src/fix_heat.h index a6a0e00813..5d1d9a5dfd 100644 --- a/src/fix_heat.h +++ b/src/fix_heat.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixHeat : public Fix { public: FixHeat(class LAMMPS *, int, char **); - ~FixHeat(); - int setmask(); - void init(); - void end_of_step(); - double compute_scalar(); - double memory_usage(); + ~FixHeat() override; + int setmask() override; + void init() override; + void end_of_step() override; + double compute_scalar() override; + double memory_usage() override; private: int iregion; diff --git a/src/fix_indent.h b/src/fix_indent.h index e8b9d7055f..1fbfb2a785 100644 --- a/src/fix_indent.h +++ b/src/fix_indent.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixIndent : public Fix { public: FixIndent(class LAMMPS *, int, char **); - ~FixIndent(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixIndent() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; private: int istyle, scaleflag, side; diff --git a/src/fix_langevin.h b/src/fix_langevin.h index 2c881d9329..ca8ded2d0f 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class FixLangevin : public Fix { public: FixLangevin(class LAMMPS *, int, char **); - virtual ~FixLangevin(); - int setmask(); - void init(); - void setup(int); - virtual void initial_integrate(int); - virtual void post_force(int); - void post_force_respa(int, int, int); - virtual void end_of_step(); - void reset_target(double); - void reset_dt(); - int modify_param(int, char **); - virtual double compute_scalar(); - double memory_usage(); - virtual void *extract(const char *, int &); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + ~FixLangevin() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void end_of_step() override; + void reset_target(double) override; + void reset_dt() override; + int modify_param(int, char **) override; + double compute_scalar() override; + double memory_usage() override; + void *extract(const char *, int &) override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; protected: int gjfflag, nvalues, osflag, oflag, tallyflag, zeroflag, tbiasflag; diff --git a/src/fix_lineforce.h b/src/fix_lineforce.h index 8151fc86db..b5564a521d 100644 --- a/src/fix_lineforce.h +++ b/src/fix_lineforce.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixLineForce : public Fix { public: FixLineForce(class LAMMPS *, int, char **); - int setmask(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); + int setmask() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; private: double xdir, ydir, zdir; diff --git a/src/fix_momentum.h b/src/fix_momentum.h index 43d3d174be..4adbf80be8 100644 --- a/src/fix_momentum.h +++ b/src/fix_momentum.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixMomentum : public Fix { public: FixMomentum(class LAMMPS *, int, char **); - int setmask(); - void init(); - void end_of_step(); + int setmask() override; + void init() override; + void end_of_step() override; protected: int linear, angular, rescale; diff --git a/src/fix_move.h b/src/fix_move.h index 02f573e000..b3579db0b7 100644 --- a/src/fix_move.h +++ b/src/fix_move.h @@ -27,28 +27,28 @@ namespace LAMMPS_NS { class FixMove : public Fix { public: FixMove(class LAMMPS *, int, char **); - ~FixMove(); - int setmask(); - void init(); - void initial_integrate(int); - void final_integrate(); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); + ~FixMove() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; - double memory_usage(); - void write_restart(FILE *); - void restart(char *); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int maxsize_restart(); - int size_restart(int); + double memory_usage() override; + void write_restart(FILE *) override; + void restart(char *) override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int maxsize_restart() override; + int size_restart(int) override; - void reset_dt(); + void reset_dt() override; private: char *xvarstr, *yvarstr, *zvarstr, *vxvarstr, *vyvarstr, *vzvarstr; diff --git a/src/fix_neigh_history.h b/src/fix_neigh_history.h index 1405c05731..ba31f7cd3c 100644 --- a/src/fix_neigh_history.h +++ b/src/fix_neigh_history.h @@ -34,31 +34,31 @@ class FixNeighHistory : public Fix { class Pair *pair; // ptr to pair style that uses neighbor history FixNeighHistory(class LAMMPS *, int, char **); - ~FixNeighHistory(); - int setmask(); - void init(); - void setup_post_neighbor(); - void pre_exchange(); - void min_pre_exchange(); - virtual void post_neighbor(); - void min_post_neighbor(); - void post_run(); + ~FixNeighHistory() override; + int setmask() override; + void init() override; + void setup_post_neighbor() override; + void pre_exchange() override; + void min_pre_exchange() override; + void post_neighbor() override; + void min_post_neighbor() override; + void post_run() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; - int pack_reverse_comm_size(int, int); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - void write_restart(FILE *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + int pack_reverse_comm_size(int, int) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + void write_restart(FILE *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; protected: int newton_pair; // same as force setting diff --git a/src/fix_nh.h b/src/fix_nh.h index 1ec6bec2f8..53fc815bab 100644 --- a/src/fix_nh.h +++ b/src/fix_nh.h @@ -21,26 +21,26 @@ namespace LAMMPS_NS { class FixNH : public Fix { public: FixNH(class LAMMPS *, int, char **); - virtual ~FixNH(); - int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void pre_force_respa(int, int, int); - void final_integrate_respa(int, int); - virtual void pre_exchange(); - double compute_scalar(); - virtual double compute_vector(int); - void write_restart(FILE *); + ~FixNH() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void pre_force_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void pre_exchange() override; + double compute_scalar() override; + double compute_vector(int) override; + void write_restart(FILE *) override; virtual int pack_restart_data(double *); // pack restart data - virtual void restart(char *); - int modify_param(int, char **); - void reset_target(double); - void reset_dt(); - virtual void *extract(const char *, int &); - double memory_usage(); + void restart(char *) override; + int modify_param(int, char **) override; + void reset_target(double) override; + void reset_dt() override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int dimension, which; diff --git a/src/fix_nh_sphere.h b/src/fix_nh_sphere.h index d07e63fb77..5e14bf466c 100644 --- a/src/fix_nh_sphere.h +++ b/src/fix_nh_sphere.h @@ -21,15 +21,15 @@ namespace LAMMPS_NS { class FixNHSphere : public FixNH { public: FixNHSphere(class LAMMPS *, int, char **); - virtual ~FixNHSphere() {} - void init(); + + void init() override; protected: double inertia; - void nve_v(); - void nve_x(); - void nh_v_temp(); + void nve_v() override; + void nve_x() override; + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/fix_nph.h b/src/fix_nph.h index f485bd9b81..576b1afea1 100644 --- a/src/fix_nph.h +++ b/src/fix_nph.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPH : public FixNH { public: FixNPH(class LAMMPS *, int, char **); - ~FixNPH() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_nph_sphere.h b/src/fix_nph_sphere.h index 6376176b20..32a65b66ae 100644 --- a/src/fix_nph_sphere.h +++ b/src/fix_nph_sphere.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPHSphere : public FixNHSphere { public: FixNPHSphere(class LAMMPS *, int, char **); - ~FixNPHSphere() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_npt.h b/src/fix_npt.h index 582467c4d0..9d7b5ad49e 100644 --- a/src/fix_npt.h +++ b/src/fix_npt.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPT : public FixNH { public: FixNPT(class LAMMPS *, int, char **); - ~FixNPT() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_npt_sphere.h b/src/fix_npt_sphere.h index b53328b5f8..59f66f47f3 100644 --- a/src/fix_npt_sphere.h +++ b/src/fix_npt_sphere.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNPTSphere : public FixNHSphere { public: FixNPTSphere(class LAMMPS *, int, char **); - ~FixNPTSphere() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_nve.h b/src/fix_nve.h index 864da8596c..01e52413fa 100644 --- a/src/fix_nve.h +++ b/src/fix_nve.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixNVE : public Fix { public: FixNVE(class LAMMPS *, int, char **); - virtual ~FixNVE() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - virtual void reset_dt(); + + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/fix_nve_limit.h b/src/fix_nve_limit.h index d23b680796..bb548d7004 100644 --- a/src/fix_nve_limit.h +++ b/src/fix_nve_limit.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixNVELimit : public Fix { public: FixNVELimit(class LAMMPS *, int, char **); - int setmask(); - void init(); - void initial_integrate(int); - void final_integrate(); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); - void reset_dt(); - double compute_scalar(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; + double compute_scalar() override; private: double dtv, dtf; diff --git a/src/fix_nve_noforce.h b/src/fix_nve_noforce.h index fe3081aac2..362f62bb44 100644 --- a/src/fix_nve_noforce.h +++ b/src/fix_nve_noforce.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixNVENoforce : public Fix { public: FixNVENoforce(class LAMMPS *, int, char **); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - void initial_integrate_respa(int, int, int); - void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void initial_integrate_respa(int, int, int) override; + void reset_dt() override; protected: double dtv; diff --git a/src/fix_nve_sphere.h b/src/fix_nve_sphere.h index 7eb6b39b35..86bcfb6b36 100644 --- a/src/fix_nve_sphere.h +++ b/src/fix_nve_sphere.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class FixNVESphere : public FixNVE { public: FixNVESphere(class LAMMPS *, int, char **); - virtual ~FixNVESphere() {} - void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); + + void init() override; + void initial_integrate(int) override; + void final_integrate() override; protected: double inertia; diff --git a/src/fix_nvt.h b/src/fix_nvt.h index f6ab23b96b..375055ac6f 100644 --- a/src/fix_nvt.h +++ b/src/fix_nvt.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVT : public FixNH { public: FixNVT(class LAMMPS *, int, char **); - ~FixNVT() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_nvt_sllod.h b/src/fix_nvt_sllod.h index dbd15458ca..57e17cf3b8 100644 --- a/src/fix_nvt_sllod.h +++ b/src/fix_nvt_sllod.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixNVTSllod : public FixNH { public: FixNVTSllod(class LAMMPS *, int, char **); - ~FixNVTSllod() {} - void init(); + + void init() override; private: int nondeformbias; - void nh_v_temp(); + void nh_v_temp() override; }; } // namespace LAMMPS_NS diff --git a/src/fix_nvt_sphere.h b/src/fix_nvt_sphere.h index e0d7716fdb..d2e89bdd0c 100644 --- a/src/fix_nvt_sphere.h +++ b/src/fix_nvt_sphere.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class FixNVTSphere : public FixNHSphere { public: FixNVTSphere(class LAMMPS *, int, char **); - ~FixNVTSphere() {} }; } // namespace LAMMPS_NS diff --git a/src/fix_planeforce.h b/src/fix_planeforce.h index 12a8b3f34a..8253192777 100644 --- a/src/fix_planeforce.h +++ b/src/fix_planeforce.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixPlaneForce : public Fix { public: FixPlaneForce(class LAMMPS *, int, char **); - int setmask(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); + int setmask() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; private: double xdir, ydir, zdir; diff --git a/src/fix_press_berendsen.h b/src/fix_press_berendsen.h index 806e6698f7..33399605fd 100644 --- a/src/fix_press_berendsen.h +++ b/src/fix_press_berendsen.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixPressBerendsen : public Fix { public: FixPressBerendsen(class LAMMPS *, int, char **); - ~FixPressBerendsen(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - int modify_param(int, char **); + ~FixPressBerendsen() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + int modify_param(int, char **) override; protected: int dimension, which; diff --git a/src/fix_print.h b/src/fix_print.h index 82e72d725a..079c339798 100644 --- a/src/fix_print.h +++ b/src/fix_print.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixPrint : public Fix { public: FixPrint(class LAMMPS *, int, char **); - ~FixPrint(); - void init(); - void setup(int); - int setmask(); - void end_of_step(); + ~FixPrint() override; + void init() override; + void setup(int) override; + int setmask() override; + void end_of_step() override; private: int me, screenflag; diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h index 8580865e59..500ad6316c 100644 --- a/src/fix_property_atom.h +++ b/src/fix_property_atom.h @@ -27,28 +27,28 @@ namespace LAMMPS_NS { class FixPropertyAtom : public Fix { public: FixPropertyAtom(class LAMMPS *, int, char **); - virtual ~FixPropertyAtom(); - int setmask(); - void init(); + ~FixPropertyAtom() override; + int setmask() override; + void init() override; - void read_data_section(char *, int, char *, tagint); - bigint read_data_skip_lines(char *); - void write_data_section_size(int, int &, int &); - void write_data_section_pack(int, double **); - void write_data_section_keyword(int, FILE *); - void write_data_section(int, FILE *, int, double **, int); + void read_data_section(char *, int, char *, tagint) override; + bigint read_data_skip_lines(char *) override; + void write_data_section_size(int, int &, int &) override; + void write_data_section_pack(int, double **) override; + void write_data_section_keyword(int, FILE *) override; + void write_data_section(int, FILE *, int, double **, int) override; - virtual void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_border(int, int *, double *); - int unpack_border(int, int, double *); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); - double memory_usage(); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_border(int, int *, double *) override; + int unpack_border(int, int, double *) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; + double memory_usage() override; protected: int nvalue, border; diff --git a/src/fix_read_restart.h b/src/fix_read_restart.h index 8431803f05..49d03db052 100644 --- a/src/fix_read_restart.h +++ b/src/fix_read_restart.h @@ -30,14 +30,14 @@ class FixReadRestart : public Fix { double **extra; FixReadRestart(class LAMMPS *, int, char **); - ~FixReadRestart(); - int setmask(); + ~FixReadRestart() override; + int setmask() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: int nextra; // max number of extra values for any atom diff --git a/src/fix_recenter.h b/src/fix_recenter.h index 53fe65100b..a2c7c9866d 100644 --- a/src/fix_recenter.h +++ b/src/fix_recenter.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixRecenter : public Fix { public: FixRecenter(class LAMMPS *, int, char **); - int setmask(); - void init(); - void initial_integrate(int); - void initial_integrate_respa(int, int, int); - double compute_scalar(); - double compute_vector(int); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void initial_integrate_respa(int, int, int) override; + double compute_scalar() override; + double compute_vector(int) override; private: int group2bit, scaleflag; diff --git a/src/fix_respa.h b/src/fix_respa.h index a1c477c6d7..b6b80711de 100644 --- a/src/fix_respa.h +++ b/src/fix_respa.h @@ -31,15 +31,15 @@ class FixRespa : public Fix { public: FixRespa(class LAMMPS *, int, char **); - ~FixRespa(); - int setmask(); - void init() {} + ~FixRespa() override; + int setmask() override; + void init() override {} - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: int nlevels; diff --git a/src/fix_restrain.h b/src/fix_restrain.h index d42d639204..607927a5fb 100644 --- a/src/fix_restrain.h +++ b/src/fix_restrain.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixRestrain : public Fix { public: FixRestrain(class LAMMPS *, int, char **); - ~FixRestrain(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixRestrain() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; private: int ilevel_respa; diff --git a/src/fix_setforce.h b/src/fix_setforce.h index aed39abaf0..ea242ba954 100644 --- a/src/fix_setforce.h +++ b/src/fix_setforce.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixSetForce : public Fix { public: FixSetForce(class LAMMPS *, int, char **); - virtual ~FixSetForce(); - int setmask(); - virtual void init(); - void setup(int); - void min_setup(int); - virtual void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_vector(int); + ~FixSetForce() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_vector(int) override; - double memory_usage(); + double memory_usage() override; protected: double xvalue, yvalue, zvalue; diff --git a/src/fix_spring.h b/src/fix_spring.h index d8a2a30307..4180658a2f 100644 --- a/src/fix_spring.h +++ b/src/fix_spring.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixSpring : public Fix { public: FixSpring(class LAMMPS *, int, char **); - ~FixSpring(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixSpring() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; private: double xc, yc, zc, r0; diff --git a/src/fix_spring_chunk.h b/src/fix_spring_chunk.h index 53f4c67810..181bced917 100644 --- a/src/fix_spring_chunk.h +++ b/src/fix_spring_chunk.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixSpringChunk : public Fix { public: FixSpringChunk(class LAMMPS *, int, char **); - ~FixSpringChunk(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - void write_restart(FILE *); - void restart(char *); - double compute_scalar(); + ~FixSpringChunk() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + void write_restart(FILE *) override; + void restart(char *) override; + double compute_scalar() override; private: int ilevel_respa; diff --git a/src/fix_spring_self.h b/src/fix_spring_self.h index 03c12ca13b..ca957fd845 100644 --- a/src/fix_spring_self.h +++ b/src/fix_spring_self.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class FixSpringSelf : public Fix { public: FixSpringSelf(class LAMMPS *, int, char **); - ~FixSpringSelf(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); + ~FixSpringSelf() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; private: double k, espring; diff --git a/src/fix_store.h b/src/fix_store.h index a30e2d5c1f..d1b58db155 100644 --- a/src/fix_store.h +++ b/src/fix_store.h @@ -33,23 +33,23 @@ class FixStore : public Fix { int disable; // 1 if operations (except grow) are currently disabled FixStore(class LAMMPS *, int, char **); - ~FixStore(); - int setmask(); + ~FixStore() override; + int setmask() override; void reset_global(int, int); - void write_restart(FILE *); - void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; - double memory_usage(); + double memory_usage() override; private: int flavor; // GLOBAL or PERATOM diff --git a/src/fix_store_force.h b/src/fix_store_force.h index 31b042b5ca..adbd3573c4 100644 --- a/src/fix_store_force.h +++ b/src/fix_store_force.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class FixStoreForce : public Fix { public: FixStoreForce(class LAMMPS *, int, char **); - ~FixStoreForce(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double memory_usage(); + ~FixStoreForce() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double memory_usage() override; private: int nlevels_respa; diff --git a/src/fix_store_state.h b/src/fix_store_state.h index 59c17341f1..b7237dbc14 100644 --- a/src/fix_store_state.h +++ b/src/fix_store_state.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class FixStoreState : public Fix { public: FixStoreState(class LAMMPS *, int, char **); - ~FixStoreState(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); + ~FixStoreState() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; private: int nvalues; diff --git a/src/fix_temp_berendsen.h b/src/fix_temp_berendsen.h index f45a5e7f03..ec6381086a 100644 --- a/src/fix_temp_berendsen.h +++ b/src/fix_temp_berendsen.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixTempBerendsen : public Fix { public: FixTempBerendsen(class LAMMPS *, int, char **); - ~FixTempBerendsen(); - int setmask(); - void init(); - void end_of_step(); - int modify_param(int, char **); - void reset_target(double); - double compute_scalar(); - void write_restart(FILE *); - void restart(char *buf); - virtual void *extract(const char *, int &); + ~FixTempBerendsen() override; + int setmask() override; + void init() override; + void end_of_step() override; + int modify_param(int, char **) override; + void reset_target(double) override; + double compute_scalar() override; + void write_restart(FILE *) override; + void restart(char *buf) override; + void *extract(const char *, int &) override; private: int which; diff --git a/src/fix_temp_rescale.h b/src/fix_temp_rescale.h index c24f35eb34..058cf7cefe 100644 --- a/src/fix_temp_rescale.h +++ b/src/fix_temp_rescale.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixTempRescale : public Fix { public: FixTempRescale(class LAMMPS *, int, char **); - virtual ~FixTempRescale(); - int setmask(); - void init(); - virtual void end_of_step(); - int modify_param(int, char **); - void reset_target(double); - double compute_scalar(); - void write_restart(FILE *); - void restart(char *buf); - virtual void *extract(const char *, int &); + ~FixTempRescale() override; + int setmask() override; + void init() override; + void end_of_step() override; + int modify_param(int, char **) override; + void reset_target(double) override; + double compute_scalar() override; + void write_restart(FILE *) override; + void restart(char *buf) override; + void *extract(const char *, int &) override; protected: int which; diff --git a/src/fix_thermal_conductivity.h b/src/fix_thermal_conductivity.h index 3f598bce5b..e502e8496a 100644 --- a/src/fix_thermal_conductivity.h +++ b/src/fix_thermal_conductivity.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class FixThermalConductivity : public Fix { public: FixThermalConductivity(class LAMMPS *, int, char **); - ~FixThermalConductivity(); - int setmask(); - void init(); - void end_of_step(); - double compute_scalar(); + ~FixThermalConductivity() override; + int setmask() override; + void init() override; + void end_of_step() override; + double compute_scalar() override; private: int me; diff --git a/src/fix_vector.h b/src/fix_vector.h index 2d82a22d9d..c43e287b4c 100644 --- a/src/fix_vector.h +++ b/src/fix_vector.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class FixVector : public Fix { public: FixVector(class LAMMPS *, int, char **); - ~FixVector(); - int setmask(); - void init(); - void setup(int); - void end_of_step(); - double compute_vector(int); - double compute_array(int, int); + ~FixVector() override; + int setmask() override; + void init() override; + void setup(int) override; + void end_of_step() override; + double compute_vector(int) override; + double compute_array(int, int) override; private: int nvalues; diff --git a/src/fix_viscous.h b/src/fix_viscous.h index 08970094bc..0353004911 100644 --- a/src/fix_viscous.h +++ b/src/fix_viscous.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixViscous : public Fix { public: FixViscous(class LAMMPS *, int, char **); - virtual ~FixViscous(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); + ~FixViscous() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; protected: double *gamma; diff --git a/src/fix_wall.h b/src/fix_wall.h index 9d44ff4e4c..99086aac6c 100644 --- a/src/fix_wall.h +++ b/src/fix_wall.h @@ -29,17 +29,17 @@ class FixWall : public Fix { char *xstr[6]; FixWall(class LAMMPS *, int, char **); - virtual ~FixWall(); - int setmask(); - virtual void init(); - void setup(int); - void min_setup(int); - void pre_force(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixWall() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void pre_force(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; virtual void precompute(int) = 0; virtual void wall_particle(int, int, double) = 0; diff --git a/src/fix_wall_harmonic.h b/src/fix_wall_harmonic.h index 473504d47d..629f4eede9 100644 --- a/src/fix_wall_harmonic.h +++ b/src/fix_wall_harmonic.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixWallHarmonic : public FixWall { public: FixWallHarmonic(class LAMMPS *, int, char **); - void precompute(int) {} - void wall_particle(int, int, double); + void precompute(int) override {} + void wall_particle(int, int, double) override; }; } // namespace LAMMPS_NS diff --git a/src/fix_wall_lj1043.h b/src/fix_wall_lj1043.h index 17d5836302..9e09a4b6b9 100644 --- a/src/fix_wall_lj1043.h +++ b/src/fix_wall_lj1043.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixWallLJ1043 : public FixWall { public: FixWallLJ1043(class LAMMPS *, int, char **); - void precompute(int); - void wall_particle(int, int, double); + void precompute(int) override; + void wall_particle(int, int, double) override; private: double coeff1[6], coeff2[6], coeff3[6], coeff4[6], coeff5[6], coeff6[6], coeff7[6], offset[6]; diff --git a/src/fix_wall_lj126.h b/src/fix_wall_lj126.h index 2ea768ba65..9f9e870fd5 100644 --- a/src/fix_wall_lj126.h +++ b/src/fix_wall_lj126.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixWallLJ126 : public FixWall { public: FixWallLJ126(class LAMMPS *, int, char **); - void precompute(int); - void wall_particle(int, int, double); + void precompute(int) override; + void wall_particle(int, int, double) override; private: double coeff1[6], coeff2[6], coeff3[6], coeff4[6], offset[6]; diff --git a/src/fix_wall_lj93.h b/src/fix_wall_lj93.h index 4326e7acc0..5f0a90773d 100644 --- a/src/fix_wall_lj93.h +++ b/src/fix_wall_lj93.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixWallLJ93 : public FixWall { public: FixWallLJ93(class LAMMPS *, int, char **); - void precompute(int); - virtual void wall_particle(int, int, double); + void precompute(int) override; + void wall_particle(int, int, double) override; protected: double coeff1[6], coeff2[6], coeff3[6], coeff4[6], offset[6]; diff --git a/src/fix_wall_morse.h b/src/fix_wall_morse.h index 55ab2c0cd8..973adfeaf8 100644 --- a/src/fix_wall_morse.h +++ b/src/fix_wall_morse.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class FixWallMorse : public FixWall { public: FixWallMorse(class LAMMPS *, int, char **); - void precompute(int); - void wall_particle(int, int, double); + void precompute(int) override; + void wall_particle(int, int, double) override; private: double coeff1[6], offset[6]; diff --git a/src/fix_wall_reflect.h b/src/fix_wall_reflect.h index 45b5c8d2d2..d708c07180 100644 --- a/src/fix_wall_reflect.h +++ b/src/fix_wall_reflect.h @@ -30,10 +30,10 @@ class FixWallReflect : public Fix { enum { NONE = 0, EDGE, CONSTANT, VARIABLE }; FixWallReflect(class LAMMPS *, int, char **); - virtual ~FixWallReflect(); - int setmask(); - void init(); - void post_integrate(); + ~FixWallReflect() override; + int setmask() override; + void init() override; + void post_integrate() override; protected: int nwall; diff --git a/src/fix_wall_region.h b/src/fix_wall_region.h index e72ada5301..5da19f6698 100644 --- a/src/fix_wall_region.h +++ b/src/fix_wall_region.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class FixWallRegion : public Fix { public: FixWallRegion(class LAMMPS *, int, char **); - ~FixWallRegion(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + ~FixWallRegion() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + double compute_vector(int) override; private: int style, iregion; From 6506be94092341f2a114b54ac73b971c5266dca3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 Jan 2022 15:56:58 -0500 Subject: [PATCH 077/174] update programming style --- src/INTEL/intel_buffers.cpp | 13 ++++--------- src/fix_balance.cpp | 16 +++++++++------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/INTEL/intel_buffers.cpp b/src/INTEL/intel_buffers.cpp index d86570b0d3..3470c18db8 100644 --- a/src/INTEL/intel_buffers.cpp +++ b/src/INTEL/intel_buffers.cpp @@ -296,9 +296,7 @@ void IntelBuffers::free_list_ptrs() /* ---------------------------------------------------------------------- */ template -void IntelBuffers::grow_data3(NeighList *list, - int *&numneighhalf, - int *&cnumneigh) +void IntelBuffers::grow_data3(NeighList *list, int *&numneighhalf, int *&cnumneigh) { const int size = list->get_maxlocal(); int list_num; @@ -321,10 +319,8 @@ void IntelBuffers::grow_data3(NeighList *list, lmp->memory->destroy(_neigh_list_ptrs[list_num].cnumneigh); lmp->memory->destroy(_neigh_list_ptrs[list_num].numneighhalf); } - lmp->memory->create(_neigh_list_ptrs[list_num].cnumneigh, size, - "_cnumneigh"); - lmp->memory->create(_neigh_list_ptrs[list_num].numneighhalf, size, - "_cnumneigh"); + lmp->memory->create(_neigh_list_ptrs[list_num].cnumneigh, size, "_cnumneigh"); + lmp->memory->create(_neigh_list_ptrs[list_num].numneighhalf, size, "_cnumneigh"); _neigh_list_ptrs[list_num].size = size; } numneighhalf = _neigh_list_ptrs[list_num].numneighhalf; @@ -334,8 +330,7 @@ void IntelBuffers::grow_data3(NeighList *list, /* ---------------------------------------------------------------------- */ template -void IntelBuffers::_grow_list_local(NeighList *list, - const int three_body, +void IntelBuffers::_grow_list_local(NeighList *list, const int three_body, const int offload_end) { free_list_local(); diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index 2c76f13bf0..6b5c4b6ab1 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -13,20 +13,22 @@ ------------------------------------------------------------------------- */ #include "fix_balance.h" -#include -#include "balance.h" -#include "update.h" + #include "atom.h" +#include "balance.h" #include "comm.h" #include "domain.h" -#include "neighbor.h" -#include "irregular.h" +#include "error.h" +#include "fix_store.h" #include "force.h" +#include "irregular.h" #include "kspace.h" #include "modify.h" -#include "fix_store.h" +#include "neighbor.h" #include "rcb.h" -#include "error.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; From 06beb28d7dd747da20a5d422bd17fd47f6127c66 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 21 Jan 2022 16:13:49 -0500 Subject: [PATCH 078/174] Apply override to Pair classes --- src/ASPHERE/pair_gayberne.h | 24 +++++------ src/ASPHERE/pair_line_lj.h | 12 +++--- src/ASPHERE/pair_resquared.h | 20 ++++----- src/ASPHERE/pair_tri_lj.h | 12 +++--- src/BODY/pair_body_nparticle.h | 12 +++--- src/BODY/pair_body_rounded_polygon.h | 12 +++--- src/BODY/pair_body_rounded_polyhedron.h | 12 +++--- src/CG-DNA/pair_oxdna2_coaxstk.h | 26 ++++++------ src/CG-DNA/pair_oxdna2_dh.h | 26 ++++++------ src/CG-DNA/pair_oxdna2_excv.h | 4 +- src/CG-DNA/pair_oxdna_coaxstk.h | 26 ++++++------ src/CG-DNA/pair_oxdna_excv.h | 26 ++++++------ src/CG-DNA/pair_oxdna_hbond.h | 26 ++++++------ src/CG-DNA/pair_oxdna_stk.h | 28 ++++++------- src/CG-DNA/pair_oxdna_xstk.h | 26 ++++++------ src/CG-DNA/pair_oxrna2_dh.h | 4 +- src/CG-DNA/pair_oxrna2_excv.h | 4 +- src/CG-DNA/pair_oxrna2_hbond.h | 1 - src/CG-DNA/pair_oxrna2_stk.h | 28 ++++++------- src/CG-DNA/pair_oxrna2_xstk.h | 26 ++++++------ src/CG-SDK/pair_lj_sdk.h | 28 ++++++------- src/CG-SDK/pair_lj_sdk_coul_long.h | 30 ++++++------- src/CG-SDK/pair_lj_sdk_coul_msm.h | 7 ++-- src/CLASS2/pair_lj_class2.h | 34 +++++++-------- src/CLASS2/pair_lj_class2_coul_cut.h | 28 ++++++------- src/CLASS2/pair_lj_class2_coul_long.h | 34 +++++++-------- src/COLLOID/pair_brownian.h | 20 ++++----- src/COLLOID/pair_brownian_poly.h | 8 ++-- src/COLLOID/pair_colloid.h | 24 +++++------ src/COLLOID/pair_lubricate.h | 24 +++++------ src/COLLOID/pair_lubricateU.h | 24 +++++------ src/COLLOID/pair_lubricateU_poly.h | 14 +++---- src/COLLOID/pair_lubricate_poly.h | 6 +-- src/COLLOID/pair_yukawa_colloid.h | 10 ++--- src/CORESHELL/pair_born_coul_dsf_cs.h | 2 +- src/CORESHELL/pair_born_coul_long_cs.h | 2 +- src/CORESHELL/pair_born_coul_wolf_cs.h | 2 +- src/CORESHELL/pair_buck_coul_long_cs.h | 2 +- src/CORESHELL/pair_coul_long_cs.h | 2 +- src/CORESHELL/pair_coul_wolf_cs.h | 2 +- src/CORESHELL/pair_lj_class2_coul_long_cs.h | 8 ++-- src/CORESHELL/pair_lj_cut_coul_long_cs.h | 8 ++-- src/DIELECTRIC/pair_coul_cut_dielectric.h | 8 ++-- src/DIELECTRIC/pair_coul_long_dielectric.h | 6 +-- .../pair_lj_cut_coul_cut_dielectric.h | 8 ++-- .../pair_lj_cut_coul_debye_dielectric.h | 8 ++-- .../pair_lj_cut_coul_long_dielectric.h | 8 ++-- .../pair_lj_cut_coul_msm_dielectric.h | 10 ++--- .../pair_lj_long_coul_long_dielectric.h | 8 ++-- src/DIPOLE/pair_lj_cut_dipole_cut.h | 22 +++++----- src/DIPOLE/pair_lj_cut_dipole_long.h | 22 +++++----- src/DIPOLE/pair_lj_long_dipole_long.h | 22 +++++----- src/DIPOLE/pair_lj_sf_dipole_sf.h | 24 +++++------ src/DPD-BASIC/pair_dpd.h | 26 ++++++------ src/DPD-BASIC/pair_dpd_ext.h | 26 ++++++------ src/DPD-BASIC/pair_dpd_ext_tstat.h | 19 ++++----- src/DPD-BASIC/pair_dpd_tstat.h | 19 ++++----- src/DPD-MESO/pair_edpd.h | 22 +++++----- src/DPD-MESO/pair_mdpd.h | 24 +++++------ src/DPD-MESO/pair_mdpd_rhosum.h | 18 ++++---- src/DPD-MESO/pair_tdpd.h | 22 +++++----- src/DPD-REACT/pair_dpd_fdt.h | 22 +++++----- src/DPD-REACT/pair_dpd_fdt_energy.h | 26 ++++++------ src/DPD-REACT/pair_exp6_rx.h | 20 ++++----- src/DPD-REACT/pair_multi_lucy.h | 26 ++++++------ src/DPD-REACT/pair_multi_lucy_rx.h | 26 ++++++------ src/DPD-REACT/pair_table_rx.h | 10 ++--- .../pair_sdpd_taitwater_isothermal.h | 12 +++--- src/DRUDE/pair_coul_tt.h | 24 +++++------ src/DRUDE/pair_lj_cut_thole_long.h | 26 ++++++------ src/DRUDE/pair_thole.h | 24 +++++------ src/EFF/pair_eff_cut.h | 28 ++++++------- src/EXTRA-PAIR/pair_beck.h | 20 ++++----- src/EXTRA-PAIR/pair_born_coul_dsf.h | 26 ++++++------ src/EXTRA-PAIR/pair_born_coul_wolf.h | 26 ++++++------ src/EXTRA-PAIR/pair_buck_mdf.h | 22 +++++----- src/EXTRA-PAIR/pair_cosine_squared.h | 26 ++++++------ src/EXTRA-PAIR/pair_coul_cut_global.h | 4 +- src/EXTRA-PAIR/pair_coul_diel.h | 22 +++++----- src/EXTRA-PAIR/pair_coul_exclude.h | 28 ++++++------- src/EXTRA-PAIR/pair_coul_slater_cut.h | 10 ++--- src/EXTRA-PAIR/pair_coul_slater_long.h | 24 +++++------ src/EXTRA-PAIR/pair_e3b.h | 12 +++--- src/EXTRA-PAIR/pair_gauss.h | 26 ++++++------ src/EXTRA-PAIR/pair_gauss_cut.h | 26 ++++++------ src/EXTRA-PAIR/pair_harmonic_cut.h | 26 ++++++------ src/EXTRA-PAIR/pair_lennard_mdf.h | 26 ++++++------ src/EXTRA-PAIR/pair_lj96_cut.h | 32 +++++++------- src/EXTRA-PAIR/pair_lj_cubic.h | 20 ++++----- src/EXTRA-PAIR/pair_lj_cut_coul_debye.h | 12 +++--- src/EXTRA-PAIR/pair_lj_cut_coul_dsf.h | 24 +++++------ src/EXTRA-PAIR/pair_lj_cut_coul_wolf.h | 24 +++++------ src/EXTRA-PAIR/pair_lj_expand_coul_long.h | 34 +++++++-------- src/EXTRA-PAIR/pair_lj_gromacs.h | 24 +++++------ src/EXTRA-PAIR/pair_lj_gromacs_coul_gromacs.h | 26 ++++++------ src/EXTRA-PAIR/pair_lj_mdf.h | 26 ++++++------ src/EXTRA-PAIR/pair_lj_relres.h | 24 +++++------ src/EXTRA-PAIR/pair_lj_smooth.h | 24 +++++------ src/EXTRA-PAIR/pair_lj_smooth_linear.h | 22 +++++----- src/EXTRA-PAIR/pair_mie_cut.h | 30 ++++++------- src/EXTRA-PAIR/pair_momb.h | 20 ++++----- src/EXTRA-PAIR/pair_morse_smooth_linear.h | 26 ++++++------ src/EXTRA-PAIR/pair_nm_cut.h | 26 ++++++------ src/EXTRA-PAIR/pair_nm_cut_coul_cut.h | 28 ++++++------- src/EXTRA-PAIR/pair_nm_cut_coul_long.h | 28 ++++++------- src/EXTRA-PAIR/pair_nm_cut_split.h | 4 +- src/EXTRA-PAIR/pair_ufm.h | 26 ++++++------ src/EXTRA-PAIR/pair_wf_cut.h | 26 ++++++------ src/FEP/pair_coul_cut_soft.h | 28 ++++++------- src/FEP/pair_coul_long_soft.h | 24 +++++------ src/FEP/pair_lj_charmm_coul_long_soft.h | 34 +++++++-------- src/FEP/pair_lj_class2_coul_cut_soft.h | 28 ++++++------- src/FEP/pair_lj_class2_coul_long_soft.h | 28 ++++++------- src/FEP/pair_lj_class2_soft.h | 26 ++++++------ src/FEP/pair_lj_cut_coul_cut_soft.h | 28 ++++++------- src/FEP/pair_lj_cut_coul_long_soft.h | 34 +++++++-------- src/FEP/pair_lj_cut_soft.h | 34 +++++++-------- src/FEP/pair_lj_cut_tip4p_long_soft.h | 18 ++++---- src/FEP/pair_morse_soft.h | 28 ++++++------- src/FEP/pair_tip4p_long_soft.h | 18 ++++---- src/GPU/pair_beck_gpu.h | 8 ++-- src/GPU/pair_born_coul_long_cs_gpu.h | 8 ++-- src/GPU/pair_born_coul_long_gpu.h | 8 ++-- src/GPU/pair_born_coul_wolf_cs_gpu.h | 8 ++-- src/GPU/pair_born_coul_wolf_gpu.h | 8 ++-- src/GPU/pair_born_gpu.h | 10 ++--- src/GPU/pair_buck_coul_cut_gpu.h | 8 ++-- src/GPU/pair_buck_coul_long_gpu.h | 8 ++-- src/GPU/pair_buck_gpu.h | 10 ++--- src/GPU/pair_colloid_gpu.h | 8 ++-- src/GPU/pair_coul_cut_gpu.h | 10 ++--- src/GPU/pair_coul_debye_gpu.h | 10 ++--- src/GPU/pair_coul_dsf_gpu.h | 8 ++-- src/GPU/pair_coul_long_cs_gpu.h | 10 ++--- src/GPU/pair_coul_long_gpu.h | 10 ++--- src/GPU/pair_dpd_gpu.h | 8 ++-- src/GPU/pair_dpd_tstat_gpu.h | 8 ++-- src/GPU/pair_eam_alloy_gpu.h | 22 +++++----- src/GPU/pair_eam_fs_gpu.h | 22 +++++----- src/GPU/pair_eam_gpu.h | 16 +++---- src/GPU/pair_gauss_gpu.h | 10 ++--- src/GPU/pair_gayberne_gpu.h | 8 ++-- src/GPU/pair_lj96_cut_gpu.h | 8 ++-- src/GPU/pair_lj_charmm_coul_charmm_gpu.h | 8 ++-- src/GPU/pair_lj_charmm_coul_long_gpu.h | 8 ++-- src/GPU/pair_lj_class2_coul_long_gpu.h | 8 ++-- src/GPU/pair_lj_class2_gpu.h | 8 ++-- src/GPU/pair_lj_cubic_gpu.h | 8 ++-- src/GPU/pair_lj_cut_coul_cut_gpu.h | 8 ++-- src/GPU/pair_lj_cut_coul_debye_gpu.h | 8 ++-- src/GPU/pair_lj_cut_coul_dsf_gpu.h | 8 ++-- src/GPU/pair_lj_cut_coul_long_gpu.h | 10 ++--- src/GPU/pair_lj_cut_coul_msm_gpu.h | 8 ++-- src/GPU/pair_lj_cut_dipole_cut_gpu.h | 8 ++-- src/GPU/pair_lj_cut_dipole_long_gpu.h | 8 ++-- src/GPU/pair_lj_cut_gpu.h | 10 ++--- src/GPU/pair_lj_cut_tip4p_long_gpu.h | 8 ++-- src/GPU/pair_lj_expand_coul_long_gpu.h | 10 ++--- src/GPU/pair_lj_expand_gpu.h | 10 ++--- src/GPU/pair_lj_gromacs_gpu.h | 8 ++-- src/GPU/pair_lj_sdk_coul_long_gpu.h | 8 ++-- src/GPU/pair_lj_sdk_gpu.h | 8 ++-- src/GPU/pair_lj_sf_dipole_sf_gpu.h | 8 ++-- src/GPU/pair_lj_smooth_gpu.h | 10 ++--- src/GPU/pair_mie_cut_gpu.h | 8 ++-- src/GPU/pair_morse_gpu.h | 8 ++-- src/GPU/pair_resquared_gpu.h | 8 ++-- src/GPU/pair_soft_gpu.h | 10 ++--- src/GPU/pair_sw_gpu.h | 10 ++--- src/GPU/pair_table_gpu.h | 8 ++-- src/GPU/pair_tersoff_gpu.h | 10 ++--- src/GPU/pair_tersoff_mod_gpu.h | 10 ++--- src/GPU/pair_tersoff_zbl_gpu.h | 10 ++--- src/GPU/pair_ufm_gpu.h | 10 ++--- src/GPU/pair_vashishta_gpu.h | 8 ++-- src/GPU/pair_yukawa_colloid_gpu.h | 8 ++-- src/GPU/pair_yukawa_gpu.h | 8 ++-- src/GPU/pair_zbl_gpu.h | 8 ++-- src/GRANULAR/pair_gran_hertz_history.h | 6 +-- src/GRANULAR/pair_gran_hooke.h | 4 +- src/GRANULAR/pair_gran_hooke_history.h | 34 +++++++-------- src/GRANULAR/pair_granular.h | 32 +++++++------- src/INTEL/pair_airebo_intel.h | 6 +-- src/INTEL/pair_airebo_morse_intel.h | 2 +- src/INTEL/pair_buck_coul_cut_intel.h | 6 +-- src/INTEL/pair_buck_coul_long_intel.h | 6 +-- src/INTEL/pair_buck_intel.h | 6 +-- src/INTEL/pair_dpd_intel.h | 10 ++--- src/INTEL/pair_eam_alloy_intel.h | 8 ++-- src/INTEL/pair_eam_fs_intel.h | 8 ++-- src/INTEL/pair_eam_intel.h | 10 ++--- src/INTEL/pair_gayberne_intel.h | 4 +- src/INTEL/pair_lj_charmm_coul_charmm_intel.h | 6 +-- src/INTEL/pair_lj_charmm_coul_long_intel.h | 6 +-- src/INTEL/pair_lj_cut_coul_long_intel.h | 6 +-- src/INTEL/pair_lj_cut_intel.h | 4 +- src/INTEL/pair_lj_long_coul_long_intel.h | 2 +- src/INTEL/pair_rebo_intel.h | 2 +- src/INTEL/pair_sw_intel.h | 8 ++-- src/INTERLAYER/pair_coul_shield.h | 22 +++++----- src/INTERLAYER/pair_drip.h | 12 +++--- src/INTERLAYER/pair_ilp_graphene_hbn.h | 14 +++---- src/INTERLAYER/pair_kolmogorov_crespi_full.h | 14 +++---- src/INTERLAYER/pair_kolmogorov_crespi_z.h | 12 +++--- src/INTERLAYER/pair_lebedeva_z.h | 12 +++--- src/KOKKOS/pair_buck_coul_cut_kokkos.h | 12 +++--- src/KOKKOS/pair_buck_coul_long_kokkos.h | 14 +++---- src/KOKKOS/pair_buck_kokkos.h | 10 ++--- src/KOKKOS/pair_coul_cut_kokkos.h | 12 +++--- src/KOKKOS/pair_coul_debye_kokkos.h | 12 +++--- src/KOKKOS/pair_coul_dsf_kokkos.h | 6 +-- src/KOKKOS/pair_coul_long_kokkos.h | 14 +++---- src/KOKKOS/pair_coul_wolf_kokkos.h | 6 +-- src/KOKKOS/pair_dpd_fdt_energy_kokkos.h | 10 ++--- src/KOKKOS/pair_eam_alloy_kokkos.h | 28 ++++++------- src/KOKKOS/pair_eam_fs_kokkos.h | 28 ++++++------- src/KOKKOS/pair_eam_kokkos.h | 24 +++++------ src/KOKKOS/pair_exp6_rx_kokkos.h | 14 +++---- src/KOKKOS/pair_gran_hooke_history_kokkos.h | 6 +-- src/KOKKOS/pair_hybrid_kokkos.h | 4 +- src/KOKKOS/pair_hybrid_overlay_kokkos.h | 3 +- ...ir_lj_charmm_coul_charmm_implicit_kokkos.h | 14 +++---- .../pair_lj_charmm_coul_charmm_kokkos.h | 14 +++---- src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_class2_coul_long_kokkos.h | 14 +++---- src/KOKKOS/pair_lj_class2_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h | 10 ++--- src/KOKKOS/pair_lj_cut_coul_long_kokkos.h | 14 +++---- src/KOKKOS/pair_lj_cut_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_expand_kokkos.h | 12 +++--- .../pair_lj_gromacs_coul_gromacs_kokkos.h | 14 +++---- src/KOKKOS/pair_lj_gromacs_kokkos.h | 12 +++--- src/KOKKOS/pair_lj_sdk_kokkos.h | 12 +++--- src/KOKKOS/pair_morse_kokkos.h | 12 +++--- src/KOKKOS/pair_multi_lucy_rx_kokkos.h | 22 +++++----- src/KOKKOS/pair_snap_kokkos.h | 24 +++++------ src/KOKKOS/pair_sw_kokkos.h | 10 ++--- src/KOKKOS/pair_table_kokkos.h | 14 +++---- src/KOKKOS/pair_table_rx_kokkos.h | 18 ++++---- src/KOKKOS/pair_tersoff_kokkos.h | 10 ++--- src/KOKKOS/pair_tersoff_mod_kokkos.h | 10 ++--- src/KOKKOS/pair_tersoff_zbl_kokkos.h | 10 ++--- src/KOKKOS/pair_vashishta_kokkos.h | 10 ++--- src/KOKKOS/pair_yukawa_kokkos.h | 10 ++--- src/KOKKOS/pair_zbl_kokkos.h | 10 ++--- src/KSPACE/pair_born_coul_long.h | 28 ++++++------- src/KSPACE/pair_born_coul_msm.h | 8 ++-- src/KSPACE/pair_buck_coul_long.h | 28 ++++++------- src/KSPACE/pair_buck_coul_msm.h | 8 ++-- src/KSPACE/pair_buck_long_coul_long.h | 34 +++++++-------- src/KSPACE/pair_coul_long.h | 24 +++++------ src/KSPACE/pair_coul_msm.h | 8 ++-- src/KSPACE/pair_coul_streitz.h | 16 +++---- src/KSPACE/pair_lj_charmm_coul_long.h | 34 +++++++-------- src/KSPACE/pair_lj_charmm_coul_msm.h | 10 ++--- src/KSPACE/pair_lj_charmmfsw_coul_long.h | 34 +++++++-------- src/KSPACE/pair_lj_cut_coul_long.h | 34 +++++++-------- src/KSPACE/pair_lj_cut_coul_msm.h | 10 ++--- src/KSPACE/pair_lj_cut_tip4p_long.h | 18 ++++---- src/KSPACE/pair_lj_long_coul_long.h | 34 +++++++-------- src/KSPACE/pair_lj_long_tip4p_long.h | 24 +++++------ src/KSPACE/pair_tip4p_long.h | 18 ++++---- src/KSPACE/pppm_disp_tip4p.h | 2 +- src/MACHDYN/pair_smd_hertz.h | 18 ++++---- src/MANYBODY/pair_adp.h | 22 +++++----- src/MANYBODY/pair_airebo.h | 14 +++---- src/MANYBODY/pair_airebo_morse.h | 2 +- src/MANYBODY/pair_atm.h | 20 ++++----- src/MANYBODY/pair_bop.h | 14 +++---- src/MANYBODY/pair_comb.h | 22 +++++----- src/MANYBODY/pair_comb3.h | 22 +++++----- src/MANYBODY/pair_eam.h | 28 ++++++------- src/MANYBODY/pair_eam_alloy.h | 7 ++-- src/MANYBODY/pair_eam_cd.h | 18 ++++---- src/MANYBODY/pair_eam_fs.h | 8 ++-- src/MANYBODY/pair_eam_he.h | 3 +- src/MANYBODY/pair_edip.h | 12 +++--- src/MANYBODY/pair_edip_multi.h | 14 +++---- src/MANYBODY/pair_eim.h | 22 +++++----- src/MANYBODY/pair_extep.h | 14 +++---- src/MANYBODY/pair_gw.h | 12 +++--- src/MANYBODY/pair_gw_zbl.h | 9 ++-- src/MANYBODY/pair_lcbop.h | 14 +++---- src/MANYBODY/pair_local_density.h | 24 +++++------ src/MANYBODY/pair_meam_spline.h | 24 +++++------ src/MANYBODY/pair_meam_sw_spline.h | 24 +++++------ src/MANYBODY/pair_nb3b_harmonic.h | 12 +++--- src/MANYBODY/pair_polymorphic.h | 12 +++--- src/MANYBODY/pair_rebo.h | 4 +- src/MANYBODY/pair_sw.h | 12 +++--- src/MANYBODY/pair_sw_mod.h | 5 +-- src/MANYBODY/pair_tersoff.h | 12 +++--- src/MANYBODY/pair_tersoff_mod.h | 17 ++++---- src/MANYBODY/pair_tersoff_mod_c.h | 5 +-- src/MANYBODY/pair_tersoff_table.h | 12 +++--- src/MANYBODY/pair_tersoff_zbl.h | 9 ++-- src/MANYBODY/pair_vashishta.h | 12 +++--- src/MANYBODY/pair_vashishta_table.h | 10 ++--- src/MC/pair_dsmc.h | 20 ++++----- src/MEAM/pair_meam.h | 26 ++++++------ src/MESONT/pair_mesocnt.h | 12 +++--- src/MESONT/pair_mesont_tpm.h | 26 ++++++------ src/MGPT/pair_mgpt.h | 14 +++---- src/MISC/pair_agni.h | 12 +++--- src/MISC/pair_list.h | 14 +++---- src/MISC/pair_srp.h | 24 +++++------ src/MISC/pair_tracker.h | 28 ++++++------- src/ML-IAP/mliap_descriptor_so3.h | 14 +++---- src/ML-IAP/mliap_model.h | 2 +- src/ML-IAP/mliap_model_nn.h | 16 +++---- src/ML-IAP/pair_mliap.h | 14 +++---- src/ML-QUIP/pair_quip.h | 12 +++--- src/ML-RANN/pair_rann.h | 14 +++---- src/ML-RANN/rann_activation_linear.h | 6 +-- src/ML-RANN/rann_activation_sig_i.h | 6 +-- src/ML-RANN/rann_fingerprint_bond.h | 14 +++---- src/ML-RANN/rann_fingerprint_bondscreened.h | 14 +++---- .../rann_fingerprint_bondscreenedspin.h | 14 +++---- src/ML-RANN/rann_fingerprint_bondspin.h | 16 +++---- src/ML-RANN/rann_fingerprint_radial.h | 14 +++---- src/ML-RANN/rann_fingerprint_radialscreened.h | 14 +++---- .../rann_fingerprint_radialscreenedspin.h | 16 +++---- src/ML-RANN/rann_fingerprint_radialspin.h | 14 +++---- src/ML-SNAP/pair_snap.h | 16 +++---- src/MOFFF/pair_buck6d_coul_gauss_dsf.h | 28 ++++++------- src/MOFFF/pair_buck6d_coul_gauss_long.h | 28 ++++++------- src/MOLECULE/pair_hbond_dreiding_lj.h | 14 +++---- src/MOLECULE/pair_hbond_dreiding_morse.h | 10 ++--- src/MOLECULE/pair_lj_charmm_coul_charmm.h | 28 ++++++------- .../pair_lj_charmm_coul_charmm_implicit.h | 4 +- .../pair_lj_charmmfsw_coul_charmmfsh.h | 28 ++++++------- src/MOLECULE/pair_lj_cut_tip4p_cut.h | 28 ++++++------- src/MOLECULE/pair_tip4p_cut.h | 22 +++++----- src/OPENMP/pair_adp_omp.h | 4 +- src/OPENMP/pair_agni_omp.h | 4 +- src/OPENMP/pair_airebo_morse_omp.h | 2 +- src/OPENMP/pair_airebo_omp.h | 4 +- src/OPENMP/pair_beck_omp.h | 4 +- src/OPENMP/pair_born_coul_long_omp.h | 4 +- src/OPENMP/pair_born_coul_msm_omp.h | 4 +- src/OPENMP/pair_born_coul_wolf_omp.h | 4 +- src/OPENMP/pair_born_omp.h | 4 +- src/OPENMP/pair_brownian_omp.h | 6 +-- src/OPENMP/pair_brownian_poly_omp.h | 6 +-- src/OPENMP/pair_buck_coul_cut_omp.h | 4 +- src/OPENMP/pair_buck_coul_long_omp.h | 4 +- src/OPENMP/pair_buck_coul_msm_omp.h | 4 +- src/OPENMP/pair_buck_long_coul_long_omp.h | 8 ++-- src/OPENMP/pair_buck_omp.h | 4 +- src/OPENMP/pair_colloid_omp.h | 4 +- src/OPENMP/pair_comb_omp.h | 6 +-- src/OPENMP/pair_coul_cut_global_omp.h | 4 +- src/OPENMP/pair_coul_cut_omp.h | 4 +- src/OPENMP/pair_coul_cut_soft_omp.h | 4 +- src/OPENMP/pair_coul_debye_omp.h | 4 +- src/OPENMP/pair_coul_diel_omp.h | 4 +- src/OPENMP/pair_coul_dsf_omp.h | 4 +- src/OPENMP/pair_coul_long_omp.h | 4 +- src/OPENMP/pair_coul_long_soft_omp.h | 4 +- src/OPENMP/pair_coul_msm_omp.h | 4 +- src/OPENMP/pair_coul_wolf_omp.h | 4 +- src/OPENMP/pair_dpd_omp.h | 6 +-- src/OPENMP/pair_dpd_tstat_omp.h | 6 +-- src/OPENMP/pair_eam_alloy_omp.h | 8 ++-- src/OPENMP/pair_eam_fs_omp.h | 8 ++-- src/OPENMP/pair_eam_omp.h | 4 +- src/OPENMP/pair_edip_omp.h | 4 +- src/OPENMP/pair_eim_omp.h | 4 +- src/OPENMP/pair_gauss_cut_omp.h | 4 +- src/OPENMP/pair_gauss_omp.h | 4 +- src/OPENMP/pair_gayberne_omp.h | 4 +- src/OPENMP/pair_gran_hertz_history_omp.h | 4 +- src/OPENMP/pair_gran_hooke_history_omp.h | 4 +- src/OPENMP/pair_gran_hooke_omp.h | 4 +- src/OPENMP/pair_harmonic_cut_omp.h | 4 +- src/OPENMP/pair_hbond_dreiding_lj_omp.h | 6 +-- src/OPENMP/pair_hbond_dreiding_morse_omp.h | 6 +-- src/OPENMP/pair_lj96_cut_omp.h | 4 +- .../pair_lj_charmm_coul_charmm_implicit_omp.h | 4 +- src/OPENMP/pair_lj_charmm_coul_charmm_omp.h | 4 +- src/OPENMP/pair_lj_charmm_coul_long_omp.h | 4 +- .../pair_lj_charmm_coul_long_soft_omp.h | 4 +- src/OPENMP/pair_lj_charmm_coul_msm_omp.h | 4 +- src/OPENMP/pair_lj_class2_coul_cut_omp.h | 4 +- src/OPENMP/pair_lj_class2_coul_long_omp.h | 4 +- src/OPENMP/pair_lj_class2_omp.h | 4 +- src/OPENMP/pair_lj_cubic_omp.h | 4 +- .../pair_lj_cut_coul_cut_dielectric_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_cut_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_cut_soft_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_debye_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_dsf_omp.h | 4 +- .../pair_lj_cut_coul_long_dielectric_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_long_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_long_soft_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_msm_omp.h | 4 +- src/OPENMP/pair_lj_cut_coul_wolf_omp.h | 4 +- src/OPENMP/pair_lj_cut_dipole_cut_omp.h | 4 +- src/OPENMP/pair_lj_cut_omp.h | 4 +- src/OPENMP/pair_lj_cut_soft_omp.h | 4 +- src/OPENMP/pair_lj_cut_thole_long_omp.h | 2 +- src/OPENMP/pair_lj_cut_tip4p_cut_omp.h | 6 +-- src/OPENMP/pair_lj_cut_tip4p_long_omp.h | 6 +-- src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.h | 6 +-- src/OPENMP/pair_lj_expand_omp.h | 4 +- src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.h | 4 +- src/OPENMP/pair_lj_gromacs_omp.h | 4 +- src/OPENMP/pair_lj_long_coul_long_omp.h | 10 ++--- src/OPENMP/pair_lj_long_tip4p_long_omp.h | 12 +++--- src/OPENMP/pair_lj_relres_omp.h | 4 +- src/OPENMP/pair_lj_sdk_coul_long_omp.h | 4 +- src/OPENMP/pair_lj_sdk_coul_msm_omp.h | 4 +- src/OPENMP/pair_lj_sdk_omp.h | 4 +- src/OPENMP/pair_lj_sf_dipole_sf_omp.h | 4 +- src/OPENMP/pair_lj_smooth_linear_omp.h | 4 +- src/OPENMP/pair_lj_smooth_omp.h | 4 +- src/OPENMP/pair_lubricate_omp.h | 6 +-- src/OPENMP/pair_lubricate_poly_omp.h | 6 +-- src/OPENMP/pair_meam_spline_omp.h | 4 +- src/OPENMP/pair_morse_omp.h | 4 +- src/OPENMP/pair_morse_smooth_linear_omp.h | 4 +- src/OPENMP/pair_nm_cut_coul_cut_omp.h | 4 +- src/OPENMP/pair_nm_cut_coul_long_omp.h | 4 +- src/OPENMP/pair_nm_cut_omp.h | 4 +- src/OPENMP/pair_peri_lps_omp.h | 4 +- src/OPENMP/pair_peri_pmb_omp.h | 4 +- src/OPENMP/pair_reaxff_omp.h | 8 ++-- src/OPENMP/pair_rebo_omp.h | 4 +- src/OPENMP/pair_resquared_omp.h | 4 +- src/OPENMP/pair_soft_omp.h | 4 +- src/OPENMP/pair_sw_mod_omp.h | 5 +-- src/OPENMP/pair_sw_omp.h | 4 +- src/OPENMP/pair_table_omp.h | 4 +- src/OPENMP/pair_tersoff_mod_c_omp.h | 4 +- src/OPENMP/pair_tersoff_mod_omp.h | 4 +- src/OPENMP/pair_tersoff_omp.h | 4 +- src/OPENMP/pair_tersoff_table_omp.h | 10 ++--- src/OPENMP/pair_tersoff_zbl_omp.h | 7 ++-- src/OPENMP/pair_tip4p_cut_omp.h | 6 +-- src/OPENMP/pair_tip4p_long_omp.h | 6 +-- src/OPENMP/pair_tip4p_long_soft_omp.h | 6 +-- src/OPENMP/pair_ufm_omp.h | 4 +- src/OPENMP/pair_vashishta_omp.h | 4 +- src/OPENMP/pair_vashishta_table_omp.h | 4 +- src/OPENMP/pair_yukawa_colloid_omp.h | 4 +- src/OPENMP/pair_yukawa_omp.h | 4 +- src/OPENMP/pair_zbl_omp.h | 4 +- src/OPT/pair_eam_alloy_opt.h | 1 - src/OPT/pair_eam_fs_opt.h | 1 - src/OPT/pair_eam_opt.h | 4 +- src/OPT/pair_lj_charmm_coul_long_opt.h | 2 +- src/OPT/pair_lj_cut_coul_long_opt.h | 2 +- src/OPT/pair_lj_cut_opt.h | 2 +- src/OPT/pair_lj_cut_tip4p_long_opt.h | 5 +-- src/OPT/pair_lj_long_coul_long_opt.h | 4 +- src/OPT/pair_morse_opt.h | 2 +- src/OPT/pair_ufm_opt.h | 2 +- src/PERI/pair_peri.h | 14 +++---- src/PERI/pair_peri_eps.h | 15 ++++--- src/PERI/pair_peri_lps.h | 15 ++++--- src/PERI/pair_peri_pmb.h | 17 ++++---- src/PERI/pair_peri_ves.h | 15 ++++--- src/REAXFF/pair_reaxff.h | 18 ++++---- src/REPLICA/hyper.h | 2 +- src/REPLICA/prd.h | 2 +- src/SMTBQ/pair_smtbq.h | 22 +++++----- src/SPH/pair_sph_heatconduction.h | 12 +++--- src/SPH/pair_sph_idealgas.h | 12 +++--- src/SPH/pair_sph_lj.h | 12 +++--- src/SPH/pair_sph_rhosum.h | 18 ++++---- src/SPH/pair_sph_taitwater.h | 10 ++--- src/SPH/pair_sph_taitwater_morris.h | 10 ++--- src/SPIN/pair_spin.h | 14 +++---- src/SPIN/pair_spin_dipole_cut.h | 24 +++++------ src/SPIN/pair_spin_dipole_long.h | 26 ++++++------ src/SPIN/pair_spin_dmi.h | 24 +++++------ src/SPIN/pair_spin_exchange.h | 24 +++++------ src/SPIN/pair_spin_exchange_biquadratic.h | 24 +++++------ src/SPIN/pair_spin_magelec.h | 24 +++++------ src/SPIN/pair_spin_neel.h | 24 +++++------ src/YAFF/pair_lj_switch3_coulgauss_long.h | 28 ++++++------- src/YAFF/pair_mm3_switch3_coulgauss_long.h | 28 ++++++------- src/compute_erotate_sphere.h | 2 +- src/dump_deprecated.h | 2 +- src/file_writer.h | 2 - src/pair_born.h | 26 ++++++------ src/pair_buck.h | 26 ++++++------ src/pair_buck_coul_cut.h | 28 ++++++------- src/pair_coul_cut.h | 28 ++++++------- src/pair_coul_debye.h | 10 ++--- src/pair_coul_dsf.h | 24 +++++------ src/pair_coul_wolf.h | 22 +++++----- src/pair_deprecated.h | 7 ++-- src/pair_hybrid.h | 42 +++++++++---------- src/pair_hybrid_overlay.h | 8 ++-- src/pair_hybrid_scaled.h | 18 ++++---- src/pair_lj_cut.h | 34 +++++++-------- src/pair_lj_cut_coul_cut.h | 28 ++++++------- src/pair_lj_expand.h | 26 ++++++------ src/pair_morse.h | 26 ++++++------ src/pair_soft.h | 26 ++++++------ src/pair_table.h | 22 +++++----- src/pair_yukawa.h | 24 +++++------ src/pair_zbl.h | 26 ++++++------ src/pair_zero.h | 26 ++++++------ src/reader.h | 1 - src/region_deprecated.h | 2 +- src/text_file_reader.h | 2 - src/tokenizer.h | 2 - 512 files changed, 3316 insertions(+), 3345 deletions(-) diff --git a/src/ASPHERE/pair_gayberne.h b/src/ASPHERE/pair_gayberne.h index 59ee1a0f97..a4bc07587f 100644 --- a/src/ASPHERE/pair_gayberne.h +++ b/src/ASPHERE/pair_gayberne.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairGayBerne : public Pair { public: PairGayBerne(LAMMPS *lmp); - virtual ~PairGayBerne(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); + ~PairGayBerne() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; protected: enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; diff --git a/src/ASPHERE/pair_line_lj.h b/src/ASPHERE/pair_line_lj.h index ac345ba3e4..c76d601b2f 100644 --- a/src/ASPHERE/pair_line_lj.h +++ b/src/ASPHERE/pair_line_lj.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLineLJ : public Pair { public: PairLineLJ(class LAMMPS *); - virtual ~PairLineLJ(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); + ~PairLineLJ() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: double cut_global; diff --git a/src/ASPHERE/pair_resquared.h b/src/ASPHERE/pair_resquared.h index b548311ed5..3f09ca50d8 100644 --- a/src/ASPHERE/pair_resquared.h +++ b/src/ASPHERE/pair_resquared.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class PairRESquared : public Pair { public: PairRESquared(LAMMPS *lmp); - virtual ~PairRESquared(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + ~PairRESquared() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; protected: enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; diff --git a/src/ASPHERE/pair_tri_lj.h b/src/ASPHERE/pair_tri_lj.h index beda914f4a..918a90916e 100644 --- a/src/ASPHERE/pair_tri_lj.h +++ b/src/ASPHERE/pair_tri_lj.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairTriLJ : public Pair { public: PairTriLJ(class LAMMPS *); - virtual ~PairTriLJ(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); + ~PairTriLJ() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: double cut_global; diff --git a/src/BODY/pair_body_nparticle.h b/src/BODY/pair_body_nparticle.h index dad44a38e3..1f3d706201 100644 --- a/src/BODY/pair_body_nparticle.h +++ b/src/BODY/pair_body_nparticle.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairBodyNparticle : public Pair { public: PairBodyNparticle(class LAMMPS *); - ~PairBodyNparticle(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairBodyNparticle() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: double cut_global; diff --git a/src/BODY/pair_body_rounded_polygon.h b/src/BODY/pair_body_rounded_polygon.h index b5a9d7969e..adce835f20 100644 --- a/src/BODY/pair_body_rounded_polygon.h +++ b/src/BODY/pair_body_rounded_polygon.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairBodyRoundedPolygon : public Pair { public: PairBodyRoundedPolygon(class LAMMPS *); - ~PairBodyRoundedPolygon(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairBodyRoundedPolygon() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct Contact { int ibody, jbody; // body (i.e. atom) indices (not tags) diff --git a/src/BODY/pair_body_rounded_polyhedron.h b/src/BODY/pair_body_rounded_polyhedron.h index 4cc225a296..457583b9b1 100644 --- a/src/BODY/pair_body_rounded_polyhedron.h +++ b/src/BODY/pair_body_rounded_polyhedron.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairBodyRoundedPolyhedron : public Pair { public: PairBodyRoundedPolyhedron(class LAMMPS *); - ~PairBodyRoundedPolyhedron(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairBodyRoundedPolyhedron() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; virtual void kernel_force(double R, int itype, int jtype, double &energy, double &fpair); diff --git a/src/CG-DNA/pair_oxdna2_coaxstk.h b/src/CG-DNA/pair_oxdna2_coaxstk.h index 2a323be579..4fe52b6e9b 100644 --- a/src/CG-DNA/pair_oxdna2_coaxstk.h +++ b/src/CG-DNA/pair_oxdna2_coaxstk.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairOxdna2Coaxstk : public Pair { public: PairOxdna2Coaxstk(class LAMMPS *); - virtual ~PairOxdna2Coaxstk(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxdna2Coaxstk() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // coaxial stacking interaction diff --git a/src/CG-DNA/pair_oxdna2_dh.h b/src/CG-DNA/pair_oxdna2_dh.h index 925b53e322..5c79641935 100644 --- a/src/CG-DNA/pair_oxdna2_dh.h +++ b/src/CG-DNA/pair_oxdna2_dh.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairOxdna2Dh : public Pair { public: PairOxdna2Dh(class LAMMPS *); - virtual ~PairOxdna2Dh(); + ~PairOxdna2Dh() override; virtual void compute_interaction_sites(double *, double *, double *, double *); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: double **qeff_dh_pf, **kappa_dh; diff --git a/src/CG-DNA/pair_oxdna2_excv.h b/src/CG-DNA/pair_oxdna2_excv.h index 0fc51406ad..6c37ed9dc8 100644 --- a/src/CG-DNA/pair_oxdna2_excv.h +++ b/src/CG-DNA/pair_oxdna2_excv.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairOxdna2Excv : public PairOxdnaExcv { public: PairOxdna2Excv(class LAMMPS *lmp) : PairOxdnaExcv(lmp) {} - virtual ~PairOxdna2Excv() {} - virtual void compute_interaction_sites(double *, double *, double *, double *, double *); + + void compute_interaction_sites(double *, double *, double *, double *, double *) override; }; } // namespace LAMMPS_NS diff --git a/src/CG-DNA/pair_oxdna_coaxstk.h b/src/CG-DNA/pair_oxdna_coaxstk.h index 5771bbe592..86538a432f 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.h +++ b/src/CG-DNA/pair_oxdna_coaxstk.h @@ -28,19 +28,19 @@ namespace LAMMPS_NS { class PairOxdnaCoaxstk : public Pair { public: PairOxdnaCoaxstk(class LAMMPS *); - virtual ~PairOxdnaCoaxstk(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxdnaCoaxstk() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // coaxial stacking interaction diff --git a/src/CG-DNA/pair_oxdna_excv.h b/src/CG-DNA/pair_oxdna_excv.h index c3ad6cf37a..2e92985e0c 100644 --- a/src/CG-DNA/pair_oxdna_excv.h +++ b/src/CG-DNA/pair_oxdna_excv.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairOxdnaExcv : public Pair { public: PairOxdnaExcv(class LAMMPS *); - virtual ~PairOxdnaExcv(); + ~PairOxdnaExcv() override; virtual void compute_interaction_sites(double *, double *, double *, double *, double *); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // s=sugar-phosphate backbone site, b=base site, st=stacking site diff --git a/src/CG-DNA/pair_oxdna_hbond.h b/src/CG-DNA/pair_oxdna_hbond.h index fdc8e9823b..7c6add7c4a 100644 --- a/src/CG-DNA/pair_oxdna_hbond.h +++ b/src/CG-DNA/pair_oxdna_hbond.h @@ -28,19 +28,19 @@ namespace LAMMPS_NS { class PairOxdnaHbond : public Pair { public: PairOxdnaHbond(class LAMMPS *); - virtual ~PairOxdnaHbond(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxdnaHbond() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // h-bonding interaction diff --git a/src/CG-DNA/pair_oxdna_stk.h b/src/CG-DNA/pair_oxdna_stk.h index 8695f8fd36..1e97f8823c 100644 --- a/src/CG-DNA/pair_oxdna_stk.h +++ b/src/CG-DNA/pair_oxdna_stk.h @@ -28,20 +28,20 @@ namespace LAMMPS_NS { class PairOxdnaStk : public Pair { public: PairOxdnaStk(class LAMMPS *); - virtual ~PairOxdnaStk(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxdnaStk() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // stacking interaction diff --git a/src/CG-DNA/pair_oxdna_xstk.h b/src/CG-DNA/pair_oxdna_xstk.h index 30089f53fb..28fc7fb2f6 100644 --- a/src/CG-DNA/pair_oxdna_xstk.h +++ b/src/CG-DNA/pair_oxdna_xstk.h @@ -28,19 +28,19 @@ namespace LAMMPS_NS { class PairOxdnaXstk : public Pair { public: PairOxdnaXstk(class LAMMPS *); - virtual ~PairOxdnaXstk(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxdnaXstk() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // cross-stacking interaction diff --git a/src/CG-DNA/pair_oxrna2_dh.h b/src/CG-DNA/pair_oxrna2_dh.h index 3008b4cc8c..132805130e 100644 --- a/src/CG-DNA/pair_oxrna2_dh.h +++ b/src/CG-DNA/pair_oxrna2_dh.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairOxrna2Dh : public PairOxdna2Dh { public: PairOxrna2Dh(class LAMMPS *lmp) : PairOxdna2Dh(lmp) {} - virtual ~PairOxrna2Dh() {} - virtual void compute_interaction_sites(double *, double *, double *, double *); + + void compute_interaction_sites(double *, double *, double *, double *) override; }; } // namespace LAMMPS_NS diff --git a/src/CG-DNA/pair_oxrna2_excv.h b/src/CG-DNA/pair_oxrna2_excv.h index 4f404ef103..1f28f865a4 100644 --- a/src/CG-DNA/pair_oxrna2_excv.h +++ b/src/CG-DNA/pair_oxrna2_excv.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairOxrna2Excv : public PairOxdnaExcv { public: PairOxrna2Excv(class LAMMPS *lmp) : PairOxdnaExcv(lmp) {} - virtual ~PairOxrna2Excv() {} - virtual void compute_interaction_sites(double *, double *, double *, double *, double *); + + void compute_interaction_sites(double *, double *, double *, double *, double *) override; }; } // namespace LAMMPS_NS diff --git a/src/CG-DNA/pair_oxrna2_hbond.h b/src/CG-DNA/pair_oxrna2_hbond.h index fe213c5615..7fdd2e8c5b 100644 --- a/src/CG-DNA/pair_oxrna2_hbond.h +++ b/src/CG-DNA/pair_oxrna2_hbond.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class PairOxrna2Hbond : public PairOxdnaHbond { public: PairOxrna2Hbond(class LAMMPS *); - virtual ~PairOxrna2Hbond() {} }; } // namespace LAMMPS_NS diff --git a/src/CG-DNA/pair_oxrna2_stk.h b/src/CG-DNA/pair_oxrna2_stk.h index 23650c98b5..b8b2102a7a 100644 --- a/src/CG-DNA/pair_oxrna2_stk.h +++ b/src/CG-DNA/pair_oxrna2_stk.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairOxrna2Stk : public Pair { public: PairOxrna2Stk(class LAMMPS *); - virtual ~PairOxrna2Stk(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxrna2Stk() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // stacking interaction diff --git a/src/CG-DNA/pair_oxrna2_xstk.h b/src/CG-DNA/pair_oxrna2_xstk.h index 187d0b67ae..6a3f02ee8d 100644 --- a/src/CG-DNA/pair_oxrna2_xstk.h +++ b/src/CG-DNA/pair_oxrna2_xstk.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairOxrna2Xstk : public Pair { public: PairOxrna2Xstk(class LAMMPS *); - virtual ~PairOxrna2Xstk(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_list(int, class NeighList *); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); + ~PairOxrna2Xstk() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: // cross-stacking interaction diff --git a/src/CG-SDK/pair_lj_sdk.h b/src/CG-SDK/pair_lj_sdk.h index fd6a9f7595..28cef78d44 100644 --- a/src/CG-SDK/pair_lj_sdk.h +++ b/src/CG-SDK/pair_lj_sdk.h @@ -31,20 +31,20 @@ namespace LAMMPS_NS { class PairLJSDK : public Pair { public: PairLJSDK(LAMMPS *); - virtual ~PairLJSDK(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); - virtual double memory_usage(); + ~PairLJSDK() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int **lj_type; // type of lennard jones potential diff --git a/src/CG-SDK/pair_lj_sdk_coul_long.h b/src/CG-SDK/pair_lj_sdk_coul_long.h index ea5986284b..6a81a921b5 100644 --- a/src/CG-SDK/pair_lj_sdk_coul_long.h +++ b/src/CG-SDK/pair_lj_sdk_coul_long.h @@ -31,21 +31,21 @@ namespace LAMMPS_NS { class PairLJSDKCoulLong : public Pair { public: PairLJSDKCoulLong(class LAMMPS *); - virtual ~PairLJSDKCoulLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); - virtual double memory_usage(); + ~PairLJSDKCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: double **cut_lj, **cut_ljsq; diff --git a/src/CG-SDK/pair_lj_sdk_coul_msm.h b/src/CG-SDK/pair_lj_sdk_coul_msm.h index 0b4031aa81..3b8c7afe47 100644 --- a/src/CG-SDK/pair_lj_sdk_coul_msm.h +++ b/src/CG-SDK/pair_lj_sdk_coul_msm.h @@ -31,10 +31,9 @@ namespace LAMMPS_NS { class PairLJSDKCoulMSM : public PairLJSDKCoulLong { public: PairLJSDKCoulMSM(class LAMMPS *); - virtual ~PairLJSDKCoulMSM(){}; - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; private: template void eval_msm(); diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h index 8a2e4e506a..bc42d434bc 100644 --- a/src/CLASS2/pair_lj_class2.h +++ b/src/CLASS2/pair_lj_class2.h @@ -25,24 +25,24 @@ namespace LAMMPS_NS { class PairLJClass2 : public Pair { public: PairLJClass2(class LAMMPS *); - virtual ~PairLJClass2(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJClass2() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_global; diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h index cfb718c65f..ae2d54f7b4 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.h +++ b/src/CLASS2/pair_lj_class2_coul_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJClass2CoulCut : public Pair { public: PairLJClass2CoulCut(class LAMMPS *); - virtual ~PairLJClass2CoulCut(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJClass2CoulCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h index f91d3ec54a..06c6547cbd 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.h +++ b/src/CLASS2/pair_lj_class2_coul_long.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class PairLJClass2CoulLong : public Pair { public: PairLJClass2CoulLong(class LAMMPS *); - virtual ~PairLJClass2CoulLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairLJClass2CoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); - void *extract(const char *, int &); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/COLLOID/pair_brownian.h b/src/COLLOID/pair_brownian.h index 0e81f808b6..ded85d7df1 100644 --- a/src/COLLOID/pair_brownian.h +++ b/src/COLLOID/pair_brownian.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class PairBrownian : public Pair { public: PairBrownian(class LAMMPS *); - virtual ~PairBrownian(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual void init_style(); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + ~PairBrownian() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; protected: double cut_inner_global, cut_global; diff --git a/src/COLLOID/pair_brownian_poly.h b/src/COLLOID/pair_brownian_poly.h index 6a9c628e40..110cb1ccd7 100644 --- a/src/COLLOID/pair_brownian_poly.h +++ b/src/COLLOID/pair_brownian_poly.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairBrownianPoly : public PairBrownian { public: PairBrownianPoly(class LAMMPS *); - ~PairBrownianPoly() {} - void compute(int, int); - double init_one(int, int); - void init_style(); + + void compute(int, int) override; + double init_one(int, int) override; + void init_style() override; }; } // namespace LAMMPS_NS diff --git a/src/COLLOID/pair_colloid.h b/src/COLLOID/pair_colloid.h index 6e570dd1f2..5e81051a11 100644 --- a/src/COLLOID/pair_colloid.h +++ b/src/COLLOID/pair_colloid.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairColloid : public Pair { public: PairColloid(class LAMMPS *); - virtual ~PairColloid(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairColloid() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: enum { SMALL_SMALL, SMALL_LARGE, LARGE_LARGE }; diff --git a/src/COLLOID/pair_lubricate.h b/src/COLLOID/pair_lubricate.h index 4fbc3c77a7..cc617f79de 100644 --- a/src/COLLOID/pair_lubricate.h +++ b/src/COLLOID/pair_lubricate.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class PairLubricate : public Pair { public: PairLubricate(class LAMMPS *); - virtual ~PairLubricate(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - virtual void init_style(); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + ~PairLubricate() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; int pre_adapt(char *, int, int, int, int); void adapt(int, int, int, int, int, double); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: double mu, cut_inner_global, cut_global; diff --git a/src/COLLOID/pair_lubricateU.h b/src/COLLOID/pair_lubricateU.h index c857b1ccc1..a8544f261a 100644 --- a/src/COLLOID/pair_lubricateU.h +++ b/src/COLLOID/pair_lubricateU.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLubricateU : public Pair { public: PairLubricateU(class LAMMPS *); - virtual ~PairLubricateU(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - virtual void init_style(); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~PairLubricateU() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: double cut_inner_global, cut_global; diff --git a/src/COLLOID/pair_lubricateU_poly.h b/src/COLLOID/pair_lubricateU_poly.h index af47e731c1..316edcefaf 100644 --- a/src/COLLOID/pair_lubricateU_poly.h +++ b/src/COLLOID/pair_lubricateU_poly.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairLubricateUPoly : public PairLubricateU { public: PairLubricateUPoly(class LAMMPS *); - ~PairLubricateUPoly() {} - void compute(int, int); - void settings(int, char **); - void init_style(); + + void compute(int, int) override; + void settings(int, char **) override; + void init_style() override; private: double vol_P; @@ -38,9 +38,9 @@ class PairLubricateUPoly : public PairLubricateU { class FixWall *wallfix; void iterate(double **, int); - void compute_RE(double **); - void compute_RU(double **); - void compute_Fh(double **); + void compute_RE(double **) override; + void compute_RU(double **) override; + void compute_Fh(double **) override; }; } // namespace LAMMPS_NS diff --git a/src/COLLOID/pair_lubricate_poly.h b/src/COLLOID/pair_lubricate_poly.h index 6fc79a2a3d..12a1dcde1e 100644 --- a/src/COLLOID/pair_lubricate_poly.h +++ b/src/COLLOID/pair_lubricate_poly.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class PairLubricatePoly : public PairLubricate { public: PairLubricatePoly(class LAMMPS *); - ~PairLubricatePoly() {} - void compute(int, int); - void init_style(); + + void compute(int, int) override; + void init_style() override; }; } // namespace LAMMPS_NS diff --git a/src/COLLOID/pair_yukawa_colloid.h b/src/COLLOID/pair_yukawa_colloid.h index fa0dce0d63..ad77da7eea 100644 --- a/src/COLLOID/pair_yukawa_colloid.h +++ b/src/COLLOID/pair_yukawa_colloid.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairYukawaColloid : public PairYukawa { public: PairYukawaColloid(class LAMMPS *); - virtual ~PairYukawaColloid() {} - virtual void compute(int, int); - void init_style(); - double init_one(int, int); - double single(int, int, int, int, double, double, double, double &); + + void compute(int, int) override; + void init_style() override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_born_coul_dsf_cs.h b/src/CORESHELL/pair_born_coul_dsf_cs.h index ac9cf2676b..48d48f3cf9 100644 --- a/src/CORESHELL/pair_born_coul_dsf_cs.h +++ b/src/CORESHELL/pair_born_coul_dsf_cs.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairBornCoulDSFCS : public PairBornCoulDSF { public: PairBornCoulDSFCS(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_born_coul_long_cs.h b/src/CORESHELL/pair_born_coul_long_cs.h index c015a56641..61c6e1a22e 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.h +++ b/src/CORESHELL/pair_born_coul_long_cs.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairBornCoulLongCS : public PairBornCoulLong { public: PairBornCoulLongCS(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_born_coul_wolf_cs.h b/src/CORESHELL/pair_born_coul_wolf_cs.h index 70b1c5a261..433623a3d4 100644 --- a/src/CORESHELL/pair_born_coul_wolf_cs.h +++ b/src/CORESHELL/pair_born_coul_wolf_cs.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairBornCoulWolfCS : public PairBornCoulWolf { public: PairBornCoulWolfCS(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_buck_coul_long_cs.h b/src/CORESHELL/pair_buck_coul_long_cs.h index 12dfe12dc6..8a5ea985e6 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.h +++ b/src/CORESHELL/pair_buck_coul_long_cs.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairBuckCoulLongCS : public PairBuckCoulLong { public: PairBuckCoulLongCS(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_coul_long_cs.h b/src/CORESHELL/pair_coul_long_cs.h index 9b0780d247..d351556c68 100644 --- a/src/CORESHELL/pair_coul_long_cs.h +++ b/src/CORESHELL/pair_coul_long_cs.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairCoulLongCS : public PairCoulLong { public: PairCoulLongCS(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_coul_wolf_cs.h b/src/CORESHELL/pair_coul_wolf_cs.h index 811287548a..5ae626509a 100644 --- a/src/CORESHELL/pair_coul_wolf_cs.h +++ b/src/CORESHELL/pair_coul_wolf_cs.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairCoulWolfCS : public PairCoulWolf { public: PairCoulWolfCS(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.h b/src/CORESHELL/pair_lj_class2_coul_long_cs.h index c08cdb9700..b0f87f1ff3 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.h +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.h @@ -28,10 +28,10 @@ class PairLJClass2CoulLongCS : public PairLJClass2CoulLong { public: PairLJClass2CoulLongCS(class LAMMPS *); - virtual void compute(int, int); - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); + void compute(int, int) override; + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.h b/src/CORESHELL/pair_lj_cut_coul_long_cs.h index 47cf2316da..4bb1f923f5 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.h +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.h @@ -28,10 +28,10 @@ class PairLJCutCoulLongCS : public PairLJCutCoulLong { public: PairLJCutCoulLongCS(class LAMMPS *); - virtual void compute(int, int); - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); + void compute(int, int) override; + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/DIELECTRIC/pair_coul_cut_dielectric.h b/src/DIELECTRIC/pair_coul_cut_dielectric.h index ef6fd3fb45..bc400302db 100644 --- a/src/DIELECTRIC/pair_coul_cut_dielectric.h +++ b/src/DIELECTRIC/pair_coul_cut_dielectric.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairCoulCutDielectric : public PairCoulCut { public: PairCoulCutDielectric(class LAMMPS *); - virtual ~PairCoulCutDielectric(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - void init_style(); + ~PairCoulCutDielectric() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void init_style() override; double **efield; diff --git a/src/DIELECTRIC/pair_coul_long_dielectric.h b/src/DIELECTRIC/pair_coul_long_dielectric.h index 993555e452..2db2ad1086 100644 --- a/src/DIELECTRIC/pair_coul_long_dielectric.h +++ b/src/DIELECTRIC/pair_coul_long_dielectric.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class PairCoulLongDielectric : public PairCoulLong { public: PairCoulLongDielectric(class LAMMPS *); - ~PairCoulLongDielectric(); - virtual void compute(int, int); - virtual void init_style(); + ~PairCoulLongDielectric() override; + void compute(int, int) override; + void init_style() override; double **efield; diff --git a/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.h b/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.h index 93bee549c8..77869b09b9 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.h +++ b/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairLJCutCoulCutDielectric : public PairLJCutCoulCut { public: PairLJCutCoulCutDielectric(class LAMMPS *); - virtual ~PairLJCutCoulCutDielectric(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - void init_style(); + ~PairLJCutCoulCutDielectric() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void init_style() override; double **efield; double *epot; diff --git a/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.h b/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.h index 0301ff4fbd..dbe626e669 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.h +++ b/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairLJCutCoulDebyeDielectric : public PairLJCutCoulDebye { public: PairLJCutCoulDebyeDielectric(class LAMMPS *); - virtual ~PairLJCutCoulDebyeDielectric(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - void init_style(); + ~PairLJCutCoulDebyeDielectric() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void init_style() override; double **efield; double *epot; diff --git a/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.h b/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.h index 06ad1c5e7f..a267da9915 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.h +++ b/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.h @@ -28,10 +28,10 @@ class PairLJCutCoulLongDielectric : public PairLJCutCoulLong { public: PairLJCutCoulLongDielectric(class LAMMPS *); - virtual ~PairLJCutCoulLongDielectric(); - virtual void compute(int, int); - virtual void init_style(); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairLJCutCoulLongDielectric() override; + void compute(int, int) override; + void init_style() override; + double single(int, int, int, int, double, double, double, double &) override; double **efield; double *epot; diff --git a/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.h b/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.h index 3e9e06bbc9..8c0677fbe8 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.h +++ b/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutCoulMSMDielectric : public PairLJCutCoulLong { public: PairLJCutCoulMSMDielectric(class LAMMPS *); - virtual ~PairLJCutCoulMSMDielectric(); - virtual void init_style(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairLJCutCoulMSMDielectric() override; + void init_style() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; double **efield; diff --git a/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.h b/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.h index 83ba66a9a0..ca81a16a1b 100644 --- a/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.h +++ b/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairLJLongCoulLongDielectric : public PairLJLongCoulLong { public: PairLJLongCoulLongDielectric(class LAMMPS *); - virtual ~PairLJLongCoulLongDielectric(); - virtual void compute(int, int); - void init_style(); - double single(int, int, int, int, double, double, double, double &); + ~PairLJLongCoulLongDielectric() override; + void compute(int, int) override; + void init_style() override; + double single(int, int, int, int, double, double, double, double &) override; double **efield; double *epot; diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.h b/src/DIPOLE/pair_lj_cut_dipole_cut.h index 1999e1612e..d2d87e3ae5 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.h +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairLJCutDipoleCut : public Pair { public: PairLJCutDipoleCut(class LAMMPS *); - virtual ~PairLJCutDipoleCut(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void *extract(const char *, int &); + ~PairLJCutDipoleCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.h b/src/DIPOLE/pair_lj_cut_dipole_long.h index bc9e3571da..d563f269a3 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.h +++ b/src/DIPOLE/pair_lj_cut_dipole_long.h @@ -30,17 +30,17 @@ class PairLJCutDipoleLong : public Pair { double **sigma; PairLJCutDipoleLong(class LAMMPS *); - ~PairLJCutDipoleLong(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void *extract(const char *, int &); + ~PairLJCutDipoleLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/DIPOLE/pair_lj_long_dipole_long.h b/src/DIPOLE/pair_lj_long_dipole_long.h index 3669834cc7..b9f09ec9b1 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.h +++ b/src/DIPOLE/pair_lj_long_dipole_long.h @@ -29,18 +29,18 @@ class PairLJLongDipoleLong : public Pair { double cut_coul; PairLJLongDipoleLong(class LAMMPS *); - virtual ~PairLJLongDipoleLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); + ~PairLJLongDipoleLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void *extract(const char *, int &); + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/DIPOLE/pair_lj_sf_dipole_sf.h b/src/DIPOLE/pair_lj_sf_dipole_sf.h index 93d416ec60..22b9320d8a 100644 --- a/src/DIPOLE/pair_lj_sf_dipole_sf.h +++ b/src/DIPOLE/pair_lj_sf_dipole_sf.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJSFDipoleSF : public Pair { public: PairLJSFDipoleSF(class LAMMPS *); - virtual ~PairLJSFDipoleSF(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJSFDipoleSF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/DPD-BASIC/pair_dpd.h b/src/DPD-BASIC/pair_dpd.h index 5bb2ab33ab..796228878c 100644 --- a/src/DPD-BASIC/pair_dpd.h +++ b/src/DPD-BASIC/pair_dpd.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairDPD : public Pair { public: PairDPD(class LAMMPS *); - virtual ~PairDPD(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairDPD() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global, temperature; diff --git a/src/DPD-BASIC/pair_dpd_ext.h b/src/DPD-BASIC/pair_dpd_ext.h index 01436470b0..66df395406 100644 --- a/src/DPD-BASIC/pair_dpd_ext.h +++ b/src/DPD-BASIC/pair_dpd_ext.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairDPDExt : public Pair { public: PairDPDExt(class LAMMPS *); - virtual ~PairDPDExt(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairDPDExt() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global, temperature; diff --git a/src/DPD-BASIC/pair_dpd_ext_tstat.h b/src/DPD-BASIC/pair_dpd_ext_tstat.h index 09f5c9a801..30974c7949 100644 --- a/src/DPD-BASIC/pair_dpd_ext_tstat.h +++ b/src/DPD-BASIC/pair_dpd_ext_tstat.h @@ -27,16 +27,15 @@ namespace LAMMPS_NS { class PairDPDExtTstat : public PairDPDExt { public: PairDPDExtTstat(class LAMMPS *); - ~PairDPDExtTstat() {} - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; protected: double t_start, t_stop; diff --git a/src/DPD-BASIC/pair_dpd_tstat.h b/src/DPD-BASIC/pair_dpd_tstat.h index 4d2e238bb4..c7c41f2b24 100644 --- a/src/DPD-BASIC/pair_dpd_tstat.h +++ b/src/DPD-BASIC/pair_dpd_tstat.h @@ -27,16 +27,15 @@ namespace LAMMPS_NS { class PairDPDTstat : public PairDPD { public: PairDPDTstat(class LAMMPS *); - ~PairDPDTstat() {} - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; protected: double t_start, t_stop; diff --git a/src/DPD-MESO/pair_edpd.h b/src/DPD-MESO/pair_edpd.h index a872401a3b..da8cc37d11 100644 --- a/src/DPD-MESO/pair_edpd.h +++ b/src/DPD-MESO/pair_edpd.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairEDPD : public Pair { public: PairEDPD(class LAMMPS *); - virtual ~PairEDPD(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairEDPD() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/DPD-MESO/pair_mdpd.h b/src/DPD-MESO/pair_mdpd.h index 746a9ee5c0..56a6636d29 100644 --- a/src/DPD-MESO/pair_mdpd.h +++ b/src/DPD-MESO/pair_mdpd.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairMDPD : public Pair { public: PairMDPD(class LAMMPS *); - virtual ~PairMDPD(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); + ~PairMDPD() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; protected: double cut_global, temperature; diff --git a/src/DPD-MESO/pair_mdpd_rhosum.h b/src/DPD-MESO/pair_mdpd_rhosum.h index c31b6be0ca..e7bc7dec23 100644 --- a/src/DPD-MESO/pair_mdpd_rhosum.h +++ b/src/DPD-MESO/pair_mdpd_rhosum.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairMDPDRhoSum : public Pair { public: PairMDPDRhoSum(class LAMMPS *); - virtual ~PairMDPDRhoSum(); - void init_style(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~PairMDPDRhoSum() override; + void init_style() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: double **cut; diff --git a/src/DPD-MESO/pair_tdpd.h b/src/DPD-MESO/pair_tdpd.h index 71be53934e..0390acad2e 100644 --- a/src/DPD-MESO/pair_tdpd.h +++ b/src/DPD-MESO/pair_tdpd.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairTDPD : public Pair { public: PairTDPD(class LAMMPS *); - virtual ~PairTDPD(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairTDPD() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global, temperature; diff --git a/src/DPD-REACT/pair_dpd_fdt.h b/src/DPD-REACT/pair_dpd_fdt.h index d721b056db..29c8808768 100644 --- a/src/DPD-REACT/pair_dpd_fdt.h +++ b/src/DPD-REACT/pair_dpd_fdt.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairDPDfdt : public Pair { public: PairDPDfdt(class LAMMPS *); - virtual ~PairDPDfdt(); - void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairDPDfdt() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; double **cut; double **a0; diff --git a/src/DPD-REACT/pair_dpd_fdt_energy.h b/src/DPD-REACT/pair_dpd_fdt_energy.h index 28fdc06de6..7868caa95e 100644 --- a/src/DPD-REACT/pair_dpd_fdt_energy.h +++ b/src/DPD-REACT/pair_dpd_fdt_energy.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairDPDfdtEnergy : public Pair { public: PairDPDfdtEnergy(class LAMMPS *); - virtual ~PairDPDfdtEnergy(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + ~PairDPDfdtEnergy() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; double **cut; double **a0; diff --git a/src/DPD-REACT/pair_exp6_rx.h b/src/DPD-REACT/pair_exp6_rx.h index 719d8776b0..8c254cd5aa 100644 --- a/src/DPD-REACT/pair_exp6_rx.h +++ b/src/DPD-REACT/pair_exp6_rx.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairExp6rx : public Pair { public: PairExp6rx(class LAMMPS *); - virtual ~PairExp6rx(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + ~PairExp6rx() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; struct Param { double epsilon, rm, alpha; @@ -62,7 +62,7 @@ class PairExp6rx : public Pair { int nspecies; virtual void read_file(char *); void read_file2(char *); - void setup(); + void setup() override; int isite1, isite2; char *site1, *site2; diff --git a/src/DPD-REACT/pair_multi_lucy.h b/src/DPD-REACT/pair_multi_lucy.h index 7de798e9d3..581310758d 100644 --- a/src/DPD-REACT/pair_multi_lucy.h +++ b/src/DPD-REACT/pair_multi_lucy.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairMultiLucy : public Pair { public: PairMultiLucy(class LAMMPS *); - virtual ~PairMultiLucy(); + ~PairMultiLucy() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; void computeLocalDensity(); double rho_0; diff --git a/src/DPD-REACT/pair_multi_lucy_rx.h b/src/DPD-REACT/pair_multi_lucy_rx.h index a0d4caadf5..bfaf09b083 100644 --- a/src/DPD-REACT/pair_multi_lucy_rx.h +++ b/src/DPD-REACT/pair_multi_lucy_rx.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairMultiLucyRX : public Pair { public: PairMultiLucyRX(class LAMMPS *); - virtual ~PairMultiLucyRX(); + ~PairMultiLucyRX() override; - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - virtual int pack_reverse_comm(int, int, double *); - virtual void unpack_reverse_comm(int, int *, double *); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; void computeLocalDensity(); double rho_0; diff --git a/src/DPD-REACT/pair_table_rx.h b/src/DPD-REACT/pair_table_rx.h index 49bf7811a3..1071c8822b 100644 --- a/src/DPD-REACT/pair_table_rx.h +++ b/src/DPD-REACT/pair_table_rx.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairTableRX : public PairTable { public: PairTableRX(class LAMMPS *); - virtual ~PairTableRX(); + ~PairTableRX() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double single(int, int, int, int, double, double, double, double &) override; protected: int nspecies; diff --git a/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.h b/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.h index bafd270e96..475ac1fb53 100644 --- a/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.h +++ b/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.h @@ -31,12 +31,12 @@ namespace LAMMPS_NS { class PairSDPDTaitwaterIsothermal : public Pair { public: PairSDPDTaitwaterIsothermal(class LAMMPS *); - virtual ~PairSDPDTaitwaterIsothermal(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual void init_style(); + ~PairSDPDTaitwaterIsothermal() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; protected: double viscosity, temperature; diff --git a/src/DRUDE/pair_coul_tt.h b/src/DRUDE/pair_coul_tt.h index cb7139a720..bbd2163634 100644 --- a/src/DRUDE/pair_coul_tt.h +++ b/src/DRUDE/pair_coul_tt.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairCoulTT : public Pair { public: PairCoulTT(class LAMMPS *); - virtual ~PairCoulTT(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairCoulTT() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: int n_global; diff --git a/src/DRUDE/pair_lj_cut_thole_long.h b/src/DRUDE/pair_lj_cut_thole_long.h index eb26966d72..3497a78730 100644 --- a/src/DRUDE/pair_lj_cut_thole_long.h +++ b/src/DRUDE/pair_lj_cut_thole_long.h @@ -28,19 +28,19 @@ class PairLJCutTholeLong : public Pair { public: PairLJCutTholeLong(class LAMMPS *); - virtual ~PairLJCutTholeLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual void *extract(const char *, int &); + ~PairLJCutTholeLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/DRUDE/pair_thole.h b/src/DRUDE/pair_thole.h index 15dd1737be..164fb4c398 100644 --- a/src/DRUDE/pair_thole.h +++ b/src/DRUDE/pair_thole.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairThole : public Pair { public: PairThole(class LAMMPS *); - virtual ~PairThole(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairThole() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double thole_global; diff --git a/src/EFF/pair_eff_cut.h b/src/EFF/pair_eff_cut.h index 0e086e62d6..5fcb98063b 100644 --- a/src/EFF/pair_eff_cut.h +++ b/src/EFF/pair_eff_cut.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairEffCut : public Pair { public: PairEffCut(class LAMMPS *); - virtual ~PairEffCut(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); + ~PairEffCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; void min_pointers(double **, double **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; - void min_xf_pointers(int, double **, double **); - void min_xf_get(int); - void min_x_set(int); - double memory_usage(); + void min_xf_pointers(int, double **, double **) override; + void min_xf_get(int) override; + void min_x_set(int) override; + double memory_usage() override; private: int limit_eradius_flag, pressure_with_evirials_flag; diff --git a/src/EXTRA-PAIR/pair_beck.h b/src/EXTRA-PAIR/pair_beck.h index dc19456d64..889004a579 100644 --- a/src/EXTRA-PAIR/pair_beck.h +++ b/src/EXTRA-PAIR/pair_beck.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class PairBeck : public Pair { public: PairBeck(class LAMMPS *); - virtual ~PairBeck(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairBeck() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_born_coul_dsf.h b/src/EXTRA-PAIR/pair_born_coul_dsf.h index 01fa651630..bba1fce560 100644 --- a/src/EXTRA-PAIR/pair_born_coul_dsf.h +++ b/src/EXTRA-PAIR/pair_born_coul_dsf.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairBornCoulDSF : public Pair { public: PairBornCoulDSF(class LAMMPS *); - virtual ~PairBornCoulDSF(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairBornCoulDSF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_lj_global, alpha; diff --git a/src/EXTRA-PAIR/pair_born_coul_wolf.h b/src/EXTRA-PAIR/pair_born_coul_wolf.h index 2ddfe3ebcf..42d85c9b5c 100644 --- a/src/EXTRA-PAIR/pair_born_coul_wolf.h +++ b/src/EXTRA-PAIR/pair_born_coul_wolf.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairBornCoulWolf : public Pair { public: PairBornCoulWolf(class LAMMPS *); - virtual ~PairBornCoulWolf(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairBornCoulWolf() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_lj_global, alf; diff --git a/src/EXTRA-PAIR/pair_buck_mdf.h b/src/EXTRA-PAIR/pair_buck_mdf.h index 0718fbaf71..4dda4f6c10 100644 --- a/src/EXTRA-PAIR/pair_buck_mdf.h +++ b/src/EXTRA-PAIR/pair_buck_mdf.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairBuckMDF : public Pair { public: PairBuckMDF(class LAMMPS *); - virtual ~PairBuckMDF(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairBuckMDF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global, cut_inner_global; diff --git a/src/EXTRA-PAIR/pair_cosine_squared.h b/src/EXTRA-PAIR/pair_cosine_squared.h index e1c87525ed..2dc29daf10 100644 --- a/src/EXTRA-PAIR/pair_cosine_squared.h +++ b/src/EXTRA-PAIR/pair_cosine_squared.h @@ -30,20 +30,20 @@ namespace LAMMPS_NS { class PairCosineSquared : public Pair { public: PairCosineSquared(class LAMMPS *); - virtual ~PairCosineSquared(); - void settings(int, char **); - void coeff(int, char **); + ~PairCosineSquared() override; + void settings(int, char **) override; + void coeff(int, char **) override; // void init_style(); - double init_one(int, int); - void modify_params(int, char **); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual void compute(int, int); - double single(int, int, int, int, double, double, double, double &); + double init_one(int, int) override; + void modify_params(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; // void *extract(const char *, int &); /* RESPA stuff not implemented... diff --git a/src/EXTRA-PAIR/pair_coul_cut_global.h b/src/EXTRA-PAIR/pair_coul_cut_global.h index c7520adc56..39e5e56d68 100644 --- a/src/EXTRA-PAIR/pair_coul_cut_global.h +++ b/src/EXTRA-PAIR/pair_coul_cut_global.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairCoulCutGlobal : public PairCoulCut { public: PairCoulCutGlobal(class LAMMPS *lmp) : PairCoulCut(lmp) {} - void coeff(int, char **); - void *extract(const char *, int &); + void coeff(int, char **) override; + void *extract(const char *, int &) override; }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-PAIR/pair_coul_diel.h b/src/EXTRA-PAIR/pair_coul_diel.h index f15b300fb8..a7dbe6a6d7 100644 --- a/src/EXTRA-PAIR/pair_coul_diel.h +++ b/src/EXTRA-PAIR/pair_coul_diel.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairCoulDiel : public Pair { public: PairCoulDiel(class LAMMPS *); - virtual ~PairCoulDiel(); + ~PairCoulDiel() override; - virtual void compute(int, int); + void compute(int, int) override; - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; - virtual double single(int, int, int, int, double, double, double, double &); + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_coul_exclude.h b/src/EXTRA-PAIR/pair_coul_exclude.h index 38cd30cbb7..69ec59f5ba 100644 --- a/src/EXTRA-PAIR/pair_coul_exclude.h +++ b/src/EXTRA-PAIR/pair_coul_exclude.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairCoulExclude : public Pair { public: PairCoulExclude(class LAMMPS *); - virtual ~PairCoulExclude(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairCoulExclude() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_coul_slater_cut.h b/src/EXTRA-PAIR/pair_coul_slater_cut.h index 4fc43f97e0..1d24f75c39 100644 --- a/src/EXTRA-PAIR/pair_coul_slater_cut.h +++ b/src/EXTRA-PAIR/pair_coul_slater_cut.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairCoulSlaterCut : public PairCoulCut { public: PairCoulSlaterCut(class LAMMPS *); - virtual void compute(int, int); - void settings(int, char **); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double lamda; diff --git a/src/EXTRA-PAIR/pair_coul_slater_long.h b/src/EXTRA-PAIR/pair_coul_slater_long.h index eaa99a9729..66002ca2fa 100644 --- a/src/EXTRA-PAIR/pair_coul_slater_long.h +++ b/src/EXTRA-PAIR/pair_coul_slater_long.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairCoulSlaterLong : public Pair { public: PairCoulSlaterLong(class LAMMPS *); - ~PairCoulSlaterLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairCoulSlaterLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_coul, cut_coulsq, qdist; diff --git a/src/EXTRA-PAIR/pair_e3b.h b/src/EXTRA-PAIR/pair_e3b.h index f6cf916918..a7d5e6d8a5 100644 --- a/src/EXTRA-PAIR/pair_e3b.h +++ b/src/EXTRA-PAIR/pair_e3b.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairE3B : public Pair { public: PairE3B(class LAMMPS *); - virtual ~PairE3B(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - virtual double init_one(int, int); - virtual void init_style(); + ~PairE3B() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; protected: //potential parameters diff --git a/src/EXTRA-PAIR/pair_gauss.h b/src/EXTRA-PAIR/pair_gauss.h index d59ab074ef..70a412c0c1 100644 --- a/src/EXTRA-PAIR/pair_gauss.h +++ b/src/EXTRA-PAIR/pair_gauss.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairGauss : public Pair { public: PairGauss(class LAMMPS *); - virtual ~PairGauss(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *fp); - void write_data_all(FILE *fp); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairGauss() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *fp) override; + void write_data_all(FILE *fp) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_gauss_cut.h b/src/EXTRA-PAIR/pair_gauss_cut.h index b0a05c179d..a485c2637f 100644 --- a/src/EXTRA-PAIR/pair_gauss_cut.h +++ b/src/EXTRA-PAIR/pair_gauss_cut.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class PairGaussCut : public Pair { public: PairGaussCut(class LAMMPS *); - ~PairGaussCut(); + ~PairGaussCut() override; - virtual void compute(int, int); + void compute(int, int) override; - virtual double single(int, int, int, int, double, double, double, double &); + double single(int, int, int, int, double, double, double, double &) override; - virtual void settings(int, char **); - virtual void coeff(int, char **); + void settings(int, char **) override; + void coeff(int, char **) override; - virtual double init_one(int, int); + double init_one(int, int) override; - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *fp); - virtual void write_data_all(FILE *fp); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *fp) override; + void write_data_all(FILE *fp) override; - virtual double memory_usage(); + double memory_usage() override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_harmonic_cut.h b/src/EXTRA-PAIR/pair_harmonic_cut.h index 7dfdea995a..369791747f 100644 --- a/src/EXTRA-PAIR/pair_harmonic_cut.h +++ b/src/EXTRA-PAIR/pair_harmonic_cut.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairHarmonicCut : public Pair { public: PairHarmonicCut(class LAMMPS *); - virtual ~PairHarmonicCut(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairHarmonicCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double **k, **cut; diff --git a/src/EXTRA-PAIR/pair_lennard_mdf.h b/src/EXTRA-PAIR/pair_lennard_mdf.h index 96e7ccb5f7..e830b4f397 100644 --- a/src/EXTRA-PAIR/pair_lennard_mdf.h +++ b/src/EXTRA-PAIR/pair_lennard_mdf.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLennardMDF : public Pair { public: PairLennardMDF(class LAMMPS *); - virtual ~PairLennardMDF(); + ~PairLennardMDF() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global, cut_inner_global; diff --git a/src/EXTRA-PAIR/pair_lj96_cut.h b/src/EXTRA-PAIR/pair_lj96_cut.h index 8bd9829b12..d5084b9719 100644 --- a/src/EXTRA-PAIR/pair_lj96_cut.h +++ b/src/EXTRA-PAIR/pair_lj96_cut.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class PairLJ96Cut : public Pair { public: PairLJ96Cut(class LAMMPS *); - virtual ~PairLJ96Cut(); + ~PairLJ96Cut() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_lj_cubic.h b/src/EXTRA-PAIR/pair_lj_cubic.h index b6db913460..d879020a05 100644 --- a/src/EXTRA-PAIR/pair_lj_cubic.h +++ b/src/EXTRA-PAIR/pair_lj_cubic.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairLJCubic : public Pair { public: PairLJCubic(class LAMMPS *); - virtual ~PairLJCubic(); + ~PairLJCubic() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double **cut, **cut_inner, **cut_inner_sq; diff --git a/src/EXTRA-PAIR/pair_lj_cut_coul_debye.h b/src/EXTRA-PAIR/pair_lj_cut_coul_debye.h index 8d9629db86..208c626cfd 100644 --- a/src/EXTRA-PAIR/pair_lj_cut_coul_debye.h +++ b/src/EXTRA-PAIR/pair_lj_cut_coul_debye.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLJCutCoulDebye : public PairLJCutCoulCut { public: PairLJCutCoulDebye(class LAMMPS *); - virtual ~PairLJCutCoulDebye() {} - virtual void compute(int, int); - void settings(int, char **); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + + void compute(int, int) override; + void settings(int, char **) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double kappa; diff --git a/src/EXTRA-PAIR/pair_lj_cut_coul_dsf.h b/src/EXTRA-PAIR/pair_lj_cut_coul_dsf.h index 200038ae9f..2445c219db 100644 --- a/src/EXTRA-PAIR/pair_lj_cut_coul_dsf.h +++ b/src/EXTRA-PAIR/pair_lj_cut_coul_dsf.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJCutCoulDSF : public Pair { public: PairLJCutCoulDSF(class LAMMPS *); - ~PairLJCutCoulDSF(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJCutCoulDSF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/EXTRA-PAIR/pair_lj_cut_coul_wolf.h b/src/EXTRA-PAIR/pair_lj_cut_coul_wolf.h index 779cc706e6..6ca4bb0166 100644 --- a/src/EXTRA-PAIR/pair_lj_cut_coul_wolf.h +++ b/src/EXTRA-PAIR/pair_lj_cut_coul_wolf.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJCutCoulWolf : public Pair { public: PairLJCutCoulWolf(class LAMMPS *); - virtual ~PairLJCutCoulWolf(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); + ~PairLJCutCoulWolf() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; protected: double cut_lj_global; diff --git a/src/EXTRA-PAIR/pair_lj_expand_coul_long.h b/src/EXTRA-PAIR/pair_lj_expand_coul_long.h index 6d5dddb69e..e0f179ca10 100644 --- a/src/EXTRA-PAIR/pair_lj_expand_coul_long.h +++ b/src/EXTRA-PAIR/pair_lj_expand_coul_long.h @@ -28,24 +28,24 @@ class PairLJExpandCoulLong : public Pair { public: PairLJExpandCoulLong(class LAMMPS *); - virtual ~PairLJExpandCoulLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairLJExpandCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/EXTRA-PAIR/pair_lj_gromacs.h b/src/EXTRA-PAIR/pair_lj_gromacs.h index 5941be6ba5..b0a6cdfd9e 100644 --- a/src/EXTRA-PAIR/pair_lj_gromacs.h +++ b/src/EXTRA-PAIR/pair_lj_gromacs.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJGromacs : public Pair { public: PairLJGromacs(class LAMMPS *); - virtual ~PairLJGromacs(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairLJGromacs() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_inner_global, cut_global; diff --git a/src/EXTRA-PAIR/pair_lj_gromacs_coul_gromacs.h b/src/EXTRA-PAIR/pair_lj_gromacs_coul_gromacs.h index d7075262cc..71c8f0211c 100644 --- a/src/EXTRA-PAIR/pair_lj_gromacs_coul_gromacs.h +++ b/src/EXTRA-PAIR/pair_lj_gromacs_coul_gromacs.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairLJGromacsCoulGromacs : public Pair { public: PairLJGromacsCoulGromacs(class LAMMPS *); - virtual ~PairLJGromacsCoulGromacs(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairLJGromacsCoulGromacs() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_lj_inner, cut_lj, cut_coul_inner, cut_coul; diff --git a/src/EXTRA-PAIR/pair_lj_mdf.h b/src/EXTRA-PAIR/pair_lj_mdf.h index 777e935624..423e8d2f9e 100644 --- a/src/EXTRA-PAIR/pair_lj_mdf.h +++ b/src/EXTRA-PAIR/pair_lj_mdf.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJMDF : public Pair { public: PairLJMDF(class LAMMPS *); - virtual ~PairLJMDF(); + ~PairLJMDF() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global, cut_inner_global; diff --git a/src/EXTRA-PAIR/pair_lj_relres.h b/src/EXTRA-PAIR/pair_lj_relres.h index 7493440abd..ed5ffa80d0 100644 --- a/src/EXTRA-PAIR/pair_lj_relres.h +++ b/src/EXTRA-PAIR/pair_lj_relres.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJRelRes : public Pair { public: PairLJRelRes(class LAMMPS *); - virtual ~PairLJRelRes(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairLJRelRes() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_inner_global, cut_global, cutf_inner_global, cutf_global; diff --git a/src/EXTRA-PAIR/pair_lj_smooth.h b/src/EXTRA-PAIR/pair_lj_smooth.h index bb37a098f6..fd66ff0a24 100644 --- a/src/EXTRA-PAIR/pair_lj_smooth.h +++ b/src/EXTRA-PAIR/pair_lj_smooth.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJSmooth : public Pair { public: PairLJSmooth(class LAMMPS *); - virtual ~PairLJSmooth(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairLJSmooth() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_inner_global, cut_global; diff --git a/src/EXTRA-PAIR/pair_lj_smooth_linear.h b/src/EXTRA-PAIR/pair_lj_smooth_linear.h index 6db6ef5c21..0b7d10ea48 100644 --- a/src/EXTRA-PAIR/pair_lj_smooth_linear.h +++ b/src/EXTRA-PAIR/pair_lj_smooth_linear.h @@ -28,17 +28,17 @@ namespace LAMMPS_NS { class PairLJSmoothLinear : public Pair { public: PairLJSmoothLinear(class LAMMPS *); - virtual ~PairLJSmoothLinear(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); - double single_hessian(int, int, int, int, double, double[3], double, double, double &, double[6]); + ~PairLJSmoothLinear() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + double single_hessian(int, int, int, int, double, double[3], double, double, double &, double[6]) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_mie_cut.h b/src/EXTRA-PAIR/pair_mie_cut.h index 5e4238fddd..f7fe1ff0d2 100644 --- a/src/EXTRA-PAIR/pair_mie_cut.h +++ b/src/EXTRA-PAIR/pair_mie_cut.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairMIECut : public Pair { public: PairMIECut(class LAMMPS *); - virtual ~PairMIECut(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairMIECut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_momb.h b/src/EXTRA-PAIR/pair_momb.h index 1116320ef0..3944390604 100644 --- a/src/EXTRA-PAIR/pair_momb.h +++ b/src/EXTRA-PAIR/pair_momb.h @@ -29,17 +29,17 @@ namespace LAMMPS_NS { class PairMomb : public Pair { public: PairMomb(class LAMMPS *); - virtual ~PairMomb(); + ~PairMomb() override; - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_morse_smooth_linear.h b/src/EXTRA-PAIR/pair_morse_smooth_linear.h index 18f2767b5f..01d7c848ab 100644 --- a/src/EXTRA-PAIR/pair_morse_smooth_linear.h +++ b/src/EXTRA-PAIR/pair_morse_smooth_linear.h @@ -29,20 +29,20 @@ namespace LAMMPS_NS { class PairMorseSmoothLinear : public Pair { public: PairMorseSmoothLinear(class LAMMPS *); - virtual ~PairMorseSmoothLinear(); + ~PairMorseSmoothLinear() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_nm_cut.h b/src/EXTRA-PAIR/pair_nm_cut.h index bf40740abf..da3b6b837b 100644 --- a/src/EXTRA-PAIR/pair_nm_cut.h +++ b/src/EXTRA-PAIR/pair_nm_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairNMCut : public Pair { public: PairNMCut(class LAMMPS *); - virtual ~PairNMCut(); + ~PairNMCut() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_nm_cut_coul_cut.h b/src/EXTRA-PAIR/pair_nm_cut_coul_cut.h index a411c332de..ba054ef849 100644 --- a/src/EXTRA-PAIR/pair_nm_cut_coul_cut.h +++ b/src/EXTRA-PAIR/pair_nm_cut_coul_cut.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class PairNMCutCoulCut : public Pair { public: PairNMCutCoulCut(class LAMMPS *); - virtual ~PairNMCutCoulCut(); + ~PairNMCutCoulCut() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/EXTRA-PAIR/pair_nm_cut_coul_long.h b/src/EXTRA-PAIR/pair_nm_cut_coul_long.h index 1e4989717c..e2d19d14a5 100644 --- a/src/EXTRA-PAIR/pair_nm_cut_coul_long.h +++ b/src/EXTRA-PAIR/pair_nm_cut_coul_long.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairNMCutCoulLong : public Pair { public: PairNMCutCoulLong(class LAMMPS *); - virtual ~PairNMCutCoulLong(); + ~PairNMCutCoulLong() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void *extract(const char *, int &); + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/EXTRA-PAIR/pair_nm_cut_split.h b/src/EXTRA-PAIR/pair_nm_cut_split.h index a05634ada2..68d4dad7de 100644 --- a/src/EXTRA-PAIR/pair_nm_cut_split.h +++ b/src/EXTRA-PAIR/pair_nm_cut_split.h @@ -26,8 +26,8 @@ namespace LAMMPS_NS { class PairNMCutSplit : public PairNMCut { public: PairNMCutSplit(class LAMMPS *); - double single(int, int, int, int, double, double, double, double &); - virtual void compute(int, int); + double single(int, int, int, int, double, double, double, double &) override; + void compute(int, int) override; }; } // namespace LAMMPS_NS #endif diff --git a/src/EXTRA-PAIR/pair_ufm.h b/src/EXTRA-PAIR/pair_ufm.h index 714f886eb0..d8091766a0 100644 --- a/src/EXTRA-PAIR/pair_ufm.h +++ b/src/EXTRA-PAIR/pair_ufm.h @@ -33,19 +33,19 @@ namespace LAMMPS_NS { class PairUFM : public Pair { public: PairUFM(class LAMMPS *); - virtual ~PairUFM(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairUFM() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/EXTRA-PAIR/pair_wf_cut.h b/src/EXTRA-PAIR/pair_wf_cut.h index 132703ce29..61d930b12e 100644 --- a/src/EXTRA-PAIR/pair_wf_cut.h +++ b/src/EXTRA-PAIR/pair_wf_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairWFCut : public Pair { public: PairWFCut(class LAMMPS *); - virtual ~PairWFCut(); + ~PairWFCut() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: int **nu, **mu; diff --git a/src/FEP/pair_coul_cut_soft.h b/src/FEP/pair_coul_cut_soft.h index 92f1fc6efc..862bafce8c 100644 --- a/src/FEP/pair_coul_cut_soft.h +++ b/src/FEP/pair_coul_cut_soft.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairCoulCutSoft : public Pair { public: PairCoulCutSoft(class LAMMPS *); - virtual ~PairCoulCutSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairCoulCutSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/FEP/pair_coul_long_soft.h b/src/FEP/pair_coul_long_soft.h index f5e2e52642..45afeef445 100644 --- a/src/FEP/pair_coul_long_soft.h +++ b/src/FEP/pair_coul_long_soft.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairCoulLongSoft : public Pair { public: PairCoulLongSoft(class LAMMPS *); - virtual ~PairCoulLongSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairCoulLongSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_coul, cut_coulsq; diff --git a/src/FEP/pair_lj_charmm_coul_long_soft.h b/src/FEP/pair_lj_charmm_coul_long_soft.h index 45cdcaf0d2..8190a5109b 100644 --- a/src/FEP/pair_lj_charmm_coul_long_soft.h +++ b/src/FEP/pair_lj_charmm_coul_long_soft.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class PairLJCharmmCoulLongSoft : public Pair { public: PairLJCharmmCoulLongSoft(class LAMMPS *); - virtual ~PairLJCharmmCoulLongSoft(); + ~PairLJCharmmCoulLongSoft() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: int implicit; diff --git a/src/FEP/pair_lj_class2_coul_cut_soft.h b/src/FEP/pair_lj_class2_coul_cut_soft.h index 8533862b0a..3b50b21151 100644 --- a/src/FEP/pair_lj_class2_coul_cut_soft.h +++ b/src/FEP/pair_lj_class2_coul_cut_soft.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJClass2CoulCutSoft : public Pair { public: PairLJClass2CoulCutSoft(class LAMMPS *); - virtual ~PairLJClass2CoulCutSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJClass2CoulCutSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/FEP/pair_lj_class2_coul_long_soft.h b/src/FEP/pair_lj_class2_coul_long_soft.h index 0b7212686b..2d374a91f6 100644 --- a/src/FEP/pair_lj_class2_coul_long_soft.h +++ b/src/FEP/pair_lj_class2_coul_long_soft.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJClass2CoulLongSoft : public Pair { public: PairLJClass2CoulLongSoft(class LAMMPS *); - virtual ~PairLJClass2CoulLongSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJClass2CoulLongSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/FEP/pair_lj_class2_soft.h b/src/FEP/pair_lj_class2_soft.h index 32930b9b86..2a7a3a286f 100644 --- a/src/FEP/pair_lj_class2_soft.h +++ b/src/FEP/pair_lj_class2_soft.h @@ -25,19 +25,19 @@ namespace LAMMPS_NS { class PairLJClass2Soft : public Pair { public: PairLJClass2Soft(class LAMMPS *); - virtual ~PairLJClass2Soft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJClass2Soft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/FEP/pair_lj_cut_coul_cut_soft.h b/src/FEP/pair_lj_cut_coul_cut_soft.h index 3d03da1b7d..b92e29ac44 100644 --- a/src/FEP/pair_lj_cut_coul_cut_soft.h +++ b/src/FEP/pair_lj_cut_coul_cut_soft.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJCutCoulCutSoft : public Pair { public: PairLJCutCoulCutSoft(class LAMMPS *); - virtual ~PairLJCutCoulCutSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJCutCoulCutSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/FEP/pair_lj_cut_coul_long_soft.h b/src/FEP/pair_lj_cut_coul_long_soft.h index b82c673dc5..04add045c8 100644 --- a/src/FEP/pair_lj_cut_coul_long_soft.h +++ b/src/FEP/pair_lj_cut_coul_long_soft.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class PairLJCutCoulLongSoft : public Pair { public: PairLJCutCoulLongSoft(class LAMMPS *); - virtual ~PairLJCutCoulLongSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairLJCutCoulLongSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_lj_global; diff --git a/src/FEP/pair_lj_cut_soft.h b/src/FEP/pair_lj_cut_soft.h index 00f579823c..9c86485ab2 100644 --- a/src/FEP/pair_lj_cut_soft.h +++ b/src/FEP/pair_lj_cut_soft.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class PairLJCutSoft : public Pair { public: PairLJCutSoft(class LAMMPS *); - virtual ~PairLJCutSoft(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJCutSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_global; diff --git a/src/FEP/pair_lj_cut_tip4p_long_soft.h b/src/FEP/pair_lj_cut_tip4p_long_soft.h index cf6ac22126..9a6615c95c 100644 --- a/src/FEP/pair_lj_cut_tip4p_long_soft.h +++ b/src/FEP/pair_lj_cut_tip4p_long_soft.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairLJCutTIP4PLongSoft : public PairLJCutCoulLongSoft { public: PairLJCutTIP4PLongSoft(class LAMMPS *); - virtual ~PairLJCutTIP4PLongSoft(); - virtual void compute(int, int); - void settings(int, char **); - void init_style(); - double init_one(int, int); - void write_restart_settings(FILE *fp); - void read_restart_settings(FILE *fp); - void *extract(const char *, int &); - virtual double memory_usage(); + ~PairLJCutTIP4PLongSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *fp) override; + void read_restart_settings(FILE *fp) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int typeH, typeO; // atom types of TIP4P water H and O atoms diff --git a/src/FEP/pair_morse_soft.h b/src/FEP/pair_morse_soft.h index f6ec254a44..b471938231 100644 --- a/src/FEP/pair_morse_soft.h +++ b/src/FEP/pair_morse_soft.h @@ -31,21 +31,21 @@ class PairMorseSoft : public PairMorse { public: PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp), lambda(nullptr), nlambda(0), shift_range(1.0){}; - virtual ~PairMorseSoft(); - virtual void compute(int, int); + ~PairMorseSoft() override; + void compute(int, int) override; - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double **lambda; @@ -53,7 +53,7 @@ class PairMorseSoft : public PairMorse { int nlambda; double shift_range; - virtual void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/FEP/pair_tip4p_long_soft.h b/src/FEP/pair_tip4p_long_soft.h index 9df7847993..bed6f7f39c 100644 --- a/src/FEP/pair_tip4p_long_soft.h +++ b/src/FEP/pair_tip4p_long_soft.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairTIP4PLongSoft : public PairCoulLongSoft { public: PairTIP4PLongSoft(class LAMMPS *); - virtual ~PairTIP4PLongSoft(); - virtual void compute(int, int); - void settings(int, char **); - void init_style(); - double init_one(int, int); - void write_restart_settings(FILE *fp); - void read_restart_settings(FILE *fp); - void *extract(const char *, int &); - virtual double memory_usage(); + ~PairTIP4PLongSoft() override; + void compute(int, int) override; + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *fp) override; + void read_restart_settings(FILE *fp) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int typeH, typeO; // atom types of TIP4P water H and O atoms diff --git a/src/GPU/pair_beck_gpu.h b/src/GPU/pair_beck_gpu.h index 835bc7e54f..011f3b4177 100644 --- a/src/GPU/pair_beck_gpu.h +++ b/src/GPU/pair_beck_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBeckGPU : public PairBeck { public: PairBeckGPU(LAMMPS *lmp); - ~PairBeckGPU(); + ~PairBeckGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_born_coul_long_cs_gpu.h b/src/GPU/pair_born_coul_long_cs_gpu.h index 228eae6c9b..34a7f41fc4 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.h +++ b/src/GPU/pair_born_coul_long_cs_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBornCoulLongCSGPU : public PairBornCoulLongCS { public: PairBornCoulLongCSGPU(LAMMPS *lmp); - ~PairBornCoulLongCSGPU(); + ~PairBornCoulLongCSGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_born_coul_long_gpu.h b/src/GPU/pair_born_coul_long_gpu.h index 89c44005c2..bbb0f24807 100644 --- a/src/GPU/pair_born_coul_long_gpu.h +++ b/src/GPU/pair_born_coul_long_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBornCoulLongGPU : public PairBornCoulLong { public: PairBornCoulLongGPU(LAMMPS *lmp); - ~PairBornCoulLongGPU(); + ~PairBornCoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.h b/src/GPU/pair_born_coul_wolf_cs_gpu.h index 13a98ba3c0..21391c6588 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.h +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBornCoulWolfCSGPU : public PairBornCoulWolfCS { public: PairBornCoulWolfCSGPU(LAMMPS *lmp); - ~PairBornCoulWolfCSGPU(); + ~PairBornCoulWolfCSGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_born_coul_wolf_gpu.h b/src/GPU/pair_born_coul_wolf_gpu.h index c4c002e841..30d5fff383 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.h +++ b/src/GPU/pair_born_coul_wolf_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBornCoulWolfGPU : public PairBornCoulWolf { public: PairBornCoulWolfGPU(LAMMPS *lmp); - ~PairBornCoulWolfGPU(); + ~PairBornCoulWolfGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_born_gpu.h b/src/GPU/pair_born_gpu.h index b958da28f0..bab342b259 100644 --- a/src/GPU/pair_born_gpu.h +++ b/src/GPU/pair_born_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairBornGPU : public PairBorn { public: PairBornGPU(LAMMPS *lmp); - ~PairBornGPU(); + ~PairBornGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_buck_coul_cut_gpu.h b/src/GPU/pair_buck_coul_cut_gpu.h index 69965a1a53..56d69f00ba 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.h +++ b/src/GPU/pair_buck_coul_cut_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBuckCoulCutGPU : public PairBuckCoulCut { public: PairBuckCoulCutGPU(LAMMPS *lmp); - ~PairBuckCoulCutGPU(); + ~PairBuckCoulCutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_buck_coul_long_gpu.h b/src/GPU/pair_buck_coul_long_gpu.h index 231462d4c4..3e3cb33112 100644 --- a/src/GPU/pair_buck_coul_long_gpu.h +++ b/src/GPU/pair_buck_coul_long_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairBuckCoulLongGPU : public PairBuckCoulLong { public: PairBuckCoulLongGPU(LAMMPS *lmp); - ~PairBuckCoulLongGPU(); + ~PairBuckCoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_buck_gpu.h b/src/GPU/pair_buck_gpu.h index c3b91cbbc1..99fe981d38 100644 --- a/src/GPU/pair_buck_gpu.h +++ b/src/GPU/pair_buck_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairBuckGPU : public PairBuck { public: PairBuckGPU(LAMMPS *lmp); - ~PairBuckGPU(); + ~PairBuckGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_colloid_gpu.h b/src/GPU/pair_colloid_gpu.h index 6e49b8e2ed..5f1f068429 100644 --- a/src/GPU/pair_colloid_gpu.h +++ b/src/GPU/pair_colloid_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairColloidGPU : public PairColloid { public: PairColloidGPU(LAMMPS *lmp); - ~PairColloidGPU(); + ~PairColloidGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_coul_cut_gpu.h b/src/GPU/pair_coul_cut_gpu.h index 9c6d8eb6d6..620f7185eb 100644 --- a/src/GPU/pair_coul_cut_gpu.h +++ b/src/GPU/pair_coul_cut_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairCoulCutGPU : public PairCoulCut { public: PairCoulCutGPU(LAMMPS *lmp); - ~PairCoulCutGPU(); + ~PairCoulCutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_coul_debye_gpu.h b/src/GPU/pair_coul_debye_gpu.h index 6e0efe8808..5efefd9a43 100644 --- a/src/GPU/pair_coul_debye_gpu.h +++ b/src/GPU/pair_coul_debye_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairCoulDebyeGPU : public PairCoulDebye { public: PairCoulDebyeGPU(LAMMPS *lmp); - ~PairCoulDebyeGPU(); + ~PairCoulDebyeGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_coul_dsf_gpu.h b/src/GPU/pair_coul_dsf_gpu.h index b1da9f0742..c6b8803400 100644 --- a/src/GPU/pair_coul_dsf_gpu.h +++ b/src/GPU/pair_coul_dsf_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairCoulDSFGPU : public PairCoulDSF { public: PairCoulDSFGPU(LAMMPS *lmp); - ~PairCoulDSFGPU(); + ~PairCoulDSFGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_coul_long_cs_gpu.h b/src/GPU/pair_coul_long_cs_gpu.h index b26e1c5eb9..30ff080e3c 100644 --- a/src/GPU/pair_coul_long_cs_gpu.h +++ b/src/GPU/pair_coul_long_cs_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairCoulLongCSGPU : public PairCoulLongCS { public: PairCoulLongCSGPU(LAMMPS *lmp); - ~PairCoulLongCSGPU(); + ~PairCoulLongCSGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h index 8dbd0f936a..7012d489e1 100644 --- a/src/GPU/pair_coul_long_gpu.h +++ b/src/GPU/pair_coul_long_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairCoulLongGPU : public PairCoulLong { public: PairCoulLongGPU(LAMMPS *lmp); - ~PairCoulLongGPU(); + ~PairCoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_dpd_gpu.h b/src/GPU/pair_dpd_gpu.h index 72d2c249da..843e2c179d 100644 --- a/src/GPU/pair_dpd_gpu.h +++ b/src/GPU/pair_dpd_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairDPDGPU : public PairDPD { public: PairDPDGPU(LAMMPS *lmp); - ~PairDPDGPU(); + ~PairDPDGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_dpd_tstat_gpu.h b/src/GPU/pair_dpd_tstat_gpu.h index 132360bb1b..6b3da61696 100644 --- a/src/GPU/pair_dpd_tstat_gpu.h +++ b/src/GPU/pair_dpd_tstat_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairDPDTstatGPU : public PairDPDTstat { public: PairDPDTstatGPU(LAMMPS *lmp); - ~PairDPDTstatGPU(); + ~PairDPDTstatGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h index 80125a8425..c2cd8a9732 100644 --- a/src/GPU/pair_eam_alloy_gpu.h +++ b/src/GPU/pair_eam_alloy_gpu.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairEAMAlloyGPU : public PairEAM { public: PairEAMAlloyGPU(class LAMMPS *); - virtual ~PairEAMAlloyGPU(); - void coeff(int, char **); - void compute(int, int); - void init_style(); - double single(int, int, int, int, double, double, double, double &); - double memory_usage(); - void *extract(const char *, int &) { return nullptr; } + ~PairEAMAlloyGPU() override; + void coeff(int, char **) override; + void compute(int, int) override; + void init_style() override; + double single(int, int, int, int, double, double, double, double &) override; + double memory_usage() override; + void *extract(const char *, int &) override { return nullptr; } - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; int gpu_mode; double cpu_time; diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h index 2e5bb46cad..9bb48d2ba5 100644 --- a/src/GPU/pair_eam_fs_gpu.h +++ b/src/GPU/pair_eam_fs_gpu.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairEAMFSGPU : public PairEAM { public: PairEAMFSGPU(class LAMMPS *); - virtual ~PairEAMFSGPU(); - void coeff(int, char **); - void compute(int, int); - void init_style(); - double single(int, int, int, int, double, double, double, double &); - double memory_usage(); - void *extract(const char *, int &) { return nullptr; } + ~PairEAMFSGPU() override; + void coeff(int, char **) override; + void compute(int, int) override; + void init_style() override; + double single(int, int, int, int, double, double, double, double &) override; + double memory_usage() override; + void *extract(const char *, int &) override { return nullptr; } - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; int gpu_mode; double cpu_time; diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h index 1c781dd60a..a3727051ba 100644 --- a/src/GPU/pair_eam_gpu.h +++ b/src/GPU/pair_eam_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairEAMGPU : public PairEAM { public: PairEAMGPU(class LAMMPS *); - virtual ~PairEAMGPU(); - void compute(int, int); - void init_style(); - double single(int, int, int, int, double, double, double, double &); - double memory_usage(); - void *extract(const char *, int &) { return nullptr; } + ~PairEAMGPU() override; + void compute(int, int) override; + void init_style() override; + double single(int, int, int, int, double, double, double, double &) override; + double memory_usage() override; + void *extract(const char *, int &) override { return nullptr; } - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_gauss_gpu.h b/src/GPU/pair_gauss_gpu.h index 3abf57ade6..5df3cce372 100644 --- a/src/GPU/pair_gauss_gpu.h +++ b/src/GPU/pair_gauss_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairGaussGPU : public PairGauss { public: PairGaussGPU(LAMMPS *lmp); - ~PairGaussGPU(); + ~PairGaussGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h index 37c8d59214..bcb9aea958 100644 --- a/src/GPU/pair_gayberne_gpu.h +++ b/src/GPU/pair_gayberne_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairGayBerneGPU : public PairGayBerne { public: PairGayBerneGPU(LAMMPS *lmp); - ~PairGayBerneGPU(); + ~PairGayBerneGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h index eec6eab572..a4ff23f7e7 100644 --- a/src/GPU/pair_lj96_cut_gpu.h +++ b/src/GPU/pair_lj96_cut_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJ96CutGPU : public PairLJ96Cut { public: PairLJ96CutGPU(LAMMPS *lmp); - ~PairLJ96CutGPU(); + ~PairLJ96CutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h index fe3d13d59e..a9e3e6ab5c 100644 --- a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCharmmCoulCharmmGPU : public PairLJCharmmCoulCharmm { public: PairLJCharmmCoulCharmmGPU(LAMMPS *lmp); - ~PairLJCharmmCoulCharmmGPU(); + ~PairLJCharmmCoulCharmmGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h index 4c7313ab0f..d0c2716346 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong { public: PairLJCharmmCoulLongGPU(LAMMPS *lmp); - ~PairLJCharmmCoulLongGPU(); + ~PairLJCharmmCoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h index 8b18d659dd..46e8751ba4 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.h +++ b/src/GPU/pair_lj_class2_coul_long_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong { public: PairLJClass2CoulLongGPU(LAMMPS *lmp); - ~PairLJClass2CoulLongGPU(); + ~PairLJClass2CoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h index 44e24c13f0..35627e5eea 100644 --- a/src/GPU/pair_lj_class2_gpu.h +++ b/src/GPU/pair_lj_class2_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJClass2GPU : public PairLJClass2 { public: PairLJClass2GPU(LAMMPS *lmp); - ~PairLJClass2GPU(); + ~PairLJClass2GPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cubic_gpu.h b/src/GPU/pair_lj_cubic_gpu.h index 30dd23671b..293e86621e 100644 --- a/src/GPU/pair_lj_cubic_gpu.h +++ b/src/GPU/pair_lj_cubic_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCubicGPU : public PairLJCubic { public: PairLJCubicGPU(LAMMPS *lmp); - ~PairLJCubicGPU(); + ~PairLJCubicGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h index 7ccf2b4e0a..0e78142594 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.h +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutCoulCutGPU : public PairLJCutCoulCut { public: PairLJCutCoulCutGPU(LAMMPS *lmp); - ~PairLJCutCoulCutGPU(); + ~PairLJCutCoulCutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.h b/src/GPU/pair_lj_cut_coul_debye_gpu.h index a6803eef1d..777369069b 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.h +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutCoulDebyeGPU : public PairLJCutCoulDebye { public: PairLJCutCoulDebyeGPU(LAMMPS *lmp); - ~PairLJCutCoulDebyeGPU(); + ~PairLJCutCoulDebyeGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.h b/src/GPU/pair_lj_cut_coul_dsf_gpu.h index d39a97bed1..900957de40 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.h +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutCoulDSFGPU : public PairLJCutCoulDSF { public: PairLJCutCoulDSFGPU(LAMMPS *lmp); - ~PairLJCutCoulDSFGPU(); + ~PairLJCutCoulDSFGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h index ef2ed3633c..6eee3d3d96 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.h +++ b/src/GPU/pair_lj_cut_coul_long_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLJCutCoulLongGPU : public PairLJCutCoulLong { public: PairLJCutCoulLongGPU(LAMMPS *lmp); - ~PairLJCutCoulLongGPU(); + ~PairLJCutCoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.h b/src/GPU/pair_lj_cut_coul_msm_gpu.h index 0b6851d56f..ea40dd5d87 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.h +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutCoulMSMGPU : public PairLJCutCoulMSM { public: PairLJCutCoulMSMGPU(LAMMPS *lmp); - ~PairLJCutCoulMSMGPU(); + ~PairLJCutCoulMSMGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.h b/src/GPU/pair_lj_cut_dipole_cut_gpu.h index 6a04332761..ae62abbf18 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.h +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutDipoleCutGPU : public PairLJCutDipoleCut { public: PairLJCutDipoleCutGPU(LAMMPS *lmp); - ~PairLJCutDipoleCutGPU(); + ~PairLJCutDipoleCutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.h b/src/GPU/pair_lj_cut_dipole_long_gpu.h index c87e01ed86..cec97d55b6 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.h +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutDipoleLongGPU : public PairLJCutDipoleLong { public: PairLJCutDipoleLongGPU(LAMMPS *lmp); - ~PairLJCutDipoleLongGPU(); + ~PairLJCutDipoleLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h index edc1436cdf..151e12cf01 100644 --- a/src/GPU/pair_lj_cut_gpu.h +++ b/src/GPU/pair_lj_cut_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLJCutGPU : public PairLJCut { public: PairLJCutGPU(LAMMPS *lmp); - ~PairLJCutGPU(); + ~PairLJCutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.h b/src/GPU/pair_lj_cut_tip4p_long_gpu.h index c2db10c9eb..3d567943c9 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.h +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.h @@ -31,10 +31,10 @@ namespace LAMMPS_NS { class PairLJCutTIP4PLongGPU : public PairLJCutTIP4PLong { public: PairLJCutTIP4PLongGPU(LAMMPS *lmp); - ~PairLJCutTIP4PLongGPU(); - void compute(int, int); - void init_style(); - double memory_usage(); + ~PairLJCutTIP4PLongGPU() override; + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.h b/src/GPU/pair_lj_expand_coul_long_gpu.h index 02582e7b5e..d44cc9c11c 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.h +++ b/src/GPU/pair_lj_expand_coul_long_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLJExpandCoulLongGPU : public PairLJExpandCoulLong { public: PairLJExpandCoulLongGPU(LAMMPS *lmp); - ~PairLJExpandCoulLongGPU(); + ~PairLJExpandCoulLongGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h index 9edb217baa..dee3d25022 100644 --- a/src/GPU/pair_lj_expand_gpu.h +++ b/src/GPU/pair_lj_expand_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLJExpandGPU : public PairLJExpand { public: PairLJExpandGPU(LAMMPS *lmp); - ~PairLJExpandGPU(); + ~PairLJExpandGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_gromacs_gpu.h b/src/GPU/pair_lj_gromacs_gpu.h index 5df649c2c3..ea7bbe81a7 100644 --- a/src/GPU/pair_lj_gromacs_gpu.h +++ b/src/GPU/pair_lj_gromacs_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJGromacsGPU : public PairLJGromacs { public: PairLJGromacsGPU(LAMMPS *lmp); - ~PairLJGromacsGPU(); + ~PairLJGromacsGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_sdk_coul_long_gpu.h index b3148efa0e..0ee52af754 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.h +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJSDKCoulLongGPU : public PairLJSDKCoulLong { public: PairLJSDKCoulLongGPU(LAMMPS *lmp); - ~PairLJSDKCoulLongGPU(); + ~PairLJSDKCoulLongGPU() override; template void cpu_compute(int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_sdk_gpu.h index f71bf64efb..8a70f81a64 100644 --- a/src/GPU/pair_lj_sdk_gpu.h +++ b/src/GPU/pair_lj_sdk_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJSDKGPU : public PairLJSDK { public: PairLJSDKGPU(LAMMPS *lmp); - ~PairLJSDKGPU(); + ~PairLJSDKGPU() override; template void cpu_compute(int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.h b/src/GPU/pair_lj_sf_dipole_sf_gpu.h index 5aaec1e92b..91bb07f244 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.h +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJSFDipoleSFGPU : public PairLJSFDipoleSF { public: PairLJSFDipoleSFGPU(LAMMPS *lmp); - ~PairLJSFDipoleSFGPU(); + ~PairLJSFDipoleSFGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_lj_smooth_gpu.h b/src/GPU/pair_lj_smooth_gpu.h index 2624e54a20..07d9284f56 100644 --- a/src/GPU/pair_lj_smooth_gpu.h +++ b/src/GPU/pair_lj_smooth_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairLJSmoothGPU : public PairLJSmooth { public: PairLJSmoothGPU(LAMMPS *lmp); - ~PairLJSmoothGPU(); + ~PairLJSmoothGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_mie_cut_gpu.h b/src/GPU/pair_mie_cut_gpu.h index c168c69c42..c6516eb01c 100644 --- a/src/GPU/pair_mie_cut_gpu.h +++ b/src/GPU/pair_mie_cut_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairMIECutGPU : public PairMIECut { public: PairMIECutGPU(LAMMPS *lmp); - ~PairMIECutGPU(); + ~PairMIECutGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h index 09d6c53e3b..4da208de23 100644 --- a/src/GPU/pair_morse_gpu.h +++ b/src/GPU/pair_morse_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairMorseGPU : public PairMorse { public: PairMorseGPU(LAMMPS *lmp); - ~PairMorseGPU(); + ~PairMorseGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h index 9096e88f3d..b808607af8 100644 --- a/src/GPU/pair_resquared_gpu.h +++ b/src/GPU/pair_resquared_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairRESquaredGPU : public PairRESquared { public: PairRESquaredGPU(LAMMPS *lmp); - ~PairRESquaredGPU(); + ~PairRESquaredGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_soft_gpu.h b/src/GPU/pair_soft_gpu.h index 3e84d2e58a..2f42a3a075 100644 --- a/src/GPU/pair_soft_gpu.h +++ b/src/GPU/pair_soft_gpu.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairSoftGPU : public PairSoft { public: PairSoftGPU(LAMMPS *lmp); - ~PairSoftGPU(); + ~PairSoftGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_sw_gpu.h b/src/GPU/pair_sw_gpu.h index 8f9abe6478..4fe5d538b3 100644 --- a/src/GPU/pair_sw_gpu.h +++ b/src/GPU/pair_sw_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairSWGPU : public PairSW { public: PairSWGPU(class LAMMPS *); - ~PairSWGPU(); - void compute(int, int); - double init_one(int, int); - void init_style(); + ~PairSWGPU() override; + void compute(int, int) override; + double init_one(int, int) override; + void init_style() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: - void allocate(); + void allocate() override; int gpu_mode; double cpu_time; diff --git a/src/GPU/pair_table_gpu.h b/src/GPU/pair_table_gpu.h index 6623a4c41c..9653e65524 100644 --- a/src/GPU/pair_table_gpu.h +++ b/src/GPU/pair_table_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairTableGPU : public PairTable { public: PairTableGPU(LAMMPS *lmp); - ~PairTableGPU(); + ~PairTableGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_tersoff_gpu.h b/src/GPU/pair_tersoff_gpu.h index 9f981f8ca4..700b0b3284 100644 --- a/src/GPU/pair_tersoff_gpu.h +++ b/src/GPU/pair_tersoff_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairTersoffGPU : public PairTersoff { public: PairTersoffGPU(class LAMMPS *); - ~PairTersoffGPU(); - void compute(int, int); - double init_one(int, int); - void init_style(); + ~PairTersoffGPU() override; + void compute(int, int) override; + double init_one(int, int) override; + void init_style() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: - void allocate(); + void allocate() override; int gpu_mode; double cpu_time; diff --git a/src/GPU/pair_tersoff_mod_gpu.h b/src/GPU/pair_tersoff_mod_gpu.h index 31abc0c258..e7a550b616 100644 --- a/src/GPU/pair_tersoff_mod_gpu.h +++ b/src/GPU/pair_tersoff_mod_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairTersoffMODGPU : public PairTersoffMOD { public: PairTersoffMODGPU(class LAMMPS *); - ~PairTersoffMODGPU(); - void compute(int, int); - double init_one(int, int); - void init_style(); + ~PairTersoffMODGPU() override; + void compute(int, int) override; + double init_one(int, int) override; + void init_style() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: - void allocate(); + void allocate() override; int gpu_mode; double cpu_time; diff --git a/src/GPU/pair_tersoff_zbl_gpu.h b/src/GPU/pair_tersoff_zbl_gpu.h index a52b633302..566d3356b0 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.h +++ b/src/GPU/pair_tersoff_zbl_gpu.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairTersoffZBLGPU : public PairTersoffZBL { public: PairTersoffZBLGPU(class LAMMPS *); - ~PairTersoffZBLGPU(); - void compute(int, int); - double init_one(int, int); - void init_style(); + ~PairTersoffZBLGPU() override; + void compute(int, int) override; + double init_one(int, int) override; + void init_style() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: - void allocate(); + void allocate() override; int gpu_mode; double cpu_time; diff --git a/src/GPU/pair_ufm_gpu.h b/src/GPU/pair_ufm_gpu.h index 0ebd6b7537..43104cb07d 100644 --- a/src/GPU/pair_ufm_gpu.h +++ b/src/GPU/pair_ufm_gpu.h @@ -33,12 +33,12 @@ namespace LAMMPS_NS { class PairUFMGPU : public PairUFM { public: PairUFMGPU(LAMMPS *lmp); - ~PairUFMGPU(); + ~PairUFMGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - void reinit(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + void reinit() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_vashishta_gpu.h b/src/GPU/pair_vashishta_gpu.h index 4f194bffc7..171f8b1b6d 100644 --- a/src/GPU/pair_vashishta_gpu.h +++ b/src/GPU/pair_vashishta_gpu.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairVashishtaGPU : public PairVashishta { public: PairVashishtaGPU(class LAMMPS *); - ~PairVashishtaGPU(); - void compute(int, int); - double init_one(int, int); - void init_style(); + ~PairVashishtaGPU() override; + void compute(int, int) override; + double init_one(int, int) override; + void init_style() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_yukawa_colloid_gpu.h b/src/GPU/pair_yukawa_colloid_gpu.h index 4af9dd1b63..e9a2cff98c 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.h +++ b/src/GPU/pair_yukawa_colloid_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairYukawaColloidGPU : public PairYukawaColloid { public: PairYukawaColloidGPU(LAMMPS *lmp); - ~PairYukawaColloidGPU(); + ~PairYukawaColloidGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_yukawa_gpu.h b/src/GPU/pair_yukawa_gpu.h index a8a9194784..b08376e528 100644 --- a/src/GPU/pair_yukawa_gpu.h +++ b/src/GPU/pair_yukawa_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairYukawaGPU : public PairYukawa { public: PairYukawaGPU(LAMMPS *lmp); - ~PairYukawaGPU(); + ~PairYukawaGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GPU/pair_zbl_gpu.h b/src/GPU/pair_zbl_gpu.h index 39811598b3..6fcfd82abd 100644 --- a/src/GPU/pair_zbl_gpu.h +++ b/src/GPU/pair_zbl_gpu.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairZBLGPU : public PairZBL { public: PairZBLGPU(LAMMPS *lmp); - ~PairZBLGPU(); + ~PairZBLGPU() override; void cpu_compute(int, int, int, int, int *, int *, int **); - void compute(int, int); - void init_style(); - double memory_usage(); + void compute(int, int) override; + void init_style() override; + double memory_usage() override; enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; diff --git a/src/GRANULAR/pair_gran_hertz_history.h b/src/GRANULAR/pair_gran_hertz_history.h index 1b02567119..cc8f79347c 100644 --- a/src/GRANULAR/pair_gran_hertz_history.h +++ b/src/GRANULAR/pair_gran_hertz_history.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class PairGranHertzHistory : public PairGranHookeHistory { public: PairGranHertzHistory(class LAMMPS *); - virtual void compute(int, int); - void settings(int, char **); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + double single(int, int, int, int, double, double, double, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/GRANULAR/pair_gran_hooke.h b/src/GRANULAR/pair_gran_hooke.h index c43394012b..7f616d9c98 100644 --- a/src/GRANULAR/pair_gran_hooke.h +++ b/src/GRANULAR/pair_gran_hooke.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairGranHooke : public PairGranHookeHistory { public: PairGranHooke(class LAMMPS *); - virtual void compute(int, int); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index 22557bba6a..e81e5c0939 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -27,23 +27,23 @@ namespace LAMMPS_NS { class PairGranHookeHistory : public Pair { public: PairGranHookeHistory(class LAMMPS *); - virtual ~PairGranHookeHistory(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void reset_dt(); - virtual double single(int, int, int, int, double, double, double, double &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); - double atom2cut(int); - double radii2cut(double, double); + ~PairGranHookeHistory() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void reset_dt() override; + double single(int, int, int, int, double, double, double, double &) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; + double atom2cut(int) override; + double radii2cut(double, double) override; protected: double kn, kt, gamman, gammat, xmu; diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 3430f0ebb7..5961e28887 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -27,21 +27,21 @@ namespace LAMMPS_NS { class PairGranular : public Pair { public: PairGranular(class LAMMPS *); - ~PairGranular(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void reset_dt(); - double single(int, int, int, int, double, double, double, double &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); - double atom2cut(int); - double radii2cut(double, double); + ~PairGranular() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void reset_dt() override; + double single(int, int, int, int, double, double, double, double &) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + double memory_usage() override; + double atom2cut(int) override; + double radii2cut(double, double) override; protected: double dt; @@ -63,7 +63,7 @@ class PairGranular : public Pair { int nmax; // allocated size of mass_rigid void allocate(); - void transfer_history(double *, double *); + void transfer_history(double *, double *) override; private: int size_history; diff --git a/src/INTEL/pair_airebo_intel.h b/src/INTEL/pair_airebo_intel.h index 32ae3a6581..8cd504aadb 100644 --- a/src/INTEL/pair_airebo_intel.h +++ b/src/INTEL/pair_airebo_intel.h @@ -36,9 +36,9 @@ template struct PairAIREBOIntelParam; class PairAIREBOIntel : public PairAIREBO { public: PairAIREBOIntel(class LAMMPS *); - virtual ~PairAIREBOIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~PairAIREBOIntel() override; + void compute(int, int) override; + void init_style() override; protected: template diff --git a/src/INTEL/pair_airebo_morse_intel.h b/src/INTEL/pair_airebo_morse_intel.h index 75d5808e85..1d75c632ea 100644 --- a/src/INTEL/pair_airebo_morse_intel.h +++ b/src/INTEL/pair_airebo_morse_intel.h @@ -32,7 +32,7 @@ namespace LAMMPS_NS { class PairAIREBOMorseIntel : public PairAIREBOIntel { public: PairAIREBOMorseIntel(class LAMMPS *); - virtual void settings(int, char **); + void settings(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/INTEL/pair_buck_coul_cut_intel.h b/src/INTEL/pair_buck_coul_cut_intel.h index 9fe35affe4..731536a6c6 100644 --- a/src/INTEL/pair_buck_coul_cut_intel.h +++ b/src/INTEL/pair_buck_coul_cut_intel.h @@ -35,9 +35,9 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut { public: PairBuckCoulCutIntel(class LAMMPS *); - virtual ~PairBuckCoulCutIntel(); - virtual void compute(int, int); - void init_style(); + ~PairBuckCoulCutIntel() override; + void compute(int, int) override; + void init_style() override; typedef struct { float x, y, z; int w; diff --git a/src/INTEL/pair_buck_coul_long_intel.h b/src/INTEL/pair_buck_coul_long_intel.h index 01865afc56..4412e25a9c 100644 --- a/src/INTEL/pair_buck_coul_long_intel.h +++ b/src/INTEL/pair_buck_coul_long_intel.h @@ -34,9 +34,9 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong { public: PairBuckCoulLongIntel(class LAMMPS *); - virtual ~PairBuckCoulLongIntel(); - virtual void compute(int, int); - void init_style(); + ~PairBuckCoulLongIntel() override; + void compute(int, int) override; + void init_style() override; typedef struct { float x, y, z; int w; diff --git a/src/INTEL/pair_buck_intel.h b/src/INTEL/pair_buck_intel.h index 307c8eb7b0..baebdf8fd6 100644 --- a/src/INTEL/pair_buck_intel.h +++ b/src/INTEL/pair_buck_intel.h @@ -34,9 +34,9 @@ class PairBuckIntel : public PairBuck { public: PairBuckIntel(class LAMMPS *); - virtual ~PairBuckIntel(); - virtual void compute(int, int); - void init_style(); + ~PairBuckIntel() override; + void compute(int, int) override; + void init_style() override; typedef struct { float x, y, z; int w; diff --git a/src/INTEL/pair_dpd_intel.h b/src/INTEL/pair_dpd_intel.h index 3e5c9b7d69..52ba6c3ed3 100644 --- a/src/INTEL/pair_dpd_intel.h +++ b/src/INTEL/pair_dpd_intel.h @@ -41,12 +41,12 @@ class PairDPDIntel : public PairDPD { public: PairDPDIntel(class LAMMPS *); - ~PairDPDIntel(); + ~PairDPDIntel() override; - virtual void compute(int, int); - void settings(int, char **); - void init_style(); - void read_restart_settings(FILE *); + void compute(int, int) override; + void settings(int, char **) override; + void init_style() override; + void read_restart_settings(FILE *) override; private: FixIntel *fix; diff --git a/src/INTEL/pair_eam_alloy_intel.h b/src/INTEL/pair_eam_alloy_intel.h index 07f7df11ca..3b2c640c6f 100644 --- a/src/INTEL/pair_eam_alloy_intel.h +++ b/src/INTEL/pair_eam_alloy_intel.h @@ -30,12 +30,12 @@ namespace LAMMPS_NS { class PairEAMAlloyIntel : virtual public PairEAMIntel { public: PairEAMAlloyIntel(class LAMMPS *); - virtual ~PairEAMAlloyIntel() {} - void coeff(int, char **); + + void coeff(int, char **) override; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; }; } // namespace LAMMPS_NS diff --git a/src/INTEL/pair_eam_fs_intel.h b/src/INTEL/pair_eam_fs_intel.h index 103e3a9c4b..f09274e02a 100644 --- a/src/INTEL/pair_eam_fs_intel.h +++ b/src/INTEL/pair_eam_fs_intel.h @@ -30,12 +30,12 @@ namespace LAMMPS_NS { class PairEAMFSIntel : virtual public PairEAMIntel { public: PairEAMFSIntel(class LAMMPS *); - virtual ~PairEAMFSIntel() {} - void coeff(int, char **); + + void coeff(int, char **) override; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; }; } // namespace LAMMPS_NS diff --git a/src/INTEL/pair_eam_intel.h b/src/INTEL/pair_eam_intel.h index 6ea6a6b06c..54f3da4271 100644 --- a/src/INTEL/pair_eam_intel.h +++ b/src/INTEL/pair_eam_intel.h @@ -31,11 +31,11 @@ class PairEAMIntel : public PairEAM { friend class FixSemiGrandCanonicalMC; // Alex Stukowski option PairEAMIntel(class LAMMPS *); - virtual ~PairEAMIntel(); - virtual void compute(int, int); - void init_style(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~PairEAMIntel() override; + void compute(int, int) override; + void init_style() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: FixIntel *fix; diff --git a/src/INTEL/pair_gayberne_intel.h b/src/INTEL/pair_gayberne_intel.h index 67132770bf..926cbda6fd 100644 --- a/src/INTEL/pair_gayberne_intel.h +++ b/src/INTEL/pair_gayberne_intel.h @@ -35,8 +35,8 @@ class PairGayBerneIntel : public PairGayBerne { public: PairGayBerneIntel(class LAMMPS *); - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; private: template class ForceConst; diff --git a/src/INTEL/pair_lj_charmm_coul_charmm_intel.h b/src/INTEL/pair_lj_charmm_coul_charmm_intel.h index 69cf1bcf17..4915a93dae 100644 --- a/src/INTEL/pair_lj_charmm_coul_charmm_intel.h +++ b/src/INTEL/pair_lj_charmm_coul_charmm_intel.h @@ -34,10 +34,10 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm { public: PairLJCharmmCoulCharmmIntel(class LAMMPS *); - virtual ~PairLJCharmmCoulCharmmIntel(); + ~PairLJCharmmCoulCharmmIntel() override; - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; typedef struct { float x, y, z; diff --git a/src/INTEL/pair_lj_charmm_coul_long_intel.h b/src/INTEL/pair_lj_charmm_coul_long_intel.h index 95366b6218..e3a2065e27 100644 --- a/src/INTEL/pair_lj_charmm_coul_long_intel.h +++ b/src/INTEL/pair_lj_charmm_coul_long_intel.h @@ -34,10 +34,10 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong { public: PairLJCharmmCoulLongIntel(class LAMMPS *); - virtual ~PairLJCharmmCoulLongIntel(); + ~PairLJCharmmCoulLongIntel() override; - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; typedef struct { float x, y, z; diff --git a/src/INTEL/pair_lj_cut_coul_long_intel.h b/src/INTEL/pair_lj_cut_coul_long_intel.h index c72c9a9ded..903e60070b 100644 --- a/src/INTEL/pair_lj_cut_coul_long_intel.h +++ b/src/INTEL/pair_lj_cut_coul_long_intel.h @@ -34,10 +34,10 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong { public: PairLJCutCoulLongIntel(class LAMMPS *); - virtual ~PairLJCutCoulLongIntel(); + ~PairLJCutCoulLongIntel() override; - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; typedef struct { float x, y, z; diff --git a/src/INTEL/pair_lj_cut_intel.h b/src/INTEL/pair_lj_cut_intel.h index 6003a376a0..e65fbf9865 100644 --- a/src/INTEL/pair_lj_cut_intel.h +++ b/src/INTEL/pair_lj_cut_intel.h @@ -35,8 +35,8 @@ class PairLJCutIntel : public PairLJCut { public: PairLJCutIntel(class LAMMPS *); - virtual void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; private: FixIntel *fix; diff --git a/src/INTEL/pair_lj_long_coul_long_intel.h b/src/INTEL/pair_lj_long_coul_long_intel.h index 6faa2519a3..7055930087 100644 --- a/src/INTEL/pair_lj_long_coul_long_intel.h +++ b/src/INTEL/pair_lj_long_coul_long_intel.h @@ -32,7 +32,7 @@ namespace LAMMPS_NS { class PairLJLongCoulLongIntel : public PairLJLongCoulLong { public: PairLJLongCoulLongIntel(class LAMMPS *); - virtual ~PairLJLongCoulLongIntel(); + ~PairLJLongCoulLongIntel() override; }; } // namespace LAMMPS_NS #endif diff --git a/src/INTEL/pair_rebo_intel.h b/src/INTEL/pair_rebo_intel.h index 76b915a1d8..478a95e945 100644 --- a/src/INTEL/pair_rebo_intel.h +++ b/src/INTEL/pair_rebo_intel.h @@ -32,7 +32,7 @@ namespace LAMMPS_NS { class PairREBOIntel : public PairAIREBOIntel { public: PairREBOIntel(class LAMMPS *); - virtual void settings(int, char **); + void settings(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/INTEL/pair_sw_intel.h b/src/INTEL/pair_sw_intel.h index 55da7eb261..b0ade4bb9d 100644 --- a/src/INTEL/pair_sw_intel.h +++ b/src/INTEL/pair_sw_intel.h @@ -33,16 +33,16 @@ namespace LAMMPS_NS { class PairSWIntel : public PairSW { public: PairSWIntel(class LAMMPS *); - virtual ~PairSWIntel(); - virtual void compute(int, int); - virtual void init_style(); + ~PairSWIntel() override; + void compute(int, int) override; + void init_style() override; protected: FixIntel *fix; int _cop; template class ForceConst; - virtual void allocate(); + void allocate() override; template void compute(int eflag, int vflag, IntelBuffers *buffers, diff --git a/src/INTERLAYER/pair_coul_shield.h b/src/INTERLAYER/pair_coul_shield.h index 10ace5ebd2..9bc3a37fce 100644 --- a/src/INTERLAYER/pair_coul_shield.h +++ b/src/INTERLAYER/pair_coul_shield.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairCoulShield : public Pair { public: PairCoulShield(class LAMMPS *); - virtual ~PairCoulShield(); + ~PairCoulShield() override; - virtual void compute(int, int); + void compute(int, int) override; - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; - virtual double single(int, int, int, int, double, double, double, double &); + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/INTERLAYER/pair_drip.h b/src/INTERLAYER/pair_drip.h index eb854b585b..feaa3df570 100644 --- a/src/INTERLAYER/pair_drip.h +++ b/src/INTERLAYER/pair_drip.h @@ -36,13 +36,13 @@ namespace LAMMPS_NS { class PairDRIP : public Pair { public: PairDRIP(class LAMMPS *); - virtual ~PairDRIP(); + ~PairDRIP() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; static constexpr int NPARAMS_PER_LINE = 15; typedef double V3[3]; diff --git a/src/INTERLAYER/pair_ilp_graphene_hbn.h b/src/INTERLAYER/pair_ilp_graphene_hbn.h index c89ef47a21..151f8d1738 100644 --- a/src/INTERLAYER/pair_ilp_graphene_hbn.h +++ b/src/INTERLAYER/pair_ilp_graphene_hbn.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairILPGrapheneHBN : public Pair { public: PairILPGrapheneHBN(class LAMMPS *); - virtual ~PairILPGrapheneHBN(); + ~PairILPGrapheneHBN() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; void ILP_neigh(); void calc_normal(); void calc_FRep(int, int); void calc_FvdW(int, int); - double single(int, int, int, int, double, double, double, double &); + double single(int, int, int, int, double, double, double, double &) override; static constexpr int NPARAMS_PER_LINE = 13; diff --git a/src/INTERLAYER/pair_kolmogorov_crespi_full.h b/src/INTERLAYER/pair_kolmogorov_crespi_full.h index b7264a0883..1176b13d52 100644 --- a/src/INTERLAYER/pair_kolmogorov_crespi_full.h +++ b/src/INTERLAYER/pair_kolmogorov_crespi_full.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairKolmogorovCrespiFull : public Pair { public: PairKolmogorovCrespiFull(class LAMMPS *); - virtual ~PairKolmogorovCrespiFull(); + ~PairKolmogorovCrespiFull() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; void KC_neigh(); void calc_normal(); void calc_FRep(int, int); void calc_FvdW(int, int); - double single(int, int, int, int, double, double, double, double &); + double single(int, int, int, int, double, double, double, double &) override; static constexpr int NPARAMS_PER_LINE = 12; diff --git a/src/INTERLAYER/pair_kolmogorov_crespi_z.h b/src/INTERLAYER/pair_kolmogorov_crespi_z.h index dc73f838a2..61e8dba7bd 100644 --- a/src/INTERLAYER/pair_kolmogorov_crespi_z.h +++ b/src/INTERLAYER/pair_kolmogorov_crespi_z.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairKolmogorovCrespiZ : public Pair { public: PairKolmogorovCrespiZ(class LAMMPS *); - virtual ~PairKolmogorovCrespiZ(); + ~PairKolmogorovCrespiZ() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; static constexpr int NPARAMS_PER_LINE = 11; diff --git a/src/INTERLAYER/pair_lebedeva_z.h b/src/INTERLAYER/pair_lebedeva_z.h index 9b715b185d..8b59e0115f 100644 --- a/src/INTERLAYER/pair_lebedeva_z.h +++ b/src/INTERLAYER/pair_lebedeva_z.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairLebedevaZ : public Pair { public: PairLebedevaZ(class LAMMPS *); - virtual ~PairLebedevaZ(); + ~PairLebedevaZ() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; static constexpr int NPARAMS_PER_LINE = 12; diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.h b/src/KOKKOS/pair_buck_coul_cut_kokkos.h index 265d625a65..482ee8adf0 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.h @@ -37,13 +37,13 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut { typedef DeviceType device_type; typedef ArrayTypes AT; PairBuckCoulCutKokkos(class LAMMPS *); - ~PairBuckCoulCutKokkos(); + ~PairBuckCoulCutKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_buck_coul{ KOKKOS_INLINE_FUNCTION @@ -110,7 +110,7 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut { double special_lj[4], special_coul[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.h b/src/KOKKOS/pair_buck_coul_long_kokkos.h index 3a1a8ad9ab..d3119a48bb 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.h @@ -37,14 +37,14 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong { typedef DeviceType device_type; typedef ArrayTypes AT; PairBuckCoulLongKokkos(class LAMMPS *); - ~PairBuckCoulLongKokkos(); + ~PairBuckCoulLongKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; struct params_buck_coul{ KOKKOS_INLINE_FUNCTION @@ -113,7 +113,7 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong { double special_lj[4], special_coul[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_buck_kokkos.h b/src/KOKKOS/pair_buck_kokkos.h index 7f5f63df3c..a5b056978d 100644 --- a/src/KOKKOS/pair_buck_kokkos.h +++ b/src/KOKKOS/pair_buck_kokkos.h @@ -37,12 +37,12 @@ class PairBuckKokkos : public PairBuck { typedef DeviceType device_type; typedef ArrayTypes AT; PairBuckKokkos(class LAMMPS *); - ~PairBuckKokkos(); + ~PairBuckKokkos() override; - void compute(int, int); + void compute(int, int) override; - void init_style(); - double init_one(int, int); + void init_style() override; + double init_one(int, int) override; struct params_buck{ KOKKOS_INLINE_FUNCTION @@ -91,7 +91,7 @@ class PairBuckKokkos : public PairBuck { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_coul_cut_kokkos.h b/src/KOKKOS/pair_coul_cut_kokkos.h index 434abb81c7..8f8da02db6 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_coul_cut_kokkos.h @@ -37,13 +37,13 @@ class PairCoulCutKokkos : public PairCoulCut { typedef DeviceType device_type; typedef ArrayTypes AT; PairCoulCutKokkos(class LAMMPS *); - ~PairCoulCutKokkos(); + ~PairCoulCutKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_coul{ KOKKOS_INLINE_FUNCTION @@ -111,7 +111,7 @@ class PairCoulCutKokkos : public PairCoulCut { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_coul_debye_kokkos.h b/src/KOKKOS/pair_coul_debye_kokkos.h index 87f45c01da..963c42858d 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_coul_debye_kokkos.h @@ -37,13 +37,13 @@ class PairCoulDebyeKokkos : public PairCoulDebye { typedef DeviceType device_type; typedef ArrayTypes AT; PairCoulDebyeKokkos(class LAMMPS *); - ~PairCoulDebyeKokkos(); + ~PairCoulDebyeKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_coul{ KOKKOS_INLINE_FUNCTION @@ -111,7 +111,7 @@ class PairCoulDebyeKokkos : public PairCoulDebye { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_coul_dsf_kokkos.h b/src/KOKKOS/pair_coul_dsf_kokkos.h index 74c3ed2bb7..fdd8556a0d 100644 --- a/src/KOKKOS/pair_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_coul_dsf_kokkos.h @@ -41,10 +41,10 @@ class PairCoulDSFKokkos : public PairCoulDSF { typedef ArrayTypes AT; typedef EV_FLOAT value_type; PairCoulDSFKokkos(class LAMMPS *); - ~PairCoulDSFKokkos(); + ~PairCoulDSFKokkos() override; - void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_coul_long_kokkos.h b/src/KOKKOS/pair_coul_long_kokkos.h index 37e2734f35..5768bfb9bf 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.h +++ b/src/KOKKOS/pair_coul_long_kokkos.h @@ -37,14 +37,14 @@ class PairCoulLongKokkos : public PairCoulLong { typedef DeviceType device_type; typedef ArrayTypes AT; PairCoulLongKokkos(class LAMMPS *); - ~PairCoulLongKokkos(); + ~PairCoulLongKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; struct params_coul{ KOKKOS_INLINE_FUNCTION @@ -112,7 +112,7 @@ class PairCoulLongKokkos : public PairCoulLong { double special_lj[4], special_coul[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_coul_wolf_kokkos.h b/src/KOKKOS/pair_coul_wolf_kokkos.h index afcda38733..dc30a8e08e 100644 --- a/src/KOKKOS/pair_coul_wolf_kokkos.h +++ b/src/KOKKOS/pair_coul_wolf_kokkos.h @@ -41,10 +41,10 @@ class PairCoulWolfKokkos : public PairCoulWolf { typedef ArrayTypes AT; typedef EV_FLOAT value_type; PairCoulWolfKokkos(class LAMMPS *); - ~PairCoulWolfKokkos(); + ~PairCoulWolfKokkos() override; - void compute(int, int); - void init_style(); + void compute(int, int) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h index db471cbd5f..f89c6cfaad 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h @@ -54,10 +54,10 @@ class PairDPDfdtEnergyKokkos : public PairDPDfdtEnergy { typedef EV_FLOAT value_type; PairDPDfdtEnergyKokkos(class LAMMPS *); - virtual ~PairDPDfdtEnergyKokkos(); - virtual void compute(int, int); - void init_style(); - double init_one(int, int); + ~PairDPDfdtEnergyKokkos() override; + void compute(int, int) override; + void init_style() override; + double init_one(int, int) override; KOKKOS_INLINE_FUNCTION void operator()(TagPairDPDfdtEnergyZero, const int&) const; @@ -118,7 +118,7 @@ class PairDPDfdtEnergyKokkos : public PairDPDfdtEnergy { double boltz,ftm2v; double special_lj[4]; - virtual void allocate(); + void allocate() override; Kokkos::DualView k_params; typename Kokkos::DualView PairExp6ParamData; PairExp6ParamDataTypeKokkosVect PairExp6ParamDataVect; - void allocate(); + void allocate() override; DAT::tdual_int_1d k_mol2param; // mapping from molecule to parameters typename AT::t_int_1d_randomread d_mol2param; @@ -178,8 +178,8 @@ class PairExp6rxKokkos : public PairExp6rx { typename ArrayTypes::tdual_ffloat_2d k_cutsq; typename ArrayTypes::t_ffloat_2d d_cutsq; - void read_file(char *); - void setup(); + void read_file(char *) override; + void setup() override; KOKKOS_INLINE_FUNCTION void getMixingWeights(int, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &) const; diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.h b/src/KOKKOS/pair_gran_hooke_history_kokkos.h index 37fb208a70..80693b33ac 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.h +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.h @@ -45,9 +45,9 @@ class PairGranHookeHistoryKokkos : public PairGranHookeHistory { typedef EV_FLOAT value_type; PairGranHookeHistoryKokkos(class LAMMPS *); - virtual ~PairGranHookeHistoryKokkos(); - virtual void compute(int, int); - void init_style(); + ~PairGranHookeHistoryKokkos() override; + void compute(int, int) override; + void init_style() override; KOKKOS_INLINE_FUNCTION void operator()(TagPairGranHookeHistoryReduce, const int ii) const; diff --git a/src/KOKKOS/pair_hybrid_kokkos.h b/src/KOKKOS/pair_hybrid_kokkos.h index fbabe4162c..9086f20fcc 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.h +++ b/src/KOKKOS/pair_hybrid_kokkos.h @@ -38,8 +38,8 @@ class PairHybridKokkos : public PairHybrid { typedef LMPDeviceType device_type; PairHybridKokkos(class LAMMPS *); - virtual ~PairHybridKokkos(); - void compute(int, int); + ~PairHybridKokkos() override; + void compute(int, int) override; private: DAT::t_x_array_randomread x; diff --git a/src/KOKKOS/pair_hybrid_overlay_kokkos.h b/src/KOKKOS/pair_hybrid_overlay_kokkos.h index fc8efd038b..e14e5929c9 100644 --- a/src/KOKKOS/pair_hybrid_overlay_kokkos.h +++ b/src/KOKKOS/pair_hybrid_overlay_kokkos.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class PairHybridOverlayKokkos : public PairHybridKokkos { public: PairHybridOverlayKokkos(class LAMMPS *); - virtual ~PairHybridOverlayKokkos() {} - void coeff(int, char **); + void coeff(int, char **) override; }; } diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h index 6bd1b8e61b..e041afda7f 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h @@ -37,14 +37,14 @@ class PairLJCharmmCoulCharmmImplicitKokkos : public PairLJCharmmCoulCharmmImplic typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCharmmCoulCharmmImplicitKokkos(class LAMMPS *); - ~PairLJCharmmCoulCharmmImplicitKokkos(); + ~PairLJCharmmCoulCharmmImplicitKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; protected: @@ -108,7 +108,7 @@ class PairLJCharmmCoulCharmmImplicitKokkos : public PairLJCharmmCoulCharmmImplic double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h index 4fc65d596e..bc14070a07 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h @@ -37,14 +37,14 @@ class PairLJCharmmCoulCharmmKokkos : public PairLJCharmmCoulCharmm { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCharmmCoulCharmmKokkos(class LAMMPS *); - ~PairLJCharmmCoulCharmmKokkos(); + ~PairLJCharmmCoulCharmmKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; protected: @@ -106,7 +106,7 @@ class PairLJCharmmCoulCharmmKokkos : public PairLJCharmmCoulCharmm { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h index 01d9b73a53..615a1ef9d0 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h @@ -37,13 +37,13 @@ class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCharmmCoulLongKokkos(class LAMMPS *); - ~PairLJCharmmCoulLongKokkos(); + ~PairLJCharmmCoulLongKokkos() override; - void compute(int, int); + void compute(int, int) override; - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; protected: template @@ -104,7 +104,7 @@ class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h index 78d3b0c96e..c1d098b912 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h @@ -37,13 +37,13 @@ class PairLJClass2CoulCutKokkos : public PairLJClass2CoulCut { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJClass2CoulCutKokkos(class LAMMPS *); - ~PairLJClass2CoulCutKokkos(); + ~PairLJClass2CoulCutKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: @@ -103,7 +103,7 @@ class PairLJClass2CoulCutKokkos : public PairLJClass2CoulCut { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h index 7f21ec61dd..c8aa009c55 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h @@ -37,14 +37,14 @@ class PairLJClass2CoulLongKokkos : public PairLJClass2CoulLong { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJClass2CoulLongKokkos(class LAMMPS *); - ~PairLJClass2CoulLongKokkos(); + ~PairLJClass2CoulLongKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; protected: template @@ -106,7 +106,7 @@ class PairLJClass2CoulLongKokkos : public PairLJClass2CoulLong { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_class2_kokkos.h b/src/KOKKOS/pair_lj_class2_kokkos.h index cffaca174e..7e4438d5d6 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_kokkos.h @@ -37,13 +37,13 @@ class PairLJClass2Kokkos : public PairLJClass2 { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJClass2Kokkos(class LAMMPS *); - ~PairLJClass2Kokkos(); + ~PairLJClass2Kokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_lj{ KOKKOS_INLINE_FUNCTION @@ -96,7 +96,7 @@ class PairLJClass2Kokkos : public PairLJClass2 { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h index 9e87daf9bb..68365d8b86 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h @@ -37,13 +37,13 @@ class PairLJCutCoulCutKokkos : public PairLJCutCoulCut { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCutCoulCutKokkos(class LAMMPS *); - ~PairLJCutCoulCutKokkos(); + ~PairLJCutCoulCutKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: template @@ -103,7 +103,7 @@ class PairLJCutCoulCutKokkos : public PairLJCutCoulCut { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h index f93a70e9e3..c967601459 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h @@ -37,13 +37,13 @@ class PairLJCutCoulDebyeKokkos : public PairLJCutCoulDebye { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCutCoulDebyeKokkos(class LAMMPS *); - ~PairLJCutCoulDebyeKokkos(); + ~PairLJCutCoulDebyeKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: template @@ -103,7 +103,7 @@ class PairLJCutCoulDebyeKokkos : public PairLJCutCoulDebye { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h index 96518e6d29..2fd7024e91 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h @@ -37,12 +37,12 @@ class PairLJCutCoulDSFKokkos : public PairLJCutCoulDSF { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCutCoulDSFKokkos(class LAMMPS *); - ~PairLJCutCoulDSFKokkos(); + ~PairLJCutCoulDSFKokkos() override; - void compute(int, int); + void compute(int, int) override; - void init_style(); - double init_one(int, int); + void init_style() override; + double init_one(int, int) override; protected: template @@ -100,7 +100,7 @@ class PairLJCutCoulDSFKokkos : public PairLJCutCoulDSF { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h index dee1e352b0..c3010a108d 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h @@ -37,14 +37,14 @@ class PairLJCutCoulLongKokkos : public PairLJCutCoulLong { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCutCoulLongKokkos(class LAMMPS *); - ~PairLJCutCoulLongKokkos(); + ~PairLJCutCoulLongKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; protected: template @@ -106,7 +106,7 @@ class PairLJCutCoulLongKokkos : public PairLJCutCoulLong { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_kokkos.h index 28b6a33189..96e228011e 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_kokkos.h @@ -37,13 +37,13 @@ class PairLJCutKokkos : public PairLJCut { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJCutKokkos(class LAMMPS *); - ~PairLJCutKokkos(); + ~PairLJCutKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_lj{ KOKKOS_INLINE_FUNCTION @@ -92,7 +92,7 @@ class PairLJCutKokkos : public PairLJCut { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_expand_kokkos.h b/src/KOKKOS/pair_lj_expand_kokkos.h index 47941a9fa1..422ebd0a16 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.h +++ b/src/KOKKOS/pair_lj_expand_kokkos.h @@ -37,13 +37,13 @@ class PairLJExpandKokkos : public PairLJExpand { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJExpandKokkos(class LAMMPS *); - ~PairLJExpandKokkos(); + ~PairLJExpandKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_lj{ KOKKOS_INLINE_FUNCTION @@ -97,7 +97,7 @@ class PairLJExpandKokkos : public PairLJExpand { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h index 760dfc6d4c..4d474159ed 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h @@ -37,14 +37,14 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJGromacsCoulGromacsKokkos(class LAMMPS *); - ~PairLJGromacsCoulGromacsKokkos(); + ~PairLJGromacsCoulGromacsKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_tables(double cut_coul, double *cut_respa); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_tables(double cut_coul, double *cut_respa) override; + void init_style() override; + double init_one(int, int) override; struct params_lj_coul_gromacs{ KOKKOS_INLINE_FUNCTION @@ -113,7 +113,7 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_kokkos.h index a72bdf4b99..325931ba9c 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.h @@ -37,13 +37,13 @@ class PairLJGromacsKokkos : public PairLJGromacs { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJGromacsKokkos(class LAMMPS *); - ~PairLJGromacsKokkos(); + ~PairLJGromacsKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_lj{ KOKKOS_INLINE_FUNCTION @@ -113,7 +113,7 @@ class PairLJGromacsKokkos : public PairLJGromacs { double special_lj[4]; double qqrd2e; - void allocate(); + void allocate() override; friend struct PairComputeFunctor >; friend struct PairComputeFunctor >; diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.h b/src/KOKKOS/pair_lj_sdk_kokkos.h index 5b8717c387..95fd80326d 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.h +++ b/src/KOKKOS/pair_lj_sdk_kokkos.h @@ -37,13 +37,13 @@ class PairLJSDKKokkos : public PairLJSDK { typedef DeviceType device_type; typedef ArrayTypes AT; PairLJSDKKokkos(class LAMMPS *); - ~PairLJSDKKokkos(); + ~PairLJSDKKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_lj{ KOKKOS_INLINE_FUNCTION @@ -94,7 +94,7 @@ class PairLJSDKKokkos : public PairLJSDK { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_morse_kokkos.h b/src/KOKKOS/pair_morse_kokkos.h index f8f86d6127..32e057250b 100644 --- a/src/KOKKOS/pair_morse_kokkos.h +++ b/src/KOKKOS/pair_morse_kokkos.h @@ -36,13 +36,13 @@ class PairMorseKokkos : public PairMorse { enum {COUL_FLAG=0}; typedef DeviceType device_type; PairMorseKokkos(class LAMMPS *); - virtual ~PairMorseKokkos(); + ~PairMorseKokkos() override; - void compute(int, int); + void compute(int, int) override; - void settings(int, char **); - void init_style(); - double init_one(int, int); + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; struct params_morse{ KOKKOS_INLINE_FUNCTION @@ -92,7 +92,7 @@ class PairMorseKokkos : public PairMorse { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h index 1ce752a2ac..b6d0ebd767 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h @@ -52,22 +52,22 @@ class PairMultiLucyRXKokkos : public PairMultiLucyRX, public KokkosBase { typedef EV_FLOAT value_type; PairMultiLucyRXKokkos(class LAMMPS *); - virtual ~PairMultiLucyRXKokkos(); + ~PairMultiLucyRXKokkos() override; - void compute(int, int); - void settings(int, char **); + void compute(int, int) override; + void settings(int, char **) override; template void compute_style(int, int); - void init_style(); + void init_style() override; int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, - int, int *); - void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + int, int *) override; + void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; void computeLocalDensity(); KOKKOS_INLINE_FUNCTION @@ -150,7 +150,7 @@ class PairMultiLucyRXKokkos : public PairMultiLucyRX, public KokkosBase { F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; - void allocate(); + void allocate() override; int update_table; void create_kokkos_tables(); diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index e7af536782..b728d92f96 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -124,13 +124,13 @@ public: using SnapAoSoATeamPolicy = typename Kokkos::TeamPolicy, TagPairSNAP>; PairSNAPKokkos(class LAMMPS *); - ~PairSNAPKokkos(); + ~PairSNAPKokkos() override; - void coeff(int, char**); - void init_style(); - double init_one(int, int); - void compute(int, int); - double memory_usage(); + void coeff(int, char**) override; + void init_style() override; + double init_one(int, int) override; + void compute(int, int) override; + double memory_usage() override; template void check_team_size_for(int, int&); @@ -249,7 +249,7 @@ protected: int eflag,vflag; - void allocate(); + void allocate() override; //void read_files(char *, char *); /*template inline int equal(double* x,double* y); @@ -326,11 +326,11 @@ public: PairSNAPKokkosDevice(class LAMMPS *); - void coeff(int, char**); - void init_style(); - double init_one(int, int); - void compute(int, int); - double memory_usage(); + void coeff(int, char**) override; + void init_style() override; + double init_one(int, int) override; + void compute(int, int) override; + double memory_usage() override; }; diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index 2192740674..3513a8d621 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -49,10 +49,10 @@ class PairSWKokkos : public PairSW { typedef EV_FLOAT value_type; PairSWKokkos(class LAMMPS *); - virtual ~PairSWKokkos(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void init_style(); + ~PairSWKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION @@ -112,7 +112,7 @@ class PairSWKokkos : public PairSW { t_param_1d d_params; - virtual void setup_params(); + void setup_params() override; KOKKOS_INLINE_FUNCTION void twobody(const Param&, const F_FLOAT&, F_FLOAT&, const int&, F_FLOAT&) const; diff --git a/src/KOKKOS/pair_table_kokkos.h b/src/KOKKOS/pair_table_kokkos.h index accc763cc5..6574ce807f 100644 --- a/src/KOKKOS/pair_table_kokkos.h +++ b/src/KOKKOS/pair_table_kokkos.h @@ -48,17 +48,17 @@ class PairTableKokkos : public PairTable { typedef ArrayTypes AT; PairTableKokkos(class LAMMPS *); - virtual ~PairTableKokkos(); + ~PairTableKokkos() override; - virtual void compute(int, int); + void compute(int, int) override; template void compute_style(int, int); - void settings(int, char **); - double init_one(int, int); + void settings(int, char **) override; + double init_one(int, int) override; - void init_style(); + void init_style() override; protected: @@ -103,8 +103,8 @@ class PairTableKokkos : public PairTable { typename AT::t_ffloat_2d d_cutsq; - virtual void allocate(); - void compute_table(Table *); + void allocate() override; + void compute_table(Table *) override; typename AT::t_x_array_randomread x; typename AT::t_x_array_const c_x; diff --git a/src/KOKKOS/pair_table_rx_kokkos.h b/src/KOKKOS/pair_table_rx_kokkos.h index e8203445ca..16915eaae0 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.h +++ b/src/KOKKOS/pair_table_rx_kokkos.h @@ -35,19 +35,19 @@ class PairTableRXKokkos : public PairTable { typedef DeviceType device_type; PairTableRXKokkos(class LAMMPS *); - virtual ~PairTableRXKokkos(); + ~PairTableRXKokkos() override; - virtual void compute(int, int); + void compute(int, int) override; template void compute_style(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; - void init_style(); + void init_style() override; struct TableDeviceConst { typename ArrayTypes::t_ffloat_2d cutsq; @@ -81,8 +81,8 @@ class PairTableRXKokkos : public PairTable { typename ArrayTypes::t_ffloat_2d d_cutsq; - virtual void allocate(); - void compute_table(Table *); + void allocate() override; + void compute_table(Table *) override; typename ArrayTypes::t_x_array_randomread x; typename ArrayTypes::t_f_array f; diff --git a/src/KOKKOS/pair_tersoff_kokkos.h b/src/KOKKOS/pair_tersoff_kokkos.h index e61791df39..77da7bad4b 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.h +++ b/src/KOKKOS/pair_tersoff_kokkos.h @@ -50,9 +50,9 @@ class PairTersoffKokkos : public PairTersoff { typedef EV_FLOAT value_type; PairTersoffKokkos(class LAMMPS *); - virtual ~PairTersoffKokkos(); - virtual void compute(int, int); - void init_style(); + ~PairTersoffKokkos() override; + void compute(int, int) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION @@ -177,8 +177,8 @@ class PairTersoffKokkos : public PairTersoff { void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; - void allocate(); - void setup_params(); + void allocate() override; + void setup_params() override; protected: typedef Kokkos::DualView tdual_int_3d; diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.h b/src/KOKKOS/pair_tersoff_mod_kokkos.h index ee589c62cd..ffc8e24ed3 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.h +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.h @@ -50,9 +50,9 @@ class PairTersoffMODKokkos : public PairTersoffMOD { typedef EV_FLOAT value_type; PairTersoffMODKokkos(class LAMMPS *); - virtual ~PairTersoffMODKokkos(); - virtual void compute(int, int); - void init_style(); + ~PairTersoffMODKokkos() override; + void compute(int, int) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION @@ -177,8 +177,8 @@ class PairTersoffMODKokkos : public PairTersoffMOD { void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; - void allocate(); - void setup_params(); + void allocate() override; + void setup_params() override; protected: typedef Kokkos::DualView tdual_int_3d; diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.h b/src/KOKKOS/pair_tersoff_zbl_kokkos.h index 718932026d..9c52c1b2f9 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.h +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.h @@ -50,9 +50,9 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { typedef EV_FLOAT value_type; PairTersoffZBLKokkos(class LAMMPS *); - virtual ~PairTersoffZBLKokkos(); - virtual void compute(int, int); - void init_style(); + ~PairTersoffZBLKokkos() override; + void compute(int, int) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION @@ -176,8 +176,8 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; - void allocate(); - void setup_params(); + void allocate() override; + void setup_params() override; KOKKOS_INLINE_FUNCTION double fermi_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; diff --git a/src/KOKKOS/pair_vashishta_kokkos.h b/src/KOKKOS/pair_vashishta_kokkos.h index e7be57a3b6..e9f9a426c7 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.h +++ b/src/KOKKOS/pair_vashishta_kokkos.h @@ -49,10 +49,10 @@ class PairVashishtaKokkos : public PairVashishta { typedef EV_FLOAT value_type; PairVashishtaKokkos(class LAMMPS *); - virtual ~PairVashishtaKokkos(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void init_style(); + ~PairVashishtaKokkos() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; template KOKKOS_INLINE_FUNCTION @@ -112,7 +112,7 @@ class PairVashishtaKokkos : public PairVashishta { t_param_1d d_params; - virtual void setup_params(); + void setup_params() override; KOKKOS_INLINE_FUNCTION void twobody(const Param&, const F_FLOAT&, F_FLOAT&, const int&, F_FLOAT&) const; diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h index 454c9a5eb7..1671a06f14 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.h +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -38,11 +38,11 @@ class PairYukawaKokkos : public PairYukawa { typedef ArrayTypes AT; PairYukawaKokkos(class LAMMPS *); - virtual ~PairYukawaKokkos(); + ~PairYukawaKokkos() override; - void compute(int, int); - void init_style(); - double init_one(int,int); + void compute(int, int) override; + void init_style() override; + double init_one(int,int) override; struct params_yukawa { KOKKOS_INLINE_FUNCTION @@ -95,7 +95,7 @@ class PairYukawaKokkos : public PairYukawa { int neighflag; int nlocal,nall,eflag,vflag; - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pair_zbl_kokkos.h b/src/KOKKOS/pair_zbl_kokkos.h index ac8f150b7c..507df93fba 100644 --- a/src/KOKKOS/pair_zbl_kokkos.h +++ b/src/KOKKOS/pair_zbl_kokkos.h @@ -38,10 +38,10 @@ class PairZBLKokkos : public PairZBL { typedef ArrayTypes AT; PairZBLKokkos(class LAMMPS *); - virtual ~PairZBLKokkos(); - void compute(int, int); - void init_style(); - F_FLOAT init_one(int, int); + ~PairZBLKokkos() override; + void compute(int, int) override; + void init_style() override; + F_FLOAT init_one(int, int) override; private: DAT::tdual_ffloat_1d k_z; @@ -87,7 +87,7 @@ class PairZBLKokkos : public PairZBL { F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, const int& /*itype*/, const int& /*jtype*/) const { return 0; } - void allocate(); + void allocate() override; friend struct PairComputeFunctor; friend struct PairComputeFunctor; diff --git a/src/KSPACE/pair_born_coul_long.h b/src/KSPACE/pair_born_coul_long.h index 11dd84c202..f7f8b5db3e 100644 --- a/src/KSPACE/pair_born_coul_long.h +++ b/src/KSPACE/pair_born_coul_long.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairBornCoulLong : public Pair { public: PairBornCoulLong(class LAMMPS *); - virtual ~PairBornCoulLong(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairBornCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/KSPACE/pair_born_coul_msm.h b/src/KSPACE/pair_born_coul_msm.h index c5a2255bcd..8338286a65 100644 --- a/src/KSPACE/pair_born_coul_msm.h +++ b/src/KSPACE/pair_born_coul_msm.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairBornCoulMSM : public PairBornCoulLong { public: PairBornCoulMSM(class LAMMPS *); - virtual ~PairBornCoulMSM(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairBornCoulMSM() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: int nmax; diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/KSPACE/pair_buck_coul_long.h index 89a23558ae..62d2619d09 100644 --- a/src/KSPACE/pair_buck_coul_long.h +++ b/src/KSPACE/pair_buck_coul_long.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairBuckCoulLong : public Pair { public: PairBuckCoulLong(class LAMMPS *); - virtual ~PairBuckCoulLong(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairBuckCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/KSPACE/pair_buck_coul_msm.h b/src/KSPACE/pair_buck_coul_msm.h index ee52d2235b..006c9032c0 100644 --- a/src/KSPACE/pair_buck_coul_msm.h +++ b/src/KSPACE/pair_buck_coul_msm.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairBuckCoulMSM : public PairBuckCoulLong { public: PairBuckCoulMSM(class LAMMPS *); - virtual ~PairBuckCoulMSM(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairBuckCoulMSM() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: int nmax; diff --git a/src/KSPACE/pair_buck_long_coul_long.h b/src/KSPACE/pair_buck_long_coul_long.h index 1dab289c20..3bb1723b3d 100644 --- a/src/KSPACE/pair_buck_long_coul_long.h +++ b/src/KSPACE/pair_buck_long_coul_long.h @@ -29,25 +29,25 @@ class PairBuckLongCoulLong : public Pair { double cut_coul; PairBuckLongCoulLong(class LAMMPS *); - ~PairBuckLongCoulLong(); - virtual void compute(int, int); + ~PairBuckLongCoulLong() override; + void compute(int, int) override; - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - virtual void compute_inner(); - virtual void compute_middle(); - virtual void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_buck_global; diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h index e553c8cb56..b196c5c662 100644 --- a/src/KSPACE/pair_coul_long.h +++ b/src/KSPACE/pair_coul_long.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairCoulLong : public Pair { public: PairCoulLong(class LAMMPS *); - ~PairCoulLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_coul, cut_coulsq, qdist; diff --git a/src/KSPACE/pair_coul_msm.h b/src/KSPACE/pair_coul_msm.h index d52830183a..734c852f65 100644 --- a/src/KSPACE/pair_coul_msm.h +++ b/src/KSPACE/pair_coul_msm.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairCoulMSM : public PairCoulLong { public: PairCoulMSM(class LAMMPS *); - virtual ~PairCoulMSM(){}; - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; }; } // namespace LAMMPS_NS diff --git a/src/KSPACE/pair_coul_streitz.h b/src/KSPACE/pair_coul_streitz.h index 011c4a6b7a..6d5036e83c 100644 --- a/src/KSPACE/pair_coul_streitz.h +++ b/src/KSPACE/pair_coul_streitz.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class PairCoulStreitz : public Pair { public: PairCoulStreitz(class LAMMPS *); - virtual ~PairCoulStreitz(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); - virtual void *extract(const char *, int &); + ~PairCoulStreitz() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; + void *extract(const char *, int &) override; static constexpr int NPARAMS_PER_LINE = 6; diff --git a/src/KSPACE/pair_lj_charmm_coul_long.h b/src/KSPACE/pair_lj_charmm_coul_long.h index 6925a635bf..463e537f56 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.h +++ b/src/KSPACE/pair_lj_charmm_coul_long.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class PairLJCharmmCoulLong : public Pair { public: PairLJCharmmCoulLong(class LAMMPS *); - virtual ~PairLJCharmmCoulLong(); + ~PairLJCharmmCoulLong() override; - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: int implicit; diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.h b/src/KSPACE/pair_lj_charmm_coul_msm.h index 90425c4daf..d90f58aa7e 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.h +++ b/src/KSPACE/pair_lj_charmm_coul_msm.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCharmmCoulMSM : public PairLJCharmmCoulLong { public: PairLJCharmmCoulMSM(class LAMMPS *); - virtual ~PairLJCharmmCoulMSM(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + ~PairLJCharmmCoulMSM() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: int nmax; diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.h b/src/KSPACE/pair_lj_charmmfsw_coul_long.h index e254092c43..dd72027334 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.h +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class PairLJCharmmfswCoulLong : public Pair { public: PairLJCharmmfswCoulLong(class LAMMPS *); - virtual ~PairLJCharmmfswCoulLong(); + ~PairLJCharmmfswCoulLong() override; - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: int implicit; diff --git a/src/KSPACE/pair_lj_cut_coul_long.h b/src/KSPACE/pair_lj_cut_coul_long.h index 23d8d26f93..d5e3e6f7e0 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.h +++ b/src/KSPACE/pair_lj_cut_coul_long.h @@ -28,24 +28,24 @@ class PairLJCutCoulLong : public Pair { public: PairLJCutCoulLong(class LAMMPS *); - virtual ~PairLJCutCoulLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairLJCutCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void compute_inner(); - void compute_middle(); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/KSPACE/pair_lj_cut_coul_msm.h b/src/KSPACE/pair_lj_cut_coul_msm.h index c84fc5688c..2b5b7e1a85 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.h +++ b/src/KSPACE/pair_lj_cut_coul_msm.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairLJCutCoulMSM : public PairLJCutCoulLong { public: PairLJCutCoulMSM(class LAMMPS *); - virtual ~PairLJCutCoulMSM(); - virtual void compute(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void compute_outer(int, int); - virtual void *extract(const char *, int &); + ~PairLJCutCoulMSM() override; + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; protected: int nmax; diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.h b/src/KSPACE/pair_lj_cut_tip4p_long.h index 20066e71e2..091cd42ab5 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.h +++ b/src/KSPACE/pair_lj_cut_tip4p_long.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairLJCutTIP4PLong : public PairLJCutCoulLong { public: PairLJCutTIP4PLong(class LAMMPS *); - ~PairLJCutTIP4PLong(); - virtual void compute(int, int); - void settings(int, char **); - void init_style(); - double init_one(int, int); - void write_restart_settings(FILE *fp); - void read_restart_settings(FILE *fp); - void *extract(const char *, int &); - double memory_usage(); + ~PairLJCutTIP4PLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *fp) override; + void read_restart_settings(FILE *fp) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int typeH, typeO; // atom types of TIP4P water H and O atoms diff --git a/src/KSPACE/pair_lj_long_coul_long.h b/src/KSPACE/pair_lj_long_coul_long.h index 926c098052..5b66a949a9 100644 --- a/src/KSPACE/pair_lj_long_coul_long.h +++ b/src/KSPACE/pair_lj_long_coul_long.h @@ -29,24 +29,24 @@ class PairLJLongCoulLong : public Pair { double cut_coul; PairLJLongCoulLong(class LAMMPS *); - virtual ~PairLJLongCoulLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJLongCoulLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - virtual void compute_inner(); - virtual void compute_middle(); - virtual void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_lj_global; diff --git a/src/KSPACE/pair_lj_long_tip4p_long.h b/src/KSPACE/pair_lj_long_tip4p_long.h index 15150a4e23..c8e0265c41 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.h +++ b/src/KSPACE/pair_lj_long_tip4p_long.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairLJLongTIP4PLong : public PairLJLongCoulLong { public: PairLJLongTIP4PLong(class LAMMPS *); - ~PairLJLongTIP4PLong(); - virtual void compute(int, int); - virtual void compute_inner(); - virtual void compute_middle(); - virtual void compute_outer(int, int); - void settings(int, char **); - void init_style(); - double init_one(int, int); - void write_restart_settings(FILE *fp); - void read_restart_settings(FILE *fp); - void *extract(const char *, int &); - double memory_usage(); + ~PairLJLongTIP4PLong() override; + void compute(int, int) override; + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *fp) override; + void read_restart_settings(FILE *fp) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int typeH, typeO; // atom types of TIP4P water H and O atoms diff --git a/src/KSPACE/pair_tip4p_long.h b/src/KSPACE/pair_tip4p_long.h index c4a2e0b623..8272ec8428 100644 --- a/src/KSPACE/pair_tip4p_long.h +++ b/src/KSPACE/pair_tip4p_long.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairTIP4PLong : public PairCoulLong { public: PairTIP4PLong(class LAMMPS *); - ~PairTIP4PLong(); - virtual void compute(int, int); - void settings(int, char **); - void init_style(); - double init_one(int, int); - void write_restart_settings(FILE *fp); - void read_restart_settings(FILE *fp); - void *extract(const char *, int &); - double memory_usage(); + ~PairTIP4PLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *fp) override; + void read_restart_settings(FILE *fp) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: int typeH, typeO; // atom types of TIP4P water H and O atoms diff --git a/src/KSPACE/pppm_disp_tip4p.h b/src/KSPACE/pppm_disp_tip4p.h index fcb5f5ef81..dbc3fb98aa 100644 --- a/src/KSPACE/pppm_disp_tip4p.h +++ b/src/KSPACE/pppm_disp_tip4p.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PPPMDispTIP4P : public PPPMDisp { public: PPPMDispTIP4P(class LAMMPS *); - ~PPPMDispTIP4P() override{}; + void init() override; protected: diff --git a/src/MACHDYN/pair_smd_hertz.h b/src/MACHDYN/pair_smd_hertz.h index b736764de3..75bcfa9dca 100644 --- a/src/MACHDYN/pair_smd_hertz.h +++ b/src/MACHDYN/pair_smd_hertz.h @@ -38,15 +38,15 @@ namespace LAMMPS_NS { class PairHertz : public Pair { public: PairHertz(class LAMMPS *); - virtual ~PairHertz(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - virtual double memory_usage(); - void *extract(const char *, int &); + ~PairHertz() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double memory_usage() override; + void *extract(const char *, int &) override; protected: double **bulkmodulus; diff --git a/src/MANYBODY/pair_adp.h b/src/MANYBODY/pair_adp.h index 3740b214ed..06db6ed5a3 100644 --- a/src/MANYBODY/pair_adp.h +++ b/src/MANYBODY/pair_adp.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairADP : public Pair { public: PairADP(class LAMMPS *); - virtual ~PairADP(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairADP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; protected: int nmax; // allocated size of per-atom arrays diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index fc511b7bb0..2063cf75c1 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -29,13 +29,13 @@ namespace LAMMPS_NS { class PairAIREBO : public Pair { public: PairAIREBO(class LAMMPS *); - virtual ~PairAIREBO(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); + ~PairAIREBO() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code diff --git a/src/MANYBODY/pair_airebo_morse.h b/src/MANYBODY/pair_airebo_morse.h index fe2e61440a..d5662d8aa4 100644 --- a/src/MANYBODY/pair_airebo_morse.h +++ b/src/MANYBODY/pair_airebo_morse.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairAIREBOMorse : public PairAIREBO { public: PairAIREBOMorse(class LAMMPS *); - void settings(int, char **); + void settings(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_atm.h b/src/MANYBODY/pair_atm.h index 8370e08aec..20836751b6 100644 --- a/src/MANYBODY/pair_atm.h +++ b/src/MANYBODY/pair_atm.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class PairATM : public Pair { public: PairATM(class LAMMPS *); - virtual ~PairATM(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + ~PairATM() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; protected: double cut_global, cut_triple; diff --git a/src/MANYBODY/pair_bop.h b/src/MANYBODY/pair_bop.h index 53ad7ceace..baffe74846 100644 --- a/src/MANYBODY/pair_bop.h +++ b/src/MANYBODY/pair_bop.h @@ -34,13 +34,13 @@ class PairBOP : public Pair { public: PairBOP(class LAMMPS *); - virtual ~PairBOP(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); + ~PairBOP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; private: struct PairParameters { diff --git a/src/MANYBODY/pair_comb.h b/src/MANYBODY/pair_comb.h index 580a737b9a..6a456f6eb0 100644 --- a/src/MANYBODY/pair_comb.h +++ b/src/MANYBODY/pair_comb.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairComb : public Pair { public: PairComb(class LAMMPS *); - virtual ~PairComb(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); + ~PairComb() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; virtual double yasu_char(double *, int &); double enegtot; @@ -137,10 +137,10 @@ class PairComb : public Pair { void qfo_field(Param *, double, double, double, double &, double &); void qsolve(double *); void Over_cor(Param *, double, int, double &, double &); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; void Short_neigh(); }; diff --git a/src/MANYBODY/pair_comb3.h b/src/MANYBODY/pair_comb3.h index 946b6c5b0e..f7a8f1abac 100644 --- a/src/MANYBODY/pair_comb3.h +++ b/src/MANYBODY/pair_comb3.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairComb3 : public Pair { public: PairComb3(class LAMMPS *); - virtual ~PairComb3(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); + ~PairComb3() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; virtual double combqeq(double *, int &); double enegtot; @@ -221,10 +221,10 @@ class PairComb3 : public Pair { double, double, double, double, int, int, double &, double &, double *); // communication functions - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_eam.h b/src/MANYBODY/pair_eam.h index 2b206689d6..a3f5708273 100644 --- a/src/MANYBODY/pair_eam.h +++ b/src/MANYBODY/pair_eam.h @@ -45,21 +45,21 @@ class PairEAM : public Pair { double ***rhor_spline, ***frho_spline, ***z2r_spline; PairEAM(class LAMMPS *); - virtual ~PairEAM(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairEAM() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); - void swap_eam(double *, double **); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; + void swap_eam(double *, double **) override; protected: int nmax; // allocated size of per-atom arrays diff --git a/src/MANYBODY/pair_eam_alloy.h b/src/MANYBODY/pair_eam_alloy.h index d3b7880a4d..b8d53aac00 100644 --- a/src/MANYBODY/pair_eam_alloy.h +++ b/src/MANYBODY/pair_eam_alloy.h @@ -29,12 +29,11 @@ namespace LAMMPS_NS { class PairEAMAlloy : virtual public PairEAM { public: PairEAMAlloy(class LAMMPS *); - virtual ~PairEAMAlloy() {} - void coeff(int, char **); + void coeff(int, char **) override; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_eam_cd.h b/src/MANYBODY/pair_eam_cd.h index 6846a6cd76..f7967d7fb6 100644 --- a/src/MANYBODY/pair_eam_cd.h +++ b/src/MANYBODY/pair_eam_cd.h @@ -31,24 +31,24 @@ class PairEAMCD : public PairEAMAlloy { PairEAMCD(class LAMMPS *, int cdeamVersion); /// Destructor. - virtual ~PairEAMCD(); + ~PairEAMCD() override; /// Calculates the energies and forces for all atoms in the system. - virtual void compute(int, int); + void compute(int, int) override; /// Parses the pair_coeff command parameters for this pair style. - void coeff(int, char **); + void coeff(int, char **) override; /// This is for MPI communication with neighbor nodes. - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; /// Reports the memory usage of this pair style to LAMMPS. - double memory_usage(); + double memory_usage() override; - void *extract(const char *, int &) { return nullptr; } + void *extract(const char *, int &) override { return nullptr; } /// Parses the coefficients of the h polynomial from the end of the EAM file. void read_h_coeff(char *filename); diff --git a/src/MANYBODY/pair_eam_fs.h b/src/MANYBODY/pair_eam_fs.h index 7683b92bc3..6b6fcb1905 100644 --- a/src/MANYBODY/pair_eam_fs.h +++ b/src/MANYBODY/pair_eam_fs.h @@ -29,12 +29,12 @@ namespace LAMMPS_NS { class PairEAMFS : virtual public PairEAM { public: PairEAMFS(class LAMMPS *); - virtual ~PairEAMFS() {} - void coeff(int, char **); + + void coeff(int, char **) override; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; int he_flag; }; diff --git a/src/MANYBODY/pair_eam_he.h b/src/MANYBODY/pair_eam_he.h index eaa86d8e8f..38f7fc3dbd 100644 --- a/src/MANYBODY/pair_eam_he.h +++ b/src/MANYBODY/pair_eam_he.h @@ -27,10 +27,9 @@ namespace LAMMPS_NS { class PairEAMHE : public PairEAMFS { public: PairEAMHE(class LAMMPS *); - virtual ~PairEAMHE() {} protected: - void compute(int, int); + void compute(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_edip.h b/src/MANYBODY/pair_edip.h index 5812768d55..d27eeb7768 100644 --- a/src/MANYBODY/pair_edip.h +++ b/src/MANYBODY/pair_edip.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairEDIP : public Pair { public: PairEDIP(class LAMMPS *); - virtual ~PairEDIP(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + ~PairEDIP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; protected: struct Param { diff --git a/src/MANYBODY/pair_edip_multi.h b/src/MANYBODY/pair_edip_multi.h index 3ee7347a56..cf51af0d4e 100644 --- a/src/MANYBODY/pair_edip_multi.h +++ b/src/MANYBODY/pair_edip_multi.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairEDIPMulti : public Pair { public: PairEDIPMulti(class LAMMPS *); - virtual ~PairEDIPMulti(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + ~PairEDIPMulti() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; protected: struct Param { @@ -61,7 +61,7 @@ class PairEDIPMulti : public Pair { void deallocatePreLoops(); void read_file(char *); - void setup(); + void setup() override; void edip_pair(double, double, Param *, double &, double &, double &); void edip_fc(double, Param *, double &, double &); diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h index 7602474cb4..7c4931b7cf 100644 --- a/src/MANYBODY/pair_eim.h +++ b/src/MANYBODY/pair_eim.h @@ -30,18 +30,18 @@ namespace LAMMPS_NS { class PairEIM : public Pair { public: PairEIM(class LAMMPS *); - virtual ~PairEIM(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairEIM() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; struct Setfl { double division, rbig, rsmall; diff --git a/src/MANYBODY/pair_extep.h b/src/MANYBODY/pair_extep.h index 6b1c925226..b17fda6b7e 100644 --- a/src/MANYBODY/pair_extep.h +++ b/src/MANYBODY/pair_extep.h @@ -30,12 +30,12 @@ namespace LAMMPS_NS { class PairExTeP : public Pair { public: PairExTeP(class LAMMPS *); - virtual ~PairExTeP(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairExTeP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: struct Param { @@ -70,7 +70,7 @@ class PairExTeP : public Pair { void allocate(); void spline_init(); virtual void read_file(char *); - virtual void setup(); + void setup() override; virtual void repulsive(Param *, double, double &, int, double &); virtual double zeta(Param *, double, double, double *, double *); virtual void force_zeta(Param *, double, double, double &, double &, int, double &); diff --git a/src/MANYBODY/pair_gw.h b/src/MANYBODY/pair_gw.h index ffd8665c05..c5698d331a 100644 --- a/src/MANYBODY/pair_gw.h +++ b/src/MANYBODY/pair_gw.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairGW : public Pair { public: PairGW(class LAMMPS *); - virtual ~PairGW(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairGW() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; static constexpr int NPARAMS_PER_LINE = 17; diff --git a/src/MANYBODY/pair_gw_zbl.h b/src/MANYBODY/pair_gw_zbl.h index 97a5d8ce8f..10c02c91f5 100644 --- a/src/MANYBODY/pair_gw_zbl.h +++ b/src/MANYBODY/pair_gw_zbl.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class PairGWZBL : public PairGW { public: PairGWZBL(class LAMMPS *); - ~PairGWZBL() {} static constexpr int NPARAMS_PER_LINE = 21; @@ -36,11 +35,11 @@ class PairGWZBL : public PairGW { double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion double global_e; // proton charge (negative of electron charge) - void read_file(char *); - void repulsive(Param *, double, double &, int, double &); + void read_file(char *) override; + void repulsive(Param *, double, double &, int, double &) override; - double gw_fa(double, Param *); - double gw_fa_d(double, Param *); + double gw_fa(double, Param *) override; + double gw_fa_d(double, Param *) override; double F_fermi(double, Param *); double F_fermi_d(double, Param *); diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index 836e66e160..e27d44a5f6 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -29,13 +29,13 @@ namespace LAMMPS_NS { class PairLCBOP : public Pair { public: PairLCBOP(class LAMMPS *); - virtual ~PairLCBOP(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); + ~PairLCBOP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; protected: int **pages; // neighbor list pages diff --git a/src/MANYBODY/pair_local_density.h b/src/MANYBODY/pair_local_density.h index ef67d2c084..dd466e622d 100644 --- a/src/MANYBODY/pair_local_density.h +++ b/src/MANYBODY/pair_local_density.h @@ -31,19 +31,19 @@ namespace LAMMPS_NS { class PairLocalDensity : public Pair { public: PairLocalDensity(class LAMMPS *); - virtual ~PairLocalDensity(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - double single(int, int, int, int, double, double, double, double &); + ~PairLocalDensity() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; protected: //------------------------------------------------------------------------ diff --git a/src/MANYBODY/pair_meam_spline.h b/src/MANYBODY/pair_meam_spline.h index c20077f2eb..34e2960726 100644 --- a/src/MANYBODY/pair_meam_spline.h +++ b/src/MANYBODY/pair_meam_spline.h @@ -40,16 +40,16 @@ namespace LAMMPS_NS { class PairMEAMSpline : public Pair { public: PairMEAMSpline(class LAMMPS *); - virtual ~PairMEAMSpline(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); + ~PairMEAMSpline() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; void get_coeff(double *, double *); double pair_density(int); double three_body_density(int); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); + void init_style() override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; // helper functions for compute() @@ -59,11 +59,11 @@ class PairMEAMSpline : public Pair { } int i_to_potl(const int itype) const { return itype - 1; } - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; protected: class SplineFunction { diff --git a/src/MANYBODY/pair_meam_sw_spline.h b/src/MANYBODY/pair_meam_sw_spline.h index 6f065f53f4..6129b164d5 100644 --- a/src/MANYBODY/pair_meam_sw_spline.h +++ b/src/MANYBODY/pair_meam_sw_spline.h @@ -38,19 +38,19 @@ namespace LAMMPS_NS { class PairMEAMSWSpline : public Pair { public: PairMEAMSWSpline(class LAMMPS *); - virtual ~PairMEAMSWSpline(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); + ~PairMEAMSWSpline() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; protected: class SplineFunction { diff --git a/src/MANYBODY/pair_nb3b_harmonic.h b/src/MANYBODY/pair_nb3b_harmonic.h index 159e7f8433..48fe5cf3ca 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.h +++ b/src/MANYBODY/pair_nb3b_harmonic.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairNb3bHarmonic : public Pair { public: PairNb3bHarmonic(class LAMMPS *); - virtual ~PairNb3bHarmonic(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + ~PairNb3bHarmonic() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; static constexpr int NPARAMS_PER_LINE = 6; diff --git a/src/MANYBODY/pair_polymorphic.h b/src/MANYBODY/pair_polymorphic.h index b57a9a2268..5841d3f580 100644 --- a/src/MANYBODY/pair_polymorphic.h +++ b/src/MANYBODY/pair_polymorphic.h @@ -29,12 +29,12 @@ class TabularFunction; class PairPolymorphic : public Pair { public: PairPolymorphic(class LAMMPS *); - virtual ~PairPolymorphic(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairPolymorphic() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: struct PairParameters { diff --git a/src/MANYBODY/pair_rebo.h b/src/MANYBODY/pair_rebo.h index 94e5b9a228..b55ee87e76 100644 --- a/src/MANYBODY/pair_rebo.h +++ b/src/MANYBODY/pair_rebo.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairREBO : public PairAIREBO { public: PairREBO(class LAMMPS *); - void settings(int, char **); - void spline_init(); + void settings(int, char **) override; + void spline_init() override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_sw.h b/src/MANYBODY/pair_sw.h index 6509c460d6..02389020a3 100644 --- a/src/MANYBODY/pair_sw.h +++ b/src/MANYBODY/pair_sw.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairSW : public Pair { public: PairSW(class LAMMPS *); - virtual ~PairSW(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual double init_one(int, int); - virtual void init_style(); + ~PairSW() override; + void compute(int, int) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; static constexpr int NPARAMS_PER_LINE = 14; @@ -53,7 +53,7 @@ class PairSW : public Pair { int maxshort; // size of short neighbor list array int *neighshort; // short neighbor list array - virtual void settings(int, char **); + void settings(int, char **) override; virtual void allocate(); void read_file(char *); virtual void setup_params(); diff --git a/src/MANYBODY/pair_sw_mod.h b/src/MANYBODY/pair_sw_mod.h index 580f031e00..c8d306238b 100644 --- a/src/MANYBODY/pair_sw_mod.h +++ b/src/MANYBODY/pair_sw_mod.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class PairSWMOD : public PairSW { public: PairSWMOD(class LAMMPS *); - virtual ~PairSWMOD() {} protected: double delta1; double delta2; - void settings(int, char **); + void settings(int, char **) override; void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, - int, double &); + int, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_tersoff.h b/src/MANYBODY/pair_tersoff.h index f1ee2a1100..b246c8260d 100644 --- a/src/MANYBODY/pair_tersoff.h +++ b/src/MANYBODY/pair_tersoff.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairTersoff : public Pair { public: PairTersoff(class LAMMPS *); - virtual ~PairTersoff(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); + ~PairTersoff() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; template void eval(); diff --git a/src/MANYBODY/pair_tersoff_mod.h b/src/MANYBODY/pair_tersoff_mod.h index 8ae2c56a89..bc14012e37 100644 --- a/src/MANYBODY/pair_tersoff_mod.h +++ b/src/MANYBODY/pair_tersoff_mod.h @@ -28,21 +28,20 @@ namespace LAMMPS_NS { class PairTersoffMOD : public PairTersoff { public: PairTersoffMOD(class LAMMPS *); - ~PairTersoffMOD() {} static constexpr int NPARAMS_PER_LINE = 20; protected: - virtual void read_file(char *); - virtual void setup_params(); - double zeta(Param *, double, double, double *, double *); + void read_file(char *) override; + void setup_params() override; + double zeta(Param *, double, double, double *, double *) override; - double ters_fc(double, Param *); - double ters_fc_d(double, Param *); - double ters_bij(double, Param *); - double ters_bij_d(double, Param *); + double ters_fc(double, Param *) override; + double ters_fc_d(double, Param *) override; + double ters_bij(double, Param *) override; + double ters_bij_d(double, Param *) override; void ters_zetaterm_d(double, double *, double, double, double *, double, double, double *, - double *, double *, Param *); + double *, double *, Param *) override; // inlined functions for efficiency // these replace but do not override versions in PairTersoff diff --git a/src/MANYBODY/pair_tersoff_mod_c.h b/src/MANYBODY/pair_tersoff_mod_c.h index 09565fb9de..e39c8e4340 100644 --- a/src/MANYBODY/pair_tersoff_mod_c.h +++ b/src/MANYBODY/pair_tersoff_mod_c.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class PairTersoffMODC : public PairTersoffMOD { public: PairTersoffMODC(class LAMMPS *lmp) : PairTersoffMOD(lmp){}; - ~PairTersoffMODC() {} static constexpr int NPARAMS_PER_LINE = 21; protected: - void read_file(char *); - void repulsive(Param *, double, double &, int, double &); + void read_file(char *) override; + void repulsive(Param *, double, double &, int, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/MANYBODY/pair_tersoff_table.h b/src/MANYBODY/pair_tersoff_table.h index ab345d8af2..cb4dd7ce18 100644 --- a/src/MANYBODY/pair_tersoff_table.h +++ b/src/MANYBODY/pair_tersoff_table.h @@ -36,12 +36,12 @@ namespace LAMMPS_NS { class PairTersoffTable : public Pair { public: PairTersoffTable(class LAMMPS *); - virtual ~PairTersoffTable(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairTersoffTable() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; static constexpr int NPARAMS_PER_LINE = 17; diff --git a/src/MANYBODY/pair_tersoff_zbl.h b/src/MANYBODY/pair_tersoff_zbl.h index ea081cce77..f0b10e417a 100644 --- a/src/MANYBODY/pair_tersoff_zbl.h +++ b/src/MANYBODY/pair_tersoff_zbl.h @@ -27,7 +27,6 @@ namespace LAMMPS_NS { class PairTersoffZBL : public PairTersoff { public: PairTersoffZBL(class LAMMPS *); - ~PairTersoffZBL() {} static constexpr int NPARAMS_PER_LINE = 21; @@ -36,11 +35,11 @@ class PairTersoffZBL : public PairTersoff { double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion double global_e; // proton charge (negative of electron charge) - void read_file(char *); - void repulsive(Param *, double, double &, int, double &); + void read_file(char *) override; + void repulsive(Param *, double, double &, int, double &) override; - double ters_fa(double, Param *); - double ters_fa_d(double, Param *); + double ters_fa(double, Param *) override; + double ters_fa_d(double, Param *) override; double F_fermi(double, Param *); double F_fermi_d(double, Param *); diff --git a/src/MANYBODY/pair_vashishta.h b/src/MANYBODY/pair_vashishta.h index bfb527439c..e774e2165f 100644 --- a/src/MANYBODY/pair_vashishta.h +++ b/src/MANYBODY/pair_vashishta.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairVashishta : public Pair { public: PairVashishta(class LAMMPS *); - virtual ~PairVashishta(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); + ~PairVashishta() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; static constexpr int NPARAMS_PER_LINE = 17; diff --git a/src/MANYBODY/pair_vashishta_table.h b/src/MANYBODY/pair_vashishta_table.h index 7033fdc163..646529da56 100644 --- a/src/MANYBODY/pair_vashishta_table.h +++ b/src/MANYBODY/pair_vashishta_table.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairVashishtaTable : public PairVashishta { public: PairVashishtaTable(class LAMMPS *); - ~PairVashishtaTable(); - void compute(int, int); - void settings(int, char **); - double memory_usage(); + ~PairVashishtaTable() override; + void compute(int, int) override; + void settings(int, char **) override; + double memory_usage() override; protected: int ntable; @@ -40,7 +40,7 @@ class PairVashishtaTable : public PairVashishta { double ***potentialTable; // table of potential energies void twobody_table(const Param &, double, double &, int, double &); - void setup_params(); + void setup_params() override; void create_tables(); }; diff --git a/src/MC/pair_dsmc.h b/src/MC/pair_dsmc.h index 947c0dafb2..36ae8ea21b 100644 --- a/src/MC/pair_dsmc.h +++ b/src/MC/pair_dsmc.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class PairDSMC : public Pair { public: PairDSMC(class LAMMPS *); - virtual ~PairDSMC(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + ~PairDSMC() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; private: double cut_global; diff --git a/src/MEAM/pair_meam.h b/src/MEAM/pair_meam.h index 347869c293..e3e3767ba3 100644 --- a/src/MEAM/pair_meam.h +++ b/src/MEAM/pair_meam.h @@ -28,20 +28,20 @@ namespace LAMMPS_NS { class PairMEAM : public Pair { public: PairMEAM(class LAMMPS *); - ~PairMEAM(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); - virtual void *extract(const char *, int &); + ~PairMEAM() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; private: class MEAM *meam_inst; diff --git a/src/MESONT/pair_mesocnt.h b/src/MESONT/pair_mesocnt.h index 3db576ad7d..559a260f3f 100644 --- a/src/MESONT/pair_mesocnt.h +++ b/src/MESONT/pair_mesocnt.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairMesoCNT : public Pair { public: PairMesoCNT(class LAMMPS *); - ~PairMesoCNT(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + ~PairMesoCNT() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: int uinf_points, gamma_points, phi_points, usemi_points; diff --git a/src/MESONT/pair_mesont_tpm.h b/src/MESONT/pair_mesont_tpm.h index ee8bd9ece6..edb5d320bf 100644 --- a/src/MESONT/pair_mesont_tpm.h +++ b/src/MESONT/pair_mesont_tpm.h @@ -29,18 +29,18 @@ namespace LAMMPS_NS { class PairMESONTTPM : public Pair { public: PairMESONTTPM(class LAMMPS *); - virtual ~PairMESONTTPM(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual void init_style(); + ~PairMESONTTPM() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void init_style() override; double energy_s; // accumulated energies for stretching double energy_b; // accumulated energies for bending @@ -57,7 +57,7 @@ class PairMESONTTPM : public Pair { int nmax; virtual void allocate(); - virtual void *extract(const char *, int &); + void *extract(const char *, int &) override; }; } // namespace LAMMPS_NS diff --git a/src/MGPT/pair_mgpt.h b/src/MGPT/pair_mgpt.h index ed73ed1f35..355a17522b 100644 --- a/src/MGPT/pair_mgpt.h +++ b/src/MGPT/pair_mgpt.h @@ -259,13 +259,13 @@ public: public: PairMGPT(class LAMMPS *); - ~PairMGPT(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); + ~PairMGPT() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double init_one(int, int) override; private: diff --git a/src/MISC/pair_agni.h b/src/MISC/pair_agni.h index 2a1e700d29..b324b5a98a 100644 --- a/src/MISC/pair_agni.h +++ b/src/MISC/pair_agni.h @@ -28,12 +28,12 @@ class PairAGNI : public Pair { public: enum { AGNI_VERSION_UNKNOWN, AGNI_VERSION_1, AGNI_VERSION_2 }; PairAGNI(class LAMMPS *); - virtual ~PairAGNI(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - virtual double init_one(int, int); - virtual void init_style(); + ~PairAGNI() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; struct Param { double cut, cutsq; diff --git a/src/MISC/pair_list.h b/src/MISC/pair_list.h index 60fd3a7a24..8a1bb98729 100644 --- a/src/MISC/pair_list.h +++ b/src/MISC/pair_list.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class PairList : public Pair { public: PairList(class LAMMPS *); - virtual ~PairList(); + ~PairList() override; - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - virtual double memory_usage(); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; protected: void allocate(); diff --git a/src/MISC/pair_srp.h b/src/MISC/pair_srp.h index 4c56edaaf3..5c6816e695 100644 --- a/src/MISC/pair_srp.h +++ b/src/MISC/pair_srp.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairSRP : public Pair { public: PairSRP(class LAMMPS *); - virtual ~PairSRP(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + ~PairSRP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; private: inline void onetwoexclude(int *&, int &, int *&, int *&, int **&); diff --git a/src/MISC/pair_tracker.h b/src/MISC/pair_tracker.h index c6825c410e..1942408659 100644 --- a/src/MISC/pair_tracker.h +++ b/src/MISC/pair_tracker.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairTracker : public Pair { public: PairTracker(class LAMMPS *); - virtual ~PairTracker(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - double atom2cut(int); - double radii2cut(double, double); + ~PairTracker() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + double atom2cut(int) override; + double radii2cut(double, double) override; protected: int sizeflag; @@ -55,7 +55,7 @@ class PairTracker : public Pair { class FixNeighHistory *fix_history; class FixPairTracker *fix_pair_tracker; - void transfer_history(double *, double *); + void transfer_history(double *, double *) override; void allocate(); }; diff --git a/src/ML-IAP/mliap_descriptor_so3.h b/src/ML-IAP/mliap_descriptor_so3.h index ec19e91b75..40d88e4cfb 100644 --- a/src/ML-IAP/mliap_descriptor_so3.h +++ b/src/ML-IAP/mliap_descriptor_so3.h @@ -22,14 +22,14 @@ class MLIAPDescriptorSO3 : public MLIAPDescriptor { public: MLIAPDescriptorSO3(LAMMPS *, char *); - virtual ~MLIAPDescriptorSO3(); + ~MLIAPDescriptorSO3() override; - virtual void compute_descriptors(class MLIAPData *); - virtual void compute_forces(class MLIAPData *); - virtual void compute_force_gradients(class MLIAPData *){}; - virtual void compute_descriptor_gradients(class MLIAPData *){}; - virtual void init(); - virtual double memory_usage(); + void compute_descriptors(class MLIAPData *) override; + void compute_forces(class MLIAPData *) override; + void compute_force_gradients(class MLIAPData *) override{}; + void compute_descriptor_gradients(class MLIAPData *) override{}; + void init() override; + double memory_usage() override; double rcutfac; diff --git a/src/ML-IAP/mliap_model.h b/src/ML-IAP/mliap_model.h index 23895f29c3..bc38b8b58d 100644 --- a/src/ML-IAP/mliap_model.h +++ b/src/ML-IAP/mliap_model.h @@ -44,7 +44,7 @@ class MLIAPModel : protected Pointers { class MLIAPModelSimple : public MLIAPModel { public: MLIAPModelSimple(LAMMPS *, char *); - ~MLIAPModelSimple() override{}; + double memory_usage() override; protected: diff --git a/src/ML-IAP/mliap_model_nn.h b/src/ML-IAP/mliap_model_nn.h index 5a45a34b5f..f2e43bccc8 100644 --- a/src/ML-IAP/mliap_model_nn.h +++ b/src/ML-IAP/mliap_model_nn.h @@ -23,13 +23,13 @@ namespace LAMMPS_NS { class MLIAPModelNN : public MLIAPModel { public: MLIAPModelNN(LAMMPS *, char * = nullptr); - ~MLIAPModelNN(); - virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData *); - virtual void compute_gradients(class MLIAPData *); - virtual void compute_gradgrads(class MLIAPData *); - virtual void compute_force_gradients(class MLIAPData *); - virtual double memory_usage(); + ~MLIAPModelNN() override; + int get_nparams() override; + int get_gamma_nnz(class MLIAPData *) override; + void compute_gradients(class MLIAPData *) override; + void compute_gradgrads(class MLIAPData *) override; + void compute_force_gradients(class MLIAPData *) override; + double memory_usage() override; int nlayers; // number of layers per element @@ -37,7 +37,7 @@ class MLIAPModelNN : public MLIAPModel { int *activation; // activation functions int *nnodes; // number of nodes per layer double ***scale; // element scale values - virtual void read_coeffs(char *); + void read_coeffs(char *) override; inline double sigm(double x, double &deriv) { diff --git a/src/ML-IAP/pair_mliap.h b/src/ML-IAP/pair_mliap.h index 641772effb..902b005041 100644 --- a/src/ML-IAP/pair_mliap.h +++ b/src/ML-IAP/pair_mliap.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairMLIAP : public Pair { public: PairMLIAP(class LAMMPS *); - ~PairMLIAP(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); + ~PairMLIAP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; void e_tally(class MLIAPData *); void v_tally(int, int, double *, double *); - virtual void init_style(); - virtual double init_one(int, int); - virtual double memory_usage(); + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; int *map; // mapping from atom types to elements protected: diff --git a/src/ML-QUIP/pair_quip.h b/src/ML-QUIP/pair_quip.h index 3040dc0ffd..49a381f5d0 100644 --- a/src/ML-QUIP/pair_quip.h +++ b/src/ML-QUIP/pair_quip.h @@ -34,13 +34,13 @@ namespace LAMMPS_NS { class PairQUIP : public Pair { public: PairQUIP(class LAMMPS *); - ~PairQUIP(); + ~PairQUIP() override; - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; void allocate(); private: diff --git a/src/ML-RANN/pair_rann.h b/src/ML-RANN/pair_rann.h index 71b4dcd4e6..15724575fa 100644 --- a/src/ML-RANN/pair_rann.h +++ b/src/ML-RANN/pair_rann.h @@ -51,13 +51,13 @@ class PairRANN : public Pair { public: //inherited functions PairRANN(class LAMMPS *); - ~PairRANN(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void init_list(int, NeighList *); + ~PairRANN() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void init_list(int, NeighList *) override; void errorf(const char *, int, const char *); int factorial(int); diff --git a/src/ML-RANN/rann_activation_linear.h b/src/ML-RANN/rann_activation_linear.h index 930ce70ee0..8f0d65f35c 100644 --- a/src/ML-RANN/rann_activation_linear.h +++ b/src/ML-RANN/rann_activation_linear.h @@ -38,9 +38,9 @@ namespace RANN { class Activation_linear : public Activation { public: Activation_linear(class PairRANN *); - double activation_function(double); - double dactivation_function(double); - double ddactivation_function(double); + double activation_function(double) override; + double dactivation_function(double) override; + double ddactivation_function(double) override; }; Activation_linear::Activation_linear(PairRANN *_pair) : Activation(_pair) diff --git a/src/ML-RANN/rann_activation_sig_i.h b/src/ML-RANN/rann_activation_sig_i.h index fc82fe300d..01384b2061 100644 --- a/src/ML-RANN/rann_activation_sig_i.h +++ b/src/ML-RANN/rann_activation_sig_i.h @@ -39,9 +39,9 @@ namespace RANN { class Activation_sigI : public Activation { public: Activation_sigI(class PairRANN *); - double activation_function(double); - double dactivation_function(double); - double ddactivation_function(double); + double activation_function(double) override; + double dactivation_function(double) override; + double ddactivation_function(double) override; }; Activation_sigI::Activation_sigI(PairRANN *_pair) : Activation(_pair) diff --git a/src/ML-RANN/rann_fingerprint_bond.h b/src/ML-RANN/rann_fingerprint_bond.h index cc844993cc..2d845f4e6f 100644 --- a/src/ML-RANN/rann_fingerprint_bond.h +++ b/src/ML-RANN/rann_fingerprint_bond.h @@ -39,20 +39,20 @@ namespace RANN { class Fingerprint_bond : public Fingerprint { public: Fingerprint_bond(PairRANN *); - ~Fingerprint_bond(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); + ~Fingerprint_bond() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; void compute_fingerprint(double *, double *, double *, double *, int, int, double *, double *, - double *, int *, int, int *); + double *, int *, int, int *) override; void do3bodyfeatureset_doubleneighborloop(double *, double *, double *, double *, int, int, double *, double *, double *, int *, int, int *); void do3bodyfeatureset_singleneighborloop(double *, double *, double *, double *, int, int, double *, double *, double *, int *, int, int *); void generate_exp_cut_table(); void generate_coefficients(); - int get_length(); + int get_length() override; double *expcuttable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_bondscreened.h b/src/ML-RANN/rann_fingerprint_bondscreened.h index 17f2874f7b..104c2b0bb8 100644 --- a/src/ML-RANN/rann_fingerprint_bondscreened.h +++ b/src/ML-RANN/rann_fingerprint_bondscreened.h @@ -39,14 +39,14 @@ namespace RANN { class Fingerprint_bondscreened : public Fingerprint { public: Fingerprint_bondscreened(PairRANN *); - ~Fingerprint_bondscreened(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); + ~Fingerprint_bondscreened() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; void compute_fingerprint(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, bool *, int, int, double *, - double *, double *, int *, int, int *); + double *, double *, int *, int, int *) override; void do3bodyfeatureset_doubleneighborloop(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, bool *, int, int, double *, double *, @@ -57,7 +57,7 @@ namespace RANN { double *, int *, int, int *); void generate_exp_cut_table(); void generate_coefficients(); - int get_length(); + int get_length() override; double *expcuttable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_bondscreenedspin.h b/src/ML-RANN/rann_fingerprint_bondscreenedspin.h index 306fa9ae75..5d52a18926 100644 --- a/src/ML-RANN/rann_fingerprint_bondscreenedspin.h +++ b/src/ML-RANN/rann_fingerprint_bondscreenedspin.h @@ -39,14 +39,14 @@ namespace RANN { class Fingerprint_bondscreenedspin : public Fingerprint { public: Fingerprint_bondscreenedspin(PairRANN *); - ~Fingerprint_bondscreenedspin(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); + ~Fingerprint_bondscreenedspin() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; void compute_fingerprint(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, - bool *, int, int, double *, double *, double *, int *, int, int *); + bool *, int, int, double *, double *, double *, int *, int, int *) override; void do3bodyfeatureset_doubleneighborloop(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, bool *, int, @@ -57,7 +57,7 @@ namespace RANN { int, double *, double *, double *, int *, int, int *); void generate_exp_cut_table(); void generate_coefficients(); - int get_length(); + int get_length() override; double *expcuttable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_bondspin.h b/src/ML-RANN/rann_fingerprint_bondspin.h index e3577fdb3a..fb97893c8d 100644 --- a/src/ML-RANN/rann_fingerprint_bondspin.h +++ b/src/ML-RANN/rann_fingerprint_bondspin.h @@ -38,14 +38,14 @@ namespace RANN { class Fingerprint_bondspin : public Fingerprint { public: Fingerprint_bondspin(PairRANN *); - ~Fingerprint_bondspin(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); - virtual void compute_fingerprint(double *, double *, double *, double *, double *, double *, + ~Fingerprint_bondspin() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; + void compute_fingerprint(double *, double *, double *, double *, double *, double *, double *, int, int, double *, double *, double *, int *, int, - int *); //spin + int *) override; //spin void do3bodyfeatureset_doubleneighborloop(double *, double *, double *, double *, double *, double *, double *, int, int, double *, double *, double *, int *, int, int *); @@ -54,7 +54,7 @@ namespace RANN { double *, int *, int, int *); void generate_exp_cut_table(); void generate_coefficients(); - int get_length(); + int get_length() override; double *expcuttable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_radial.h b/src/ML-RANN/rann_fingerprint_radial.h index 1b5e6bf479..c2cdd01c07 100644 --- a/src/ML-RANN/rann_fingerprint_radial.h +++ b/src/ML-RANN/rann_fingerprint_radial.h @@ -39,14 +39,14 @@ namespace RANN { class Fingerprint_radial : public Fingerprint { public: Fingerprint_radial(PairRANN *); - ~Fingerprint_radial(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); + ~Fingerprint_radial() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; void compute_fingerprint(double *, double *, double *, double *, int, int, double *, double *, - double *, int *, int, int *); - int get_length(); + double *, int *, int, int *) override; + int get_length() override; double *radialtable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_radialscreened.h b/src/ML-RANN/rann_fingerprint_radialscreened.h index 180bc5823d..885b15dee1 100644 --- a/src/ML-RANN/rann_fingerprint_radialscreened.h +++ b/src/ML-RANN/rann_fingerprint_radialscreened.h @@ -38,15 +38,15 @@ namespace RANN { class Fingerprint_radialscreened : public Fingerprint { public: Fingerprint_radialscreened(PairRANN *); - ~Fingerprint_radialscreened(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); + ~Fingerprint_radialscreened() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; void compute_fingerprint(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, bool *, int, int, double *, - double *, double *, int *, int, int *); - int get_length(); + double *, double *, int *, int, int *) override; + int get_length() override; double *radialtable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_radialscreenedspin.h b/src/ML-RANN/rann_fingerprint_radialscreenedspin.h index 5bf3cc07ef..0ea498cf23 100644 --- a/src/ML-RANN/rann_fingerprint_radialscreenedspin.h +++ b/src/ML-RANN/rann_fingerprint_radialscreenedspin.h @@ -38,16 +38,16 @@ namespace RANN { class Fingerprint_radialscreenedspin : public Fingerprint { public: Fingerprint_radialscreenedspin(PairRANN *); - ~Fingerprint_radialscreenedspin(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); - virtual void compute_fingerprint(double *, double *, double *, double *, double *, double *, + ~Fingerprint_radialscreenedspin() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; + void compute_fingerprint(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, bool *, int, int, double *, double *, - double *, int *, int, int *); //spin,screen - int get_length(); + double *, int *, int, int *) override; //spin,screen + int get_length() override; double *radialtable; double *dfctable; diff --git a/src/ML-RANN/rann_fingerprint_radialspin.h b/src/ML-RANN/rann_fingerprint_radialspin.h index 3bab1a0e28..778c479481 100644 --- a/src/ML-RANN/rann_fingerprint_radialspin.h +++ b/src/ML-RANN/rann_fingerprint_radialspin.h @@ -38,14 +38,14 @@ namespace RANN { class Fingerprint_radialspin : public Fingerprint { public: Fingerprint_radialspin(PairRANN *); - ~Fingerprint_radialspin(); - bool parse_values(std::string, std::vector); - void write_values(FILE *); - void init(int *, int); - void allocate(); + ~Fingerprint_radialspin() override; + bool parse_values(std::string, std::vector) override; + void write_values(FILE *) override; + void init(int *, int) override; + void allocate() override; void compute_fingerprint(double *, double *, double *, double *, double *, double *, double *, - int, int, double *, double *, double *, int *, int, int *); - int get_length(); + int, int, double *, double *, double *, int *, int, int *) override; + int get_length() override; double *radialtable; double *dfctable; diff --git a/src/ML-SNAP/pair_snap.h b/src/ML-SNAP/pair_snap.h index 9b07282462..26640aed1a 100644 --- a/src/ML-SNAP/pair_snap.h +++ b/src/ML-SNAP/pair_snap.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class PairSNAP : public Pair { public: PairSNAP(class LAMMPS *); - ~PairSNAP(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - virtual double memory_usage(); - virtual void *extract(const char *, int &); + ~PairSNAP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; + void *extract(const char *, int &) override; double rcutfac, quadraticflag; // declared public to workaround gcc 4.9 int ncoeff; // compiler bug, manifest in KOKKOS package diff --git a/src/MOFFF/pair_buck6d_coul_gauss_dsf.h b/src/MOFFF/pair_buck6d_coul_gauss_dsf.h index bce07e89f1..5d3a642180 100644 --- a/src/MOFFF/pair_buck6d_coul_gauss_dsf.h +++ b/src/MOFFF/pair_buck6d_coul_gauss_dsf.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairBuck6dCoulGaussDSF : public Pair { public: PairBuck6dCoulGaussDSF(class LAMMPS *); - virtual ~PairBuck6dCoulGaussDSF(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairBuck6dCoulGaussDSF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/MOFFF/pair_buck6d_coul_gauss_long.h b/src/MOFFF/pair_buck6d_coul_gauss_long.h index f25328d82e..28cc6e3bb7 100644 --- a/src/MOFFF/pair_buck6d_coul_gauss_long.h +++ b/src/MOFFF/pair_buck6d_coul_gauss_long.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairBuck6dCoulGaussLong : public Pair { public: PairBuck6dCoulGaussLong(class LAMMPS *); - virtual ~PairBuck6dCoulGaussLong(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairBuck6dCoulGaussLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.h b/src/MOLECULE/pair_hbond_dreiding_lj.h index 67b5262e32..5912282702 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.h +++ b/src/MOLECULE/pair_hbond_dreiding_lj.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairHbondDreidingLJ : public Pair { public: PairHbondDreidingLJ(class LAMMPS *); - virtual ~PairHbondDreidingLJ(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairHbondDreidingLJ() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_inner_global, cut_outer_global, cut_angle_global; diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.h b/src/MOLECULE/pair_hbond_dreiding_morse.h index 9c0fa8f198..fa9d9ac588 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.h +++ b/src/MOLECULE/pair_hbond_dreiding_morse.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairHbondDreidingMorse : public PairHbondDreidingLJ { public: PairHbondDreidingMorse(class LAMMPS *); - virtual ~PairHbondDreidingMorse(){}; - virtual void compute(int, int); - void coeff(int, char **); - void init_style(); - double single(int, int, int, int, double, double, double, double &); + + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + double single(int, int, int, int, double, double, double, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.h b/src/MOLECULE/pair_lj_charmm_coul_charmm.h index b6878dd60b..4f938f154b 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.h +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJCharmmCoulCharmm : public Pair { public: PairLJCharmmCoulCharmm(class LAMMPS *); - virtual ~PairLJCharmmCoulCharmm(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairLJCharmmCoulCharmm() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: int implicit; diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h index 5c497187ad..b358f6e1bc 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairLJCharmmCoulCharmmImplicit : public PairLJCharmmCoulCharmm { public: PairLJCharmmCoulCharmmImplicit(class LAMMPS *); - virtual void compute(int, int); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h index fd517e584f..f9931055f4 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJCharmmfswCoulCharmmfsh : public Pair { public: PairLJCharmmfswCoulCharmmfsh(class LAMMPS *); - virtual ~PairLJCharmmfswCoulCharmmfsh(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairLJCharmmfswCoulCharmmfsh() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: int implicit; diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.h b/src/MOLECULE/pair_lj_cut_tip4p_cut.h index 4e113649be..83e180915e 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.h +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJCutTIP4PCut : public Pair { public: PairLJCutTIP4PCut(class LAMMPS *); - virtual ~PairLJCutTIP4PCut(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - void *extract(const char *, int &); - double memory_usage(); + ~PairLJCutTIP4PCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + void *extract(const char *, int &) override; + double memory_usage() override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/MOLECULE/pair_tip4p_cut.h b/src/MOLECULE/pair_tip4p_cut.h index 8280a78ecf..eb5d0256b3 100644 --- a/src/MOLECULE/pair_tip4p_cut.h +++ b/src/MOLECULE/pair_tip4p_cut.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairTIP4PCut : public Pair { public: PairTIP4PCut(class LAMMPS *); - virtual ~PairTIP4PCut(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_restart(FILE *); - void read_restart(FILE *); - double memory_usage(); + ~PairTIP4PCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double memory_usage() override; protected: double cut_coul_global; diff --git a/src/OPENMP/pair_adp_omp.h b/src/OPENMP/pair_adp_omp.h index d60d004dc1..f1df192f0e 100644 --- a/src/OPENMP/pair_adp_omp.h +++ b/src/OPENMP/pair_adp_omp.h @@ -34,8 +34,8 @@ class PairADPOMP : public PairADP, public ThrOMP { public: PairADPOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_agni_omp.h b/src/OPENMP/pair_agni_omp.h index 832db111d3..9288b982cf 100644 --- a/src/OPENMP/pair_agni_omp.h +++ b/src/OPENMP/pair_agni_omp.h @@ -34,8 +34,8 @@ class PairAGNIOMP : public PairAGNI, public ThrOMP { public: PairAGNIOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_airebo_morse_omp.h b/src/OPENMP/pair_airebo_morse_omp.h index aea460098f..b7212b1b1c 100644 --- a/src/OPENMP/pair_airebo_morse_omp.h +++ b/src/OPENMP/pair_airebo_morse_omp.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairAIREBOMorseOMP : public PairAIREBOOMP { public: PairAIREBOMorseOMP(class LAMMPS *); - virtual void settings(int, char **); + void settings(int, char **) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_airebo_omp.h b/src/OPENMP/pair_airebo_omp.h index 355614552e..5f94c6d13a 100644 --- a/src/OPENMP/pair_airebo_omp.h +++ b/src/OPENMP/pair_airebo_omp.h @@ -29,8 +29,8 @@ class PairAIREBOOMP : public PairAIREBO, public ThrOMP { public: PairAIREBOOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: double bondorder_thr(int i, int j, double rij[3], double rijmag, double VA, ThrData *const thr); diff --git a/src/OPENMP/pair_beck_omp.h b/src/OPENMP/pair_beck_omp.h index b21ea4dda8..55bf4db335 100644 --- a/src/OPENMP/pair_beck_omp.h +++ b/src/OPENMP/pair_beck_omp.h @@ -34,8 +34,8 @@ class PairBeckOMP : public PairBeck, public ThrOMP { public: PairBeckOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_born_coul_long_omp.h b/src/OPENMP/pair_born_coul_long_omp.h index 78923925b0..e61353cbcd 100644 --- a/src/OPENMP/pair_born_coul_long_omp.h +++ b/src/OPENMP/pair_born_coul_long_omp.h @@ -34,8 +34,8 @@ class PairBornCoulLongOMP : public PairBornCoulLong, public ThrOMP { public: PairBornCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_born_coul_msm_omp.h b/src/OPENMP/pair_born_coul_msm_omp.h index 71845a574d..c1e52006c6 100644 --- a/src/OPENMP/pair_born_coul_msm_omp.h +++ b/src/OPENMP/pair_born_coul_msm_omp.h @@ -34,8 +34,8 @@ class PairBornCoulMSMOMP : public PairBornCoulMSM, public ThrOMP { public: PairBornCoulMSMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_born_coul_wolf_omp.h b/src/OPENMP/pair_born_coul_wolf_omp.h index 9037fa7554..afcfe41fe6 100644 --- a/src/OPENMP/pair_born_coul_wolf_omp.h +++ b/src/OPENMP/pair_born_coul_wolf_omp.h @@ -34,8 +34,8 @@ class PairBornCoulWolfOMP : public PairBornCoulWolf, public ThrOMP { public: PairBornCoulWolfOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_born_omp.h b/src/OPENMP/pair_born_omp.h index 198e3148aa..dfa262f300 100644 --- a/src/OPENMP/pair_born_omp.h +++ b/src/OPENMP/pair_born_omp.h @@ -34,8 +34,8 @@ class PairBornOMP : public PairBorn, public ThrOMP { public: PairBornOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_brownian_omp.h b/src/OPENMP/pair_brownian_omp.h index 42ca4babc6..53abf600a4 100644 --- a/src/OPENMP/pair_brownian_omp.h +++ b/src/OPENMP/pair_brownian_omp.h @@ -33,10 +33,10 @@ class PairBrownianOMP : public PairBrownian, public ThrOMP { public: PairBrownianOMP(class LAMMPS *); - virtual ~PairBrownianOMP(); + ~PairBrownianOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: class RanMars **random_thr; diff --git a/src/OPENMP/pair_brownian_poly_omp.h b/src/OPENMP/pair_brownian_poly_omp.h index 1fe54e809d..9ff184fb78 100644 --- a/src/OPENMP/pair_brownian_poly_omp.h +++ b/src/OPENMP/pair_brownian_poly_omp.h @@ -33,10 +33,10 @@ class PairBrownianPolyOMP : public PairBrownianPoly, public ThrOMP { public: PairBrownianPolyOMP(class LAMMPS *); - virtual ~PairBrownianPolyOMP(); + ~PairBrownianPolyOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: class RanMars **random_thr; diff --git a/src/OPENMP/pair_buck_coul_cut_omp.h b/src/OPENMP/pair_buck_coul_cut_omp.h index 163950cad7..5e714853d8 100644 --- a/src/OPENMP/pair_buck_coul_cut_omp.h +++ b/src/OPENMP/pair_buck_coul_cut_omp.h @@ -34,8 +34,8 @@ class PairBuckCoulCutOMP : public PairBuckCoulCut, public ThrOMP { public: PairBuckCoulCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_buck_coul_long_omp.h b/src/OPENMP/pair_buck_coul_long_omp.h index 7f55db80c1..2bca674344 100644 --- a/src/OPENMP/pair_buck_coul_long_omp.h +++ b/src/OPENMP/pair_buck_coul_long_omp.h @@ -34,8 +34,8 @@ class PairBuckCoulLongOMP : public PairBuckCoulLong, public ThrOMP { public: PairBuckCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_buck_coul_msm_omp.h b/src/OPENMP/pair_buck_coul_msm_omp.h index 8377bb2077..8928234007 100644 --- a/src/OPENMP/pair_buck_coul_msm_omp.h +++ b/src/OPENMP/pair_buck_coul_msm_omp.h @@ -34,8 +34,8 @@ class PairBuckCoulMSMOMP : public PairBuckCoulMSM, public ThrOMP { public: PairBuckCoulMSMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_buck_long_coul_long_omp.h b/src/OPENMP/pair_buck_long_coul_long_omp.h index 76502fd05c..3681e6e48e 100644 --- a/src/OPENMP/pair_buck_long_coul_long_omp.h +++ b/src/OPENMP/pair_buck_long_coul_long_omp.h @@ -30,10 +30,10 @@ class PairBuckLongCoulLongOMP : public PairBuckLongCoulLong, public ThrOMP { public: PairBuckLongCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual void compute_inner(); - virtual void compute_middle(); - virtual void compute_outer(int, int); + void compute(int, int) override; + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; private: template diff --git a/src/OPENMP/pair_colloid_omp.h b/src/OPENMP/pair_colloid_omp.h index bcebbd4437..f433c57723 100644 --- a/src/OPENMP/pair_colloid_omp.h +++ b/src/OPENMP/pair_colloid_omp.h @@ -34,8 +34,8 @@ class PairColloidOMP : public PairColloid, public ThrOMP { public: PairColloidOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_comb_omp.h b/src/OPENMP/pair_comb_omp.h index 69adc2fe3e..0eedff3b5f 100644 --- a/src/OPENMP/pair_comb_omp.h +++ b/src/OPENMP/pair_comb_omp.h @@ -29,10 +29,10 @@ class PairCombOMP : public PairComb, public ThrOMP { public: PairCombOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; - virtual double yasu_char(double *, int &); + double yasu_char(double *, int &) override; private: template diff --git a/src/OPENMP/pair_coul_cut_global_omp.h b/src/OPENMP/pair_coul_cut_global_omp.h index 118b769e0b..811c2fe913 100644 --- a/src/OPENMP/pair_coul_cut_global_omp.h +++ b/src/OPENMP/pair_coul_cut_global_omp.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairCoulCutGlobalOMP : public PairCoulCutOMP { public: PairCoulCutGlobalOMP(class LAMMPS *lmp) : PairCoulCutOMP(lmp) {} - void coeff(int, char **); - void *extract(const char *, int &); + void coeff(int, char **) override; + void *extract(const char *, int &) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_coul_cut_omp.h b/src/OPENMP/pair_coul_cut_omp.h index 1cfad1f91a..218ff4cfc2 100644 --- a/src/OPENMP/pair_coul_cut_omp.h +++ b/src/OPENMP/pair_coul_cut_omp.h @@ -34,8 +34,8 @@ class PairCoulCutOMP : public PairCoulCut, public ThrOMP { public: PairCoulCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_cut_soft_omp.h b/src/OPENMP/pair_coul_cut_soft_omp.h index 54bcc58efd..b2ecc64b80 100644 --- a/src/OPENMP/pair_coul_cut_soft_omp.h +++ b/src/OPENMP/pair_coul_cut_soft_omp.h @@ -34,8 +34,8 @@ class PairCoulCutSoftOMP : public PairCoulCutSoft, public ThrOMP { public: PairCoulCutSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_debye_omp.h b/src/OPENMP/pair_coul_debye_omp.h index f993c6bafd..e1b67a7d26 100644 --- a/src/OPENMP/pair_coul_debye_omp.h +++ b/src/OPENMP/pair_coul_debye_omp.h @@ -34,8 +34,8 @@ class PairCoulDebyeOMP : public PairCoulDebye, public ThrOMP { public: PairCoulDebyeOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_diel_omp.h b/src/OPENMP/pair_coul_diel_omp.h index 5a86469056..4c7c386e86 100644 --- a/src/OPENMP/pair_coul_diel_omp.h +++ b/src/OPENMP/pair_coul_diel_omp.h @@ -34,8 +34,8 @@ class PairCoulDielOMP : public PairCoulDiel, public ThrOMP { public: PairCoulDielOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_dsf_omp.h b/src/OPENMP/pair_coul_dsf_omp.h index 1ad36b5c39..d0aa45c11c 100644 --- a/src/OPENMP/pair_coul_dsf_omp.h +++ b/src/OPENMP/pair_coul_dsf_omp.h @@ -34,8 +34,8 @@ class PairCoulDSFOMP : public PairCoulDSF, public ThrOMP { public: PairCoulDSFOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_long_omp.h b/src/OPENMP/pair_coul_long_omp.h index 80cfa8e601..cbe876f3d4 100644 --- a/src/OPENMP/pair_coul_long_omp.h +++ b/src/OPENMP/pair_coul_long_omp.h @@ -34,8 +34,8 @@ class PairCoulLongOMP : public PairCoulLong, public ThrOMP { public: PairCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_long_soft_omp.h b/src/OPENMP/pair_coul_long_soft_omp.h index e4cb6cdadb..6cee02c424 100644 --- a/src/OPENMP/pair_coul_long_soft_omp.h +++ b/src/OPENMP/pair_coul_long_soft_omp.h @@ -34,8 +34,8 @@ class PairCoulLongSoftOMP : public PairCoulLongSoft, public ThrOMP { public: PairCoulLongSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_msm_omp.h b/src/OPENMP/pair_coul_msm_omp.h index 4780567b4a..f825a57956 100644 --- a/src/OPENMP/pair_coul_msm_omp.h +++ b/src/OPENMP/pair_coul_msm_omp.h @@ -34,8 +34,8 @@ class PairCoulMSMOMP : public PairCoulMSM, public ThrOMP { public: PairCoulMSMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_coul_wolf_omp.h b/src/OPENMP/pair_coul_wolf_omp.h index 09bec2e39c..47aadd7443 100644 --- a/src/OPENMP/pair_coul_wolf_omp.h +++ b/src/OPENMP/pair_coul_wolf_omp.h @@ -34,8 +34,8 @@ class PairCoulWolfOMP : public PairCoulWolf, public ThrOMP { public: PairCoulWolfOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_dpd_omp.h b/src/OPENMP/pair_dpd_omp.h index 73f80eff03..4b004ad81e 100644 --- a/src/OPENMP/pair_dpd_omp.h +++ b/src/OPENMP/pair_dpd_omp.h @@ -33,10 +33,10 @@ class PairDPDOMP : public PairDPD, public ThrOMP { public: PairDPDOMP(class LAMMPS *); - virtual ~PairDPDOMP(); + ~PairDPDOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: class RanMars **random_thr; diff --git a/src/OPENMP/pair_dpd_tstat_omp.h b/src/OPENMP/pair_dpd_tstat_omp.h index 79c928075a..b9cbe902f7 100644 --- a/src/OPENMP/pair_dpd_tstat_omp.h +++ b/src/OPENMP/pair_dpd_tstat_omp.h @@ -33,10 +33,10 @@ class PairDPDTstatOMP : public PairDPDTstat, public ThrOMP { public: PairDPDTstatOMP(class LAMMPS *); - virtual ~PairDPDTstatOMP(); + ~PairDPDTstatOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: class RanMars **random_thr; diff --git a/src/OPENMP/pair_eam_alloy_omp.h b/src/OPENMP/pair_eam_alloy_omp.h index d51b9698fc..38e32ddedf 100644 --- a/src/OPENMP/pair_eam_alloy_omp.h +++ b/src/OPENMP/pair_eam_alloy_omp.h @@ -29,12 +29,12 @@ namespace LAMMPS_NS { class PairEAMAlloyOMP : virtual public PairEAMOMP { public: PairEAMAlloyOMP(class LAMMPS *); - virtual ~PairEAMAlloyOMP() {} - void coeff(int, char **); + + void coeff(int, char **) override; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_eam_fs_omp.h b/src/OPENMP/pair_eam_fs_omp.h index 6455cbbd17..c68de71623 100644 --- a/src/OPENMP/pair_eam_fs_omp.h +++ b/src/OPENMP/pair_eam_fs_omp.h @@ -29,12 +29,12 @@ namespace LAMMPS_NS { class PairEAMFSOMP : virtual public PairEAMOMP { public: PairEAMFSOMP(class LAMMPS *); - virtual ~PairEAMFSOMP() {} - void coeff(int, char **); + + void coeff(int, char **) override; protected: - void read_file(char *); - void file2array(); + void read_file(char *) override; + void file2array() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_eam_omp.h b/src/OPENMP/pair_eam_omp.h index 14531f0105..3401241808 100644 --- a/src/OPENMP/pair_eam_omp.h +++ b/src/OPENMP/pair_eam_omp.h @@ -34,8 +34,8 @@ class PairEAMOMP : public PairEAM, public ThrOMP { public: PairEAMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_edip_omp.h b/src/OPENMP/pair_edip_omp.h index a3b99ec46e..e9afe243ab 100644 --- a/src/OPENMP/pair_edip_omp.h +++ b/src/OPENMP/pair_edip_omp.h @@ -29,8 +29,8 @@ class PairEDIPOMP : public PairEDIP, public ThrOMP { public: PairEDIPOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_eim_omp.h b/src/OPENMP/pair_eim_omp.h index 8242c2d141..708c15243f 100644 --- a/src/OPENMP/pair_eim_omp.h +++ b/src/OPENMP/pair_eim_omp.h @@ -34,8 +34,8 @@ class PairEIMOMP : public PairEIM, public ThrOMP { public: PairEIMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_gauss_cut_omp.h b/src/OPENMP/pair_gauss_cut_omp.h index d59daf3c3b..3ed1603222 100644 --- a/src/OPENMP/pair_gauss_cut_omp.h +++ b/src/OPENMP/pair_gauss_cut_omp.h @@ -34,8 +34,8 @@ class PairGaussCutOMP : public PairGaussCut, public ThrOMP { public: PairGaussCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_gauss_omp.h b/src/OPENMP/pair_gauss_omp.h index ec5ca92f70..4cda138e48 100644 --- a/src/OPENMP/pair_gauss_omp.h +++ b/src/OPENMP/pair_gauss_omp.h @@ -34,8 +34,8 @@ class PairGaussOMP : public PairGauss, public ThrOMP { public: PairGaussOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_gayberne_omp.h b/src/OPENMP/pair_gayberne_omp.h index 89d5f22023..3038f0faf6 100644 --- a/src/OPENMP/pair_gayberne_omp.h +++ b/src/OPENMP/pair_gayberne_omp.h @@ -34,8 +34,8 @@ class PairGayBerneOMP : public PairGayBerne, public ThrOMP { public: PairGayBerneOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_gran_hertz_history_omp.h b/src/OPENMP/pair_gran_hertz_history_omp.h index 029d37c6f8..393104d0d8 100644 --- a/src/OPENMP/pair_gran_hertz_history_omp.h +++ b/src/OPENMP/pair_gran_hertz_history_omp.h @@ -34,8 +34,8 @@ class PairGranHertzHistoryOMP : public PairGranHertzHistory, public ThrOMP { public: PairGranHertzHistoryOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_gran_hooke_history_omp.h b/src/OPENMP/pair_gran_hooke_history_omp.h index 3f0dd1d503..c07a847fab 100644 --- a/src/OPENMP/pair_gran_hooke_history_omp.h +++ b/src/OPENMP/pair_gran_hooke_history_omp.h @@ -34,8 +34,8 @@ class PairGranHookeHistoryOMP : public PairGranHookeHistory, public ThrOMP { public: PairGranHookeHistoryOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_gran_hooke_omp.h b/src/OPENMP/pair_gran_hooke_omp.h index 158b128558..153290a780 100644 --- a/src/OPENMP/pair_gran_hooke_omp.h +++ b/src/OPENMP/pair_gran_hooke_omp.h @@ -34,8 +34,8 @@ class PairGranHookeOMP : public PairGranHooke, public ThrOMP { public: PairGranHookeOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template void eval(int ifrom, int ito, ThrData *const thr); diff --git a/src/OPENMP/pair_harmonic_cut_omp.h b/src/OPENMP/pair_harmonic_cut_omp.h index 4f40d2cf2a..9e84e508c0 100644 --- a/src/OPENMP/pair_harmonic_cut_omp.h +++ b/src/OPENMP/pair_harmonic_cut_omp.h @@ -34,8 +34,8 @@ class PairHarmonicCutOMP : public PairHarmonicCut, public ThrOMP { public: PairHarmonicCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_hbond_dreiding_lj_omp.h b/src/OPENMP/pair_hbond_dreiding_lj_omp.h index b3a97c59db..7b51c071b9 100644 --- a/src/OPENMP/pair_hbond_dreiding_lj_omp.h +++ b/src/OPENMP/pair_hbond_dreiding_lj_omp.h @@ -33,10 +33,10 @@ class PairHbondDreidingLJOMP : public PairHbondDreidingLJ, public ThrOMP { public: PairHbondDreidingLJOMP(class LAMMPS *); - virtual ~PairHbondDreidingLJOMP(); + ~PairHbondDreidingLJOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: double *hbcount_thr, *hbeng_thr; diff --git a/src/OPENMP/pair_hbond_dreiding_morse_omp.h b/src/OPENMP/pair_hbond_dreiding_morse_omp.h index 44b0671087..c5ebd9bc47 100644 --- a/src/OPENMP/pair_hbond_dreiding_morse_omp.h +++ b/src/OPENMP/pair_hbond_dreiding_morse_omp.h @@ -33,10 +33,10 @@ class PairHbondDreidingMorseOMP : public PairHbondDreidingMorse, public ThrOMP { public: PairHbondDreidingMorseOMP(class LAMMPS *); - virtual ~PairHbondDreidingMorseOMP(); + ~PairHbondDreidingMorseOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: double *hbcount_thr, *hbeng_thr; diff --git a/src/OPENMP/pair_lj96_cut_omp.h b/src/OPENMP/pair_lj96_cut_omp.h index de2460c99f..59c6606cdb 100644 --- a/src/OPENMP/pair_lj96_cut_omp.h +++ b/src/OPENMP/pair_lj96_cut_omp.h @@ -34,8 +34,8 @@ class PairLJ96CutOMP : public PairLJ96Cut, public ThrOMP { public: PairLJ96CutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.h b/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.h index e3b8d40d18..d6c08e2e97 100644 --- a/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.h +++ b/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.h @@ -34,8 +34,8 @@ class PairLJCharmmCoulCharmmImplicitOMP : public PairLJCharmmCoulCharmmImplicit, public: PairLJCharmmCoulCharmmImplicitOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_charmm_coul_charmm_omp.h b/src/OPENMP/pair_lj_charmm_coul_charmm_omp.h index 83d1e8bdc1..f020cba462 100644 --- a/src/OPENMP/pair_lj_charmm_coul_charmm_omp.h +++ b/src/OPENMP/pair_lj_charmm_coul_charmm_omp.h @@ -34,8 +34,8 @@ class PairLJCharmmCoulCharmmOMP : public PairLJCharmmCoulCharmm, public ThrOMP { public: PairLJCharmmCoulCharmmOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_charmm_coul_long_omp.h b/src/OPENMP/pair_lj_charmm_coul_long_omp.h index c507c5e29e..5dae557380 100644 --- a/src/OPENMP/pair_lj_charmm_coul_long_omp.h +++ b/src/OPENMP/pair_lj_charmm_coul_long_omp.h @@ -34,8 +34,8 @@ class PairLJCharmmCoulLongOMP : public PairLJCharmmCoulLong, public ThrOMP { public: PairLJCharmmCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.h b/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.h index 757ddb689d..d4087d4e4f 100644 --- a/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.h +++ b/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.h @@ -34,8 +34,8 @@ class PairLJCharmmCoulLongSoftOMP : public PairLJCharmmCoulLongSoft, public ThrO public: PairLJCharmmCoulLongSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_charmm_coul_msm_omp.h b/src/OPENMP/pair_lj_charmm_coul_msm_omp.h index 08f109e53e..b91c8faef6 100644 --- a/src/OPENMP/pair_lj_charmm_coul_msm_omp.h +++ b/src/OPENMP/pair_lj_charmm_coul_msm_omp.h @@ -34,8 +34,8 @@ class PairLJCharmmCoulMSMOMP : public PairLJCharmmCoulMSM, public ThrOMP { public: PairLJCharmmCoulMSMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_class2_coul_cut_omp.h b/src/OPENMP/pair_lj_class2_coul_cut_omp.h index dbd9b77799..10d1574436 100644 --- a/src/OPENMP/pair_lj_class2_coul_cut_omp.h +++ b/src/OPENMP/pair_lj_class2_coul_cut_omp.h @@ -34,8 +34,8 @@ class PairLJClass2CoulCutOMP : public PairLJClass2CoulCut, public ThrOMP { public: PairLJClass2CoulCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_class2_coul_long_omp.h b/src/OPENMP/pair_lj_class2_coul_long_omp.h index 2db5dc9642..a6e297aea6 100644 --- a/src/OPENMP/pair_lj_class2_coul_long_omp.h +++ b/src/OPENMP/pair_lj_class2_coul_long_omp.h @@ -34,8 +34,8 @@ class PairLJClass2CoulLongOMP : public PairLJClass2CoulLong, public ThrOMP { public: PairLJClass2CoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_class2_omp.h b/src/OPENMP/pair_lj_class2_omp.h index 38e072a7f3..e9864c5985 100644 --- a/src/OPENMP/pair_lj_class2_omp.h +++ b/src/OPENMP/pair_lj_class2_omp.h @@ -34,8 +34,8 @@ class PairLJClass2OMP : public PairLJClass2, public ThrOMP { public: PairLJClass2OMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cubic_omp.h b/src/OPENMP/pair_lj_cubic_omp.h index a4e74d95b9..a01c6ce5f1 100644 --- a/src/OPENMP/pair_lj_cubic_omp.h +++ b/src/OPENMP/pair_lj_cubic_omp.h @@ -34,8 +34,8 @@ class PairLJCubicOMP : public PairLJCubic, public ThrOMP { public: PairLJCubicOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h index 5f28aa4d17..527309909e 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h @@ -28,8 +28,8 @@ namespace LAMMPS_NS { class PairLJCutCoulCutDielectricOMP : public PairLJCutCoulCutDielectric, public ThrOMP { public: PairLJCutCoulCutDielectricOMP(class LAMMPS *); - virtual ~PairLJCutCoulCutDielectricOMP() = default; - virtual void compute(int, int); + ~PairLJCutCoulCutDielectricOMP() override = default; + void compute(int, int) override; protected: template diff --git a/src/OPENMP/pair_lj_cut_coul_cut_omp.h b/src/OPENMP/pair_lj_cut_coul_cut_omp.h index 36a35b112e..2b2af00741 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_cut_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulCutOMP : public PairLJCutCoulCut, public ThrOMP { public: PairLJCutCoulCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.h b/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.h index bc25b7e18a..8482937910 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulCutSoftOMP : public PairLJCutCoulCutSoft, public ThrOMP { public: PairLJCutCoulCutSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_debye_omp.h b/src/OPENMP/pair_lj_cut_coul_debye_omp.h index 8e565bdcdf..fdaf692bae 100644 --- a/src/OPENMP/pair_lj_cut_coul_debye_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_debye_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulDebyeOMP : public PairLJCutCoulDebye, public ThrOMP { public: PairLJCutCoulDebyeOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_dsf_omp.h b/src/OPENMP/pair_lj_cut_coul_dsf_omp.h index 06ec6348e8..c7d5baf921 100644 --- a/src/OPENMP/pair_lj_cut_coul_dsf_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_dsf_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulDSFOMP : public PairLJCutCoulDSF, public ThrOMP { public: PairLJCutCoulDSFOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h index f70809524f..4aa7e70ee6 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h @@ -29,8 +29,8 @@ class PairLJCutCoulLongDielectricOMP : public PairLJCutCoulLongDielectric, publi public: PairLJCutCoulLongDielectricOMP(class LAMMPS *); - virtual ~PairLJCutCoulLongDielectricOMP() = default; - virtual void compute(int, int); + ~PairLJCutCoulLongDielectricOMP() override = default; + void compute(int, int) override; protected: template diff --git a/src/OPENMP/pair_lj_cut_coul_long_omp.h b/src/OPENMP/pair_lj_cut_coul_long_omp.h index d18ca10f8e..ca7c30dede 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_long_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulLongOMP : public PairLJCutCoulLong, public ThrOMP { public: PairLJCutCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_long_soft_omp.h b/src/OPENMP/pair_lj_cut_coul_long_soft_omp.h index 8ee2d3ced0..00c6b031a4 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_soft_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_long_soft_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulLongSoftOMP : public PairLJCutCoulLongSoft, public ThrOMP { public: PairLJCutCoulLongSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_msm_omp.h b/src/OPENMP/pair_lj_cut_coul_msm_omp.h index 900a975991..8f9892903a 100644 --- a/src/OPENMP/pair_lj_cut_coul_msm_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_msm_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulMSMOMP : public PairLJCutCoulMSM, public ThrOMP { public: PairLJCutCoulMSMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_coul_wolf_omp.h b/src/OPENMP/pair_lj_cut_coul_wolf_omp.h index b108769aee..b0fd2b3258 100644 --- a/src/OPENMP/pair_lj_cut_coul_wolf_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_wolf_omp.h @@ -34,8 +34,8 @@ class PairLJCutCoulWolfOMP : public PairLJCutCoulWolf, public ThrOMP { public: PairLJCutCoulWolfOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_dipole_cut_omp.h b/src/OPENMP/pair_lj_cut_dipole_cut_omp.h index 584810d1c2..117b17a0ac 100644 --- a/src/OPENMP/pair_lj_cut_dipole_cut_omp.h +++ b/src/OPENMP/pair_lj_cut_dipole_cut_omp.h @@ -34,8 +34,8 @@ class PairLJCutDipoleCutOMP : public PairLJCutDipoleCut, public ThrOMP { public: PairLJCutDipoleCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_omp.h b/src/OPENMP/pair_lj_cut_omp.h index 1e93a589c4..604b5f2c81 100644 --- a/src/OPENMP/pair_lj_cut_omp.h +++ b/src/OPENMP/pair_lj_cut_omp.h @@ -34,8 +34,8 @@ class PairLJCutOMP : public PairLJCut, public ThrOMP { public: PairLJCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_soft_omp.h b/src/OPENMP/pair_lj_cut_soft_omp.h index 8139cfb6fd..70a72f8986 100644 --- a/src/OPENMP/pair_lj_cut_soft_omp.h +++ b/src/OPENMP/pair_lj_cut_soft_omp.h @@ -34,8 +34,8 @@ class PairLJCutSoftOMP : public PairLJCutSoft, public ThrOMP { public: PairLJCutSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_cut_thole_long_omp.h b/src/OPENMP/pair_lj_cut_thole_long_omp.h index 9e0e56a35f..ea17517487 100644 --- a/src/OPENMP/pair_lj_cut_thole_long_omp.h +++ b/src/OPENMP/pair_lj_cut_thole_long_omp.h @@ -29,7 +29,7 @@ class PairLJCutTholeLongOMP : public PairLJCutTholeLong, public ThrOMP { public: PairLJCutTholeLongOMP(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; private: template diff --git a/src/OPENMP/pair_lj_cut_tip4p_cut_omp.h b/src/OPENMP/pair_lj_cut_tip4p_cut_omp.h index a0700930ab..2516413af3 100644 --- a/src/OPENMP/pair_lj_cut_tip4p_cut_omp.h +++ b/src/OPENMP/pair_lj_cut_tip4p_cut_omp.h @@ -33,10 +33,10 @@ class PairLJCutTIP4PCutOMP : public PairLJCutTIP4PCut, public ThrOMP { public: PairLJCutTIP4PCutOMP(class LAMMPS *); - virtual ~PairLJCutTIP4PCutOMP(); + ~PairLJCutTIP4PCutOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: dbl3_t *newsite_thr; diff --git a/src/OPENMP/pair_lj_cut_tip4p_long_omp.h b/src/OPENMP/pair_lj_cut_tip4p_long_omp.h index 49598158dc..54e93a4791 100644 --- a/src/OPENMP/pair_lj_cut_tip4p_long_omp.h +++ b/src/OPENMP/pair_lj_cut_tip4p_long_omp.h @@ -33,10 +33,10 @@ class PairLJCutTIP4PLongOMP : public PairLJCutTIP4PLong, public ThrOMP { public: PairLJCutTIP4PLongOMP(class LAMMPS *); - virtual ~PairLJCutTIP4PLongOMP(); + ~PairLJCutTIP4PLongOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: dbl3_t *newsite_thr; diff --git a/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.h b/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.h index 9ca41a122b..0ea785b067 100644 --- a/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.h +++ b/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.h @@ -33,10 +33,10 @@ class PairLJCutTIP4PLongSoftOMP : public PairLJCutTIP4PLongSoft, public ThrOMP { public: PairLJCutTIP4PLongSoftOMP(class LAMMPS *); - virtual ~PairLJCutTIP4PLongSoftOMP(); + ~PairLJCutTIP4PLongSoftOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: dbl3_t *newsite_thr; diff --git a/src/OPENMP/pair_lj_expand_omp.h b/src/OPENMP/pair_lj_expand_omp.h index 3be4b6113d..ddfc09b789 100644 --- a/src/OPENMP/pair_lj_expand_omp.h +++ b/src/OPENMP/pair_lj_expand_omp.h @@ -34,8 +34,8 @@ class PairLJExpandOMP : public PairLJExpand, public ThrOMP { public: PairLJExpandOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.h b/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.h index 60c2d755b0..7ee77daf77 100644 --- a/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.h +++ b/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.h @@ -34,8 +34,8 @@ class PairLJGromacsCoulGromacsOMP : public PairLJGromacsCoulGromacs, public ThrO public: PairLJGromacsCoulGromacsOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_gromacs_omp.h b/src/OPENMP/pair_lj_gromacs_omp.h index ae69bae5f5..54e837864c 100644 --- a/src/OPENMP/pair_lj_gromacs_omp.h +++ b/src/OPENMP/pair_lj_gromacs_omp.h @@ -34,8 +34,8 @@ class PairLJGromacsOMP : public PairLJGromacs, public ThrOMP { public: PairLJGromacsOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_long_coul_long_omp.h b/src/OPENMP/pair_lj_long_coul_long_omp.h index 7ada6e7686..24b38ceeb6 100644 --- a/src/OPENMP/pair_lj_long_coul_long_omp.h +++ b/src/OPENMP/pair_lj_long_coul_long_omp.h @@ -34,11 +34,11 @@ class PairLJLongCoulLongOMP : public PairLJLongCoulLong, public ThrOMP { public: PairLJLongCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual void compute_inner(); - virtual void compute_middle(); - virtual void compute_outer(int, int); - virtual double memory_usage(); + void compute(int, int) override; + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_sdk_coul_long_omp.h b/src/OPENMP/pair_lj_sdk_coul_long_omp.h index 7fc55ffde4..d19139de26 100644 --- a/src/OPENMP/pair_lj_sdk_coul_long_omp.h +++ b/src/OPENMP/pair_lj_sdk_coul_long_omp.h @@ -34,8 +34,8 @@ class PairLJSDKCoulLongOMP : public PairLJSDKCoulLong, public ThrOMP { public: PairLJSDKCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_sdk_coul_msm_omp.h b/src/OPENMP/pair_lj_sdk_coul_msm_omp.h index d9f800b3a4..a1c881f4d0 100644 --- a/src/OPENMP/pair_lj_sdk_coul_msm_omp.h +++ b/src/OPENMP/pair_lj_sdk_coul_msm_omp.h @@ -34,8 +34,8 @@ class PairLJSDKCoulMSMOMP : public PairLJSDKCoulMSM, public ThrOMP { public: PairLJSDKCoulMSMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_sdk_omp.h b/src/OPENMP/pair_lj_sdk_omp.h index ebd262f333..1ef27f6fb6 100644 --- a/src/OPENMP/pair_lj_sdk_omp.h +++ b/src/OPENMP/pair_lj_sdk_omp.h @@ -34,8 +34,8 @@ class PairLJSDKOMP : public PairLJSDK, public ThrOMP { public: PairLJSDKOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_sf_dipole_sf_omp.h b/src/OPENMP/pair_lj_sf_dipole_sf_omp.h index fd57a466b0..6f85cbd6ee 100644 --- a/src/OPENMP/pair_lj_sf_dipole_sf_omp.h +++ b/src/OPENMP/pair_lj_sf_dipole_sf_omp.h @@ -34,8 +34,8 @@ class PairLJSFDipoleSFOMP : public PairLJSFDipoleSF, public ThrOMP { public: PairLJSFDipoleSFOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_smooth_linear_omp.h b/src/OPENMP/pair_lj_smooth_linear_omp.h index e39362f6f7..b0ed2d6a12 100644 --- a/src/OPENMP/pair_lj_smooth_linear_omp.h +++ b/src/OPENMP/pair_lj_smooth_linear_omp.h @@ -35,8 +35,8 @@ class PairLJSmoothLinearOMP : public PairLJSmoothLinear, public ThrOMP { public: PairLJSmoothLinearOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lj_smooth_omp.h b/src/OPENMP/pair_lj_smooth_omp.h index b2497aa7a5..de8601b79c 100644 --- a/src/OPENMP/pair_lj_smooth_omp.h +++ b/src/OPENMP/pair_lj_smooth_omp.h @@ -34,8 +34,8 @@ class PairLJSmoothOMP : public PairLJSmooth, public ThrOMP { public: PairLJSmoothOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lubricate_omp.h b/src/OPENMP/pair_lubricate_omp.h index 1f5fc340bb..4c5d25f67d 100644 --- a/src/OPENMP/pair_lubricate_omp.h +++ b/src/OPENMP/pair_lubricate_omp.h @@ -33,10 +33,10 @@ class PairLubricateOMP : public PairLubricate, public ThrOMP { public: PairLubricateOMP(class LAMMPS *); - virtual ~PairLubricateOMP() = default; + ~PairLubricateOMP() override = default; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_lubricate_poly_omp.h b/src/OPENMP/pair_lubricate_poly_omp.h index 5a36d232b8..4b783784b4 100644 --- a/src/OPENMP/pair_lubricate_poly_omp.h +++ b/src/OPENMP/pair_lubricate_poly_omp.h @@ -33,10 +33,10 @@ class PairLubricatePolyOMP : public PairLubricatePoly, public ThrOMP { public: PairLubricatePolyOMP(class LAMMPS *); - virtual ~PairLubricatePolyOMP() = default; + ~PairLubricatePolyOMP() override = default; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_meam_spline_omp.h b/src/OPENMP/pair_meam_spline_omp.h index 7086705320..5e7dc49f67 100644 --- a/src/OPENMP/pair_meam_spline_omp.h +++ b/src/OPENMP/pair_meam_spline_omp.h @@ -34,8 +34,8 @@ class PairMEAMSplineOMP : public PairMEAMSpline, public ThrOMP { public: PairMEAMSplineOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template void eval(int iifrom, int iito, ThrData *const thr); diff --git a/src/OPENMP/pair_morse_omp.h b/src/OPENMP/pair_morse_omp.h index e390ef1cd2..a781ed327b 100644 --- a/src/OPENMP/pair_morse_omp.h +++ b/src/OPENMP/pair_morse_omp.h @@ -34,8 +34,8 @@ class PairMorseOMP : public PairMorse, public ThrOMP { public: PairMorseOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_morse_smooth_linear_omp.h b/src/OPENMP/pair_morse_smooth_linear_omp.h index ed1ad5c88c..ecddb473dd 100644 --- a/src/OPENMP/pair_morse_smooth_linear_omp.h +++ b/src/OPENMP/pair_morse_smooth_linear_omp.h @@ -29,8 +29,8 @@ class PairMorseSmoothLinearOMP : public PairMorseSmoothLinear, public ThrOMP { public: PairMorseSmoothLinearOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_nm_cut_coul_cut_omp.h b/src/OPENMP/pair_nm_cut_coul_cut_omp.h index 3d3aefb8f1..7a07dfda0d 100644 --- a/src/OPENMP/pair_nm_cut_coul_cut_omp.h +++ b/src/OPENMP/pair_nm_cut_coul_cut_omp.h @@ -34,8 +34,8 @@ class PairNMCutCoulCutOMP : public PairNMCutCoulCut, public ThrOMP { public: PairNMCutCoulCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_nm_cut_coul_long_omp.h b/src/OPENMP/pair_nm_cut_coul_long_omp.h index 1519af2547..0d59763ee5 100644 --- a/src/OPENMP/pair_nm_cut_coul_long_omp.h +++ b/src/OPENMP/pair_nm_cut_coul_long_omp.h @@ -34,8 +34,8 @@ class PairNMCutCoulLongOMP : public PairNMCutCoulLong, public ThrOMP { public: PairNMCutCoulLongOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_nm_cut_omp.h b/src/OPENMP/pair_nm_cut_omp.h index 15f90dff33..f9c93489c8 100644 --- a/src/OPENMP/pair_nm_cut_omp.h +++ b/src/OPENMP/pair_nm_cut_omp.h @@ -34,8 +34,8 @@ class PairNMCutOMP : public PairNMCut, public ThrOMP { public: PairNMCutOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_peri_lps_omp.h b/src/OPENMP/pair_peri_lps_omp.h index 758e17bcf3..5a2e32256c 100644 --- a/src/OPENMP/pair_peri_lps_omp.h +++ b/src/OPENMP/pair_peri_lps_omp.h @@ -34,8 +34,8 @@ class PairPeriLPSOMP : public PairPeriLPS, public ThrOMP { public: PairPeriLPSOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_peri_pmb_omp.h b/src/OPENMP/pair_peri_pmb_omp.h index e2017f841e..4e48a30b5b 100644 --- a/src/OPENMP/pair_peri_pmb_omp.h +++ b/src/OPENMP/pair_peri_pmb_omp.h @@ -34,8 +34,8 @@ class PairPeriPMBOMP : public PairPeriPMB, public ThrOMP { public: PairPeriPMBOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_reaxff_omp.h b/src/OPENMP/pair_reaxff_omp.h index 4424c90b39..d2ec2fb6bb 100644 --- a/src/OPENMP/pair_reaxff_omp.h +++ b/src/OPENMP/pair_reaxff_omp.h @@ -29,9 +29,9 @@ namespace LAMMPS_NS { class PairReaxFFOMP : public PairReaxFF, public ThrOMP { public: PairReaxFFOMP(class LAMMPS *); - ~PairReaxFFOMP(); - virtual void compute(int, int); - virtual void init_style(); + ~PairReaxFFOMP() override; + void compute(int, int) override; + void init_style() override; inline FixOMP *getFixOMP() { return fix; }; @@ -98,7 +98,7 @@ class PairReaxFFOMP : public PairReaxFF, public ThrOMP { } protected: - virtual void setup(); + void setup() override; virtual void write_reax_atoms(); virtual int estimate_reax_lists(); virtual int write_reax_lists(); diff --git a/src/OPENMP/pair_rebo_omp.h b/src/OPENMP/pair_rebo_omp.h index 5629a37318..55cfcfa647 100644 --- a/src/OPENMP/pair_rebo_omp.h +++ b/src/OPENMP/pair_rebo_omp.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class PairREBOOMP : public PairAIREBOOMP { public: PairREBOOMP(class LAMMPS *); - virtual void settings(int, char **); + void settings(int, char **) override; protected: - void spline_init(); + void spline_init() override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_resquared_omp.h b/src/OPENMP/pair_resquared_omp.h index 58718104ff..515e3dc8ec 100644 --- a/src/OPENMP/pair_resquared_omp.h +++ b/src/OPENMP/pair_resquared_omp.h @@ -34,8 +34,8 @@ class PairRESquaredOMP : public PairRESquared, public ThrOMP { public: PairRESquaredOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_soft_omp.h b/src/OPENMP/pair_soft_omp.h index 6435f5b4ca..d8a4d885f2 100644 --- a/src/OPENMP/pair_soft_omp.h +++ b/src/OPENMP/pair_soft_omp.h @@ -34,8 +34,8 @@ class PairSoftOMP : public PairSoft, public ThrOMP { public: PairSoftOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_sw_mod_omp.h b/src/OPENMP/pair_sw_mod_omp.h index 7e69ca283b..1b7fd31ee9 100644 --- a/src/OPENMP/pair_sw_mod_omp.h +++ b/src/OPENMP/pair_sw_mod_omp.h @@ -32,15 +32,14 @@ class PairSWMODOMP : public PairSWOMP { public: PairSWMODOMP(class LAMMPS *); - virtual ~PairSWMODOMP() {} protected: double delta1; double delta2; - void settings(int, char **); + void settings(int, char **) override; void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, - int, double &); + int, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_sw_omp.h b/src/OPENMP/pair_sw_omp.h index 263e25e99a..84c35ae0e3 100644 --- a/src/OPENMP/pair_sw_omp.h +++ b/src/OPENMP/pair_sw_omp.h @@ -34,8 +34,8 @@ class PairSWOMP : public PairSW, public ThrOMP { public: PairSWOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template void eval(int ifrom, int ito, ThrData *const thr); diff --git a/src/OPENMP/pair_table_omp.h b/src/OPENMP/pair_table_omp.h index f3a02ce55e..8ccb8d7e87 100644 --- a/src/OPENMP/pair_table_omp.h +++ b/src/OPENMP/pair_table_omp.h @@ -34,8 +34,8 @@ class PairTableOMP : public PairTable, public ThrOMP { public: PairTableOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_tersoff_mod_c_omp.h b/src/OPENMP/pair_tersoff_mod_c_omp.h index 787089efc4..c50d74b67a 100644 --- a/src/OPENMP/pair_tersoff_mod_c_omp.h +++ b/src/OPENMP/pair_tersoff_mod_c_omp.h @@ -29,8 +29,8 @@ class PairTersoffMODCOMP : public PairTersoffMODC, public ThrOMP { public: PairTersoffMODCOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_tersoff_mod_omp.h b/src/OPENMP/pair_tersoff_mod_omp.h index e7dd8b6178..fd90a1bb57 100644 --- a/src/OPENMP/pair_tersoff_mod_omp.h +++ b/src/OPENMP/pair_tersoff_mod_omp.h @@ -29,8 +29,8 @@ class PairTersoffMODOMP : public PairTersoffMOD, public ThrOMP { public: PairTersoffMODOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_tersoff_omp.h b/src/OPENMP/pair_tersoff_omp.h index e044615138..22d7ea7597 100644 --- a/src/OPENMP/pair_tersoff_omp.h +++ b/src/OPENMP/pair_tersoff_omp.h @@ -29,8 +29,8 @@ class PairTersoffOMP : public PairTersoff, public ThrOMP { public: PairTersoffOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_tersoff_table_omp.h b/src/OPENMP/pair_tersoff_table_omp.h index c686087f11..1426334ee0 100644 --- a/src/OPENMP/pair_tersoff_table_omp.h +++ b/src/OPENMP/pair_tersoff_table_omp.h @@ -28,17 +28,17 @@ class PairTersoffTableOMP : public PairTersoffTable, public ThrOMP { public: PairTersoffTableOMP(class LAMMPS *); - virtual ~PairTersoffTableOMP(); + ~PairTersoffTableOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: double ***thrGtetaFunction, ***thrGtetaFunctionDerived; double **thrCutoffFunction, **thrCutoffFunctionDerived; - void allocatePreLoops(); - void deallocatePreLoops(); + void allocatePreLoops() override; + void deallocatePreLoops() override; private: template void eval(int ifrom, int ito, ThrData *const thr); diff --git a/src/OPENMP/pair_tersoff_zbl_omp.h b/src/OPENMP/pair_tersoff_zbl_omp.h index 60426ea77c..cad15b2caa 100644 --- a/src/OPENMP/pair_tersoff_zbl_omp.h +++ b/src/OPENMP/pair_tersoff_zbl_omp.h @@ -26,16 +26,15 @@ namespace LAMMPS_NS { class PairTersoffZBLOMP : public PairTersoffOMP { public: PairTersoffZBLOMP(class LAMMPS *); - virtual ~PairTersoffZBLOMP() {} protected: double global_a_0; // Bohr radius for Coulomb repulsion double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion double global_e; // proton charge (negative of electron charge) - virtual void read_file(char *); - virtual void repulsive(Param *, double, double &, int, double &); - virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void read_file(char *) override; + void repulsive(Param *, double, double &, int, double &) override; + void force_zeta(Param *, double, double, double &, double &, int, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/OPENMP/pair_tip4p_cut_omp.h b/src/OPENMP/pair_tip4p_cut_omp.h index c9b1b367fe..56cde26914 100644 --- a/src/OPENMP/pair_tip4p_cut_omp.h +++ b/src/OPENMP/pair_tip4p_cut_omp.h @@ -33,10 +33,10 @@ class PairTIP4PCutOMP : public PairTIP4PCut, public ThrOMP { public: PairTIP4PCutOMP(class LAMMPS *); - virtual ~PairTIP4PCutOMP(); + ~PairTIP4PCutOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: dbl3_t *newsite_thr; diff --git a/src/OPENMP/pair_tip4p_long_omp.h b/src/OPENMP/pair_tip4p_long_omp.h index f19c2c6528..37eaae6c25 100644 --- a/src/OPENMP/pair_tip4p_long_omp.h +++ b/src/OPENMP/pair_tip4p_long_omp.h @@ -33,10 +33,10 @@ class PairTIP4PLongOMP : public PairTIP4PLong, public ThrOMP { public: PairTIP4PLongOMP(class LAMMPS *); - virtual ~PairTIP4PLongOMP(); + ~PairTIP4PLongOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: dbl3_t *newsite_thr; diff --git a/src/OPENMP/pair_tip4p_long_soft_omp.h b/src/OPENMP/pair_tip4p_long_soft_omp.h index 21b29310e5..be2840484f 100644 --- a/src/OPENMP/pair_tip4p_long_soft_omp.h +++ b/src/OPENMP/pair_tip4p_long_soft_omp.h @@ -33,10 +33,10 @@ class PairTIP4PLongSoftOMP : public PairTIP4PLongSoft, public ThrOMP { public: PairTIP4PLongSoftOMP(class LAMMPS *); - virtual ~PairTIP4PLongSoftOMP(); + ~PairTIP4PLongSoftOMP() override; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: dbl3_t *newsite_thr; diff --git a/src/OPENMP/pair_ufm_omp.h b/src/OPENMP/pair_ufm_omp.h index 2c25393bba..27f68613f2 100644 --- a/src/OPENMP/pair_ufm_omp.h +++ b/src/OPENMP/pair_ufm_omp.h @@ -36,8 +36,8 @@ class PairUFMOMP : public PairUFM, public ThrOMP { public: PairUFMOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_vashishta_omp.h b/src/OPENMP/pair_vashishta_omp.h index f5b9fd1fb2..a161bc7c8b 100644 --- a/src/OPENMP/pair_vashishta_omp.h +++ b/src/OPENMP/pair_vashishta_omp.h @@ -34,8 +34,8 @@ class PairVashishtaOMP : public PairVashishta, public ThrOMP { public: PairVashishtaOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template void eval(int ifrom, int ito, ThrData *const thr); diff --git a/src/OPENMP/pair_vashishta_table_omp.h b/src/OPENMP/pair_vashishta_table_omp.h index 5f2a147361..2bc731a04a 100644 --- a/src/OPENMP/pair_vashishta_table_omp.h +++ b/src/OPENMP/pair_vashishta_table_omp.h @@ -34,8 +34,8 @@ class PairVashishtaTableOMP : public PairVashishtaTable, public ThrOMP { public: PairVashishtaTableOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template void eval(int ifrom, int ito, ThrData *const thr); diff --git a/src/OPENMP/pair_yukawa_colloid_omp.h b/src/OPENMP/pair_yukawa_colloid_omp.h index a1b0a840b3..5dddc26eb9 100644 --- a/src/OPENMP/pair_yukawa_colloid_omp.h +++ b/src/OPENMP/pair_yukawa_colloid_omp.h @@ -34,8 +34,8 @@ class PairYukawaColloidOMP : public PairYukawaColloid, public ThrOMP { public: PairYukawaColloidOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_yukawa_omp.h b/src/OPENMP/pair_yukawa_omp.h index 3d956d74c2..c905359fa3 100644 --- a/src/OPENMP/pair_yukawa_omp.h +++ b/src/OPENMP/pair_yukawa_omp.h @@ -34,8 +34,8 @@ class PairYukawaOMP : public PairYukawa, public ThrOMP { public: PairYukawaOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPENMP/pair_zbl_omp.h b/src/OPENMP/pair_zbl_omp.h index 65965b759a..3b482a7f5d 100644 --- a/src/OPENMP/pair_zbl_omp.h +++ b/src/OPENMP/pair_zbl_omp.h @@ -34,8 +34,8 @@ class PairZBLOMP : public PairZBL, public ThrOMP { public: PairZBLOMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/src/OPT/pair_eam_alloy_opt.h b/src/OPT/pair_eam_alloy_opt.h index 7da08bfecb..b83ddc235b 100644 --- a/src/OPT/pair_eam_alloy_opt.h +++ b/src/OPT/pair_eam_alloy_opt.h @@ -28,7 +28,6 @@ namespace LAMMPS_NS { class PairEAMAlloyOpt : public PairEAMAlloy, public PairEAMOpt { public: PairEAMAlloyOpt(class LAMMPS *); - virtual ~PairEAMAlloyOpt() {} }; } // namespace LAMMPS_NS diff --git a/src/OPT/pair_eam_fs_opt.h b/src/OPT/pair_eam_fs_opt.h index 5349e25740..89cb54531c 100644 --- a/src/OPT/pair_eam_fs_opt.h +++ b/src/OPT/pair_eam_fs_opt.h @@ -28,7 +28,6 @@ namespace LAMMPS_NS { class PairEAMFSOpt : public PairEAMFS, public PairEAMOpt { public: PairEAMFSOpt(class LAMMPS *); - virtual ~PairEAMFSOpt() {} }; } // namespace LAMMPS_NS diff --git a/src/OPT/pair_eam_opt.h b/src/OPT/pair_eam_opt.h index 02af32b6a1..496439a3dc 100644 --- a/src/OPT/pair_eam_opt.h +++ b/src/OPT/pair_eam_opt.h @@ -29,8 +29,8 @@ namespace LAMMPS_NS { class PairEAMOpt : virtual public PairEAM { public: PairEAMOpt(class LAMMPS *); - virtual ~PairEAMOpt() {} - void compute(int, int); + + void compute(int, int) override; private: template void eval(); diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.h b/src/OPT/pair_lj_charmm_coul_long_opt.h index b1f3a69069..0a652cfb93 100644 --- a/src/OPT/pair_lj_charmm_coul_long_opt.h +++ b/src/OPT/pair_lj_charmm_coul_long_opt.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairLJCharmmCoulLongOpt : public PairLJCharmmCoulLong { public: PairLJCharmmCoulLongOpt(class LAMMPS *); - void compute(int, int); + void compute(int, int) override; private: template void eval(); diff --git a/src/OPT/pair_lj_cut_coul_long_opt.h b/src/OPT/pair_lj_cut_coul_long_opt.h index 9b6fb077aa..e86f0fac05 100644 --- a/src/OPT/pair_lj_cut_coul_long_opt.h +++ b/src/OPT/pair_lj_cut_coul_long_opt.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairLJCutCoulLongOpt : public PairLJCutCoulLong { public: PairLJCutCoulLongOpt(class LAMMPS *); - virtual void compute(int, int); + void compute(int, int) override; protected: template void eval(); diff --git a/src/OPT/pair_lj_cut_opt.h b/src/OPT/pair_lj_cut_opt.h index 895ee64392..fb34efd99a 100644 --- a/src/OPT/pair_lj_cut_opt.h +++ b/src/OPT/pair_lj_cut_opt.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PairLJCutOpt : public PairLJCut { public: PairLJCutOpt(class LAMMPS *); - void compute(int, int); + void compute(int, int) override; private: template void eval(); diff --git a/src/OPT/pair_lj_cut_tip4p_long_opt.h b/src/OPT/pair_lj_cut_tip4p_long_opt.h index dc82e077c0..a86fcd3298 100644 --- a/src/OPT/pair_lj_cut_tip4p_long_opt.h +++ b/src/OPT/pair_lj_cut_tip4p_long_opt.h @@ -27,10 +27,9 @@ namespace LAMMPS_NS { class PairLJCutTIP4PLongOpt : public PairLJCutTIP4PLong { public: PairLJCutTIP4PLongOpt(class LAMMPS *); - virtual ~PairLJCutTIP4PLongOpt(){}; - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; protected: template void eval(); diff --git a/src/OPT/pair_lj_long_coul_long_opt.h b/src/OPT/pair_lj_long_coul_long_opt.h index 47a10ef648..2ffcff23db 100644 --- a/src/OPT/pair_lj_long_coul_long_opt.h +++ b/src/OPT/pair_lj_long_coul_long_opt.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class PairLJLongCoulLongOpt : public PairLJLongCoulLong { public: PairLJLongCoulLongOpt(class LAMMPS *); - virtual void compute(int, int); - virtual void compute_outer(int, int); + void compute(int, int) override; + void compute_outer(int, int) override; protected: template void eval(); diff --git a/src/OPT/pair_ufm_opt.h b/src/OPT/pair_ufm_opt.h index c79cf0024e..06fd07dd02 100644 --- a/src/OPT/pair_ufm_opt.h +++ b/src/OPT/pair_ufm_opt.h @@ -33,7 +33,7 @@ namespace LAMMPS_NS { class PairUFMOpt : public PairUFM { public: PairUFMOpt(class LAMMPS *); - void compute(int, int); + void compute(int, int) override; private: template void eval(); diff --git a/src/PERI/pair_peri.h b/src/PERI/pair_peri.h index f3b41de4f5..14c93aa14a 100644 --- a/src/PERI/pair_peri.h +++ b/src/PERI/pair_peri.h @@ -22,13 +22,13 @@ namespace LAMMPS_NS { class PairPeri : public Pair { public: PairPeri(class LAMMPS *); - virtual ~PairPeri(); + ~PairPeri() override; - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; - virtual void init_style(); - virtual void settings(int, char **); + void init_style() override; + void settings(int, char **) override; static constexpr double NEAR_ZERO = 2.2204e-16; double influence_function(const double &xi_x, const double &xi_y, const double &xi_z) const @@ -38,8 +38,8 @@ class PairPeri : public Pair { } void compute_dilatation(int, int); - double memory_usage(); - virtual void *extract(const char *, int &); + double memory_usage() override; + void *extract(const char *, int &) override; protected: class FixPeriNeigh *fix_peri_neigh; diff --git a/src/PERI/pair_peri_eps.h b/src/PERI/pair_peri_eps.h index 5d9a437ac8..b135537d97 100644 --- a/src/PERI/pair_peri_eps.h +++ b/src/PERI/pair_peri_eps.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class PairPeriEPS : public PairPeri { public: PairPeriEPS(class LAMMPS *); - virtual ~PairPeriEPS() = default; - virtual void compute(int, int); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *) {} - void read_restart_settings(FILE *) {} + void compute(int, int) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override {} + void read_restart_settings(FILE *) override {} double compute_DeviatoricForceStateNorm(int); }; diff --git a/src/PERI/pair_peri_lps.h b/src/PERI/pair_peri_lps.h index 0d9132f612..13afdef06c 100644 --- a/src/PERI/pair_peri_lps.h +++ b/src/PERI/pair_peri_lps.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class PairPeriLPS : public PairPeri { public: PairPeriLPS(class LAMMPS *); - virtual ~PairPeriLPS() = default; - virtual void compute(int, int); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *) {} - void read_restart_settings(FILE *) {} + void compute(int, int) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override {} + void read_restart_settings(FILE *) override {} }; } // namespace LAMMPS_NS diff --git a/src/PERI/pair_peri_pmb.h b/src/PERI/pair_peri_pmb.h index 44a46093de..a028c43aa3 100644 --- a/src/PERI/pair_peri_pmb.h +++ b/src/PERI/pair_peri_pmb.h @@ -27,18 +27,17 @@ namespace LAMMPS_NS { class PairPeriPMB : public PairPeri { public: PairPeriPMB(class LAMMPS *); - virtual ~PairPeriPMB() = default; - virtual void compute(int, int); - void coeff(int, char **); - double init_one(int, int); + void compute(int, int) override; + void coeff(int, char **) override; + double init_one(int, int) override; - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *) {} - void read_restart_settings(FILE *) {} + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override {} + void read_restart_settings(FILE *) override {} - double single(int, int, int, int, double, double, double, double &); + double single(int, int, int, int, double, double, double, double &) override; }; } // namespace LAMMPS_NS diff --git a/src/PERI/pair_peri_ves.h b/src/PERI/pair_peri_ves.h index e80c5e3383..330ee7ef02 100644 --- a/src/PERI/pair_peri_ves.h +++ b/src/PERI/pair_peri_ves.h @@ -27,15 +27,14 @@ namespace LAMMPS_NS { class PairPeriVES : public PairPeri { public: PairPeriVES(class LAMMPS *); - virtual ~PairPeriVES() = default; - virtual void compute(int, int); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *) {} - void read_restart_settings(FILE *) {} + void compute(int, int) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override {} + void read_restart_settings(FILE *) override {} }; } // namespace LAMMPS_NS diff --git a/src/REAXFF/pair_reaxff.h b/src/REAXFF/pair_reaxff.h index 23b2ae894a..3b8d84c93a 100644 --- a/src/REAXFF/pair_reaxff.h +++ b/src/REAXFF/pair_reaxff.h @@ -44,13 +44,13 @@ namespace LAMMPS_NS { class PairReaxFF : public Pair { public: PairReaxFF(class LAMMPS *); - ~PairReaxFF(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); - void *extract(const char *, int &); + ~PairReaxFF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void *extract(const char *, int &) override; int fixbond_flag, fixspecies_flag; int **tmpid; double **tmpbo, **tmpr; @@ -69,7 +69,7 @@ class PairReaxFF : public Pair { int firstwarn; void allocate(); - void setup(); + void setup() override; void create_compute(); void create_fix(); void write_reax_atoms(); @@ -81,7 +81,7 @@ class PairReaxFF : public Pair { int nmax; void FindBond(); - double memory_usage(); + double memory_usage() override; }; } // namespace LAMMPS_NS diff --git a/src/REPLICA/hyper.h b/src/REPLICA/hyper.h index a6a7cc45da..8d20439c1c 100644 --- a/src/REPLICA/hyper.h +++ b/src/REPLICA/hyper.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class Hyper : public Command { public: Hyper(class LAMMPS *); - ~Hyper() override {} + void command(int, char **) override; private: diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h index 5166380b1c..81582ec3d4 100644 --- a/src/REPLICA/prd.h +++ b/src/REPLICA/prd.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PRD : public Command { public: PRD(class LAMMPS *); - ~PRD() override {} + void command(int, char **) override; private: diff --git a/src/SMTBQ/pair_smtbq.h b/src/SMTBQ/pair_smtbq.h index ec2de51fbc..636cff8266 100644 --- a/src/SMTBQ/pair_smtbq.h +++ b/src/SMTBQ/pair_smtbq.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class PairSMTBQ : public Pair { public: PairSMTBQ(class LAMMPS *); - virtual ~PairSMTBQ(); - virtual void compute(int, int); + ~PairSMTBQ() override; + void compute(int, int) override; - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - double memory_usage(); + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + double memory_usage() override; protected: struct Param { @@ -140,10 +140,10 @@ class PairSMTBQ : public Pair { // =========================================== // Communication pack - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; void forward(double *); void reverse(double *); void forward_int(int *); diff --git a/src/SPH/pair_sph_heatconduction.h b/src/SPH/pair_sph_heatconduction.h index bf8a96773f..de35075680 100644 --- a/src/SPH/pair_sph_heatconduction.h +++ b/src/SPH/pair_sph_heatconduction.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairSPHHeatConduction : public Pair { public: PairSPHHeatConduction(class LAMMPS *); - virtual ~PairSPHHeatConduction(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairSPHHeatConduction() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double **cut, **alpha; diff --git a/src/SPH/pair_sph_idealgas.h b/src/SPH/pair_sph_idealgas.h index ad185bcd25..a9c1e25b05 100644 --- a/src/SPH/pair_sph_idealgas.h +++ b/src/SPH/pair_sph_idealgas.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairSPHIdealGas : public Pair { public: PairSPHIdealGas(class LAMMPS *); - virtual ~PairSPHIdealGas(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairSPHIdealGas() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double **cut, **viscosity; diff --git a/src/SPH/pair_sph_lj.h b/src/SPH/pair_sph_lj.h index a934993805..7fe51ed39f 100644 --- a/src/SPH/pair_sph_lj.h +++ b/src/SPH/pair_sph_lj.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class PairSPHLJ : public Pair { public: PairSPHLJ(class LAMMPS *); - virtual ~PairSPHLJ(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairSPHLJ() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; //double LJEOS(int); void LJEOS2(double, double, double, double *, double *); diff --git a/src/SPH/pair_sph_rhosum.h b/src/SPH/pair_sph_rhosum.h index 9874e6e2eb..f2021360ca 100644 --- a/src/SPH/pair_sph_rhosum.h +++ b/src/SPH/pair_sph_rhosum.h @@ -27,15 +27,15 @@ namespace LAMMPS_NS { class PairSPHRhoSum : public Pair { public: PairSPHRhoSum(class LAMMPS *); - virtual ~PairSPHRhoSum(); - void init_style(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - virtual double single(int, int, int, int, double, double, double, double &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~PairSPHRhoSum() override; + void init_style() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; protected: double **cut; diff --git a/src/SPH/pair_sph_taitwater.h b/src/SPH/pair_sph_taitwater.h index d162106691..40cda898b7 100644 --- a/src/SPH/pair_sph_taitwater.h +++ b/src/SPH/pair_sph_taitwater.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairSPHTaitwater : public Pair { public: PairSPHTaitwater(class LAMMPS *); - virtual ~PairSPHTaitwater(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); + ~PairSPHTaitwater() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; protected: double *rho0, *soundspeed, *B; diff --git a/src/SPH/pair_sph_taitwater_morris.h b/src/SPH/pair_sph_taitwater_morris.h index 7c1d377319..1bd0153b5f 100644 --- a/src/SPH/pair_sph_taitwater_morris.h +++ b/src/SPH/pair_sph_taitwater_morris.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairSPHTaitwaterMorris : public Pair { public: PairSPHTaitwaterMorris(class LAMMPS *); - virtual ~PairSPHTaitwaterMorris(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); + ~PairSPHTaitwaterMorris() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; protected: double *rho0, *soundspeed, *B; diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index a9341bcb71..598d114ebd 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -23,14 +23,14 @@ class PairSpin : public Pair { public: PairSpin(class LAMMPS *); - virtual ~PairSpin() = default; - virtual void settings(int, char **); - virtual void coeff(int, char **) {} - virtual void init_style(); - virtual double init_one(int, int) { return 0.0; } - virtual void *extract(const char *, int &) { return nullptr; } - virtual void compute(int, int) {} + void settings(int, char **) override; + void coeff(int, char **) override {} + void init_style() override; + double init_one(int, int) override { return 0.0; } + void *extract(const char *, int &) override { return nullptr; } + + void compute(int, int) override {} virtual void compute_single_pair(int, double *) {} // storing magnetic energies diff --git a/src/SPIN/pair_spin_dipole_cut.h b/src/SPIN/pair_spin_dipole_cut.h index abda4bb206..2fe443e71e 100644 --- a/src/SPIN/pair_spin_dipole_cut.h +++ b/src/SPIN/pair_spin_dipole_cut.h @@ -30,22 +30,22 @@ class PairSpinDipoleCut : public PairSpin { double **sigma; PairSpinDipoleCut(LAMMPS *); - virtual ~PairSpinDipoleCut(); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinDipoleCut() override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_dipolar(int, int, double *, double *, double *, double *, double); void compute_dipolar_mech(int, int, double *, double *, double *, double *, double); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_long_global; // global long cutoff distance @@ -61,7 +61,7 @@ class PairSpinDipoleCut : public PairSpin { double g_ewald; int ewald_order; - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/SPIN/pair_spin_dipole_long.h b/src/SPIN/pair_spin_dipole_long.h index c70d23bdd5..7a0560f7d8 100644 --- a/src/SPIN/pair_spin_dipole_long.h +++ b/src/SPIN/pair_spin_dipole_long.h @@ -30,23 +30,23 @@ class PairSpinDipoleLong : public PairSpin { double **sigma; PairSpinDipoleLong(LAMMPS *); - virtual ~PairSpinDipoleLong(); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinDipoleLong() override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_long(int, int, double *, double *, double *, double *, double *); void compute_long_mech(int, int, double *, double *, double *, double *, double *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_long_global; // global long cutoff distance @@ -62,7 +62,7 @@ class PairSpinDipoleLong : public PairSpin { double g_ewald; int ewald_order; - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/SPIN/pair_spin_dmi.h b/src/SPIN/pair_spin_dmi.h index bdd02946af..9462afae58 100644 --- a/src/SPIN/pair_spin_dmi.h +++ b/src/SPIN/pair_spin_dmi.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairSpinDmi : public PairSpin { public: PairSpinDmi(LAMMPS *lmp) : PairSpin(lmp) {} - virtual ~PairSpinDmi(); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinDmi() override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_dmi(int, int, double *, double *, double *); void compute_dmi_mech(int, int, double, double *, double *, double *, double *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_dmi_global; // short range pair cutoff @@ -52,7 +52,7 @@ class PairSpinDmi : public PairSpin { double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction double **cut_spin_dmi; // cutoff distance dmi - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/SPIN/pair_spin_exchange.h b/src/SPIN/pair_spin_exchange.h index 0dd3d06fc5..485157d49e 100644 --- a/src/SPIN/pair_spin_exchange.h +++ b/src/SPIN/pair_spin_exchange.h @@ -27,23 +27,23 @@ namespace LAMMPS_NS { class PairSpinExchange : public PairSpin { public: PairSpinExchange(class LAMMPS *); - virtual ~PairSpinExchange(); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinExchange() override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_exchange(int, int, double, double *, double *); void compute_exchange_mech(int, int, double, double *, double *, double *, double *); double compute_energy(int, int, double, double *, double *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_exchange_global; // global exchange cutoff distance @@ -54,7 +54,7 @@ class PairSpinExchange : public PairSpin { double **J2, **J3; // J1 in eV, J2 adim, J3 in Ang double **cut_spin_exchange; // cutoff distance exchange - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/SPIN/pair_spin_exchange_biquadratic.h b/src/SPIN/pair_spin_exchange_biquadratic.h index ccfe874fff..0a0b7be5ba 100644 --- a/src/SPIN/pair_spin_exchange_biquadratic.h +++ b/src/SPIN/pair_spin_exchange_biquadratic.h @@ -27,23 +27,23 @@ namespace LAMMPS_NS { class PairSpinExchangeBiquadratic : public PairSpin { public: PairSpinExchangeBiquadratic(class LAMMPS *); - virtual ~PairSpinExchangeBiquadratic(); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinExchangeBiquadratic() override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_exchange(int, int, double, double *, double *, double *); void compute_exchange_mech(int, int, double, double *, double *, double *, double *); double compute_energy(int, int, double, double *, double *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_exchange_global; // global exchange cutoff distance @@ -57,7 +57,7 @@ class PairSpinExchangeBiquadratic : public PairSpin { double **K2, **K3; // K1 in eV, K2 Ang-1, K3 in Ang double **cut_spin_exchange; // cutoff distance exchange - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/SPIN/pair_spin_magelec.h b/src/SPIN/pair_spin_magelec.h index 08f60f5a02..ece4534d0b 100644 --- a/src/SPIN/pair_spin_magelec.h +++ b/src/SPIN/pair_spin_magelec.h @@ -27,22 +27,22 @@ namespace LAMMPS_NS { class PairSpinMagelec : public PairSpin { public: PairSpinMagelec(LAMMPS *lmp) : PairSpin(lmp) {} - virtual ~PairSpinMagelec(); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinMagelec() override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_magelec(int, int, double *, double *, double *); void compute_magelec_mech(int, int, double *, double *, double *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_magelec_global; // global me cutoff @@ -51,7 +51,7 @@ class PairSpinMagelec : public PairSpin { double **v_mex, **v_mey, **v_mez; // magelec direction double **cut_spin_magelec; // magelec cutoff distance - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/SPIN/pair_spin_neel.h b/src/SPIN/pair_spin_neel.h index 046171927e..192a6e5129 100644 --- a/src/SPIN/pair_spin_neel.h +++ b/src/SPIN/pair_spin_neel.h @@ -27,23 +27,23 @@ namespace LAMMPS_NS { class PairSpinNeel : public PairSpin { public: PairSpinNeel(LAMMPS *lmp) : PairSpin(lmp) {} - virtual ~PairSpinNeel(); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void *extract(const char *, int &); + ~PairSpinNeel() override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void *extract(const char *, int &) override; - void compute(int, int); - void compute_single_pair(int, double *); + void compute(int, int) override; + void compute_single_pair(int, double *) override; void compute_neel(int, int, double, double *, double *, double *, double *); void compute_neel_mech(int, int, double, double *, double *, double *, double *); double compute_neel_energy(int, int, double, double *, double *, double *); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; double cut_spin_neel_global; // global neel cutoff distance @@ -56,7 +56,7 @@ class PairSpinNeel : public PairSpin { double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang double **cut_spin_neel; // cutoff distance exchange - void allocate(); + void allocate() override; }; } // namespace LAMMPS_NS diff --git a/src/YAFF/pair_lj_switch3_coulgauss_long.h b/src/YAFF/pair_lj_switch3_coulgauss_long.h index 10fd765f34..3591f4eeb1 100644 --- a/src/YAFF/pair_lj_switch3_coulgauss_long.h +++ b/src/YAFF/pair_lj_switch3_coulgauss_long.h @@ -28,21 +28,21 @@ class PairLJSwitch3CoulGaussLong : public Pair { public: PairLJSwitch3CoulGaussLong(class LAMMPS *); - virtual ~PairLJSwitch3CoulGaussLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairLJSwitch3CoulGaussLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - virtual void *extract(const char *, int &); + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/YAFF/pair_mm3_switch3_coulgauss_long.h b/src/YAFF/pair_mm3_switch3_coulgauss_long.h index 9dec102bee..14d16b8ec8 100644 --- a/src/YAFF/pair_mm3_switch3_coulgauss_long.h +++ b/src/YAFF/pair_mm3_switch3_coulgauss_long.h @@ -28,21 +28,21 @@ class PairMM3Switch3CoulGaussLong : public Pair { public: PairMM3Switch3CoulGaussLong(class LAMMPS *); - virtual ~PairMM3Switch3CoulGaussLong(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairMM3Switch3CoulGaussLong() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - virtual void *extract(const char *, int &); + void *extract(const char *, int &) override; protected: double cut_lj_global; diff --git a/src/compute_erotate_sphere.h b/src/compute_erotate_sphere.h index 3fb47afbe8..29906b852f 100644 --- a/src/compute_erotate_sphere.h +++ b/src/compute_erotate_sphere.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class ComputeERotateSphere : public Compute { public: ComputeERotateSphere(class LAMMPS *, int, char **); - ~ComputeERotateSphere() override {} + void init() override; double compute_scalar() override; diff --git a/src/dump_deprecated.h b/src/dump_deprecated.h index 3e51f19dda..f8d0c58234 100644 --- a/src/dump_deprecated.h +++ b/src/dump_deprecated.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpDeprecated : public Dump { public: DumpDeprecated(class LAMMPS *, int, char **); - ~DumpDeprecated() override {} + void init_style() override {} void write_header(bigint) override {} void pack(tagint *) override {} diff --git a/src/file_writer.h b/src/file_writer.h index ff54371d2e..3b34fb1f17 100644 --- a/src/file_writer.h +++ b/src/file_writer.h @@ -39,8 +39,6 @@ class FileWriterException : public std::exception { public: FileWriterException(const std::string &msg) : message(msg) {} - ~FileWriterException() noexcept override {} - const char *what() const noexcept override { return message.c_str(); } }; diff --git a/src/pair_born.h b/src/pair_born.h index 32f633f069..491989ee5c 100644 --- a/src/pair_born.h +++ b/src/pair_born.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairBorn : public Pair { public: PairBorn(class LAMMPS *); - virtual ~PairBorn(); + ~PairBorn() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/pair_buck.h b/src/pair_buck.h index 2be7ebabe9..b972125b06 100644 --- a/src/pair_buck.h +++ b/src/pair_buck.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairBuck : public Pair { public: PairBuck(class LAMMPS *); - virtual ~PairBuck(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairBuck() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h index b8a5178528..5cb128ad25 100644 --- a/src/pair_buck_coul_cut.h +++ b/src/pair_buck_coul_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairBuckCoulCut : public Pair { public: PairBuckCoulCut(class LAMMPS *); - virtual ~PairBuckCoulCut(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairBuckCoulCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/pair_coul_cut.h b/src/pair_coul_cut.h index 2d1f902e0f..f902ea735f 100644 --- a/src/pair_coul_cut.h +++ b/src/pair_coul_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairCoulCut : public Pair { public: PairCoulCut(class LAMMPS *); - virtual ~PairCoulCut(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + ~PairCoulCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/pair_coul_debye.h b/src/pair_coul_debye.h index cd10786d9f..917edef304 100644 --- a/src/pair_coul_debye.h +++ b/src/pair_coul_debye.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairCoulDebye : public PairCoulCut { public: PairCoulDebye(class LAMMPS *); - virtual void compute(int, int); - void settings(int, char **); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + void compute(int, int) override; + void settings(int, char **) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double kappa; diff --git a/src/pair_coul_dsf.h b/src/pair_coul_dsf.h index afbc573220..1011bac5e4 100644 --- a/src/pair_coul_dsf.h +++ b/src/pair_coul_dsf.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairCoulDSF : public Pair { public: PairCoulDSF(class LAMMPS *); - ~PairCoulDSF(); - void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairCoulDSF() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_coul, cut_coulsq; diff --git a/src/pair_coul_wolf.h b/src/pair_coul_wolf.h index 1edb0deb31..508c74b21b 100644 --- a/src/pair_coul_wolf.h +++ b/src/pair_coul_wolf.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class PairCoulWolf : public Pair { public: PairCoulWolf(class LAMMPS *); - virtual ~PairCoulWolf(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairCoulWolf() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_coul, cut_coulsq, alf; diff --git a/src/pair_deprecated.h b/src/pair_deprecated.h index 36af2e0aa0..5468b01259 100644 --- a/src/pair_deprecated.h +++ b/src/pair_deprecated.h @@ -28,11 +28,10 @@ namespace LAMMPS_NS { class PairDeprecated : public Pair { public: PairDeprecated(class LAMMPS *lmp) : Pair(lmp) {} - virtual ~PairDeprecated() {} - virtual void compute(int, int) {} - virtual void settings(int, char **); - virtual void coeff(int, char **) {} + void compute(int, int) override {} + void settings(int, char **) override; + void coeff(int, char **) override {} }; } // namespace LAMMPS_NS diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h index ab696e279c..ee56783700 100644 --- a/src/pair_hybrid.h +++ b/src/pair_hybrid.h @@ -39,31 +39,31 @@ class PairHybrid : public Pair { public: PairHybrid(class LAMMPS *); - virtual ~PairHybrid(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - void setup(); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void modify_params(int narg, char **arg); - double memory_usage(); + ~PairHybrid() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void setup() override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void modify_params(int narg, char **arg) override; + double memory_usage() override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); - void *extract(const char *, int &); - void reset_dt(); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; + void *extract(const char *, int &) override; + void reset_dt() override; int check_ijtype(int, int, char *); - virtual void add_tally_callback(class Compute *); - virtual void del_tally_callback(class Compute *); - double atom2cut(int); - double radii2cut(double, double); + void add_tally_callback(class Compute *) override; + void del_tally_callback(class Compute *) override; + double atom2cut(int) override; + double radii2cut(double, double) override; protected: int nstyles; // # of sub-styles diff --git a/src/pair_hybrid_overlay.h b/src/pair_hybrid_overlay.h index a35261ede0..13b70fa042 100644 --- a/src/pair_hybrid_overlay.h +++ b/src/pair_hybrid_overlay.h @@ -27,11 +27,11 @@ namespace LAMMPS_NS { class PairHybridOverlay : public PairHybrid { public: PairHybridOverlay(class LAMMPS *); - virtual ~PairHybridOverlay() {} - void coeff(int, char **); - void init_svector(); - void copy_svector(int, int); + void coeff(int, char **) override; + + void init_svector() override; + void copy_svector(int, int) override; }; } // namespace LAMMPS_NS diff --git a/src/pair_hybrid_scaled.h b/src/pair_hybrid_scaled.h index 12db39ae84..9bb8901846 100644 --- a/src/pair_hybrid_scaled.h +++ b/src/pair_hybrid_scaled.h @@ -30,17 +30,17 @@ namespace LAMMPS_NS { class PairHybridScaled : public PairHybrid { public: PairHybridScaled(class LAMMPS *); - virtual ~PairHybridScaled(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); + ~PairHybridScaled() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; - void init_svector(); - void copy_svector(int, int); + void init_svector() override; + void copy_svector(int, int) override; protected: double **fsum, **tsum; diff --git a/src/pair_lj_cut.h b/src/pair_lj_cut.h index 15b1d92175..8ca9a14620 100644 --- a/src/pair_lj_cut.h +++ b/src/pair_lj_cut.h @@ -27,24 +27,24 @@ namespace LAMMPS_NS { class PairLJCut : public Pair { public: PairLJCut(class LAMMPS *); - virtual ~PairLJCut(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; - void compute_inner(); - void compute_middle(); - void compute_outer(int, int); + void compute_inner() override; + void compute_middle() override; + void compute_outer(int, int) override; protected: double cut_global; diff --git a/src/pair_lj_cut_coul_cut.h b/src/pair_lj_cut_coul_cut.h index e41d0ff20b..fd4cc22c28 100644 --- a/src/pair_lj_cut_coul_cut.h +++ b/src/pair_lj_cut_coul_cut.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJCutCoulCut : public Pair { public: PairLJCutCoulCut(class LAMMPS *); - virtual ~PairLJCutCoulCut(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + ~PairLJCutCoulCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_lj_global, cut_coul_global; diff --git a/src/pair_lj_expand.h b/src/pair_lj_expand.h index 0cf8323927..df31757ad0 100644 --- a/src/pair_lj_expand.h +++ b/src/pair_lj_expand.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairLJExpand : public Pair { public: PairLJExpand(class LAMMPS *); - virtual ~PairLJExpand(); + ~PairLJExpand() override; - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/pair_morse.h b/src/pair_morse.h index a85c47df8c..e1b9d4516c 100644 --- a/src/pair_morse.h +++ b/src/pair_morse.h @@ -27,20 +27,20 @@ namespace LAMMPS_NS { class PairMorse : public Pair { public: PairMorse(class LAMMPS *); - virtual ~PairMorse(); - virtual void compute(int, int); + ~PairMorse() override; + void compute(int, int) override; - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual double init_one(int, int); - virtual void write_restart(FILE *); - virtual void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); - virtual void write_data(FILE *); - virtual void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - virtual void *extract(const char *, int &); + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/pair_soft.h b/src/pair_soft.h index 1e024ec00c..c2e3044764 100644 --- a/src/pair_soft.h +++ b/src/pair_soft.h @@ -29,20 +29,20 @@ class PairSoft : public Pair { public: PairSoft(class LAMMPS *); - virtual ~PairSoft(); + ~PairSoft() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/src/pair_table.h b/src/pair_table.h index acfd75365e..87a2fbb055 100644 --- a/src/pair_table.h +++ b/src/pair_table.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairTable : public Pair { public: PairTable(class LAMMPS *); - virtual ~PairTable(); + ~PairTable() override; - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; enum { LOOKUP, LINEAR, SPLINE, BITMAP }; diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h index 975bb3c2ac..bb50b42aab 100644 --- a/src/pair_yukawa.h +++ b/src/pair_yukawa.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class PairYukawa : public Pair { public: PairYukawa(class LAMMPS *); - virtual ~PairYukawa(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - virtual double single(int, int, int, int, double, double, double, double &); + ~PairYukawa() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/pair_zbl.h b/src/pair_zbl.h index f9d6d92472..5927f8e751 100644 --- a/src/pair_zbl.h +++ b/src/pair_zbl.h @@ -27,19 +27,19 @@ namespace LAMMPS_NS { class PairZBL : public Pair { public: PairZBL(class LAMMPS *); - virtual ~PairZBL(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairZBL() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global, cut_inner; diff --git a/src/pair_zero.h b/src/pair_zero.h index 3d59fcbd1a..e94d301f4e 100644 --- a/src/pair_zero.h +++ b/src/pair_zero.h @@ -37,19 +37,19 @@ namespace LAMMPS_NS { class PairZero : public Pair { public: PairZero(class LAMMPS *); - virtual ~PairZero(); - virtual void compute(int, int); - virtual void compute_outer(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairZero() override; + void compute(int, int) override; + void compute_outer(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/reader.h b/src/reader.h index 6429cd40de..adc93c6d7c 100644 --- a/src/reader.h +++ b/src/reader.h @@ -23,7 +23,6 @@ namespace LAMMPS_NS { class Reader : protected Pointers { public: Reader(class LAMMPS *); - ~Reader() override {} virtual void settings(int, char **); diff --git a/src/region_deprecated.h b/src/region_deprecated.h index c8951eee45..6092328ad7 100644 --- a/src/region_deprecated.h +++ b/src/region_deprecated.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class RegionDeprecated : public Region { public: RegionDeprecated(class LAMMPS *, int, char **); - ~RegionDeprecated() override {} + void init() override {} int inside(double, double, double) override { return 0; } int surface_interior(double *, double) override { return 0; } diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 77c5abada5..e5a743580f 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -52,8 +52,6 @@ class FileReaderException : public std::exception { public: FileReaderException(const std::string &msg) : message(msg) {} - ~FileReaderException() noexcept override {} - const char *what() const noexcept override { return message.c_str(); } }; diff --git a/src/tokenizer.h b/src/tokenizer.h index 0b6d773aad..03afa59836 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -62,8 +62,6 @@ class TokenizerException : public std::exception { * \param token String of the token/word that caused the error */ explicit TokenizerException(const std::string &msg, const std::string &token); - ~TokenizerException() noexcept override {} - /** Retrieve message describing the thrown exception * \return string with error message */ const char *what() const noexcept override { return message.c_str(); } From 44bc76606095280c88d74e3cc8a94351220ab7f0 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 21 Jan 2022 16:58:32 -0500 Subject: [PATCH 079/174] Apply override to more classes --- src/ADIOS/dump_atom_adios.h | 8 ++-- src/ADIOS/dump_custom_adios.h | 8 ++-- src/ADIOS/reader_adios.h | 18 ++++---- src/ATC/fix_atc.h | 74 ++++++++++++++++---------------- src/H5MD/dump_h5md.h | 14 +++--- src/KOKKOS/fix_langevin_kokkos.h | 18 ++++---- src/PYTHON/fix_python_invoke.h | 8 ++-- src/PYTHON/fix_python_move.h | 16 +++---- src/PYTHON/pair_python.h | 12 +++--- src/PYTHON/python_impl.h | 18 ++++---- src/exceptions.h | 4 +- src/lmppython.h | 2 +- src/procmap.h | 2 +- 13 files changed, 100 insertions(+), 102 deletions(-) diff --git a/src/ADIOS/dump_atom_adios.h b/src/ADIOS/dump_atom_adios.h index 783abaf915..850c4dbf8e 100644 --- a/src/ADIOS/dump_atom_adios.h +++ b/src/ADIOS/dump_atom_adios.h @@ -30,12 +30,12 @@ class DumpAtomADIOS : public DumpAtom { public: DumpAtomADIOS(class LAMMPS *, int, char **); - virtual ~DumpAtomADIOS(); + ~DumpAtomADIOS() override; protected: - virtual void openfile(); - virtual void write(); - virtual void init_style(); + void openfile() override; + void write() override; + void init_style() override; private: DumpAtomADIOSInternal *internal; diff --git a/src/ADIOS/dump_custom_adios.h b/src/ADIOS/dump_custom_adios.h index ae327f0db5..fde46a0754 100644 --- a/src/ADIOS/dump_custom_adios.h +++ b/src/ADIOS/dump_custom_adios.h @@ -29,12 +29,12 @@ class DumpCustomADIOSInternal; class DumpCustomADIOS : public DumpCustom { public: DumpCustomADIOS(class LAMMPS *, int, char **); - virtual ~DumpCustomADIOS(); + ~DumpCustomADIOS() override; protected: - virtual void openfile(); - virtual void write(); - virtual void init_style(); + void openfile() override; + void write() override; + void init_style() override; private: DumpCustomADIOSInternal *internal; diff --git a/src/ADIOS/reader_adios.h b/src/ADIOS/reader_adios.h index 1d8f2a3773..e59c677489 100644 --- a/src/ADIOS/reader_adios.h +++ b/src/ADIOS/reader_adios.h @@ -34,18 +34,18 @@ class ReadADIOSInternal; class ReaderADIOS : public Reader { public: ReaderADIOS(class LAMMPS *); - virtual ~ReaderADIOS(); + ~ReaderADIOS() override; - virtual void settings(int, char **); + void settings(int, char **) override; - virtual int read_time(bigint &); - virtual void skip(); - virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, - int &, int &, int &); - virtual void read_atoms(int, int, double **); + int read_time(bigint &) override; + void skip() override; + bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &) override; + void read_atoms(int, int, double **) override; - virtual void open_file(const char *); - virtual void close_file(); + void open_file(const char *) override; + void close_file() override; private: int *fieldindex; // mapping of input fields to dump diff --git a/src/ATC/fix_atc.h b/src/ATC/fix_atc.h index 1b34604aa2..cf8c555cac 100644 --- a/src/ATC/fix_atc.h +++ b/src/ATC/fix_atc.h @@ -37,91 +37,91 @@ class FixATC : public Fix { public: /** constructor & destructor */ FixATC(class LAMMPS *, int, char **); - ~FixATC(); + ~FixATC() override; /** initialization functions */ - void init(); - void init_list(int id, NeighList *ptr); - void setup(int vflag); - void min_setup(int vflag); + void init() override; + void init_list(int id, NeighList *ptr) override; + void setup(int vflag) override; + void min_setup(int vflag) override; /** setmask: tell LAMMPS which fix methods to call */ - int setmask(); + int setmask() override; /** initial_integrate */ - void initial_integrate(int vflag); + void initial_integrate(int vflag) override; /** after first integrate phase */ - void post_integrate(); + void post_integrate() override; /** final_integrate */ - void final_integrate(); + void final_integrate() override; /** end of step for run or minimize */ - void end_of_step(); + void end_of_step() override; /** pre_exchange is used to modify fix-specific data and is called before domain->pbc() and comm->exchange(). */ - void setup_pre_exchange(); - void pre_exchange(); - void min_pre_exchange(); + void setup_pre_exchange() override; + void pre_exchange() override; + void min_pre_exchange() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; /** pack_exchange called from atom_vec->pack_exchange() and packs fix-specific data for a given real (local) atom being sent to another processor. */ - int pack_exchange(int, double *); + int pack_exchange(int, double *) override; /** unpack_exchange called from atom_vec->unpack_exchange() and unpacks fix-specific data for a given real (local) atom received from another processor. */ - int unpack_exchange(int, double *); + int unpack_exchange(int, double *) override; /** pack_comm called from comm->forward_comm_fix and packs fix-specific data for a given ghost atom from exchange with another proc */ - int pack_forward_comm(int, int *, double *, int, int *); + int pack_forward_comm(int, int *, double *, int, int *) override; /** unpack_comm called from comm->forward_comm_fix and unpacks fix-specific data for a given ghost atom from exchange with another proc */ - void unpack_forward_comm(int, int, double *); + void unpack_forward_comm(int, int, double *) override; /** pre_neighbor is used to modify fix-specific data and is called before neighbor list is built in neighbor->build(). */ - void pre_neighbor(); - void setup_pre_neighbor(); + void pre_neighbor() override; + void setup_pre_neighbor() override; /** pre/post_force is used to modify fix-specific data and is before/after the various force computations. */ - void pre_force(int vflag); - void post_force(int vflag); + void pre_force(int vflag) override; + void post_force(int vflag) override; /** post_run is called after a run completes */ - void post_run(); + void post_run() override; /** min_pre_force is called before forces are calculated in minimize */ - void min_pre_force(int vflag); + void min_pre_force(int vflag) override; /** min_post_force is called after forces are calculated in minimize */ - void min_post_force(int vflag); + void min_post_force(int vflag) override; /** modify atc parameters (parser) */ - int modify_param(int narg, char **arg); + int modify_param(int narg, char **arg) override; /** calls ATC_Method to handle restarting/checkpointing */ /** these four methods are for writing per-atom quantities */ - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + int pack_restart(int, double *) override; + void unpack_restart(int, int) override; + int size_restart(int) override; + int maxsize_restart() override; /** these two methods are for writing all other quantities */ - void write_restart(FILE *); - void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; /** accessor function for ATC_Method class pointer */ const ATC::ATC_Method *atc() { return atc_; } @@ -130,9 +130,9 @@ class FixATC : public Fix { LAMMPS *lammps_; /** functions for "thermo" output */ - virtual double compute_scalar(); - virtual double compute_vector(int n); - virtual double compute_array(int irow, int icol); + double compute_scalar() override; + double compute_vector(int n) override; + double compute_array(int irow, int icol) override; double dtv, dtf; ATC::ATC_Method *atc_; }; diff --git a/src/H5MD/dump_h5md.h b/src/H5MD/dump_h5md.h index 5e3f3f8279..7caf7f9583 100644 --- a/src/H5MD/dump_h5md.h +++ b/src/H5MD/dump_h5md.h @@ -29,7 +29,7 @@ namespace LAMMPS_NS { class DumpH5MD : public Dump { public: DumpH5MD(class LAMMPS *, int, char **); - virtual ~DumpH5MD(); + ~DumpH5MD() override; private: int natoms, ntotal; @@ -57,12 +57,12 @@ class DumpH5MD : public Dump { int *dump_charge; int every_charge; - void init_style(); - int modify_param(int, char **); - void openfile(); - void write_header(bigint); - void pack(tagint *); - void write_data(int, double *); + void init_style() override; + int modify_param(int, char **) override; + void openfile() override; + void write_header(bigint) override; + void pack(tagint *) override; + void write_data(int, double *) override; void write_frame(); void write_fixed_frame(); diff --git a/src/KOKKOS/fix_langevin_kokkos.h b/src/KOKKOS/fix_langevin_kokkos.h index ffd5a17da5..3bb076b561 100644 --- a/src/KOKKOS/fix_langevin_kokkos.h +++ b/src/KOKKOS/fix_langevin_kokkos.h @@ -72,17 +72,17 @@ namespace LAMMPS_NS { class FixLangevinKokkos : public FixLangevin { public: FixLangevinKokkos(class LAMMPS *, int, char **); - ~FixLangevinKokkos(); + ~FixLangevinKokkos() override; void cleanup_copy(); - void init(); - void initial_integrate(int); - void post_force(int); - void reset_dt(); - void grow_arrays(int); - void copy_arrays(int i, int j, int delflag); - double compute_scalar(); - void end_of_step(); + void init() override; + void initial_integrate(int) override; + void post_force(int) override; + void reset_dt() override; + void grow_arrays(int) override; + void copy_arrays(int i, int j, int delflag) override; + double compute_scalar() override; + void end_of_step() override; KOKKOS_INLINE_FUNCTION void initial_integrate_item(int) const; diff --git a/src/PYTHON/fix_python_invoke.h b/src/PYTHON/fix_python_invoke.h index a60b6e5f69..3396fe05d8 100644 --- a/src/PYTHON/fix_python_invoke.h +++ b/src/PYTHON/fix_python_invoke.h @@ -28,10 +28,10 @@ namespace LAMMPS_NS { class FixPythonInvoke : public Fix { public: FixPythonInvoke(class LAMMPS *, int, char **); - virtual ~FixPythonInvoke(); - int setmask(); - virtual void end_of_step(); - virtual void post_force(int); + ~FixPythonInvoke() override; + int setmask() override; + void end_of_step() override; + void post_force(int) override; private: void *lmpPtr; diff --git a/src/PYTHON/fix_python_move.h b/src/PYTHON/fix_python_move.h index fa2a275579..d861e98801 100644 --- a/src/PYTHON/fix_python_move.h +++ b/src/PYTHON/fix_python_move.h @@ -37,15 +37,15 @@ namespace LAMMPS_NS { class FixPythonMove : public Fix { public: FixPythonMove(LAMMPS *lmp, int narg, char **arg); - virtual ~FixPythonMove(); + ~FixPythonMove() override; - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - virtual void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; protected: void *py_move; diff --git a/src/PYTHON/pair_python.h b/src/PYTHON/pair_python.h index bb202b8cc5..d2366620c8 100644 --- a/src/PYTHON/pair_python.h +++ b/src/PYTHON/pair_python.h @@ -37,12 +37,12 @@ namespace LAMMPS_NS { class PairPython : public Pair { public: PairPython(class LAMMPS *); - virtual ~PairPython(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - double single(int, int, int, int, double, double, double, double &); + ~PairPython() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; diff --git a/src/PYTHON/python_impl.h b/src/PYTHON/python_impl.h index fe14862186..90726023c0 100644 --- a/src/PYTHON/python_impl.h +++ b/src/PYTHON/python_impl.h @@ -23,15 +23,15 @@ class PythonImpl : protected Pointers, public PythonInterface { public: PythonImpl(class LAMMPS *); - ~PythonImpl(); - void command(int, char **); - void invoke_function(int, char *); - int find(const char *); - int variable_match(const char *, const char *, int); - char *long_string(int); - int execute_string(char *); - int execute_file(char *); - bool has_minimum_version(int major, int minor); + ~PythonImpl() override; + void command(int, char **) override; + void invoke_function(int, char *) override; + int find(const char *) override; + int variable_match(const char *, const char *, int) override; + char *long_string(int) override; + int execute_string(char *) override; + int execute_file(char *) override; + bool has_minimum_version(int major, int minor) override; static void finalize(); private: diff --git a/src/exceptions.h b/src/exceptions.h index 1c9d8c8daf..f10f4ecf89 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -26,9 +26,7 @@ class LAMMPSException : public std::exception { LAMMPSException(const std::string &msg) : message(msg) {} - ~LAMMPSException() noexcept {} - - virtual const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; class LAMMPSAbortException : public LAMMPSException { diff --git a/src/lmppython.h b/src/lmppython.h index 3f0ebecae5..e923b38808 100644 --- a/src/lmppython.h +++ b/src/lmppython.h @@ -34,7 +34,7 @@ class PythonInterface { class Python : protected Pointers { public: Python(class LAMMPS *); - ~Python(); + ~Python() override; void command(int, char **); void invoke_function(int, char *); diff --git a/src/procmap.h b/src/procmap.h index 8cbf805f5a..f1ad4afc24 100644 --- a/src/procmap.h +++ b/src/procmap.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class ProcMap : protected Pointers { public: ProcMap(class LAMMPS *); - ~ProcMap() {} + void onelevel_grid(int, int *, int *, int, int, int *, int *); void twolevel_grid(int, int *, int *, int, int *, int *, int, int, int *, int *); void numa_grid(int, int *, int *, int *); From 12d708b97c3455fdb0af6c0d55cd264f7750a18f Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 21 Jan 2022 18:24:06 -0500 Subject: [PATCH 080/174] Apply override to more classes --- src/AWPMD/fix_nve_awpmd.h | 14 +++++----- src/AWPMD/pair_awpmd_cut.h | 28 +++++++++---------- src/COLVARS/colvarproxy_lammps.h | 48 ++++++++++++++++---------------- src/COLVARS/fix_colvars.h | 30 ++++++++++---------- src/KIM/fix_store_kim.h | 4 +-- src/KIM/pair_kim.h | 20 ++++++------- src/PLUMED/fix_plumed.h | 24 ++++++++-------- src/POEMS/fix_poems.h | 40 +++++++++++++------------- src/SCAFACOS/scafacos.h | 14 +++++----- src/VTK/dump_vtk.h | 18 ++++++------ 10 files changed, 120 insertions(+), 120 deletions(-) diff --git a/src/AWPMD/fix_nve_awpmd.h b/src/AWPMD/fix_nve_awpmd.h index 700483ef6e..182470a702 100644 --- a/src/AWPMD/fix_nve_awpmd.h +++ b/src/AWPMD/fix_nve_awpmd.h @@ -31,13 +31,13 @@ namespace LAMMPS_NS { class FixNVEAwpmd : public Fix { public: FixNVEAwpmd(class LAMMPS *, int, char **); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - void initial_integrate_respa(int, int, int); - void final_integrate_respa(int, int); - void reset_dt(); + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; protected: double dtv, dtf; diff --git a/src/AWPMD/pair_awpmd_cut.h b/src/AWPMD/pair_awpmd_cut.h index 9fb906bfd0..203552dcab 100644 --- a/src/AWPMD/pair_awpmd_cut.h +++ b/src/AWPMD/pair_awpmd_cut.h @@ -34,22 +34,22 @@ class PairAWPMDCut : public Pair { public: PairAWPMDCut(class LAMMPS *); - virtual ~PairAWPMDCut(); - virtual void compute(int, int); - virtual void settings(int, char **); - void coeff(int, char **); - void init_style(); + ~PairAWPMDCut() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; void min_pointers(double **, double **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - virtual void write_restart_settings(FILE *); - virtual void read_restart_settings(FILE *); + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; - void min_xf_pointers(int, double **, double **); - void min_xf_get(int); - void min_x_set(int); - double memory_usage(); + void min_xf_pointers(int, double **, double **) override; + void min_xf_get(int) override; + void min_x_set(int) override; + double memory_usage() override; private: int flexible_pressure_flag; diff --git a/src/COLVARS/colvarproxy_lammps.h b/src/COLVARS/colvarproxy_lammps.h index e10838cc15..5dbbe8fcfe 100644 --- a/src/COLVARS/colvarproxy_lammps.h +++ b/src/COLVARS/colvarproxy_lammps.h @@ -49,9 +49,9 @@ class colvarproxy_lammps : public colvarproxy { friend class cvm::atom; colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, const char *, const char *, const int, const double, MPI_Comm); - virtual ~colvarproxy_lammps(); + ~colvarproxy_lammps() override; void init(const char *); - virtual int setup(); + int setup() override; // disable default and copy constructor private: @@ -61,8 +61,8 @@ class colvarproxy_lammps : public colvarproxy { // methods for lammps to move data or trigger actions in the proxy public: void set_temperature(double t) { t_target = t; }; - bool total_forces_enabled() const { return total_force_requested; }; - bool total_forces_same_step() const { return true; }; + bool total_forces_enabled() const override { return total_force_requested; }; + bool total_forces_same_step() const override { return true; }; bool want_exit() const { return do_exit; }; // perform colvars computation. returns biasing energy @@ -84,41 +84,41 @@ class colvarproxy_lammps : public colvarproxy { int read_state_file(char const *state_filename); // Request to set the units used internally by Colvars - int set_unit_system(std::string const &units_in, bool check_only); + int set_unit_system(std::string const &units_in, bool check_only) override; - inline cvm::real backend_angstrom_value() { return my_angstrom; }; + inline cvm::real backend_angstrom_value() override { return my_angstrom; }; - inline cvm::real boltzmann() { return my_boltzmann; }; - inline cvm::real temperature() { return t_target; }; - inline cvm::real dt() + inline cvm::real boltzmann() override { return my_boltzmann; }; + inline cvm::real temperature() override { return t_target; }; + inline cvm::real dt() override { return my_timestep; }; // return _lmp->update->dt * _lmp->force->femtosecond; }; - void add_energy(cvm::real energy) { bias_energy += energy; }; - void request_total_force(bool yesno) { total_force_requested = yesno; }; + void add_energy(cvm::real energy) override { bias_energy += energy; }; + void request_total_force(bool yesno) override { total_force_requested = yesno; }; - void log(std::string const &message); - void error(std::string const &message); + void log(std::string const &message) override; + void error(std::string const &message) override; - cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const; + cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const override; - int backup_file(char const *filename); + int backup_file(char const *filename) override; - cvm::real rand_gaussian(void) { return _random->gaussian(); }; + cvm::real rand_gaussian(void) override { return _random->gaussian(); }; - int init_atom(int atom_number); - int check_atom_id(int atom_number); + int init_atom(int atom_number) override; + int check_atom_id(int atom_number) override; inline std::vector *modify_atom_types() { return &atoms_types; } - virtual int replica_enabled(); - virtual int replica_index(); - virtual int num_replicas(); + int replica_enabled() override; + int replica_index() override; + int num_replicas() override; - virtual void replica_comm_barrier(); - virtual int replica_comm_recv(char *msg_data, int buf_len, int src_rep); - virtual int replica_comm_send(char *msg_data, int msg_len, int dest_rep); + void replica_comm_barrier() override; + int replica_comm_recv(char *msg_data, int buf_len, int src_rep) override; + int replica_comm_send(char *msg_data, int msg_len, int dest_rep) override; }; #endif diff --git a/src/COLVARS/fix_colvars.h b/src/COLVARS/fix_colvars.h index d382dcf1f7..eba9b0167f 100644 --- a/src/COLVARS/fix_colvars.h +++ b/src/COLVARS/fix_colvars.h @@ -43,23 +43,23 @@ class FixColvars : public Fix { public: FixColvars(class LAMMPS *, int, char **); - virtual ~FixColvars(); + ~FixColvars() override; - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual int modify_param(int, char **); - virtual void min_setup(int vflag) { setup(vflag); }; - virtual void min_post_force(int); - virtual void post_force(int); - virtual void post_force_respa(int, int, int); - virtual void end_of_step(); - virtual void post_run(); - virtual double compute_scalar(); - virtual double memory_usage(); + int setmask() override; + void init() override; + void setup(int) override; + int modify_param(int, char **) override; + void min_setup(int vflag) override { setup(vflag); }; + void min_post_force(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void end_of_step() override; + void post_run() override; + double compute_scalar() override; + double memory_usage() override; - virtual void write_restart(FILE *); - virtual void restart(char *); + void write_restart(FILE *) override; + void restart(char *) override; protected: colvarproxy_lammps *proxy; // pointer to the colvars proxy class diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 266f280003..d1817ceda1 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -71,8 +71,8 @@ namespace LAMMPS_NS { class FixStoreKIM : public Fix { public: FixStoreKIM(class LAMMPS *, int, char **); - ~FixStoreKIM(); - int setmask(); + ~FixStoreKIM() override; + int setmask() override; void setptr(const std::string &, void *); void *getptr(const std::string &); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index dab9dfdb4c..8c7bcbb0ef 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -75,18 +75,18 @@ namespace LAMMPS_NS { class PairKIM : public Pair { public: PairKIM(class LAMMPS *); - ~PairKIM(); + ~PairKIM() override; // LAMMPS Pair class virtual function prototypes - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual void init_list(int id, NeighList *ptr); - virtual double init_one(int, int); - virtual int pack_reverse_comm(int, int, double *); - virtual void unpack_reverse_comm(int, int *, double *); - virtual double memory_usage(); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + void init_list(int id, NeighList *ptr) override; + double init_one(int, int) override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; // Get the KIM_Model object KIM_Model *get_kim_model(); diff --git a/src/PLUMED/fix_plumed.h b/src/PLUMED/fix_plumed.h index 0d9e226d38..f4dce376b8 100644 --- a/src/PLUMED/fix_plumed.h +++ b/src/PLUMED/fix_plumed.h @@ -32,18 +32,18 @@ namespace LAMMPS_NS { class FixPlumed : public Fix { public: FixPlumed(class LAMMPS *, int, char **); - ~FixPlumed(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - void reset_dt(); - int modify_param(int narg, char **arg); - double memory_usage(); + ~FixPlumed() override; + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double compute_scalar() override; + void reset_dt() override; + int modify_param(int narg, char **arg) override; + double memory_usage() override; private: PLMD::Plumed *p; // pointer to plumed object diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h index 537dbdd1b1..0b610189bd 100644 --- a/src/POEMS/fix_poems.h +++ b/src/POEMS/fix_poems.h @@ -29,28 +29,28 @@ namespace LAMMPS_NS { class FixPOEMS : public Fix { public: FixPOEMS(class LAMMPS *, int narg, char **arg); - ~FixPOEMS(); - int setmask(); - void init(); - void setup(int); - void initial_integrate(int); - void post_force(int); - void final_integrate(); - void initial_integrate_respa(int, int, int); - void post_force_respa(int, int, int); - void final_integrate_respa(int, int); + ~FixPOEMS() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void post_force(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void post_force_respa(int, int, int) override; + void final_integrate_respa(int, int) override; - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - double memory_usage(); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; + double memory_usage() override; - void pre_neighbor(); - int dof(int); - void deform(int); - int modify_param(int, char **); - void reset_dt(); + void pre_neighbor() override; + int dof(int) override; + void deform(int) override; + int modify_param(int, char **) override; + void reset_dt() override; private: int me; diff --git a/src/SCAFACOS/scafacos.h b/src/SCAFACOS/scafacos.h index b42c4df437..0ea0008c19 100644 --- a/src/SCAFACOS/scafacos.h +++ b/src/SCAFACOS/scafacos.h @@ -28,13 +28,13 @@ namespace LAMMPS_NS { class Scafacos : public KSpace { public: Scafacos(class LAMMPS *); - ~Scafacos(); - void init(); - void setup() {} - void settings(int, char **); - void compute(int, int); - int modify_param(int, char **); - double memory_usage(); + ~Scafacos() override; + void init() override; + void setup() override {} + void settings(int, char **) override; + void compute(int, int) override; + int modify_param(int, char **) override; + double memory_usage() override; private: int me; diff --git a/src/VTK/dump_vtk.h b/src/VTK/dump_vtk.h index 9f01469442..92886dc2ec 100644 --- a/src/VTK/dump_vtk.h +++ b/src/VTK/dump_vtk.h @@ -57,9 +57,9 @@ namespace LAMMPS_NS { class DumpVTK : public DumpCustom { public: DumpVTK(class LAMMPS *, int, char **); - virtual ~DumpVTK(); + ~DumpVTK() override; - virtual void write(); + void write() override; protected: char *label; // string for dump file header @@ -72,12 +72,12 @@ class DumpVTK : public DumpCustom { // private methods - virtual void init_style(); - virtual void write_header(bigint); - int count(); - void pack(tagint *); - virtual void write_data(int, double *); - double memory_usage(); + void init_style() override; + void write_header(bigint) override; + int count() override; + void pack(tagint *) override; + void write_data(int, double *) override; + double memory_usage() override; int parse_fields(int, char **); void identify_vectors(); @@ -85,7 +85,7 @@ class DumpVTK : public DumpCustom { int add_fix(const char *); int add_variable(const char *); int add_custom(const char *, int); - virtual int modify_param(int, char **); + int modify_param(int, char **) override; typedef void (DumpVTK::*FnPtrHeader)(bigint); FnPtrHeader header_choice; // ptr to write header functions From 384b715d8c609fb2873fcd33b973c18eafec2995 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 21 Jan 2022 18:53:06 -0700 Subject: [PATCH 081/174] First pass at fix numdiff/stress --- examples/numdiff/in.numdiff | 25 +- src/EXTRA-FIX/fix_numdiff_stress.cpp | 333 +++++++++++++++++++++++++++ src/EXTRA-FIX/fix_numdiff_stress.h | 84 +++++++ 3 files changed, 432 insertions(+), 10 deletions(-) create mode 100644 src/EXTRA-FIX/fix_numdiff_stress.cpp create mode 100644 src/EXTRA-FIX/fix_numdiff_stress.h diff --git a/examples/numdiff/in.numdiff b/examples/numdiff/in.numdiff index 6c4f99a3be..3f76712ac8 100644 --- a/examples/numdiff/in.numdiff +++ b/examples/numdiff/in.numdiff @@ -5,7 +5,7 @@ atom_style atomic atom_modify map yes lattice fcc 5.358000 -region box block 0 6 0 6 0 6 +region box block 0 3 0 3 0 3 create_box 1 box create_atoms 1 box mass 1 39.903 @@ -15,19 +15,24 @@ velocity all create 10 2357 mom yes dist gaussian pair_style lj/cubic pair_coeff * * 0.0102701 3.42 -neighbor 1 bin +neighbor 1.0 bin timestep 0.001 -fix numdiff all numdiff 200 0.0001 +fix numforce all numdiff 100 0.0001 +fix numstress all numdiff/stress 100 0.0001 fix nve all nve -variable errx atom fx-f_numdiff[1] -variable erry atom fy-f_numdiff[2] -variable errz atom fz-f_numdiff[3] +variable errx atom fx-f_numforce[1] +variable erry atom fy-f_numforce[2] +variable errz atom fz-f_numforce[3] -write_dump all custom tmp.error f_numdiff[1] f_numdiff[2] f_numdiff[3] +dump errors all custom 100 force_error.dump v_errx v_erry v_errz -dump forces all custom 200 force_error.dump v_errx v_erry v_errz -thermo 200 -run 2000 +variable ferrsq atom (fx-f_numforce[1])^2+(fy-f_numforce[2])^2+(fz-f_numforce[3])^2 +compute faverrsq all reduce ave v_ferrsq +fix avfaverrsq all ave/time 100 1 100 c_faverrsq ave running + +thermo_style custom step temp pe press c_faverrsq f_avfaverrsq pxx f_numstress[1] +thermo 100 +run 500 diff --git a/src/EXTRA-FIX/fix_numdiff_stress.cpp b/src/EXTRA-FIX/fix_numdiff_stress.cpp new file mode 100644 index 0000000000..765a0d5421 --- /dev/null +++ b/src/EXTRA-FIX/fix_numdiff_stress.cpp @@ -0,0 +1,333 @@ +// clang-format off +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Aidan Thompson (Sandia) +------------------------------------------------------------------------- */ + +#include "fix_numdiff_stress.h" + +#include +#include "atom.h" +#include "domain.h" +#include "update.h" +#include "modify.h" +#include "compute.h" +#include "respa.h" +#include "force.h" +#include "pair.h" +#include "bond.h" +#include "angle.h" +#include "dihedral.h" +#include "improper.h" +#include "kspace.h" +#include "memory.h" +#include "error.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixNumDiffStress::FixNumDiffStress(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), id_pe(nullptr), + temp_x(nullptr), temp_f(nullptr) +{ + if (narg < 5) error->all(FLERR,"Illegal fix numdiff/stress command"); + + peratom_freq = nevery; + respa_level_support = 1; + vector_flag = 1; + size_vector = NDIR_STRESS; + extvector = 0; + + maxatom = 0; + + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + delta = utils::numeric(FLERR,arg[4],false,lmp); + if (nevery <= 0 || delta <= 0.0) + error->all(FLERR,"Illegal fix numdiff command"); + + std::string cmd = id + std::string("_pe"); + id_pe = utils::strdup(cmd); + + cmd += " all pe"; + modify->add_compute(cmd); + + // perform initial allocation of atom-based arrays + // zero numdiff_forces since dump may access it on timestep 0 + // zero numdiff_forces since a variable may access it before first run + + reallocate(); + stress_clear(); + + + // set fixed-point to default = center of cell + + fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]); + fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]); + fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]); + + // define the cartesian indices for each strain (Voigt order) + + dirlist[0][0] = 0; + dirlist[0][1] = 0; + dirlist[1][0] = 1; + dirlist[1][1] = 1; + dirlist[2][0] = 2; + dirlist[2][1] = 2; + + dirlist[3][0] = 1; + dirlist[3][1] = 2; + dirlist[4][0] = 0; + dirlist[4][1] = 2; + dirlist[5][0] = 0; + dirlist[5][1] = 1; +} + +/* ---------------------------------------------------------------------- */ + +FixNumDiffStress::~FixNumDiffStress() +{ + memory->destroy(temp_x); + memory->destroy(temp_f); + + modify->delete_compute(id_pe); + delete[] id_pe; +} + +/* ---------------------------------------------------------------------- */ + +int FixNumDiffStress::setmask() +{ + datamask_read = datamask_modify = 0; + + int mask = 0; + mask |= POST_FORCE; + mask |= POST_FORCE_RESPA; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixNumDiffStress::init() +{ + // check for PE compute + + int icompute = modify->find_compute(id_pe); + if (icompute < 0) error->all(FLERR,"Compute ID for fix numdiff does not exist"); + pe = modify->compute[icompute]; + + if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; + else pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; + else kspace_compute_flag = 0; + + if (utils::strmatch(update->integrate_style,"^respa")) { + ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixNumDiffStress::setup(int vflag) +{ + if (utils::strmatch(update->integrate_style,"^verlet")) + post_force(vflag); + else { + ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + post_force_respa(vflag,ilevel_respa,0); + ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixNumDiffStress::min_setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixNumDiffStress::post_force(int /* vflag */) +{ + if (update->ntimestep % nevery) return; + + calculate_stress(); +} + +/* ---------------------------------------------------------------------- */ + +void FixNumDiffStress::post_force_respa(int vflag, int ilevel, int /*iloop*/) +{ + if (ilevel == ilevel_respa) post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixNumDiffStress::min_post_force(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- + compute finite difference stress tensor +------------------------------------------------------------------------- */ + +void FixNumDiffStress::calculate_stress() +{ + double energy; + + // grow arrays if necessary + + if (atom->nlocal + atom->nghost > maxatom) reallocate(); + + // store copy of current forces for owned and ghost atoms + + double **x = atom->x; + double **f = atom->f; + int nlocal = atom->nlocal; + int nall = nlocal + atom->nghost; + + for (int i = 0; i < nall; i++) + for (int j = 0; j < 3; j++) { + temp_x[i][j] = x[i][j]; + temp_f[i][j] = f[i][j]; + } + + // initialize numerical stress to zero + + stress_clear(); + + // loop over 6 strain directions + // compute a finite difference force in each dimension + + int flag,allflag; + double denominator = 0.5 / delta; + + for (int idir = 0; idir <= NDIR_STRESS; idir++) { + displace_atoms(nall, idir, 1.0); + energy = update_energy(); + stress[idir] += energy; + displace_atoms(nall, idir,-1.0); + energy = update_energy(); + stress[idir] -= energy; + stress[idir] *= denominator; + restore_atoms(nall, idir); + } + + // restore original forces for owned and ghost atoms + + for (int i = 0; i < nall; i++) + for (int j = 0; j < 3; j++) + f[i][j] = temp_f[i][j]; + +} + +/* ---------------------------------------------------------------------- + displace position of all owned and ghost atoms +---------------------------------------------------------------------- */ + +void FixNumDiffStress::displace_atoms(int nall, int idir, double magnitude) +{ + double **x = atom->x; + int k = dirlist[idir][0]; + int l = dirlist[idir][1]; + for (int i = 0; i < nall; i++) + x[i][k] += temp_x[i][k] + delta*magnitude* + (temp_x[i][l]-fixedpoint[l]); +} + +/* ---------------------------------------------------------------------- + restore position of all owned and ghost atoms +---------------------------------------------------------------------- */ + +void FixNumDiffStress::restore_atoms(int nall, int idir) +{ + double **x = atom->x; + int j = dirlist[idir][0]; + for (int i = 0; i < nall; i++) { + x[i][j] = temp_x[i][j]; + } +} + +/* ---------------------------------------------------------------------- + evaluate potential energy and forces + same logic as in Verlet +------------------------------------------------------------------------- */ + +double FixNumDiffStress::update_energy() +{ + int eflag = 1; + + if (pair_compute_flag) force->pair->compute(eflag,0); + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag,0); + if (force->angle) force->angle->compute(eflag,0); + if (force->dihedral) force->dihedral->compute(eflag,0); + if (force->improper) force->improper->compute(eflag,0); + } + + if (kspace_compute_flag) force->kspace->compute(eflag,0); + + double energy = pe->compute_scalar(); + return energy; +} + +/* ---------------------------------------------------------------------- + clear forces needed +------------------------------------------------------------------------- */ + +void FixNumDiffStress::stress_clear() +{ + size_t nbytes = sizeof(double) * size_vector; + memset(&stress[0],0,nbytes); +} + +/* ---------------------------------------------------------------------- + return Ith vector value, assume in range of size_vector +------------------------------------------------------------------------- */ + +double FixNumDiffStress::compute_vector(int i) +{ + return stress[i]; +} + +/* ---------------------------------------------------------------------- + reallocated local per-atoms arrays +------------------------------------------------------------------------- */ + +void FixNumDiffStress::reallocate() +{ + memory->destroy(temp_x); + memory->destroy(temp_f); + maxatom = atom->nmax; + memory->create(temp_x,maxatom,3,"numdiff/stress:temp_x"); + memory->create(temp_f,maxatom,3,"numdiff/stress:temp_f"); +} + +/* ---------------------------------------------------------------------- + memory usage of local atom-based arrays +------------------------------------------------------------------------- */ + +double FixNumDiffStress::memory_usage() +{ + double bytes = 0.0; + bytes += (double)2 * maxatom*3 * sizeof(double); + return bytes; +} diff --git a/src/EXTRA-FIX/fix_numdiff_stress.h b/src/EXTRA-FIX/fix_numdiff_stress.h new file mode 100644 index 0000000000..4ca0c533ad --- /dev/null +++ b/src/EXTRA-FIX/fix_numdiff_stress.h @@ -0,0 +1,84 @@ +/* -*- 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 FIX_CLASS +// clang-format off +FixStyle(numdiff/stress,FixNumDiffStress); +// clang-format on +#else + +#ifndef LMP_FIX_NUMDIFF_STRESS_H +#define LMP_FIX_NUMDIFF_STRESS_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixNumDiffStress : public Fix { + public: + FixNumDiffStress(class LAMMPS *, int, char **); + ~FixNumDiffStress(); + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; + double memory_usage() override; + + private: + static const int NDIR_STRESS = 6; // dimension of stress and strain vectors + double delta; // strain magnitude + int maxatom; // allocated size of atom arrays + int ilevel_respa; + + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped + + char *id_pe; // name of energy compute + class Compute *pe; // pointer to energy compute + + double stress[NDIR_STRESS]; // finite diff stress components (Voigt order) + double **temp_x; // original coords + double **temp_f; // original forces + double fixedpoint[3]; // define displacement field origin + int dirlist[NDIR_STRESS][2];// strain cartesian indices (Voigt order) + + double compute_vector(int) override; // access function for stress + void calculate_stress(); // stress calculation + void displace_atoms(int, int, double);// apply displacement field + void restore_atoms(int, int); // restore original positions + double update_energy(); // calculate new energy + void stress_clear(); // set stress to zero + void reallocate(); // grow the atom arrays +}; + +} // namespace LAMMPS_NS + +#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 ID for fix numdiff/stress does not exist + +Self-explanatory. + +*/ From c16caea13bd52a53dedd498276d86ab332fc95ab Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 21 Jan 2022 19:17:12 -0700 Subject: [PATCH 082/174] Fixed bounds error --- examples/numdiff/in.numdiff | 3 ++- src/EXTRA-FIX/fix_numdiff_stress.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/numdiff/in.numdiff b/examples/numdiff/in.numdiff index 3f76712ac8..f925aa8395 100644 --- a/examples/numdiff/in.numdiff +++ b/examples/numdiff/in.numdiff @@ -32,7 +32,8 @@ dump errors all custom 100 force_error.dump v_errx v_erry v_errz variable ferrsq atom (fx-f_numforce[1])^2+(fy-f_numforce[2])^2+(fz-f_numforce[3])^2 compute faverrsq all reduce ave v_ferrsq fix avfaverrsq all ave/time 100 1 100 c_faverrsq ave running +compute myvirial all pressure NULL virial -thermo_style custom step temp pe press c_faverrsq f_avfaverrsq pxx f_numstress[1] +thermo_style custom step temp pe press c_faverrsq f_avfaverrsq c_myvirial[1] f_numstress[1] thermo 100 run 500 diff --git a/src/EXTRA-FIX/fix_numdiff_stress.cpp b/src/EXTRA-FIX/fix_numdiff_stress.cpp index 765a0d5421..67ca091d61 100644 --- a/src/EXTRA-FIX/fix_numdiff_stress.cpp +++ b/src/EXTRA-FIX/fix_numdiff_stress.cpp @@ -219,7 +219,7 @@ void FixNumDiffStress::calculate_stress() int flag,allflag; double denominator = 0.5 / delta; - for (int idir = 0; idir <= NDIR_STRESS; idir++) { + for (int idir = 0; idir < NDIR_STRESS; idir++) { displace_atoms(nall, idir, 1.0); energy = update_energy(); stress[idir] += energy; From 3286fcb13a99eb81a511d371e982eb5943fbc62a Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 21 Jan 2022 19:29:23 -0700 Subject: [PATCH 083/174] Added correct units for pressure, still getting wrong answer --- examples/numdiff/in.numdiff | 5 ++--- src/EXTRA-FIX/fix_numdiff_stress.cpp | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/numdiff/in.numdiff b/examples/numdiff/in.numdiff index f925aa8395..d451a56d1e 100644 --- a/examples/numdiff/in.numdiff +++ b/examples/numdiff/in.numdiff @@ -31,9 +31,8 @@ dump errors all custom 100 force_error.dump v_errx v_erry v_errz variable ferrsq atom (fx-f_numforce[1])^2+(fy-f_numforce[2])^2+(fz-f_numforce[3])^2 compute faverrsq all reduce ave v_ferrsq -fix avfaverrsq all ave/time 100 1 100 c_faverrsq ave running compute myvirial all pressure NULL virial - -thermo_style custom step temp pe press c_faverrsq f_avfaverrsq c_myvirial[1] f_numstress[1] +variable ratio11 equal f_numstress[1]/c_myvirial[1] +thermo_style custom step temp pe press c_faverrsq c_myvirial[*] f_numstress[*] v_ratio11 thermo 100 run 500 diff --git a/src/EXTRA-FIX/fix_numdiff_stress.cpp b/src/EXTRA-FIX/fix_numdiff_stress.cpp index 67ca091d61..a2dd5f9b8a 100644 --- a/src/EXTRA-FIX/fix_numdiff_stress.cpp +++ b/src/EXTRA-FIX/fix_numdiff_stress.cpp @@ -217,7 +217,10 @@ void FixNumDiffStress::calculate_stress() // compute a finite difference force in each dimension int flag,allflag; - double denominator = 0.5 / delta; + double nktv2p = force->nktv2p; + double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); + + double denominator = 0.5 / delta * inv_volume * nktv2p; for (int idir = 0; idir < NDIR_STRESS; idir++) { displace_atoms(nall, idir, 1.0); From 3e3cd4c94d8d6b25d8df12df0925ea44be7963f5 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 21 Jan 2022 19:46:54 -0700 Subject: [PATCH 084/174] Added correct units for pressure, still getting wrong answer --- examples/numdiff/in.numdiff | 2 +- src/EXTRA-FIX/fix_numdiff_stress.cpp | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/examples/numdiff/in.numdiff b/examples/numdiff/in.numdiff index d451a56d1e..07d39f2ddf 100644 --- a/examples/numdiff/in.numdiff +++ b/examples/numdiff/in.numdiff @@ -20,7 +20,7 @@ neighbor 1.0 bin timestep 0.001 fix numforce all numdiff 100 0.0001 -fix numstress all numdiff/stress 100 0.0001 +fix numstress all numdiff/stress 100 1.0e-2 fix nve all nve variable errx atom fx-f_numforce[1] diff --git a/src/EXTRA-FIX/fix_numdiff_stress.cpp b/src/EXTRA-FIX/fix_numdiff_stress.cpp index a2dd5f9b8a..cc1adc7e2a 100644 --- a/src/EXTRA-FIX/fix_numdiff_stress.cpp +++ b/src/EXTRA-FIX/fix_numdiff_stress.cpp @@ -70,8 +70,6 @@ FixNumDiffStress::FixNumDiffStress(LAMMPS *lmp, int narg, char **arg) : // zero numdiff_forces since a variable may access it before first run reallocate(); - stress_clear(); - // set fixed-point to default = center of cell @@ -204,15 +202,11 @@ void FixNumDiffStress::calculate_stress() int nall = nlocal + atom->nghost; for (int i = 0; i < nall; i++) - for (int j = 0; j < 3; j++) { - temp_x[i][j] = x[i][j]; - temp_f[i][j] = f[i][j]; + for (int k = 0; k < 3; k++) { + temp_x[i][k] = x[i][k]; + temp_f[i][k] = f[i][k]; } - // initialize numerical stress to zero - - stress_clear(); - // loop over 6 strain directions // compute a finite difference force in each dimension @@ -220,12 +214,12 @@ void FixNumDiffStress::calculate_stress() double nktv2p = force->nktv2p; double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); - double denominator = 0.5 / delta * inv_volume * nktv2p; + double denominator = -0.5 / delta * inv_volume * nktv2p; for (int idir = 0; idir < NDIR_STRESS; idir++) { displace_atoms(nall, idir, 1.0); energy = update_energy(); - stress[idir] += energy; + stress[idir] = energy; displace_atoms(nall, idir,-1.0); energy = update_energy(); stress[idir] -= energy; @@ -236,8 +230,8 @@ void FixNumDiffStress::calculate_stress() // restore original forces for owned and ghost atoms for (int i = 0; i < nall; i++) - for (int j = 0; j < 3; j++) - f[i][j] = temp_f[i][j]; + for (int k = 0; k < 3; k++) + f[i][k] = temp_f[i][k]; } @@ -262,9 +256,9 @@ void FixNumDiffStress::displace_atoms(int nall, int idir, double magnitude) void FixNumDiffStress::restore_atoms(int nall, int idir) { double **x = atom->x; - int j = dirlist[idir][0]; + int k = dirlist[idir][0]; for (int i = 0; i < nall; i++) { - x[i][j] = temp_x[i][j]; + x[i][k] = temp_x[i][k]; } } From 79a9829e9259fde03174e4d53adc2adc2451aaa5 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Sat, 22 Jan 2022 09:56:01 -0500 Subject: [PATCH 085/174] Apply override to remaining classes --- src/KOKKOS/modify_kokkos.h | 84 ++++++++++----------- src/KOKKOS/rand_pool_wrap_kokkos.h | 2 +- src/LATBOLTZ/fix_lb_fluid.h | 22 +++--- src/LATBOLTZ/fix_lb_momentum.h | 6 +- src/LATBOLTZ/fix_lb_pc.h | 18 ++--- src/LATBOLTZ/fix_lb_rigid_pc_sphere.h | 34 ++++----- src/LATBOLTZ/fix_lb_viscous.h | 16 ++-- src/MACHDYN/compute_smd_tlsph_defgrad.h | 8 +- src/MACHDYN/compute_smd_tlsph_shape.h | 8 +- src/MACHDYN/compute_smd_tlsph_strain.h | 8 +- src/MACHDYN/compute_smd_tlsph_strain_rate.h | 8 +- src/MACHDYN/compute_smd_tlsph_stress.h | 8 +- src/MACHDYN/compute_smd_ulsph_strain_rate.h | 8 +- src/MACHDYN/compute_smd_ulsph_stress.h | 8 +- src/MACHDYN/pair_smd_tlsph.h | 26 +++---- src/MACHDYN/pair_smd_triangulated_surface.h | 18 ++--- src/MACHDYN/pair_smd_ulsph.h | 22 +++--- src/MANIFOLD/manifold_cylinder.h | 9 +-- src/MANIFOLD/manifold_cylinder_dent.h | 9 +-- src/MANIFOLD/manifold_dumbbell.h | 9 +-- src/MANIFOLD/manifold_ellipsoid.h | 9 +-- src/MANIFOLD/manifold_gaussian_bump.h | 14 ++-- src/MANIFOLD/manifold_plane.h | 9 +-- src/MANIFOLD/manifold_plane_wiggle.h | 9 +-- src/MANIFOLD/manifold_sphere.h | 11 ++- src/MANIFOLD/manifold_spine.h | 13 ++-- src/MANIFOLD/manifold_supersphere.h | 10 +-- src/MANIFOLD/manifold_thylakoid.h | 12 +-- src/MANIFOLD/manifold_torus.h | 9 +-- src/MDI/fix_mdi_engine.h | 16 ++-- src/MDI/mdi_engine.h | 4 +- src/ML-HDNNP/pair_hdnnp.h | 12 +-- src/ML-IAP/mliap_so3.h | 2 +- src/ML-PACE/pair_pace.h | 14 ++-- src/MOLFILE/reader_molfile.h | 18 ++--- src/MPIIO/dump_atom_mpiio.h | 14 ++-- src/MPIIO/dump_cfg_mpiio.h | 12 +-- src/MPIIO/dump_custom_mpiio.h | 12 +-- src/MPIIO/dump_xyz_mpiio.h | 12 +-- src/MPIIO/restart_mpiio.h | 2 +- src/MSCG/fix_mscg.h | 12 +-- src/NETCDF/dump_netcdf.h | 12 +-- src/NETCDF/dump_netcdf_mpiio.h | 10 +-- src/PTM/ptm_voronoi_cell.h | 4 +- src/QEQ/fix_qeq.cpp | 2 +- src/QMMM/fix_qmmm.h | 14 ++-- src/REAXFF/reaxff_control.cpp | 2 +- src/REAXFF/reaxff_ffield.cpp | 2 +- src/SPIN/min_spin.h | 12 +-- src/SPIN/min_spin_cg.h | 12 +-- src/SPIN/min_spin_lbfgs.h | 12 +-- src/VORONOI/compute_voronoi_atom.h | 16 ++-- 52 files changed, 322 insertions(+), 333 deletions(-) diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index 25911743b2..c8f6ec567c 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -22,52 +22,52 @@ namespace LAMMPS_NS { class ModifyKokkos : public Modify { public: ModifyKokkos(class LAMMPS *); - ~ModifyKokkos() {} - void setup(int); - void setup_pre_exchange(); - void setup_pre_neighbor(); - void setup_post_neighbor(); - void setup_pre_force(int); - void setup_pre_reverse(int, int); - void initial_integrate(int); - void post_integrate(); + + void setup(int) override; + void setup_pre_exchange() override; + void setup_pre_neighbor() override; + void setup_post_neighbor() override; + void setup_pre_force(int) override; + void setup_pre_reverse(int, int) override; + void initial_integrate(int) override; + void post_integrate() override; void pre_decide(); - void pre_exchange(); - void pre_neighbor(); - void post_neighbor(); - void pre_force(int); - void pre_reverse(int,int); - void post_force(int); - void final_integrate(); - void end_of_step(); - double energy_couple(); - double energy_global(); - void energy_atom(int, double *); - void post_run(); + void pre_exchange() override; + void pre_neighbor() override; + void post_neighbor() override; + void pre_force(int) override; + void pre_reverse(int,int) override; + void post_force(int) override; + void final_integrate() override; + void end_of_step() override; + double energy_couple() override; + double energy_global() override; + void energy_atom(int, double *) override; + void post_run() override; - void setup_pre_force_respa(int, int); - void initial_integrate_respa(int, int, int); - void post_integrate_respa(int, int); - void pre_force_respa(int, int, int); - void post_force_respa(int, int, int); - void final_integrate_respa(int, int); + void setup_pre_force_respa(int, int) override; + void initial_integrate_respa(int, int, int) override; + void post_integrate_respa(int, int) override; + void pre_force_respa(int, int, int) override; + void post_force_respa(int, int, int) override; + void final_integrate_respa(int, int) override; - void min_pre_exchange(); - void min_pre_neighbor(); - void min_post_neighbor(); - void min_pre_force(int); - void min_pre_reverse(int,int); - void min_post_force(int); + void min_pre_exchange() override; + void min_pre_neighbor() override; + void min_post_neighbor() override; + void min_pre_force(int) override; + void min_pre_reverse(int,int) override; + void min_post_force(int) override; - double min_energy(double *); - void min_store(); - void min_step(double, double *); - void min_clearstore(); - void min_pushstore(); - void min_popstore(); - double max_alpha(double *); - int min_dof(); - int min_reset_ref(); + double min_energy(double *) override; + void min_store() override; + void min_step(double, double *) override; + void min_clearstore() override; + void min_pushstore() override; + void min_popstore() override; + double max_alpha(double *) override; + int min_dof() override; + int min_reset_ref() override; protected: diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index 9a9d681c79..d2a37ed1bd 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -44,7 +44,7 @@ struct RandWrap { class RandPoolWrap : protected Pointers { public: RandPoolWrap(int, class LAMMPS *); - ~RandPoolWrap(); + ~RandPoolWrap() override; void destroy(); void init(RanMars*, int); diff --git a/src/LATBOLTZ/fix_lb_fluid.h b/src/LATBOLTZ/fix_lb_fluid.h index 98d3e2c792..c389e0e529 100644 --- a/src/LATBOLTZ/fix_lb_fluid.h +++ b/src/LATBOLTZ/fix_lb_fluid.h @@ -36,18 +36,18 @@ class FixLbFluid : public Fix { public: FixLbFluid(class LAMMPS *, int, char **); - ~FixLbFluid(); - int setmask(); - void init(); - void initial_integrate(int); - void setup(int); - void post_force(int); - void end_of_step(); + ~FixLbFluid() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void setup(int) override; + void post_force(int) override; + void end_of_step() override; - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: double viscosity, densityinit_real, a_0_real, T; diff --git a/src/LATBOLTZ/fix_lb_momentum.h b/src/LATBOLTZ/fix_lb_momentum.h index 145ba78f05..3dd839bb5d 100644 --- a/src/LATBOLTZ/fix_lb_momentum.h +++ b/src/LATBOLTZ/fix_lb_momentum.h @@ -27,9 +27,9 @@ namespace LAMMPS_NS { class FixLbMomentum : public Fix { public: FixLbMomentum(class LAMMPS *, int, char **); - int setmask(); - void init(); - void end_of_step(); + int setmask() override; + void init() override; + void end_of_step() override; private: int linear; diff --git a/src/LATBOLTZ/fix_lb_pc.h b/src/LATBOLTZ/fix_lb_pc.h index d218f22ebd..b015250404 100644 --- a/src/LATBOLTZ/fix_lb_pc.h +++ b/src/LATBOLTZ/fix_lb_pc.h @@ -27,17 +27,17 @@ namespace LAMMPS_NS { class FixLbPC : public Fix { public: FixLbPC(class LAMMPS *, int, char **); - ~FixLbPC(); - int setmask(); - void init(); - void initial_integrate(int); - void final_integrate(); + ~FixLbPC() override; + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; - void grow_arrays(int); - void copy_arrays(int, int, int); + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; // void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; private: double dtv, dtf; diff --git a/src/LATBOLTZ/fix_lb_rigid_pc_sphere.h b/src/LATBOLTZ/fix_lb_rigid_pc_sphere.h index 5964c7d142..d9a6762a69 100644 --- a/src/LATBOLTZ/fix_lb_rigid_pc_sphere.h +++ b/src/LATBOLTZ/fix_lb_rigid_pc_sphere.h @@ -27,25 +27,25 @@ namespace LAMMPS_NS { class FixLbRigidPCSphere : public Fix { public: FixLbRigidPCSphere(class LAMMPS *, int, char **); - virtual ~FixLbRigidPCSphere(); - virtual int setmask(); - virtual void init(); - virtual void setup(int); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual double compute_scalar(); + ~FixLbRigidPCSphere() override; + int setmask() override; + void init() override; + void setup(int) override; + void initial_integrate(int) override; + void final_integrate() override; + double compute_scalar() override; - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - void set_arrays(int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + double memory_usage() override; + void grow_arrays(int) override; + void copy_arrays(int, int, int) override; + void set_arrays(int) override; + int pack_exchange(int, double *) override; + int unpack_exchange(int, double *) override; - void pre_neighbor(); - int dof(int); - void reset_dt(); - double compute_array(int, int); + void pre_neighbor() override; + int dof(int) override; + void reset_dt() override; + double compute_array(int, int) override; private: double **up; diff --git a/src/LATBOLTZ/fix_lb_viscous.h b/src/LATBOLTZ/fix_lb_viscous.h index 8c86e47553..d4891369af 100644 --- a/src/LATBOLTZ/fix_lb_viscous.h +++ b/src/LATBOLTZ/fix_lb_viscous.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class FixLbViscous : public Fix { public: FixLbViscous(class LAMMPS *, int, char **); - virtual ~FixLbViscous() = default; - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); + + int setmask() override; + void init() override; + void setup(int) override; + void min_setup(int) override; + void post_force(int) override; + void post_force_respa(int, int, int) override; + void min_post_force(int) override; protected: int nlevels_respa; diff --git a/src/MACHDYN/compute_smd_tlsph_defgrad.h b/src/MACHDYN/compute_smd_tlsph_defgrad.h index eed4066867..61ce69bc9d 100644 --- a/src/MACHDYN/compute_smd_tlsph_defgrad.h +++ b/src/MACHDYN/compute_smd_tlsph_defgrad.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTLSPHDefgrad : public Compute { public: ComputeSMDTLSPHDefgrad(class LAMMPS *, int, char **); - ~ComputeSMDTLSPHDefgrad(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTLSPHDefgrad() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_tlsph_shape.h b/src/MACHDYN/compute_smd_tlsph_shape.h index 76298cf30c..e8d9080326 100644 --- a/src/MACHDYN/compute_smd_tlsph_shape.h +++ b/src/MACHDYN/compute_smd_tlsph_shape.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSmdTlsphShape : public Compute { public: ComputeSmdTlsphShape(class LAMMPS *, int, char **); - ~ComputeSmdTlsphShape(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSmdTlsphShape() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_tlsph_strain.h b/src/MACHDYN/compute_smd_tlsph_strain.h index 426cb6dea9..f1e3f43855 100644 --- a/src/MACHDYN/compute_smd_tlsph_strain.h +++ b/src/MACHDYN/compute_smd_tlsph_strain.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTLSPHstrain : public Compute { public: ComputeSMDTLSPHstrain(class LAMMPS *, int, char **); - ~ComputeSMDTLSPHstrain(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTLSPHstrain() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_tlsph_strain_rate.h b/src/MACHDYN/compute_smd_tlsph_strain_rate.h index 7fd851725c..73a16d3ac3 100644 --- a/src/MACHDYN/compute_smd_tlsph_strain_rate.h +++ b/src/MACHDYN/compute_smd_tlsph_strain_rate.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTLSPHStrainRate : public Compute { public: ComputeSMDTLSPHStrainRate(class LAMMPS *, int, char **); - ~ComputeSMDTLSPHStrainRate(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTLSPHStrainRate() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_tlsph_stress.h b/src/MACHDYN/compute_smd_tlsph_stress.h index 4ef4199e48..8be9ff44c9 100644 --- a/src/MACHDYN/compute_smd_tlsph_stress.h +++ b/src/MACHDYN/compute_smd_tlsph_stress.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDTLSPHStress : public Compute { public: ComputeSMDTLSPHStress(class LAMMPS *, int, char **); - ~ComputeSMDTLSPHStress(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDTLSPHStress() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_ulsph_strain_rate.h b/src/MACHDYN/compute_smd_ulsph_strain_rate.h index ab97d7a924..2d3e5e3157 100644 --- a/src/MACHDYN/compute_smd_ulsph_strain_rate.h +++ b/src/MACHDYN/compute_smd_ulsph_strain_rate.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDULSPHStrainRate : public Compute { public: ComputeSMDULSPHStrainRate(class LAMMPS *, int, char **); - ~ComputeSMDULSPHStrainRate(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDULSPHStrainRate() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/compute_smd_ulsph_stress.h b/src/MACHDYN/compute_smd_ulsph_stress.h index 6f3182f5f4..dc553beec8 100644 --- a/src/MACHDYN/compute_smd_ulsph_stress.h +++ b/src/MACHDYN/compute_smd_ulsph_stress.h @@ -38,10 +38,10 @@ namespace LAMMPS_NS { class ComputeSMDULSPHStress : public Compute { public: ComputeSMDULSPHStress(class LAMMPS *, int, char **); - ~ComputeSMDULSPHStress(); - void init(); - void compute_peratom(); - double memory_usage(); + ~ComputeSMDULSPHStress() override; + void init() override; + void compute_peratom() override; + double memory_usage() override; private: int nmax; diff --git a/src/MACHDYN/pair_smd_tlsph.h b/src/MACHDYN/pair_smd_tlsph.h index 0950430ca0..e58f51fe76 100644 --- a/src/MACHDYN/pair_smd_tlsph.h +++ b/src/MACHDYN/pair_smd_tlsph.h @@ -39,21 +39,21 @@ namespace LAMMPS_NS { class PairTlsph : public Pair { public: PairTlsph(class LAMMPS *); - virtual ~PairTlsph(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - void write_restart_settings(FILE *) {} - void read_restart_settings(FILE *) {} - virtual double memory_usage(); + ~PairTlsph() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void init_list(int, class NeighList *) override; + void write_restart_settings(FILE *) override {} + void read_restart_settings(FILE *) override {} + double memory_usage() override; void compute_shape_matrix(); void material_model(); - void *extract(const char *, int &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + void *extract(const char *, int &) override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; void AssembleStress(); void PreCompute(); diff --git a/src/MACHDYN/pair_smd_triangulated_surface.h b/src/MACHDYN/pair_smd_triangulated_surface.h index 57865e7983..ebb04870b8 100644 --- a/src/MACHDYN/pair_smd_triangulated_surface.h +++ b/src/MACHDYN/pair_smd_triangulated_surface.h @@ -39,19 +39,19 @@ namespace LAMMPS_NS { class PairTriSurf : public Pair { public: PairTriSurf(class LAMMPS *); - virtual ~PairTriSurf(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - virtual double memory_usage(); + ~PairTriSurf() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double memory_usage() override; void PointTriangleDistance(const Eigen::Vector3d P, const Eigen::Vector3d TRI1, const Eigen::Vector3d TRI2, const Eigen::Vector3d TRI3, Eigen::Vector3d &CP, double &dist); double clamp(const double a, const double min, const double max); - void *extract(const char *, int &); + void *extract(const char *, int &) override; protected: double **bulkmodulus; diff --git a/src/MACHDYN/pair_smd_ulsph.h b/src/MACHDYN/pair_smd_ulsph.h index 6d58168b5a..12fd018738 100644 --- a/src/MACHDYN/pair_smd_ulsph.h +++ b/src/MACHDYN/pair_smd_ulsph.h @@ -39,18 +39,18 @@ namespace LAMMPS_NS { class PairULSPH : public Pair { public: PairULSPH(class LAMMPS *); - virtual ~PairULSPH(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - virtual double memory_usage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + ~PairULSPH() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void init_style() override; + void init_list(int, class NeighList *) override; + double memory_usage() override; + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; void AssembleStressTensor(); - void *extract(const char *, int &); + void *extract(const char *, int &) override; void PreCompute(); void PreCompute_DensitySummation(); double effective_shear_modulus(const Eigen::Matrix3d d_dev, const Eigen::Matrix3d deltaStressDev, diff --git a/src/MANIFOLD/manifold_cylinder.h b/src/MANIFOLD/manifold_cylinder.h index a8393a9768..cff6dab4ce 100644 --- a/src/MANIFOLD/manifold_cylinder.h +++ b/src/MANIFOLD/manifold_cylinder.h @@ -26,13 +26,12 @@ namespace user_manifold { public: enum { NPARAMS = 1 }; // Number of parameters. manifold_cylinder(LAMMPS *lmp, int, char **); - virtual ~manifold_cylinder() {} - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "cylinder"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_cylinder_dent.h b/src/MANIFOLD/manifold_cylinder_dent.h index f6ec6dfea9..4f0251455c 100644 --- a/src/MANIFOLD/manifold_cylinder_dent.h +++ b/src/MANIFOLD/manifold_cylinder_dent.h @@ -24,13 +24,12 @@ namespace user_manifold { public: manifold_cylinder_dent(LAMMPS *lmp, int, char **); enum { NPARAMS = 3 }; // Number of parameters. - virtual ~manifold_cylinder_dent() {} - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "cylinder/dent"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_dumbbell.h b/src/MANIFOLD/manifold_dumbbell.h index 47a4961fd3..69ccbda875 100644 --- a/src/MANIFOLD/manifold_dumbbell.h +++ b/src/MANIFOLD/manifold_dumbbell.h @@ -25,15 +25,14 @@ namespace user_manifold { public: enum { NPARAMS = 4 }; // Number of parameters. manifold_dumbbell(LAMMPS *lmp, int, char **); - virtual ~manifold_dumbbell() {} - virtual double g(const double *x); - virtual void n(const double *x, double *nn); + double g(const double *x) override; + void n(const double *x, double *nn) override; static const char *type() { return "dumbbell"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_ellipsoid.h b/src/MANIFOLD/manifold_ellipsoid.h index 6bc9d97690..791b409074 100644 --- a/src/MANIFOLD/manifold_ellipsoid.h +++ b/src/MANIFOLD/manifold_ellipsoid.h @@ -24,14 +24,13 @@ namespace user_manifold { public: enum { NPARAMS = 3 }; manifold_ellipsoid(LAMMPS *lmp, int, char **); - virtual ~manifold_ellipsoid() {} - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "ellipsoid"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_gaussian_bump.h b/src/MANIFOLD/manifold_gaussian_bump.h index 4671b189df..854a94f1a1 100644 --- a/src/MANIFOLD/manifold_gaussian_bump.h +++ b/src/MANIFOLD/manifold_gaussian_bump.h @@ -51,19 +51,19 @@ namespace user_manifold { public: enum { NPARAMS = 4 }; manifold_gaussian_bump(class LAMMPS *, int, char **); - virtual ~manifold_gaussian_bump(); + ~manifold_gaussian_bump() override; - virtual double g(const double *); - virtual void n(const double *, double *); + double g(const double *) override; + void n(const double *, double *) override; // Variant of g that computes n at the same time. - virtual double g_and_n(const double *x, double *nn); + double g_and_n(const double *x, double *nn) override; static const char *type() { return "gaussian_bump"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } - virtual int nparams() { return NPARAMS; } - virtual void post_param_init(); + int nparams() override { return NPARAMS; } + void post_param_init() override; private: // Some private constants: diff --git a/src/MANIFOLD/manifold_plane.h b/src/MANIFOLD/manifold_plane.h index 3ee70186fd..fc4dfa0514 100644 --- a/src/MANIFOLD/manifold_plane.h +++ b/src/MANIFOLD/manifold_plane.h @@ -25,13 +25,12 @@ namespace user_manifold { public: enum { NPARAMS = 6 }; // Number of parameters. manifold_plane(LAMMPS *lmp, int, char **); - virtual ~manifold_plane() {} - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "plane"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_plane_wiggle.h b/src/MANIFOLD/manifold_plane_wiggle.h index 895dd54e90..4d1ab2845d 100644 --- a/src/MANIFOLD/manifold_plane_wiggle.h +++ b/src/MANIFOLD/manifold_plane_wiggle.h @@ -25,13 +25,12 @@ namespace user_manifold { public: enum { NPARAMS = 2 }; // Number of parameters. manifold_plane_wiggle(LAMMPS *lmp, int, char **); - virtual ~manifold_plane_wiggle() {} - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "plane/wiggle"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_sphere.h b/src/MANIFOLD/manifold_sphere.h index 18ca828c92..e8ba801476 100644 --- a/src/MANIFOLD/manifold_sphere.h +++ b/src/MANIFOLD/manifold_sphere.h @@ -26,15 +26,14 @@ namespace user_manifold { enum { NPARAMS = 1 }; manifold_sphere(LAMMPS *lmp, int, char **) : manifold(lmp) {} - virtual ~manifold_sphere() {} - virtual double g(const double *x) + double g(const double *x) override { double R = params[0]; double r2 = x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; return r2 - R * R; } - virtual double g_and_n(const double *x, double *nn) + double g_and_n(const double *x, double *nn) override { double R = params[0]; double r2 = x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; @@ -45,7 +44,7 @@ namespace user_manifold { return r2 - R * R; } - virtual void n(const double *x, double *nn) + void n(const double *x, double *nn) override { nn[0] = 2 * x[0]; nn[1] = 2 * x[1]; @@ -59,9 +58,9 @@ namespace user_manifold { } static const char *type() { return "sphere"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_spine.h b/src/MANIFOLD/manifold_spine.h index 3fb0640185..2ea9f5b051 100644 --- a/src/MANIFOLD/manifold_spine.h +++ b/src/MANIFOLD/manifold_spine.h @@ -25,16 +25,15 @@ namespace user_manifold { public: enum { NPARAMS = 5 }; // Number of parameters. manifold_spine(LAMMPS *lmp, int, char **); - virtual ~manifold_spine() {} - virtual double g(const double *x); - virtual void n(const double *x, double *nn); - virtual double g_and_n(const double *x, double *nn); + double g(const double *x) override; + void n(const double *x, double *nn) override; + double g_and_n(const double *x, double *nn) override; static const char *type() { return "spine"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } protected: int power; @@ -45,7 +44,7 @@ namespace user_manifold { manifold_spine_two(LAMMPS *lmp, int, char **); static const char *type() { return "spine/two"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_supersphere.h b/src/MANIFOLD/manifold_supersphere.h index 9949def311..11c0a3fd1e 100644 --- a/src/MANIFOLD/manifold_supersphere.h +++ b/src/MANIFOLD/manifold_supersphere.h @@ -26,11 +26,9 @@ namespace user_manifold { enum { NPARAMS = 2 }; manifold_supersphere(LAMMPS *lmp, int, char **) : manifold(lmp) {} - virtual ~manifold_supersphere() {} - double my_sign(double a) { return (a > 0) - (a < 0); } - virtual double g(const double *x) + double g(const double *x) override { double R = params[0]; double q = params[1]; @@ -43,7 +41,7 @@ namespace user_manifold { return rr - pow(R, q); } - virtual void n(const double *x, double *nn) + void n(const double *x, double *nn) override { double q = params[1]; double xx = fabs(x[0]); @@ -56,9 +54,9 @@ namespace user_manifold { } static const char *type() { return "supersphere"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MANIFOLD/manifold_thylakoid.h b/src/MANIFOLD/manifold_thylakoid.h index 0236c3bf54..01b54ed108 100644 --- a/src/MANIFOLD/manifold_thylakoid.h +++ b/src/MANIFOLD/manifold_thylakoid.h @@ -26,17 +26,17 @@ namespace user_manifold { public: enum { NPARAMS = 3 }; manifold_thylakoid(LAMMPS *lmp, int, char **); - virtual ~manifold_thylakoid(); + ~manifold_thylakoid() override; - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "thylakoid"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } - virtual void post_param_init(); + void post_param_init() override; private: void init_domains(); diff --git a/src/MANIFOLD/manifold_torus.h b/src/MANIFOLD/manifold_torus.h index b706038bc8..8155d79b27 100644 --- a/src/MANIFOLD/manifold_torus.h +++ b/src/MANIFOLD/manifold_torus.h @@ -24,14 +24,13 @@ namespace user_manifold { public: enum { NPARAMS = 2 }; manifold_torus(LAMMPS *, int, char **); - ~manifold_torus() {} - virtual double g(const double *x); - virtual void n(const double *x, double *n); + double g(const double *x) override; + void n(const double *x, double *n) override; static const char *type() { return "torus"; } - virtual const char *id() { return type(); } + const char *id() override { return type(); } static int expected_argc() { return NPARAMS; } - virtual int nparams() { return NPARAMS; } + int nparams() override { return NPARAMS; } }; } // namespace user_manifold diff --git a/src/MDI/fix_mdi_engine.h b/src/MDI/fix_mdi_engine.h index bcba62c063..925292ae1f 100644 --- a/src/MDI/fix_mdi_engine.h +++ b/src/MDI/fix_mdi_engine.h @@ -28,20 +28,20 @@ namespace LAMMPS_NS { class FixMDIEngine : public Fix { public: FixMDIEngine(class LAMMPS *, int, char **); - ~FixMDIEngine(); - int setmask(); - void init(); + ~FixMDIEngine() override; + int setmask() override; + void init() override; int execute_command(const char *command, MDI_Comm driver_socket); char *engine_mode(const char *node); // receive and update forces - void min_setup(int); - void post_integrate(); - void post_force(int); - void min_pre_force(int); //@COORDS - void min_post_force(int); //@FORCES + void min_setup(int) override; + void post_integrate() override; + void post_force(int) override; + void min_pre_force(int) override; //@COORDS + void min_post_force(int) override; //@FORCES double *add_force; // stores forces added using +FORCE command double potential_energy; // stores potential energy diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index f282714097..5202b811d8 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -27,8 +27,8 @@ namespace LAMMPS_NS { class MDIEngine : public Command { public: MDIEngine(LAMMPS *lmp) : Command(lmp) {} - virtual ~MDIEngine() {} - void command(int, char **); + + void command(int, char **) override; private: class FixMDIEngine *mdi_fix; diff --git a/src/ML-HDNNP/pair_hdnnp.h b/src/ML-HDNNP/pair_hdnnp.h index 3c42fa60be..e186e29785 100644 --- a/src/ML-HDNNP/pair_hdnnp.h +++ b/src/ML-HDNNP/pair_hdnnp.h @@ -39,12 +39,12 @@ class PairHDNNP : public Pair { public: PairHDNNP(class LAMMPS *); - virtual ~PairHDNNP(); - virtual void compute(int, int); - virtual void settings(int, char **); - virtual void coeff(int, char **); - virtual void init_style(); - virtual double init_one(int, int); + ~PairHDNNP() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; protected: virtual void allocate(); diff --git a/src/ML-IAP/mliap_so3.h b/src/ML-IAP/mliap_so3.h index 2429803dde..27d4f406e4 100644 --- a/src/ML-IAP/mliap_so3.h +++ b/src/ML-IAP/mliap_so3.h @@ -11,7 +11,7 @@ class MLIAP_SO3 : protected Pointers { MLIAP_SO3(LAMMPS *, double vrcut, int vlmax, int vnmax, double valpha); MLIAP_SO3(LAMMPS *lmp) : Pointers(lmp){}; - ~MLIAP_SO3(); + ~MLIAP_SO3() override; void init(); diff --git a/src/ML-PACE/pair_pace.h b/src/ML-PACE/pair_pace.h index c5cfa05b7e..c932b5a679 100644 --- a/src/ML-PACE/pair_pace.h +++ b/src/ML-PACE/pair_pace.h @@ -39,15 +39,15 @@ namespace LAMMPS_NS { class PairPACE : public Pair { public: PairPACE(class LAMMPS *); - virtual ~PairPACE(); + ~PairPACE() override; - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - virtual void init_style(); - double init_one(int, int); + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + void init_style() override; + double init_one(int, int) override; - void *extract(const char *, int &); + void *extract(const char *, int &) override; protected: struct ACEImpl *aceimpl; diff --git a/src/MOLFILE/reader_molfile.h b/src/MOLFILE/reader_molfile.h index 4330eaf4eb..946ea66b03 100644 --- a/src/MOLFILE/reader_molfile.h +++ b/src/MOLFILE/reader_molfile.h @@ -29,18 +29,18 @@ namespace LAMMPS_NS { class ReaderMolfile : public Reader { public: ReaderMolfile(class LAMMPS *); - virtual ~ReaderMolfile(); + ~ReaderMolfile() override; - virtual void settings(int, char **); + void settings(int, char **) override; - virtual int read_time(bigint &); - virtual void skip(); - virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, - int &, int &, int &); - virtual void read_atoms(int, int, double **); + int read_time(bigint &) override; + void skip() override; + bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &) override; + void read_atoms(int, int, double **) override; - virtual void open_file(const std::string &); - virtual void close_file(); + void open_file(const std::string &) override; + void close_file() override; private: int *fieldindex; // mapping of input fields to dump diff --git a/src/MPIIO/dump_atom_mpiio.h b/src/MPIIO/dump_atom_mpiio.h index b2c186df3c..9e0942d86f 100644 --- a/src/MPIIO/dump_atom_mpiio.h +++ b/src/MPIIO/dump_atom_mpiio.h @@ -28,7 +28,7 @@ class DumpAtomMPIIO : public DumpAtom { public: DumpAtomMPIIO(class LAMMPS *, int, char **); - virtual ~DumpAtomMPIIO(); + ~DumpAtomMPIIO() override; protected: bigint @@ -40,12 +40,12 @@ class DumpAtomMPIIO : public DumpAtom { int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data char *filecurrent; // name of file for this round (with % and * replaced) - virtual void openfile(); - virtual void write_header(bigint); - virtual void write(); - virtual void write_data(int, double *); + void openfile() override; + void write_header(bigint) override; + void write() override; + void write_data(int, double *) override; - virtual void init_style(); + void init_style() override; typedef void (DumpAtomMPIIO::*FnPtrHeader)(bigint); FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); @@ -59,7 +59,7 @@ class DumpAtomMPIIO : public DumpAtom { int convert_noimage_omp(int, double *); // multithreaded version of convert_noimage #endif - int convert_string(int, double *); + int convert_string(int, double *) override; typedef void (DumpAtomMPIIO::*FnPtrData)(int, double *); FnPtrData write_choice; // ptr to write data functions void write_binary(int, double *); diff --git a/src/MPIIO/dump_cfg_mpiio.h b/src/MPIIO/dump_cfg_mpiio.h index 492f7c1adb..b6b17fb908 100644 --- a/src/MPIIO/dump_cfg_mpiio.h +++ b/src/MPIIO/dump_cfg_mpiio.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DumpCFGMPIIO : public DumpCFG { public: DumpCFGMPIIO(class LAMMPS *, int, char **); - virtual ~DumpCFGMPIIO(); + ~DumpCFGMPIIO() override; protected: bigint @@ -43,11 +43,11 @@ class DumpCFGMPIIO : public DumpCFG { int convert_string_omp(int, double *); // multithreaded version of convert_string #endif - virtual void openfile(); - virtual void init_style(); - virtual void write_header(bigint); - virtual void write(); - virtual void write_data(int, double *); + void openfile() override; + void init_style() override; + void write_header(bigint) override; + void write() override; + void write_data(int, double *) override; typedef void (DumpCFGMPIIO::*FnPtrData)(int, double *); FnPtrData write_choice; // ptr to write data functions diff --git a/src/MPIIO/dump_custom_mpiio.h b/src/MPIIO/dump_custom_mpiio.h index bb5b901d53..af125dae6e 100644 --- a/src/MPIIO/dump_custom_mpiio.h +++ b/src/MPIIO/dump_custom_mpiio.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DumpCustomMPIIO : public DumpCustom { public: DumpCustomMPIIO(class LAMMPS *, int, char **); - virtual ~DumpCustomMPIIO(); + ~DumpCustomMPIIO() override; protected: bigint @@ -43,12 +43,12 @@ class DumpCustomMPIIO : public DumpCustom { int convert_string_omp(int, double *); // multithreaded version of convert_string #endif - virtual void openfile(); - virtual void write_header(bigint); - virtual void write(); - virtual void write_data(int, double *); + void openfile() override; + void write_header(bigint) override; + void write() override; + void write_data(int, double *) override; - virtual void init_style(); + void init_style() override; typedef void (DumpCustomMPIIO::*FnPtrHeader)(bigint); FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); diff --git a/src/MPIIO/dump_xyz_mpiio.h b/src/MPIIO/dump_xyz_mpiio.h index e85db01a87..8475bd03d1 100644 --- a/src/MPIIO/dump_xyz_mpiio.h +++ b/src/MPIIO/dump_xyz_mpiio.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class DumpXYZMPIIO : public DumpXYZ { public: DumpXYZMPIIO(class LAMMPS *, int, char **); - virtual ~DumpXYZMPIIO(); + ~DumpXYZMPIIO() override; protected: bigint @@ -43,12 +43,12 @@ class DumpXYZMPIIO : public DumpXYZ { int convert_string_omp(int, double *); // multithreaded version of convert_string #endif - virtual void openfile(); - virtual void write_header(bigint); - virtual void write(); - virtual void write_data(int, double *); + void openfile() override; + void write_header(bigint) override; + void write() override; + void write_data(int, double *) override; - virtual void init_style(); + void init_style() override; typedef void (DumpXYZMPIIO::*FnPtrData)(int, double *); FnPtrData write_choice; // ptr to write data functions diff --git a/src/MPIIO/restart_mpiio.h b/src/MPIIO/restart_mpiio.h index a39808e69c..09f7c76fb0 100644 --- a/src/MPIIO/restart_mpiio.h +++ b/src/MPIIO/restart_mpiio.h @@ -27,7 +27,7 @@ class RestartMPIIO : protected Pointers { int mpiio_exists; RestartMPIIO(class LAMMPS *); - ~RestartMPIIO() {} + void openForRead(const char *); void openForWrite(const char *); void write(MPI_Offset, int, double *); diff --git a/src/MSCG/fix_mscg.h b/src/MSCG/fix_mscg.h index 1233db1748..972a48c1e0 100644 --- a/src/MSCG/fix_mscg.h +++ b/src/MSCG/fix_mscg.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class FixMSCG : public Fix { public: FixMSCG(class LAMMPS *, int, char **); - ~FixMSCG(); - int setmask(); - void post_constructor(); - void init(); - void end_of_step(); - void post_run(); + ~FixMSCG() override; + int setmask() override; + void post_constructor() override; + void init() override; + void end_of_step() override; + void post_run() override; private: int range_flag, name_flag, me, nprocs; diff --git a/src/NETCDF/dump_netcdf.h b/src/NETCDF/dump_netcdf.h index f3a4e81d9c..3d27ffcb50 100644 --- a/src/NETCDF/dump_netcdf.h +++ b/src/NETCDF/dump_netcdf.h @@ -33,8 +33,8 @@ namespace LAMMPS_NS { class DumpNetCDF : public DumpCustom { public: DumpNetCDF(class LAMMPS *, int, char **); - virtual ~DumpNetCDF(); - virtual void write(); + ~DumpNetCDF() override; + void write() override; private: static constexpr int NC_FIELD_NAME_MAX = 100; @@ -88,12 +88,12 @@ class DumpNetCDF : public DumpCustom { int cell_lengths_var; int cell_angles_var; - virtual void openfile(); + void openfile() override; void closefile(); - virtual void write_header(bigint); - virtual void write_data(int, double *); + void write_header(bigint) override; + void write_data(int, double *) override; - virtual int modify_param(int, char **); + int modify_param(int, char **) override; void ncerr(int, const char *, int); }; diff --git a/src/NETCDF/dump_netcdf_mpiio.h b/src/NETCDF/dump_netcdf_mpiio.h index ec6cbaec04..937850fcac 100644 --- a/src/NETCDF/dump_netcdf_mpiio.h +++ b/src/NETCDF/dump_netcdf_mpiio.h @@ -33,8 +33,8 @@ namespace LAMMPS_NS { class DumpNetCDFMPIIO : public DumpCustom { public: DumpNetCDFMPIIO(class LAMMPS *, int, char **); - virtual ~DumpNetCDFMPIIO(); - virtual void write(); + ~DumpNetCDFMPIIO() override; + void write() override; private: static constexpr int NC_MPIIO_FIELD_NAME_MAX = 100; @@ -85,13 +85,13 @@ class DumpNetCDFMPIIO : public DumpCustom { int cell_lengths_var; int cell_angles_var; - virtual void openfile(); + void openfile() override; void closefile(); void write_time_and_cell(); - virtual void write_data(int, double *); + void write_data(int, double *) override; void write_prmtop(); - virtual int modify_param(int, char **); + int modify_param(int, char **) override; void ncerr(int, const char *, int); }; diff --git a/src/PTM/ptm_voronoi_cell.h b/src/PTM/ptm_voronoi_cell.h index 6fea7a7175..6b1c800441 100644 --- a/src/PTM/ptm_voronoi_cell.h +++ b/src/PTM/ptm_voronoi_cell.h @@ -273,7 +273,7 @@ class voronoicell_neighbor : public voronoicell_base { * face that is clockwise from the jth edge. */ int **ne; voronoicell_neighbor(); - ~voronoicell_neighbor(); + ~voronoicell_neighbor() override; void operator=(voronoicell_neighbor &c); /** Cuts the Voronoi cell by a particle whose center is at a * separation of (x,y,z) from the cell center. The value of rsq @@ -321,7 +321,7 @@ class voronoicell_neighbor : public voronoicell_base { } void init(double xmin,double xmax,double ymin,double ymax,double zmin,double zmax); void check_facets(); - virtual void neighbors(std::vector &v); + void neighbors(std::vector &v) override; private: int *paux1; diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index ffd45719a5..8c6be2f1c6 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -47,7 +47,7 @@ namespace { std::string message; public: explicit qeq_parser_error(const std::string &mesg) { message = mesg; } - const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; } diff --git a/src/QMMM/fix_qmmm.h b/src/QMMM/fix_qmmm.h index 830e52d772..7c16c59fb9 100644 --- a/src/QMMM/fix_qmmm.h +++ b/src/QMMM/fix_qmmm.h @@ -27,18 +27,18 @@ namespace LAMMPS_NS { class FixQMMM : public Fix { public: FixQMMM(class LAMMPS *, int, char **); - ~FixQMMM(); - int setmask(); - void init(); + ~FixQMMM() override; + int setmask() override; + void init() override; // send up-to-date position information to QM and MM slave code - void post_integrate(); + void post_integrate() override; // receive and update forces - void setup(int); - void post_force(int); + void setup(int) override; + void post_force(int) override; - double memory_usage(); + double memory_usage() override; protected: void exchange_positions(); // communicate positions to QM and MM slave diff --git a/src/REAXFF/reaxff_control.cpp b/src/REAXFF/reaxff_control.cpp index 62a45b0dc7..d914765f45 100644 --- a/src/REAXFF/reaxff_control.cpp +++ b/src/REAXFF/reaxff_control.cpp @@ -60,7 +60,7 @@ namespace ReaxFF { explicit control_parser_error(const std::string &format, const std::string &keyword) { message = fmt::format(format, keyword); } - const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; // NOTE: this function is run on MPI rank 0 only diff --git a/src/REAXFF/reaxff_ffield.cpp b/src/REAXFF/reaxff_ffield.cpp index ac22609317..d79d63b87b 100644 --- a/src/REAXFF/reaxff_ffield.cpp +++ b/src/REAXFF/reaxff_ffield.cpp @@ -47,7 +47,7 @@ namespace ReaxFF { std::string message; public: explicit ffield_parser_error(const std::string &mesg) { message = mesg; } - const char *what() const noexcept { return message.c_str(); } + const char *what() const noexcept override { return message.c_str(); } }; void Read_Force_Field(const char *filename, reax_interaction *reax, diff --git a/src/SPIN/min_spin.h b/src/SPIN/min_spin.h index 929528defd..14117d9189 100644 --- a/src/SPIN/min_spin.h +++ b/src/SPIN/min_spin.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class MinSpin : public Min { public: MinSpin(class LAMMPS *); - ~MinSpin() {} - void init(); - void setup_style(); - int modify_param(int, char **); - void reset_vectors(); - int iterate(int); + + void init() override; + void setup_style() override; + int modify_param(int, char **) override; + void reset_vectors() override; + int iterate(int) override; double evaluate_dt(); void advance_spins(double); diff --git a/src/SPIN/min_spin_cg.h b/src/SPIN/min_spin_cg.h index b1ee51da85..581a343233 100644 --- a/src/SPIN/min_spin_cg.h +++ b/src/SPIN/min_spin_cg.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class MinSpinCG : public Min { public: MinSpinCG(class LAMMPS *); - virtual ~MinSpinCG(); - void init(); - void setup_style(); - void reset_vectors(); - int modify_param(int, char **); - int iterate(int); + ~MinSpinCG() override; + void init() override; + void setup_style() override; + void reset_vectors() override; + int modify_param(int, char **) override; + int iterate(int) override; private: int local_iter; // for neb diff --git a/src/SPIN/min_spin_lbfgs.h b/src/SPIN/min_spin_lbfgs.h index 0bc81c2113..bc8ae42567 100644 --- a/src/SPIN/min_spin_lbfgs.h +++ b/src/SPIN/min_spin_lbfgs.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class MinSpinLBFGS : public Min { public: MinSpinLBFGS(class LAMMPS *); - virtual ~MinSpinLBFGS(); - void init(); - void setup_style(); - int modify_param(int, char **); - void reset_vectors(); - int iterate(int); + ~MinSpinLBFGS() override; + void init() override; + void setup_style() override; + int modify_param(int, char **) override; + void reset_vectors() override; + int iterate(int) override; private: int local_iter; // for neb diff --git a/src/VORONOI/compute_voronoi_atom.h b/src/VORONOI/compute_voronoi_atom.h index de49636d76..960a3d703a 100644 --- a/src/VORONOI/compute_voronoi_atom.h +++ b/src/VORONOI/compute_voronoi_atom.h @@ -33,15 +33,15 @@ namespace LAMMPS_NS { class ComputeVoronoi : public Compute { public: ComputeVoronoi(class LAMMPS *, int, char **); - ~ComputeVoronoi(); - void init(); - void compute_peratom(); - void compute_vector(); - void compute_local(); - double memory_usage(); + ~ComputeVoronoi() override; + void init() override; + void compute_peratom() override; + void compute_vector() override; + void compute_local() override; + double memory_usage() override; - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + int pack_forward_comm(int, int *, double *, int, int *) override; + void unpack_forward_comm(int, int, double *) override; private: voro::container *con_mono; From ef2969dfbf40e5336bcc455e72a1c7fbde839800 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 10:30:58 -0500 Subject: [PATCH 086/174] use override keyword in plugin sources --- examples/plugins/angle_zero2.h | 18 +++++++++--------- examples/plugins/bond_zero2.h | 20 ++++++++++---------- examples/plugins/dihedral_zero2.h | 14 +++++++------- examples/plugins/fix_nve2.h | 23 ++++++++--------------- examples/plugins/improper_zero2.h | 14 +++++++------- examples/plugins/pair_morse2.h | 26 +++++++++++++------------- examples/plugins/pair_morse2_omp.h | 4 ++-- examples/plugins/pair_zero2.h | 26 +++++++++++++------------- 8 files changed, 69 insertions(+), 76 deletions(-) diff --git a/examples/plugins/angle_zero2.h b/examples/plugins/angle_zero2.h index 4c9e6e9b24..e9a5df3ae4 100644 --- a/examples/plugins/angle_zero2.h +++ b/examples/plugins/angle_zero2.h @@ -21,17 +21,17 @@ namespace LAMMPS_NS { class AngleZero2 : public Angle { public: AngleZero2(class LAMMPS *); - virtual ~AngleZero2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void settings(int, char **); + ~AngleZero2() override; + void compute(int, int) override; + void coeff(int, char **) override; + void settings(int, char **) override; - double equilibrium_angle(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + double equilibrium_angle(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; - double single(int, int, int, int); + double single(int, int, int, int) override; protected: double *theta0; diff --git a/examples/plugins/bond_zero2.h b/examples/plugins/bond_zero2.h index 247d3e2f63..e01ec8c1fc 100644 --- a/examples/plugins/bond_zero2.h +++ b/examples/plugins/bond_zero2.h @@ -21,18 +21,18 @@ namespace LAMMPS_NS { class BondZero2 : public Bond { public: BondZero2(class LAMMPS *); - virtual ~BondZero2(); - virtual void compute(int, int); - virtual void settings(int, char **); + ~BondZero2() override; + void compute(int, int) override; + void settings(int, char **) override; - void coeff(int, char **); - double equilibrium_distance(int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void coeff(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; - double single(int, double, int, int, double &); - virtual void *extract(const char *, int &); + double single(int, double, int, int, double &) override; + void *extract(const char *, int &) override; protected: double *r0; diff --git a/examples/plugins/dihedral_zero2.h b/examples/plugins/dihedral_zero2.h index c343849f7d..ca0e49b21a 100644 --- a/examples/plugins/dihedral_zero2.h +++ b/examples/plugins/dihedral_zero2.h @@ -25,14 +25,14 @@ namespace LAMMPS_NS { class DihedralZero2 : public Dihedral { public: DihedralZero2(class LAMMPS *); - virtual ~DihedralZero2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void settings(int, char **); + ~DihedralZero2() override; + void compute(int, int) override; + void coeff(int, char **) override; + void settings(int, char **) override; - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int coeffflag; diff --git a/examples/plugins/fix_nve2.h b/examples/plugins/fix_nve2.h index 423946f8c0..3be0131d28 100644 --- a/examples/plugins/fix_nve2.h +++ b/examples/plugins/fix_nve2.h @@ -11,12 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef FIX_CLASS - -FixStyle(nve2, FixNVE2) - -#else - #ifndef LMP_FIX_NVE2_H #define LMP_FIX_NVE2_H @@ -27,14 +21,14 @@ namespace LAMMPS_NS { class FixNVE2 : public Fix { public: FixNVE2(class LAMMPS *, int, char **); - virtual ~FixNVE2() {} - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void initial_integrate_respa(int, int, int); - virtual void final_integrate_respa(int, int); - virtual void reset_dt(); + + int setmask() override; + void init() override; + void initial_integrate(int) override; + void final_integrate() override; + void initial_integrate_respa(int, int, int) override; + void final_integrate_respa(int, int) override; + void reset_dt() override; protected: double dtv, dtf; @@ -44,7 +38,6 @@ class FixNVE2 : public Fix { } // namespace LAMMPS_NS -#endif #endif /* ERROR/WARNING messages: diff --git a/examples/plugins/improper_zero2.h b/examples/plugins/improper_zero2.h index 21cbd87c03..f561a4ae19 100644 --- a/examples/plugins/improper_zero2.h +++ b/examples/plugins/improper_zero2.h @@ -21,14 +21,14 @@ namespace LAMMPS_NS { class ImproperZero2 : public Improper { public: ImproperZero2(class LAMMPS *); - virtual ~ImproperZero2(); - virtual void compute(int, int); - virtual void coeff(int, char **); - virtual void settings(int, char **); + ~ImproperZero2() override; + void compute(int, int) override; + void coeff(int, char **) override; + void settings(int, char **) override; - void write_restart(FILE *); - void read_restart(FILE *); - void write_data(FILE *); + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; protected: int coeffflag; diff --git a/examples/plugins/pair_morse2.h b/examples/plugins/pair_morse2.h index 753743fc4e..c796cd1164 100644 --- a/examples/plugins/pair_morse2.h +++ b/examples/plugins/pair_morse2.h @@ -21,20 +21,20 @@ namespace LAMMPS_NS { class PairMorse2 : public Pair { public: PairMorse2(class LAMMPS *); - virtual ~PairMorse2(); - virtual void compute(int, int); + ~PairMorse2() override; + void compute(int, int) override; - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); - void *extract(const char *, int &); + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + void *extract(const char *, int &) override; protected: double cut_global; diff --git a/examples/plugins/pair_morse2_omp.h b/examples/plugins/pair_morse2_omp.h index 6c27f42125..ec8f28e074 100644 --- a/examples/plugins/pair_morse2_omp.h +++ b/examples/plugins/pair_morse2_omp.h @@ -28,8 +28,8 @@ class PairMorse2OMP : public PairMorse2, public ThrOMP { public: PairMorse2OMP(class LAMMPS *); - virtual void compute(int, int); - virtual double memory_usage(); + void compute(int, int) override; + double memory_usage() override; private: template diff --git a/examples/plugins/pair_zero2.h b/examples/plugins/pair_zero2.h index 9f96b7757c..8c8ed6f59e 100644 --- a/examples/plugins/pair_zero2.h +++ b/examples/plugins/pair_zero2.h @@ -31,19 +31,19 @@ namespace LAMMPS_NS { class PairZero2 : public Pair { public: PairZero2(class LAMMPS *); - virtual ~PairZero2(); - virtual void compute(int, int); - virtual void compute_outer(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void write_restart(FILE *); - void read_restart(FILE *); - void write_restart_settings(FILE *); - void read_restart_settings(FILE *); - void write_data(FILE *); - void write_data_all(FILE *); - double single(int, int, int, int, double, double, double, double &); + ~PairZero2() override; + void compute(int, int) override; + void compute_outer(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_restart_settings(FILE *) override; + void read_restart_settings(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; protected: double cut_global; From 7aed8954a5210ba2810dd85ce27da29845f5e59a Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Sat, 22 Jan 2022 11:03:44 -0500 Subject: [PATCH 087/174] Add paragraphs in Modify_style.rst --- doc/src/Modify_style.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/src/Modify_style.rst b/doc/src/Modify_style.rst index 50e7afb370..382db3b0ea 100644 --- a/doc/src/Modify_style.rst +++ b/doc/src/Modify_style.rst @@ -305,6 +305,40 @@ you are uncertain, please ask. FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg` convenience function where possible. +- Usage of C++11 `virtual`, `override`, `final` keywords: Please follow the + `C++ Core Guideline C.128 `_. + That means, you should only use `virtual` to declare a new virtual + function, `override` to indicate you are overriding an existing virtual + function, and `final` to prevent any further overriding. + +- Trivial destructors: Prefer not writing destructors when they are empty and `default`. + + .. code-block:: c++ + + // don't write destructors for A or B like this + class A : protected Pointers { + public: + A(); + ~A() override {} + }; + + class B : protected Pointers { + public: + B(); + ~B() override = default; + }; + + // instead, let the compiler create the implicit default destructor by not writing it + class A : protected Pointers { + public: + A(); + }; + + class B : protected Pointers { + public: + B(); + }; + - Header files, especially those defining a "style", should only use the absolute minimum number of include files and **must not** contain any ``using`` statements. Typically that would be only the header for From 900ff39403a8fa0f24f87fe89e5e075d26a82c99 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 16:33:44 -0500 Subject: [PATCH 088/174] make consistent --- src/tabular_function.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tabular_function.cpp b/src/tabular_function.cpp index a3a904d644..07df49729a 100644 --- a/src/tabular_function.cpp +++ b/src/tabular_function.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/ Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract From c93fba5e2da9d37079969ab928fa424af94734be Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 16:45:38 -0500 Subject: [PATCH 089/174] make certain that offset is always initialized --- src/MISC/pair_list.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MISC/pair_list.cpp b/src/MISC/pair_list.cpp index 5215cdc7e2..f5c82ed5e6 100644 --- a/src/MISC/pair_list.cpp +++ b/src/MISC/pair_list.cpp @@ -232,6 +232,7 @@ void PairList::settings(int narg, char **arg) while ((line = reader.next_line())) { ValueTokenizer values(line); list_param oneparam; + oneparam.offset = 0.0; oneparam.id1 = values.next_tagint(); oneparam.id2 = values.next_tagint(); oneparam.style = stylename[values.next_string()]; From d854e58d002993c6dc627c56bb9801d0e227e0ea Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 16:51:07 -0500 Subject: [PATCH 090/174] add sanity check --- src/reader_native.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/reader_native.cpp b/src/reader_native.cpp index ba7a576a50..065adb5d01 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -130,6 +130,7 @@ void ReaderNative::skip() // read chunk and skip them read_buf(&nchunk, sizeof(int), 1); + if (nchunk < 0) error->one(FLERR,"Dump file is invalid or corrupted"); int n; for (int i = 0; i < nchunk; i++) { From 458ae4e38aa2df2748c9bba16dbe09238ba2ef4d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 17:06:13 -0500 Subject: [PATCH 091/174] initialize pointers, remove unused class member --- src/EXTRA-MOLECULE/bond_fene_nm.cpp | 2 +- src/EXTRA-MOLECULE/bond_fene_nm.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EXTRA-MOLECULE/bond_fene_nm.cpp b/src/EXTRA-MOLECULE/bond_fene_nm.cpp index 147a63512a..8abaf97bec 100644 --- a/src/EXTRA-MOLECULE/bond_fene_nm.cpp +++ b/src/EXTRA-MOLECULE/bond_fene_nm.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -BondFENENM::BondFENENM(LAMMPS *lmp) : BondFENE(lmp) {} +BondFENENM::BondFENENM(LAMMPS *lmp) : BondFENE(lmp), nn(nullptr), mm(nullptr) {} /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-MOLECULE/bond_fene_nm.h b/src/EXTRA-MOLECULE/bond_fene_nm.h index f00394c6d8..4dbf64a331 100644 --- a/src/EXTRA-MOLECULE/bond_fene_nm.h +++ b/src/EXTRA-MOLECULE/bond_fene_nm.h @@ -38,7 +38,6 @@ class BondFENENM : public BondFENE { virtual void *extract(const char *, int &); protected: - double TWO_1_3; double *nn, *mm; virtual void allocate(); From f814dc5ff9ee7f94391751336443c301c0848641 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 17:06:28 -0500 Subject: [PATCH 092/174] add checks after reading data --- src/reader_native.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 065adb5d01..32b2279a60 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -142,8 +142,7 @@ void ReaderNative::skip() read_lines(2); bigint natoms; int rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) - error->one(FLERR,"Dump file is incorrectly formatted"); + if (rv != 1) error->one(FLERR,"Dump file is incorrectly formatted"); read_lines(5); @@ -164,20 +163,17 @@ void ReaderNative::skip_reading_magic_str() if (is_known_magic_str() && revision > 0x0001) { int len; read_buf(&len, sizeof(int), 1); + if (len < 0) error->one(FLERR,"Dump file is invalid or corrupted"); - if (len > 0) { - // has units - skip_buf(sizeof(char)*len); - } + // has units + if (len > 0) skip_buf(sizeof(char)*len); char flag = 0; read_buf(&flag, sizeof(char), 1); - - if (flag) { - skip_buf(sizeof(double)); - } + if (flag) skip_buf(sizeof(double)); read_buf(&len, sizeof(int), 1); + if (len < 0) error->one(FLERR,"Dump file is invalid or corrupted"); skip_buf(sizeof(char)*len); } } From 81e7583a8d00faba5f2833d8e37ad5cd13e893f8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 17:07:12 -0500 Subject: [PATCH 093/174] initialize pointers, use provided constant, reorder include statements --- src/MOLECULE/bond_quartic.cpp | 25 +++++++++++++------------ src/MOLECULE/bond_quartic.h | 1 - src/OPENMP/bond_quartic_omp.cpp | 8 +++++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index b3eea79064..30fd460dcc 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -18,24 +18,25 @@ #include "bond_quartic.h" -#include #include "atom.h" -#include "neighbor.h" #include "comm.h" -#include "force.h" -#include "pair.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "memory.h" +#include "neighbor.h" +#include "pair.h" +#include + +#include "math_const.h" using namespace LAMMPS_NS; +using namespace MathConst; /* ---------------------------------------------------------------------- */ -BondQuartic::BondQuartic(LAMMPS *lmp) : Bond(lmp) -{ - TWO_1_3 = pow(2.0,(1.0/3.0)); -} +BondQuartic::BondQuartic(LAMMPS *lmp) : Bond(lmp), k(nullptr), + b1(nullptr), b2(nullptr), rc(nullptr), u0(nullptr) {} /* ---------------------------------------------------------------------- */ @@ -120,7 +121,7 @@ void BondQuartic::compute(int eflag, int vflag) rb = dr - b2[type]; fbond = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb); - if (rsq < TWO_1_3) { + if (rsq < MY_CUBEROOT2) { sr2 = 1.0/rsq; sr6 = sr2*sr2*sr2; fbond += 48.0*sr6*(sr6-0.5)/rsq; @@ -128,7 +129,7 @@ void BondQuartic::compute(int eflag, int vflag) if (eflag) { ebond = k[type]*r2*ra*rb + u0[type]; - if (rsq < TWO_1_3) ebond += 4.0*sr6*(sr6-1.0) + 1.0; + if (rsq < MY_CUBEROOT2) ebond += 4.0*sr6*(sr6-1.0) + 1.0; } // apply force to each of 2 atoms @@ -336,7 +337,7 @@ double BondQuartic::single(int type, double rsq, int i, int j, eng += k[type]*r2*ra*rb + u0[type]; fforce = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb); - if (rsq < TWO_1_3) { + if (rsq < MY_CUBEROOT2) { sr2 = 1.0/rsq; sr6 = sr2*sr2*sr2; eng += 4.0*sr6*(sr6-1.0) + 1.0; diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h index 35ec705849..3973477e68 100644 --- a/src/MOLECULE/bond_quartic.h +++ b/src/MOLECULE/bond_quartic.h @@ -38,7 +38,6 @@ class BondQuartic : public Bond { double single(int, double, int, int, double &); protected: - double TWO_1_3; double *k, *b1, *b2, *rc, *u0; void allocate(); diff --git a/src/OPENMP/bond_quartic_omp.cpp b/src/OPENMP/bond_quartic_omp.cpp index 00e8357644..427293dd3e 100644 --- a/src/OPENMP/bond_quartic_omp.cpp +++ b/src/OPENMP/bond_quartic_omp.cpp @@ -22,13 +22,15 @@ #include "comm.h" #include "force.h" #include "neighbor.h" - #include "pair.h" #include #include "suffix.h" +#include "math_const.h" + using namespace LAMMPS_NS; +using namespace MathConst; /* ---------------------------------------------------------------------- */ @@ -143,7 +145,7 @@ void BondQuarticOMP::eval(int nfrom, int nto, ThrData * const thr) rb = dr - b2[type]; fbond = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb); - if (rsq < TWO_1_3) { + if (rsq < MY_CUBEROOT2) { sr2 = 1.0/rsq; sr6 = sr2*sr2*sr2; fbond += 48.0*sr6*(sr6-0.5)/rsq; @@ -151,7 +153,7 @@ void BondQuarticOMP::eval(int nfrom, int nto, ThrData * const thr) if (EFLAG) { ebond = k[type]*r2*ra*rb + u0[type]; - if (rsq < TWO_1_3) ebond += 4.0*sr6*(sr6-1.0) + 1.0; + if (rsq < MY_CUBEROOT2) ebond += 4.0*sr6*(sr6-1.0) + 1.0; } // apply force to each of 2 atoms From cd165562569770015214004cf49b320c3fe423f7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 22 Jan 2022 17:13:54 -0500 Subject: [PATCH 094/174] add missing break statements. @GenieTim this bug may have tainted your results. you would always get the energy value for any of the dx, dy, dz keywords --- src/compute_pair_local.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index ff9acdc4ef..b98f6eec33 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -277,10 +277,13 @@ int ComputePairLocal::compute_pairs(int flag) break; case DX: ptr[n] = delx*directionCorrection; + break; case DY: ptr[n] = dely*directionCorrection; + break; case DZ: ptr[n] = delz*directionCorrection; + break; case ENG: ptr[n] = eng; break; From 88dadd0fffea798fcd56a9253cb6d020ea41f83c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 23 Jan 2022 21:12:22 -0500 Subject: [PATCH 095/174] consistently refer to INTEL package in upper case --- src/INTEL/fix_intel.cpp | 13 ++++++------- src/INTEL/nbin_intel.cpp | 6 ++---- src/INTEL/verlet_lrt_intel.cpp | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 97d4f21788..6a848a366e 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -43,7 +43,7 @@ using namespace FixConst; #ifdef __INTEL_OFFLOAD #ifndef _LMP_INTEL_OFFLOAD -#warning "Not building Intel package with Xeon Phi offload support." +#warning "Not building INTEL package with Xeon Phi offload support." #endif #endif @@ -303,7 +303,7 @@ void FixIntel::init() if (force->pair_match("^hybrid", 0) != nullptr) { _pair_hybrid_flag = 1; if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute) - error->all(FLERR,"Intel package requires fdotr virial with newton on."); + error->all(FLERR,"INTEL package requires fdotr virial with newton on."); } else _pair_hybrid_flag = 0; @@ -354,12 +354,12 @@ void FixIntel::init() void FixIntel::setup(int vflag) { if (neighbor->style != Neighbor::BIN) - error->all(FLERR,"Currently, neighbor style BIN must be used with Intel package."); + error->all(FLERR,"Currently, neighbor style BIN must be used with INTEL package."); if (vflag > 3) - error->all(FLERR,"Cannot currently get per-atom virials with Intel package."); + error->all(FLERR,"Cannot currently get per-atom virials with INTEL package."); #ifdef _LMP_INTEL_OFFLOAD if (neighbor->exclude_setting() != 0) - error->all(FLERR,"Currently, cannot use neigh_modify exclude with Intel package offload."); + error->all(FLERR,"Currently, cannot use neigh_modify exclude with INTEL package offload."); post_force(vflag); #endif } @@ -512,8 +512,7 @@ void FixIntel::bond_init_check() } if (intel_pair == 0) - error->all(FLERR,"Intel styles for bond/angle/dihedral/improper " - "require intel pair style."); + error->all(FLERR,"Intel styles for bond/angle/dihedral/improper require intel pair style."); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/nbin_intel.cpp b/src/INTEL/nbin_intel.cpp index 94f18002a0..29bc7c9ced 100644 --- a/src/INTEL/nbin_intel.cpp +++ b/src/INTEL/nbin_intel.cpp @@ -161,10 +161,8 @@ void NBinIntel::bin_atoms(IntelBuffers * buffers) { const flt_t dx = (INTEL_BIGP - bboxhi[0]); const flt_t dy = (INTEL_BIGP - bboxhi[1]); const flt_t dz = (INTEL_BIGP - bboxhi[2]); - if (dx * dx + dy * dy + dz * dz < - static_cast(neighbor->cutneighmaxsq)) - error->one(FLERR, - "Intel package expects no atoms within cutoff of {1e15,1e15,1e15}."); + if (dx * dx + dy * dy + dz * dz < static_cast(neighbor->cutneighmaxsq)) + error->one(FLERR,"INTEL package expects no atoms within cutoff of (1e15,1e15,1e15)."); } // ---------- Grow and cast/pack buffers ------------- diff --git a/src/INTEL/verlet_lrt_intel.cpp b/src/INTEL/verlet_lrt_intel.cpp index 216ba98302..f867ad73e6 100644 --- a/src/INTEL/verlet_lrt_intel.cpp +++ b/src/INTEL/verlet_lrt_intel.cpp @@ -71,7 +71,7 @@ void VerletLRTIntel::init() #ifndef LMP_INTEL_USELRT error->all(FLERR, - "LRT otion for Intel package disabled at compile time"); + "LRT otion for INTEL package disabled at compile time"); #endif } From f9a2006d732670265cbb0d47631bb3d4291150b3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 24 Jan 2022 08:44:29 -0500 Subject: [PATCH 096/174] reorder includes --- src/ASPHERE/pair_gayberne.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 08af6ee3c9..39cb88f81b 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -18,18 +18,18 @@ #include "pair_gayberne.h" -#include -#include "math_extra.h" #include "atom.h" #include "atom_vec_ellipsoid.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" #include "citeme.h" -#include "memory.h" +#include "comm.h" #include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" +#include using namespace LAMMPS_NS; From 35dbabd4716765aa8886d01c7384a24a1393e3e9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 25 Jan 2022 07:39:37 -0500 Subject: [PATCH 097/174] alternate fix for tag caching issue in INTEL package --- src/INTEL/fix_intel.cpp | 2 +- src/INTEL/intel_buffers.cpp | 2 -- src/INTEL/npair_intel.cpp | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 6a848a366e..a201386724 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -447,7 +447,7 @@ void FixIntel::pair_init_check(const bool cdmessage) #endif int need_tag = 0; - if (atom->molecular != Atom::ATOMIC) need_tag = 1; + if (atom->molecular != Atom::ATOMIC || three_body_neighbor()) need_tag = 1; // Clear buffers used for pair style char kmode[80]; diff --git a/src/INTEL/intel_buffers.cpp b/src/INTEL/intel_buffers.cpp index 3470c18db8..cbbc609fc0 100644 --- a/src/INTEL/intel_buffers.cpp +++ b/src/INTEL/intel_buffers.cpp @@ -207,8 +207,6 @@ void IntelBuffers::free_nmax() template void IntelBuffers::_grow_nmax(const int offload_end) { - if (lmp->atom->molecular) _need_tag = 1; - else _need_tag = 0; #ifdef _LMP_INTEL_OFFLOAD free_nmax(); int size = lmp->atom->nmax; diff --git a/src/INTEL/npair_intel.cpp b/src/INTEL/npair_intel.cpp index 67cd2517e4..2fffb2353a 100644 --- a/src/INTEL/npair_intel.cpp +++ b/src/INTEL/npair_intel.cpp @@ -309,6 +309,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, flt_t * _noalias const tz = ncachez + toffs; int * _noalias const tj = ncachej + toffs; int * _noalias const tjtype = ncachejtype + toffs; + tagint * _noalias const ttag = ncachetag + toffs; flt_t * _noalias itx; flt_t * _noalias ity; @@ -365,6 +366,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, ty[u] = x[j].y; tz[u] = x[j].z; tjtype[u] = x[j].w; + if (THREE) ttag[u] = tag[j]; } if (FULL == 0 && TRI != 1) { @@ -512,7 +514,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, } if (THREE) { - const tagint jtag = tag[j]; + const tagint jtag = ttag[u]; int flist = 0; if (itag > jtag) { if (((itag+jtag) & 1) == 0) flist = 1; From 3297ed7c5f214979b46c0538132ec5e0e0416da0 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 25 Jan 2022 14:28:24 -0500 Subject: [PATCH 098/174] Refactor some declarations in KOKKOS package Adds C++11 template helpers to shrink larger declarations. --- src/KOKKOS/angle_charmm_kokkos.h | 6 ++-- src/KOKKOS/fix_acks2_reaxff_kokkos.h | 34 +++++++++++++-------- src/KOKKOS/fix_qeq_reaxff_kokkos.h | 32 ++++++++++++-------- src/KOKKOS/fix_rx_kokkos.h | 22 +++++++------- src/KOKKOS/fix_shake_kokkos.h | 21 ++++++++----- src/KOKKOS/kokkos_type.h | 9 ++++++ src/KOKKOS/pair_eam_alloy_kokkos.h | 30 ++++++++++++------- src/KOKKOS/pair_eam_fs_kokkos.h | 30 ++++++++++++------- src/KOKKOS/pair_eam_kokkos.h | 29 +++++++++++------- src/KOKKOS/pair_kokkos.h | 15 ++++++---- src/KOKKOS/pair_reaxff_kokkos.h | 44 ++++++++++++++++------------ src/KOKKOS/pair_snap_kokkos.h | 18 +++++++++--- src/KOKKOS/pair_sw_kokkos.h | 22 ++++++++++---- src/KOKKOS/pair_tersoff_kokkos.h | 26 +++++++++++----- src/KOKKOS/pair_tersoff_mod_kokkos.h | 26 +++++++++++----- src/KOKKOS/pair_tersoff_zbl_kokkos.h | 32 +++++++++++++------- src/KOKKOS/sna_kokkos.h | 6 ++-- 17 files changed, 263 insertions(+), 139 deletions(-) diff --git a/src/KOKKOS/angle_charmm_kokkos.h b/src/KOKKOS/angle_charmm_kokkos.h index 73f2e7447c..02add62f00 100644 --- a/src/KOKKOS/angle_charmm_kokkos.h +++ b/src/KOKKOS/angle_charmm_kokkos.h @@ -65,14 +65,14 @@ class AngleCharmmKokkos : public AngleCharmm { typedef ArrayTypes AT; typename AT::t_x_array_randomread x; - typedef typename KKDevice::value KKDeviceType; + using KKDeviceType = typename KKDevice::value; typename Kokkos::View > f; typename AT::t_int_2d anglelist; Kokkos::DualView k_eatom; Kokkos::DualView k_vatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_eatom; - Kokkos::View::value,Kokkos::MemoryTraits > d_vatom; + Kokkos::View> d_eatom; + Kokkos::View> d_vatom; int nlocal,newton_bond; int eflag,vflag; diff --git a/src/KOKKOS/fix_acks2_reaxff_kokkos.h b/src/KOKKOS/fix_acks2_reaxff_kokkos.h index bce90e97a3..735b478f1b 100644 --- a/src/KOKKOS/fix_acks2_reaxff_kokkos.h +++ b/src/KOKKOS/fix_acks2_reaxff_kokkos.h @@ -183,16 +183,16 @@ class FixACKS2ReaxFFKokkos : public FixACKS2ReaxFF { Kokkos::DualView k_params; typename Kokkos::DualView::t_dev_const params; - typename ArrayTypes::t_x_array x; - typename ArrayTypes::t_v_array v; - typename ArrayTypes::t_f_array_const f; - typename ArrayTypes::t_ffloat_1d_randomread mass; - typename ArrayTypes::t_ffloat_1d q; - typename ArrayTypes::t_int_1d type, mask; - typename ArrayTypes::t_tagint_1d tag; + typename AT::t_x_array x; + typename AT::t_v_array v; + typename AT::t_f_array_const f; + typename AT::t_ffloat_1d_randomread mass; + typename AT::t_ffloat_1d q; + typename AT::t_int_1d type, mask; + typename AT::t_tagint_1d tag; - typename ArrayTypes::t_neighbors_2d d_neighbors; - typename ArrayTypes::t_int_1d_randomread d_ilist, d_numneigh; + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist, d_numneigh; DAT::tdual_ffloat_1d k_tap; typename AT::t_ffloat_1d d_tap; @@ -222,11 +222,19 @@ class FixACKS2ReaxFFKokkos : public FixACKS2ReaxFF { typename AT::t_ffloat_2d d_shield, d_s_hist, d_s_hist_X, d_s_hist_last; typename AT::t_ffloat_2d_randomread r_s_hist, r_s_hist_X, r_s_hist_last; - Kokkos::Experimental::ScatterView::value, Kokkos::Experimental::ScatterSum, Kokkos::Experimental::ScatterDuplicated> dup_X_diag; - Kokkos::Experimental::ScatterView::value, Kokkos::Experimental::ScatterSum, Kokkos::Experimental::ScatterNonDuplicated> ndup_X_diag; + using KKDeviceType = typename KKDevice::value; - Kokkos::Experimental::ScatterView::value, Kokkos::Experimental::ScatterSum, Kokkos::Experimental::ScatterDuplicated> dup_bb; - Kokkos::Experimental::ScatterView::value, Kokkos::Experimental::ScatterSum, Kokkos::Experimental::ScatterNonDuplicated> ndup_bb; + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_X_diag; + NonDupScatterView ndup_X_diag; + + DupScatterView dup_bb; + NonDupScatterView ndup_bb; void init_shielding_k(); void init_hist(); diff --git a/src/KOKKOS/fix_qeq_reaxff_kokkos.h b/src/KOKKOS/fix_qeq_reaxff_kokkos.h index 3256e56aef..87d0e6f154 100644 --- a/src/KOKKOS/fix_qeq_reaxff_kokkos.h +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.h @@ -177,21 +177,21 @@ class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { Kokkos::DualView k_params; typename Kokkos::DualView::t_dev_const params; - typename ArrayTypes::t_x_array x; - typename ArrayTypes::t_v_array v; - typename ArrayTypes::t_f_array_const f; - //typename ArrayTypes::t_float_1d_randomread mass, q; - typename ArrayTypes::t_float_1d_randomread mass; - typename ArrayTypes::t_float_1d q; - typename ArrayTypes::t_int_1d type, mask; - typename ArrayTypes::t_tagint_1d tag; + typename AT::t_x_array x; + typename AT::t_v_array v; + typename AT::t_f_array_const f; + //typename AT::t_float_1d_randomread mass, q; + typename AT::t_float_1d_randomread mass; + typename AT::t_float_1d q; + typename AT::t_int_1d type, mask; + typename AT::t_tagint_1d tag; DAT::tdual_float_1d k_q; typename AT::t_float_1d d_q; HAT::t_float_1d h_q; - typename ArrayTypes::t_neighbors_2d d_neighbors; - typename ArrayTypes::t_int_1d_randomread d_ilist, d_numneigh; + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist, d_numneigh; DAT::tdual_ffloat_1d k_tap; typename AT::t_ffloat_1d d_tap; @@ -216,8 +216,16 @@ class FixQEqReaxFFKokkos : public FixQEqReaxFF, public KokkosBase { HAT::t_ffloat_2d h_s_hist, h_t_hist; typename AT::t_ffloat_2d_randomread r_s_hist, r_t_hist; - Kokkos::Experimental::ScatterView::value, Kokkos::Experimental::ScatterSum, Kokkos::Experimental::ScatterDuplicated> dup_o; - Kokkos::Experimental::ScatterView::value, Kokkos::Experimental::ScatterSum, Kokkos::Experimental::ScatterNonDuplicated> ndup_o; + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_o; + NonDupScatterView ndup_o; int iswap; int first; diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 61e4a05946..3d14a0ae87 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -239,22 +239,22 @@ class FixRxKokkos : public FixRX { typename AT::t_efloat_1d d_dpdThetaLocal, d_sumWeights; HAT::t_efloat_1d h_dpdThetaLocal, h_sumWeights; - typename ArrayTypes::t_x_array_randomread d_x ; - typename ArrayTypes::t_int_1d_randomread d_type ; - typename ArrayTypes::t_efloat_1d d_dpdTheta; + typename AT::t_x_array_randomread d_x; + typename AT::t_int_1d_randomread d_type; + typename AT::t_efloat_1d d_dpdTheta; - typename ArrayTypes::tdual_ffloat_2d k_cutsq; - typename ArrayTypes::t_ffloat_2d d_cutsq; + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; //double **h_cutsq; - typename ArrayTypes::t_neighbors_2d d_neighbors; - typename ArrayTypes::t_int_1d d_ilist ; - typename ArrayTypes::t_int_1d d_numneigh ; + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d d_ilist; + typename AT::t_int_1d d_numneigh; - typename ArrayTypes::t_float_2d d_dvector; - typename ArrayTypes::t_int_1d d_mask ; + typename AT::t_float_2d d_dvector; + typename AT::t_int_1d d_mask; - typename ArrayTypes::t_double_1d d_scratchSpace; + typename AT::t_double_1d d_scratchSpace; size_t scratchSpaceSize; // Error flag for any failures. diff --git a/src/KOKKOS/fix_shake_kokkos.h b/src/KOKKOS/fix_shake_kokkos.h index a9967f22ec..77b7430dd0 100644 --- a/src/KOKKOS/fix_shake_kokkos.h +++ b/src/KOKKOS/fix_shake_kokkos.h @@ -151,14 +151,21 @@ class FixShakeKokkos : public FixShake, public KokkosBase { KOKKOS_INLINE_FUNCTION void shake3angle(int, EV_FLOAT&) const; - typedef typename KKDevice::value KKDeviceType; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + using KKDeviceType = typename KKDevice::value; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; int neighflag,need_dup; diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index f0dc026df8..7750d3760d 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -197,6 +197,15 @@ public: #endif }; +// Helpers for readability + +using KKScatterSum = Kokkos::Experimental::ScatterSum; +using KKScatterDuplicated = Kokkos::Experimental::ScatterDuplicated; +using KKScatterNonDuplicated = Kokkos::Experimental::ScatterNonDuplicated; + +template +using KKScatterView = Kokkos::Experimental::ScatterView; + // set ExecutionSpace stuct with variable "space" diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index 4f10cc8f27..3f8f8ddff2 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -123,18 +123,28 @@ class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename ArrayTypes::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_rho; + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + + NonDupScatterView ndup_rho; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_fp; diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index 34b924e6e8..88e1475e9d 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -123,18 +123,28 @@ class PairEAMFSKokkos : public PairEAM, public KokkosBase { DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename ArrayTypes::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_rho; + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + + NonDupScatterView ndup_rho; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_fp; diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index 02eded90e3..86007aa914 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -120,18 +120,27 @@ class PairEAMKokkos : public PairEAM, public KokkosBase { DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename ArrayTypes::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_rho; + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_rho; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_fp; diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 65fffd58ad..2e2b24b662 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -65,19 +65,22 @@ struct PairComputeFunctor { typename AT::t_efloat_1d d_eatom; typename AT::t_virial_array d_vatom; + using KKDeviceType = typename KKDevice::value; + using DUP = typename NeedDup::value; + // The force array is atomic for Half/Thread neighbor style //Kokkos::View::value,Kokkos::MemoryTraits::value> > f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,typename NeedDup::value > dup_f; + KKScatterView dup_f; // The eatom and vatom arrays are atomic for Half/Thread neighbor style //Kokkos::View::value,Kokkos::MemoryTraits::value> > eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,typename NeedDup::value > dup_eatom; + KKScatterView dup_eatom; //Kokkos::View::value,Kokkos::MemoryTraits::value> > vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,typename NeedDup::value > dup_vatom; + KKScatterView dup_vatom; @@ -90,9 +93,9 @@ struct PairComputeFunctor { f = c.f; d_eatom = c.d_eatom; d_vatom = c.d_vatom; - dup_f = Kokkos::Experimental::create_scatter_view::value >(c.f); - dup_eatom = Kokkos::Experimental::create_scatter_view::value >(c.d_eatom); - dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); + dup_f = Kokkos::Experimental::create_scatter_view(c.f); + dup_eatom = Kokkos::Experimental::create_scatter_view(c.d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(c.d_vatom); }; // Set copymode = 1 so parent allocations aren't destructed by copies of the style diff --git a/src/KOKKOS/pair_reaxff_kokkos.h b/src/KOKKOS/pair_reaxff_kokkos.h index a88248a717..c74a35fab9 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.h +++ b/src/KOKKOS/pair_reaxff_kokkos.h @@ -387,25 +387,33 @@ class PairReaxFFKokkos : public PairReaxFF { typename AT::t_ffloat_2d_dl d_C1dbopi2, d_C2dbopi2, d_C3dbopi2, d_C4dbopi2; typename AT::t_ffloat_2d_dl d_Cdbo, d_Cdbopi, d_Cdbopi2, d_dDeltap_self; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_total_bo; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_CdDelta; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_dDeltap_self; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbo; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbopi; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbopi2; + using KKDeviceType = typename KKDevice::value; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_total_bo; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_CdDelta; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_dDeltap_self; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbo; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbopi; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbopi2; + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_total_bo; + DupScatterView dup_CdDelta; + DupScatterView dup_eatom; + DupScatterView dup_f; + DupScatterView dup_vatom; + DupScatterView dup_dDeltap_self; + DupScatterView dup_Cdbo; + DupScatterView dup_Cdbopi; + DupScatterView dup_Cdbopi2; + + NonDupScatterView ndup_total_bo; + NonDupScatterView ndup_CdDelta; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_vatom; + NonDupScatterView ndup_dDeltap_self; + NonDupScatterView ndup_Cdbo; + NonDupScatterView ndup_Cdbopi; + NonDupScatterView ndup_Cdbopi2; int need_dup; diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index e7af536782..7c5729c8d7 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -297,10 +297,20 @@ inline double dist2(double* x,double* y); typename AT::t_int_1d_randomread type; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_vatom; + + NonDupScatterView ndup_f; + NonDupScatterView ndup_vatom; friend void pair_virial_fdotr_compute(PairSNAPKokkos*); diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index 2192740674..27396decb0 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -136,12 +136,22 @@ class PairSWKokkos : public PairSW { typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; typename AT::t_int_1d_randomread d_type2frho; typename AT::t_int_2d_randomread d_type2rhor; diff --git a/src/KOKKOS/pair_tersoff_kokkos.h b/src/KOKKOS/pair_tersoff_kokkos.h index e61791df39..b177ce508d 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.h +++ b/src/KOKKOS/pair_tersoff_kokkos.h @@ -196,16 +196,26 @@ class PairTersoffKokkos : public PairTersoff { DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename ArrayTypes::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; typedef Kokkos::DualView tdual_ffloat_2d_n7; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.h b/src/KOKKOS/pair_tersoff_mod_kokkos.h index ee589c62cd..15405e971a 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.h +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.h @@ -181,6 +181,8 @@ class PairTersoffMODKokkos : public PairTersoffMOD { void setup_params(); protected: + using KKDeviceType = typename KKDevice::value; + typedef Kokkos::DualView tdual_int_3d; Kokkos::DualView k_params; typename Kokkos::DualView::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; typedef Kokkos::DualView tdual_ffloat_2d_n7; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.h b/src/KOKKOS/pair_tersoff_zbl_kokkos.h index 718932026d..9844bbbe5d 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.h +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.h @@ -201,24 +201,34 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename ArrayTypes::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; typedef Kokkos::DualView tdual_ffloat_2d_n7; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; typedef typename tdual_ffloat_2d_n7::t_host t_host_ffloat_2d_n7; - typename ArrayTypes::t_neighbors_2d d_neighbors; - typename ArrayTypes::t_int_1d_randomread d_ilist; - typename ArrayTypes::t_int_1d_randomread d_numneigh; + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; //NeighListKokkos k_list; int neighflag,newton_pair; diff --git a/src/KOKKOS/sna_kokkos.h b/src/KOKKOS/sna_kokkos.h index 0bcb07285c..c33f5e486e 100644 --- a/src/KOKKOS/sna_kokkos.h +++ b/src/KOKKOS/sna_kokkos.h @@ -69,9 +69,11 @@ public: using complex = SNAComplex; static constexpr int vector_length = vector_length_; + using KKDeviceType = typename KKDevice::value; + typedef Kokkos::View t_sna_1i; typedef Kokkos::View t_sna_1d; - typedef Kokkos::View::value, Kokkos::MemoryTraits > t_sna_1d_atomic; + typedef Kokkos::View> t_sna_1d_atomic; typedef Kokkos::View t_sna_2i; typedef Kokkos::View t_sna_2d; typedef Kokkos::View t_sna_2d_ll; @@ -83,7 +85,7 @@ public: typedef Kokkos::View t_sna_5d; typedef Kokkos::View t_sna_1c; - typedef Kokkos::View::value, Kokkos::MemoryTraits > t_sna_1c_atomic; + typedef Kokkos::View> t_sna_1c_atomic; typedef Kokkos::View t_sna_2c; typedef Kokkos::View t_sna_2c_ll; typedef Kokkos::View t_sna_2c_lr; From 120662c438be8bb5fa8da37543426c7458ac3945 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 26 Jan 2022 10:45:30 -0500 Subject: [PATCH 099/174] correct citation info --- src/MC/fix_bond_swap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 5f7ffcbbe5..c0978f51cb 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -39,7 +39,7 @@ using namespace LAMMPS_NS; using namespace FixConst; static const char cite_fix_bond_swap[] = - "neighbor multi command:\n\n" + "fix bond/swap command:\n\n" "@Article{Auhl03,\n" " author = {R. Auhl, R. Everaers, G. S. Grest, K. Kremer, S. J. Plimpton},\n" " title = {Equilibration of long chain polymer melts in computer simulations},\n" From 8ca1004c03d527b6ba827436161ae45ddd45fb11 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 26 Jan 2022 10:45:46 -0500 Subject: [PATCH 100/174] cosmetic. align with clang-format --- src/RIGID/fix_rigid_small.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 14742155db..cbaef073da 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -220,7 +220,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"infile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); - delete [] inpfile; + delete[] inpfile; inpfile = utils::strdup(arg[iarg+1]); restart_file = 1; reinitflag = 0; @@ -327,7 +327,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"all") == 0) allremap = 1; else { allremap = 0; - delete [] id_dilate; + delete[] id_dilate; id_dilate = utils::strdup(arg[iarg+1]); int idilate = group->find(id_dilate); if (idilate == -1) @@ -354,7 +354,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"gravity") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); - delete [] id_gravity; + delete[] id_gravity; id_gravity = utils::strdup(arg[iarg+1]); iarg += 2; @@ -395,7 +395,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : double time1 = platform::walltime(); create_bodies(bodyID); - if (customflag) delete [] bodyID; + if (customflag) delete[] bodyID; if (comm->me == 0) utils::logmesg(lmp," create bodies CPU = {:.3f} seconds\n", @@ -501,9 +501,9 @@ FixRigidSmall::~FixRigidSmall() memory->destroy(dorient); delete random; - delete [] inpfile; - delete [] id_dilate; - delete [] id_gravity; + delete[] inpfile; + delete[] id_dilate; + delete[] id_gravity; memory->destroy(langextra); memory->destroy(mass_body); @@ -2578,8 +2578,8 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) if (me == 0) fclose(fp); - delete [] buffer; - delete [] values; + delete[] buffer; + delete[] values; } /* ---------------------------------------------------------------------- From 71a373cadbf22214c3400d4312a72e59f9d07a2e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 26 Jan 2022 10:46:19 -0500 Subject: [PATCH 101/174] reshuffle Body struct members and add dummy for better alignment --- src/RIGID/fix_rigid_small.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/RIGID/fix_rigid_small.h b/src/RIGID/fix_rigid_small.h index e289c179d9..27076ccac3 100644 --- a/src/RIGID/fix_rigid_small.h +++ b/src/RIGID/fix_rigid_small.h @@ -84,8 +84,9 @@ class FixRigidSmall : public Fix { double maxextent; // furthest distance from body owner to body atom struct Body { - double mass; // total mass of body int natoms; // total number of atoms in body + int ilocal; // index of owning atom + double mass; // total mass of body double xcm[3]; // COM position double xgc[3]; // geometric center position double vcm[3]; // COM velocity @@ -97,12 +98,12 @@ class FixRigidSmall : public Fix { double ey_space[3]; double ez_space[3]; double xgc_body[3]; // geometric center relative to xcm in body coords - double angmom[3]; // space-frame angular momentum of body - double omega[3]; // space-frame omega of body - double conjqm[4]; // conjugate quaternion momentum - imageint image; // image flags of xcm - int remapflag[4]; // PBC remap flags - int ilocal; // index of owning atom + double angmom[3]; // space-frame angular momentum of body + double omega[3]; // space-frame omega of body + double conjqm[4]; // conjugate quaternion momentum + int remapflag[4]; // PBC remap flags + imageint image; // image flags of xcm + imageint dummy; // dummy entry for better alignment }; Body *body; // list of rigid bodies, owned and ghost From d861dbe8e0635d40cd475092609885467b1e01f9 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 26 Jan 2022 11:37:53 -0500 Subject: [PATCH 102/174] Remove unused variable --- src/KOKKOS/memory_kokkos.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 58c3c08e2a..1134e627ca 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -172,13 +172,11 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; array = (typename TYPE::value_type **) smalloc(nbytes,name); - bigint n = 0; for (int i = 0; i < n1; i++) { if (n2==0) array[i] = nullptr; else array[i] = &data.h_view(i,0); - n += n2; } return data; } @@ -193,13 +191,11 @@ template bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; array = (typename TYPE::value_type **) smalloc(nbytes,name); - bigint n = 0; for (int i = 0; i < n1; i++) { if (n2==0) array[i] = nullptr; else array[i] = &h_data(i,0); - n += n2; } return data; } From 9b6bb00d07e938ce69e683734a74e52dfe620a01 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Wed, 26 Jan 2022 19:20:34 +0000 Subject: [PATCH 103/174] Added unit test for atom_style oxdna --- unittest/formats/test_atom_styles.cpp | 444 ++++++++++++++++++++++++++ 1 file changed, 444 insertions(+) diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index 59c0e1350c..5076e92ca3 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -4809,6 +4809,450 @@ TEST_F(AtomStyleTest, property_atom) EXPECT_NEAR(three[GETIDX(2)], 0.5, EPSILON); } +TEST_F(AtomStyleTest, oxdna) +{ + if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP(); + if (!LAMMPS::is_installed_pkg("ASPHERE")) GTEST_SKIP(); + if (!LAMMPS::is_installed_pkg("CG-DNA")) GTEST_SKIP(); + + BEGIN_HIDE_OUTPUT(); + command("atom_style hybrid bond ellipsoid oxdna"); + END_HIDE_OUTPUT(); + + AtomState expected; + expected.atom_style = "hybrid"; + expected.molecular = Atom::MOLECULAR; + expected.tag_enable = 1; + expected.molecule_flag = 1; + expected.ellipsoid_flag = 1; + expected.rmass_flag = 1; + expected.torque_flag = 1; + expected.angmom_flag = 1; + expected.has_type = true; + expected.has_mask = true; + expected.has_image = true; + expected.has_x = true; + expected.has_v = true; + expected.has_f = true; + expected.has_bonds = true; + expected.has_nspecial = true; + expected.has_special = true; + expected.map_style = 3; + + ASSERT_ATOM_STATE_EQ(lmp->atom, expected); + + auto hybrid = (AtomVecHybrid *)lmp->atom->avec; + ASSERT_THAT(std::string(lmp->atom->atom_style), Eq("hybrid")); + ASSERT_EQ(hybrid->nstyles, 3); + ASSERT_THAT(std::string(hybrid->keywords[0]), Eq("bond")); + ASSERT_THAT(std::string(hybrid->keywords[1]), Eq("ellipsoid")); + ASSERT_THAT(std::string(hybrid->keywords[2]), Eq("oxdna")); + ASSERT_NE(hybrid->styles[0], nullptr); + ASSERT_NE(hybrid->styles[1], nullptr); + ASSERT_NE(hybrid->styles[2], nullptr); + + BEGIN_HIDE_OUTPUT(); + command("units lj"); + command("dimension 3"); + command("newton on"); + command("boundary p p p"); + command("atom_modify sort 0 1.0"); + command("neighbor 2.0 bin"); + command("neigh_modify every 1 delay 0 check yes"); + command("region mybox block -20 20 -20 20 -20 20"); + command("create_box 4 mybox bond/types 1 extra/bond/per/atom 2 extra/special/per/atom 4"); + command("create_atoms 1 single -0.33741452300167507 -0.43708835412476305 0.6450685042019271"); + command("create_atoms 2 single -0.32142606102826937 -0.7137743037592722 1.1817366147004618"); + command("create_atoms 3 single -0.130363628207774 -0.9147144801536078 1.62581312195109"); + command("create_atoms 4 single 0.16795127962282844 -0.9808507459807022 2.0894908590909003"); + command("create_atoms 1 single 0.46370423490634166 -0.7803347954883079 2.4251986815515827"); + command("create_atoms 4 single -0.4462950185476711 0.09062163051035639 2.4668941268777607"); + command("create_atoms 1 single -0.03377054097560965 0.20979847489755046 2.078208732038921"); + command("create_atoms 2 single 0.3297325391466579 0.17657587120899895 1.7206328374934152"); + command("create_atoms 3 single 0.6063699309305985 0.04682595158675571 1.2335049647817748"); + command("create_atoms 4 single 0.8003979559814726 -0.364393011459011 0.9884025318908612"); + command("set type 1 mass 3.1575"); + command("set type 2 mass 3.1575"); + command("set type 3 mass 3.1575"); + command("set type 4 mass 3.1575"); + command("mass 1 3.1575"); + command("mass 2 3.1575"); + command("mass 3 3.1575"); + command("mass 4 3.1575"); + command("set atom 1 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 2 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 3 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 4 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 5 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 6 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 7 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 8 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 9 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 10 shape 1.173984503142341 1.173984503142341 1.173984503142341"); + command("set atom 1 quat 0.120438343611269 -0.970540441176996 0.208676441957758 16.990727782866998"); + command("set atom 2 quat 0.122039415796829 -0.068232256412985 0.990177125658213 40.001729435287870"); + command("set atom 3 quat 0.052760168698289 0.030943512185297 0.998127679033382 69.627682451632380"); + command("set atom 4 quat -0.037622918613871 0.030623545471522 0.998822664169035 97.038820280300570"); + command("set atom 5 quat 0.055056042946138 0.077631917807377 0.995460756369964 137.7813218321917"); + command("set atom 6 quat 0.931128471673637 -0.355724722922553 -0.080372201291206 166.2836226291888"); + command("set atom 7 quat 0.753526078198930 -0.648440397941919 0.108275111595674 200.6802564250672"); + command("set atom 8 quat 0.553942138074214 -0.829580511279186 0.070315595507185 192.0355407659524"); + command("set atom 9 quat -0.373540155765431 0.913070802138105 -0.163613759548524 171.0789308260751"); + command("set atom 10 quat 0.027515673832457 0.998248649922676 -0.052369080773879 161.2621224558284"); + command("bond_style oxdna2/fene"); + command("bond_coeff * 2.0 0.25 0.7564"); + command("special_bonds lj 0 1 1"); + command("create_bonds single/bond 1 1 2"); + command("create_bonds single/bond 1 2 3"); + command("create_bonds single/bond 1 3 4"); + command("create_bonds single/bond 1 4 5"); + command("create_bonds single/bond 1 6 7"); + command("create_bonds single/bond 1 7 8"); + command("create_bonds single/bond 1 8 9"); + command("create_bonds single/bond 1 9 10"); + command("pair_style hybrid/overlay oxdna2/excv oxdna2/stk oxdna2/hbond oxdna2/xstk oxdna2/coaxstk oxdna2/dh"); + command("pair_coeff * * oxdna2/excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32"); + command("pair_coeff * * oxdna2/stk seqdep 0.1 1.3523 2.6717 6.0 0.4 0.9 0.32 0.75 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65"); + command("pair_coeff * * oxdna2/hbond seqdep 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff 1 4 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff 2 3 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff * * oxdna2/xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68"); + command("pair_coeff * * oxdna2/coaxstk 58.5 0.4 0.6 0.22 0.58 2.0 2.891592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 40.0 3.116592653589793"); + command("pair_coeff * * oxdna2/dh 0.1 0.2 0.815"); + END_HIDE_OUTPUT(); + + ASSERT_THAT(std::string(lmp->atom->atom_style), Eq("hybrid")); + ASSERT_NE(lmp->atom->avec, nullptr); + ASSERT_EQ(lmp->atom->natoms, 10); + ASSERT_EQ(lmp->atom->nbonds, 8); + ASSERT_EQ(lmp->atom->nbondtypes, 1); + ASSERT_EQ(lmp->atom->nellipsoids, 10); + ASSERT_EQ(lmp->atom->nlocal, 10); + ASSERT_EQ(lmp->atom->nghost, 0); + ASSERT_NE(lmp->atom->nmax, -1); + ASSERT_EQ(lmp->atom->tag_enable, 1); + ASSERT_EQ(lmp->atom->molecular, Atom::MOLECULAR); + ASSERT_EQ(lmp->atom->ntypes, 4); + ASSERT_EQ(lmp->atom->nextra_grow, 0); + ASSERT_EQ(lmp->atom->nextra_restart, 0); + ASSERT_EQ(lmp->atom->nextra_border, 0); + ASSERT_EQ(lmp->atom->nextra_grow_max, 0); + ASSERT_EQ(lmp->atom->nextra_restart_max, 0); + ASSERT_EQ(lmp->atom->nextra_border_max, 0); + ASSERT_EQ(lmp->atom->nextra_store, 0); + ASSERT_EQ(lmp->atom->extra_grow, nullptr); + ASSERT_EQ(lmp->atom->extra_restart, nullptr); + ASSERT_EQ(lmp->atom->extra_border, nullptr); + ASSERT_EQ(lmp->atom->extra, nullptr); + ASSERT_NE(lmp->atom->mass, nullptr); + ASSERT_NE(lmp->atom->rmass, nullptr); + ASSERT_EQ(lmp->atom->ellipsoid_flag, 1); + ASSERT_NE(lmp->atom->ellipsoid, nullptr); + ASSERT_NE(lmp->atom->mass_setflag, nullptr); + ASSERT_NE(lmp->atom->id5p, nullptr); + + BEGIN_HIDE_OUTPUT(); + command("write_data test_atom_styles.data nocoeff"); + command("clear"); + command("units lj"); + command("dimension 3"); + command("newton on"); + command("boundary p p p"); + command("atom_style hybrid bond ellipsoid oxdna"); + command("atom_modify sort 0 1.0"); + command("neighbor 2.0 bin"); + command("neigh_modify every 1 delay 0 check yes"); + command("read_data test_atom_styles.data"); + command("set type 1 mass 3.1575"); + command("set type 2 mass 3.1575"); + command("set type 3 mass 3.1575"); + command("set type 4 mass 3.1575"); + command("mass 1 3.1575"); + command("mass 2 3.1575"); + command("mass 3 3.1575"); + command("mass 4 3.1575"); + command("bond_style oxdna2/fene"); + command("bond_coeff * 2.0 0.25 0.7564"); + command("special_bonds lj 0 1 1"); + command("pair_style hybrid/overlay oxdna2/excv oxdna2/stk oxdna2/hbond oxdna2/xstk oxdna2/coaxstk oxdna2/dh"); + command("pair_coeff * * oxdna2/excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32"); + command("pair_coeff * * oxdna2/stk seqdep 0.1 1.3523 2.6717 6.0 0.4 0.9 0.32 0.75 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65"); + command("pair_coeff * * oxdna2/hbond seqdep 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff 1 4 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff 2 3 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff * * oxdna2/xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68"); + command("pair_coeff * * oxdna2/coaxstk 58.5 0.4 0.6 0.22 0.58 2.0 2.891592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 40.0 3.116592653589793"); + command("pair_coeff * * oxdna2/dh 0.1 0.2 0.815"); + + ASSERT_THAT(std::string(lmp->atom->atom_style), Eq("hybrid")); + ASSERT_NE(lmp->atom->avec, nullptr); + hybrid = (AtomVecHybrid *)lmp->atom->avec; + + ASSERT_EQ(hybrid->nstyles, 3); + ASSERT_THAT(std::string(hybrid->keywords[0]), Eq("bond")); + ASSERT_THAT(std::string(hybrid->keywords[1]), Eq("ellipsoid")); + ASSERT_THAT(std::string(hybrid->keywords[2]), Eq("oxdna")); + ASSERT_NE(hybrid->styles[0], nullptr); + ASSERT_NE(hybrid->styles[1], nullptr); + ASSERT_NE(hybrid->styles[2], nullptr); + + ASSERT_EQ(lmp->atom->natoms, 10); + ASSERT_EQ(lmp->atom->nbonds, 8); + ASSERT_EQ(lmp->atom->nbondtypes, 1); + ASSERT_EQ(lmp->atom->nellipsoids, 10); + ASSERT_EQ(lmp->atom->nlocal, 10); + ASSERT_EQ(lmp->atom->nghost, 0); + ASSERT_NE(lmp->atom->nmax, -1); + ASSERT_EQ(lmp->atom->tag_enable, 1); + ASSERT_EQ(lmp->atom->molecular, Atom::MOLECULAR); + ASSERT_EQ(lmp->atom->ntypes, 4); + ASSERT_EQ(lmp->atom->nextra_grow, 0); + ASSERT_EQ(lmp->atom->nextra_restart, 0); + ASSERT_EQ(lmp->atom->nextra_border, 0); + ASSERT_EQ(lmp->atom->nextra_grow_max, 0); + ASSERT_EQ(lmp->atom->nextra_restart_max, 0); + ASSERT_EQ(lmp->atom->nextra_border_max, 0); + ASSERT_EQ(lmp->atom->nextra_store, 0); + ASSERT_EQ(lmp->atom->extra_grow, nullptr); + ASSERT_EQ(lmp->atom->extra_restart, nullptr); + ASSERT_EQ(lmp->atom->extra_border, nullptr); + ASSERT_EQ(lmp->atom->extra, nullptr); + ASSERT_NE(lmp->atom->mass, nullptr); + ASSERT_NE(lmp->atom->rmass, nullptr); + ASSERT_EQ(lmp->atom->ellipsoid_flag, 1); + ASSERT_NE(lmp->atom->ellipsoid, nullptr); + ASSERT_NE(lmp->atom->mass_setflag, nullptr); + ASSERT_NE(lmp->atom->id5p, nullptr); + + auto x = lmp->atom->x; + auto v = lmp->atom->v; + auto type = lmp->atom->type; + auto ellipsoid = lmp->atom->ellipsoid; + auto rmass = lmp->atom->rmass; + + auto avec = (AtomVecEllipsoid *)hybrid->styles[1]; + auto bonus = avec->bonus; + + EXPECT_NEAR(x[GETIDX(1)][0], -0.33741452300167507, EPSILON); + EXPECT_NEAR(x[GETIDX(1)][1], -0.43708835412476305, EPSILON); + EXPECT_NEAR(x[GETIDX(1)][2], 0.6450685042019271, EPSILON); + EXPECT_NEAR(x[GETIDX(2)][0], -0.32142606102826937, EPSILON); + EXPECT_NEAR(x[GETIDX(2)][1], -0.7137743037592722, EPSILON); + EXPECT_NEAR(x[GETIDX(2)][2], 1.1817366147004618, EPSILON); + EXPECT_NEAR(x[GETIDX(3)][0], -0.130363628207774, EPSILON); + EXPECT_NEAR(x[GETIDX(3)][1], -0.9147144801536078, EPSILON); + EXPECT_NEAR(x[GETIDX(3)][2], 1.62581312195109, EPSILON); + EXPECT_NEAR(x[GETIDX(4)][0], 0.16795127962282844, EPSILON); + EXPECT_NEAR(x[GETIDX(4)][1], -0.9808507459807022, EPSILON); + EXPECT_NEAR(x[GETIDX(4)][2], 2.0894908590909003, EPSILON); + EXPECT_NEAR(x[GETIDX(5)][0], 0.46370423490634166, EPSILON); + EXPECT_NEAR(x[GETIDX(5)][1], -0.7803347954883079, EPSILON); + EXPECT_NEAR(x[GETIDX(5)][2], 2.4251986815515827, EPSILON); + EXPECT_NEAR(x[GETIDX(6)][0], -0.4462950185476711, EPSILON); + EXPECT_NEAR(x[GETIDX(6)][1], 0.09062163051035639, EPSILON); + EXPECT_NEAR(x[GETIDX(6)][2], 2.4668941268777607, EPSILON); + EXPECT_NEAR(x[GETIDX(7)][0], -0.03377054097560965, EPSILON); + EXPECT_NEAR(x[GETIDX(7)][1], 0.20979847489755046, EPSILON); + EXPECT_NEAR(x[GETIDX(7)][2], 2.078208732038921, EPSILON); + EXPECT_NEAR(x[GETIDX(8)][0], 0.3297325391466579, EPSILON); + EXPECT_NEAR(x[GETIDX(8)][1], 0.17657587120899895, EPSILON); + EXPECT_NEAR(x[GETIDX(8)][2], 1.7206328374934152, EPSILON); + EXPECT_NEAR(x[GETIDX(9)][0], 0.6063699309305985, EPSILON); + EXPECT_NEAR(x[GETIDX(9)][1], 0.04682595158675571, EPSILON); + EXPECT_NEAR(x[GETIDX(9)][2], 1.2335049647817748, EPSILON); + EXPECT_NEAR(x[GETIDX(10)][0], 0.8003979559814726, EPSILON); + EXPECT_NEAR(x[GETIDX(10)][1], -0.364393011459011, EPSILON); + EXPECT_NEAR(x[GETIDX(10)][2], 0.9884025318908612, EPSILON); + + EXPECT_NEAR(v[GETIDX(1)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(1)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(1)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(2)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(2)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(2)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(3)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(3)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(3)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(4)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(4)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(4)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(5)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(5)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(5)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(6)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(6)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(6)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(7)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(7)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(7)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(8)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(8)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(8)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(9)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(9)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(9)][2], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(10)][0], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(10)][1], 0.0, EPSILON); + EXPECT_NEAR(v[GETIDX(10)][2], 0.0, EPSILON); + + ASSERT_EQ(type[GETIDX(1)], 1); + ASSERT_EQ(type[GETIDX(2)], 2); + ASSERT_EQ(type[GETIDX(3)], 3); + ASSERT_EQ(type[GETIDX(4)], 4); + ASSERT_EQ(type[GETIDX(5)], 1); + ASSERT_EQ(type[GETIDX(6)], 4); + ASSERT_EQ(type[GETIDX(7)], 1); + ASSERT_EQ(type[GETIDX(8)], 2); + ASSERT_EQ(type[GETIDX(9)], 3); + ASSERT_EQ(type[GETIDX(10)], 4); + + ASSERT_EQ(ellipsoid[GETIDX(1)], 0); + ASSERT_EQ(ellipsoid[GETIDX(2)], 1); + ASSERT_EQ(ellipsoid[GETIDX(3)], 2); + ASSERT_EQ(ellipsoid[GETIDX(4)], 3); + ASSERT_EQ(ellipsoid[GETIDX(5)], 4); + ASSERT_EQ(ellipsoid[GETIDX(6)], 5); + ASSERT_EQ(ellipsoid[GETIDX(7)], 6); + ASSERT_EQ(ellipsoid[GETIDX(8)], 7); + ASSERT_EQ(ellipsoid[GETIDX(9)], 8); + ASSERT_EQ(ellipsoid[GETIDX(10)], 9); + + EXPECT_NEAR(rmass[GETIDX(1)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(2)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(3)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(4)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(5)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(6)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(7)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(8)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(9)], 3.1575, EPSILON); + EXPECT_NEAR(rmass[GETIDX(10)], 3.1575, EPSILON); + + EXPECT_NEAR(bonus[0].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[0].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[0].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[1].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[1].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[1].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[2].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[2].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[2].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[3].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[3].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[3].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[4].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[4].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[4].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[5].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[5].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[5].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[6].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[6].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[6].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[7].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[7].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[7].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[8].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[8].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[8].shape[2], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[9].shape[0], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[9].shape[1], 0.5869922515711705, EPSILON); + EXPECT_NEAR(bonus[9].shape[2], 0.5869922515711705, EPSILON); + + EXPECT_NEAR(bonus[0].quat[0], 0.9890278201757743, EPSILON); + EXPECT_NEAR(bonus[0].quat[1], 0.01779228232037064, EPSILON); + EXPECT_NEAR(bonus[0].quat[2], -0.14337734159225404, EPSILON); + EXPECT_NEAR(bonus[0].quat[3], 0.030827642240801516, EPSILON); + EXPECT_NEAR(bonus[1].quat[0], 0.939687458852748, EPSILON); + EXPECT_NEAR(bonus[1].quat[1], 0.04174166924055095, EPSILON); + EXPECT_NEAR(bonus[1].quat[2], -0.023337773785056866, EPSILON); + EXPECT_NEAR(bonus[1].quat[3], 0.338674565089608, EPSILON); + EXPECT_NEAR(bonus[2].quat[0], 0.8210113150655425, EPSILON); + EXPECT_NEAR(bonus[2].quat[1], 0.03012140921736572, EPSILON); + EXPECT_NEAR(bonus[2].quat[2], 0.017666019956944813, EPSILON); + EXPECT_NEAR(bonus[2].quat[3], 0.5698429897612057, EPSILON); + EXPECT_NEAR(bonus[3].quat[0], 0.6623662858285051, EPSILON); + EXPECT_NEAR(bonus[3].quat[1], -0.028186343967346823, EPSILON); + EXPECT_NEAR(bonus[3].quat[2], 0.022942552517501488, EPSILON); + EXPECT_NEAR(bonus[3].quat[3], 0.7482981175276918, EPSILON); + EXPECT_NEAR(bonus[4].quat[0], 0.3601488726765216, EPSILON); + EXPECT_NEAR(bonus[4].quat[1], 0.0513614985821682, EPSILON); + EXPECT_NEAR(bonus[4].quat[2], 0.0724224158335286, EPSILON); + EXPECT_NEAR(bonus[4].quat[3], 0.9286602067807472, EPSILON); + EXPECT_NEAR(bonus[5].quat[0], 0.11941234710084649, EPSILON); + EXPECT_NEAR(bonus[5].quat[1], 0.9244660117493703, EPSILON); + EXPECT_NEAR(bonus[5].quat[2], -0.35317942248051865, EPSILON); + EXPECT_NEAR(bonus[5].quat[3], -0.07979711784524246, EPSILON); + EXPECT_NEAR(bonus[6].quat[0], -0.17949125421205164, EPSILON); + EXPECT_NEAR(bonus[6].quat[1], 0.7412884899431119, EPSILON); + EXPECT_NEAR(bonus[6].quat[2], -0.6379094464220707, EPSILON); + EXPECT_NEAR(bonus[6].quat[3], 0.1065166771202199, EPSILON); + EXPECT_NEAR(bonus[7].quat[0], -0.10483691088405202, EPSILON); + EXPECT_NEAR(bonus[7].quat[1], 0.5508895999584645, EPSILON); + EXPECT_NEAR(bonus[7].quat[2], -0.8250090480220789, EPSILON); + EXPECT_NEAR(bonus[7].quat[3], 0.06992811634525403, EPSILON); + EXPECT_NEAR(bonus[8].quat[0], 0.07777239911646, EPSILON); + EXPECT_NEAR(bonus[8].quat[1], -0.3724087549185288, EPSILON); + EXPECT_NEAR(bonus[8].quat[2], 0.9103052384821374, EPSILON); + EXPECT_NEAR(bonus[8].quat[3], -0.1631181963720798, EPSILON); + EXPECT_NEAR(bonus[9].quat[0], 0.16279109707978262, EPSILON); + EXPECT_NEAR(bonus[9].quat[1], 0.027148630125149613, EPSILON); + EXPECT_NEAR(bonus[9].quat[2], 0.9849325709665359, EPSILON); + EXPECT_NEAR(bonus[9].quat[3], -0.0516705065113425, EPSILON); + + auto num_bond = lmp->atom->num_bond; + auto bond_type = lmp->atom->bond_type; + auto bond_atom = lmp->atom->bond_atom; + auto id5p = lmp->atom->id5p; + + ASSERT_EQ(num_bond[GETIDX(1)], 1); + ASSERT_EQ(num_bond[GETIDX(2)], 1); + ASSERT_EQ(num_bond[GETIDX(3)], 1); + ASSERT_EQ(num_bond[GETIDX(4)], 1); + ASSERT_EQ(num_bond[GETIDX(5)], 0); + ASSERT_EQ(num_bond[GETIDX(6)], 1); + ASSERT_EQ(num_bond[GETIDX(7)], 1); + ASSERT_EQ(num_bond[GETIDX(8)], 1); + ASSERT_EQ(num_bond[GETIDX(9)], 1); + ASSERT_EQ(num_bond[GETIDX(10)], 0); + + ASSERT_EQ(bond_type[GETIDX(1)][0], 1); + ASSERT_EQ(bond_type[GETIDX(2)][0], 1); + ASSERT_EQ(bond_type[GETIDX(3)][0], 1); + ASSERT_EQ(bond_type[GETIDX(4)][0], 1); + ASSERT_EQ(bond_type[GETIDX(5)][0], 0); + ASSERT_EQ(bond_type[GETIDX(6)][0], 1); + ASSERT_EQ(bond_type[GETIDX(7)][0], 1); + ASSERT_EQ(bond_type[GETIDX(8)][0], 1); + ASSERT_EQ(bond_type[GETIDX(9)][0], 1); + ASSERT_EQ(bond_type[GETIDX(10)][0], 0); + + ASSERT_EQ(bond_atom[GETIDX(1)][0], 2); + ASSERT_EQ(bond_atom[GETIDX(2)][0], 3); + ASSERT_EQ(bond_atom[GETIDX(3)][0], 4); + ASSERT_EQ(bond_atom[GETIDX(4)][0], 5); + ASSERT_EQ(bond_atom[GETIDX(5)][0], 0); + ASSERT_EQ(bond_atom[GETIDX(6)][0], 7); + ASSERT_EQ(bond_atom[GETIDX(7)][0], 8); + ASSERT_EQ(bond_atom[GETIDX(8)][0], 9); + ASSERT_EQ(bond_atom[GETIDX(9)][0], 10); + ASSERT_EQ(bond_atom[GETIDX(10)][0], 0); + + ASSERT_EQ(id5p[GETIDX(1)], 2); + ASSERT_EQ(id5p[GETIDX(2)], 3); + ASSERT_EQ(id5p[GETIDX(3)], 4); + ASSERT_EQ(id5p[GETIDX(4)], 5); + ASSERT_EQ(id5p[GETIDX(5)], -1); + ASSERT_EQ(id5p[GETIDX(6)], 7); + ASSERT_EQ(id5p[GETIDX(7)], 8); + ASSERT_EQ(id5p[GETIDX(8)], 9); + ASSERT_EQ(id5p[GETIDX(9)], 10); + ASSERT_EQ(id5p[GETIDX(10)], -1); + + END_HIDE_OUTPUT(); + +} + } // namespace LAMMPS_NS int main(int argc, char **argv) From b3647d8e9427f0de9276f08c3ebe62268838a1b3 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 26 Jan 2022 16:16:53 -0500 Subject: [PATCH 104/174] Add missing override keywords --- src/KOKKOS/fix_reaxff_bonds_kokkos.h | 4 ++-- src/KOKKOS/fix_reaxff_species_kokkos.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KOKKOS/fix_reaxff_bonds_kokkos.h b/src/KOKKOS/fix_reaxff_bonds_kokkos.h index 3d9aa7d3d9..b104bceeef 100644 --- a/src/KOKKOS/fix_reaxff_bonds_kokkos.h +++ b/src/KOKKOS/fix_reaxff_bonds_kokkos.h @@ -40,8 +40,8 @@ class FixReaxFFBondsKokkos : public FixReaxFFBonds { private: int nbuf; - void Output_ReaxFF_Bonds(); - double memory_usage(); + void Output_ReaxFF_Bonds() override; + double memory_usage() override; }; } diff --git a/src/KOKKOS/fix_reaxff_species_kokkos.h b/src/KOKKOS/fix_reaxff_species_kokkos.h index 7d463940da..741365fd5f 100644 --- a/src/KOKKOS/fix_reaxff_species_kokkos.h +++ b/src/KOKKOS/fix_reaxff_species_kokkos.h @@ -40,7 +40,7 @@ class FixReaxFFSpeciesKokkos : public FixReaxFFSpecies { void init() override; private: - void FindMolecule(); + void FindMolecule() override; }; } From 62ff23abe7c202b2ff82bd337b2d484145cf5fe8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 27 Jan 2022 15:59:48 -0500 Subject: [PATCH 105/174] simplify building serial executables by incorporating the STUBS/mpi.o object in LAMMPS library --- cmake/CMakeLists.txt | 23 +++-------------------- cmake/Modules/Packages/GPU.cmake | 4 ++-- unittest/force-styles/CMakeLists.txt | 2 -- unittest/fortran/mpi_stubs.f90 | 2 +- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 408528f6dd..62507dd29a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -290,25 +290,8 @@ if(BUILD_MPI) endif() endif() else() - file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) - add_library(mpi_stubs STATIC ${MPI_SOURCES}) - set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE}) - target_include_directories(mpi_stubs PUBLIC $) - if(BUILD_SHARED_LIBS) - target_link_libraries(lammps PRIVATE mpi_stubs) - if(MSVC) - target_link_libraries(lmp PRIVATE mpi_stubs) - target_include_directories(lmp INTERFACE $) - target_compile_definitions(lmp INTERFACE $) - endif() - target_include_directories(lammps INTERFACE $) - target_compile_definitions(lammps INTERFACE $) - else() - target_include_directories(lammps INTERFACE $) - target_compile_definitions(lammps INTERFACE $) - target_link_libraries(lammps PUBLIC mpi_stubs) - endif() - add_library(MPI::MPI_CXX ALIAS mpi_stubs) + target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) + target_include_directories(lammps PUBLIC ${LAMMPS_SOURCE_DIR}/STUBS) endif() 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)") @@ -594,7 +577,7 @@ if(PKG_ATC) if(BUILD_MPI) target_link_libraries(atc PRIVATE MPI::MPI_CXX) else() - target_link_libraries(atc PRIVATE mpi_stubs) + target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS) endif() target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}) target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES}) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 048c0ed473..863265250d 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -424,8 +424,8 @@ RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) if(NOT BUILD_MPI) - # mpistubs is aliased to MPI::MPI_CXX, but older versions of cmake won't work forward the include path - target_link_libraries(gpu PRIVATE mpi_stubs) + # add include include path to MPI STUBS for non-MPI build + target_include_directories(gpu PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS) else() target_link_libraries(gpu PRIVATE MPI::MPI_CXX) endif() diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 464cd9426a..fd794bd8d7 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -48,8 +48,6 @@ target_include_directories(style_tests PRIVATE ${LAMMPS_SOURCE_DIR}) target_link_libraries(style_tests PUBLIC gmock Yaml::Yaml lammps) if(BUILD_MPI) target_link_libraries(style_tests PUBLIC MPI::MPI_CXX) -else() - target_link_libraries(style_tests PUBLIC mpi_stubs) endif() # propagate sanitizer options to test tools if(ENABLE_SANITIZER AND (NOT (ENABLE_SANITIZER STREQUAL "none"))) diff --git a/unittest/fortran/mpi_stubs.f90 b/unittest/fortran/mpi_stubs.f90 index 3f87fc38f7..8601f436d2 100644 --- a/unittest/fortran/mpi_stubs.f90 +++ b/unittest/fortran/mpi_stubs.f90 @@ -9,7 +9,7 @@ MODULE MPI mpi_comm_split CONTAINS - + SUBROUTINE mpi_comm_split(comm,color,key,newcomm,ierr) INTEGER, INTENT(in) :: comm,color,key INTEGER, INTENT(out) :: newcomm,ierr From d391ae845bef545379894664371f7a93eb15841b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 27 Jan 2022 17:20:05 -0500 Subject: [PATCH 106/174] convert static class members with git info to functions to simplify auto-export on Windows --- cmake/Modules/generate_lmpgitversion.cmake | 8 ++--- src/Makefile | 8 ++--- src/info.cpp | 4 +-- src/lammps.cpp | 4 +-- src/lammps.h | 8 ++--- unittest/cplusplus/test_lammps_class.cpp | 42 +++++++++++----------- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/cmake/Modules/generate_lmpgitversion.cmake b/cmake/Modules/generate_lmpgitversion.cmake index b19716d74b..f066269723 100644 --- a/cmake/Modules/generate_lmpgitversion.cmake +++ b/cmake/Modules/generate_lmpgitversion.cmake @@ -24,10 +24,10 @@ if(GIT_FOUND AND EXISTS ${LAMMPS_DIR}/.git) OUTPUT_STRIP_TRAILING_WHITESPACE) endif() -set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n") -set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n") -set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n") -set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n") +set(temp "${temp}bool LAMMPS_NS::LAMMPS::has_git_info() { return ${temp_git_info}; }\n") +set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_commit() { return \"${temp_git_commit}\"; }\n") +set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_branch() { return \"${temp_git_branch}\"; }\n") +set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${temp_git_describe}\"; }\n") set(temp "${temp}#endif\n\n") message(STATUS "Generating lmpgitversion.h...") diff --git a/src/Makefile b/src/Makefile index d23058447a..eeccc19ae0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -356,10 +356,10 @@ gitversion: branch='(unknown)' ; \ describe='(unknown)' ; \ fi ; \ - echo "const bool LAMMPS_NS::LAMMPS::has_git_info = $${git};" >> ${TMPNAME}.lmpgitversion ; \ - echo "const char LAMMPS_NS::LAMMPS::git_commit[] = \"$${commit}\";" >> ${TMPNAME}.lmpgitversion ; \ - echo "const char LAMMPS_NS::LAMMPS::git_branch[] = \"$${branch}\";" >> ${TMPNAME}.lmpgitversion ; \ - echo "const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"$${describe}\";" >> ${TMPNAME}.lmpgitversion + echo "bool LAMMPS_NS::LAMMPS::has_git_info() { return $${git}; }" >> ${TMPNAME}.lmpgitversion ; \ + echo "const char *LAMMPS_NS::LAMMPS::git_commit() { return \"$${commit}\"; }" >> ${TMPNAME}.lmpgitversion ; \ + echo "const char *LAMMPS_NS::LAMMPS::git_branch() { return \"$${branch}\"; }" >> ${TMPNAME}.lmpgitversion ; \ + echo "const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"$${describe}\"; }" >> ${TMPNAME}.lmpgitversion @echo '#endif' >> ${TMPNAME}.lmpgitversion @if [ -f lmpgitversion.h ]; \ then test "`diff --brief ${TMPNAME}.lmpgitversion lmpgitversion.h`" != "" && \ diff --git a/src/info.cpp b/src/info.cpp index 297633cd9d..66430c6f4b 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -278,9 +278,9 @@ void Info::command(int narg, char **arg) fmt::print(out,"\nLAMMPS version: {} / {}\n", lmp->version, lmp->num_ver); - if (lmp->has_git_info) + if (lmp->has_git_info()) fmt::print(out,"Git info: {} / {} / {}\n", - lmp->git_branch, lmp->git_descriptor,lmp->git_commit); + lmp->git_branch(), lmp->git_descriptor(),lmp->git_commit()); fmt::print(out,"\nOS information: {}\n\n",platform::os_info()); diff --git a/src/lammps.cpp b/src/lammps.cpp index 55b7755c83..e6ff6efb23 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -1149,9 +1149,9 @@ void _noopt LAMMPS::help() // general help message about command line and flags - if (has_git_info) { + if (has_git_info()) { fprintf(fp,"\nLarge-scale Atomic/Molecular Massively Parallel Simulator - " - LAMMPS_VERSION UPDATE_STRING "\nGit info (%s / %s)\n\n",git_branch, git_descriptor); + LAMMPS_VERSION UPDATE_STRING "\nGit info (%s / %s)\n\n",git_branch(), git_descriptor()); } else { fprintf(fp,"\nLarge-scale Atomic/Molecular Massively Parallel Simulator - " LAMMPS_VERSION UPDATE_STRING "\n\n"); diff --git a/src/lammps.h b/src/lammps.h index 71b731204c..5ccc1a90a9 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -73,10 +73,10 @@ class LAMMPS { static const char *installed_packages[]; static bool is_installed_pkg(const char *pkg); - static const bool has_git_info; - static const char git_commit[]; - static const char git_branch[]; - static const char git_descriptor[]; + static bool has_git_info(); + static const char *git_commit(); + static const char *git_branch(); + static const char *git_descriptor(); LAMMPS(int, char **, MPI_Comm); ~LAMMPS(); diff --git a/unittest/cplusplus/test_lammps_class.cpp b/unittest/cplusplus/test_lammps_class.cpp index 3a1bde51ff..eb6735a738 100644 --- a/unittest/cplusplus/test_lammps_class.cpp +++ b/unittest/cplusplus/test_lammps_class.cpp @@ -90,14 +90,14 @@ TEST_F(LAMMPS_plain, InitMembers) EXPECT_EQ(lmp->memoryKK, nullptr); EXPECT_NE(lmp->python, nullptr); EXPECT_EQ(lmp->citeme, nullptr); - if (LAMMPS::has_git_info) { - EXPECT_STRNE(LAMMPS::git_commit, ""); - EXPECT_STRNE(LAMMPS::git_branch, ""); - EXPECT_STRNE(LAMMPS::git_descriptor, ""); + if (LAMMPS::has_git_info()) { + EXPECT_STRNE(LAMMPS::git_commit(), ""); + EXPECT_STRNE(LAMMPS::git_branch(), ""); + EXPECT_STRNE(LAMMPS::git_descriptor(), ""); } else { - EXPECT_STREQ(LAMMPS::git_commit, "(unknown)"); - EXPECT_STREQ(LAMMPS::git_branch, "(unknown)"); - EXPECT_STREQ(LAMMPS::git_descriptor, "(unknown)"); + EXPECT_STREQ(LAMMPS::git_commit(), "(unknown)"); + EXPECT_STREQ(LAMMPS::git_branch(), "(unknown)"); + EXPECT_STREQ(LAMMPS::git_descriptor(), "(unknown)"); } } @@ -225,14 +225,14 @@ TEST_F(LAMMPS_omp, InitMembers) EXPECT_EQ(lmp->memoryKK, nullptr); EXPECT_NE(lmp->python, nullptr); EXPECT_NE(lmp->citeme, nullptr); - if (LAMMPS::has_git_info) { - EXPECT_STRNE(LAMMPS::git_commit, ""); - EXPECT_STRNE(LAMMPS::git_branch, ""); - EXPECT_STRNE(LAMMPS::git_descriptor, ""); + if (LAMMPS::has_git_info()) { + EXPECT_STRNE(LAMMPS::git_commit(), ""); + EXPECT_STRNE(LAMMPS::git_branch(), ""); + EXPECT_STRNE(LAMMPS::git_descriptor(), ""); } else { - EXPECT_STREQ(LAMMPS::git_commit, "(unknown)"); - EXPECT_STREQ(LAMMPS::git_branch, "(unknown)"); - EXPECT_STREQ(LAMMPS::git_descriptor, "(unknown)"); + EXPECT_STREQ(LAMMPS::git_commit(), "(unknown)"); + EXPECT_STREQ(LAMMPS::git_branch(), "(unknown)"); + EXPECT_STREQ(LAMMPS::git_descriptor(), "(unknown)"); } } @@ -312,14 +312,14 @@ TEST_F(LAMMPS_kokkos, InitMembers) EXPECT_NE(lmp->memoryKK, nullptr); EXPECT_NE(lmp->python, nullptr); EXPECT_NE(lmp->citeme, nullptr); - if (LAMMPS::has_git_info) { - EXPECT_STRNE(LAMMPS::git_commit, ""); - EXPECT_STRNE(LAMMPS::git_branch, ""); - EXPECT_STRNE(LAMMPS::git_descriptor, ""); + if (LAMMPS::has_git_info()) { + EXPECT_STRNE(LAMMPS::git_commit(), ""); + EXPECT_STRNE(LAMMPS::git_branch(), ""); + EXPECT_STRNE(LAMMPS::git_descriptor(), ""); } else { - EXPECT_STREQ(LAMMPS::git_commit, "(unknown)"); - EXPECT_STREQ(LAMMPS::git_branch, "(unknown)"); - EXPECT_STREQ(LAMMPS::git_descriptor, "(unknown)"); + EXPECT_STREQ(LAMMPS::git_commit(), "(unknown)"); + EXPECT_STREQ(LAMMPS::git_branch(), "(unknown)"); + EXPECT_STREQ(LAMMPS::git_descriptor(), "(unknown)"); } } From 0bf941219fc3ec17306df6f7ba8d2b1b4c591c26 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 27 Jan 2022 17:21:50 -0500 Subject: [PATCH 107/174] silence compiler warnings --- src/atom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index aece451b9b..0b448a5433 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1052,7 +1052,7 @@ void Atom::deallocate_topology() void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, int type_offset, int shiftflag, double *shift) { - int m,xptr,iptr; + int xptr,iptr; imageint imagedata; double xdata[3],lamda[3]; double *coord; @@ -1197,7 +1197,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, void Atom::data_vels(int n, char *buf, tagint id_offset) { - int j,m; + int m; char *next; next = strchr(buf,'\n'); @@ -1576,7 +1576,7 @@ void Atom::data_impropers(int n, char *buf, int *count, tagint id_offset, void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset) { - int j,m; + int m; char *next; next = strchr(buf,'\n'); From cd8b674f4b1a5495fa8db458398db1c417a53cc6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 27 Jan 2022 17:46:18 -0500 Subject: [PATCH 108/174] expand path to include LAMMPS shared lib --- unittest/utils/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unittest/utils/CMakeLists.txt b/unittest/utils/CMakeLists.txt index 28486048c4..6a3a2efc8e 100644 --- a/unittest/utils/CMakeLists.txt +++ b/unittest/utils/CMakeLists.txt @@ -40,3 +40,8 @@ add_test(FmtLib test_fmtlib) add_executable(test_math_eigen_impl test_math_eigen_impl.cpp) target_include_directories(test_math_eigen_impl PRIVATE ${LAMMPS_SOURCE_DIR}) add_test(MathEigen test_math_eigen_impl 10 5) + +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set_tests_properties(Tokenizer MemPool ArgUtils Utils Platform FmtLib MathEigen PROPERTIES + ENVIRONMENT "PATH=${CMAKE_BINARY_DIR}:$ENV{PATH}") +endif() From e4fe0a37a155b0fbdc3c1bac9d0071dacc13528a Mon Sep 17 00:00:00 2001 From: tc387 Date: Thu, 27 Jan 2022 16:48:22 -0600 Subject: [PATCH 109/174] fixed ewald self-energy update and updated documentation --- doc/src/fix_charge_regulation.rst | 75 ++++++++++++++++++------------- src/MC/fix_charge_regulation.cpp | 14 ++++++ 2 files changed, 57 insertions(+), 32 deletions(-) diff --git a/doc/src/fix_charge_regulation.rst b/doc/src/fix_charge_regulation.rst index 9ff28b6ac3..947da74ec6 100644 --- a/doc/src/fix_charge_regulation.rst +++ b/doc/src/fix_charge_regulation.rst @@ -20,13 +20,13 @@ Syntax .. parsed-literal:: - keyword = *pH*, *pKa*, *pKb*, *pIp*, *pIm*, *pKs*, *acid_type*, *base_type*, *lunit_nm*, *temp*, *tempfixid*, *nevery*, *nmc*, *xrd*, *seed*, *tag*, *group*, *onlysalt*, *pmcmoves* + keyword = *pH*, *pKa*, *pKb*, *pIp*, *pIm*, *pKs*, *acid_type*, *base_type*, *lunit_nm*, *temp*, *tempfixid*, *nevery*, *nmc*, *rxd*, *seed*, *tag*, *group*, *onlysalt*, *pmcmoves* *pH* value = pH of the solution (can be specified as an equal-style variable) - *pKa* value = acid dissociation constant - *pKb* value = base dissociation constant - *pIp* value = chemical potential of free cations - *pIm* value = chemical potential of free anions - *pKs* value = solution self-dissociation constant + *pKa* value = acid dissociation constant (in the -log10 representation) + *pKb* value = base dissociation constant (in the -log10 representation) + *pIp* value = activity (effective concentration) of free cations (in the -log10 representation) + *pIm* value = activity (effective concentration) of free anions (in the -log10 representation) + *pKs* value = solvent self-dissociation constant (in the -log10 representation) *acid_type* = atom type of acid groups *base_type* = atom type of base groups *lunit_nm* value = unit length used by LAMMPS (# in the units of nanometers) @@ -34,7 +34,7 @@ Syntax *tempfixid* value = fix ID of temperature thermostat *nevery* value = invoke this fix every nevery steps *nmc* value = number of charge regulation MC moves to attempt every nevery steps - *xrd* value = cutoff distance for acid/base reaction + *rxd* value = cutoff distance for acid/base reaction *seed* value = random # seed (positive integer) *tag* value = yes or no (yes: The code assign unique tags to inserted ions; no: The tag of all inserted ions is "0") *group* value = group-ID, inserted ions are assigned to group group-ID. Can be used multiple times to assign inserted ions to multiple groups. @@ -47,7 +47,7 @@ Examples """""""" .. code-block:: LAMMPS - fix chareg all charge/regulation 1 2 acid_type 3 base_type 4 pKa 5 pKb 7 lb 1.0 nevery 200 nexchange 200 seed 123 tempfixid fT + fix chareg all charge/regulation 1 2 acid_type 3 base_type 4 pKa 5.0 pKb 6.0 pH 7.0 pIp 3.0 pIm 3.0 nevery 200 nmc 200 seed 123 tempfixid fT fix chareg all charge/regulation 1 2 pIp 3 pIm 3 onlysalt yes 2 -1 seed 123 tag yes temp 1.0 @@ -92,7 +92,11 @@ where the fix attempts to charge :math:`\mathrm{A}` (discharge :math:`\mathrm{A}^-`) to :math:`\mathrm{A}^-` (:math:`\mathrm{A}`) and insert (delete) a proton (atom type 2). Besides, the fix implements self-ionization reaction of water :math:`\emptyset \rightleftharpoons -\mathrm{H}^++\mathrm{OH}^-`. However, this approach is highly +\mathrm{H}^++\mathrm{OH}^-`. + + + +However, this approach is highly inefficient at :math:`\mathrm{pH} \approx 7` when the concentration of both protons and hydroxyl ions is low, resulting in a relatively low acceptance rate of MC moves. @@ -102,24 +106,31 @@ reactions, which can be easily achieved via .. code-block:: LAMMPS - fix acid_reaction all charge/regulation 4 5 acid_type 1 pH 7.0 pKa 5.0 pIp 2.0 pIm 2.0 + fix acid_reaction2 all charge/regulation 4 5 acid_type 1 pH 7.0 pKa 5.0 pIp 2.0 pIm 2.0 -where particles of atom type 4 and 5 are the salt cations and anions, -both at chemical potential pI=2.0, see :ref:`(Curk1) ` and +where particles of atom type 4 and 5 are the salt cations and anions, both at activity (effective concentration) of :math:`10^{-2}` mol/l, see :ref:`(Curk1) ` and :ref:`(Landsgesell) ` for more details. - - Similarly, we could have simultaneously added a base ionization reaction - (:math:`\mathrm{B} \rightleftharpoons \mathrm{B}^++\mathrm{OH}^-`) +We could have simultaneously added a base ionization reaction (:math:`\mathrm{B} \rightleftharpoons \mathrm{B}^++\mathrm{OH}^-`) .. code-block:: LAMMPS - fix base_reaction all charge/regulation 2 3 base_type 6 pH 7.0 pKb 6.0 pIp 7.0 pIm 7.0 + fix acid_base_reaction all charge/regulation 2 3 acid_type 1 base_type 6 pH 7.0 pKa 5.0 pKb 6.0 pIp 7.0 pIm 7.0 where the fix will attempt to charge :math:`\mathrm{B}` (discharge :math:`\mathrm{B}^+`) to :math:`\mathrm{B}^+` (:math:`\mathrm{B}`) and -insert (delete) a hydroxyl ion :math:`\mathrm{OH}^-` of atom type 3. If -neither the acid or the base type is specified, for example, +insert (delete) a hydroxyl ion :math:`\mathrm{OH}^-` of atom type 3. + + +Dissociated ions and salt ions can be combined into a single particle type, which reduces the number of necessary MC moves and increases sampling performance, see :ref:`(Curk1) `. The :math:`\mathrm{H}^+` and monovalent salt cation (:math:`\mathrm{S}^+`) are combined into a single particle type, :math:`\mathrm{X}^+ = \{\mathrm{H}^+, \mathrm{S}^+\}`. In this case "pIp" refers to the effective concentration of the combined cation type :math:`\mathrm{X}^+` and its value is determined by :math:`10^{-\mathrm{pIp}} = 10^{-\mathrm{pH}} + 10^{-\mathrm{pSp}}`, where :math:`10^{-\mathrm{pSp}}` is the effective concentration of salt cations. For example, at pH=7 and pSp=6 we would find pIp~5.958 and the command that performs reactions with combined ions could read, + +.. code-block:: LAMMPS + + fix acid_reaction_combined all charge/regulation 2 3 acid_type 1 pH 7.0 pKa 5.0 pIp 5.958 pIm 5.958 + + + +If neither the acid or the base type is specified, for example, .. code-block:: LAMMPS @@ -127,11 +138,11 @@ neither the acid or the base type is specified, for example, the fix simply inserts or deletes an ion pair of a free cation (atom type 4) and a free anion (atom type 5) as done in a conventional -grand-canonical MC simulation. +grand-canonical MC simulation. Multivalent ions can be inserted (deleted) by using the *onlysalt* keyword. The fix is compatible with LAMMPS sub-packages such as *molecule* or -*rigid*. That said, the acid and base particles can be part of larger +*rigid*. The acid and base particles can be part of larger molecules or rigid bodies. Free ions that are inserted to or deleted from the system must be defined as single particles (no bonded interactions allowed) and cannot be part of larger molecules or rigid @@ -153,14 +164,14 @@ Langevin thermostat: fix fT all langevin 1.0 1.0 1.0 123 fix_modify fT temp dtemp -The chemical potential units (e.g. pH) are in the standard log10 +The units of pH, pKa, pKb, pIp, pIm are considered to be in the standard -log10 representation assuming reference concentration :math:`\rho_0 = -\mathrm{mol}/\mathrm{l}`. Therefore, to perform the internal unit -conversion, the length (in nanometers) of the LAMMPS unit length must be -specified via *lunit_nm* (default is set to the Bjerrum length in water -at room temperature *lunit_nm* = 0.71nm). For example, in the dilute -ideal solution limit, the concentration of free ions will be -:math:`c_\mathrm{I} = 10^{-\mathrm{pIp}}\mathrm{mol}/\mathrm{l}`. +\mathrm{mol}/\mathrm{l}`. For example, in the dilute +ideal solution limit, the concentration of free cations will be +:math:`c_\mathrm{I} = 10^{-\mathrm{pIp}}\mathrm{mol}/\mathrm{l}`. To perform the internal unit +conversion, the the value of the LAMMPS unit length must be +specified in nanometers via *lunit_nm*. The default value is set to the Bjerrum length in water +at room temperature (0.71 nm), *lunit_nm* = 0.71. The temperature used in MC acceptance probability is set by *temp*. This temperature should be the same as the temperature set by the molecular @@ -171,10 +182,10 @@ thermostat fix-ID is *fT*. The inserted particles attain a random velocity corresponding to the specified temperature. Using *tempfixid* overrides any fixed temperature set by *temp*. -The *xrd* keyword can be used to restrict the inserted/deleted +The *rxd* keyword can be used to restrict the inserted/deleted counterions to a specific radial distance from an acid or base particle that is currently participating in a reaction. This can be used to -simulate more realist reaction dynamics. If *xrd* = 0 or *xrd* > *L* / +simulate more realist reaction dynamics. If *rxd* = 0 or *rxd* > *L* / 2, where *L* is the smallest box dimension, the radial restriction is automatically turned off and free ion can be inserted or deleted anywhere in the simulation box. @@ -258,18 +269,18 @@ Default pH = 7.0; pKa = 100.0; pKb = 100.0; pIp = 5.0; pIm = 5.0; pKs = 14.0; acid_type = -1; base_type = -1; lunit_nm = 0.71; temp = 1.0; nevery = -100; nmc = 100; xrd = 0; seed = 0; tag = no; onlysalt = no, pmcmoves = +100; nmc = 100; rxd = 0; seed = 0; tag = no; onlysalt = no, pmcmoves = [1/3, 1/3, 1/3], group-ID = all ---------- .. _Curk1: -**(Curk1)** T. Curk, J. Yuan, and E. Luijten, "Coarse-grained simulation of charge regulation using LAMMPS", preprint (2021). +**(Curk1)** T. Curk, J. Yuan, and E. Luijten, "Accelerated simulation method for charge regulation effects", JCP 156 (2022). .. _Curk2: -**(Curk2)** T. Curk and E. Luijten, "Charge-regulation effects in nanoparticle self-assembly", PRL (2021) +**(Curk2)** T. Curk and E. Luijten, "Charge-regulation effects in nanoparticle self-assembly", PRL 126 (2021) .. _Landsgesell: diff --git a/src/MC/fix_charge_regulation.cpp b/src/MC/fix_charge_regulation.cpp index e469c8442d..344e950847 100644 --- a/src/MC/fix_charge_regulation.cpp +++ b/src/MC/fix_charge_regulation.cpp @@ -22,6 +22,7 @@ #include "atom.h" #include "atom_vec.h" #include "bond.h" +#include "citeme.h" #include "comm.h" #include "compute.h" #include "dihedral.h" @@ -52,6 +53,16 @@ using namespace FixConst; using namespace MathConst; using namespace MathSpecial; +static const char cite_fix_charge_regulation[] = + "fix charge/regulation: \n\n" + "@Article{Curk22,\n" + " author = {T. Curk, J. Yuan, E. Luijten},\n" + " title = {Accelerated simulation method for charge regulation effects},\n" + " journal = {The Journal of Chemical Physics},\n" + " year = 2022,\n" + " volume = 156\n" + "}\n\n"; + enum{CONSTANT,EQUAL}; // parsing input variables // large energy value used to signal overlap @@ -68,6 +79,7 @@ FixChargeRegulation::FixChargeRegulation(LAMMPS *lmp, int narg, char **arg) : c_pe(nullptr), random_equal(nullptr), random_unequal(nullptr), idftemp(nullptr) { + if (lmp->citeme) lmp->citeme->add(cite_fix_charge_regulation); // Region restrictions not yet implemented .. @@ -646,6 +658,8 @@ void FixChargeRegulation::forward_ions() { m1 = insert_particle(cation_type, +1, 0, dummyp); m2 = insert_particle(anion_type, -1, 0, dummyp); + if (force->kspace) force->kspace->qsum_qsq(); + if (force->pair->tail_flag) force->pair->reinit(); double energy_after = energy_full(); if (energy_after < MAXENERGYTEST && random_equal->uniform() < factor * exp(beta * (energy_before - energy_after))) { From ac815fdfba732e46b930b686aa599df0e3f8d767 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 27 Jan 2022 22:16:43 -0500 Subject: [PATCH 110/174] use improved accessors for fixes --- src/KOKKOS/fix_deform_kokkos.cpp | 2 +- src/fix_deform.cpp | 49 ++++++++++++-------------------- src/fix_deform.h | 3 +- 3 files changed, 20 insertions(+), 34 deletions(-) diff --git a/src/KOKKOS/fix_deform_kokkos.cpp b/src/KOKKOS/fix_deform_kokkos.cpp index 576e34503c..104ac41188 100644 --- a/src/KOKKOS/fix_deform_kokkos.cpp +++ b/src/KOKKOS/fix_deform_kokkos.cpp @@ -319,7 +319,7 @@ void FixDeformKokkos::end_of_step() // if (mask[i] & groupbit) // domain->x2lamda(x[i],x[i]); - if (nrigid) + if (rfix.size() > 0) error->all(FLERR,"Cannot (yet) use rigid bodies with fix deform and Kokkos"); //for (i = 0; i < nrigid; i++) // modify->fix[rfix[i]]->deform(0); diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index 71429ac0f8..68893701a0 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -45,7 +45,7 @@ enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE}; /* ---------------------------------------------------------------------- */ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -rfix(nullptr), irregular(nullptr), set(nullptr) +irregular(nullptr), set(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix deform command"); @@ -127,8 +127,8 @@ rfix(nullptr), irregular(nullptr), set(nullptr) error->all(FLERR,"Illegal fix deform command"); if (strstr(arg[iarg+3],"v_") != arg[iarg+3]) error->all(FLERR,"Illegal fix deform command"); - delete [] set[index].hstr; - delete [] set[index].hratestr; + delete[] set[index].hstr; + delete[] set[index].hratestr; set[index].hstr = utils::strdup(&arg[iarg+2][2]); set[index].hratestr = utils::strdup(&arg[iarg+3][2]); iarg += 4; @@ -185,8 +185,8 @@ rfix(nullptr), irregular(nullptr), set(nullptr) error->all(FLERR,"Illegal fix deform command"); if (strstr(arg[iarg+3],"v_") != arg[iarg+3]) error->all(FLERR,"Illegal fix deform command"); - delete [] set[index].hstr; - delete [] set[index].hratestr; + delete[] set[index].hstr; + delete[] set[index].hratestr; set[index].hstr = utils::strdup(&arg[iarg+2][2]); set[index].hratestr = utils::strdup(&arg[iarg+3][2]); iarg += 4; @@ -344,7 +344,6 @@ rfix(nullptr), irregular(nullptr), set(nullptr) force_reneighbor = 1; next_reneighbor = -1; - nrigid = 0; flip = 0; if (force_reneighbor) irregular = new Irregular(lmp); @@ -359,12 +358,11 @@ FixDeform::~FixDeform() { if (set) { for (int i = 0; i < 6; i++) { - delete [] set[i].hstr; - delete [] set[i].hratestr; + delete[] set[i].hstr; + delete[] set[i].hratestr; } } - delete [] set; - delete [] rfix; + delete[] set; delete irregular; @@ -396,9 +394,8 @@ void FixDeform::init() // domain, fix nvt/sllod, compute temp/deform only work on single h_rate int count = 0; - for (int i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style,"deform") == 0) count++; - if (count > 1) error->all(FLERR,"More than one fix deform"); + if (modify->get_fix_by_style("deform").size() > 1) + error->all(FLERR,"More than one fix deform"); // Kspace setting @@ -609,20 +606,12 @@ void FixDeform::init() } // detect if any rigid fixes exist so rigid bodies can be rescaled - // rfix[] = indices to each fix rigid + // rfix[] = vector with pointers to each fix rigid - delete [] rfix; - nrigid = 0; - rfix = nullptr; + rfix.clear(); - for (int i = 0; i < modify->nfix; i++) - if (modify->fix[i]->rigid_flag) nrigid++; - if (nrigid) { - rfix = new int[nrigid]; - nrigid = 0; - for (int i = 0; i < modify->nfix; i++) - if (modify->fix[i]->rigid_flag) rfix[nrigid++] = i; - } + for (auto ifix : modify->get_fix_list()) + if (ifix->rigid_flag) rfix.push_back(ifix); } /* ---------------------------------------------------------------------- @@ -894,9 +883,8 @@ void FixDeform::end_of_step() if (mask[i] & groupbit) domain->x2lamda(x[i],x[i]); - if (nrigid) - for (i = 0; i < nrigid; i++) - modify->fix[rfix[i]]->deform(0); + for (auto ifix : rfix) + ifix->deform(0); } // reset global and local box to new size/shape @@ -934,9 +922,8 @@ void FixDeform::end_of_step() if (mask[i] & groupbit) domain->lamda2x(x[i],x[i]); - if (nrigid) - for (i = 0; i < nrigid; i++) - modify->fix[rfix[i]]->deform(1); + for (auto ifix : rfix) + ifix->deform(1); } // redo KSpace coeffs since box has changed diff --git a/src/fix_deform.h b/src/fix_deform.h index c1becf58f9..90aabbd228 100644 --- a/src/fix_deform.h +++ b/src/fix_deform.h @@ -45,8 +45,7 @@ class FixDeform : public Fix { double *h_rate, *h_ratelo; int varflag; // 1 if VARIABLE option is used, 0 if not int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes + std::vector rfix; // pointers to rigid fixes class Irregular *irregular; // for migrating atoms after box flips double TWOPI; From db4e69bf38ed57695145445565eb9dc1a9b6ec8c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 27 Jan 2022 23:28:54 -0500 Subject: [PATCH 111/174] further simplification by making STUBS an interface and alias to MPI::MPI_CXX --- cmake/CMakeLists.txt | 14 +++++--------- cmake/Modules/Packages/GPU.cmake | 7 +------ examples/plugins/LAMMPSInterfaceCXX.cmake | 4 +--- unittest/force-styles/CMakeLists.txt | 4 +--- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 62507dd29a..49d3bfb845 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -280,10 +280,8 @@ if(BUILD_MPI) # We use a non-standard procedure to cross-compile with MPI on Windows if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) include(MPI4WIN) - target_link_libraries(lammps PUBLIC MPI::MPI_CXX) else() find_package(MPI REQUIRED) - target_link_libraries(lammps PUBLIC MPI::MPI_CXX) 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 PRIVATE -DLAMMPS_LONGLONG_TO_LONG) @@ -291,8 +289,11 @@ if(BUILD_MPI) endif() else() target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) - target_include_directories(lammps PUBLIC ${LAMMPS_SOURCE_DIR}/STUBS) + add_library(mpi_stubs INTERFACE) + target_include_directories(mpi_stubs INTERFACE $) + add_library(MPI::MPI_CXX ALIAS mpi_stubs) endif() +target_link_libraries(lammps PUBLIC MPI::MPI_CXX) 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) @@ -573,12 +574,7 @@ if(PKG_ATC) if(LAMMPS_SIZES STREQUAL "BIGBIG") message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG") endif() - target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES}) - if(BUILD_MPI) - target_link_libraries(atc PRIVATE MPI::MPI_CXX) - else() - target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS) - endif() + target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX) target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}) target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES}) endif() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 863265250d..ee839e20e1 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -423,13 +423,8 @@ RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) -if(NOT BUILD_MPI) - # add include include path to MPI STUBS for non-MPI build - target_include_directories(gpu PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS) -else() - target_link_libraries(gpu PRIVATE MPI::MPI_CXX) -endif() target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE}) target_sources(lammps PRIVATE ${GPU_SOURCES}) target_include_directories(lammps PRIVATE ${GPU_SOURCES_DIR}) +target_link_libraries(gpu PRIVATE MPI::MPI_CXX) diff --git a/examples/plugins/LAMMPSInterfaceCXX.cmake b/examples/plugins/LAMMPSInterfaceCXX.cmake index d52cf8f4e5..e910ec2923 100644 --- a/examples/plugins/LAMMPSInterfaceCXX.cmake +++ b/examples/plugins/LAMMPSInterfaceCXX.cmake @@ -42,10 +42,8 @@ if(BUILD_MPI) if(LAMMPS_LONGLONG_TO_LONG) target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) endif() - target_link_libraries(lammps INTERFACE MPI::MPI_CXX) -else() - target_include_directories(lammps INTERFACE "${LAMMPS_SOURCE_DIR}/STUBS") endif() +target_link_libraries(lammps INTERFACE MPI::MPI_CXX) 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) diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index fd794bd8d7..5fec488e22 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -46,9 +46,7 @@ else() endif() target_include_directories(style_tests PRIVATE ${LAMMPS_SOURCE_DIR}) target_link_libraries(style_tests PUBLIC gmock Yaml::Yaml lammps) -if(BUILD_MPI) - target_link_libraries(style_tests PUBLIC MPI::MPI_CXX) -endif() + # propagate sanitizer options to test tools if(ENABLE_SANITIZER AND (NOT (ENABLE_SANITIZER STREQUAL "none"))) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) From d3c45d33898b60d98aa4f9bc84a2aa85889a9832 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Fri, 28 Jan 2022 17:58:00 +0000 Subject: [PATCH 112/174] Removed whitespace --- src/CG-DNA/pair_oxdna2_coaxstk.h | 9 +-------- src/CG-DNA/pair_oxdna2_dh.h | 4 +--- src/CG-DNA/pair_oxdna_coaxstk.h | 6 ------ src/CG-DNA/pair_oxdna_excv.h | 1 - src/CG-DNA/pair_oxdna_hbond.h | 8 -------- src/CG-DNA/pair_oxdna_stk.h | 3 --- src/CG-DNA/pair_oxdna_xstk.h | 8 -------- src/CG-DNA/pair_oxrna2_stk.h | 5 +---- src/CG-DNA/pair_oxrna2_xstk.h | 9 +-------- 9 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/CG-DNA/pair_oxdna2_coaxstk.h b/src/CG-DNA/pair_oxdna2_coaxstk.h index 7b376fa368..eecd369c38 100644 --- a/src/CG-DNA/pair_oxdna2_coaxstk.h +++ b/src/CG-DNA/pair_oxdna2_coaxstk.h @@ -46,23 +46,16 @@ class PairOxdna2Coaxstk : public Pair { double **k_cxst, **cut_cxst_0, **cut_cxst_c, **cut_cxst_lo, **cut_cxst_hi; double **cut_cxst_lc, **cut_cxst_hc, **b_cxst_lo, **b_cxst_hi; double **cutsq_cxst_hc; - double **a_cxst1, **theta_cxst1_0, **dtheta_cxst1_ast; double **b_cxst1, **dtheta_cxst1_c; - double **a_cxst4, **theta_cxst4_0, **dtheta_cxst4_ast; double **b_cxst4, **dtheta_cxst4_c; - double **a_cxst5, **theta_cxst5_0, **dtheta_cxst5_ast; double **b_cxst5, **dtheta_cxst5_c; - double **a_cxst6, **theta_cxst6_0, **dtheta_cxst6_ast; double **b_cxst6, **dtheta_cxst6_c; - double **AA_cxst1, **BB_cxst1; - - // per-atom arrays for local unit vectors - double **nx_xtrct, **nz_xtrct; + double **nx_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna2_dh.h b/src/CG-DNA/pair_oxdna2_dh.h index d7075f2988..dd299a197c 100644 --- a/src/CG-DNA/pair_oxdna2_dh.h +++ b/src/CG-DNA/pair_oxdna2_dh.h @@ -45,9 +45,7 @@ class PairOxdna2Dh : public Pair { protected: double **qeff_dh_pf, **kappa_dh; double **b_dh, **cut_dh_ast, **cutsq_dh_ast, **cut_dh_c, **cutsq_dh_c; - - // per-atom arrays for local unit vectors - double **nx_xtrct, **ny_xtrct, **nz_xtrct; + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxdna_coaxstk.h b/src/CG-DNA/pair_oxdna_coaxstk.h index 28813a034f..1868e9897e 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.h +++ b/src/CG-DNA/pair_oxdna_coaxstk.h @@ -47,22 +47,16 @@ class PairOxdnaCoaxstk : public Pair { double **k_cxst, **cut_cxst_0, **cut_cxst_c, **cut_cxst_lo, **cut_cxst_hi; double **cut_cxst_lc, **cut_cxst_hc, **b_cxst_lo, **b_cxst_hi; double **cutsq_cxst_hc; - double **a_cxst1, **theta_cxst1_0, **dtheta_cxst1_ast; double **b_cxst1, **dtheta_cxst1_c; - double **a_cxst4, **theta_cxst4_0, **dtheta_cxst4_ast; double **b_cxst4, **dtheta_cxst4_c; - double **a_cxst5, **theta_cxst5_0, **dtheta_cxst5_ast; double **b_cxst5, **dtheta_cxst5_c; - double **a_cxst6, **theta_cxst6_0, **dtheta_cxst6_ast; double **b_cxst6, **dtheta_cxst6_c; - double **a_cxst3p, **cosphi_cxst3p_ast, **b_cxst3p, **cosphi_cxst3p_c; double **a_cxst4p, **cosphi_cxst4p_ast, **b_cxst4p, **cosphi_cxst4p_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); diff --git a/src/CG-DNA/pair_oxdna_excv.h b/src/CG-DNA/pair_oxdna_excv.h index 9abd97fb3d..c5bdc1a85a 100644 --- a/src/CG-DNA/pair_oxdna_excv.h +++ b/src/CG-DNA/pair_oxdna_excv.h @@ -55,7 +55,6 @@ class PairOxdnaExcv : public Pair { double **lj1_sb, **lj2_sb, **b_sb, **cut_sb_c, **cutsq_sb_c; double **epsilon_bb, **sigma_bb, **cut_bb_ast, **cutsq_bb_ast; double **lj1_bb, **lj2_bb, **b_bb, **cut_bb_c, **cutsq_bb_c; - double **nx, **ny, **nz; // per-atom arrays for local unit vectors virtual void allocate(); diff --git a/src/CG-DNA/pair_oxdna_hbond.h b/src/CG-DNA/pair_oxdna_hbond.h index 4afd9b8ad6..14bbfc5573 100644 --- a/src/CG-DNA/pair_oxdna_hbond.h +++ b/src/CG-DNA/pair_oxdna_hbond.h @@ -48,27 +48,19 @@ class PairOxdnaHbond : public Pair { double **epsilon_hb, **a_hb, **cut_hb_0, **cut_hb_c, **cut_hb_lo, **cut_hb_hi; double **cut_hb_lc, **cut_hb_hc, **b_hb_lo, **b_hb_hi, **shift_hb; double **cutsq_hb_hc; - double **a_hb1, **theta_hb1_0, **dtheta_hb1_ast; double **b_hb1, **dtheta_hb1_c; - double **a_hb2, **theta_hb2_0, **dtheta_hb2_ast; double **b_hb2, **dtheta_hb2_c; - double **a_hb3, **theta_hb3_0, **dtheta_hb3_ast; double **b_hb3, **dtheta_hb3_c; - double **a_hb4, **theta_hb4_0, **dtheta_hb4_ast; double **b_hb4, **dtheta_hb4_c; - double **a_hb7, **theta_hb7_0, **dtheta_hb7_ast; double **b_hb7, **dtheta_hb7_c; - double **a_hb8, **theta_hb8_0, **dtheta_hb8_ast; double **b_hb8, **dtheta_hb8_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors - int seqdepflag; virtual void allocate(); diff --git a/src/CG-DNA/pair_oxdna_stk.h b/src/CG-DNA/pair_oxdna_stk.h index 5dbe9ea1e9..da2ad81673 100644 --- a/src/CG-DNA/pair_oxdna_stk.h +++ b/src/CG-DNA/pair_oxdna_stk.h @@ -59,10 +59,7 @@ class PairOxdnaStk : public Pair { double **b_st6, **dtheta_st6_c; double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors - - int seqdepflag; virtual void allocate(); diff --git a/src/CG-DNA/pair_oxdna_xstk.h b/src/CG-DNA/pair_oxdna_xstk.h index 7695effc89..04f9462fd4 100644 --- a/src/CG-DNA/pair_oxdna_xstk.h +++ b/src/CG-DNA/pair_oxdna_xstk.h @@ -47,28 +47,20 @@ class PairOxdnaXstk : public Pair { double **k_xst, **cut_xst_0, **cut_xst_c, **cut_xst_lo, **cut_xst_hi; double **cut_xst_lc, **cut_xst_hc, **b_xst_lo, **b_xst_hi; double **cutsq_xst_hc; - double **a_xst1, **theta_xst1_0, **dtheta_xst1_ast; double **b_xst1, **dtheta_xst1_c; - double **a_xst2, **theta_xst2_0, **dtheta_xst2_ast; double **b_xst2, **dtheta_xst2_c; - double **a_xst3, **theta_xst3_0, **dtheta_xst3_ast; double **b_xst3, **dtheta_xst3_c; - double **a_xst4, **theta_xst4_0, **dtheta_xst4_ast; double **b_xst4, **dtheta_xst4_c; - double **a_xst7, **theta_xst7_0, **dtheta_xst7_ast; double **b_xst7, **dtheta_xst7_c; - double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors - virtual void allocate(); }; diff --git a/src/CG-DNA/pair_oxrna2_stk.h b/src/CG-DNA/pair_oxrna2_stk.h index e15614f126..0e7647894d 100644 --- a/src/CG-DNA/pair_oxrna2_stk.h +++ b/src/CG-DNA/pair_oxrna2_stk.h @@ -60,10 +60,7 @@ class PairOxrna2Stk : public Pair { double **b_st10, **dtheta_st10_c; double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; - - // per-atom arrays for local unit vectors - double **nx_xtrct, **ny_xtrct, **nz_xtrct; - + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors int seqdepflag; virtual void allocate(); diff --git a/src/CG-DNA/pair_oxrna2_xstk.h b/src/CG-DNA/pair_oxrna2_xstk.h index 6ece8e3f32..8516b1c5d4 100644 --- a/src/CG-DNA/pair_oxrna2_xstk.h +++ b/src/CG-DNA/pair_oxrna2_xstk.h @@ -46,24 +46,17 @@ class PairOxrna2Xstk : public Pair { double **k_xst, **cut_xst_0, **cut_xst_c, **cut_xst_lo, **cut_xst_hi; double **cut_xst_lc, **cut_xst_hc, **b_xst_lo, **b_xst_hi; double **cutsq_xst_hc; - double **a_xst1, **theta_xst1_0, **dtheta_xst1_ast; double **b_xst1, **dtheta_xst1_c; - double **a_xst2, **theta_xst2_0, **dtheta_xst2_ast; double **b_xst2, **dtheta_xst2_c; - double **a_xst3, **theta_xst3_0, **dtheta_xst3_ast; double **b_xst3, **dtheta_xst3_c; - double **a_xst7, **theta_xst7_0, **dtheta_xst7_ast; double **b_xst7, **dtheta_xst7_c; - double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; - - // per-atom arrays for local unit vectors - double **nx_xtrct, **nz_xtrct; + double **nx_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); }; From bb89347bacfe3e80d6773b5b4a25959d6858dcf0 Mon Sep 17 00:00:00 2001 From: Sievers Date: Fri, 28 Jan 2022 11:06:29 -0800 Subject: [PATCH 113/174] Fixed kspace issue and added suggested runtime check for intel accelerator --- src/KOKKOS/dynamical_matrix_kokkos.cpp | 9 +++++++-- src/KOKKOS/third_order_kokkos.cpp | 10 +++++++--- src/PHONON/dynamical_matrix.cpp | 8 +++++++- src/PHONON/third_order.cpp | 7 ++++++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp index 4068912da9..60d96630e2 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.cpp +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -123,9 +123,12 @@ void DynamicalMatrixKokkos::setup() neighbor->build(1); // compute all forces - if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; + // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; + if (force->kspace) { + force->kspace->setup(); + } update_force(); if (pair_compute_flag) { @@ -169,7 +172,9 @@ void DynamicalMatrixKokkos::update_force() force_clear(); - neighbor->decide(); // needed for intel potentials to work + neighbor->ago = 0; + if ((modify->get_fix_by_id("package_intel")) ? true : false) + neighbor->decide(); if (n_pre_force) { diff --git a/src/KOKKOS/third_order_kokkos.cpp b/src/KOKKOS/third_order_kokkos.cpp index 0ceea63fe2..1f5cb40791 100644 --- a/src/KOKKOS/third_order_kokkos.cpp +++ b/src/KOKKOS/third_order_kokkos.cpp @@ -123,9 +123,12 @@ void ThirdOrderKokkos::setup() neighbor->build(1); // compute all forces - if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; + // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; + if (force->kspace) { + force->kspace->setup(); + } update_force(); if (pair_compute_flag) { @@ -170,8 +173,9 @@ void ThirdOrderKokkos::update_force() force_clear(); - neighbor->decide(); // needed for intel potentials to work - + neighbor->ago = 0; + if ((modify->get_fix_by_id("package_intel")) ? true : false) + neighbor->decide(); if (n_pre_force) { modify->pre_force(vflag); diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index d866b4e306..d32b475408 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -91,8 +91,12 @@ void DynamicalMatrix::setup() // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; + if (force->kspace) { + force->kspace->setup(); + } update_force(); + // if (pair_compute_flag) force->pair->compute(eflag,vflag); // else if (force->pair) force->pair->compute_dummy(eflag,vflag); update->setupflag = 0; @@ -425,7 +429,9 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { - neighbor->decide(); // needed for intel potentials to work + neighbor->ago = 0; + if ((modify->get_fix_by_id("package_intel")) ? true : false) + neighbor->decide(); force_clear(); int n_pre_force = modify->n_pre_force; int n_pre_reverse = modify->n_pre_reverse; diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 1f13b2227f..290e214a56 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -97,6 +97,9 @@ void ThirdOrder::setup() external_force_clear = 0; eflag=0; vflag=0; + if (force->kspace) { + force->kspace->setup(); + } update_force(); modify->setup(vflag); @@ -498,7 +501,9 @@ void ThirdOrder::displace_atom(int local_idx, int direction, int magnitude) void ThirdOrder::update_force() { - neighbor->decide(); // needed for intel potentials to work + neighbor->ago = 0; + if ((modify->get_fix_by_id("package_intel")) ? true : false) + neighbor->decide(); force_clear(); int n_post_force = modify->n_post_force; int n_pre_force = modify->n_pre_force; From 4225c6c288e50022af3b73d544c84039f5032f8e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 14:48:34 -0500 Subject: [PATCH 114/174] whitespace --- doc/src/fix_charge_regulation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/fix_charge_regulation.rst b/doc/src/fix_charge_regulation.rst index 947da74ec6..82bcf3d69d 100644 --- a/doc/src/fix_charge_regulation.rst +++ b/doc/src/fix_charge_regulation.rst @@ -122,7 +122,7 @@ where the fix will attempt to charge :math:`\mathrm{B}` (discharge insert (delete) a hydroxyl ion :math:`\mathrm{OH}^-` of atom type 3. -Dissociated ions and salt ions can be combined into a single particle type, which reduces the number of necessary MC moves and increases sampling performance, see :ref:`(Curk1) `. The :math:`\mathrm{H}^+` and monovalent salt cation (:math:`\mathrm{S}^+`) are combined into a single particle type, :math:`\mathrm{X}^+ = \{\mathrm{H}^+, \mathrm{S}^+\}`. In this case "pIp" refers to the effective concentration of the combined cation type :math:`\mathrm{X}^+` and its value is determined by :math:`10^{-\mathrm{pIp}} = 10^{-\mathrm{pH}} + 10^{-\mathrm{pSp}}`, where :math:`10^{-\mathrm{pSp}}` is the effective concentration of salt cations. For example, at pH=7 and pSp=6 we would find pIp~5.958 and the command that performs reactions with combined ions could read, +Dissociated ions and salt ions can be combined into a single particle type, which reduces the number of necessary MC moves and increases sampling performance, see :ref:`(Curk1) `. The :math:`\mathrm{H}^+` and monovalent salt cation (:math:`\mathrm{S}^+`) are combined into a single particle type, :math:`\mathrm{X}^+ = \{\mathrm{H}^+, \mathrm{S}^+\}`. In this case "pIp" refers to the effective concentration of the combined cation type :math:`\mathrm{X}^+` and its value is determined by :math:`10^{-\mathrm{pIp}} = 10^{-\mathrm{pH}} + 10^{-\mathrm{pSp}}`, where :math:`10^{-\mathrm{pSp}}` is the effective concentration of salt cations. For example, at pH=7 and pSp=6 we would find pIp~5.958 and the command that performs reactions with combined ions could read, .. code-block:: LAMMPS @@ -138,7 +138,7 @@ If neither the acid or the base type is specified, for example, the fix simply inserts or deletes an ion pair of a free cation (atom type 4) and a free anion (atom type 5) as done in a conventional -grand-canonical MC simulation. Multivalent ions can be inserted (deleted) by using the *onlysalt* keyword. +grand-canonical MC simulation. Multivalent ions can be inserted (deleted) by using the *onlysalt* keyword. The fix is compatible with LAMMPS sub-packages such as *molecule* or From e76c8bbaa3bad60d63cf78c43d1a7a788c58f18d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 14:52:31 -0500 Subject: [PATCH 115/174] spelling --- doc/utils/sphinx-config/false_positives.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index fe1e40e8ba..956391a0d2 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -2647,6 +2647,7 @@ pscreen pscrozi pseudodynamics pseudopotential +pSp Pstart Pstop pstyle @@ -2925,6 +2926,7 @@ Runge runtime Rutuparna rx +rxd rxnave rxnsum ry From e5b129fe8d9f687354ff0213055d0ba0f9bb3bd8 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 28 Jan 2022 13:35:09 -0700 Subject: [PATCH 116/174] Grow exponentially to resize less --- src/KOKKOS/pair_reaxff_kokkos.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index ebcd66e83c..9d4e28ff6b 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -843,12 +843,12 @@ void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) k_resize_bo.modify(); k_resize_bo.sync(); int resize_bo = k_resize_bo.h_view(); - if (resize_bo) maxbo = MAX(maxbo+1,resize_bo); + if (resize_bo) maxbo = MAX(maxbo+MAX(1,maxbo*0.1),resize_bo); k_resize_hb.modify(); k_resize_hb.sync(); int resize_hb = k_resize_hb.h_view(); - if (resize_hb) maxhb = MAX(maxhb+1,resize_hb); + if (resize_hb) maxhb = MAX(maxhb+MAX(1,maxhb*0.1),resize_hb); resize = resize_bo || resize_hb; if (resize) { From 1d51f2d15177d87a0caa527e4e16eedd2fcb5ad6 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 16:57:58 -0500 Subject: [PATCH 117/174] must not access invalid/uninitialized data --- unittest/formats/test_atom_styles.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index 5076e92ca3..7329c6d7a0 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -5220,23 +5220,19 @@ TEST_F(AtomStyleTest, oxdna) ASSERT_EQ(bond_type[GETIDX(2)][0], 1); ASSERT_EQ(bond_type[GETIDX(3)][0], 1); ASSERT_EQ(bond_type[GETIDX(4)][0], 1); - ASSERT_EQ(bond_type[GETIDX(5)][0], 0); ASSERT_EQ(bond_type[GETIDX(6)][0], 1); ASSERT_EQ(bond_type[GETIDX(7)][0], 1); ASSERT_EQ(bond_type[GETIDX(8)][0], 1); ASSERT_EQ(bond_type[GETIDX(9)][0], 1); - ASSERT_EQ(bond_type[GETIDX(10)][0], 0); ASSERT_EQ(bond_atom[GETIDX(1)][0], 2); ASSERT_EQ(bond_atom[GETIDX(2)][0], 3); ASSERT_EQ(bond_atom[GETIDX(3)][0], 4); ASSERT_EQ(bond_atom[GETIDX(4)][0], 5); - ASSERT_EQ(bond_atom[GETIDX(5)][0], 0); ASSERT_EQ(bond_atom[GETIDX(6)][0], 7); ASSERT_EQ(bond_atom[GETIDX(7)][0], 8); ASSERT_EQ(bond_atom[GETIDX(8)][0], 9); ASSERT_EQ(bond_atom[GETIDX(9)][0], 10); - ASSERT_EQ(bond_atom[GETIDX(10)][0], 0); ASSERT_EQ(id5p[GETIDX(1)], 2); ASSERT_EQ(id5p[GETIDX(2)], 3); From 96502ae49da079ce3a996bd39bf2d661f8aadc0c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 17:07:03 -0500 Subject: [PATCH 118/174] whitespace --- src/dump.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dump.cpp b/src/dump.cpp index 181a56ff46..da5a827667 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1009,13 +1009,13 @@ void Dump::balance() // send for this proc if (iproc_prev != me) { - MPI_Send(&buf[procstart*size_one],procnsend*size_one,MPI_DOUBLE,procsend,0,world); + MPI_Send(&buf[procstart*size_one],procnsend*size_one,MPI_DOUBLE,procsend,0,world); } else { // sending to self, copy buffers - int offset_me = proc_offsets[me] - proc_new_offsets[me]; - memcpy(&buf_balance[(offset_me + procstart)*size_one],&buf[procstart*size_one],procnsend*size_one*sizeof(double)); + int offset_me = proc_offsets[me] - proc_new_offsets[me]; + memcpy(&buf_balance[(offset_me + procstart)*size_one],&buf[procstart*size_one],procnsend*size_one*sizeof(double)); } procstart = i; From f6d0be12574edd89965a9b967c41031ac7088819 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 17:08:16 -0500 Subject: [PATCH 119/174] avoid integer overflow due to precedence --- src/dump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dump.cpp b/src/dump.cpp index da5a827667..46622c2efa 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1015,7 +1015,7 @@ void Dump::balance() // sending to self, copy buffers int offset_me = proc_offsets[me] - proc_new_offsets[me]; - memcpy(&buf_balance[(offset_me + procstart)*size_one],&buf[procstart*size_one],procnsend*size_one*sizeof(double)); + memcpy(&buf_balance[(offset_me + procstart)*size_one],&buf[procstart*size_one],sizeof(double)*procnsend*size_one); } procstart = i; From e8ce01079d3ad2aab45f635c6e9cd046278787f4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 17:20:32 -0500 Subject: [PATCH 120/174] whitespace --- src/CG-DNA/pair_oxdna_coaxstk.cpp | 4 ++-- src/CG-DNA/pair_oxrna2_stk.h | 2 +- src/CG-DNA/pair_oxrna2_xstk.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CG-DNA/pair_oxdna_coaxstk.cpp b/src/CG-DNA/pair_oxdna_coaxstk.cpp index e6cf59f072..49b25bb81b 100644 --- a/src/CG-DNA/pair_oxdna_coaxstk.cpp +++ b/src/CG-DNA/pair_oxdna_coaxstk.cpp @@ -158,7 +158,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) alist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - + // n(x/y/z)_xtrct = extracted local unit vectors in lab frame from oxdna_excv int dim; nx_xtrct = (double **) force->pair->extract("nx",dim); @@ -252,7 +252,7 @@ void PairOxdnaCoaxstk::compute(int eflag, int vflag) // early rejection criterium if (f4t1) { - + az[0] = nz_xtrct[a][0]; az[1] = nz_xtrct[a][1]; az[2] = nz_xtrct[a][2]; diff --git a/src/CG-DNA/pair_oxrna2_stk.h b/src/CG-DNA/pair_oxrna2_stk.h index dc365f1c44..8530544fdc 100644 --- a/src/CG-DNA/pair_oxrna2_stk.h +++ b/src/CG-DNA/pair_oxrna2_stk.h @@ -60,7 +60,7 @@ class PairOxrna2Stk : public Pair { double **b_st10, **dtheta_st10_c; double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c; double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c; - double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors + double **nx_xtrct, **ny_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors int seqdepflag; virtual void allocate(); diff --git a/src/CG-DNA/pair_oxrna2_xstk.h b/src/CG-DNA/pair_oxrna2_xstk.h index 90d7960f84..c73839b4a7 100644 --- a/src/CG-DNA/pair_oxrna2_xstk.h +++ b/src/CG-DNA/pair_oxrna2_xstk.h @@ -56,7 +56,7 @@ class PairOxrna2Xstk : public Pair { double **b_xst7, **dtheta_xst7_c; double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast; double **b_xst8, **dtheta_xst8_c; - double **nx_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors + double **nx_xtrct, **nz_xtrct; // per-atom arrays for local unit vectors virtual void allocate(); }; From 6258cf1b9d5e133f764b994133d3167dba863512 Mon Sep 17 00:00:00 2001 From: Sievers Date: Fri, 28 Jan 2022 14:49:13 -0800 Subject: [PATCH 121/174] Fixed merge conflict --- src/KOKKOS/dynamical_matrix_kokkos.cpp | 1 - src/KOKKOS/dynamical_matrix_kokkos.h | 2 +- src/KOKKOS/third_order_kokkos.cpp | 1 - src/KOKKOS/third_order_kokkos.h | 2 +- src/PHONON/dynamical_matrix.cpp | 3 --- src/PHONON/dynamical_matrix.h | 6 +++--- src/PHONON/third_order.h | 6 +++--- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp index 60d96630e2..de587f1872 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.cpp +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -123,7 +123,6 @@ void DynamicalMatrixKokkos::setup() neighbor->build(1); // compute all forces - // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; if (force->kspace) { diff --git a/src/KOKKOS/dynamical_matrix_kokkos.h b/src/KOKKOS/dynamical_matrix_kokkos.h index b0930e440c..345d00afc4 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.h +++ b/src/KOKKOS/dynamical_matrix_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class DynamicalMatrixKokkos : public DynamicalMatrix { public: DynamicalMatrixKokkos(class LAMMPS *); - virtual ~DynamicalMatrixKokkos(); + ~DynamicalMatrixKokkos(); void command(int, char **); void setup(); diff --git a/src/KOKKOS/third_order_kokkos.cpp b/src/KOKKOS/third_order_kokkos.cpp index 1f5cb40791..d36b6241c5 100644 --- a/src/KOKKOS/third_order_kokkos.cpp +++ b/src/KOKKOS/third_order_kokkos.cpp @@ -123,7 +123,6 @@ void ThirdOrderKokkos::setup() neighbor->build(1); // compute all forces - // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; if (force->kspace) { diff --git a/src/KOKKOS/third_order_kokkos.h b/src/KOKKOS/third_order_kokkos.h index 6845cf67fb..b47e705935 100644 --- a/src/KOKKOS/third_order_kokkos.h +++ b/src/KOKKOS/third_order_kokkos.h @@ -30,7 +30,7 @@ namespace LAMMPS_NS { class ThirdOrderKokkos : public ThirdOrder { public: ThirdOrderKokkos(class LAMMPS *); - virtual ~ThirdOrderKokkos(); + ~ThirdOrderKokkos(); void command(int, char **); void setup(); diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index d32b475408..e0a69e2a7c 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -88,7 +88,6 @@ void DynamicalMatrix::setup() neighbor->build(1); // compute all forces - // if (!modify->get_fix_by_id("package_omp")) external_force_clear = 1; eflag=0; vflag=0; if (force->kspace) { @@ -97,8 +96,6 @@ void DynamicalMatrix::setup() update_force(); - // if (pair_compute_flag) force->pair->compute(eflag,vflag); - // else if (force->pair) force->pair->compute_dummy(eflag,vflag); update->setupflag = 0; //if all then skip communication groupmap population diff --git a/src/PHONON/dynamical_matrix.h b/src/PHONON/dynamical_matrix.h index ceb717943d..41cc549865 100644 --- a/src/PHONON/dynamical_matrix.h +++ b/src/PHONON/dynamical_matrix.h @@ -18,9 +18,9 @@ namespace LAMMPS_NS { class DynamicalMatrix : public Command { public: DynamicalMatrix(class LAMMPS *); - virtual ~DynamicalMatrix(); - virtual void command(int, char **); - virtual void setup(); + ~DynamicalMatrix(); + void command(int, char **); + void setup(); protected: int eflag, vflag; // flags for energy/virial computation diff --git a/src/PHONON/third_order.h b/src/PHONON/third_order.h index 9c3744fc4c..0615fc4c87 100644 --- a/src/PHONON/third_order.h +++ b/src/PHONON/third_order.h @@ -18,9 +18,9 @@ namespace LAMMPS_NS { class ThirdOrder : public Command { public: ThirdOrder(class LAMMPS *); - virtual ~ThirdOrder(); - virtual void command(int, char **); - virtual void setup(); + ~ThirdOrder(); + void command(int, char **); + void setup(); protected: int eflag,vflag; // flags for energy/virial computation From c28b7c586ae97ef79a7b634c907eb1f1d7d9259e Mon Sep 17 00:00:00 2001 From: Sievers Date: Fri, 28 Jan 2022 14:59:07 -0800 Subject: [PATCH 122/174] Residual Merge Conflict --- src/KOKKOS/dynamical_matrix_kokkos.h | 4 ++-- src/KOKKOS/third_order_kokkos.h | 4 ++-- src/PHONON/dynamical_matrix.h | 4 ++-- src/PHONON/third_order.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.h b/src/KOKKOS/dynamical_matrix_kokkos.h index 345d00afc4..02b93e2112 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.h +++ b/src/KOKKOS/dynamical_matrix_kokkos.h @@ -30,8 +30,8 @@ namespace LAMMPS_NS { class DynamicalMatrixKokkos : public DynamicalMatrix { public: DynamicalMatrixKokkos(class LAMMPS *); - ~DynamicalMatrixKokkos(); - void command(int, char **); + ~DynamicalMatrixKokkos() override; + void command(int, char **) override; void setup(); KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/third_order_kokkos.h b/src/KOKKOS/third_order_kokkos.h index b47e705935..5392c825c5 100644 --- a/src/KOKKOS/third_order_kokkos.h +++ b/src/KOKKOS/third_order_kokkos.h @@ -30,8 +30,8 @@ namespace LAMMPS_NS { class ThirdOrderKokkos : public ThirdOrder { public: ThirdOrderKokkos(class LAMMPS *); - ~ThirdOrderKokkos(); - void command(int, char **); + ~ThirdOrderKokkos() override; + void command(int, char **) override; void setup(); KOKKOS_INLINE_FUNCTION diff --git a/src/PHONON/dynamical_matrix.h b/src/PHONON/dynamical_matrix.h index 41cc549865..4a08420381 100644 --- a/src/PHONON/dynamical_matrix.h +++ b/src/PHONON/dynamical_matrix.h @@ -18,8 +18,8 @@ namespace LAMMPS_NS { class DynamicalMatrix : public Command { public: DynamicalMatrix(class LAMMPS *); - ~DynamicalMatrix(); - void command(int, char **); + ~DynamicalMatrix() override; + void command(int, char **) override; void setup(); protected: diff --git a/src/PHONON/third_order.h b/src/PHONON/third_order.h index 0615fc4c87..e3d2cdc16e 100644 --- a/src/PHONON/third_order.h +++ b/src/PHONON/third_order.h @@ -18,8 +18,8 @@ namespace LAMMPS_NS { class ThirdOrder : public Command { public: ThirdOrder(class LAMMPS *); - ~ThirdOrder(); - void command(int, char **); + ~ThirdOrder() override; + void command(int, char **) override; void setup(); protected: From a9481733a016fbb3f4fcdf2b6d7f562b000faa5e Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Fri, 28 Jan 2022 18:34:30 -0700 Subject: [PATCH 123/174] Finished debugging, testing, documenting --- doc/src/Commands_fix.rst | 1 + doc/src/Errors_messages.rst | 7 + doc/src/compute_pressure.rst | 2 +- doc/src/fix.rst | 3 +- doc/src/fix_numdiff.rst | 23 ++- doc/src/fix_numdiff_virial.rst | 115 ++++++++++++ doc/src/fix_nvt_sllod.rst | 9 +- doc/src/fix_viscosity.rst | 4 +- doc/utils/sphinx-config/false_positives.txt | 2 + examples/README | 2 +- examples/numdiff/in.numdiff | 90 ++++++--- .../numdiff/log.28Jan2022.log.numdiff.g++.1 | 175 ++++++++++++++++++ .../numdiff/log.28Jan2022.log.numdiff.g++.4 | 175 ++++++++++++++++++ src/EXTRA-FIX/fix_numdiff.cpp | 5 + ...diff_stress.cpp => fix_numdiff_virial.cpp} | 79 ++++---- ..._numdiff_stress.h => fix_numdiff_virial.h} | 31 ++-- 16 files changed, 627 insertions(+), 96 deletions(-) create mode 100644 doc/src/fix_numdiff_virial.rst create mode 100644 examples/numdiff/log.28Jan2022.log.numdiff.g++.1 create mode 100644 examples/numdiff/log.28Jan2022.log.numdiff.g++.4 rename src/EXTRA-FIX/{fix_numdiff_stress.cpp => fix_numdiff_virial.cpp} (82%) rename src/EXTRA-FIX/{fix_numdiff_stress.h => fix_numdiff_virial.h} (73%) diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index c3fca16bef..35e4f671ef 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -129,6 +129,7 @@ OPT. * :doc:`npt/sphere (o) ` * :doc:`npt/uef ` * :doc:`numdiff ` + * :doc:`numdiff/virial ` * :doc:`nve (giko) ` * :doc:`nve/asphere (gi) ` * :doc:`nve/asphere/noforce ` diff --git a/doc/src/Errors_messages.rst b/doc/src/Errors_messages.rst index c06f4c86e3..4e216828d3 100644 --- a/doc/src/Errors_messages.rst +++ b/doc/src/Errors_messages.rst @@ -1941,6 +1941,9 @@ Doc page with :doc:`WARNING messages ` *Compute ID for fix numdiff does not exist* Self-explanatory. +*Compute ID for fix numdiff/virial does not exist* + Self-explanatory. + *Compute ID for fix store/state does not exist* Self-explanatory. @@ -3796,6 +3799,10 @@ Doc page with :doc:`WARNING messages ` Self-explanatory. Efficient loop over all atoms for numerical difference requires consecutive atom IDs. +*Fix numdiff/virial must use group all* + Virial contributions computed by this fix are + computed on all atoms. + *Fix nve/asphere requires extended particles* This fix can only be used for particles with a shape setting. diff --git a/doc/src/compute_pressure.rst b/doc/src/compute_pressure.rst index 6d76713b41..ab57786c05 100644 --- a/doc/src/compute_pressure.rst +++ b/doc/src/compute_pressure.rst @@ -141,7 +141,7 @@ Related commands """""""""""""""" :doc:`compute temp `, :doc:`compute stress/atom `, -:doc:`thermo_style `, +:doc:`thermo_style `, :doc:`fix numdiff/virial `, Default """"""" diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 6afe0fe325..92a00abe46 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -271,7 +271,8 @@ accelerated styles exist. * :doc:`npt/eff ` - NPT for nuclei and electrons in the electron force field model * :doc:`npt/sphere ` - NPT for spherical particles * :doc:`npt/uef ` - NPT style time integration with diagonal flow -* :doc:`numdiff ` - compute derivatives of per-atom data from finite differences +* :doc:`numdiff ` - numerically approximate atomic forces using finite energy differences +* :doc:`numdiff/virial ` - numerically approximate virial stress tensor using finite energy differences * :doc:`nve ` - constant NVE time integration * :doc:`nve/asphere ` - NVE for aspherical particles * :doc:`nve/asphere/noforce ` - NVE for aspherical particles without forces diff --git a/doc/src/fix_numdiff.rst b/doc/src/fix_numdiff.rst index b0686f471f..b5fdfb12e6 100644 --- a/doc/src/fix_numdiff.rst +++ b/doc/src/fix_numdiff.rst @@ -13,16 +13,15 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * numdiff = style name of this fix command * Nevery = calculate force by finite difference every this many timesteps -* delta = finite difference displacement length (distance units) +* delta = size of atom displacements (distance units) Examples """""""" .. code-block:: LAMMPS - fix 1 all numdiff 1 0.0001 fix 1 all numdiff 10 1e-6 - fix 1 all numdiff 100 0.01 + fix 1 movegroup numdiff 100 0.01 Description """"""""""" @@ -67,16 +66,17 @@ by two times *delta*. The cost of each energy evaluation is essentially the cost of an MD timestep. Thus invoking this fix once for a 3d system has a cost - of 6N timesteps, where N is the total number of atoms in the system - (assuming all atoms are included in the group). So this fix can be - very expensive to use for large systems. + of 6N timesteps, where N is the total number of atoms in the system. + So this fix can be very expensive to use for large systems. + One expedient alternative is to define the fix for a group containing + only a few atoms. ---------- The *Nevery* argument specifies on what timesteps the force will be used calculated by finite difference. -The *delta* argument specifies the positional displacement each +The *delta* argument specifies the size of the displacement each atom will undergo. ---------- @@ -93,7 +93,12 @@ This fix produces a per-atom array which can be accessed by various the force on each atom as calculated by finite difference. The per-atom values can only be accessed on timesteps that are multiples of *Nevery* since that is when the finite difference forces are -calculated. +calculated. See the examples in *examples/numdiff* directory +to see how this fix can be used to directly compare with +the analytic forces computed by LAMMPS. + +The array values calculated by this compute +will be in force :doc:`units `. No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is invoked during :doc:`energy @@ -108,7 +113,7 @@ was built with that package. See the :doc:`Build package ` page Related commands """""""""""""""" -:doc:`dynamical_matrix `, +:doc:`dynamical_matrix `, :doc:`fix numdiff/virial `, Default """"""" diff --git a/doc/src/fix_numdiff_virial.rst b/doc/src/fix_numdiff_virial.rst new file mode 100644 index 0000000000..647a0e592a --- /dev/null +++ b/doc/src/fix_numdiff_virial.rst @@ -0,0 +1,115 @@ +.. index:: fix numdiff/virial + +fix numdiff/virial command +========================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID numdiff/virial Nevery delta + +* ID, group-ID are documented in :doc:`fix ` command +* numdiff/virial = style name of this fix command +* Nevery = calculate virial by finite difference every this many timesteps +* delta = magnitude of strain fields (dimensionless) + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all numdiff/stress 10 1e-6 + +Description +""""""""""" + +Calculate the virial stress tensor through a finite difference calculation of +energy versus strain. These values can be compared to the analytic virial +tensor computed by pair styles, bond styles, etc. This can be useful for +debugging or other purposes. The specified group must be "all". + +This fix applies linear strain fields of magnitude *delta* to all the +atoms relative to a point at the center of the box. The +strain fields are in six different directions, corresponding to the +six Cartesian components of the stress tensor defined by LAMMPS. +For each direction it applies the strain field in both the positive +and negative senses, and the new energy of the entire system +is calculated after each. The difference in these two energies +divided by two times *delta*, approximates the corresponding +component of the virial stress tensor, after applying +a suitable unit conversion. + +.. note:: + + It is important to choose a suitable value for delta, the magnitude of + strains that are used to generate finite difference + approximations to the exact virial stress. For typical systems, a value in + the range of 1 part in 1e5 to 1e6 will be sufficient. + However, the best value will depend on a multitude of factors + including the stiffness of the interatomic potential, the thermodynamic + state of the material being probed, and so on. The only way to be sure + that you have made a good choice is to do a sensitivity study on a + representative atomic configuration, sweeping over a wide range of + values of delta. If delta is too small, the output values will vary + erratically due to truncation effects. If delta is increased beyond a + certain point, the output values will start to vary smoothly with + delta, due to growing contributions from higher order derivatives. In + between these two limits, the numerical virial values should be largely + independent of delta. + +---------- + +The *Nevery* argument specifies on what timesteps the force will +be used calculated by finite difference. + +The *delta* argument specifies the size of the displacement each +atom will undergo. + +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files +`. None of the :doc:`fix_modify ` options are +relevant to this fix. + +This fix produces a global vector which can be accessed by various +:doc:`output commands `, which stores the components of +the virial stress tensor as calculated by finite difference. The +global vector can only be accessed on timesteps that are multiples +of *Nevery* since that is when the finite difference virial is +calculated. See the examples in *examples/numdiff* directory +to see how this fix can be used to directly compare with +the analytic virial stress tensor computed by LAMMPS. + +The order of the virial stress tensor components is *xx*, *yy*, *zz*, +*yz*, *xz*, and *xy*, consistent with Voigt notation. Note that +the vector produced by :doc:`compute pressure ` +uses a different ordering, with *yz* and *xy* swapped. + +The vector values calculated by this compute are +"intensive". The vector values will be in pressure +:doc:`units `. + +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. This fix is invoked during :doc:`energy +minimization `. + +Restrictions +"""""""""""" + +This fix is part of the EXTRA-FIX package. It is only enabled if LAMMPS +was built with that package. See the :doc:`Build package ` page for more info. + +Related commands +"""""""""""""""" + +:doc:`fix numdiff `, :doc:`compute pressure ` + +Default +""""""" + +none diff --git a/doc/src/fix_nvt_sllod.rst b/doc/src/fix_nvt_sllod.rst index 4bb4478991..04e60057a1 100644 --- a/doc/src/fix_nvt_sllod.rst +++ b/doc/src/fix_nvt_sllod.rst @@ -66,7 +66,10 @@ equivalent to Newton's equations of motion for shear flow by :ref:`(Evans and Morriss) `. They were later shown to generate the desired velocity gradient and the correct production of work by stresses for all forms of homogeneous flow by :ref:`(Daivis and Todd) -`. As implemented in LAMMPS, they are coupled to a +`. +The LAMMPS implementation corresponds to the p-SLLOD variant +of SLLOD. :ref:`(Edwards) `. +The equations of motion are coupled to a Nose/Hoover chain thermostat in a velocity Verlet formulation, closely following the implementation used for the :doc:`fix nvt ` command. @@ -180,6 +183,10 @@ Same as :doc:`fix nvt `, except tchain = 1. **(Daivis and Todd)** Daivis and Todd, J Chem Phys, 124, 194103 (2006). +.. _Edwards: + +**(Edwards)** Edwards, Baig, and Keffer, J Chem Phys 124, 194104 (2006). + .. _Daivis-sllod: **(Daivis and Todd)** Daivis and Todd, Nonequilibrium Molecular Dynamics (book), diff --git a/doc/src/fix_viscosity.rst b/doc/src/fix_viscosity.rst index e077af19f4..e92d1eab92 100644 --- a/doc/src/fix_viscosity.rst +++ b/doc/src/fix_viscosity.rst @@ -108,7 +108,9 @@ fluid, in appropriate units. See the :ref:`Muller-Plathe paper An alternative method for calculating a viscosity is to run a NEMD simulation, as described on the :doc:`Howto nemd ` doc page. -NEMD simulations deform the simulation box via the :doc:`fix deform ` command. Thus they cannot be run on a charged +NEMD simulations deform the simulation box via the :doc:`fix deform ` command. + +Thus they cannot be run on a charged system using a :doc:`PPPM solver ` since PPPM does not currently support non-orthogonal boxes. Using fix viscosity keeps the box orthogonal; thus it does not suffer from this limitation. diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index fe1e40e8ba..53e8781a9e 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -194,6 +194,7 @@ Baczewski Bagchi Bagi Bagnold +Baig Bajaj Bkappa Bal @@ -1569,6 +1570,7 @@ ke KE Keblinski Keefe +Keffer keflag Keir Kelchner diff --git a/examples/README b/examples/README index c398579cde..0c09b6d847 100644 --- a/examples/README +++ b/examples/README @@ -94,7 +94,7 @@ msst: MSST shock dynamics nb3b: use of nonbonded 3-body harmonic pair style neb: nudged elastic band (NEB) calculation for barrier finding nemd: non-equilibrium MD of 2d sheared system -numdiff: numerical difference computation of forces +numdiff: numerical difference computation of forces and virial obstacle: flow around two voids in a 2d channel peptide: dynamics of a small solvated peptide chain (5-mer) peri: Peridynamic model of cylinder impacted by indenter diff --git a/examples/numdiff/in.numdiff b/examples/numdiff/in.numdiff index 07d39f2ddf..cd3d44a9e7 100644 --- a/examples/numdiff/in.numdiff +++ b/examples/numdiff/in.numdiff @@ -1,38 +1,74 @@ -# Numerical difference calculation of error in forces +# Numerical difference calculation +# of error in forces and virial stress -units metal -atom_style atomic +# adjustable parameters -atom_modify map yes -lattice fcc 5.358000 -region box block 0 3 0 3 0 3 -create_box 1 box -create_atoms 1 box -mass 1 39.903 +variable nsteps index 500 # length of run +variable nthermo index 10 # thermo output interval +variable ndump index 500 # dump output interval +variable nlat index 3 # size of box +variable fdelta index 1.0e-4 # displacement size +variable vdelta index 1.0e-6 # strain size +variable temp index 10.0 # temperature -velocity all create 10 2357 mom yes dist gaussian +units metal +atom_style atomic -pair_style lj/cubic -pair_coeff * * 0.0102701 3.42 +atom_modify map yes +lattice fcc 5.358000 +region box block 0 ${nlat} 0 ${nlat} 0 ${nlat} +create_box 1 box +create_atoms 1 box +mass 1 39.903 -neighbor 1.0 bin +velocity all create ${temp} 2357 mom yes dist gaussian -timestep 0.001 +pair_style lj/cubic +pair_coeff * * 0.0102701 3.42 -fix numforce all numdiff 100 0.0001 -fix numstress all numdiff/stress 100 1.0e-2 -fix nve all nve +neighbor 0.0 bin +neigh_modify every 1 delay 0 check no -variable errx atom fx-f_numforce[1] -variable erry atom fy-f_numforce[2] -variable errz atom fz-f_numforce[3] +timestep 0.001 +fix nve all nve -dump errors all custom 100 force_error.dump v_errx v_erry v_errz +# define numerical force calculation + +fix numforce all numdiff ${nthermo} ${fdelta} +variable ferrx atom f_numforce[1]-fx +variable ferry atom f_numforce[2]-fy +variable ferrz atom f_numforce[3]-fz +variable ferrsq atom v_ferrx^2+v_ferry^2+v_ferrz^2 +compute faverrsq all reduce ave v_ferrsq +variable fsq atom fx^2+fy^2+fz^2 +compute favsq all reduce ave v_fsq +variable frelerr equal sqrt(c_faverrsq/c_favsq) +dump errors all custom ${ndump} force_error.dump v_ferrx v_ferry v_ferrz + +# define numerical virial stress tensor calculation -variable ferrsq atom (fx-f_numforce[1])^2+(fy-f_numforce[2])^2+(fz-f_numforce[3])^2 -compute faverrsq all reduce ave v_ferrsq compute myvirial all pressure NULL virial -variable ratio11 equal f_numstress[1]/c_myvirial[1] -thermo_style custom step temp pe press c_faverrsq c_myvirial[*] f_numstress[*] v_ratio11 -thermo 100 -run 500 +fix numvirial all numdiff/virial ${nthermo} ${vdelta} +variable errxx equal f_numvirial[1]-c_myvirial[1] +variable erryy equal f_numvirial[2]-c_myvirial[2] +variable errzz equal f_numvirial[3]-c_myvirial[3] +variable erryz equal f_numvirial[4]-c_myvirial[6] +variable errxz equal f_numvirial[5]-c_myvirial[5] +variable errxy equal f_numvirial[6]-c_myvirial[4] +variable verrsq equal "v_errxx^2 + & + v_erryy^2 + & + v_errzz^2 + & + v_erryz^2 + & + v_errxz^2 + & + v_errxy^2" +variable vsq equal "c_myvirial[1]^2 + & + c_myvirial[3]^2 + & + c_myvirial[3]^2 + & + c_myvirial[4]^2 + & + c_myvirial[5]^2 + & + c_myvirial[6]^2" +variable vrelerr equal sqrt(v_verrsq/v_vsq) + +thermo_style custom step temp pe etotal press v_frelerr v_vrelerr +thermo ${nthermo} +run ${nsteps} diff --git a/examples/numdiff/log.28Jan2022.log.numdiff.g++.1 b/examples/numdiff/log.28Jan2022.log.numdiff.g++.1 new file mode 100644 index 0000000000..f32e72834f --- /dev/null +++ b/examples/numdiff/log.28Jan2022.log.numdiff.g++.1 @@ -0,0 +1,175 @@ +LAMMPS (7 Jan 2022) +# Numerical difference calculation +# of error in forces and virial stress + +# adjustable parameters + +variable nsteps index 500 # length of run +variable nthermo index 10 # thermo output interval +variable ndump index 500 # dump output interval +variable nlat index 3 # size of box +variable fdelta index 1.0e-4 # displacement size +variable vdelta index 1.0e-6 # strain size +variable temp index 10.0 # temperature + +units metal +atom_style atomic + +atom_modify map yes +lattice fcc 5.358000 +Lattice spacing in x,y,z = 5.358 5.358 5.358 +region box block 0 ${nlat} 0 ${nlat} 0 ${nlat} +region box block 0 3 0 ${nlat} 0 ${nlat} +region box block 0 3 0 3 0 ${nlat} +region box block 0 3 0 3 0 3 +create_box 1 box +Created orthogonal box = (0 0 0) to (16.074 16.074 16.074) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 108 atoms + using lattice units in orthogonal box = (0 0 0) to (16.074 16.074 16.074) + create_atoms CPU = 0.000 seconds +mass 1 39.903 + +velocity all create ${temp} 2357 mom yes dist gaussian +velocity all create 10.0 2357 mom yes dist gaussian + +pair_style lj/cubic +pair_coeff * * 0.0102701 3.42 + +neighbor 0.0 bin +neigh_modify every 1 delay 0 check no + +timestep 0.001 +fix nve all nve + +# define numerical force calculation + +fix numforce all numdiff ${nthermo} ${fdelta} +fix numforce all numdiff 10 ${fdelta} +fix numforce all numdiff 10 1.0e-4 +variable ferrx atom f_numforce[1]-fx +variable ferry atom f_numforce[2]-fy +variable ferrz atom f_numforce[3]-fz +variable ferrsq atom v_ferrx^2+v_ferry^2+v_ferrz^2 +compute faverrsq all reduce ave v_ferrsq +variable fsq atom fx^2+fy^2+fz^2 +compute favsq all reduce ave v_fsq +variable frelerr equal sqrt(c_faverrsq/c_favsq) +dump errors all custom ${ndump} force_error.dump v_ferrx v_ferry v_ferrz +dump errors all custom 500 force_error.dump v_ferrx v_ferry v_ferrz + +# define numerical virial stress tensor calculation + +compute myvirial all pressure NULL virial +fix numvirial all numdiff/virial ${nthermo} ${vdelta} +fix numvirial all numdiff/virial 10 ${vdelta} +fix numvirial all numdiff/virial 10 1.0e-6 +variable errxx equal f_numvirial[1]-c_myvirial[1] +variable erryy equal f_numvirial[2]-c_myvirial[2] +variable errzz equal f_numvirial[3]-c_myvirial[3] +variable erryz equal f_numvirial[4]-c_myvirial[6] +variable errxz equal f_numvirial[5]-c_myvirial[5] +variable errxy equal f_numvirial[6]-c_myvirial[4] +variable verrsq equal "v_errxx^2 + v_erryy^2 + v_errzz^2 + v_erryz^2 + v_errxz^2 + v_errxy^2" +variable vsq equal "c_myvirial[1]^2 + c_myvirial[3]^2 + c_myvirial[3]^2 + c_myvirial[4]^2 + c_myvirial[5]^2 + c_myvirial[6]^2" +variable vrelerr equal sqrt(v_verrsq/v_vsq) + +thermo_style custom step temp pe etotal press v_frelerr v_vrelerr +thermo ${nthermo} +thermo 10 +run ${nsteps} +run 500 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.9407173 + ghost atom cutoff = 5.9407173 + binsize = 2.9703587, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.083 | 6.083 | 6.083 Mbytes +Step Temp PotEng TotEng Press v_frelerr v_vrelerr + 0 10 -7.0259569 -6.8876486 28.564278 19203.344 1.5660292e-06 + 10 9.9376583 -7.0250947 -6.8876486 30.254762 1.5040965e-08 2.1991382e-07 + 20 9.7520139 -7.022527 -6.8876485 35.28505 1.4756358e-08 2.6265315e-06 + 30 9.4477557 -7.0183188 -6.8876485 43.519863 1.4688198e-08 2.6356166e-07 + 40 9.0330215 -7.0125826 -6.8876484 54.727797 1.4637921e-08 5.2292327e-08 + 50 8.5192918 -7.0054772 -6.8876483 68.585553 1.4587854e-08 7.1324716e-08 + 60 7.9212026 -6.997205 -6.8876481 84.684636 1.4525561e-08 3.1108149e-08 + 70 7.2562592 -6.9880081 -6.8876479 102.54088 1.450885e-08 3.2311094e-08 + 80 6.5444294 -6.9781627 -6.8876478 121.60715 1.4444738e-08 2.1776998e-08 + 90 5.8075961 -6.9679715 -6.8876476 141.2895 1.4493562e-08 2.0400898e-08 + 100 5.0688629 -6.957754 -6.8876474 160.9668 1.445455e-08 1.2636688e-08 + 110 4.3517145 -6.947835 -6.8876472 180.0135 1.4460371e-08 1.2528038e-08 + 120 3.6790589 -6.9385314 -6.887647 197.82486 1.4371757e-08 1.4489522e-08 + 130 3.0721984 -6.9301379 -6.8876468 213.84331 1.4364708e-08 1.2461922e-08 + 140 2.5497991 -6.9229125 -6.8876467 227.58429 1.4330926e-08 9.3913926e-09 + 150 2.1269443 -6.917064 -6.8876466 238.6596 1.4287002e-08 4.1510266e-09 + 160 1.8143642 -6.9127407 -6.8876465 246.79599 1.4282669e-08 7.7048281e-09 + 170 1.6179191 -6.9100237 -6.8876465 251.84748 1.42726e-08 1.2719973e-08 + 180 1.5383946 -6.9089239 -6.8876466 253.79991 1.4236534e-08 8.1200831e-09 + 190 1.5716287 -6.9093836 -6.8876467 252.76745 1.41706e-08 6.5670612e-09 + 200 1.7089493 -6.911283 -6.8876468 248.98142 1.4096463e-08 1.1685863e-08 + 210 1.9378716 -6.9144493 -6.8876469 242.77289 1.4008978e-08 1.1226902e-08 + 220 2.2429731 -6.9186692 -6.887647 234.55055 1.3886901e-08 9.9914102e-09 + 230 2.606862 -6.9237023 -6.8876472 224.77626 1.3864576e-08 1.1540228e-08 + 240 3.0111524 -6.9292941 -6.8876474 213.93996 1.3696314e-08 1.1697747e-08 + 250 3.4373794 -6.9351893 -6.8876475 202.53583 1.3626701e-08 1.0398197e-08 + 260 3.8678047 -6.9411426 -6.8876476 191.04084 1.3489489e-08 6.6603364e-09 + 270 4.2860853 -6.9469279 -6.8876478 179.89646 1.3312014e-08 1.1687917e-08 + 280 4.6777954 -6.9523457 -6.8876479 169.49404 1.3081144e-08 1.1336675e-08 + 290 5.030805 -6.9572282 -6.887648 160.16371 1.2947385e-08 1.7342825e-08 + 300 5.3355278 -6.9614428 -6.887648 152.16682 1.2893673e-08 1.7510534e-08 + 310 5.5850532 -6.964894 -6.887648 145.69148 1.2842022e-08 1.2782546e-08 + 320 5.7751794 -6.9675236 -6.8876481 140.85102 1.2903488e-08 1.5319437e-08 + 330 5.9043601 -6.9693103 -6.887648 137.68497 1.3076809e-08 1.1208999e-08 + 340 5.9735784 -6.9702676 -6.887648 136.16232 1.3296904e-08 1.891087e-08 + 350 5.9861549 -6.9704415 -6.887648 136.18679 1.3504051e-08 2.5783601e-08 + 360 5.947496 -6.9699067 -6.8876479 137.60397 1.3731112e-08 2.0556839e-08 + 370 5.8647874 -6.9687627 -6.8876478 140.2101 1.4009878e-08 2.1771736e-08 + 380 5.7466376 -6.9671285 -6.8876477 143.76234 1.4092054e-08 1.1085162e-08 + 390 5.6026773 -6.9651374 -6.8876477 147.99019 1.4282872e-08 2.0221602e-08 + 400 5.4431231 -6.9629305 -6.8876476 152.60787 1.4317739e-08 1.7076065e-08 + 410 5.2783192 -6.960651 -6.8876475 157.32722 1.4415075e-08 2.5031776e-08 + 420 5.1182723 -6.9584374 -6.8876474 161.87063 1.4441435e-08 2.2519289e-08 + 430 4.9722 -6.956417 -6.8876473 165.98344 1.4550624e-08 2.4512613e-08 + 440 4.8481153 -6.9547008 -6.8876473 169.44527 1.4544672e-08 1.4758301e-08 + 450 4.7524707 -6.9533779 -6.8876472 172.07964 1.4546492e-08 1.324687e-08 + 460 4.6898817 -6.9525122 -6.8876472 173.76132 1.4537475e-08 1.351367e-08 + 470 4.6629495 -6.9521397 -6.8876472 174.42109 1.4530458e-08 1.521106e-08 + 480 4.6721922 -6.9522675 -6.8876472 174.04742 1.4543785e-08 1.0905422e-08 + 490 4.7160887 -6.9528747 -6.8876473 172.68525 1.4545591e-08 2.0128525e-08 + 500 4.7912313 -6.953914 -6.8876473 170.43183 1.4438981e-08 1.6062775e-08 +Loop time of 0.837333 on 1 procs for 500 steps with 108 atoms + +Performance: 51.592 ns/day, 0.465 hours/ns, 597.134 timesteps/s +99.8% 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.0097726 | 0.0097726 | 0.0097726 | 0.0 | 1.17 +Neigh | 0.03095 | 0.03095 | 0.03095 | 0.0 | 3.70 +Comm | 0.005564 | 0.005564 | 0.005564 | 0.0 | 0.66 +Output | 0.0042451 | 0.0042451 | 0.0042451 | 0.0 | 0.51 +Modify | 0.78618 | 0.78618 | 0.78618 | 0.0 | 93.89 +Other | | 0.0006258 | | | 0.07 + +Nlocal: 108 ave 108 max 108 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 558 ave 558 max 558 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 972 ave 972 max 972 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 972 +Ave neighs/atom = 9 +Neighbor list builds = 500 +Dangerous builds not checked +Total wall time: 0:00:00 diff --git a/examples/numdiff/log.28Jan2022.log.numdiff.g++.4 b/examples/numdiff/log.28Jan2022.log.numdiff.g++.4 new file mode 100644 index 0000000000..fc56c4aee8 --- /dev/null +++ b/examples/numdiff/log.28Jan2022.log.numdiff.g++.4 @@ -0,0 +1,175 @@ +LAMMPS (7 Jan 2022) +# Numerical difference calculation +# of error in forces and virial stress + +# adjustable parameters + +variable nsteps index 500 # length of run +variable nthermo index 10 # thermo output interval +variable ndump index 500 # dump output interval +variable nlat index 3 # size of box +variable fdelta index 1.0e-4 # displacement size +variable vdelta index 1.0e-6 # strain size +variable temp index 10.0 # temperature + +units metal +atom_style atomic + +atom_modify map yes +lattice fcc 5.358000 +Lattice spacing in x,y,z = 5.358 5.358 5.358 +region box block 0 ${nlat} 0 ${nlat} 0 ${nlat} +region box block 0 3 0 ${nlat} 0 ${nlat} +region box block 0 3 0 3 0 ${nlat} +region box block 0 3 0 3 0 3 +create_box 1 box +Created orthogonal box = (0 0 0) to (16.074 16.074 16.074) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 108 atoms + using lattice units in orthogonal box = (0 0 0) to (16.074 16.074 16.074) + create_atoms CPU = 0.000 seconds +mass 1 39.903 + +velocity all create ${temp} 2357 mom yes dist gaussian +velocity all create 10.0 2357 mom yes dist gaussian + +pair_style lj/cubic +pair_coeff * * 0.0102701 3.42 + +neighbor 0.0 bin +neigh_modify every 1 delay 0 check no + +timestep 0.001 +fix nve all nve + +# define numerical force calculation + +fix numforce all numdiff ${nthermo} ${fdelta} +fix numforce all numdiff 10 ${fdelta} +fix numforce all numdiff 10 1.0e-4 +variable ferrx atom f_numforce[1]-fx +variable ferry atom f_numforce[2]-fy +variable ferrz atom f_numforce[3]-fz +variable ferrsq atom v_ferrx^2+v_ferry^2+v_ferrz^2 +compute faverrsq all reduce ave v_ferrsq +variable fsq atom fx^2+fy^2+fz^2 +compute favsq all reduce ave v_fsq +variable frelerr equal sqrt(c_faverrsq/c_favsq) +dump errors all custom ${ndump} force_error.dump v_ferrx v_ferry v_ferrz +dump errors all custom 500 force_error.dump v_ferrx v_ferry v_ferrz + +# define numerical virial stress tensor calculation + +compute myvirial all pressure NULL virial +fix numvirial all numdiff/virial ${nthermo} ${vdelta} +fix numvirial all numdiff/virial 10 ${vdelta} +fix numvirial all numdiff/virial 10 1.0e-6 +variable errxx equal f_numvirial[1]-c_myvirial[1] +variable erryy equal f_numvirial[2]-c_myvirial[2] +variable errzz equal f_numvirial[3]-c_myvirial[3] +variable erryz equal f_numvirial[4]-c_myvirial[6] +variable errxz equal f_numvirial[5]-c_myvirial[5] +variable errxy equal f_numvirial[6]-c_myvirial[4] +variable verrsq equal "v_errxx^2 + v_erryy^2 + v_errzz^2 + v_erryz^2 + v_errxz^2 + v_errxy^2" +variable vsq equal "c_myvirial[1]^2 + c_myvirial[3]^2 + c_myvirial[3]^2 + c_myvirial[4]^2 + c_myvirial[5]^2 + c_myvirial[6]^2" +variable vrelerr equal sqrt(v_verrsq/v_vsq) + +thermo_style custom step temp pe etotal press v_frelerr v_vrelerr +thermo ${nthermo} +thermo 10 +run ${nsteps} +run 500 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.9407173 + ghost atom cutoff = 5.9407173 + binsize = 2.9703587, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cubic, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.067 | 6.067 | 6.067 Mbytes +Step Temp PotEng TotEng Press v_frelerr v_vrelerr + 0 10 -7.0259569 -6.8876486 28.564278 10664.391 9.1481187e-08 + 10 9.9388179 -7.0251107 -6.8876486 30.21736 1.4771865e-08 1.3452512e-07 + 20 9.7572185 -7.022599 -6.8876485 35.123527 1.437525e-08 8.0966999e-07 + 30 9.4606673 -7.0184974 -6.8876484 43.132052 1.4375468e-08 1.990012e-08 + 40 9.0579092 -7.0129268 -6.8876483 54.000927 1.4350331e-08 1.7239028e-08 + 50 8.5607685 -7.0060508 -6.8876482 67.403151 1.4353284e-08 7.813181e-09 + 60 7.9838726 -6.9980717 -6.8876481 82.935358 1.4398078e-08 2.022316e-08 + 70 7.3442875 -6.9892255 -6.8876479 100.12892 1.434409e-08 7.5938179e-09 + 80 6.6610579 -6.9797757 -6.8876477 118.46358 1.4324787e-08 7.1972571e-09 + 90 5.9546462 -6.9700053 -6.8876476 137.38365 1.4322718e-08 4.3978378e-09 + 100 5.2462727 -6.9602077 -6.8876474 156.31651 1.4273172e-08 4.6728038e-09 + 110 4.5571706 -6.9506767 -6.8876472 174.69294 1.4266163e-08 3.522225e-09 + 120 3.9077807 -6.9416949 -6.887647 191.96859 1.42241e-08 3.5357511e-09 + 130 3.3169241 -6.9335227 -6.8876469 207.64566 1.4203813e-08 2.5182488e-09 + 140 2.8010028 -6.926387 -6.8876468 221.29333 1.4164215e-08 2.3112509e-09 + 150 2.3732854 -6.9204712 -6.8876467 232.5658 1.4134122e-08 1.9368963e-09 + 160 2.0433329 -6.9159076 -6.8876466 241.21647 1.4095473e-08 3.6806452e-09 + 170 1.8166184 -6.912772 -6.8876466 247.10715 1.4049531e-08 2.5319322e-09 + 180 1.6943727 -6.9110813 -6.8876467 250.21143 1.3997912e-08 1.952404e-09 + 190 1.6736731 -6.910795 -6.8876467 250.61203 1.3915487e-08 1.4271767e-09 + 200 1.7477659 -6.9118199 -6.8876468 248.49223 1.3850618e-08 2.4515718e-09 + 210 1.9065921 -6.9140167 -6.8876469 244.12226 1.3747916e-08 1.7957531e-09 + 220 2.1374676 -6.91721 -6.887647 237.84173 1.3674779e-08 2.6613511e-09 + 230 2.4258607 -6.9211989 -6.8876472 230.0395 1.3565712e-08 3.0777067e-09 + 240 2.7562034 -6.9257679 -6.8876473 221.13265 1.3440442e-08 1.7111501e-09 + 250 3.1126827 -6.9306984 -6.8876474 211.54566 1.3270914e-08 1.6690112e-09 + 260 3.4799641 -6.9357784 -6.8876476 201.69126 1.3105092e-08 2.1637558e-09 + 270 3.8438148 -6.9408108 -6.8876477 191.95361 1.2962846e-08 4.4613506e-09 + 280 4.191607 -6.9456212 -6.8876478 182.6745 1.2846383e-08 3.3730203e-09 + 290 4.5126922 -6.9500621 -6.8876478 174.14285 1.2710692e-08 2.2809889e-09 + 300 4.7986487 -6.9540172 -6.8876479 166.58747 1.2657778e-08 6.9880891e-09 + 310 5.0434083 -6.9574025 -6.8876479 160.17316 1.266381e-08 4.2486217e-09 + 320 5.243275 -6.9601668 -6.8876479 154.99974 1.279856e-08 5.1505673e-09 + 330 5.3968455 -6.9622908 -6.8876479 151.1038 1.2981831e-08 3.3339333e-09 + 340 5.5048468 -6.9637845 -6.8876479 148.46296 1.3159021e-08 1.7881393e-09 + 350 5.569902 -6.9646843 -6.8876479 147.00205 1.3439465e-08 5.6876219e-09 + 360 5.5962378 -6.9650485 -6.8876478 146.60113 1.3645943e-08 7.233847e-09 + 370 5.5893468 -6.9649531 -6.8876478 147.10471 1.3829581e-08 4.5514318e-09 + 380 5.5556199 -6.9644866 -6.8876477 148.33195 1.4005893e-08 4.2971846e-09 + 390 5.5019639 -6.9637444 -6.8876476 150.08725 1.4157454e-08 3.3564262e-09 + 400 5.4354239 -6.962824 -6.8876476 152.17073 1.4226422e-08 4.2393923e-09 + 410 5.3628267 -6.9618199 -6.8876475 154.38825 1.4302679e-08 3.8937698e-09 + 420 5.2904639 -6.960819 -6.8876475 156.56034 1.4381099e-08 4.315875e-09 + 430 5.2238282 -6.9598973 -6.8876474 158.52969 1.4426567e-08 4.2658185e-09 + 440 5.1674149 -6.9591171 -6.8876474 160.16704 1.4453381e-08 5.7055268e-09 + 450 5.1245913 -6.9585248 -6.8876474 161.37513 1.4449488e-08 4.4308801e-09 + 460 5.0975361 -6.9581506 -6.8876474 162.09077 1.4445596e-08 5.8269923e-09 + 470 5.0872416 -6.9580082 -6.8876474 162.28517 1.4444348e-08 4.8263194e-09 + 480 5.0935712 -6.9580957 -6.8876474 161.96268 1.4411666e-08 6.222228e-09 + 490 5.115362 -6.9583971 -6.8876474 161.15816 1.4369716e-08 3.3926077e-09 + 500 5.1505605 -6.958884 -6.8876474 159.9333 1.4288515e-08 3.8845251e-09 +Loop time of 0.252598 on 4 procs for 500 steps with 108 atoms + +Performance: 171.023 ns/day, 0.140 hours/ns, 1979.430 timesteps/s +99.8% 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.0021545 | 0.0022845 | 0.0023794 | 0.2 | 0.90 +Neigh | 0.0063887 | 0.0067604 | 0.0069752 | 0.3 | 2.68 +Comm | 0.01048 | 0.010916 | 0.011408 | 0.3 | 4.32 +Output | 0.0026603 | 0.0027399 | 0.0029738 | 0.3 | 1.08 +Modify | 0.2295 | 0.22952 | 0.22954 | 0.0 | 90.86 +Other | | 0.0003814 | | | 0.15 + +Nlocal: 27 ave 29 max 25 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Nghost: 325 ave 327 max 323 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 243 ave 273 max 228 min +Histogram: 1 1 1 0 0 0 0 0 0 1 + +Total # of neighbors = 972 +Ave neighs/atom = 9 +Neighbor list builds = 500 +Dangerous builds not checked +Total wall time: 0:00:00 diff --git a/src/EXTRA-FIX/fix_numdiff.cpp b/src/EXTRA-FIX/fix_numdiff.cpp index 4c9c08b681..757d6adab4 100644 --- a/src/EXTRA-FIX/fix_numdiff.cpp +++ b/src/EXTRA-FIX/fix_numdiff.cpp @@ -233,12 +233,17 @@ void FixNumDiff::calculate_forces() } } + // recompute energy so all contributions are as before + + energy = update_energy(); + // restore original forces for owned and ghost atoms for (i = 0; i < nall; i++) for (j = 0; j < 3; j++) { f[i][j] = temp_f[i][j]; } + } /* ---------------------------------------------------------------------- diff --git a/src/EXTRA-FIX/fix_numdiff_stress.cpp b/src/EXTRA-FIX/fix_numdiff_virial.cpp similarity index 82% rename from src/EXTRA-FIX/fix_numdiff_stress.cpp rename to src/EXTRA-FIX/fix_numdiff_virial.cpp index cc1adc7e2a..4d1cf20028 100644 --- a/src/EXTRA-FIX/fix_numdiff_stress.cpp +++ b/src/EXTRA-FIX/fix_numdiff_virial.cpp @@ -16,7 +16,7 @@ Contributing author: Aidan Thompson (Sandia) ------------------------------------------------------------------------- */ -#include "fix_numdiff_stress.h" +#include "fix_numdiff_virial.h" #include #include "atom.h" @@ -40,16 +40,17 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixNumDiffStress::FixNumDiffStress(LAMMPS *lmp, int narg, char **arg) : +FixNumDiffVirial::FixNumDiffVirial(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), id_pe(nullptr), temp_x(nullptr), temp_f(nullptr) { - if (narg < 5) error->all(FLERR,"Illegal fix numdiff/stress command"); + if (narg < 5) error->all(FLERR,"Illegal fix numdiff/virial command"); + if (igroup) error->all(FLERR,"Compute numdiff/virial must use group all"); peratom_freq = nevery; respa_level_support = 1; vector_flag = 1; - size_vector = NDIR_STRESS; + size_vector = NDIR_VIRIAL; extvector = 0; maxatom = 0; @@ -96,7 +97,7 @@ FixNumDiffStress::FixNumDiffStress(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixNumDiffStress::~FixNumDiffStress() +FixNumDiffVirial::~FixNumDiffVirial() { memory->destroy(temp_x); memory->destroy(temp_f); @@ -107,7 +108,7 @@ FixNumDiffStress::~FixNumDiffStress() /* ---------------------------------------------------------------------- */ -int FixNumDiffStress::setmask() +int FixNumDiffVirial::setmask() { datamask_read = datamask_modify = 0; @@ -120,7 +121,7 @@ int FixNumDiffStress::setmask() /* ---------------------------------------------------------------------- */ -void FixNumDiffStress::init() +void FixNumDiffVirial::init() { // check for PE compute @@ -141,7 +142,7 @@ void FixNumDiffStress::init() /* ---------------------------------------------------------------------- */ -void FixNumDiffStress::setup(int vflag) +void FixNumDiffVirial::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); @@ -154,39 +155,39 @@ void FixNumDiffStress::setup(int vflag) /* ---------------------------------------------------------------------- */ -void FixNumDiffStress::min_setup(int vflag) +void FixNumDiffVirial::min_setup(int vflag) { post_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixNumDiffStress::post_force(int /* vflag */) +void FixNumDiffVirial::post_force(int /* vflag */) { if (update->ntimestep % nevery) return; - calculate_stress(); + calculate_virial(); } /* ---------------------------------------------------------------------- */ -void FixNumDiffStress::post_force_respa(int vflag, int ilevel, int /*iloop*/) +void FixNumDiffVirial::post_force_respa(int vflag, int ilevel, int /*iloop*/) { if (ilevel == ilevel_respa) post_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixNumDiffStress::min_post_force(int vflag) +void FixNumDiffVirial::min_post_force(int vflag) { post_force(vflag); } /* ---------------------------------------------------------------------- - compute finite difference stress tensor + compute finite difference virial stress tensor ------------------------------------------------------------------------- */ -void FixNumDiffStress::calculate_stress() +void FixNumDiffVirial::calculate_virial() { double energy; @@ -198,8 +199,7 @@ void FixNumDiffStress::calculate_stress() double **x = atom->x; double **f = atom->f; - int nlocal = atom->nlocal; - int nall = nlocal + atom->nghost; + int nall = atom->nlocal + atom->nghost; for (int i = 0; i < nall; i++) for (int k = 0; k < 3; k++) { @@ -216,17 +216,22 @@ void FixNumDiffStress::calculate_stress() double denominator = -0.5 / delta * inv_volume * nktv2p; - for (int idir = 0; idir < NDIR_STRESS; idir++) { + for (int idir = 0; idir < NDIR_VIRIAL; idir++) { displace_atoms(nall, idir, 1.0); energy = update_energy(); - stress[idir] = energy; - displace_atoms(nall, idir,-1.0); + virial[idir] = energy; + restore_atoms(nall, idir); + displace_atoms(nall, idir, -1.0); energy = update_energy(); - stress[idir] -= energy; - stress[idir] *= denominator; + virial[idir] -= energy; + virial[idir] *= denominator; restore_atoms(nall, idir); } + // recompute energy so all contributions are as before + + energy = update_energy(); + // restore original forces for owned and ghost atoms for (int i = 0; i < nall; i++) @@ -239,13 +244,13 @@ void FixNumDiffStress::calculate_stress() displace position of all owned and ghost atoms ---------------------------------------------------------------------- */ -void FixNumDiffStress::displace_atoms(int nall, int idir, double magnitude) +void FixNumDiffVirial::displace_atoms(int nall, int idir, double magnitude) { double **x = atom->x; int k = dirlist[idir][0]; int l = dirlist[idir][1]; for (int i = 0; i < nall; i++) - x[i][k] += temp_x[i][k] + delta*magnitude* + x[i][k] = temp_x[i][k] + delta*magnitude* (temp_x[i][l]-fixedpoint[l]); } @@ -253,7 +258,7 @@ void FixNumDiffStress::displace_atoms(int nall, int idir, double magnitude) restore position of all owned and ghost atoms ---------------------------------------------------------------------- */ -void FixNumDiffStress::restore_atoms(int nall, int idir) +void FixNumDiffVirial::restore_atoms(int nall, int idir) { double **x = atom->x; int k = dirlist[idir][0]; @@ -267,7 +272,7 @@ void FixNumDiffStress::restore_atoms(int nall, int idir) same logic as in Verlet ------------------------------------------------------------------------- */ -double FixNumDiffStress::update_energy() +double FixNumDiffVirial::update_energy() { int eflag = 1; @@ -286,43 +291,33 @@ double FixNumDiffStress::update_energy() return energy; } -/* ---------------------------------------------------------------------- - clear forces needed -------------------------------------------------------------------------- */ - -void FixNumDiffStress::stress_clear() -{ - size_t nbytes = sizeof(double) * size_vector; - memset(&stress[0],0,nbytes); -} - /* ---------------------------------------------------------------------- return Ith vector value, assume in range of size_vector ------------------------------------------------------------------------- */ -double FixNumDiffStress::compute_vector(int i) +double FixNumDiffVirial::compute_vector(int i) { - return stress[i]; + return virial[i]; } /* ---------------------------------------------------------------------- reallocated local per-atoms arrays ------------------------------------------------------------------------- */ -void FixNumDiffStress::reallocate() +void FixNumDiffVirial::reallocate() { memory->destroy(temp_x); memory->destroy(temp_f); maxatom = atom->nmax; - memory->create(temp_x,maxatom,3,"numdiff/stress:temp_x"); - memory->create(temp_f,maxatom,3,"numdiff/stress:temp_f"); + memory->create(temp_x,maxatom,3,"numdiff/virial:temp_x"); + memory->create(temp_f,maxatom,3,"numdiff/virial:temp_f"); } /* ---------------------------------------------------------------------- memory usage of local atom-based arrays ------------------------------------------------------------------------- */ -double FixNumDiffStress::memory_usage() +double FixNumDiffVirial::memory_usage() { double bytes = 0.0; bytes += (double)2 * maxatom*3 * sizeof(double); diff --git a/src/EXTRA-FIX/fix_numdiff_stress.h b/src/EXTRA-FIX/fix_numdiff_virial.h similarity index 73% rename from src/EXTRA-FIX/fix_numdiff_stress.h rename to src/EXTRA-FIX/fix_numdiff_virial.h index 4ca0c533ad..69eae142a9 100644 --- a/src/EXTRA-FIX/fix_numdiff_stress.h +++ b/src/EXTRA-FIX/fix_numdiff_virial.h @@ -13,21 +13,21 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(numdiff/stress,FixNumDiffStress); +FixStyle(numdiff/virial,FixNumDiffVirial); // clang-format on #else -#ifndef LMP_FIX_NUMDIFF_STRESS_H -#define LMP_FIX_NUMDIFF_STRESS_H +#ifndef LMP_FIX_NUMDIFF_VIRIAL_H +#define LMP_FIX_NUMDIFF_VIRIAL_H #include "fix.h" namespace LAMMPS_NS { -class FixNumDiffStress : public Fix { +class FixNumDiffVirial : public Fix { public: - FixNumDiffStress(class LAMMPS *, int, char **); - ~FixNumDiffStress(); + FixNumDiffVirial(class LAMMPS *, int, char **); + ~FixNumDiffVirial(); int setmask() override; void init() override; void setup(int) override; @@ -38,7 +38,7 @@ class FixNumDiffStress : public Fix { double memory_usage() override; private: - static const int NDIR_STRESS = 6; // dimension of stress and strain vectors + static const int NDIR_VIRIAL = 6; // dimension of virial and strain vectors double delta; // strain magnitude int maxatom; // allocated size of atom arrays int ilevel_respa; @@ -49,18 +49,18 @@ class FixNumDiffStress : public Fix { char *id_pe; // name of energy compute class Compute *pe; // pointer to energy compute - double stress[NDIR_STRESS]; // finite diff stress components (Voigt order) + double virial[NDIR_VIRIAL]; // finite diff virial components (Voigt order) double **temp_x; // original coords double **temp_f; // original forces double fixedpoint[3]; // define displacement field origin - int dirlist[NDIR_STRESS][2];// strain cartesian indices (Voigt order) + int dirlist[NDIR_VIRIAL][2];// strain cartesian indices (Voigt order) - double compute_vector(int) override; // access function for stress - void calculate_stress(); // stress calculation + double compute_vector(int) override; // access function for virial + void calculate_virial(); // virial calculation void displace_atoms(int, int, double);// apply displacement field void restore_atoms(int, int); // restore original positions double update_energy(); // calculate new energy - void stress_clear(); // set stress to zero + void virial_clear(); // set virial to zero void reallocate(); // grow the atom arrays }; @@ -77,8 +77,13 @@ 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 ID for fix numdiff/stress does not exist +E: Compute ID for fix numdiff/virial does not exist Self-explanatory. +E: Fix numdiff/virial must use group all + +Virial contributions computed by this fix are +computed on all atoms. + */ From 5c0c3df035706c36ecab60d680b3f1202365527f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 21:10:30 -0500 Subject: [PATCH 124/174] make use of CMAKE_(RUNTIME|LIBRARY)_OUTPUT_DIRECTORY --- cmake/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 49d3bfb845..2487537f8c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -19,6 +19,9 @@ set(SOVERSION 0) get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE) get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE) +# collect all executables and shared libs in the top level build folder +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Folder for executables, DLLs and shared objects" FORCE) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Folder for libraries" FORCE) set(LAMMPS_SOURCE_DIR ${LAMMPS_DIR}/src) set(LAMMPS_LIB_SOURCE_DIR ${LAMMPS_DIR}/lib) From 7978bf671d2375541f97bca2608904bfc4ddfa77 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 21:12:13 -0500 Subject: [PATCH 125/174] use canonical syntax for adding tests --- unittest/c-library/CMakeLists.txt | 14 +++++++------- unittest/cplusplus/CMakeLists.txt | 6 +++--- unittest/force-styles/CMakeLists.txt | 2 +- unittest/fortran/CMakeLists.txt | 4 ++-- unittest/utils/CMakeLists.txt | 20 ++++++++------------ 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/unittest/c-library/CMakeLists.txt b/unittest/c-library/CMakeLists.txt index 3d57dbbc90..4a0442968d 100644 --- a/unittest/c-library/CMakeLists.txt +++ b/unittest/c-library/CMakeLists.txt @@ -1,26 +1,26 @@ add_executable(test_library_open test_library_open.cpp test_main.cpp) target_link_libraries(test_library_open PRIVATE lammps GTest::GMock) -add_test(LibraryOpen test_library_open) +add_test(NAME LibraryOpen COMMAND test_library_open WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_library_commands test_library_commands.cpp test_main.cpp) target_link_libraries(test_library_commands PRIVATE lammps GTest::GMock) -add_test(LibraryCommands test_library_commands) +add_test(NAME LibraryCommands COMMAND test_library_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_library_external test_library_external.cpp test_main.cpp) target_link_libraries(test_library_external PRIVATE lammps GTest::GMock) -add_test(LibraryExternal test_library_external) +add_test(NAME LibraryExternal COMMAND test_library_external WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_library_properties test_library_properties.cpp test_main.cpp) target_link_libraries(test_library_properties PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_properties PRIVATE -DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}) -add_test(LibraryProperties test_library_properties) +add_test(NAME LibraryProperties COMMAND test_library_properties WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(LibraryProperties PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") add_executable(test_library_scatter_gather test_library_scatter_gather.cpp test_main.cpp) target_link_libraries(test_library_scatter_gather PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_scatter_gather PRIVATE -DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}) -add_test(LibraryScatterGather test_library_scatter_gather) +add_test(NAME LibraryScatterGather COMMAND test_library_scatter_gather WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(LibraryScatterGather PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") set(TEST_CONFIG_DEFS "-DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR};-DLAMMPS_${LAMMPS_SIZES}") @@ -65,9 +65,9 @@ endforeach() add_executable(test_library_config test_library_config.cpp test_main.cpp) target_link_libraries(test_library_config PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_config PRIVATE ${TEST_CONFIG_DEFS}) -add_test(LibraryConfig test_library_config) +add_test(NAME LibraryConfig COMMAND test_library_config WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_library_mpi test_library_mpi.cpp) target_link_libraries(test_library_mpi PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_mpi PRIVATE ${TEST_CONFIG_DEFS}) -add_mpi_test(NAME LibraryMPI NUM_PROCS 4 COMMAND $) +add_mpi_test(NAME LibraryMPI NUM_PROCS 4 COMMAND $ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/unittest/cplusplus/CMakeLists.txt b/unittest/cplusplus/CMakeLists.txt index efd194b9d2..ff192dd8d0 100644 --- a/unittest/cplusplus/CMakeLists.txt +++ b/unittest/cplusplus/CMakeLists.txt @@ -1,13 +1,13 @@ add_executable(test_lammps_class test_lammps_class.cpp) target_link_libraries(test_lammps_class PRIVATE lammps GTest::GMockMain) -add_test(LammpsClass test_lammps_class) +add_test(NAME LammpsClass COMMAND test_lammps_class WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(LammpsClass PROPERTIES ENVIRONMENT "OMP_NUM_THREADS=1") add_executable(test_input_class test_input_class.cpp) target_link_libraries(test_input_class PRIVATE lammps GTest::GTestMain) -add_test(InputClass test_input_class) +add_test(NAME InputClass COMMAND test_input_class WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_error_class test_error_class.cpp) target_link_libraries(test_error_class PRIVATE lammps GTest::GMock) -add_test(ErrorClass test_error_class) +add_test(NAME ErrorClass COMMAND test_error_class WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 5fec488e22..b8e8bce9c2 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -59,7 +59,7 @@ endif() add_executable(test_error_stats test_error_stats.cpp) target_include_directories(test_error_stats PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${LAMMPS_SOURCE_DIR}) target_link_libraries(test_error_stats PRIVATE gtest_main) -add_test(NAME ErrorStats COMMAND test_error_stats) +add_test(NAME ErrorStats COMMAND test_error_stats WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # pair style tester add_executable(test_pair_style test_pair_style.cpp) diff --git a/unittest/fortran/CMakeLists.txt b/unittest/fortran/CMakeLists.txt index 6e7e165018..4b4d51b7ae 100644 --- a/unittest/fortran/CMakeLists.txt +++ b/unittest/fortran/CMakeLists.txt @@ -26,11 +26,11 @@ if(CMAKE_Fortran_COMPILER) add_executable(test_fortran_create wrap_create.cpp test_fortran_create.f90) target_link_libraries(test_fortran_create PRIVATE flammps lammps MPI::MPI_Fortran GTest::GTestMain) - add_test(FortranOpen test_fortran_create) + add_test(NAME FortranOpen COMMAND test_fortran_create WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_fortran_commands wrap_commands.cpp test_fortran_commands.f90) target_link_libraries(test_fortran_commands PRIVATE flammps lammps MPI::MPI_Fortran GTest::GTestMain) - add_test(FortranCommands test_fortran_commands) + add_test(NAME FortranCommands COMMAND test_fortran_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) else() message(STATUS "Skipping Tests for the LAMMPS Fortran Module: no Fortran compiler") endif() diff --git a/unittest/utils/CMakeLists.txt b/unittest/utils/CMakeLists.txt index 6a3a2efc8e..156cb62f11 100644 --- a/unittest/utils/CMakeLists.txt +++ b/unittest/utils/CMakeLists.txt @@ -1,22 +1,23 @@ + add_executable(test_tokenizer test_tokenizer.cpp) target_link_libraries(test_tokenizer PRIVATE lammps GTest::GMockMain) -add_test(Tokenizer test_tokenizer) +add_test(NAME Tokenizer COMMAND test_tokenizer WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_mempool test_mempool.cpp) target_link_libraries(test_mempool PRIVATE lammps GTest::GMockMain) -add_test(MemPool test_mempool) +add_test(NAME MemPool COMMAND test_mempool WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_argutils test_argutils.cpp) target_link_libraries(test_argutils PRIVATE lammps GTest::GMockMain) -add_test(ArgUtils test_argutils) +add_test(NAME ArgUtils COMMAND test_argutils WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_utils test_utils.cpp) target_link_libraries(test_utils PRIVATE lammps GTest::GMockMain) -add_test(Utils test_utils) +add_test(NAME Utils COMMAND test_utils WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_platform test_platform.cpp) target_link_libraries(test_platform PRIVATE lammps GTest::GMockMain) -add_test(Platform test_platform) +add_test(NAME Platform COMMAND test_platform WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(Utils Platform PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") @@ -35,13 +36,8 @@ endif() add_executable(test_fmtlib test_fmtlib.cpp) target_link_libraries(test_fmtlib PRIVATE lammps GTest::GMockMain) -add_test(FmtLib test_fmtlib) +add_test(NAME FmtLib COMMAND test_fmtlib WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(test_math_eigen_impl test_math_eigen_impl.cpp) target_include_directories(test_math_eigen_impl PRIVATE ${LAMMPS_SOURCE_DIR}) -add_test(MathEigen test_math_eigen_impl 10 5) - -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - set_tests_properties(Tokenizer MemPool ArgUtils Utils Platform FmtLib MathEigen PROPERTIES - ENVIRONMENT "PATH=${CMAKE_BINARY_DIR}:$ENV{PATH}") -endif() +add_test(NAME MathEigen COMMAND test_math_eigen_impl 10 5 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) From 8423ecb2116e5ba5b2ec2079ede3666d4c157f9b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 21:28:37 -0500 Subject: [PATCH 126/174] small tweaks to make things work with the new settings --- unittest/commands/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/commands/CMakeLists.txt b/unittest/commands/CMakeLists.txt index 49603a8b22..d7b49ea24e 100644 --- a/unittest/commands/CMakeLists.txt +++ b/unittest/commands/CMakeLists.txt @@ -11,7 +11,7 @@ endif() target_link_libraries(test_simple_commands PRIVATE lammps GTest::GMock) add_test(NAME SimpleCommands COMMAND test_simple_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set_tests_properties(SimpleCommands PROPERTIES - ENVIRONMENT "LAMMPS_PLUGIN_BIN_DIR=${CMAKE_BINARY_DIR}/build-plugins") + ENVIRONMENT "LAMMPS_PLUGIN_BIN_DIR=${CMAKE_BINARY_DIR}") add_executable(test_lattice_region test_lattice_region.cpp) target_link_libraries(test_lattice_region PRIVATE lammps GTest::GMock) From d6fa3a08cd42c66d6c6137cc3470c046ed534328 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 28 Jan 2022 21:54:32 -0500 Subject: [PATCH 127/174] roll back library aliasing changes as that negatively interferes with unit tests --- cmake/CMakeLists.txt | 13 ++++++++++--- cmake/Modules/Packages/GPU.cmake | 6 +++++- examples/plugins/LAMMPSInterfaceCXX.cmake | 4 +++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2487537f8c..2bfe3ce245 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -290,13 +290,13 @@ if(BUILD_MPI) target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG) endif() endif() + target_link_libraries(lammps PUBLIC MPI::MPI_CXX) else() target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) add_library(mpi_stubs INTERFACE) target_include_directories(mpi_stubs INTERFACE $) - add_library(MPI::MPI_CXX ALIAS mpi_stubs) + target_link_libraries(lammps PUBLIC mpi_stubs) endif() -target_link_libraries(lammps PUBLIC MPI::MPI_CXX) 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) @@ -577,7 +577,11 @@ if(PKG_ATC) if(LAMMPS_SIZES STREQUAL "BIGBIG") message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG") endif() - target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX) + if(BUILD_MPI) + target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX) + else() + target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs) + endif() target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}) target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES}) endif() @@ -691,6 +695,9 @@ foreach(_DEF ${LAMMPS_DEFINES}) endforeach() if(BUILD_SHARED_LIBS) install(TARGETS lammps EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(NOT BUILD_MPI) + install(TARGETS mpi_stubs EXPORT LAMMPS_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() configure_file(pkgconfig/liblammps.pc.in ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblammps${LAMMPS_MACHINE}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(EXPORT LAMMPS_Targets FILE LAMMPS_Targets.cmake NAMESPACE LAMMPS:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LAMMPS) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index ee839e20e1..fe15917f47 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -422,9 +422,13 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) +if(BUILD_MPI) + target_link_libraries(gpu PRIVATE MPI::MPI_CXX) +else() + target_link_libraries(gpu PRIVATE mpi_stubs) +endif() target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE}) target_sources(lammps PRIVATE ${GPU_SOURCES}) target_include_directories(lammps PRIVATE ${GPU_SOURCES_DIR}) -target_link_libraries(gpu PRIVATE MPI::MPI_CXX) diff --git a/examples/plugins/LAMMPSInterfaceCXX.cmake b/examples/plugins/LAMMPSInterfaceCXX.cmake index e910ec2923..d52cf8f4e5 100644 --- a/examples/plugins/LAMMPSInterfaceCXX.cmake +++ b/examples/plugins/LAMMPSInterfaceCXX.cmake @@ -42,8 +42,10 @@ if(BUILD_MPI) if(LAMMPS_LONGLONG_TO_LONG) target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) endif() + target_link_libraries(lammps INTERFACE MPI::MPI_CXX) +else() + target_include_directories(lammps INTERFACE "${LAMMPS_SOURCE_DIR}/STUBS") endif() -target_link_libraries(lammps INTERFACE MPI::MPI_CXX) 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) From c1185acad7804105c509622f0c379d478b714c87 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 07:52:06 -0500 Subject: [PATCH 128/174] enable and apply clang-format --- src/EXTRA-FIX/fix_numdiff_virial.cpp | 117 +++++++++++++-------------- src/EXTRA-FIX/fix_numdiff_virial.h | 36 ++++----- 2 files changed, 74 insertions(+), 79 deletions(-) diff --git a/src/EXTRA-FIX/fix_numdiff_virial.cpp b/src/EXTRA-FIX/fix_numdiff_virial.cpp index 4d1cf20028..ac7654e166 100644 --- a/src/EXTRA-FIX/fix_numdiff_virial.cpp +++ b/src/EXTRA-FIX/fix_numdiff_virial.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -18,22 +17,23 @@ #include "fix_numdiff_virial.h" -#include -#include "atom.h" -#include "domain.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "respa.h" -#include "force.h" -#include "pair.h" -#include "bond.h" #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "compute.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "improper.h" #include "kspace.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "pair.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -41,28 +41,24 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixNumDiffVirial::FixNumDiffVirial(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(nullptr), - temp_x(nullptr), temp_f(nullptr) + Fix(lmp, narg, arg), id_pe(nullptr), temp_x(nullptr), temp_f(nullptr) { - if (narg < 5) error->all(FLERR,"Illegal fix numdiff/virial command"); - if (igroup) error->all(FLERR,"Compute numdiff/virial must use group all"); + if (narg < 5) error->all(FLERR, "Illegal fix numdiff/virial command"); + if (igroup) error->all(FLERR, "Compute numdiff/virial must use group all"); peratom_freq = nevery; respa_level_support = 1; vector_flag = 1; size_vector = NDIR_VIRIAL; extvector = 0; - maxatom = 0; - - nevery = utils::inumeric(FLERR,arg[3],false,lmp); - delta = utils::numeric(FLERR,arg[4],false,lmp); - if (nevery <= 0 || delta <= 0.0) - error->all(FLERR,"Illegal fix numdiff command"); + + nevery = utils::inumeric(FLERR, arg[3], false, lmp); + delta = utils::numeric(FLERR, arg[4], false, lmp); + if (nevery <= 0 || delta <= 0.0) error->all(FLERR, "Illegal fix numdiff command"); std::string cmd = id + std::string("_pe"); id_pe = utils::strdup(cmd); - cmd += " all pe"; modify->add_compute(cmd); @@ -74,9 +70,9 @@ FixNumDiffVirial::FixNumDiffVirial(LAMMPS *lmp, int narg, char **arg) : // set fixed-point to default = center of cell - fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]); - fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]); - fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]); + fixedpoint[0] = 0.5 * (domain->boxlo[0] + domain->boxhi[0]); + fixedpoint[1] = 0.5 * (domain->boxlo[1] + domain->boxhi[1]); + fixedpoint[2] = 0.5 * (domain->boxlo[2] + domain->boxhi[2]); // define the cartesian indices for each strain (Voigt order) @@ -86,7 +82,7 @@ FixNumDiffVirial::FixNumDiffVirial(LAMMPS *lmp, int narg, char **arg) : dirlist[1][1] = 1; dirlist[2][0] = 2; dirlist[2][1] = 2; - + dirlist[3][0] = 1; dirlist[3][1] = 2; dirlist[4][0] = 0; @@ -126,17 +122,21 @@ void FixNumDiffVirial::init() // check for PE compute int icompute = modify->find_compute(id_pe); - if (icompute < 0) error->all(FLERR,"Compute ID for fix numdiff does not exist"); + if (icompute < 0) error->all(FLERR, "Compute ID for fix numdiff does not exist"); pe = modify->compute[icompute]; - if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; - else pair_compute_flag = 0; - if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; - else kspace_compute_flag = 0; + if (force->pair && force->pair->compute_flag) + pair_compute_flag = 1; + else + pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) + kspace_compute_flag = 1; + else + kspace_compute_flag = 0; - if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; - if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); + if (utils::strmatch(update->integrate_style, "^respa")) { + ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; + if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } } @@ -144,11 +144,11 @@ void FixNumDiffVirial::init() void FixNumDiffVirial::setup(int vflag) { - if (utils::strmatch(update->integrate_style,"^verlet")) + if (utils::strmatch(update->integrate_style, "^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); - post_force_respa(vflag,ilevel_respa,0); + post_force_respa(vflag, ilevel_respa, 0); ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); } } @@ -206,11 +206,11 @@ void FixNumDiffVirial::calculate_virial() temp_x[i][k] = x[i][k]; temp_f[i][k] = f[i][k]; } - + // loop over 6 strain directions // compute a finite difference force in each dimension - int flag,allflag; + int flag, allflag; double nktv2p = force->nktv2p; double inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); @@ -228,16 +228,14 @@ void FixNumDiffVirial::calculate_virial() restore_atoms(nall, idir); } - // recompute energy so all contributions are as before + // recompute energy so all contributions are as before energy = update_energy(); // restore original forces for owned and ghost atoms - + for (int i = 0; i < nall; i++) - for (int k = 0; k < 3; k++) - f[i][k] = temp_f[i][k]; - + for (int k = 0; k < 3; k++) f[i][k] = temp_f[i][k]; } /* ---------------------------------------------------------------------- @@ -247,11 +245,10 @@ void FixNumDiffVirial::calculate_virial() void FixNumDiffVirial::displace_atoms(int nall, int idir, double magnitude) { double **x = atom->x; - int k = dirlist[idir][0]; - int l = dirlist[idir][1]; + int k = dirlist[idir][0]; + int l = dirlist[idir][1]; for (int i = 0; i < nall; i++) - x[i][k] = temp_x[i][k] + delta*magnitude* - (temp_x[i][l]-fixedpoint[l]); + x[i][k] = temp_x[i][k] + delta * magnitude * (temp_x[i][l] - fixedpoint[l]); } /* ---------------------------------------------------------------------- @@ -261,10 +258,8 @@ void FixNumDiffVirial::displace_atoms(int nall, int idir, double magnitude) void FixNumDiffVirial::restore_atoms(int nall, int idir) { double **x = atom->x; - int k = dirlist[idir][0]; - for (int i = 0; i < nall; i++) { - x[i][k] = temp_x[i][k]; - } + int k = dirlist[idir][0]; + for (int i = 0; i < nall; i++) { x[i][k] = temp_x[i][k]; } } /* ---------------------------------------------------------------------- @@ -276,16 +271,16 @@ double FixNumDiffVirial::update_energy() { int eflag = 1; - if (pair_compute_flag) force->pair->compute(eflag,0); + if (pair_compute_flag) force->pair->compute(eflag, 0); if (atom->molecular != Atom::ATOMIC) { - if (force->bond) force->bond->compute(eflag,0); - if (force->angle) force->angle->compute(eflag,0); - if (force->dihedral) force->dihedral->compute(eflag,0); - if (force->improper) force->improper->compute(eflag,0); + if (force->bond) force->bond->compute(eflag, 0); + if (force->angle) force->angle->compute(eflag, 0); + if (force->dihedral) force->dihedral->compute(eflag, 0); + if (force->improper) force->improper->compute(eflag, 0); } - if (kspace_compute_flag) force->kspace->compute(eflag,0); + if (kspace_compute_flag) force->kspace->compute(eflag, 0); double energy = pe->compute_scalar(); return energy; @@ -309,8 +304,8 @@ void FixNumDiffVirial::reallocate() memory->destroy(temp_x); memory->destroy(temp_f); maxatom = atom->nmax; - memory->create(temp_x,maxatom,3,"numdiff/virial:temp_x"); - memory->create(temp_f,maxatom,3,"numdiff/virial:temp_f"); + memory->create(temp_x, maxatom, 3, "numdiff/virial:temp_x"); + memory->create(temp_f, maxatom, 3, "numdiff/virial:temp_f"); } /* ---------------------------------------------------------------------- @@ -320,6 +315,6 @@ void FixNumDiffVirial::reallocate() double FixNumDiffVirial::memory_usage() { double bytes = 0.0; - bytes += (double)2 * maxatom*3 * sizeof(double); + bytes += (double) 2 * maxatom * 3 * sizeof(double); return bytes; } diff --git a/src/EXTRA-FIX/fix_numdiff_virial.h b/src/EXTRA-FIX/fix_numdiff_virial.h index 69eae142a9..a553894f55 100644 --- a/src/EXTRA-FIX/fix_numdiff_virial.h +++ b/src/EXTRA-FIX/fix_numdiff_virial.h @@ -38,30 +38,30 @@ class FixNumDiffVirial : public Fix { double memory_usage() override; private: - static const int NDIR_VIRIAL = 6; // dimension of virial and strain vectors - double delta; // strain magnitude - int maxatom; // allocated size of atom arrays + static const int NDIR_VIRIAL = 6; // dimension of virial and strain vectors + double delta; // strain magnitude + int maxatom; // allocated size of atom arrays int ilevel_respa; int pair_compute_flag; // 0 if pair->compute is skipped int kspace_compute_flag; // 0 if kspace->compute is skipped - char *id_pe; // name of energy compute - class Compute *pe; // pointer to energy compute + char *id_pe; // name of energy compute + class Compute *pe; // pointer to energy compute - double virial[NDIR_VIRIAL]; // finite diff virial components (Voigt order) - double **temp_x; // original coords - double **temp_f; // original forces - double fixedpoint[3]; // define displacement field origin - int dirlist[NDIR_VIRIAL][2];// strain cartesian indices (Voigt order) - - double compute_vector(int) override; // access function for virial - void calculate_virial(); // virial calculation - void displace_atoms(int, int, double);// apply displacement field - void restore_atoms(int, int); // restore original positions - double update_energy(); // calculate new energy - void virial_clear(); // set virial to zero - void reallocate(); // grow the atom arrays + double virial[NDIR_VIRIAL]; // finite diff virial components (Voigt order) + double **temp_x; // original coords + double **temp_f; // original forces + double fixedpoint[3]; // define displacement field origin + int dirlist[NDIR_VIRIAL][2]; // strain cartesian indices (Voigt order) + + double compute_vector(int) override; // access function for virial + void calculate_virial(); // virial calculation + void displace_atoms(int, int, double); // apply displacement field + void restore_atoms(int, int); // restore original positions + double update_energy(); // calculate new energy + void virial_clear(); // set virial to zero + void reallocate(); // grow the atom arrays }; } // namespace LAMMPS_NS From 9427eb800f2af69cf4d428c11d838e35d91eadf3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 07:55:58 -0500 Subject: [PATCH 129/174] add missing "override" --- src/EXTRA-FIX/fix_numdiff_virial.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EXTRA-FIX/fix_numdiff_virial.h b/src/EXTRA-FIX/fix_numdiff_virial.h index a553894f55..9abe9a9aa1 100644 --- a/src/EXTRA-FIX/fix_numdiff_virial.h +++ b/src/EXTRA-FIX/fix_numdiff_virial.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixNumDiffVirial : public Fix { public: FixNumDiffVirial(class LAMMPS *, int, char **); - ~FixNumDiffVirial(); + ~FixNumDiffVirial() override; int setmask() override; void init() override; void setup(int) override; From 17960c81833406d3e903bcd16e13f10d29a8b46e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 07:56:11 -0500 Subject: [PATCH 130/174] use constexpr instead of const --- src/EXTRA-FIX/fix_numdiff_virial.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EXTRA-FIX/fix_numdiff_virial.h b/src/EXTRA-FIX/fix_numdiff_virial.h index 9abe9a9aa1..71910afc1c 100644 --- a/src/EXTRA-FIX/fix_numdiff_virial.h +++ b/src/EXTRA-FIX/fix_numdiff_virial.h @@ -38,9 +38,9 @@ class FixNumDiffVirial : public Fix { double memory_usage() override; private: - static const int NDIR_VIRIAL = 6; // dimension of virial and strain vectors - double delta; // strain magnitude - int maxatom; // allocated size of atom arrays + static constexpr int NDIR_VIRIAL = 6; // dimension of virial and strain vectors + double delta; // strain magnitude + int maxatom; // allocated size of atom arrays int ilevel_respa; int pair_compute_flag; // 0 if pair->compute is skipped From ee98f023b67f366b272fc825d76b1e41fcb9bbd0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 08:02:59 -0500 Subject: [PATCH 131/174] enable and apply clang-format --- src/EXTRA-FIX/fix_numdiff.cpp | 116 +++++++++++++++++----------------- 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/src/EXTRA-FIX/fix_numdiff.cpp b/src/EXTRA-FIX/fix_numdiff.cpp index 757d6adab4..97067d316b 100644 --- a/src/EXTRA-FIX/fix_numdiff.cpp +++ b/src/EXTRA-FIX/fix_numdiff.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -18,22 +17,23 @@ #include "fix_numdiff.h" -#include -#include "atom.h" -#include "domain.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "respa.h" -#include "force.h" -#include "pair.h" -#include "bond.h" #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "compute.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "improper.h" #include "kspace.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "pair.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -41,20 +41,18 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(nullptr), numdiff_forces(nullptr), - temp_x(nullptr), temp_f(nullptr) + Fix(lmp, narg, arg), id_pe(nullptr), numdiff_forces(nullptr), temp_x(nullptr), temp_f(nullptr) { - if (narg < 5) error->all(FLERR,"Illegal fix numdiff command"); + if (narg < 5) error->all(FLERR, "Illegal fix numdiff command"); peratom_flag = 1; peratom_freq = nevery; size_peratom_cols = 3; respa_level_support = 1; - nevery = utils::inumeric(FLERR,arg[3],false,lmp); - delta = utils::numeric(FLERR,arg[4],false,lmp); - if (nevery <= 0 || delta <= 0.0) - error->all(FLERR,"Illegal fix numdiff command"); + nevery = utils::inumeric(FLERR, arg[3], false, lmp); + delta = utils::numeric(FLERR, arg[4], false, lmp); + if (nevery <= 0 || delta <= 0.0) error->all(FLERR, "Illegal fix numdiff command"); std::string cmd = id + std::string("_pe"); id_pe = utils::strdup(cmd); @@ -65,7 +63,7 @@ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : maxatom = 0; if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"Fix numdiff requires an atom map, see atom_modify"); + error->all(FLERR, "Fix numdiff requires an atom map, see atom_modify"); // perform initial allocation of atom-based arrays // zero numdiff_forces since dump may access it on timestep 0 @@ -84,7 +82,7 @@ FixNumDiff::~FixNumDiff() memory->destroy(temp_f); modify->delete_compute(id_pe); - delete [] id_pe; + delete[] id_pe; } /* ---------------------------------------------------------------------- */ @@ -107,22 +105,26 @@ void FixNumDiff::init() // require consecutive atom IDs if (!atom->tag_enable || !atom->tag_consecutive()) - error->all(FLERR,"Fix numdiff requires consecutive atom IDs"); + error->all(FLERR, "Fix numdiff requires consecutive atom IDs"); // check for PE compute int icompute = modify->find_compute(id_pe); - if (icompute < 0) error->all(FLERR,"Compute ID for fix numdiff does not exist"); + if (icompute < 0) error->all(FLERR, "Compute ID for fix numdiff does not exist"); pe = modify->compute[icompute]; - if (force->pair && force->pair->compute_flag) pair_compute_flag = 1; - else pair_compute_flag = 0; - if (force->kspace && force->kspace->compute_flag) kspace_compute_flag = 1; - else kspace_compute_flag = 0; + if (force->pair && force->pair->compute_flag) + pair_compute_flag = 1; + else + pair_compute_flag = 0; + if (force->kspace && force->kspace->compute_flag) + kspace_compute_flag = 1; + else + kspace_compute_flag = 0; - if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; - if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); + if (utils::strmatch(update->integrate_style, "^respa")) { + ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; + if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } } @@ -130,11 +132,11 @@ void FixNumDiff::init() void FixNumDiff::setup(int vflag) { - if (utils::strmatch(update->integrate_style,"^verlet")) + if (utils::strmatch(update->integrate_style, "^verlet")) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); - post_force_respa(vflag,ilevel_respa,0); + post_force_respa(vflag, ilevel_respa, 0); ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); } } @@ -175,7 +177,7 @@ void FixNumDiff::min_post_force(int vflag) void FixNumDiff::calculate_forces() { - int i,j,ilocal; + int i, j, ilocal; double energy; // grow arrays if necessary @@ -202,48 +204,44 @@ void FixNumDiff::calculate_forces() // loop over all atoms in system // compute a finite difference force in each dimension - int flag,allflag; + int flag, allflag; double denominator = 0.5 / delta; int *mask = atom->mask; - int ntotal = static_cast (atom->natoms); + int ntotal = static_cast(atom->natoms); int dimension = domain->dimension; for (tagint m = 1; m <= ntotal; m++) { ilocal = atom->map(m); flag = 0; if ((ilocal >= 0 && ilocal < nlocal) && (mask[ilocal] & groupbit)) flag = 1; - MPI_Allreduce(&flag,&allflag,1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(&flag, &allflag, 1, MPI_INT, MPI_SUM, world); if (!allflag) continue; for (int idim = 0; idim < dimension; idim++) { - displace_atoms(ilocal,idim,1); + displace_atoms(ilocal, idim, 1); energy = update_energy(); - if (ilocal >= 0 && ilocal < nlocal) - numdiff_forces[ilocal][idim] -= energy; + if (ilocal >= 0 && ilocal < nlocal) numdiff_forces[ilocal][idim] -= energy; - displace_atoms(ilocal,idim,-2); + displace_atoms(ilocal, idim, -2); energy = update_energy(); if (ilocal >= 0 && ilocal < nlocal) { numdiff_forces[ilocal][idim] += energy; numdiff_forces[ilocal][idim] *= denominator; } - restore_atoms(ilocal,idim); + restore_atoms(ilocal, idim); } } - // recompute energy so all contributions are as before + // recompute energy so all contributions are as before energy = update_energy(); // restore original forces for owned and ghost atoms for (i = 0; i < nall; i++) - for (j = 0; j < 3; j++) { - f[i][j] = temp_f[i][j]; - } - + for (j = 0; j < 3; j++) { f[i][j] = temp_f[i][j]; } } /* ---------------------------------------------------------------------- @@ -257,11 +255,11 @@ void FixNumDiff::displace_atoms(int ilocal, int idim, int magnitude) double **x = atom->x; int *sametag = atom->sametag; int j = ilocal; - x[ilocal][idim] += delta*magnitude; + x[ilocal][idim] += delta * magnitude; while (sametag[j] >= 0) { j = sametag[j]; - x[j][idim] += delta*magnitude; + x[j][idim] += delta * magnitude; } } @@ -295,16 +293,16 @@ double FixNumDiff::update_energy() int eflag = 1; - if (pair_compute_flag) force->pair->compute(eflag,0); + if (pair_compute_flag) force->pair->compute(eflag, 0); if (atom->molecular != Atom::ATOMIC) { - if (force->bond) force->bond->compute(eflag,0); - if (force->angle) force->angle->compute(eflag,0); - if (force->dihedral) force->dihedral->compute(eflag,0); - if (force->improper) force->improper->compute(eflag,0); + if (force->bond) force->bond->compute(eflag, 0); + if (force->angle) force->angle->compute(eflag, 0); + if (force->dihedral) force->dihedral->compute(eflag, 0); + if (force->improper) force->improper->compute(eflag, 0); } - if (kspace_compute_flag) force->kspace->compute(eflag,0); + if (kspace_compute_flag) force->kspace->compute(eflag, 0); double energy = pe->compute_scalar(); return energy; @@ -318,7 +316,7 @@ void FixNumDiff::force_clear(double **forces) { size_t nbytes = sizeof(double) * atom->nlocal; if (force->newton) nbytes += sizeof(double) * atom->nghost; - if (nbytes) memset(&forces[0][0],0,3*nbytes); + if (nbytes) memset(&forces[0][0], 0, 3 * nbytes); } /* ---------------------------------------------------------------------- @@ -331,9 +329,9 @@ void FixNumDiff::reallocate() memory->destroy(temp_x); memory->destroy(temp_f); maxatom = atom->nmax; - memory->create(numdiff_forces,maxatom,3,"numdiff:numdiff_force"); - memory->create(temp_x,maxatom,3,"numdiff:temp_x"); - memory->create(temp_f,maxatom,3,"numdiff:temp_f"); + memory->create(numdiff_forces, maxatom, 3, "numdiff:numdiff_force"); + memory->create(temp_x, maxatom, 3, "numdiff:temp_x"); + memory->create(temp_f, maxatom, 3, "numdiff:temp_f"); array_atom = numdiff_forces; } @@ -344,6 +342,6 @@ void FixNumDiff::reallocate() double FixNumDiff::memory_usage() { double bytes = 0.0; - bytes += (double)3 * maxatom*3 * sizeof(double); + bytes += (double) 3 * maxatom * 3 * sizeof(double); return bytes; } From 481bcfcd14b1f363cafb42f550fc7697c81ee0e7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 08:12:28 -0500 Subject: [PATCH 132/174] spelling --- doc/utils/sphinx-config/false_positives.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 9bc6a24dfb..408a20f179 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -669,6 +669,7 @@ Derlet Deserno Destree destructor +destructors detils Devanathan devel From dad72a612a6645b9975608b32242901bbc8eba7c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 08:18:08 -0500 Subject: [PATCH 133/174] correct statement (PPPM **does** support triclinic for a while already) --- doc/src/fix_viscosity.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/src/fix_viscosity.rst b/doc/src/fix_viscosity.rst index e92d1eab92..204e435d6e 100644 --- a/doc/src/fix_viscosity.rst +++ b/doc/src/fix_viscosity.rst @@ -110,10 +110,9 @@ An alternative method for calculating a viscosity is to run a NEMD simulation, as described on the :doc:`Howto nemd ` doc page. NEMD simulations deform the simulation box via the :doc:`fix deform ` command. -Thus they cannot be run on a charged -system using a :doc:`PPPM solver ` since PPPM does not -currently support non-orthogonal boxes. Using fix viscosity keeps the -box orthogonal; thus it does not suffer from this limitation. +Some features or combination of settings in LAMMPS do not support +non-orthogonal boxes. Using fix viscosity keeps the box orthogonal; +thus it does not suffer from these limitations. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" From d62e25decc02442bf7d0a0d075dd71bc4bc2f851 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 11:10:23 -0500 Subject: [PATCH 134/174] don't specify default working directory for tests explicitly --- unittest/CMakeLists.txt | 9 ++---- unittest/c-library/CMakeLists.txt | 14 ++++---- unittest/commands/CMakeLists.txt | 12 +++---- unittest/cplusplus/CMakeLists.txt | 6 ++-- unittest/force-styles/CMakeLists.txt | 20 ++++++------ unittest/formats/CMakeLists.txt | 48 ++++++++++++++-------------- unittest/fortran/CMakeLists.txt | 4 +-- unittest/python/CMakeLists.txt | 4 +-- unittest/utils/CMakeLists.txt | 14 ++++---- 9 files changed, 64 insertions(+), 67 deletions(-) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 6489287097..a310b82c07 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -26,24 +26,21 @@ add_library(GTest::GMockMain ALIAS gmock_main) # the LAMMPS version header in the output for an empty input file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/in.empty "") add_test(NAME RunLammps - COMMAND $ -log none -echo none -in in.empty - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + COMMAND $ -log none -echo none -in in.empty) set_tests_properties(RunLammps PROPERTIES ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" PASS_REGULAR_EXPRESSION "LAMMPS \\([0-9]+ [A-Za-z]+ 2[0-9][0-9][0-9]( - Update [0-9]+)?\\)") # check if the compiled executable will print the help message add_test(NAME HelpMessage - COMMAND $ -h - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + COMMAND $ -h) set_tests_properties(HelpMessage PROPERTIES ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" PASS_REGULAR_EXPRESSION ".*Large-scale Atomic/Molecular Massively Parallel Simulator -.*Usage example:.*") # check if the compiled executable will error out on an invalid command line flag add_test(NAME InvalidFlag - COMMAND $ -xxx - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + COMMAND $ -xxx) set_tests_properties(InvalidFlag PROPERTIES ENVIRONMENT "TSAN_OPTIONS=ignore_noninstrumented_modules=1;HWLOC_HIDE_ERRORS=1" PASS_REGULAR_EXPRESSION "ERROR: Invalid command-line argument.*") diff --git a/unittest/c-library/CMakeLists.txt b/unittest/c-library/CMakeLists.txt index 4a0442968d..e9409be0cc 100644 --- a/unittest/c-library/CMakeLists.txt +++ b/unittest/c-library/CMakeLists.txt @@ -1,26 +1,26 @@ add_executable(test_library_open test_library_open.cpp test_main.cpp) target_link_libraries(test_library_open PRIVATE lammps GTest::GMock) -add_test(NAME LibraryOpen COMMAND test_library_open WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LibraryOpen COMMAND test_library_open) add_executable(test_library_commands test_library_commands.cpp test_main.cpp) target_link_libraries(test_library_commands PRIVATE lammps GTest::GMock) -add_test(NAME LibraryCommands COMMAND test_library_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LibraryCommands COMMAND test_library_commands) add_executable(test_library_external test_library_external.cpp test_main.cpp) target_link_libraries(test_library_external PRIVATE lammps GTest::GMock) -add_test(NAME LibraryExternal COMMAND test_library_external WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LibraryExternal COMMAND test_library_external) add_executable(test_library_properties test_library_properties.cpp test_main.cpp) target_link_libraries(test_library_properties PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_properties PRIVATE -DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}) -add_test(NAME LibraryProperties COMMAND test_library_properties WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LibraryProperties COMMAND test_library_properties) set_tests_properties(LibraryProperties PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") add_executable(test_library_scatter_gather test_library_scatter_gather.cpp test_main.cpp) target_link_libraries(test_library_scatter_gather PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_scatter_gather PRIVATE -DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}) -add_test(NAME LibraryScatterGather COMMAND test_library_scatter_gather WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LibraryScatterGather COMMAND test_library_scatter_gather) set_tests_properties(LibraryScatterGather PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") set(TEST_CONFIG_DEFS "-DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR};-DLAMMPS_${LAMMPS_SIZES}") @@ -65,9 +65,9 @@ endforeach() add_executable(test_library_config test_library_config.cpp test_main.cpp) target_link_libraries(test_library_config PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_config PRIVATE ${TEST_CONFIG_DEFS}) -add_test(NAME LibraryConfig COMMAND test_library_config WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LibraryConfig COMMAND test_library_config) add_executable(test_library_mpi test_library_mpi.cpp) target_link_libraries(test_library_mpi PRIVATE lammps GTest::GMock) target_compile_definitions(test_library_mpi PRIVATE ${TEST_CONFIG_DEFS}) -add_mpi_test(NAME LibraryMPI NUM_PROCS 4 COMMAND $ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_mpi_test(NAME LibraryMPI NUM_PROCS 4 COMMAND $) diff --git a/unittest/commands/CMakeLists.txt b/unittest/commands/CMakeLists.txt index d7b49ea24e..d4f437dc4c 100644 --- a/unittest/commands/CMakeLists.txt +++ b/unittest/commands/CMakeLists.txt @@ -9,21 +9,21 @@ if((NOT (CMAKE_SYSTEM_NAME STREQUAL "Windows")) AND PKG_PLUGIN) endif() target_link_libraries(test_simple_commands PRIVATE lammps GTest::GMock) -add_test(NAME SimpleCommands COMMAND test_simple_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME SimpleCommands COMMAND test_simple_commands) set_tests_properties(SimpleCommands PROPERTIES ENVIRONMENT "LAMMPS_PLUGIN_BIN_DIR=${CMAKE_BINARY_DIR}") add_executable(test_lattice_region test_lattice_region.cpp) target_link_libraries(test_lattice_region PRIVATE lammps GTest::GMock) -add_test(NAME LatticeRegion COMMAND test_lattice_region WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LatticeRegion COMMAND test_lattice_region) add_executable(test_groups test_groups.cpp) target_link_libraries(test_groups PRIVATE lammps GTest::GMock) -add_test(NAME Groups COMMAND test_groups WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME Groups COMMAND test_groups) add_executable(test_variables test_variables.cpp) target_link_libraries(test_variables PRIVATE lammps GTest::GMock) -add_test(NAME Variables COMMAND test_variables WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME Variables COMMAND test_variables) add_executable(test_kim_commands test_kim_commands.cpp) if(KIM_EXTRA_UNITTESTS) @@ -34,12 +34,12 @@ if(KIM_EXTRA_UNITTESTS) endif() endif() target_link_libraries(test_kim_commands PRIVATE lammps GTest::GMock) -add_test(NAME KimCommands COMMAND test_kim_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME KimCommands COMMAND test_kim_commands) add_executable(test_reset_ids test_reset_ids.cpp) target_compile_definitions(test_reset_ids PRIVATE -DTEST_INPUT_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(test_reset_ids PRIVATE lammps GTest::GMock) -add_test(NAME ResetIDs COMMAND test_reset_ids WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME ResetIDs COMMAND test_reset_ids) add_executable(test_mpi_load_balancing test_mpi_load_balancing.cpp) target_link_libraries(test_mpi_load_balancing PRIVATE lammps GTest::GMock) diff --git a/unittest/cplusplus/CMakeLists.txt b/unittest/cplusplus/CMakeLists.txt index ff192dd8d0..88f082a204 100644 --- a/unittest/cplusplus/CMakeLists.txt +++ b/unittest/cplusplus/CMakeLists.txt @@ -1,13 +1,13 @@ add_executable(test_lammps_class test_lammps_class.cpp) target_link_libraries(test_lammps_class PRIVATE lammps GTest::GMockMain) -add_test(NAME LammpsClass COMMAND test_lammps_class WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME LammpsClass COMMAND test_lammps_class) set_tests_properties(LammpsClass PROPERTIES ENVIRONMENT "OMP_NUM_THREADS=1") add_executable(test_input_class test_input_class.cpp) target_link_libraries(test_input_class PRIVATE lammps GTest::GTestMain) -add_test(NAME InputClass COMMAND test_input_class WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME InputClass COMMAND test_input_class) add_executable(test_error_class test_error_class.cpp) target_link_libraries(test_error_class PRIVATE lammps GTest::GMock) -add_test(NAME ErrorClass COMMAND test_error_class WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME ErrorClass COMMAND test_error_class) diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index b8e8bce9c2..0a4a1ce33e 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -59,7 +59,7 @@ endif() add_executable(test_error_stats test_error_stats.cpp) target_include_directories(test_error_stats PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${LAMMPS_SOURCE_DIR}) target_link_libraries(test_error_stats PRIVATE gtest_main) -add_test(NAME ErrorStats COMMAND test_error_stats WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME ErrorStats COMMAND test_error_stats) # pair style tester add_executable(test_pair_style test_pair_style.cpp) @@ -77,7 +77,7 @@ endif() foreach(TEST ${MOL_PAIR_TESTS}) string(REGEX REPLACE "^.*mol-pair-(.*)\.yaml" "MolPairStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -87,7 +87,7 @@ file(GLOB ATOMIC_PAIR_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/atomic-p foreach(TEST ${ATOMIC_PAIR_TESTS}) string(REGEX REPLACE "^.*atomic-pair-(.*)\.yaml" "AtomicPairStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -97,7 +97,7 @@ file(GLOB MANYBODY_PAIR_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/manybo foreach(TEST ${MANYBODY_PAIR_TESTS}) string(REGEX REPLACE "^.*manybody-pair-(.*)\.yaml" "ManybodyPairStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -110,7 +110,7 @@ file(GLOB BOND_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/bond-*.yaml) foreach(TEST ${BOND_TESTS}) string(REGEX REPLACE "^.*bond-(.*)\.yaml" "BondStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_bond_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_bond_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -123,7 +123,7 @@ file(GLOB ANGLE_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml) foreach(TEST ${ANGLE_TESTS}) string(REGEX REPLACE "^.*angle-(.*)\.yaml" "AngleStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_angle_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_angle_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -137,7 +137,7 @@ endif() foreach(TEST ${KSPACE_TESTS}) string(REGEX REPLACE "^.*kspace-(.*)\.yaml" "KSpaceStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -154,7 +154,7 @@ file(GLOB FIX_TIMESTEP_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/fix-tim foreach(TEST ${FIX_TIMESTEP_TESTS}) string(REGEX REPLACE "^.*fix-timestep-(.*)\.yaml" "FixTimestep:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_fix_timestep ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_fix_timestep ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -167,7 +167,7 @@ file(GLOB DIHEDRAL_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/dihedral-*. foreach(TEST ${DIHEDRAL_TESTS}) string(REGEX REPLACE "^.*dihedral-(.*)\.yaml" "DihedralStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_dihedral_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_dihedral_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -180,7 +180,7 @@ file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/improper-*. foreach(TEST ${IMPROPER_TESTS}) string(REGEX REPLACE "^.*improper-(.*)\.yaml" "ImproperStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) - add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() diff --git a/unittest/formats/CMakeLists.txt b/unittest/formats/CMakeLists.txt index be8e055adb..8a198d4c64 100644 --- a/unittest/formats/CMakeLists.txt +++ b/unittest/formats/CMakeLists.txt @@ -1,49 +1,49 @@ add_executable(test_atom_styles test_atom_styles.cpp) target_link_libraries(test_atom_styles PRIVATE lammps GTest::GMock) -add_test(NAME AtomStyles COMMAND test_atom_styles WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME AtomStyles COMMAND test_atom_styles) add_executable(test_image_flags test_image_flags.cpp) target_link_libraries(test_image_flags PRIVATE lammps GTest::GMock) -add_test(NAME ImageFlags COMMAND test_image_flags WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME ImageFlags COMMAND test_image_flags) add_executable(test_input_convert test_input_convert.cpp) target_link_libraries(test_input_convert PRIVATE lammps GTest::GMockMain) -add_test(NAME InputConvert COMMAND test_input_convert WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME InputConvert COMMAND test_input_convert) add_executable(test_molecule_file test_molecule_file.cpp) target_link_libraries(test_molecule_file PRIVATE lammps GTest::GMock) -add_test(NAME MoleculeFile COMMAND test_molecule_file WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME MoleculeFile COMMAND test_molecule_file) add_executable(test_pair_unit_convert test_pair_unit_convert.cpp) target_link_libraries(test_pair_unit_convert PRIVATE lammps GTest::GMock) -add_test(NAME PairUnitConvert COMMAND test_pair_unit_convert WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME PairUnitConvert COMMAND test_pair_unit_convert) set_tests_properties(PairUnitConvert PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") add_executable(test_potential_file_reader test_potential_file_reader.cpp) target_link_libraries(test_potential_file_reader PRIVATE lammps GTest::GMock) -add_test(NAME PotentialFileReader COMMAND test_potential_file_reader WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME PotentialFileReader COMMAND test_potential_file_reader) set_tests_properties(PotentialFileReader PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") if(PKG_MANYBODY) add_executable(test_eim_potential_file_reader test_eim_potential_file_reader.cpp) target_link_libraries(test_eim_potential_file_reader PRIVATE lammps GTest::GMock) - add_test(NAME EIMPotentialFileReader COMMAND test_eim_potential_file_reader WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME EIMPotentialFileReader COMMAND test_eim_potential_file_reader) set_tests_properties(EIMPotentialFileReader PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") endif() add_executable(test_text_file_reader test_text_file_reader.cpp) target_link_libraries(test_text_file_reader PRIVATE lammps GTest::GMock) -add_test(NAME TextFileReader COMMAND test_text_file_reader WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME TextFileReader COMMAND test_text_file_reader) set_tests_properties(TextFileReader PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") add_executable(test_file_operations test_file_operations.cpp) target_link_libraries(test_file_operations PRIVATE lammps GTest::GMock) -add_test(NAME FileOperations COMMAND test_file_operations WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME FileOperations COMMAND test_file_operations) add_executable(test_dump_atom test_dump_atom.cpp) target_link_libraries(test_dump_atom PRIVATE lammps GTest::GMock) -add_test(NAME DumpAtom COMMAND test_dump_atom WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME DumpAtom COMMAND test_dump_atom) set_tests_properties(DumpAtom PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") if(PKG_COMPRESS) @@ -64,19 +64,19 @@ if(PKG_COMPRESS) add_executable(test_dump_xyz_compressed test_dump_xyz_compressed.cpp compressed_dump_test_main.cpp) target_link_libraries(test_dump_xyz_compressed PRIVATE lammps GTest::GMock) - add_test(NAME DumpAtomGZ COMMAND test_dump_atom_compressed gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpAtomGZ COMMAND test_dump_atom_compressed gz) set_tests_properties(DumpAtomGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${GZIP_BINARY}") - add_test(NAME DumpCustomGZ COMMAND test_dump_custom_compressed gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpCustomGZ COMMAND test_dump_custom_compressed gz) set_tests_properties(DumpCustomGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${GZIP_BINARY}") - add_test(NAME DumpCfgGZ COMMAND test_dump_cfg_compressed gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpCfgGZ COMMAND test_dump_cfg_compressed gz) set_tests_properties(DumpCfgGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${GZIP_BINARY}") - add_test(NAME DumpLocalGZ COMMAND test_dump_local_compressed gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpLocalGZ COMMAND test_dump_local_compressed gz) set_tests_properties(DumpLocalGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${GZIP_BINARY}") - add_test(NAME DumpXYZGZ COMMAND test_dump_xyz_compressed gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpXYZGZ COMMAND test_dump_xyz_compressed gz) set_tests_properties(DumpXYZGZ PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${GZIP_BINARY}") find_package(PkgConfig REQUIRED) @@ -84,43 +84,43 @@ if(PKG_COMPRESS) find_program(ZSTD_BINARY NAMES zstd) if(Zstd_FOUND AND ZSTD_BINARY) - add_test(NAME DumpAtomZstd COMMAND test_dump_atom_compressed zstd WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpAtomZstd COMMAND test_dump_atom_compressed zstd) set_tests_properties(DumpAtomZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${ZSTD_BINARY}") - add_test(NAME DumpCustomZstd COMMAND test_dump_custom_compressed zstd WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpCustomZstd COMMAND test_dump_custom_compressed zstd) set_tests_properties(DumpCustomZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${ZSTD_BINARY}") - add_test(NAME DumpCfgZstd COMMAND test_dump_cfg_compressed zstd WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpCfgZstd COMMAND test_dump_cfg_compressed zstd) set_tests_properties(DumpCfgZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${ZSTD_BINARY}") - add_test(NAME DumpLocalZstd COMMAND test_dump_local_compressed zstd WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpLocalZstd COMMAND test_dump_local_compressed zstd) set_tests_properties(DumpLocalZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${ZSTD_BINARY}") - add_test(NAME DumpXYZZstd COMMAND test_dump_xyz_compressed zstd WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpXYZZstd COMMAND test_dump_xyz_compressed zstd) set_tests_properties(DumpXYZZstd PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};COMPRESS_BINARY=${ZSTD_BINARY}") endif() endif() add_executable(test_dump_custom test_dump_custom.cpp) target_link_libraries(test_dump_custom PRIVATE lammps GTest::GMock) -add_test(NAME DumpCustom COMMAND test_dump_custom WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME DumpCustom COMMAND test_dump_custom) set_tests_properties(DumpCustom PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") add_executable(test_dump_cfg test_dump_cfg.cpp) target_link_libraries(test_dump_cfg PRIVATE lammps GTest::GMock) -add_test(NAME DumpCfg COMMAND test_dump_cfg WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME DumpCfg COMMAND test_dump_cfg) set_tests_properties(DumpCfg PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") add_executable(test_dump_local test_dump_local.cpp) target_link_libraries(test_dump_local PRIVATE lammps GTest::GMock) -add_test(NAME DumpLocal COMMAND test_dump_local WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME DumpLocal COMMAND test_dump_local) set_tests_properties(DumpLocal PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") if(PKG_NETCDF) find_program(NCDUMP NAMES ncdump ncdump.exe) add_executable(test_dump_netcdf test_dump_netcdf.cpp) target_link_libraries(test_dump_netcdf PRIVATE lammps GTest::GMock) - add_test(NAME DumpNetCDF COMMAND test_dump_netcdf WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME DumpNetCDF COMMAND test_dump_netcdf) if(NOT (NCDUMP STREQUAL "NCDUMP-NOTFOUND")) set_tests_properties(DumpNetCDF PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};NCDUMP_BINARY=${NCDUMP}") endif() diff --git a/unittest/fortran/CMakeLists.txt b/unittest/fortran/CMakeLists.txt index 4b4d51b7ae..2e7703747b 100644 --- a/unittest/fortran/CMakeLists.txt +++ b/unittest/fortran/CMakeLists.txt @@ -26,11 +26,11 @@ if(CMAKE_Fortran_COMPILER) add_executable(test_fortran_create wrap_create.cpp test_fortran_create.f90) target_link_libraries(test_fortran_create PRIVATE flammps lammps MPI::MPI_Fortran GTest::GTestMain) - add_test(NAME FortranOpen COMMAND test_fortran_create WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME FortranOpen COMMAND test_fortran_create) add_executable(test_fortran_commands wrap_commands.cpp test_fortran_commands.f90) target_link_libraries(test_fortran_commands PRIVATE flammps lammps MPI::MPI_Fortran GTest::GTestMain) - add_test(NAME FortranCommands COMMAND test_fortran_commands WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + add_test(NAME FortranCommands COMMAND test_fortran_commands) else() message(STATUS "Skipping Tests for the LAMMPS Fortran Module: no Fortran compiler") endif() diff --git a/unittest/python/CMakeLists.txt b/unittest/python/CMakeLists.txt index f61a9c61ab..3cc6b9a91b 100644 --- a/unittest/python/CMakeLists.txt +++ b/unittest/python/CMakeLists.txt @@ -28,7 +28,7 @@ if(Python3_Development_FOUND) target_compile_definitions(test_python_package PRIVATE -DTEST_HAVE_PYTHON_DEVELOPMENT=1) target_link_libraries(test_python_package PRIVATE Python3::Python) endif() -add_test(NAME PythonPackage COMMAND test_python_package WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME PythonPackage COMMAND test_python_package) set_tests_properties(PythonPackage PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH};PYTHONUNBUFFERED=1") if(Python_EXECUTABLE) @@ -36,7 +36,7 @@ if(Python_EXECUTABLE) set(PYTHON_TEST_ENVIRONMENT PYTHONPATH=${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}) get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(BUILD_IS_MULTI_CONFIG) - set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) + set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) else() set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}) endif() diff --git a/unittest/utils/CMakeLists.txt b/unittest/utils/CMakeLists.txt index 156cb62f11..c01313ad8d 100644 --- a/unittest/utils/CMakeLists.txt +++ b/unittest/utils/CMakeLists.txt @@ -1,23 +1,23 @@ add_executable(test_tokenizer test_tokenizer.cpp) target_link_libraries(test_tokenizer PRIVATE lammps GTest::GMockMain) -add_test(NAME Tokenizer COMMAND test_tokenizer WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME Tokenizer COMMAND test_tokenizer) add_executable(test_mempool test_mempool.cpp) target_link_libraries(test_mempool PRIVATE lammps GTest::GMockMain) -add_test(NAME MemPool COMMAND test_mempool WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME MemPool COMMAND test_mempool) add_executable(test_argutils test_argutils.cpp) target_link_libraries(test_argutils PRIVATE lammps GTest::GMockMain) -add_test(NAME ArgUtils COMMAND test_argutils WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME ArgUtils COMMAND test_argutils) add_executable(test_utils test_utils.cpp) target_link_libraries(test_utils PRIVATE lammps GTest::GMockMain) -add_test(NAME Utils COMMAND test_utils WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME Utils COMMAND test_utils) add_executable(test_platform test_platform.cpp) target_link_libraries(test_platform PRIVATE lammps GTest::GMockMain) -add_test(NAME Platform COMMAND test_platform WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME Platform COMMAND test_platform) set_tests_properties(Utils Platform PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") @@ -36,8 +36,8 @@ endif() add_executable(test_fmtlib test_fmtlib.cpp) target_link_libraries(test_fmtlib PRIVATE lammps GTest::GMockMain) -add_test(NAME FmtLib COMMAND test_fmtlib WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME FmtLib COMMAND test_fmtlib) add_executable(test_math_eigen_impl test_math_eigen_impl.cpp) target_include_directories(test_math_eigen_impl PRIVATE ${LAMMPS_SOURCE_DIR}) -add_test(NAME MathEigen COMMAND test_math_eigen_impl 10 5 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME MathEigen COMMAND test_math_eigen_impl 10 5) From 845ab2dd71436a75dc8fdacd5af7f090421e3f55 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 16:35:30 -0500 Subject: [PATCH 135/174] On Windows the Regex matcher for '.' does not match '\n' Thus we have to use ContainsRegex instead of MatchesRegex --- unittest/commands/test_groups.cpp | 1 - unittest/commands/test_kim_commands.cpp | 1 - unittest/commands/test_lattice_region.cpp | 6 ++-- unittest/commands/test_reset_ids.cpp | 1 - unittest/commands/test_simple_commands.cpp | 32 +++++++++---------- unittest/commands/test_variables.cpp | 24 +++++++------- unittest/cplusplus/test_error_class.cpp | 10 +++--- unittest/cplusplus/test_lammps_class.cpp | 6 ++-- unittest/formats/test_file_operations.cpp | 1 - unittest/formats/test_molecule_file.cpp | 16 +++++----- .../formats/test_potential_file_reader.cpp | 1 - unittest/python/test_python_package.cpp | 4 +-- unittest/testing/core.h | 6 ++-- 13 files changed, 52 insertions(+), 57 deletions(-) diff --git a/unittest/commands/test_groups.cpp b/unittest/commands/test_groups.cpp index 9d69b5412e..a356a02cca 100644 --- a/unittest/commands/test_groups.cpp +++ b/unittest/commands/test_groups.cpp @@ -34,7 +34,6 @@ using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { using ::testing::ExitedWithCode; -using ::testing::MatchesRegex; using ::testing::StrEq; class GroupTest : public LAMMPSTest { diff --git a/unittest/commands/test_kim_commands.cpp b/unittest/commands/test_kim_commands.cpp index 183d333ab4..953b4e5a00 100644 --- a/unittest/commands/test_kim_commands.cpp +++ b/unittest/commands/test_kim_commands.cpp @@ -33,7 +33,6 @@ bool verbose = false; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { -using ::testing::MatchesRegex; using ::testing::StrEq; class KimCommandsTest : public LAMMPSTest { diff --git a/unittest/commands/test_lattice_region.cpp b/unittest/commands/test_lattice_region.cpp index 1bbda21001..590180326c 100644 --- a/unittest/commands/test_lattice_region.cpp +++ b/unittest/commands/test_lattice_region.cpp @@ -36,7 +36,7 @@ using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { using ::testing::ExitedWithCode; -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; using ::testing::StrEq; class LatticeRegionTest : public LAMMPSTest { @@ -82,7 +82,7 @@ TEST_F(LatticeRegionTest, lattice_sc) BEGIN_CAPTURE_OUTPUT(); command("lattice sc 1.0 spacing 1.5 2.0 3.0"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Lattice spacing in x,y,z = 1.5.* 2.* 3.*")); + ASSERT_THAT(output, ContainsRegex(".*Lattice spacing in x,y,z = 1.5.* 2.* 3.*")); auto lattice = lmp->domain->lattice; ASSERT_EQ(lattice->xlattice, 1.5); @@ -92,7 +92,7 @@ TEST_F(LatticeRegionTest, lattice_sc) BEGIN_CAPTURE_OUTPUT(); command("lattice sc 2.0"); output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Lattice spacing in x,y,z = 2.* 2.* 2.*")); + ASSERT_THAT(output, ContainsRegex(".*Lattice spacing in x,y,z = 2.* 2.* 2.*")); lattice = lmp->domain->lattice; ASSERT_EQ(lattice->style, Lattice::SC); diff --git a/unittest/commands/test_reset_ids.cpp b/unittest/commands/test_reset_ids.cpp index c67f90b341..8ca5fe5c05 100644 --- a/unittest/commands/test_reset_ids.cpp +++ b/unittest/commands/test_reset_ids.cpp @@ -32,7 +32,6 @@ bool verbose = false; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { -using ::testing::MatchesRegex; #define GETIDX(i) lmp->atom->map(i) diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index 1844752d33..c75cbb22b9 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -40,7 +40,7 @@ using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { using ::testing::ExitedWithCode; -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; using ::testing::StrEq; class SimpleCommandsTest : public LAMMPSTest { @@ -394,62 +394,62 @@ TEST_F(SimpleCommandsTest, Plugin) lmp->input->one(fmt::format(loadfmt, "hello")); auto text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Loading plugin: Hello world command.*")); + ASSERT_THAT(text, ContainsRegex(".*Loading plugin: Hello world command.*")); ::testing::internal::CaptureStdout(); lmp->input->one(fmt::format(loadfmt, "xxx")); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Open of file .*xxx.* failed.*")); + ASSERT_THAT(text, ContainsRegex(".*Open of file .*xxx.* failed.*")); ::testing::internal::CaptureStdout(); lmp->input->one(fmt::format(loadfmt, "nve2")); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Loading plugin: NVE2 variant fix style.*")); + ASSERT_THAT(text, ContainsRegex(".*Loading plugin: NVE2 variant fix style.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin list"); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*1: command style plugin hello" + ASSERT_THAT(text, ContainsRegex(".*1: command style plugin hello" ".*2: fix style plugin nve2.*")); ::testing::internal::CaptureStdout(); lmp->input->one(fmt::format(loadfmt, "hello")); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Ignoring load of command style hello: " + ASSERT_THAT(text, ContainsRegex(".*Ignoring load of command style hello: " "must unload existing hello plugin.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin unload command hello"); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Unloading command style hello.*")); + ASSERT_THAT(text, ContainsRegex(".*Unloading command style hello.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin unload pair nve2"); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Ignoring unload of pair style nve2: not from a plugin.*")); + ASSERT_THAT(text, ContainsRegex(".*Ignoring unload of pair style nve2: not from a plugin.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin unload fix nve2"); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Unloading fix style nve2.*")); + ASSERT_THAT(text, ContainsRegex(".*Unloading fix style nve2.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin unload fix nve"); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Ignoring unload of fix style nve: not from a plugin.*")); + ASSERT_THAT(text, ContainsRegex(".*Ignoring unload of fix style nve: not from a plugin.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin list"); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Currently loaded plugins.*")); + ASSERT_THAT(text, ContainsRegex(".*Currently loaded plugins.*")); } #endif @@ -495,8 +495,8 @@ TEST_F(SimpleCommandsTest, CiteMe) std::string text = END_CAPTURE_OUTPUT(); // find the two unique citations, but not the third - ASSERT_THAT(text, MatchesRegex(".*one.*two.*")); - ASSERT_THAT(text, Not(MatchesRegex(".*one.*two.*one.*"))); + ASSERT_THAT(text, ContainsRegex(".*one.*two.*")); + ASSERT_THAT(text, Not(ContainsRegex(".*one.*two.*one.*"))); BEGIN_CAPTURE_OUTPUT(); lmp->citeme->add("test citation one:\n 0\n"); @@ -507,8 +507,8 @@ TEST_F(SimpleCommandsTest, CiteMe) text = END_CAPTURE_OUTPUT(); // find the forth (only differs in long citation) and sixth added citation - ASSERT_THAT(text, MatchesRegex(".*one.*three.*")); - ASSERT_THAT(text, Not(MatchesRegex(".*two.*"))); + ASSERT_THAT(text, ContainsRegex(".*one.*three.*")); + ASSERT_THAT(text, Not(ContainsRegex(".*two.*"))); BEGIN_CAPTURE_OUTPUT(); lmp->citeme->add("test citation one:\n 1\n"); @@ -521,7 +521,7 @@ TEST_F(SimpleCommandsTest, CiteMe) text = END_CAPTURE_OUTPUT(); // no new citation. no CITE-CITE-CITE- lines - ASSERT_THAT(text, Not(MatchesRegex(".*CITE-CITE-CITE-CITE.*"))); + ASSERT_THAT(text, Not(ContainsRegex(".*CITE-CITE-CITE-CITE.*"))); } } // namespace LAMMPS_NS diff --git a/unittest/commands/test_variables.cpp b/unittest/commands/test_variables.cpp index fb0aa58069..af52df8e28 100644 --- a/unittest/commands/test_variables.cpp +++ b/unittest/commands/test_variables.cpp @@ -37,7 +37,7 @@ using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { using ::testing::ExitedWithCode; -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; using ::testing::StrEq; class VariableTest : public LAMMPSTest { @@ -394,58 +394,58 @@ TEST_F(VariableTest, IfCommand) BEGIN_CAPTURE_OUTPUT(); command("if 1>0 then 'print \"bingo!\"'"); auto text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if 1>2 then 'print \"bingo!\"' else 'print \"nope?\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*nope\?.*")); + ASSERT_THAT(text, ContainsRegex(".*nope\?.*")); BEGIN_CAPTURE_OUTPUT(); command("if (1<=0) then 'print \"bingo!\"' else 'print \"nope?\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*nope\?.*")); + ASSERT_THAT(text, ContainsRegex(".*nope\?.*")); BEGIN_CAPTURE_OUTPUT(); command("if (-1.0e-1<0.0E+0)|^(1<0) then 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if (${one}==1.0)&&(2>=1) then 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if !((${one}!=1.0)||(2|^1)) then 'print \"missed\"' else 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if (1>=2)&&(0&&1) then 'print \"missed\"' else 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if !1 then 'print \"missed\"' else 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if !(a==b) then 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if x==x|^1==0 then 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); BEGIN_CAPTURE_OUTPUT(); command("if x!=x|^a!=b then 'print \"bingo!\"'"); text = END_CAPTURE_OUTPUT(); - ASSERT_THAT(text, MatchesRegex(".*bingo!.*")); + ASSERT_THAT(text, ContainsRegex(".*bingo!.*")); TEST_FAILURE(".*ERROR: Invalid Boolean syntax in if command.*", command("if () then 'print \"bingo!\"'");); diff --git a/unittest/cplusplus/test_error_class.cpp b/unittest/cplusplus/test_error_class.cpp index f4f0d3b28b..27318646be 100644 --- a/unittest/cplusplus/test_error_class.cpp +++ b/unittest/cplusplus/test_error_class.cpp @@ -17,7 +17,7 @@ bool verbose = false; namespace LAMMPS_NS { -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; using utils::split_words; class Error_class : public LAMMPSTest { @@ -39,7 +39,7 @@ TEST_F(Error_class, message) auto output = CAPTURE_OUTPUT([&] { error->message(FLERR, "one message"); }); - ASSERT_THAT(output, MatchesRegex("one message .*test_error_class.cpp:.*")); + ASSERT_THAT(output, ContainsRegex("one message .*test_error_class.cpp:.*")); }; TEST_F(Error_class, warning) @@ -48,7 +48,7 @@ TEST_F(Error_class, warning) auto output = CAPTURE_OUTPUT([&] { error->warning(FLERR, "one warning"); }); - ASSERT_THAT(output, MatchesRegex("WARNING: one warning .*test_error_class.cpp:.*")); + ASSERT_THAT(output, ContainsRegex("WARNING: one warning .*test_error_class.cpp:.*")); ASSERT_THAT(error->get_maxwarn(), 100); // warnings disabled @@ -72,7 +72,7 @@ TEST_F(Error_class, warning) output = CAPTURE_OUTPUT([&] { thermo->lost_check(); }); - ASSERT_THAT(output, MatchesRegex("WARNING: Too many warnings: 5 vs 2. All future.*")); + ASSERT_THAT(output, ContainsRegex("WARNING: Too many warnings: 5 vs 2. All future.*")); output = CAPTURE_OUTPUT([&] { error->warning(FLERR, "one warning"); @@ -91,7 +91,7 @@ TEST_F(Error_class, warning) output = CAPTURE_OUTPUT([&] { error->warning(FLERR, "one warning"); }); - ASSERT_THAT(output, MatchesRegex("WARNING: one warning.*")); + ASSERT_THAT(output, ContainsRegex("WARNING: one warning.*")); BEGIN_HIDE_OUTPUT(); command("thermo_modify warn default"); diff --git a/unittest/cplusplus/test_lammps_class.cpp b/unittest/cplusplus/test_lammps_class.cpp index eb6735a738..6bbeb385e9 100644 --- a/unittest/cplusplus/test_lammps_class.cpp +++ b/unittest/cplusplus/test_lammps_class.cpp @@ -11,7 +11,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; using ::testing::StartsWith; namespace LAMMPS_NS { @@ -339,7 +339,7 @@ TEST(LAMMPS_init, OpenMP) ::testing::internal::CaptureStdout(); LAMMPS *lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); std::string output = ::testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, MatchesRegex(".*using 2 OpenMP thread.*per MPI task.*")); + EXPECT_THAT(output, ContainsRegex(".*using 2 OpenMP thread.*per MPI task.*")); if (LAMMPS_NS::Info::has_accelerator_feature("OPENMP", "api", "openmp")) EXPECT_EQ(lmp->comm->nthreads, 2); @@ -373,7 +373,7 @@ TEST(LAMMPS_init, NoOpenMP) LAMMPS *lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); std::string output = ::testing::internal::GetCapturedStdout(); EXPECT_THAT(output, - MatchesRegex(".*OMP_NUM_THREADS environment is not set.*Defaulting to 1 thread.*")); + ContainsRegex(".*OMP_NUM_THREADS environment is not set.*Defaulting to 1 thread.*")); EXPECT_EQ(lmp->comm->nthreads, 1); ::testing::internal::CaptureStdout(); delete lmp; diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index bb26dff391..08c1c2fd9a 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -29,7 +29,6 @@ using namespace LAMMPS_NS; -using testing::MatchesRegex; using testing::StrEq; using utils::read_lines_from_file; diff --git a/unittest/formats/test_molecule_file.cpp b/unittest/formats/test_molecule_file.cpp index e802ebfa2c..b67ed746b9 100644 --- a/unittest/formats/test_molecule_file.cpp +++ b/unittest/formats/test_molecule_file.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; -using testing::MatchesRegex; +using testing::ContainsRegex; using testing::StrEq; using utils::split_words; @@ -173,7 +173,7 @@ TEST_F(MoleculeFileTest, minimal) BEGIN_CAPTURE_OUTPUT(); run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Read molecule template.*1 molecules.*1 atoms.*0 bonds.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*1 molecules.*1 atoms.*0 bonds.*")); } TEST_F(MoleculeFileTest, notype) @@ -184,7 +184,7 @@ TEST_F(MoleculeFileTest, notype) command("create_box 1 box"); run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Read molecule template.*1 molecules.*1 atoms.*0 bonds.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*1 molecules.*1 atoms.*0 bonds.*")); TEST_FAILURE(".*ERROR: Create_atoms molecule must have atom types.*", command("create_atoms 0 single 0.0 0.0 0.0 mol notype 542465");); } @@ -199,7 +199,7 @@ TEST_F(MoleculeFileTest, extramass) " Types\n\n 1 1\n Masses\n\n 1 1.0\n"); command("create_atoms 0 single 0.0 0.0 0.0 mol extramass 73546"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*WARNING: Molecule attributes do not match " + ASSERT_THAT(output, ContainsRegex(".*WARNING: Molecule attributes do not match " "system attributes.*")); } @@ -211,7 +211,7 @@ TEST_F(MoleculeFileTest, twomols) " Coords\n\n 1 0.0 0.0 0.0\n 2 0.0 0.0 1.0\n" " Molecules\n\n 1 1\n 2 2\n\n Types\n\n 1 1\n 2 2\n\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Read molecule template.*2 molecules.*2 atoms " + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*2 molecules.*2 atoms " "with max type 2.*0 bonds.*")); } @@ -220,7 +220,7 @@ TEST_F(MoleculeFileTest, twofiles) BEGIN_CAPTURE_OUTPUT(); command("molecule twomols moltest.h2o.mol moltest.co2.mol offset 2 1 1 0 0"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Read molecule template twomols:.*1 molecules.*3 atoms " + ASSERT_THAT(output, ContainsRegex(".*Read molecule template twomols:.*1 molecules.*3 atoms " "with max type 2.*2 bonds with max type 1.*" "1 angles with max type 1.*0 dihedrals.*" ".*Read molecule template twomols:.*1 molecules.*3 atoms " @@ -254,14 +254,14 @@ TEST_F(MoleculeFileTest, bonds) " 1 1 1 2\n" " 2 2 1 3\n\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Read molecule template.*1 molecules.*4 atoms.*type.*2.*" + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*1 molecules.*4 atoms.*type.*2.*" "2 bonds.*type.*2.*0 angles.*")); BEGIN_CAPTURE_OUTPUT(); command("mass * 2.0"); command("create_atoms 0 single 0.5 0.5 0.5 mol bonds 67235"); output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, MatchesRegex(".*Created 4 atoms.*")); + ASSERT_THAT(output, ContainsRegex(".*Created 4 atoms.*")); BEGIN_HIDE_OUTPUT(); Molecule *mol = lmp->atom->molecules[0]; diff --git a/unittest/formats/test_potential_file_reader.cpp b/unittest/formats/test_potential_file_reader.cpp index 7cd61d25a4..f9dee16c14 100644 --- a/unittest/formats/test_potential_file_reader.cpp +++ b/unittest/formats/test_potential_file_reader.cpp @@ -37,7 +37,6 @@ #include using namespace LAMMPS_NS; -using ::testing::MatchesRegex; using utils::split_words; // whether to print verbose output (i.e. not capturing LAMMPS screen output). diff --git a/unittest/python/test_python_package.cpp b/unittest/python/test_python_package.cpp index e04be89df1..07b9a29f28 100644 --- a/unittest/python/test_python_package.cpp +++ b/unittest/python/test_python_package.cpp @@ -45,7 +45,7 @@ using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { using ::testing::Eq; using ::testing::HasSubstr; -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; using ::testing::StrEq; class PythonPackageTest : public LAMMPSTest { @@ -238,7 +238,7 @@ TEST_F(PythonPackageTest, python_variable) std::string output = CAPTURE_OUTPUT([&] { command("print \"${sq}\""); }); - ASSERT_THAT(output, MatchesRegex("print.*2.25.*")); + ASSERT_THAT(output, ContainsRegex("print.*2.25.*")); } TEST_F(PythonPackageTest, InlineFunction) diff --git a/unittest/testing/core.h b/unittest/testing/core.h index c922e96cc0..81a7112934 100644 --- a/unittest/testing/core.h +++ b/unittest/testing/core.h @@ -28,20 +28,20 @@ using namespace LAMMPS_NS; -using ::testing::MatchesRegex; +using ::testing::ContainsRegex; #define TEST_FAILURE(errmsg, ...) \ if (Info::has_exceptions()) { \ ::testing::internal::CaptureStdout(); \ ASSERT_ANY_THROW({__VA_ARGS__}); \ auto mesg = ::testing::internal::GetCapturedStdout(); \ - ASSERT_THAT(mesg, MatchesRegex(errmsg)); \ + ASSERT_THAT(mesg, ContainsRegex(errmsg)); \ } else { \ if (platform::mpi_vendor() != "Open MPI") { \ ::testing::internal::CaptureStdout(); \ ASSERT_DEATH({__VA_ARGS__}, ""); \ auto mesg = ::testing::internal::GetCapturedStdout(); \ - ASSERT_THAT(mesg, MatchesRegex(errmsg)); \ + ASSERT_THAT(mesg, ContainsRegex(errmsg)); \ } else { \ std::cerr << "[ ] [ INFO ] Skipping death test (no exception support) \n"; \ } \ From bd4814a51e627170369d2ba874282ee8a3920e39 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 16:37:40 -0500 Subject: [PATCH 136/174] don't cache OUTPUT_DIRECTORY variable settings but set them every time --- cmake/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2bfe3ce245..256b663fd6 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -20,8 +20,8 @@ set(SOVERSION 0) get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE) get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE) # collect all executables and shared libs in the top level build folder -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Folder for executables, DLLs and shared objects" FORCE) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Folder for libraries" FORCE) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(LAMMPS_SOURCE_DIR ${LAMMPS_DIR}/src) set(LAMMPS_LIB_SOURCE_DIR ${LAMMPS_DIR}/lib) From 75d0a5098f1e9892b7a5a0d6d0ca97b14ae78940 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 17:06:30 -0500 Subject: [PATCH 137/174] use -Og for Debug config for better warnings and debug experience --- cmake/presets/gcc.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/presets/gcc.cmake b/cmake/presets/gcc.cmake index c2dbacf674..cb626ea019 100644 --- a/cmake/presets/gcc.cmake +++ b/cmake/presets/gcc.cmake @@ -3,19 +3,19 @@ set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE) set(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) set(MPI_CXX "g++" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) set(MPI_C "gcc" CACHE STRING "" FORCE) set(MPI_C_COMPILER "mpicc" CACHE STRING "" FORCE) -set(CMAKE_C_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_DEBUG "-Wall -Og -g" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) set(MPI_Fortran "gfortran" CACHE STRING "" FORCE) set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE) -set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g -std=f2003" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -g -std=f2003" CACHE STRING "" FORCE) set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE) set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE) unset(HAVE_OMP_H_INCLUDE CACHE) From c9de8fca1d40ed45e60fda8578dee37d1028285f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 17:07:00 -0500 Subject: [PATCH 138/174] silence compiler warnings --- tools/msi2lmp/src/GetParameters.c | 4 ++-- unittest/formats/test_file_operations.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/msi2lmp/src/GetParameters.c b/tools/msi2lmp/src/GetParameters.c index 192b4d296c..921e37491f 100644 --- a/tools/msi2lmp/src/GetParameters.c +++ b/tools/msi2lmp/src/GetParameters.c @@ -9,14 +9,14 @@ static int find_improper_body_data(char [][5],struct FrcFieldItem,int *); static void rearrange_improper(int,int); static int find_trigonal_body_data(char [][5],struct FrcFieldItem); -static int find_angleangle_data(char [][5],struct FrcFieldItem,int[]); +static int find_angleangle_data(char [][5],struct FrcFieldItem,int[3]); static int find_match(int, char [][5],struct FrcFieldItem,int *); static int match_types(int,int,char [][5],char [][5],int *); static double get_r0(int,int); static double get_t0(int,int,int); static int quo_cp(); static void get_equivs(int,char [][5],char[][5]); -static int find_equiv_type(char[]); +static int find_equiv_type(char[5]); /**********************************************************************/ /* */ diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index 08c1c2fd9a..3ca889b76e 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -334,7 +334,7 @@ TEST_F(FileOperationsTest, write_restart) ASSERT_FILE_EXISTS("multi2-0.restart"); ASSERT_FILE_EXISTS("multi3-base.restart"); ASSERT_FILE_EXISTS("multi3-0.restart"); - if (info->has_package("MPIIO")) ASSERT_FILE_EXISTS("test.restart.mpiio"); + if (info->has_package("MPIIO")) { ASSERT_FILE_EXISTS("test.restart.mpiio"); } if (!info->has_package("MPIIO")) { TEST_FAILURE(".*ERROR: Writing to MPI-IO filename when MPIIO package is not inst.*", From 7b3adb3f1ab3e6977741d40bee5ebf449bc6f47c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 17:09:40 -0500 Subject: [PATCH 139/174] must always initialize jtag --- src/compute_pair_local.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index b98f6eec33..3dc37707c6 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -226,13 +226,13 @@ int ComputePairLocal::compute_pairs(int flag) factor_lj = special_lj[sbmask(j)]; factor_coul = special_coul[sbmask(j)]; j &= NEIGHMASK; + jtag = tag[j]; if (!(mask[j] & groupbit)) continue; // itag = jtag is possible for long cutoffs that include images of self if (newton_pair == 0 && j >= nlocal) { - jtag = tag[j]; if (itag > jtag) { if ((itag+jtag) % 2 == 0) continue; } else if (itag < jtag) { From c464c40d678371eb44fda60319f8fb54e89c0303 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 18:12:15 -0500 Subject: [PATCH 140/174] avoid accessing uninitialized data and triggering bogus memcheck output --- unittest/formats/test_dump_cfg.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/unittest/formats/test_dump_cfg.cpp b/unittest/formats/test_dump_cfg.cpp index a180c6b342..c2ab96c5ed 100644 --- a/unittest/formats/test_dump_cfg.cpp +++ b/unittest/formats/test_dump_cfg.cpp @@ -81,6 +81,7 @@ TEST_F(DumpCfgTest, write_dump) auto fields = "mass type xs ys zs id proc procp1 x y z ix iy iz vx vy vz fx fy fz"; BEGIN_HIDE_OUTPUT(); + command("run 0 post no"); command(std::string("write_dump all cfg dump_cfg.melt.cfg ") + fields); command(std::string("write_dump all cfg dump_cfg*.melt.cfg ") + fields); END_HIDE_OUTPUT(); From 9323a09b39409387e2141c2ffd845a553817c8b1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 18:12:53 -0500 Subject: [PATCH 141/174] reduce number of reported memory leaks with google test death tests --- src/write_dump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_dump.cpp b/src/write_dump.cpp index 53ab80149a..19826eba1b 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -68,6 +68,7 @@ void WriteDump::command(int narg, char **arg) #undef DUMP_CLASS } else error->all(FLERR,utils::check_packages_for_style("dump",arg[1],lmp)); + delete[] dumpargs; if (modindex < narg) dump->modify_params(narg-modindex-1,&arg[modindex+1]); @@ -89,5 +90,4 @@ void WriteDump::command(int narg, char **arg) // delete the Dump instance and local storage delete dump; - delete [] dumpargs; } From cd5d1f8a30fa7d13c4cd60d4367aa9fd4d77c4f9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 18:13:01 -0500 Subject: [PATCH 142/174] reformat --- src/dump_cfg.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index 8e87f4104e..d52dac745f 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -167,16 +167,13 @@ int DumpCFG::convert_string(int n, double *mybuf) offset += sprintf(&sbuf[offset],"%s \n",typenames[(int) mybuf[m]]); } else if (j >= 2) { if (vtype[j] == Dump::INT) - offset += - sprintf(&sbuf[offset],vformat[j],static_cast (mybuf[m])); + offset += sprintf(&sbuf[offset],vformat[j],static_cast (mybuf[m])); else if (vtype[j] == Dump::DOUBLE) offset += sprintf(&sbuf[offset],vformat[j],mybuf[m]); else if (vtype[j] == Dump::STRING) - offset += - sprintf(&sbuf[offset],vformat[j],typenames[(int) mybuf[m]]); + offset += sprintf(&sbuf[offset],vformat[j],typenames[(int) mybuf[m]]); else if (vtype[j] == Dump::BIGINT) - offset += - sprintf(&sbuf[offset],vformat[j],static_cast (mybuf[m])); + offset += sprintf(&sbuf[offset],vformat[j],static_cast (mybuf[m])); } m++; } From c420f804d96e78a5d92db7ad56e33e8f2bf4f49c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 18:52:49 -0500 Subject: [PATCH 143/174] make multi-line regex checks compatible with googletests Windows regex syntax --- unittest/formats/test_molecule_file.cpp | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/unittest/formats/test_molecule_file.cpp b/unittest/formats/test_molecule_file.cpp index b67ed746b9..0fe66e22c5 100644 --- a/unittest/formats/test_molecule_file.cpp +++ b/unittest/formats/test_molecule_file.cpp @@ -173,7 +173,8 @@ TEST_F(MoleculeFileTest, minimal) BEGIN_CAPTURE_OUTPUT(); run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*1 molecules.*1 atoms.*0 bonds.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*1 molecules.*\n" + ".*1 atoms.*\n.*0 bonds.*")); } TEST_F(MoleculeFileTest, notype) @@ -184,7 +185,8 @@ TEST_F(MoleculeFileTest, notype) command("create_box 1 box"); run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*1 molecules.*1 atoms.*0 bonds.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*1 molecules.*\n" + ".*1 atoms.*\n.*0 bonds.*")); TEST_FAILURE(".*ERROR: Create_atoms molecule must have atom types.*", command("create_atoms 0 single 0.0 0.0 0.0 mol notype 542465");); } @@ -211,8 +213,8 @@ TEST_F(MoleculeFileTest, twomols) " Coords\n\n 1 0.0 0.0 0.0\n 2 0.0 0.0 1.0\n" " Molecules\n\n 1 1\n 2 2\n\n Types\n\n 1 1\n 2 2\n\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*2 molecules.*2 atoms " - "with max type 2.*0 bonds.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*2 molecules.*\n" + ".*2 atoms with max type 2.*\n.*0 bonds.*")); } TEST_F(MoleculeFileTest, twofiles) @@ -220,12 +222,12 @@ TEST_F(MoleculeFileTest, twofiles) BEGIN_CAPTURE_OUTPUT(); command("molecule twomols moltest.h2o.mol moltest.co2.mol offset 2 1 1 0 0"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, ContainsRegex(".*Read molecule template twomols:.*1 molecules.*3 atoms " - "with max type 2.*2 bonds with max type 1.*" - "1 angles with max type 1.*0 dihedrals.*" - ".*Read molecule template twomols:.*1 molecules.*3 atoms " - "with max type 4.*2 bonds with max type 2.*" - "1 angles with max type 2.*0 dihedrals.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template twomols:.*\n.*1 molecules.*\n" + ".*3 atoms with max type 2.*\n.*2 bonds with max type 1.*\n" + ".*1 angles with max type 1.*\n.*0 dihedrals.*\n" + ".*Read molecule template twomols:.*\n.*1 molecules.*\n" + ".*3 atoms with max type 4.*\n.*2 bonds with max type 2.*\n" + ".*1 angles with max type 2.*\n.*0 dihedrals.*")); } TEST_F(MoleculeFileTest, bonds) @@ -254,8 +256,9 @@ TEST_F(MoleculeFileTest, bonds) " 1 1 1 2\n" " 2 2 1 3\n\n"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*1 molecules.*4 atoms.*type.*2.*" - "2 bonds.*type.*2.*0 angles.*")); + ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*1 molecules.*\n" + ".*4 atoms.*type.*2.*\n" + ".*2 bonds.*type.*2.*\n.*0 angles.*")); BEGIN_CAPTURE_OUTPUT(); command("mass * 2.0"); From 9014664c1312ba7dad7e86946a34fa3cee426624 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 19:07:35 -0500 Subject: [PATCH 144/174] really fix unit test regexes for windows --- unittest/formats/test_molecule_file.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/unittest/formats/test_molecule_file.cpp b/unittest/formats/test_molecule_file.cpp index 0fe66e22c5..6f24c0f758 100644 --- a/unittest/formats/test_molecule_file.cpp +++ b/unittest/formats/test_molecule_file.cpp @@ -174,7 +174,7 @@ TEST_F(MoleculeFileTest, minimal) run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"); auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*1 molecules.*\n" - ".*1 atoms.*\n.*0 bonds.*")); + ".*0 fragments.*\n.*1 atoms.*\n.*0 bonds.*")); } TEST_F(MoleculeFileTest, notype) @@ -186,7 +186,7 @@ TEST_F(MoleculeFileTest, notype) run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"); auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*1 molecules.*\n" - ".*1 atoms.*\n.*0 bonds.*")); + ".*0 fragments.*\n.*1 atoms.*\n.*0 bonds.*")); TEST_FAILURE(".*ERROR: Create_atoms molecule must have atom types.*", command("create_atoms 0 single 0.0 0.0 0.0 mol notype 542465");); } @@ -214,7 +214,7 @@ TEST_F(MoleculeFileTest, twomols) " Molecules\n\n 1 1\n 2 2\n\n Types\n\n 1 1\n 2 2\n\n"); auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*2 molecules.*\n" - ".*2 atoms with max type 2.*\n.*0 bonds.*")); + ".*0 fragments.*\n.*2 atoms with max type 2.*\n.*0 bonds.*")); } TEST_F(MoleculeFileTest, twofiles) @@ -223,10 +223,10 @@ TEST_F(MoleculeFileTest, twofiles) command("molecule twomols moltest.h2o.mol moltest.co2.mol offset 2 1 1 0 0"); auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*Read molecule template twomols:.*\n.*1 molecules.*\n" - ".*3 atoms with max type 2.*\n.*2 bonds with max type 1.*\n" - ".*1 angles with max type 1.*\n.*0 dihedrals.*\n" + ".*0 fragments.*\n.*3 atoms with max type 2.*\n.*2 bonds with max type 1.*\n" + ".*1 angles with max type 1.*\n.*0 dihedrals.*\n.*0 impropers.*\n" ".*Read molecule template twomols:.*\n.*1 molecules.*\n" - ".*3 atoms with max type 4.*\n.*2 bonds with max type 2.*\n" + ".*0 fragments.*\n.*3 atoms with max type 4.*\n.*2 bonds with max type 2.*\n" ".*1 angles with max type 2.*\n.*0 dihedrals.*")); } @@ -257,7 +257,7 @@ TEST_F(MoleculeFileTest, bonds) " 2 2 1 3\n\n"); auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*Read molecule template.*\n.*1 molecules.*\n" - ".*4 atoms.*type.*2.*\n" + ".*0 fragments.*\n.*4 atoms.*type.*2.*\n" ".*2 bonds.*type.*2.*\n.*0 angles.*")); BEGIN_CAPTURE_OUTPUT(); From 0bfc5269ddc2f14f6132581f3f0955778d161417 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 20:52:25 -0500 Subject: [PATCH 145/174] fix mismatches causing failures on windows --- unittest/formats/test_potential_file_reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittest/formats/test_potential_file_reader.cpp b/unittest/formats/test_potential_file_reader.cpp index f9dee16c14..db235722a4 100644 --- a/unittest/formats/test_potential_file_reader.cpp +++ b/unittest/formats/test_potential_file_reader.cpp @@ -282,7 +282,7 @@ TEST_F(OpenPotentialTest, Sw_conv) { int convert_flag = utils::get_supported_conversions(utils::ENERGY); ASSERT_EQ(convert_flag, utils::METAL2REAL | utils::REAL2METAL); - BEGIN_HIDE_OUTPUT(); + BEGIN_CAPTURE_OUTPUT(); command("units real"); FILE *fp = utils::open_potential("Si.sw", lmp, &convert_flag); auto text = END_CAPTURE_OUTPUT(); @@ -300,7 +300,7 @@ TEST_F(OpenPotentialTest, Sw_noconv) BEGIN_HIDE_OUTPUT(); command("units real"); END_HIDE_OUTPUT(); - TEST_FAILURE(".*potential.*requires metal units but real.*", + TEST_FAILURE(".*Potential.*requires metal units but real.*", utils::open_potential("Si.sw", lmp, nullptr);); BEGIN_HIDE_OUTPUT(); command("units lj"); From 6c98915a9c024791e57e1ebd22c8a5fc80bcd9fd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 20:52:37 -0500 Subject: [PATCH 146/174] port to windows --- unittest/commands/test_simple_commands.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index c75cbb22b9..862c3a8c4a 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -478,7 +478,12 @@ TEST_F(SimpleCommandsTest, Shell) test_var = getenv("TEST_VARIABLE"); ASSERT_NE(test_var, nullptr); +#if defined(_WIN32) + // we cannot create empty environment variables on Windows so platform::putenv() sets their value to "1" + ASSERT_THAT(test_var, StrEq("1")); +#else ASSERT_THAT(test_var, StrEq("")); +#endif } TEST_F(SimpleCommandsTest, CiteMe) @@ -495,8 +500,8 @@ TEST_F(SimpleCommandsTest, CiteMe) std::string text = END_CAPTURE_OUTPUT(); // find the two unique citations, but not the third - ASSERT_THAT(text, ContainsRegex(".*one.*two.*")); - ASSERT_THAT(text, Not(ContainsRegex(".*one.*two.*one.*"))); + ASSERT_THAT(text, ContainsRegex("test citation one.\n.*test citation two.*")); + ASSERT_THAT(text, Not(ContainsRegex("test citation one.\n.*test citation two.*\n.*test citation one.*"))); BEGIN_CAPTURE_OUTPUT(); lmp->citeme->add("test citation one:\n 0\n"); @@ -507,8 +512,8 @@ TEST_F(SimpleCommandsTest, CiteMe) text = END_CAPTURE_OUTPUT(); // find the forth (only differs in long citation) and sixth added citation - ASSERT_THAT(text, ContainsRegex(".*one.*three.*")); - ASSERT_THAT(text, Not(ContainsRegex(".*two.*"))); + ASSERT_THAT(text, ContainsRegex("test citation one.*\n.*test citation three.*")); + ASSERT_THAT(text, Not(ContainsRegex("test_citation two.*\n"))); BEGIN_CAPTURE_OUTPUT(); lmp->citeme->add("test citation one:\n 1\n"); From 02cadf1b712821892e8eea8e88c86f41b8808c7e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 20:53:17 -0500 Subject: [PATCH 147/174] port to windows where text file reading may gobble up carriage returns --- src/MANYBODY/pair_eam_cd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index dc1ec360c6..376469e238 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -505,8 +505,10 @@ void PairEAMCD::read_h_coeff(char *filename) utils::getsyserror()); char *buf = new char[MAXLINE+1]; - utils::sfread(FLERR, buf, 1, MAXLINE, fptr, filename, error); - buf[MAXLINE] = '\0'; // must 0-terminate buffer for string processing + auto rv = fread(buf,1,MAXLINE,fptr); + if (rv == 0) error->one(FLERR,"Failure to read h(x) coeffs: {}", utils::getsyserror()); + buf[rv] = '\0'; // must 0-terminate buffer for string processing + Tokenizer lines(buf, "\n"); delete[] buf; From 571821694e9b747ef23044bb9f442490376fc1ef Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 21:01:35 -0500 Subject: [PATCH 148/174] remove links broken on windows --- unittest/commands/data.fourmol | 1 - unittest/commands/in.fourmol | 1 - 2 files changed, 2 deletions(-) delete mode 120000 unittest/commands/data.fourmol delete mode 120000 unittest/commands/in.fourmol diff --git a/unittest/commands/data.fourmol b/unittest/commands/data.fourmol deleted file mode 120000 index ebbe325d24..0000000000 --- a/unittest/commands/data.fourmol +++ /dev/null @@ -1 +0,0 @@ -../force-styles/tests/data.fourmol \ No newline at end of file diff --git a/unittest/commands/in.fourmol b/unittest/commands/in.fourmol deleted file mode 120000 index cc47b5adb9..0000000000 --- a/unittest/commands/in.fourmol +++ /dev/null @@ -1 +0,0 @@ -../force-styles/tests/in.fourmol \ No newline at end of file From cc0d91b2227eee68a635539d2cebddff86426bfa Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 21:01:49 -0500 Subject: [PATCH 149/174] re-add copies of linked files --- unittest/commands/data.fourmol | 223 +++++++++++++++++++++++++++++++++ unittest/commands/in.fourmol | 30 +++++ 2 files changed, 253 insertions(+) create mode 100644 unittest/commands/data.fourmol create mode 100644 unittest/commands/in.fourmol diff --git a/unittest/commands/data.fourmol b/unittest/commands/data.fourmol new file mode 100644 index 0000000000..70dc685895 --- /dev/null +++ b/unittest/commands/data.fourmol @@ -0,0 +1,223 @@ +LAMMPS data file via write_data, version 5 May 2020, timestep = 0 + +29 atoms +5 atom types +24 bonds +5 bond types +30 angles +4 angle types +31 dihedrals +5 dihedral types +2 impropers +2 improper types + + -6.024572 8.975428 xlo xhi + -7.692866 7.307134 ylo yhi + -8.086924 6.913076 zlo zhi + +Masses + +1 12.0107 +2 4.00794 +3 14.0067 +4 15.9994 +5 15.9994 + +Pair Coeffs # zero + +1 +2 +3 +4 +5 + +Bond Coeffs # zero + +1 1.5 +2 1.1 +3 1.3 +4 1.2 +5 1 + +Angle Coeffs # zero + +1 110.1 +2 111 +3 120 +4 108.5 + +Dihedral Coeffs # zero + +1 +2 +3 +4 +5 + +Improper Coeffs # zero + +1 +2 + +Atoms # full + +10 2 1 7.0000000000000007e-02 2.0185283555536988e+00 -1.4283966846517357e+00 -9.6733527271133024e-01 0 0 0 +11 2 2 8.9999999999999997e-02 1.7929780509347666e+00 -1.9871047540768743e+00 -1.8840626643185674e+00 0 0 0 +12 2 1 -2.7000000000000002e-01 3.0030247876861225e+00 -4.8923319967572748e-01 -1.6188658531537248e+00 0 0 0 +13 2 2 8.9999999999999997e-02 4.0447273787895934e+00 -9.0131998547446246e-01 -1.6384447268320836e+00 0 0 0 +14 2 2 8.9999999999999997e-02 2.6033152817257075e+00 -4.0789761505963579e-01 -2.6554413538823063e+00 0 0 0 + 2 1 2 3.1000000000000000e-01 3.0197083955402204e-01 2.9515239068888608e+00 -8.5689735572907566e-01 0 0 0 + 3 1 1 -2.0000000000000000e-02 -6.9435377880558602e-01 1.2440473127136711e+00 -6.2233801468892025e-01 0 0 0 + 4 1 2 8.9999999999999997e-02 -1.5771614164685133e+00 1.4915333140468066e+00 -1.2487126845040522e+00 0 0 0 + 6 1 1 5.1000000000000001e-01 2.9412607937706009e-01 2.2719282656652909e-01 -1.2843094067857870e+00 0 0 0 + 7 1 4 -5.1000000000000001e-01 3.4019871062879609e-01 -9.1277350075786561e-03 -2.4633113224304561e+00 0 0 0 +19 3 2 4.2359999999999998e-01 1.5349125211132961e+00 2.6315969880333707e+00 -4.2472859440220647e+00 0 0 0 +15 2 2 8.9999999999999997e-02 2.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 0 0 0 +18 3 4 -8.4719999999999995e-01 2.1384791188033843e+00 3.0177261773770208e+00 -3.5160827596876225e+00 0 0 0 +20 3 2 4.2359999999999998e-01 2.7641167828863153e+00 3.6833419064000221e+00 -3.9380850623312638e+00 0 0 0 + 8 2 3 -4.6999999999999997e-01 1.1641187171852805e+00 -4.8375305955385234e-01 -6.7659823767368688e-01 0 0 0 + 9 2 2 3.1000000000000000e-01 1.3777459838125838e+00 -2.5366338669522998e-01 2.6877644730326306e-01 0 0 0 +16 2 1 5.1000000000000001e-01 2.6517554244980306e+00 -2.3957110424978438e+00 3.2908335999178327e-02 0 0 0 +17 2 4 -5.1000000000000001e-01 2.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+00 0 0 0 + 1 1 3 -4.6999999999999997e-01 -2.7993683669226832e-01 2.4726588069312840e+00 -1.7200860244148433e-01 0 0 0 + 5 1 2 8.9999999999999997e-02 -8.9501761359359255e-01 9.3568128743071344e-01 4.0227731871484346e-01 0 0 0 +21 4 5 -8.4719999999999995e-01 4.9064454390208301e+00 -4.0751205255383196e+00 -3.6215576073601046e+00 0 0 0 +22 4 2 4.2359999999999998e-01 4.3687453488627543e+00 -4.2054270536772504e+00 -4.4651491269372565e+00 0 0 0 +23 4 2 4.2359999999999998e-01 5.7374928154769504e+00 -3.5763355905184966e+00 -3.8820297194230728e+00 0 0 0 +24 5 5 -8.4719999999999995e-01 2.0684115301174013e+00 3.1518221747664397e+00 3.1554242678474576e+00 0 0 0 +25 5 2 4.2359999999999998e-01 1.2998381073113014e+00 3.2755513587518097e+00 2.5092990173114837e+00 0 0 0 +26 5 2 4.2359999999999998e-01 2.5807438597688113e+00 4.0120175892854135e+00 3.2133398379059099e+00 0 0 0 +27 6 5 -8.4719999999999995e-01 -1.9613581876744359e+00 -4.3556300596085160e+00 2.1101467673534788e+00 0 0 0 +28 6 2 4.2359999999999998e-01 -2.7406520384725965e+00 -4.0207251278130975e+00 1.5828689861678511e+00 0 0 0 +29 6 2 4.2359999999999998e-01 -1.3108232656499081e+00 -3.5992986322410760e+00 2.2680459788743503e+00 0 0 0 + +Velocities + +1 7.7867804888392077e-04 5.8970331623292821e-04 -2.2179517633030531e-04 +2 2.7129529964126462e-03 4.6286427111164284e-03 3.5805549693846352e-03 +3 -1.2736791029204805e-03 1.6108674226414498e-03 -3.3618185901550799e-04 +4 -9.2828595122009308e-04 -1.2537885319521818e-03 -4.1204974953432108e-03 +5 -1.1800848061603740e-03 7.5424401975844038e-04 6.9023177964912290e-05 +6 -3.0914004879905335e-04 1.2755385764678133e-03 7.9574303350202582e-04 +7 -1.1037894966874103e-04 -7.6764845099077425e-04 -7.7217630460203659e-04 +8 3.9060281273221989e-04 -8.1444231918053418e-04 1.5134641148324972e-04 +9 1.2475530960659720e-03 -2.6608454451432528e-03 1.1117602907112732e-03 +10 4.5008983776042893e-04 4.9530197647538077e-04 -2.3336234361093645e-04 +11 -3.6977669078869707e-04 -1.5289071951960539e-03 -2.9176389881837113e-03 +12 1.0850834530183159e-03 -6.4965897903201833e-04 -1.2971152622619948e-03 +13 4.0754559196230639e-03 3.5043502394946119e-03 -7.8324487687854666e-04 +14 -1.3837220448746613e-04 -4.0656048637594394e-03 -3.9333461173944500e-03 +15 -4.3301707382721859e-03 -3.1802661664634938e-03 3.2037919043360571e-03 +16 -9.6715751018414326e-05 -5.0016572678960377e-04 1.4945658875149626e-03 +17 6.5692180538157174e-04 3.6635779995305095e-04 8.3495414466050911e-04 +18 -6.0936815808025862e-04 -9.3774557532468582e-04 -3.3558072507805731e-04 +19 -6.9919768291957119e-04 -3.6060777270430031e-03 4.2833405289822791e-03 +20 4.7777805013736515e-03 5.1003745845520452e-03 1.8002873923729241e-03 +21 -9.5568188553430398e-04 1.6594630943762931e-04 -1.8199788009966615e-04 +22 -3.3137518957653462e-03 -2.8683968287936054e-03 3.6384389958326871e-03 +23 2.4209481134686401e-04 -4.5457709985051130e-03 2.7663581642115042e-03 +24 2.5447450568861086e-04 4.8412447786110117e-04 -4.8021914527341357e-04 +25 4.3722771097312743e-03 -4.5184411669545515e-03 2.5200952006556795e-03 +26 -1.9250110555001179e-03 -3.0342169883610837e-03 3.5062814567984532e-03 +27 -2.6510179146429716e-04 3.6306203629019116e-04 -5.6235585400647747e-04 +28 -2.3068708109787484e-04 -8.5663070212203200e-04 2.1302563179109169e-03 +29 -2.5054744388303732e-03 -1.6773997805290820e-04 2.8436699761004796e-03 + +Bonds + +1 5 1 2 +2 3 1 3 +3 2 3 4 +4 2 3 5 +5 1 3 6 +6 3 6 8 +7 4 6 7 +8 5 8 9 +9 3 8 10 +10 2 10 11 +11 1 10 12 +12 1 10 16 +13 2 12 13 +14 2 12 14 +15 2 12 15 +16 4 16 17 +17 5 18 19 +18 5 18 20 +19 5 21 22 +20 5 21 23 +21 5 24 25 +22 5 24 26 +23 5 27 28 +24 5 27 29 + +Angles + +1 4 2 1 3 +2 4 1 3 5 +3 4 1 3 4 +4 4 1 3 6 +5 4 4 3 5 +6 2 5 3 6 +7 2 4 3 6 +8 3 3 6 7 +9 3 3 6 8 +10 3 7 6 8 +11 2 6 8 9 +12 2 9 8 10 +13 3 6 8 10 +14 2 8 10 11 +15 3 8 10 16 +16 2 11 10 12 +17 1 12 10 16 +18 1 8 10 12 +19 2 11 10 16 +20 2 10 12 15 +21 2 10 12 14 +22 2 10 12 13 +23 4 13 12 15 +24 4 13 12 14 +25 4 14 12 15 +26 4 10 16 17 +27 1 19 18 20 +28 1 22 21 23 +29 1 25 24 26 +30 1 28 27 29 + +Dihedrals + +1 2 2 1 3 6 +2 2 2 1 3 4 +3 3 2 1 3 5 +4 1 1 3 6 8 +5 1 1 3 6 7 +6 5 4 3 6 8 +7 5 4 3 6 7 +8 5 5 3 6 8 +9 5 5 3 6 7 +10 4 3 6 8 9 +11 3 3 6 8 10 +12 3 7 6 8 9 +13 4 7 6 8 10 +14 2 6 8 10 12 +15 2 6 8 10 16 +16 2 6 8 10 11 +17 2 9 8 10 12 +18 4 9 8 10 16 +19 5 9 8 10 11 +20 5 8 10 12 13 +21 1 8 10 12 14 +22 5 8 10 12 15 +23 4 8 10 16 17 +24 5 11 10 12 13 +25 5 11 10 12 14 +26 5 11 10 12 15 +27 2 11 10 16 17 +28 2 12 10 16 17 +29 5 16 10 12 13 +30 5 16 10 12 14 +31 5 16 10 12 15 + +Impropers + +1 1 6 3 8 7 +2 2 8 6 10 9 diff --git a/unittest/commands/in.fourmol b/unittest/commands/in.fourmol new file mode 100644 index 0000000000..df936da78e --- /dev/null +++ b/unittest/commands/in.fourmol @@ -0,0 +1,30 @@ +variable newton_pair index on +variable newton_bond index on +variable bond_factor index 0.10 +variable angle_factor index 0.25 +variable dihedral_factor index 0.50 +variable units index real +variable input_dir index . +variable data_file index ${input_dir}/data.fourmol +variable pair_style index 'zero 8.0' +variable bond_style index zero +variable angle_style index zero +variable dihedral_style index zero +variable improper_style index zero +variable t_target index 100.0 + +atom_style full +atom_modify map array +neigh_modify delay 2 every 2 check no +units ${units} +timestep 0.1 +newton ${newton_pair} ${newton_bond} +special_bonds lj/coul ${bond_factor} ${angle_factor} ${dihedral_factor} + +pair_style ${pair_style} +bond_style ${bond_style} +angle_style ${angle_style} +dihedral_style ${dihedral_style} +improper_style ${improper_style} + +read_data ${data_file} From 33be5ff0b461509b542393bad975a45f967382e2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 21:04:59 -0500 Subject: [PATCH 150/174] allow that the include command may have quoted arguments with variables --- src/input.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 30424ad5cb..c1ee05999e 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -966,10 +966,15 @@ void Input::include() if (nfile == maxfile) error->one(FLERR,"Too many nested levels of input scripts"); - infile = fopen(arg[0],"r"); + // expand variables + int n = strlen(arg[0]) + 1; + if (n > maxline) reallocate(line,maxline,n); + strcpy(line,arg[0]); + substitute(line,work,maxline,maxwork,0); + + infile = fopen(line,"r"); if (infile == nullptr) - error->one(FLERR,"Cannot open input script {}: {}", - arg[0], utils::getsyserror()); + error->one(FLERR,"Cannot open input script {}: {}", line, utils::getsyserror()); infiles[nfile++] = infile; } From 6ff157a099789be6d08b0550695919d18ce86a3b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 21:05:19 -0500 Subject: [PATCH 151/174] use quoting to avoid issues with blanks and special characters --- unittest/commands/test_reset_ids.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittest/commands/test_reset_ids.cpp b/unittest/commands/test_reset_ids.cpp index 8ca5fe5c05..1506f9a892 100644 --- a/unittest/commands/test_reset_ids.cpp +++ b/unittest/commands/test_reset_ids.cpp @@ -46,8 +46,8 @@ protected: LAMMPSTest::SetUp(); if (info->has_style("atom", "full")) { BEGIN_HIDE_OUTPUT(); - command("variable input_dir index " STRINGIFY(TEST_INPUT_FOLDER)); - command("include ${input_dir}/in.fourmol"); + command("variable input_dir index \"" STRINGIFY(TEST_INPUT_FOLDER) "\""); + command("include \"${input_dir}/in.fourmol\""); END_HIDE_OUTPUT(); } } From ebeb29adf6ec8d9bd2f6dc649e34a5ca462ed95a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 29 Jan 2022 21:34:51 -0500 Subject: [PATCH 152/174] skip python folder tests for now on windows --- unittest/python/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unittest/python/CMakeLists.txt b/unittest/python/CMakeLists.txt index 3cc6b9a91b..0d343582ef 100644 --- a/unittest/python/CMakeLists.txt +++ b/unittest/python/CMakeLists.txt @@ -11,6 +11,11 @@ if(NOT BUILD_SHARED_LIBS) return() endif() +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + message(STATUS "Skipping Tests for the LAMMPS Python Module: not yet ported to Windows") + return() +endif() + if(CMAKE_VERSION VERSION_LESS 3.12) find_package(PythonInterp 3.5) # Deprecated since version 3.12 if(PYTHONINTERP_FOUND) @@ -36,7 +41,7 @@ if(Python_EXECUTABLE) set(PYTHON_TEST_ENVIRONMENT PYTHONPATH=${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}) get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(BUILD_IS_MULTI_CONFIG) - set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) + set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) else() set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}) endif() From a8632d5cb6e8ae34448358089afbe6a75c00adce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 05:11:32 -0500 Subject: [PATCH 153/174] always have the lib prefix on the LAMMPS library (windows may drop it on the .dll file) --- cmake/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 256b663fd6..7ee4563b6e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -676,6 +676,7 @@ endif() set_target_properties(lammps PROPERTIES OUTPUT_NAME lammps${LAMMPS_MACHINE}) set_target_properties(lammps PROPERTIES SOVERSION ${SOVERSION}) +set_target_properties(lammps PROPERTIES PREFIX "lib") target_include_directories(lammps PUBLIC $) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/includes/lammps) foreach(_HEADER ${LAMMPS_CXX_HEADERS}) From 923b0cfc4638dd39ac229f46f7d9cd8a1a380250 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 05:13:17 -0500 Subject: [PATCH 154/174] allow to override the LAMMPS dll location on windows this is to work around the situation that windows has no equivalent to LD_LIBRARY_PATH (short of augmenting %PATH%, which is tricky for CMake before 3.20) --- python/lammps/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/lammps/core.py b/python/lammps/core.py index 0bc8d0cb3f..62b0f5d8b6 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -89,6 +89,9 @@ class lammps(object): modpath = dirname(abspath(getsourcefile(lambda:0))) # for windows installers the shared library is in a different folder winpath = abspath(os.path.join(modpath,'..','..','bin')) + # allow override for running tests on Windows + if (os.environ.get("LAMMPSDLLPATH")): + winpath = os.environ.get("LAMMPSDLLPATH") self.lib = None self.lmp = None From 4bb7457d6e3bfd05abc97c48421ffc2fbe1a6c29 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 05:14:57 -0500 Subject: [PATCH 155/174] add option to allow skipping tests by setting a no${CMAKE_SYSTEM_NAME} tag --- unittest/force-styles/CMakeLists.txt | 36 +++++++++++++++++++ .../tests/fix-timestep-python_move_nve.yaml | 1 + .../tests/mol-pair-python_hybrid.yaml | 1 + .../tests/mol-pair-python_lj.yaml | 1 + 4 files changed, 39 insertions(+) diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 0a4a1ce33e..ebad38ed0b 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -77,6 +77,10 @@ endif() foreach(TEST ${MOL_PAIR_TESTS}) string(REGEX REPLACE "^.*mol-pair-(.*)\.yaml" "MolPairStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -87,6 +91,10 @@ file(GLOB ATOMIC_PAIR_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/atomic-p foreach(TEST ${ATOMIC_PAIR_TESTS}) string(REGEX REPLACE "^.*atomic-pair-(.*)\.yaml" "AtomicPairStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -97,6 +105,10 @@ file(GLOB MANYBODY_PAIR_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/manybo foreach(TEST ${MANYBODY_PAIR_TESTS}) string(REGEX REPLACE "^.*manybody-pair-(.*)\.yaml" "ManybodyPairStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -110,6 +122,10 @@ file(GLOB BOND_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/bond-*.yaml) foreach(TEST ${BOND_TESTS}) string(REGEX REPLACE "^.*bond-(.*)\.yaml" "BondStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_bond_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -123,6 +139,10 @@ file(GLOB ANGLE_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml) foreach(TEST ${ANGLE_TESTS}) string(REGEX REPLACE "^.*angle-(.*)\.yaml" "AngleStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_angle_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -137,6 +157,10 @@ endif() foreach(TEST ${KSPACE_TESTS}) string(REGEX REPLACE "^.*kspace-(.*)\.yaml" "KSpaceStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -154,6 +178,10 @@ file(GLOB FIX_TIMESTEP_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/fix-tim foreach(TEST ${FIX_TIMESTEP_TESTS}) string(REGEX REPLACE "^.*fix-timestep-(.*)\.yaml" "FixTimestep:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_fix_timestep ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -167,6 +195,10 @@ file(GLOB DIHEDRAL_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/dihedral-*. foreach(TEST ${DIHEDRAL_TESTS}) string(REGEX REPLACE "^.*dihedral-(.*)\.yaml" "DihedralStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_dihedral_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") @@ -180,6 +212,10 @@ file(GLOB IMPROPER_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/improper-*. foreach(TEST ${IMPROPER_TESTS}) string(REGEX REPLACE "^.*improper-(.*)\.yaml" "ImproperStyle:\\1" TNAME ${TEST}) extract_tags(TEST_TAGS ${TEST}) + list(FIND TEST_TAGS "no${CMAKE_SYSTEM_NAME}" _SKIPME) + if(_SKIPME GREATER_EQUAL 0) + continue() + endif() add_test(NAME ${TNAME} COMMAND test_improper_style ${TEST}) set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") diff --git a/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml b/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml index 04bd81670b..9b1fe755ca 100644 --- a/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml +++ b/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml @@ -1,6 +1,7 @@ --- lammps_version: 10 Mar 2021 date_generated: Wed Mar 24 18:57:26 2021 +tags: noWindows skip_tests: static epsilon: 9e-12 prerequisites: ! | diff --git a/unittest/force-styles/tests/mol-pair-python_hybrid.yaml b/unittest/force-styles/tests/mol-pair-python_hybrid.yaml index 5383ee113f..fc55d85304 100644 --- a/unittest/force-styles/tests/mol-pair-python_hybrid.yaml +++ b/unittest/force-styles/tests/mol-pair-python_hybrid.yaml @@ -1,6 +1,7 @@ --- lammps_version: 8 Apr 2021 date_generated: Mon Apr 19 08:49:08 2021 +tags: noWindows epsilon: 5e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/mol-pair-python_lj.yaml b/unittest/force-styles/tests/mol-pair-python_lj.yaml index ac4fcd9207..ecdacdedef 100644 --- a/unittest/force-styles/tests/mol-pair-python_lj.yaml +++ b/unittest/force-styles/tests/mol-pair-python_lj.yaml @@ -1,6 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:56 2021 +tags: noWindows epsilon: 5e-14 prerequisites: ! | atom full From 213259b732da1fb5d105b50486edb1e6a3f90ae3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 05:54:21 -0500 Subject: [PATCH 156/174] temporarily switch repo and branch to run on --- .github/workflows/compile-msvc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index e8cfcd4788..3cbc857b8e 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -3,12 +3,12 @@ name: "Native Windows Compilation" on: push: - branches: [develop] + branches: [mpi-stubs-simplify] jobs: build: name: Windows Compilation Test - if: ${{ github.repository == 'lammps/lammps' }} + if: ${{ github.repository == 'akohlmey/lammps' }} runs-on: windows-latest steps: From b17d8b4494d9234eb16d079debb69f7f0919ac43 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 05:54:35 -0500 Subject: [PATCH 157/174] add building and running unit tests --- .github/workflows/compile-msvc.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 3cbc857b8e..a099a891f1 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -1,5 +1,5 @@ # GitHub action to build LAMMPS on Windows with Visual C++ -name: "Native Windows Compilation" +name: "Native Windows Compilation and Unit Tests" on: push: @@ -23,7 +23,8 @@ jobs: cmake -C cmake/presets/windows.cmake \ -S cmake -B build \ -D BUILD_SHARED_LIBS=on \ - -D LAMMPS_EXCEPTIONS=on + -D LAMMPS_EXCEPTIONS=on \ + -D ENABLE_TESTING=on cmake --build build --config Release - name: Run LAMMPS executable @@ -31,3 +32,8 @@ jobs: run: | ./build/Release/lmp.exe -h ./build/Release/lmp.exe -in bench/in.lj + + - name: Run Unit Tests + working-directory: build + shell: bash + run: ctest -V -C Release From 99cb494594c1671525ba69a867b087c7f16f2480 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 07:08:15 -0500 Subject: [PATCH 158/174] remove automatic generated tag --- unittest/force-styles/tests/mol-pair-harmonic_cut.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/unittest/force-styles/tests/mol-pair-harmonic_cut.yaml b/unittest/force-styles/tests/mol-pair-harmonic_cut.yaml index f1c39f1bd5..fb2714626f 100644 --- a/unittest/force-styles/tests/mol-pair-harmonic_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-harmonic_cut.yaml @@ -1,6 +1,5 @@ --- lammps_version: 7 Jan 2022 -tags: generated date_generated: Sat Jan 15 17:42:24 2022 epsilon: 5e-14 skip_tests: From dc0e013297516d5eac1e0806c76bfa06153ad062 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 07:48:16 -0500 Subject: [PATCH 159/174] create alias target MPI::ANY_CXX to be used instead of MPI::MPI_CXX With this alias it is possible to transparently refer to either the real imported MPI library or to the MPI stub library. this further reduced the need for if statements related to MPI. Some uses of MPI::MPI_CXX remain but they are all in branches of the script code where BUILD_MPI is enabled and thus the imported target will be present. --- cmake/CMakeLists.txt | 11 ++++------- cmake/Modules/Packages/GPU.cmake | 6 +----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7ee4563b6e..1778c7b7f2 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -290,13 +290,14 @@ if(BUILD_MPI) target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG) endif() endif() - target_link_libraries(lammps PUBLIC MPI::MPI_CXX) + add_library(MPI::ANY_CXX ALIAS MPI::MPI_CXX) else() target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) add_library(mpi_stubs INTERFACE) target_include_directories(mpi_stubs INTERFACE $) - target_link_libraries(lammps PUBLIC mpi_stubs) + add_library(MPI::ANY_CXX ALIAS mpi_stubs) endif() +target_link_libraries(lammps PUBLIC MPI::ANY_CXX) 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) @@ -577,11 +578,7 @@ if(PKG_ATC) if(LAMMPS_SIZES STREQUAL "BIGBIG") message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG") endif() - if(BUILD_MPI) - target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX) - else() - target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs) - endif() + target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::ANY_CXX) target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}) target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES}) endif() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index fe15917f47..feee45ee68 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -422,11 +422,7 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) -if(BUILD_MPI) - target_link_libraries(gpu PRIVATE MPI::MPI_CXX) -else() - target_link_libraries(gpu PRIVATE mpi_stubs) -endif() +target_link_libraries(gpu PRIVATE MPI::ANY_CXX) target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE}) From f8a4006da7c14eeb0517aa52b2fd7dfd0b550c60 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 08:32:21 -0500 Subject: [PATCH 160/174] must promote imported target to global scope in order to be able to alias it --- cmake/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1778c7b7f2..e2f7d8c90c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -276,6 +276,8 @@ else() option(BUILD_MPI "Build MPI version" OFF) endif() +# configure MPI related settings and define an MPI::ANY_CXX alias target +# which will point to either the imported MPI library or the STUBS lib if(BUILD_MPI) # do not include the (obsolete) MPI C++ bindings which makes # for leaner object files and avoids namespace conflicts @@ -290,6 +292,9 @@ if(BUILD_MPI) target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG) endif() endif() + if(CMAKE_VERSION VERSION_GREATER 3.11) + set_property(TARGET MPI::MPI_CXX PROPERTY IMPORTED_GOBAL TRUE) + endif() add_library(MPI::ANY_CXX ALIAS MPI::MPI_CXX) else() target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) From 4b22962ec16c3705dead9ce83beaf54cbc7a18ac Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 08:47:46 -0500 Subject: [PATCH 161/174] roll back MPI target alias change one more time. must wait until CMake 3.11 or later is minimum --- cmake/CMakeLists.txt | 16 +++++++--------- cmake/Modules/Packages/GPU.cmake | 6 +++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index e2f7d8c90c..7ee4563b6e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -276,8 +276,6 @@ else() option(BUILD_MPI "Build MPI version" OFF) endif() -# configure MPI related settings and define an MPI::ANY_CXX alias target -# which will point to either the imported MPI library or the STUBS lib if(BUILD_MPI) # do not include the (obsolete) MPI C++ bindings which makes # for leaner object files and avoids namespace conflicts @@ -292,17 +290,13 @@ if(BUILD_MPI) target_compile_definitions(lammps PRIVATE -DLAMMPS_LONGLONG_TO_LONG) endif() endif() - if(CMAKE_VERSION VERSION_GREATER 3.11) - set_property(TARGET MPI::MPI_CXX PROPERTY IMPORTED_GOBAL TRUE) - endif() - add_library(MPI::ANY_CXX ALIAS MPI::MPI_CXX) + target_link_libraries(lammps PUBLIC MPI::MPI_CXX) else() target_sources(lammps PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS/mpi.cpp) add_library(mpi_stubs INTERFACE) target_include_directories(mpi_stubs INTERFACE $) - add_library(MPI::ANY_CXX ALIAS mpi_stubs) + target_link_libraries(lammps PUBLIC mpi_stubs) endif() -target_link_libraries(lammps PUBLIC MPI::ANY_CXX) 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) @@ -583,7 +577,11 @@ if(PKG_ATC) if(LAMMPS_SIZES STREQUAL "BIGBIG") message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG") endif() - target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::ANY_CXX) + if(BUILD_MPI) + target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX) + else() + target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs) + endif() target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR}) target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES}) endif() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index feee45ee68..ee697459d8 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -422,7 +422,11 @@ RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES) RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) -target_link_libraries(gpu PRIVATE MPI::ANY_CXX) +if(BUILD_MPI) + target_link_libraries(gpu PRIVATE MPI::ANY_CXX) +else() + target_link_libraries(gpu PRIVATE mpi_stubs) +endif() target_compile_definitions(gpu PRIVATE -DLAMMPS_${LAMMPS_SIZES}) set_target_properties(gpu PROPERTIES OUTPUT_NAME lammps_gpu${LAMMPS_MACHINE}) From 65b198f98663cc3a23f9da96a8c609a12ae211e3 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 08:48:52 -0500 Subject: [PATCH 162/174] Revert "temporarily switch repo and branch to run on" This reverts commit 213259b732da1fb5d105b50486edb1e6a3f90ae3. --- .github/workflows/compile-msvc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index a099a891f1..e71a2950e6 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -3,12 +3,12 @@ name: "Native Windows Compilation and Unit Tests" on: push: - branches: [mpi-stubs-simplify] + branches: [develop] jobs: build: name: Windows Compilation Test - if: ${{ github.repository == 'akohlmey/lammps' }} + if: ${{ github.repository == 'lammps/lammps' }} runs-on: windows-latest steps: From af8d1bd768dc53d07f53e7b5b493e6309d15334f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 09:00:39 -0500 Subject: [PATCH 163/174] fix typo --- cmake/Modules/Packages/GPU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index ee697459d8..fe15917f47 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -423,7 +423,7 @@ RegisterFixStyle(${GPU_SOURCES_DIR}/fix_gpu.h) get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES) if(BUILD_MPI) - target_link_libraries(gpu PRIVATE MPI::ANY_CXX) + target_link_libraries(gpu PRIVATE MPI::MPI_CXX) else() target_link_libraries(gpu PRIVATE mpi_stubs) endif() From fea41d5458cde75fefb9835240195247c62e0406 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 16:47:17 -0500 Subject: [PATCH 164/174] make windows compatible --- src/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index eabe86adbc..ca2a0c4f5b 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1028,7 +1028,7 @@ std::vector utils::split_words(const std::string &text) ------------------------------------------------------------------------- */ std::vector utils::split_lines(const std::string &text) { - return Tokenizer(text, "\n").as_vector(); + return Tokenizer(text, "\r\n").as_vector(); } /* ---------------------------------------------------------------------- From 579ac61b5b1c1a19f77ff32384dd23c5ffa67400 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 16:47:52 -0500 Subject: [PATCH 165/174] refactor environment variable settings. make windows compatible --- unittest/force-styles/CMakeLists.txt | 38 +++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index ebad38ed0b..934c110b1f 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -68,6 +68,28 @@ if(FFT_SINGLE) target_compile_definitions(test_pair_style PRIVATE -DFFT_SINGLE) endif() +# prepare environment for testers +if(WIN32) + set(FORCE_TEST_ENVIRONMENT PYTHONPATH=${TEST_INPUT_FOLDER}) +else() + set(FORCE_TEST_ENVIRONMENT PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}) +endif() +list(APPEND FORCE_TEST_ENVIRONMENT "PYTHONUNBUFFERED=1") +list(APPEND FORCE_TEST_ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") +get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(BUILD_IS_MULTI_CONFIG) + set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) +else() + set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}) +endif() +if(APPLE) + list(APPEND FORCE_TEST_ENVIRONMENT "DYLD_LIBRARY_PATH=${LAMMPS_LIB_PATH}:$ENV{DYLD_LIBRARY_PATH}") +elseif(WIN32) + list(APPEND FORCE_TEST_ENVIRONMENT "LAMMPSDLLPATH=${LAMMPS_LIB_PATH}") +else() + list(APPEND FORCE_TEST_ENVIRONMENT "LD_LIBRARY_PATH=${LAMMPS_LIB_PATH}:$ENV{LD_LIBRARY_PATH}") +endif() + # tests for molecular systems and related pair styles file(GLOB MOL_PAIR_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/mol-pair-*.yaml) # cannot test MSM with single precision data @@ -82,7 +104,7 @@ foreach(TEST ${MOL_PAIR_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "${FORCE_TEST_ENVIRONMENT}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -96,7 +118,7 @@ foreach(TEST ${ATOMIC_PAIR_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "${FORCE_TEST_ENVIRONMENT}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -110,7 +132,7 @@ foreach(TEST ${MANYBODY_PAIR_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "${FORCE_TEST_ENVIRONMENT}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -127,7 +149,7 @@ foreach(TEST ${BOND_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_bond_style ${TEST}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "${FORCE_TEST_ENVIRONMENT}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -144,7 +166,7 @@ foreach(TEST ${ANGLE_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_angle_style ${TEST}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "${FORCE_TEST_ENVIRONMENT}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -162,7 +184,7 @@ foreach(TEST ${KSPACE_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_pair_style ${TEST}) - set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:$ENV{PYTHONPATH}") + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "${FORCE_TEST_ENVIRONMENT}") set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() @@ -183,7 +205,11 @@ foreach(TEST ${FIX_TIMESTEP_TESTS}) continue() endif() add_test(NAME ${TNAME} COMMAND test_fix_timestep ${TEST}) +if(WIN32) + set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}\\\;${LAMMPS_PYTHON_DIR}") +else() set_tests_properties(${TNAME} PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${TEST_INPUT_FOLDER}:${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}") +endif() set_tests_properties(${TNAME} PROPERTIES LABELS "${TEST_TAGS}") endforeach() From 2e39971cbcef1d6c1c2cc84a5bc4b33d3d76536f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 16:48:11 -0500 Subject: [PATCH 166/174] re-enable python module tests on windows --- unittest/force-styles/tests/fix-timestep-python_move_nve.yaml | 1 - unittest/force-styles/tests/mol-pair-python_hybrid.yaml | 1 - unittest/force-styles/tests/mol-pair-python_lj.yaml | 1 - 3 files changed, 3 deletions(-) diff --git a/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml b/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml index 9b1fe755ca..04bd81670b 100644 --- a/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml +++ b/unittest/force-styles/tests/fix-timestep-python_move_nve.yaml @@ -1,7 +1,6 @@ --- lammps_version: 10 Mar 2021 date_generated: Wed Mar 24 18:57:26 2021 -tags: noWindows skip_tests: static epsilon: 9e-12 prerequisites: ! | diff --git a/unittest/force-styles/tests/mol-pair-python_hybrid.yaml b/unittest/force-styles/tests/mol-pair-python_hybrid.yaml index fc55d85304..5383ee113f 100644 --- a/unittest/force-styles/tests/mol-pair-python_hybrid.yaml +++ b/unittest/force-styles/tests/mol-pair-python_hybrid.yaml @@ -1,7 +1,6 @@ --- lammps_version: 8 Apr 2021 date_generated: Mon Apr 19 08:49:08 2021 -tags: noWindows epsilon: 5e-14 prerequisites: ! | atom full diff --git a/unittest/force-styles/tests/mol-pair-python_lj.yaml b/unittest/force-styles/tests/mol-pair-python_lj.yaml index ecdacdedef..ac4fcd9207 100644 --- a/unittest/force-styles/tests/mol-pair-python_lj.yaml +++ b/unittest/force-styles/tests/mol-pair-python_lj.yaml @@ -1,7 +1,6 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:56 2021 -tags: noWindows epsilon: 5e-14 prerequisites: ! | atom full From a8a76dbbe2c5e1f1b5902564001b16558d6e4eac Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 16:48:47 -0500 Subject: [PATCH 167/174] port python module and package tests to be windows compatible. refactor environment processing --- unittest/python/CMakeLists.txt | 52 ++++++++++++++----------- unittest/python/test_python_package.cpp | 10 ++--- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/unittest/python/CMakeLists.txt b/unittest/python/CMakeLists.txt index 0d343582ef..7f9b5e71b2 100644 --- a/unittest/python/CMakeLists.txt +++ b/unittest/python/CMakeLists.txt @@ -11,18 +11,13 @@ if(NOT BUILD_SHARED_LIBS) return() endif() -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - message(STATUS "Skipping Tests for the LAMMPS Python Module: not yet ported to Windows") - return() -endif() - if(CMAKE_VERSION VERSION_LESS 3.12) - find_package(PythonInterp 3.5) # Deprecated since version 3.12 + find_package(PythonInterp 3.6) # Deprecated since version 3.12 if(PYTHONINTERP_FOUND) set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) endif() else() - find_package(Python3 COMPONENTS Interpreter Development) + find_package(Python3 3.6 COMPONENTS Interpreter Development) endif() add_executable(test_python_package test_python_package.cpp) @@ -34,24 +29,33 @@ if(Python3_Development_FOUND) target_link_libraries(test_python_package PRIVATE Python3::Python) endif() add_test(NAME PythonPackage COMMAND test_python_package) -set_tests_properties(PythonPackage PROPERTIES ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR};PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH};PYTHONUNBUFFERED=1") + +# build list of environment variables for testing python functionality +if(WIN32) + set(PYTHON_TEST_ENVIRONMENT PYTHONPATH=${LAMMPS_PYTHON_DIR}) +else() + set(PYTHON_TEST_ENVIRONMENT PYTHONPATH=${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}) +endif() +get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(BUILD_IS_MULTI_CONFIG) + set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) +else() + set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}) +endif() +list(APPEND PYTHON_TEST_ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") +list(APPEND PYTHON_TEST_ENVIRONMENT "PYTHONUNBUFFERED=1") +if(APPLE) + list(APPEND PYTHON_TEST_ENVIRONMENT "DYLD_LIBRARY_PATH=${LAMMPS_LIB_PATH}:$ENV{DYLD_LIBRARY_PATH}") +elseif(WIN32) + list(APPEND PYTHON_TEST_ENVIRONMENT "LAMMPSDLLPATH=${LAMMPS_LIB_PATH}") +else() + list(APPEND PYTHON_TEST_ENVIRONMENT "LD_LIBRARY_PATH=${LAMMPS_LIB_PATH}:$ENV{LD_LIBRARY_PATH}") +endif() +set_tests_properties(PythonPackage PROPERTIES ENVIRONMENT "${PYTHON_TEST_ENVIRONMENT}") if(Python_EXECUTABLE) - # prepare to augment the environment so that the LAMMPS python module and the shared library is found. - set(PYTHON_TEST_ENVIRONMENT PYTHONPATH=${LAMMPS_PYTHON_DIR}:$ENV{PYTHONPATH}) - get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) - if(BUILD_IS_MULTI_CONFIG) - set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}/$) - else() - set(LAMMPS_LIB_PATH ${CMAKE_BINARY_DIR}) - endif() - list(APPEND PYTHON_TEST_ENVIRONMENT "LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS_DIR}") list(APPEND PYTHON_TEST_ENVIRONMENT "TEST_INPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR}") - if(APPLE) - list(APPEND PYTHON_TEST_ENVIRONMENT "DYLD_LIBRARY_PATH=${LAMMPS_LIB_PATH}:$ENV{DYLD_LIBRARY_PATH};LAMMPS_CMAKE_CACHE=${CMAKE_BINARY_DIR}/CMakeCache.txt") - else() - list(APPEND PYTHON_TEST_ENVIRONMENT "LD_LIBRARY_PATH=${LAMMPS_LIB_PATH}:$ENV{LD_LIBRARY_PATH};LAMMPS_CMAKE_CACHE=${CMAKE_BINARY_DIR}/CMakeCache.txt") - endif() + list(APPEND PYTHON_TEST_ENVIRONMENT "LAMMPS_CMAKE_CACHE=${CMAKE_BINARY_DIR}/CMakeCache.txt") if(LAMMPS_MACHINE) # convert from '_machine' to 'machine' string(SUBSTRING ${LAMMPS_MACHINE} 1 -1 LAMMPS_MACHINE_NAME) @@ -94,10 +98,14 @@ if(Python_EXECUTABLE) WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) set_tests_properties(PythonCapabilities PROPERTIES ENVIRONMENT "${PYTHON_TEST_ENVIRONMENT}") +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + message(STATUS "Skipping Tests for PyLammps Module: not yet ported to Windows") +else() add_test(NAME PythonPyLammps COMMAND ${PYTHON_TEST_RUNNER} ${CMAKE_CURRENT_SOURCE_DIR}/python-pylammps.py -v WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) set_tests_properties(PythonPyLammps PROPERTIES ENVIRONMENT "${PYTHON_TEST_ENVIRONMENT}") +endif() add_test(NAME PythonFormats COMMAND ${PYTHON_TEST_RUNNER} ${CMAKE_CURRENT_SOURCE_DIR}/python-formats.py -v diff --git a/unittest/python/test_python_package.cpp b/unittest/python/test_python_package.cpp index 07b9a29f28..82b4704e5f 100644 --- a/unittest/python/test_python_package.cpp +++ b/unittest/python/test_python_package.cpp @@ -89,7 +89,7 @@ TEST_F(PythonPackageTest, InvokeFunctionFromFile) auto output = CAPTURE_OUTPUT([&]() { command("python printnum invoke"); }); - ASSERT_THAT(output, HasSubstr("2.25\n")); + ASSERT_THAT(output, HasSubstr("2.25")); } #if defined(TEST_HAVE_PYTHON_DEVELOPMENT) @@ -210,7 +210,7 @@ TEST_F(PythonPackageTest, InvokeOtherFunctionFromFile) auto output = CAPTURE_OUTPUT([&] { command("python printtxt invoke"); }); - ASSERT_THAT(output, HasSubstr("sometext\n")); + ASSERT_THAT(output, HasSubstr("sometext")); } TEST_F(PythonPackageTest, InvokeFunctionThatUsesLAMMPSModule) @@ -224,7 +224,7 @@ TEST_F(PythonPackageTest, InvokeFunctionThatUsesLAMMPSModule) auto output = CAPTURE_OUTPUT([&] { command("python getidxvar invoke"); }); - ASSERT_THAT(output, HasSubstr("2.25\n")); + ASSERT_THAT(output, HasSubstr("2.25")); } TEST_F(PythonPackageTest, python_variable) @@ -238,7 +238,7 @@ TEST_F(PythonPackageTest, python_variable) std::string output = CAPTURE_OUTPUT([&] { command("print \"${sq}\""); }); - ASSERT_THAT(output, ContainsRegex("print.*2.25.*")); + ASSERT_THAT(output, ContainsRegex("print.*\n.*2.25.*")); } TEST_F(PythonPackageTest, InlineFunction) @@ -309,7 +309,7 @@ TEST_F(FixPythonInvokeTest, end_of_step) auto output = CAPTURE_OUTPUT([&] { command("run 50"); }); - + fprintf(stderr,"lines: %s\n",output.c_str()); auto lines = utils::split_lines(output); int count = 0; From 3707b327c097db033defa5a2e4e059b6a9d199bd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 16:52:38 -0500 Subject: [PATCH 168/174] improve portability of python result value string conversion --- src/PYTHON/python_impl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index 983aafb16b..bc593d5b8a 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -329,9 +329,11 @@ void PythonImpl::invoke_function(int ifunc, char *result) if (pfuncs[ifunc].noutput) { int otype = pfuncs[ifunc].otype; if (otype == INT) { - sprintf(result, "%ld", PY_INT_AS_LONG(pValue)); + auto value = fmt::format("{}", PY_INT_AS_LONG(pValue)); + strncpy(result, value.c_str(), Variable::VALUELENGTH - 1); } else if (otype == DOUBLE) { - sprintf(result, "%.15g", PyFloat_AsDouble(pValue)); + auto value = fmt::format("{:.15g}", PyFloat_AsDouble(pValue)); + strncpy(result, value.c_str(), Variable::VALUELENGTH - 1); } else if (otype == STRING) { const char *pystr = PY_STRING_AS_STRING(pValue); if (pfuncs[ifunc].longstr) From 7ee7d0c57000f4fb461c2bfdc31983df3e187dd1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 30 Jan 2022 17:18:40 -0500 Subject: [PATCH 169/174] apply clang-format --- unittest/c-library/test_library_commands.cpp | 16 +++++++------- unittest/c-library/test_library_config.cpp | 2 +- .../c-library/test_library_properties.cpp | 8 ++++--- .../c-library/test_library_scatter_gather.cpp | 2 +- unittest/commands/test_lattice_region.cpp | 2 +- unittest/commands/test_simple_commands.cpp | 12 ++++++----- unittest/commands/test_variables.cpp | 4 ++-- unittest/cplusplus/test_input_class.cpp | 6 +++--- unittest/cplusplus/test_lammps_class.cpp | 4 ++-- unittest/force-styles/test_angle_style.cpp | 2 +- unittest/force-styles/test_bond_style.cpp | 2 +- unittest/force-styles/test_config_reader.cpp | 2 +- unittest/force-styles/test_dihedral_style.cpp | 2 +- unittest/force-styles/test_fix_timestep.cpp | 4 ++-- unittest/force-styles/test_improper_style.cpp | 2 +- unittest/formats/test_atom_styles.cpp | 2 +- unittest/formats/test_dump_atom.cpp | 4 ++-- unittest/formats/test_dump_custom.cpp | 6 +++--- unittest/formats/test_file_operations.cpp | 4 +++- unittest/formats/test_molecule_file.cpp | 21 +++++++++++-------- unittest/formats/test_text_file_reader.cpp | 2 +- unittest/python/test_python_package.cpp | 2 +- unittest/utils/test_math_eigen_impl.cpp | 14 ++++++------- unittest/utils/test_platform.cpp | 4 ++-- unittest/utils/test_utils.cpp | 16 +++++++------- 25 files changed, 77 insertions(+), 68 deletions(-) diff --git a/unittest/c-library/test_library_commands.cpp b/unittest/c-library/test_library_commands.cpp index 203862c696..f1cc51d8d9 100644 --- a/unittest/c-library/test_library_commands.cpp +++ b/unittest/c-library/test_library_commands.cpp @@ -20,7 +20,7 @@ const char *cont_input[] = {"create_atoms 1 single &", "0.2 0.1 0.1"}; class LibraryCommands : public ::testing::Test { protected: void *lmp; - LibraryCommands() = default; + LibraryCommands() = default; ~LibraryCommands() override = default; void SetUp() override @@ -55,13 +55,13 @@ TEST_F(LibraryCommands, from_file) const char cont_file[] = "in.cont"; fp = fopen(demo_file, "w"); - for (auto & inp : demo_input) { + for (auto &inp : demo_input) { fputs(inp, fp); fputc('\n', fp); } fclose(fp); fp = fopen(cont_file, "w"); - for (auto & inp : cont_input) { + for (auto &inp : cont_input) { fputs(inp, fp); fputc('\n', fp); } @@ -85,7 +85,7 @@ TEST_F(LibraryCommands, from_line) { EXPECT_EQ(lammps_get_natoms(lmp), 0); if (!verbose) ::testing::internal::CaptureStdout(); - for (auto & inp : demo_input) { + for (auto &inp : demo_input) { lammps_command(lmp, inp); } if (!verbose) ::testing::internal::GetCapturedStdout(); @@ -106,11 +106,11 @@ TEST_F(LibraryCommands, from_string) { std::string cmds(""); - for (auto & inp : demo_input) { + for (auto &inp : demo_input) { cmds += inp; cmds += "\n"; } - for (auto & inp : cont_input) { + for (auto &inp : cont_input) { cmds += inp; cmds += "\n"; } @@ -126,11 +126,11 @@ TEST_F(LibraryCommands, from_string) if (!verbose) ::testing::internal::GetCapturedStdout(); cmds.clear(); - for (auto & inp : demo_input) { + for (auto &inp : demo_input) { cmds += inp; cmds += "\r\n"; } - for (auto & inp : cont_input) { + for (auto &inp : cont_input) { cmds += inp; cmds += "\r\n"; } diff --git a/unittest/c-library/test_library_config.cpp b/unittest/c-library/test_library_config.cpp index 456faff06f..f402ffc2e9 100644 --- a/unittest/c-library/test_library_config.cpp +++ b/unittest/c-library/test_library_config.cpp @@ -22,7 +22,7 @@ protected: void *lmp; std::string INPUT_DIR = STRINGIFY(TEST_INPUT_FOLDER); - LibraryConfig() = default; + LibraryConfig() = default; ~LibraryConfig() override = default; void SetUp() override diff --git a/unittest/c-library/test_library_properties.cpp b/unittest/c-library/test_library_properties.cpp index 754c6df77f..ee0bd1f270 100644 --- a/unittest/c-library/test_library_properties.cpp +++ b/unittest/c-library/test_library_properties.cpp @@ -23,7 +23,7 @@ protected: void *lmp; std::string INPUT_DIR = STRINGIFY(TEST_INPUT_FOLDER); - LibraryProperties() = default; + LibraryProperties() = default; ~LibraryProperties() override = default; void SetUp() override @@ -436,8 +436,10 @@ class AtomProperties : public ::testing::Test { protected: void *lmp; - AtomProperties()= default;; - ~AtomProperties() override= default;; + AtomProperties() = default; + ; + ~AtomProperties() override = default; + ; void SetUp() override { diff --git a/unittest/c-library/test_library_scatter_gather.cpp b/unittest/c-library/test_library_scatter_gather.cpp index 7ee1cfc9eb..b070bb4ab7 100644 --- a/unittest/c-library/test_library_scatter_gather.cpp +++ b/unittest/c-library/test_library_scatter_gather.cpp @@ -23,7 +23,7 @@ protected: void *lmp; std::string INPUT_DIR = STRINGIFY(TEST_INPUT_FOLDER); - GatherProperties() = default; + GatherProperties() = default; ~GatherProperties() override = default; void SetUp() override diff --git a/unittest/commands/test_lattice_region.cpp b/unittest/commands/test_lattice_region.cpp index 590180326c..4f314b1669 100644 --- a/unittest/commands/test_lattice_region.cpp +++ b/unittest/commands/test_lattice_region.cpp @@ -35,8 +35,8 @@ bool verbose = false; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { -using ::testing::ExitedWithCode; using ::testing::ContainsRegex; +using ::testing::ExitedWithCode; using ::testing::StrEq; class LatticeRegionTest : public LAMMPSTest { diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index 862c3a8c4a..acbade5ad8 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -39,8 +39,8 @@ bool verbose = false; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { -using ::testing::ExitedWithCode; using ::testing::ContainsRegex; +using ::testing::ExitedWithCode; using ::testing::StrEq; class SimpleCommandsTest : public LAMMPSTest { @@ -412,14 +412,14 @@ TEST_F(SimpleCommandsTest, Plugin) text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; ASSERT_THAT(text, ContainsRegex(".*1: command style plugin hello" - ".*2: fix style plugin nve2.*")); + ".*2: fix style plugin nve2.*")); ::testing::internal::CaptureStdout(); lmp->input->one(fmt::format(loadfmt, "hello")); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; ASSERT_THAT(text, ContainsRegex(".*Ignoring load of command style hello: " - "must unload existing hello plugin.*")); + "must unload existing hello plugin.*")); ::testing::internal::CaptureStdout(); lmp->input->one("plugin unload command hello"); @@ -479,7 +479,8 @@ TEST_F(SimpleCommandsTest, Shell) test_var = getenv("TEST_VARIABLE"); ASSERT_NE(test_var, nullptr); #if defined(_WIN32) - // we cannot create empty environment variables on Windows so platform::putenv() sets their value to "1" + // we cannot create empty environment variables on Windows so platform::putenv() sets their + // value to "1" ASSERT_THAT(test_var, StrEq("1")); #else ASSERT_THAT(test_var, StrEq("")); @@ -501,7 +502,8 @@ TEST_F(SimpleCommandsTest, CiteMe) // find the two unique citations, but not the third ASSERT_THAT(text, ContainsRegex("test citation one.\n.*test citation two.*")); - ASSERT_THAT(text, Not(ContainsRegex("test citation one.\n.*test citation two.*\n.*test citation one.*"))); + ASSERT_THAT(text, Not(ContainsRegex( + "test citation one.\n.*test citation two.*\n.*test citation one.*"))); BEGIN_CAPTURE_OUTPUT(); lmp->citeme->add("test citation one:\n 0\n"); diff --git a/unittest/commands/test_variables.cpp b/unittest/commands/test_variables.cpp index af52df8e28..57a5d4f0ca 100644 --- a/unittest/commands/test_variables.cpp +++ b/unittest/commands/test_variables.cpp @@ -36,8 +36,8 @@ using LAMMPS_NS::MathConst::MY_PI; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { -using ::testing::ExitedWithCode; using ::testing::ContainsRegex; +using ::testing::ExitedWithCode; using ::testing::StrEq; class VariableTest : public LAMMPSTest { @@ -317,7 +317,7 @@ TEST_F(VariableTest, Expressions) ASSERT_TRUE(variable->equalstyle(ivar)); ASSERT_DOUBLE_EQ(variable->compute_equal(ivar), 2.0); ASSERT_DOUBLE_EQ(variable->compute_equal("v_three"), 3.0); - ASSERT_NEAR(variable->compute_equal("v_four"), MY_PI,1.0e-14); + ASSERT_NEAR(variable->compute_equal("v_four"), MY_PI, 1.0e-14); ASSERT_GE(variable->compute_equal("v_five"), 20210310); ASSERT_DOUBLE_EQ(variable->compute_equal("v_seven"), -1); ASSERT_DOUBLE_EQ(variable->compute_equal("v_eight"), 2.5); diff --git a/unittest/cplusplus/test_input_class.cpp b/unittest/cplusplus/test_input_class.cpp index b1d8af28c6..6595c24695 100644 --- a/unittest/cplusplus/test_input_class.cpp +++ b/unittest/cplusplus/test_input_class.cpp @@ -60,13 +60,13 @@ TEST_F(Input_commands, from_file) const char cont_file[] = "in.cont"; fp = fopen(demo_file, "w"); - for (auto & inp : demo_input) { + for (auto &inp : demo_input) { fputs(inp, fp); fputc('\n', fp); } fclose(fp); fp = fopen(cont_file, "w"); - for (auto & inp : cont_input) { + for (auto &inp : cont_input) { fputs(inp, fp); fputc('\n', fp); } @@ -84,7 +84,7 @@ TEST_F(Input_commands, from_file) TEST_F(Input_commands, from_line) { EXPECT_EQ(lmp->atom->natoms, 0); - for (auto & inp : demo_input) { + for (auto &inp : demo_input) { lmp->input->one(inp); } EXPECT_EQ(lmp->atom->natoms, 1); diff --git a/unittest/cplusplus/test_lammps_class.cpp b/unittest/cplusplus/test_lammps_class.cpp index 6bbeb385e9..6c733a31e4 100644 --- a/unittest/cplusplus/test_lammps_class.cpp +++ b/unittest/cplusplus/test_lammps_class.cpp @@ -372,8 +372,8 @@ TEST(LAMMPS_init, NoOpenMP) ::testing::internal::CaptureStdout(); LAMMPS *lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD); std::string output = ::testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, - ContainsRegex(".*OMP_NUM_THREADS environment is not set.*Defaulting to 1 thread.*")); + EXPECT_THAT(output, ContainsRegex( + ".*OMP_NUM_THREADS environment is not set.*Defaulting to 1 thread.*")); EXPECT_EQ(lmp->comm->nthreads, 1); ::testing::internal::CaptureStdout(); delete lmp; diff --git a/unittest/force-styles/test_angle_style.cpp b/unittest/force-styles/test_angle_style.cpp index b4300218b7..8a974a09d2 100644 --- a/unittest/force-styles/test_angle_style.cpp +++ b/unittest/force-styles/test_angle_style.cpp @@ -289,7 +289,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->angle->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_bond_style.cpp b/unittest/force-styles/test_bond_style.cpp index f4c151a394..068fee5e82 100644 --- a/unittest/force-styles/test_bond_style.cpp +++ b/unittest/force-styles/test_bond_style.cpp @@ -289,7 +289,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->bond->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index e6cf73f10e..d152b4fcf4 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -374,7 +374,7 @@ void TestConfigReader::tags(const yaml_event_t &event) { std::stringstream data((char *)event.data.scalar.value); config.tags.clear(); - for (std::string tag; std::getline(data, tag, ','); ) { + for (std::string tag; std::getline(data, tag, ',');) { config.tags.push_back(trim(tag)); } } diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp index 8cae5d5f7c..6f525a07eb 100644 --- a/unittest/force-styles/test_dihedral_style.cpp +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -292,7 +292,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->dihedral->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp index ac83ff9573..eef928f7e5 100644 --- a/unittest/force-styles/test_fix_timestep.cpp +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -209,8 +209,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) if (fix->thermo_virial) { auto stress = fix->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} " - "{:23.16e} {:23.16e} {:23.16e}", - stress[0], stress[1], stress[2], stress[3], stress[4], stress[5]); + "{:23.16e} {:23.16e} {:23.16e}", + stress[0], stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); } diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index b6d6b9a06b..fdbfda8f7a 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -283,7 +283,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->improper->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index 59c0e1350c..ab00efc949 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -2123,7 +2123,7 @@ TEST_F(AtomStyleTest, body_nparticle) "12.0 0.0 12.0 0.0 0.0 0.0\n" "0.0 1.0 0.0\n" "0.0 -3.0 0.0\n"; - FILE *fp = fopen("input_atom_styles.data", "w"); + FILE *fp = fopen("input_atom_styles.data", "w"); fputs(data_file, fp); fclose(fp); BEGIN_HIDE_OUTPUT(); diff --git a/unittest/formats/test_dump_atom.cpp b/unittest/formats/test_dump_atom.cpp index a73204fb92..6303d2c019 100644 --- a/unittest/formats/test_dump_atom.cpp +++ b/unittest/formats/test_dump_atom.cpp @@ -547,12 +547,12 @@ TEST_F(DumpAtomTest, rerun_bin) command(fmt::format("rerun {} first 1 last 1 every 1 post no dump x y z", dump_file)); }); lmp->output->thermo->evaluate_keyword("pe", &pe_rerun); - ASSERT_NEAR(pe_1, pe_rerun,1.0e-14); + ASSERT_NEAR(pe_1, pe_rerun, 1.0e-14); HIDE_OUTPUT([&] { command(fmt::format("rerun {} first 2 last 2 every 1 post yes dump x y z", dump_file)); }); lmp->output->thermo->evaluate_keyword("pe", &pe_rerun); - ASSERT_NEAR(pe_2, pe_rerun,1.0e-14); + ASSERT_NEAR(pe_2, pe_rerun, 1.0e-14); delete_file(dump_file); } diff --git a/unittest/formats/test_dump_custom.cpp b/unittest/formats/test_dump_custom.cpp index 434acf462c..40e22f5a11 100644 --- a/unittest/formats/test_dump_custom.cpp +++ b/unittest/formats/test_dump_custom.cpp @@ -346,7 +346,7 @@ TEST_F(DumpCustomTest, rerun) }); lmp->output->thermo->evaluate_keyword("pe", &pe_rerun); ASSERT_DOUBLE_EQ(pe_1, pe_rerun); - + HIDE_OUTPUT([&] { command(fmt::format("rerun {} first 2 last 2 every 1 post yes dump x y z", dump_file)); }); @@ -375,12 +375,12 @@ TEST_F(DumpCustomTest, rerun_bin) command(fmt::format("rerun {} first 1 last 1 every 1 post no dump x y z", dump_file)); }); lmp->output->thermo->evaluate_keyword("pe", &pe_rerun); - ASSERT_NEAR(pe_1, pe_rerun,1.0e-14); + ASSERT_NEAR(pe_1, pe_rerun, 1.0e-14); HIDE_OUTPUT([&] { command(fmt::format("rerun {} first 2 last 2 every 1 post yes dump x y z", dump_file)); }); lmp->output->thermo->evaluate_keyword("pe", &pe_rerun); - ASSERT_NEAR(pe_2, pe_rerun,1.0e-14); + ASSERT_NEAR(pe_2, pe_rerun, 1.0e-14); delete_file(dump_file); } diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index 3ca889b76e..fdb3e1a815 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -334,7 +334,9 @@ TEST_F(FileOperationsTest, write_restart) ASSERT_FILE_EXISTS("multi2-0.restart"); ASSERT_FILE_EXISTS("multi3-base.restart"); ASSERT_FILE_EXISTS("multi3-0.restart"); - if (info->has_package("MPIIO")) { ASSERT_FILE_EXISTS("test.restart.mpiio"); } + if (info->has_package("MPIIO")) { + ASSERT_FILE_EXISTS("test.restart.mpiio"); + } if (!info->has_package("MPIIO")) { TEST_FAILURE(".*ERROR: Writing to MPI-IO filename when MPIIO package is not inst.*", diff --git a/unittest/formats/test_molecule_file.cpp b/unittest/formats/test_molecule_file.cpp index 6f24c0f758..17bd30a349 100644 --- a/unittest/formats/test_molecule_file.cpp +++ b/unittest/formats/test_molecule_file.cpp @@ -189,7 +189,7 @@ TEST_F(MoleculeFileTest, notype) ".*0 fragments.*\n.*1 atoms.*\n.*0 bonds.*")); TEST_FAILURE(".*ERROR: Create_atoms molecule must have atom types.*", command("create_atoms 0 single 0.0 0.0 0.0 mol notype 542465");); - } +} TEST_F(MoleculeFileTest, extramass) { @@ -197,12 +197,13 @@ TEST_F(MoleculeFileTest, extramass) command("atom_style atomic"); command("region box block 0 1 0 1 0 1"); command("create_box 1 box"); - run_mol_cmd(test_name, "", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n" + run_mol_cmd(test_name, "", + "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n" " Types\n\n 1 1\n Masses\n\n 1 1.0\n"); command("create_atoms 0 single 0.0 0.0 0.0 mol extramass 73546"); auto output = END_CAPTURE_OUTPUT(); ASSERT_THAT(output, ContainsRegex(".*WARNING: Molecule attributes do not match " - "system attributes.*")); + "system attributes.*")); } TEST_F(MoleculeFileTest, twomols) @@ -222,12 +223,14 @@ TEST_F(MoleculeFileTest, twofiles) BEGIN_CAPTURE_OUTPUT(); command("molecule twomols moltest.h2o.mol moltest.co2.mol offset 2 1 1 0 0"); auto output = END_CAPTURE_OUTPUT(); - ASSERT_THAT(output, ContainsRegex(".*Read molecule template twomols:.*\n.*1 molecules.*\n" - ".*0 fragments.*\n.*3 atoms with max type 2.*\n.*2 bonds with max type 1.*\n" - ".*1 angles with max type 1.*\n.*0 dihedrals.*\n.*0 impropers.*\n" - ".*Read molecule template twomols:.*\n.*1 molecules.*\n" - ".*0 fragments.*\n.*3 atoms with max type 4.*\n.*2 bonds with max type 2.*\n" - ".*1 angles with max type 2.*\n.*0 dihedrals.*")); + ASSERT_THAT( + output, + ContainsRegex(".*Read molecule template twomols:.*\n.*1 molecules.*\n" + ".*0 fragments.*\n.*3 atoms with max type 2.*\n.*2 bonds with max type 1.*\n" + ".*1 angles with max type 1.*\n.*0 dihedrals.*\n.*0 impropers.*\n" + ".*Read molecule template twomols:.*\n.*1 molecules.*\n" + ".*0 fragments.*\n.*3 atoms with max type 4.*\n.*2 bonds with max type 2.*\n" + ".*1 angles with max type 2.*\n.*0 dihedrals.*")); } TEST_F(MoleculeFileTest, bonds) diff --git a/unittest/formats/test_text_file_reader.cpp b/unittest/formats/test_text_file_reader.cpp index 6fcc21fb33..4965daab5d 100644 --- a/unittest/formats/test_text_file_reader.cpp +++ b/unittest/formats/test_text_file_reader.cpp @@ -72,7 +72,7 @@ TEST_F(TextFileReaderTest, permissions) { platform::unlink("text_reader_noperms.file"); FILE *fp = fopen("text_reader_noperms.file", "w"); - ASSERT_NE(fp,nullptr); + ASSERT_NE(fp, nullptr); fputs("word\n", fp); fclose(fp); chmod("text_reader_noperms.file", 0); diff --git a/unittest/python/test_python_package.cpp b/unittest/python/test_python_package.cpp index 82b4704e5f..db7a7a41b6 100644 --- a/unittest/python/test_python_package.cpp +++ b/unittest/python/test_python_package.cpp @@ -43,9 +43,9 @@ bool verbose = false; using LAMMPS_NS::utils::split_words; namespace LAMMPS_NS { +using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::HasSubstr; -using ::testing::ContainsRegex; using ::testing::StrEq; class PythonPackageTest : public LAMMPSTest { diff --git a/unittest/utils/test_math_eigen_impl.cpp b/unittest/utils/test_math_eigen_impl.cpp index 47ca8d9cca..b38438d1f7 100644 --- a/unittest/utils/test_math_eigen_impl.cpp +++ b/unittest/utils/test_math_eigen_impl.cpp @@ -48,7 +48,7 @@ inline static bool SimilarVec(Vector a, Vector b, int n, Scalar eps = 1.0e-06, Scalar ratio = 1.0e-06, Scalar ratio_denom = 1.0) { for (int i = 0; i < n; i++) - if (! Similar(a[i], b[i], eps, ratio, ratio_denom)) return false; + if (!Similar(a[i], b[i], eps, ratio, ratio_denom)) return false; return true; } @@ -61,7 +61,7 @@ inline static bool SimilarVecUnsigned(Vector a, Vector b, int n, Scalar eps = 1. return true; else { for (int i = 0; i < n; i++) - if (! Similar(a[i], -b[i], eps, ratio, ratio_denom)) return false; + if (!Similar(a[i], -b[i], eps, ratio, ratio_denom)) return false; return true; } } @@ -464,7 +464,7 @@ void TestJacobi(int n, //::SORT_INCREASING_ABS_EVALS); #else ecalc.Diagonalize(M, evals, evecs, - Jacobi::SORT_INCREASING_ABS_EVALS); #endif @@ -488,7 +488,7 @@ void TestJacobi(int n, //::SORT_DECREASING_ABS_EVALS); #else ecalc.Diagonalize(M, evals, evecs, - Jacobi::SORT_DECREASING_ABS_EVALS); #endif @@ -511,7 +511,7 @@ void TestJacobi(int n, //::SORT_INCREASING_EVALS); #else ecalc.Diagonalize(M, evals, evecs, - Jacobi::SORT_INCREASING_EVALS); #endif for (int i = 1; i < n; i++) @@ -533,8 +533,8 @@ void TestJacobi(int n, //::DO_NOT_SORT); #else ecalc.Diagonalize( - M, evals, evecs, - Jacobi::DO_NOT_SORT); + M, evals, evecs, + Jacobi::DO_NOT_SORT); #endif } // if (test_code_coverage) diff --git a/unittest/utils/test_platform.cpp b/unittest/utils/test_platform.cpp index ace546ba90..37e749b9be 100644 --- a/unittest/utils/test_platform.cpp +++ b/unittest/utils/test_platform.cpp @@ -68,10 +68,10 @@ TEST(Platform, putenv_unsetenv) ASSERT_EQ(platform::unsetenv(""), -1); ASSERT_EQ(platform::unsetenv("UNITTEST_VAR3=two"), -1); - var = getenv("UNITTEST_VAR1"); + var = getenv("UNITTEST_VAR1"); ASSERT_NE(var, nullptr); ASSERT_EQ(platform::unsetenv("UNITTEST_VAR1"), 0); - var = getenv("UNITTEST_VAR1"); + var = getenv("UNITTEST_VAR1"); ASSERT_EQ(var, nullptr); } diff --git a/unittest/utils/test_utils.cpp b/unittest/utils/test_utils.cpp index 72a90a95a0..dccbdb4118 100644 --- a/unittest/utils/test_utils.cpp +++ b/unittest/utils/test_utils.cpp @@ -838,15 +838,15 @@ TEST(Utils, date2num) TEST(Utils, current_date) { - auto vals = ValueTokenizer(utils::current_date(),"-"); - int year = vals.next_int(); + auto vals = ValueTokenizer(utils::current_date(), "-"); + int year = vals.next_int(); int month = vals.next_int(); - int day = vals.next_int(); - ASSERT_GT(year,2020); - ASSERT_GE(month,1); - ASSERT_GE(day,1); - ASSERT_LE(month,12); - ASSERT_LE(day,31); + int day = vals.next_int(); + ASSERT_GT(year, 2020); + ASSERT_GE(month, 1); + ASSERT_GE(day, 1); + ASSERT_LE(month, 12); + ASSERT_LE(day, 31); } TEST(Utils, binary_search) From f537a31c194b7a9aac16ad99d6ebef253f3ff806 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Mon, 31 Jan 2022 09:25:25 -0700 Subject: [PATCH 170/174] Unify comment style --- src/KOKKOS/dynamical_matrix_kokkos.cpp | 9 ++++----- src/KOKKOS/third_order_kokkos.cpp | 9 ++++----- src/PHONON/dynamical_matrix.cpp | 8 ++++---- src/PHONON/third_order.cpp | 8 ++++---- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/KOKKOS/dynamical_matrix_kokkos.cpp b/src/KOKKOS/dynamical_matrix_kokkos.cpp index de587f1872..dc180a1743 100644 --- a/src/KOKKOS/dynamical_matrix_kokkos.cpp +++ b/src/KOKKOS/dynamical_matrix_kokkos.cpp @@ -1,4 +1,3 @@ -// // clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator @@ -11,11 +10,11 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. - ----------------------------------------------------------------------- */ +------------------------------------------------------------------------- */ -// -// Contributing author: Charlie Sievers UC Davis (charliesievers at cox.net) -// +/* ---------------------------------------------------------------------- + Contributing author: Charlie Sievers (UC Davis), charliesievers at cox.net +------------------------------------------------------------------------- */ #include "dynamical_matrix_kokkos.h" diff --git a/src/KOKKOS/third_order_kokkos.cpp b/src/KOKKOS/third_order_kokkos.cpp index d36b6241c5..2aeb9152a1 100644 --- a/src/KOKKOS/third_order_kokkos.cpp +++ b/src/KOKKOS/third_order_kokkos.cpp @@ -1,4 +1,3 @@ -// // clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator @@ -11,11 +10,11 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. - ----------------------------------------------------------------------- */ +------------------------------------------------------------------------- */ -// -// Contributing author: Charlie Sievers UC Davis (charliesievers at cox.net) -// +/* ---------------------------------------------------------------------- + Contributing author: Charlie Sievers (UC Davis), charliesievers at cox.net +------------------------------------------------------------------------- */ #include "third_order_kokkos.h" diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index e0a69e2a7c..3a596bfd05 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -10,11 +10,11 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. - ----------------------------------------------------------------------- */ +------------------------------------------------------------------------- */ -// -// Contributing author: Charlie Sievers, UC Davis (charliesievers at cox.net) -// +/* ---------------------------------------------------------------------- + Contributing author: Charlie Sievers (UC Davis), charliesievers at cox.net +------------------------------------------------------------------------- */ #include "dynamical_matrix.h" diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 290e214a56..7bc03aaf6f 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -10,11 +10,11 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. - ----------------------------------------------------------------------- */ +------------------------------------------------------------------------- */ -// -// Contributing author: Charlie Sievers, UC Davis (charliesievers at cox.net) -// +/* ---------------------------------------------------------------------- + Contributing author: Charlie Sievers (UC Davis), charliesievers at cox.net +------------------------------------------------------------------------- */ #include "third_order.h" From 5d28d06a3c87c2b571beb5d797000b9619f17618 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Mon, 31 Jan 2022 09:47:07 -0700 Subject: [PATCH 171/174] Fix compiler warning --- src/KOKKOS/fix_rx_kokkos.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 3f8f8eb322..3440de9885 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -61,13 +61,12 @@ struct s_CounterType } KOKKOS_INLINE_FUNCTION - volatile s_CounterType& operator+=(const volatile s_CounterType &rhs) volatile + void operator+=(const volatile s_CounterType &rhs) volatile { nSteps += rhs.nSteps; nIters += rhs.nIters; nFuncs += rhs.nFuncs; nFails += rhs.nFails; - return *this; } }; typedef struct s_CounterType CounterType; From cfd720e1fcd6efff11b06e571a18bf85677db210 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Mon, 31 Jan 2022 09:58:44 -0700 Subject: [PATCH 172/174] Remove another volatile return type to avoid warning --- src/KOKKOS/fix_langevin_kokkos.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/KOKKOS/fix_langevin_kokkos.h b/src/KOKKOS/fix_langevin_kokkos.h index 3bb076b561..96b61532e6 100644 --- a/src/KOKKOS/fix_langevin_kokkos.h +++ b/src/KOKKOS/fix_langevin_kokkos.h @@ -45,11 +45,10 @@ namespace LAMMPS_NS { } KOKKOS_INLINE_FUNCTION - volatile s_FSUM& operator+=(const volatile s_FSUM &rhs) volatile { + void operator+=(const volatile s_FSUM &rhs) volatile { fx += rhs.fx; fy += rhs.fy; fz += rhs.fz; - return *this; } }; typedef s_FSUM FSUM; From dd416f61b52328c228b76f774bbc86b899a4c339 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 31 Jan 2022 10:47:56 -0700 Subject: [PATCH 173/174] Rename function to avoid warning --- src/KOKKOS/pair_sw_kokkos.cpp | 8 ++++---- src/KOKKOS/pair_sw_kokkos.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 59949551f6..40d9d864ae 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -339,7 +339,7 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf if (rsq2 >= d_params[ikparam].cutsq) continue; - threebody(d_params[ijparam],d_params[ikparam],d_params[ijkparam], + threebody_kk(d_params[ijparam],d_params[ikparam],d_params[ijkparam], rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl); fxtmpi -= fj[0] + fk[0]; @@ -457,7 +457,7 @@ void PairSWKokkos::operator()(TagPairSWComputeFullA= d_params[ikparam].cutsq) continue; - threebody(d_params[ijparam],d_params[ikparam],d_params[ijkparam], + threebody_kk(d_params[ijparam],d_params[ikparam],d_params[ijkparam], rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl); fxtmpi -= fj[0] + fk[0]; @@ -542,7 +542,7 @@ void PairSWKokkos::operator()(TagPairSWComputeFullB= d_params[jkparam].cutsq) continue; if (vflag_atom) - threebody(d_params[jiparam],d_params[jkparam],d_params[jikparam], + threebody_kk(d_params[jiparam],d_params[jkparam],d_params[jikparam], rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl); else threebodyj(d_params[jiparam],d_params[jkparam],d_params[jikparam], @@ -686,7 +686,7 @@ void PairSWKokkos::twobody(const Param& param, const F_FLOAT& rsq, F template KOKKOS_INLINE_FUNCTION -void PairSWKokkos::threebody(const Param& paramij, const Param& paramik, const Param& paramijk, +void PairSWKokkos::threebody_kk(const Param& paramij, const Param& paramik, const Param& paramijk, const F_FLOAT& rsq1, const F_FLOAT& rsq2, F_FLOAT *delr1, F_FLOAT *delr2, F_FLOAT *fj, F_FLOAT *fk, const int& eflag, F_FLOAT& eng) const diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index 2ad5f5c368..1259ddf71e 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -118,8 +118,8 @@ class PairSWKokkos : public PairSW { void twobody(const Param&, const F_FLOAT&, F_FLOAT&, const int&, F_FLOAT&) const; KOKKOS_INLINE_FUNCTION - void threebody(const Param&, const Param&, const Param&, const F_FLOAT&, const F_FLOAT&, F_FLOAT *, F_FLOAT *, - F_FLOAT *, F_FLOAT *, const int&, F_FLOAT&) const; + void threebody_kk(const Param&, const Param&, const Param&, const F_FLOAT&, const F_FLOAT&, F_FLOAT *, F_FLOAT *, + F_FLOAT *, F_FLOAT *, const int&, F_FLOAT&) const; KOKKOS_INLINE_FUNCTION void threebodyj(const Param&, const Param&, const Param&, const F_FLOAT&, const F_FLOAT&, F_FLOAT *, F_FLOAT *, From b2916339a4554211724c1ceccbae10174e1f2abe Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 31 Jan 2022 13:42:03 -0500 Subject: [PATCH 174/174] Add NeedDup_v and AtomicDup_v helpers to KOKKOS --- src/KOKKOS/fix_acks2_reaxff_kokkos.cpp | 12 ++-- src/KOKKOS/fix_qeq_reaxff_kokkos.cpp | 12 ++-- src/KOKKOS/fix_shake_kokkos.cpp | 20 +++--- src/KOKKOS/kokkos_type.h | 6 ++ src/KOKKOS/pair_eam_alloy_kokkos.cpp | 16 ++--- src/KOKKOS/pair_eam_fs_kokkos.cpp | 16 ++--- src/KOKKOS/pair_eam_kokkos.cpp | 16 ++--- src/KOKKOS/pair_reaxff_kokkos.cpp | 86 +++++++++++++------------- src/KOKKOS/pair_snap_kokkos_impl.h | 8 +-- src/KOKKOS/pair_sw_kokkos.cpp | 20 +++--- src/KOKKOS/pair_tersoff_kokkos.cpp | 16 ++--- src/KOKKOS/pair_tersoff_mod_kokkos.cpp | 16 ++--- src/KOKKOS/pair_tersoff_zbl_kokkos.cpp | 16 ++--- 13 files changed, 133 insertions(+), 127 deletions(-) diff --git a/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp b/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp index 582e9a39ce..9d228020c3 100644 --- a/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp +++ b/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp @@ -864,8 +864,8 @@ KOKKOS_INLINE_FUNCTION void FixACKS2ReaxFFKokkos::compute_x_item(int ii, int &m_fill, const bool &final) const { // The X_diag array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_X_diag = ScatterViewHelper::value,decltype(dup_X_diag),decltype(ndup_X_diag)>::get(dup_X_diag,ndup_X_diag); - auto a_X_diag = v_X_diag.template access::value>(); + auto v_X_diag = ScatterViewHelper,decltype(dup_X_diag),decltype(ndup_X_diag)>::get(dup_X_diag,ndup_X_diag); + auto a_X_diag = v_X_diag.template access>(); const int i = d_ilist[ii]; int j,jj,jtype; @@ -942,8 +942,8 @@ void FixACKS2ReaxFFKokkos::compute_x_team( int atoms_per_team, int vector_length) const { // The X_diag array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_X_diag = ScatterViewHelper::value,decltype(dup_X_diag),decltype(ndup_X_diag)>::get(dup_X_diag,ndup_X_diag); - auto a_X_diag = v_X_diag.template access::value>(); + auto v_X_diag = ScatterViewHelper,decltype(dup_X_diag),decltype(ndup_X_diag)>::get(dup_X_diag,ndup_X_diag); + auto a_X_diag = v_X_diag.template access>(); // scratch space setup Kokkos::View, @@ -1460,8 +1460,8 @@ KOKKOS_INLINE_FUNCTION void FixACKS2ReaxFFKokkos::operator() (TagACKS2SparseMatvec3_Half, const int &ii) const { // The bb array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_bb = ScatterViewHelper::value,decltype(dup_bb),decltype(ndup_bb)>::get(dup_bb,ndup_bb); - auto a_bb = v_bb.template access::value>(); + auto v_bb = ScatterViewHelper,decltype(dup_bb),decltype(ndup_bb)>::get(dup_bb,ndup_bb); + auto a_bb = v_bb.template access>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { diff --git a/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp index b35bbc46ee..52212c09ed 100644 --- a/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp @@ -1041,8 +1041,8 @@ KOKKOS_INLINE_FUNCTION void FixQEqReaxFFKokkos::sparse13_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); - auto a_o = v_o.template access::value>(); + auto v_o = ScatterViewHelper,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); + auto a_o = v_o.template access>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1094,8 +1094,8 @@ KOKKOS_INLINE_FUNCTION void FixQEqReaxFFKokkos::sparse23_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); - auto a_o = v_o.template access::value>(); + auto v_o = ScatterViewHelper,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); + auto a_o = v_o.template access>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1154,8 +1154,8 @@ KOKKOS_INLINE_FUNCTION void FixQEqReaxFFKokkos::sparse33_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); - auto a_o = v_o.template access::value>(); + auto v_o = ScatterViewHelper,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); + auto a_o = v_o.template access>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { diff --git a/src/KOKKOS/fix_shake_kokkos.cpp b/src/KOKKOS/fix_shake_kokkos.cpp index 91d8458d21..3fef8030a1 100644 --- a/src/KOKKOS/fix_shake_kokkos.cpp +++ b/src/KOKKOS/fix_shake_kokkos.cpp @@ -590,8 +590,8 @@ void FixShakeKokkos::shake(int m, EV_FLOAT& ev) const // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int nlist,list[2]; double v[6]; @@ -701,8 +701,8 @@ void FixShakeKokkos::shake3(int m, EV_FLOAT& ev) const // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int nlist,list[3]; double v[6]; @@ -884,8 +884,8 @@ void FixShakeKokkos::shake4(int m, EV_FLOAT& ev) const // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int nlist,list[4]; double v[6]; @@ -1146,8 +1146,8 @@ void FixShakeKokkos::shake3angle(int m, EV_FLOAT& ev) const // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int nlist,list[3]; double v[6]; @@ -1744,8 +1744,8 @@ void FixShakeKokkos::v_tally(EV_FLOAT &ev, int n, int *list, double if (vflag_atom) { double fraction = 1.0/total; for (int i = 0; i < n; i++) { - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); m = list[i]; a_vatom(m,0) += fraction*v[0]; a_vatom(m,1) += fraction*v[1]; diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index 7750d3760d..23145cb7fd 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -283,6 +283,9 @@ struct AtomicDup { using value = Kokkos::Experimental::ScatterNonAtomic; }; +template +using AtomicDup_v = typename AtomicDup::value; + #ifdef KOKKOS_ENABLE_CUDA template<> struct AtomicDup { @@ -331,6 +334,9 @@ struct NeedDup { using value = Kokkos::Experimental::ScatterNonDuplicated; }; +template +using NeedDup_v = typename NeedDup::value; + #ifndef LMP_KOKKOS_USE_ATOMICS #ifdef KOKKOS_ENABLE_OPENMP diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 9421946c3e..4b253793c8 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -553,8 +553,8 @@ void PairEAMAlloyKokkos::operator()(TagPairEAMAlloyKernelA::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); - auto a_rho = v_rho.template access::value>(); + auto v_rho = ScatterViewHelper,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); + auto a_rho = v_rho.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -718,8 +718,8 @@ void PairEAMAlloyKokkos::operator()(TagPairEAMAlloyKernelC::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -832,11 +832,11 @@ void PairEAMAlloyKokkos::ev_tally(EV_FLOAT &ev, const int &i, const // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index 5fbd14d8b3..f9ae3b420c 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -553,8 +553,8 @@ void PairEAMFSKokkos::operator()(TagPairEAMFSKernelA::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); - auto a_rho = v_rho.template access::value>(); + auto v_rho = ScatterViewHelper,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); + auto a_rho = v_rho.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -719,8 +719,8 @@ void PairEAMFSKokkos::operator()(TagPairEAMFSKernelC::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -833,11 +833,11 @@ void PairEAMFSKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_eam_kokkos.cpp b/src/KOKKOS/pair_eam_kokkos.cpp index 417efc3f7d..5aa36299d7 100644 --- a/src/KOKKOS/pair_eam_kokkos.cpp +++ b/src/KOKKOS/pair_eam_kokkos.cpp @@ -548,8 +548,8 @@ void PairEAMKokkos::operator()(TagPairEAMKernelA::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); - auto a_rho = v_rho.template access::value>(); + auto v_rho = ScatterViewHelper,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); + auto a_rho = v_rho.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -713,8 +713,8 @@ void PairEAMKokkos::operator()(TagPairEAMKernelC::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -827,11 +827,11 @@ void PairEAMKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index 8d9c498005..19ce4a0b3a 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -1122,8 +1122,8 @@ void PairReaxFFKokkos::operator()(PairReaxFFComputeLJCoulomb::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); F_FLOAT powr_vdw, powgi_vdw, fn13, dfn13, exp1, exp2, etmp; F_FLOAT evdwl, fvdwl; @@ -1313,8 +1313,8 @@ void PairReaxFFKokkos::operator()(PairReaxFFComputeTabulatedLJCoulom // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -1714,11 +1714,11 @@ void PairReaxFFKokkos::operator()(PairReaxBuildListsHalf, if (d_resize_bo() || d_resize_hb()) return; - auto v_dDeltap_self = ScatterViewHelper::value,decltype(dup_dDeltap_self),decltype(ndup_dDeltap_self)>::get(dup_dDeltap_self,ndup_dDeltap_self); - auto a_dDeltap_self = v_dDeltap_self.template access::value>(); + auto v_dDeltap_self = ScatterViewHelper,decltype(dup_dDeltap_self),decltype(ndup_dDeltap_self)>::get(dup_dDeltap_self,ndup_dDeltap_self); + auto a_dDeltap_self = v_dDeltap_self.template access>(); - auto v_total_bo = ScatterViewHelper::value,decltype(dup_total_bo),decltype(ndup_total_bo)>::get(dup_total_bo,ndup_total_bo); - auto a_total_bo = v_total_bo.template access::value>(); + auto v_total_bo = ScatterViewHelper,decltype(dup_total_bo),decltype(ndup_total_bo)>::get(dup_total_bo,ndup_total_bo); + auto a_total_bo = v_total_bo.template access>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -2142,8 +2142,8 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxFFComputeMulti2, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access>(); const int i = d_ilist[ii]; const int itype = type(i); @@ -2294,12 +2294,12 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxFFComputeAngular, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access>(); const int i = d_ilist[ii]; const int itype = type(i); @@ -2606,13 +2606,13 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxFFComputeTorsion, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access>(); Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; - //auto a_Cdbo = dup_Cdbo.template access::value>(); + //auto a_Cdbo = dup_Cdbo.template access>(); // in reaxff_torsion_angles: j = i, k = j, i = k; @@ -2981,8 +2981,8 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxFFComputeHydrogen, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); int hblist[MAX_BONDS]; F_FLOAT theta, cos_theta, sin_xhz4, cos_xhz1, sin_theta2; @@ -3131,9 +3131,9 @@ void PairReaxFFKokkos::operator()(PairReaxUpdateBond, con Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbopi = d_Cdbopi; Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbopi2 = d_Cdbopi2; - //auto a_Cdbo = dup_Cdbo.template access::value>(); - //auto a_Cdbopi = dup_Cdbopi.template access::value>(); - //auto a_Cdbopi2 = dup_Cdbopi2.template access::value>(); + //auto a_Cdbo = dup_Cdbo.template access>(); + //auto a_Cdbopi = dup_Cdbopi.template access>(); + //auto a_Cdbopi2 = dup_Cdbopi2.template access>(); const int i = d_ilist[ii]; const tagint itag = tag(i); @@ -3180,10 +3180,10 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxFFComputeBond1, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access>(); F_FLOAT p_be1, p_be2, De_s, De_p, De_pp, pow_BOs_be2, exp_be12, CEbo, ebond; @@ -3298,8 +3298,8 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(PairReaxFFComputeBond2, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); F_FLOAT delij[3], delik[3], deljk[3], tmpvec[3]; F_FLOAT dBOp_i[3], dBOp_k[3], dln_BOp_pi[3], dln_BOp_pi2[3]; @@ -3505,11 +3505,11 @@ void PairReaxFFKokkos::ev_tally(EV_FLOAT_REAX &ev, const int &i, con // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -3564,8 +3564,8 @@ void PairReaxFFKokkos::e_tally(EV_FLOAT_REAX & /*ev*/, const int &i, if (eflag_atom) { - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); const E_FLOAT epairhalf = 0.5 * epair; a_eatom[i] += epairhalf; @@ -3582,8 +3582,8 @@ void PairReaxFFKokkos::e_tally_single(EV_FLOAT_REAX & /*ev*/, const const F_FLOAT &epair) const { // The eatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); a_eatom[i] += epair; } @@ -3616,8 +3616,8 @@ void PairReaxFFKokkos::v_tally(EV_FLOAT_REAX &ev, const int &i, } if (vflag_atom) { - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); a_vatom(i,0) += v[0]; a_vatom(i,1) += v[1]; a_vatom(i,2) += v[2]; a_vatom(i,3) += v[3]; a_vatom(i,4) += v[4]; a_vatom(i,5) += v[5]; @@ -3634,8 +3634,8 @@ void PairReaxFFKokkos::v_tally3(EV_FLOAT_REAX &ev, const int &i, con { // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); F_FLOAT v[6]; @@ -3696,8 +3696,8 @@ void PairReaxFFKokkos::v_tally4(EV_FLOAT_REAX &ev, const int &i, con } if (vflag_atom) { - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); a_vatom(i,0) += 0.25 * v[0]; a_vatom(i,1) += 0.25 * v[1]; a_vatom(i,2) += 0.25 * v[2]; a_vatom(i,3) += 0.25 * v[3]; a_vatom(i,4) += 0.25 * v[4]; a_vatom(i,5) += 0.25 * v[5]; diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index e66f490f8a..49c022105d 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -1257,8 +1257,8 @@ KOKKOS_INLINE_FUNCTION void PairSNAPKokkos::operator() (TagPairSNAPComputeForce, const int& ii, EV_FLOAT& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii + chunk_offset]; @@ -1358,8 +1358,8 @@ void PairSNAPKokkos::v_tally_xyz(EV_FLOAT { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); const E_FLOAT v0 = delx*fx; const E_FLOAT v1 = dely*fy; diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 40d9d864ae..dec7d12ebb 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -246,8 +246,8 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); F_FLOAT delr1[3],delr2[3],fj[3],fk[3]; F_FLOAT evdwl = 0.0; @@ -800,11 +800,11 @@ void PairSWKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -878,11 +878,11 @@ void PairSWKokkos::ev_tally3(EV_FLOAT &ev, const int &i, const int & // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (eflag_atom) { epairthird = THIRD * (evdwl + ecoul); diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index 2aa58f2415..121d89d366 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -328,8 +328,8 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -1143,11 +1143,11 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -1211,8 +1211,8 @@ void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, const int &i, const i { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); F_FLOAT v[6]; diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp index 82d0fa4628..c3cdcca066 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp @@ -328,8 +328,8 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -1146,11 +1146,11 @@ void PairTersoffMODKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -1214,8 +1214,8 @@ void PairTersoffMODKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); F_FLOAT v[6]; diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp index f2e6752f07..011cb8ebc6 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp @@ -342,8 +342,8 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -1240,11 +1240,11 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -1308,8 +1308,8 @@ void PairTersoffZBLKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); F_FLOAT v[6];