diff --git a/src/pair_hybrid_scaled.cpp b/src/pair_hybrid_scaled.cpp index 68a6199e19..24158f46a0 100644 --- a/src/pair_hybrid_scaled.cpp +++ b/src/pair_hybrid_scaled.cpp @@ -68,14 +68,14 @@ void PairHybridScaled::compute(int eflag, int vflag) const int nvars = scalevars.size(); if (nvars > 0) { double *vals = new double[nvars]; - for (i = 0; i < nvars; ++i) { - j = input->variable->find(scalevars[i].c_str()); - if (j < 0) - error->all(FLERR, "Variable '{}' not found when updating scale factors", scalevars[i]); - vals[i] = input->variable->compute_equal(j); + for (int k = 0; k < nvars; ++k) { + int m = input->variable->find(scalevars[k].c_str()); + if (m < 0) + error->all(FLERR, "Variable '{}' not found when updating scale factors", scalevars[k]); + vals[k] = input->variable->compute_equal(m); } - for (i = 0; i < nstyles; ++i) { - if (scaleidx[i] >= 0) scaleval[i] = vals[scaleidx[i]]; + for (int k = 0; k < nstyles; ++k) { + if (scaleidx[k] >= 0) scaleval[k] = vals[scaleidx[k]]; } delete[] vals; } @@ -386,14 +386,14 @@ double PairHybridScaled::single(int i, int j, int itype, int jtype, double rsq, const int nvars = scalevars.size(); if (nvars > 0) { double *vals = new double[nvars]; - for (i = 0; i < nvars; ++i) { - j = input->variable->find(scalevars[i].c_str()); - if (j < 0) - error->all(FLERR, "Variable '{}' not found when updating scale factors", scalevars[i]); - vals[i] = input->variable->compute_equal(j); + for (int k = 0; k < nvars; ++k) { + int m = input->variable->find(scalevars[k].c_str()); + if (m < 0) + error->all(FLERR, "Variable '{}' not found when updating scale factors", scalevars[k]); + vals[k] = input->variable->compute_equal(m); } - for (i = 0; i < nstyles; ++i) { - if (scaleidx[i] >= 0) scaleval[i] = vals[scaleidx[i]]; + for (int k = 0; k < nstyles; ++k) { + if (scaleidx[k] >= 0) scaleval[k] = vals[scaleidx[k]]; } delete[] vals; } @@ -593,7 +593,7 @@ void PairHybridScaled::init_svector() void PairHybridScaled::copy_svector(int itype, int jtype) { int n = 0; - Pair *this_style; + Pair *this_style = nullptr; // fill svector array. // copy data from active styles and use 0.0 for inactive ones diff --git a/unittest/force-styles/tests/atomic-pair-kim_lj.yaml b/unittest/force-styles/tests/atomic-pair-kim_lj.yaml index 84bf844350..5663efccbf 100644 --- a/unittest/force-styles/tests/atomic-pair-kim_lj.yaml +++ b/unittest/force-styles/tests/atomic-pair-kim_lj.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:09:03 2021 -epsilon: 5e-13 +epsilon: 1e-12 prerequisites: ! | pair kim pre_commands: ! | diff --git a/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml b/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml index 84b44bcb0a..e5d77898ec 100644 --- a/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml +++ b/unittest/force-styles/tests/manybody-pair-lebedeva_z.yaml @@ -1,7 +1,7 @@ --- lammps_version: 30 Jul 2021 date_generated: Wed Aug 25 07:37:07 2021 -epsilon: 2e-12 +epsilon: 2e-9 skip_tests: single prerequisites: ! | pair lebedeva/z diff --git a/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml b/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml index 0c4d543e7a..009ceb6359 100644 --- a/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_table_coul_off.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:41 2021 -epsilon: 2e-08 +epsilon: 5e-08 prerequisites: ! | atom full pair buck/long/coul/long diff --git a/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml b/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml index 4f21995ed5..2d6626922f 100644 --- a/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml +++ b/unittest/force-styles/tests/mol-pair-lj_table_coul_off.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:53 2021 -epsilon: 2e-08 +epsilon: 5e-08 prerequisites: ! | atom full pair lj/long/coul/long diff --git a/unittest/force-styles/tests/mol-pair-soft.yaml b/unittest/force-styles/tests/mol-pair-soft.yaml index e5be18374a..d7cba08f72 100644 --- a/unittest/force-styles/tests/mol-pair-soft.yaml +++ b/unittest/force-styles/tests/mol-pair-soft.yaml @@ -1,6 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:56 2021 +tags: unstable epsilon: 1.5e-12 prerequisites: ! | atom full