Commit1 JT 060219

- added all min/spin tests in src/SPIN/neb_spin.cpp
- added lbfgs to .gitignore
- commit before pull/merge
This commit is contained in:
julient31 2019-07-02 16:02:36 -06:00
parent 3adc23a770
commit 66a5041973
3 changed files with 12 additions and 9 deletions

2
src/.gitignore vendored
View File

@ -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

View File

@ -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++) {

View File

@ -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