diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index c813954805..942f46aa22 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -657,6 +657,9 @@ void ImproperClass2::angleangle(int eflag, int vflag) i4 = improperlist[n][3]; type = improperlist[n][4]; + if ((aa_k1[type] == 0.0) && (aa_k2[type] == 0.0) + && (aa_k3[type] == 0.0)) continue; + // difference vectors delxAB = x[i1][0] - x[i2][0]; diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 10043d5dd0..d41a88bd88 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -764,8 +764,11 @@ struct AtomVecFullKokkos_PackBorder { union ubuf { double d; int64_t i; + KOKKOS_INLINE_FUNCTION ubuf(double arg) : d(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int64_t arg) : i(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int arg) : i(arg) {} }; @@ -1030,8 +1033,11 @@ struct AtomVecFullKokkos_UnpackBorder { union ubuf { double d; int64_t i; + KOKKOS_INLINE_FUNCTION ubuf(double arg) : d(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int64_t arg) : i(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int arg) : i(arg) {} }; @@ -1177,8 +1183,11 @@ struct AtomVecFullKokkos_PackExchangeFunctor { union ubuf { double d; int64_t i; + KOKKOS_INLINE_FUNCTION ubuf(double arg) : d(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int64_t arg) : i(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int arg) : i(arg) {} }; @@ -1527,8 +1536,11 @@ struct AtomVecFullKokkos_UnpackExchangeFunctor { union ubuf { double d; int64_t i; + KOKKOS_INLINE_FUNCTION ubuf(double arg) : d(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int64_t arg) : i(arg) {} + KOKKOS_INLINE_FUNCTION ubuf(int arg) : i(arg) {} }; diff --git a/src/KOKKOS/dihedral_opls_kokkos.h b/src/KOKKOS/dihedral_opls_kokkos.h index 183c39ea37..5bf2552d9b 100755 --- a/src/KOKKOS/dihedral_opls_kokkos.h +++ b/src/KOKKOS/dihedral_opls_kokkos.h @@ -13,9 +13,9 @@ #ifdef DIHEDRAL_CLASS -DihedralStyle(charmm/kk,DihedralOPLSKokkos) -DihedralStyle(charmm/kk/device,DihedralOPLSKokkos) -DihedralStyle(charmm/kk/host,DihedralOPLSKokkos) +DihedralStyle(opls/kk,DihedralOPLSKokkos) +DihedralStyle(opls/kk/device,DihedralOPLSKokkos) +DihedralStyle(opls/kk/host,DihedralOPLSKokkos) #else diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index 7dcd9b6fdc..10ccf000b6 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -120,7 +120,8 @@ void Ndx2Group::command(int narg, char **arg) // if we had processed a section, before we need to step back if (name != NULL) { rewind(fp); - find_section(fp,name); + char *tmp = find_section(fp,name); + delete[] tmp; delete[] name; name = NULL; } @@ -171,6 +172,7 @@ void Ndx2Group::command(int narg, char **arg) len = 0; // find named section, search from beginning of file + if (name != NULL) delete[] name; rewind(fp); name = find_section(fp,arg[idx]); if (name != NULL) len=strlen(name); diff --git a/src/USER-DPD/fix_eos_table.cpp b/src/USER-DPD/fix_eos_table.cpp index a2b28c5b73..b1c845d7c3 100644 --- a/src/USER-DPD/fix_eos_table.cpp +++ b/src/USER-DPD/fix_eos_table.cpp @@ -395,7 +395,7 @@ double FixEOStable::splint(double *xa, double *ya, double *y2a, int n, double x) void FixEOStable::energy_lookup(double t, double &u) { int itable; - double fraction,a,b; + double fraction; Table *tb = &tables[0]; if(t < tb->lo || t > tb->hi){ @@ -417,7 +417,7 @@ void FixEOStable::energy_lookup(double t, double &u) void FixEOStable::temperature_lookup(double u, double &t) { int itable; - double fraction,a,b; + double fraction; Table *tb = &tables[1]; if(u < tb->lo || u > tb->hi){ diff --git a/src/USER-DPD/fix_shardlow.cpp b/src/USER-DPD/fix_shardlow.cpp index eef9b13409..38f91e7e69 100644 --- a/src/USER-DPD/fix_shardlow.cpp +++ b/src/USER-DPD/fix_shardlow.cpp @@ -156,7 +156,7 @@ void FixShardlow::initial_integrate(int vflag) int i,j,ii,jj,inum,jnum,itype,jtype; int *ilist,*jlist,*numneigh,**firstneigh; double xtmp,ytmp,ztmp,delx,dely,delz; - double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double delvx,delvy,delvz; double rsq,r,rinv; double dot,wd,wr,randnum,factor_dpd,factor_dpd1; double dpx,dpy,dpz; @@ -170,7 +170,6 @@ void FixShardlow::initial_integrate(int vflag) int nlocal = atom->nlocal; int nghost = atom->nghost; int nall = nlocal + nghost; - double *special_lj = force->special_lj; int newton_pair = force->newton_pair; double randPair; @@ -179,7 +178,7 @@ void FixShardlow::initial_integrate(int vflag) double *duCond = atom->duCond; double *duMech = atom->duMech; double *dpdTheta = atom->dpdTheta; - double kappa_ij, alpha_ij, theta_ij, gamma_ij, sigma_ij, u_ij; + double kappa_ij, alpha_ij, theta_ij, gamma_ij, sigma_ij; double vxi, vyi, vzi, vxj, vyj, vzj; double vx0i, vy0i, vz0i, vx0j, vy0j, vz0j; double dot1, dot2, dot3, dot4; diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index c28b3cdbe1..de313b820e 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -212,8 +212,7 @@ void PairDPDfdt::coeff(int narg, char **arg) double a0_one = force->numeric(FLERR,arg[2]); double sigma_one = force->numeric(FLERR,arg[3]); double cut_one = cut_global; - double kappa_one; - + if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); int count = 0; diff --git a/src/comm.h b/src/comm.h index f6404868df..cac8b2fc50 100644 --- a/src/comm.h +++ b/src/comm.h @@ -147,7 +147,7 @@ class Comm : protected Pointers { W: OMP_NUM_THREADS environment is not set. This environment variable must be set appropriately to use the -USER-OMP pacakge. +USER-OMP package. E: Illegal ... command diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index dbb1c3cd9e..cecaa9b3f8 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -451,7 +451,7 @@ int DumpCustom::count() choose[i] = 0; } - // un-choose if any threshhold criterion isn't met + // un-choose if any threshold criterion isn't met if (nthresh) { double *ptr; @@ -471,7 +471,7 @@ int DumpCustom::count() } else if (thresh_array[ithresh] == MOL) { if (!atom->molecule_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); tagint *molecule = atom->molecule; for (i = 0; i < nlocal; i++) dchoose[i] = molecule[i]; ptr = dchoose; @@ -740,44 +740,44 @@ int DumpCustom::count() } else if (thresh_array[ithresh] == Q) { if (!atom->q_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = atom->q; nstride = 1; } else if (thresh_array[ithresh] == MUX) { if (!atom->mu_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->mu[0][0]; nstride = 4; } else if (thresh_array[ithresh] == MUY) { if (!atom->mu_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->mu[0][1]; nstride = 4; } else if (thresh_array[ithresh] == MUZ) { if (!atom->mu_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->mu[0][2]; nstride = 4; } else if (thresh_array[ithresh] == MU) { if (!atom->mu_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->mu[0][3]; nstride = 4; } else if (thresh_array[ithresh] == RADIUS) { if (!atom->radius_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = atom->radius; nstride = 1; } else if (thresh_array[ithresh] == DIAMETER) { if (!atom->radius_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); double *radius = atom->radius; for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i]; ptr = dchoose; @@ -785,55 +785,55 @@ int DumpCustom::count() } else if (thresh_array[ithresh] == OMEGAX) { if (!atom->omega_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->omega[0][0]; nstride = 3; } else if (thresh_array[ithresh] == OMEGAY) { if (!atom->omega_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->omega[0][1]; nstride = 3; } else if (thresh_array[ithresh] == OMEGAZ) { if (!atom->omega_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->omega[0][2]; nstride = 3; } else if (thresh_array[ithresh] == ANGMOMX) { if (!atom->angmom_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->angmom[0][0]; nstride = 3; } else if (thresh_array[ithresh] == ANGMOMY) { if (!atom->angmom_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->angmom[0][1]; nstride = 3; } else if (thresh_array[ithresh] == ANGMOMZ) { if (!atom->angmom_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->angmom[0][2]; nstride = 3; } else if (thresh_array[ithresh] == TQX) { if (!atom->torque_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->torque[0][0]; nstride = 3; } else if (thresh_array[ithresh] == TQY) { if (!atom->torque_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->torque[0][1]; nstride = 3; } else if (thresh_array[ithresh] == TQZ) { if (!atom->torque_flag) error->all(FLERR, - "Threshhold for an atom property that isn't allocated"); + "Threshold for an atom property that isn't allocated"); ptr = &atom->torque[0][2]; nstride = 3; @@ -881,7 +881,7 @@ int DumpCustom::count() nstride = 1; } - // unselect atoms that don't meet threshhold criterion + // unselect atoms that don't meet threshold criterion value = thresh_value[ithresh]; @@ -1459,6 +1459,7 @@ int DumpCustom::modify_param(int narg, char **arg) iregion = domain->find_region(arg[1]); if (iregion == -1) error->all(FLERR,"Dump_modify region ID does not exist"); + delete [] idregion; int n = strlen(arg[1]) + 1; idregion = new char[n]; strcpy(idregion,arg[1]); @@ -1502,13 +1503,13 @@ int DumpCustom::modify_param(int narg, char **arg) if (narg < 4) error->all(FLERR,"Illegal dump_modify command"); - // grow threshhold arrays + // grow threshold arrays memory->grow(thresh_array,nthresh+1,"dump:thresh_array"); memory->grow(thresh_op,(nthresh+1),"dump:thresh_op"); memory->grow(thresh_value,(nthresh+1),"dump:thresh_value"); - // set attribute type of threshhold + // set attribute type of threshold // customize by adding to if statement if (strcmp(arg[1],"id") == 0) thresh_array[nthresh] = ID; @@ -1733,7 +1734,7 @@ int DumpCustom::modify_param(int narg, char **arg) } else error->all(FLERR,"Invalid dump_modify threshhold operator"); - // set operation type of threshhold + // set operation type of threshold if (strcmp(arg[2],"<") == 0) thresh_op[nthresh] = LT; else if (strcmp(arg[2],"<=") == 0) thresh_op[nthresh] = LE; @@ -1741,9 +1742,9 @@ int DumpCustom::modify_param(int narg, char **arg) else if (strcmp(arg[2],">=") == 0) thresh_op[nthresh] = GE; else if (strcmp(arg[2],"==") == 0) thresh_op[nthresh] = EQ; else if (strcmp(arg[2],"!=") == 0) thresh_op[nthresh] = NEQ; - else error->all(FLERR,"Invalid dump_modify threshhold operator"); + else error->all(FLERR,"Invalid dump_modify threshold operator"); - // set threshhold value + // set threshold value thresh_value[nthresh] = force->numeric(FLERR,arg[3]); diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 904586e949..4cebdb14c9 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -89,6 +89,7 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) strcpy(adapt[nadapt].pstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].pparam = new char[n]; + adapt[nadapt].pair = NULL; strcpy(adapt[nadapt].pparam,arg[iarg+2]); force->bounds(arg[iarg+3],atom->ntypes, adapt[nadapt].ilo,adapt[nadapt].ihi); @@ -294,7 +295,7 @@ void FixAdapt::init() if (ad->which == PAIR) { anypair = 1; - Pair *pair = NULL; + ad->pair = NULL; // if ad->pstyle has trailing sub-style annotation ":N", // strip it for pstyle arg to pair_match() and set nsub = N @@ -317,23 +318,25 @@ void FixAdapt::init() strcpy(psuffix,pstyle); strcat(psuffix,"/"); strcat(psuffix,lmp->suffix); - pair = force->pair_match(psuffix,1,nsub); + ad->pair = force->pair_match(psuffix,1,nsub); delete[] psuffix; } - if (pair == NULL) pair = force->pair_match(pstyle,1,nsub); - if (pair == NULL) error->all(FLERR,"Fix adapt pair style does not exist"); - void *ptr = pair->extract(ad->pparam,ad->pdim); + if (ad->pair == NULL) ad->pair = force->pair_match(pstyle,1,nsub); + if (ad->pair == NULL) error->all(FLERR,"Fix adapt pair style does not exist"); + + void *ptr = ad->pair->extract(ad->pparam,ad->pdim); if (ptr == NULL) error->all(FLERR,"Fix adapt pair style param not supported"); - ad->pdim = 2; - if (ad->pdim == 0) ad->scalar = (double *) ptr; - if (ad->pdim == 2) ad->array = (double **) ptr; + // for pair styles only parameters that are 2-d arrays in atom types are supported + if (ad->pdim != 2) + error->all(FLERR,"Fix adapt pair style param is not compatible"); + else ad->array = (double **) ptr; // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style - if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 || - strcmp(force->pair_style,"hybrid/overlay") == 0)) { + if (strcmp(force->pair_style,"hybrid") == 0 || + strcmp(force->pair_style,"hybrid/overlay") == 0) { PairHybrid *pair = (PairHybrid *) force->pair; for (i = ad->ilo; i <= ad->ihi; i++) for (j = MAX(ad->jlo,i); j <= ad->jhi; j++) @@ -515,8 +518,14 @@ void FixAdapt::change_settings() // re-initialize pair styles if any PAIR settings were changed // this resets other coeffs that may depend on changed values, // and also offset and tail corrections - - if (anypair) force->pair->reinit(); + if (anypair) { + for (int m = 0; m < nadapt; m++) { + Adapt *ad = &adapt[m]; + if (ad->which == PAIR) { + ad->pair->reinit(); + } + } + } // reset KSpace charges if charges have changed diff --git a/src/fix_adapt.h b/src/fix_adapt.h index 7ae659df45..a6d45c78cc 100644 --- a/src/fix_adapt.h +++ b/src/fix_adapt.h @@ -57,6 +57,7 @@ class FixAdapt : public Fix { double *scalar,scalar_orig; double **array,**array_orig; int aparam; + class Pair *pair; }; Adapt *adapt; @@ -99,6 +100,10 @@ E: Fix adapt pair style param not supported The pair style does not know about the parameter you specified. +E: Fix adapt pair style param is not compatible + +Self-explanatory + E: Fix adapt type pair range is not valid for pair hybrid sub-style Self-explanatory. diff --git a/src/mpiio.h b/src/mpiio.h index 70e62fec95..4953ade185 100644 --- a/src/mpiio.h +++ b/src/mpiio.h @@ -15,7 +15,7 @@ #define LMP_MPIIO_H // true interface to MPIIO package -// used when MPIIO pacakge is installed +// used when MPIIO package is installed #ifdef LMP_MPIIO