diff --git a/src/.gitignore b/src/.gitignore index 0d802981f9..f0ac3a1ff9 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -163,6 +163,8 @@ /min_spin.h /min_spin_oso_cg.cpp /min_spin_oso_cg.h +/min_spin_oso_lbfgs.cpp +/min_spin_oso_lbfgs.h /neb_spin.cpp /neb_spin.h /pair_spin.cpp diff --git a/src/SPIN/min_spin_oso_lbfgs.cpp b/src/SPIN/min_spin_oso_lbfgs.cpp index f3643168a4..23cb3718c8 100644 --- a/src/SPIN/min_spin_oso_lbfgs.cpp +++ b/src/SPIN/min_spin_oso_lbfgs.cpp @@ -361,12 +361,12 @@ void MinSpinOSO_LBFGS::calc_search_direction(int iter) } } else { - dyds = 0.0; - for (int i = 0; i < 3 * nlocal; i++) { - ds[m_index][i] = p_s[i]; - dy[m_index][i] = g_cur[i] - g_old[i]; - dyds += ds[m_index][i] * dy[m_index][i]; - } + dyds = 0.0; + for (int i = 0; i < 3 * nlocal; i++) { + ds[m_index][i] = p_s[i]; + dy[m_index][i] = g_cur[i] - g_old[i]; + dyds += ds[m_index][i] * dy[m_index][i]; + } MPI_Allreduce(&dyds, &dyds_global, 1, MPI_DOUBLE, MPI_SUM, world); if (fabs(dyds) > 1.0e-60) rho[m_index] = 1.0 / dyds_global; else rho[m_index] = 1.0e60; @@ -409,7 +409,7 @@ void MinSpinOSO_LBFGS::calc_search_direction(int iter) } MPI_Allreduce(&yy, &yy_global, 1, MPI_DOUBLE, MPI_SUM, world); - // calculate now search direction + // calculate now search direction if (fabs(yy_global) > 1.0e-60) { for (int i = 0; i < 3 * nlocal; i++) { diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 126cfb09e3..9ab461cbe6 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -50,6 +50,7 @@ #include "memory.h" #include "error.h" #include "math_const.h" +#include "utils.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -194,8 +195,8 @@ void NEBSpin::run() if (update->minimize->searchflag) error->all(FLERR,"NEBSpin requires damped dynamics minimizer"); - if (strcmp(update->minimize_style,"spin") != 0) - error->all(FLERR,"NEBSpin requires spin minimizer"); + if (!utils::strmatch(update->minimize_style,"^spin")) + error->all(FLERR,"NEBSpin requires a spin minimizer"); // setup regular NEBSpin minimization