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:
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@ -163,6 +163,8 @@
|
|||||||
/min_spin.h
|
/min_spin.h
|
||||||
/min_spin_oso_cg.cpp
|
/min_spin_oso_cg.cpp
|
||||||
/min_spin_oso_cg.h
|
/min_spin_oso_cg.h
|
||||||
|
/min_spin_oso_lbfgs.cpp
|
||||||
|
/min_spin_oso_lbfgs.h
|
||||||
/neb_spin.cpp
|
/neb_spin.cpp
|
||||||
/neb_spin.h
|
/neb_spin.h
|
||||||
/pair_spin.cpp
|
/pair_spin.cpp
|
||||||
|
|||||||
@ -361,12 +361,12 @@ void MinSpinOSO_LBFGS::calc_search_direction(int iter)
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dyds = 0.0;
|
dyds = 0.0;
|
||||||
for (int i = 0; i < 3 * nlocal; i++) {
|
for (int i = 0; i < 3 * nlocal; i++) {
|
||||||
ds[m_index][i] = p_s[i];
|
ds[m_index][i] = p_s[i];
|
||||||
dy[m_index][i] = g_cur[i] - g_old[i];
|
dy[m_index][i] = g_cur[i] - g_old[i];
|
||||||
dyds += ds[m_index][i] * dy[m_index][i];
|
dyds += ds[m_index][i] * dy[m_index][i];
|
||||||
}
|
}
|
||||||
MPI_Allreduce(&dyds, &dyds_global, 1, MPI_DOUBLE, MPI_SUM, world);
|
MPI_Allreduce(&dyds, &dyds_global, 1, MPI_DOUBLE, MPI_SUM, world);
|
||||||
if (fabs(dyds) > 1.0e-60) rho[m_index] = 1.0 / dyds_global;
|
if (fabs(dyds) > 1.0e-60) rho[m_index] = 1.0 / dyds_global;
|
||||||
else rho[m_index] = 1.0e60;
|
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);
|
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) {
|
if (fabs(yy_global) > 1.0e-60) {
|
||||||
for (int i = 0; i < 3 * nlocal; i++) {
|
for (int i = 0; i < 3 * nlocal; i++) {
|
||||||
|
|||||||
@ -50,6 +50,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "math_const.h"
|
#include "math_const.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace MathConst;
|
using namespace MathConst;
|
||||||
@ -194,8 +195,8 @@ void NEBSpin::run()
|
|||||||
|
|
||||||
if (update->minimize->searchflag)
|
if (update->minimize->searchflag)
|
||||||
error->all(FLERR,"NEBSpin requires damped dynamics minimizer");
|
error->all(FLERR,"NEBSpin requires damped dynamics minimizer");
|
||||||
if (strcmp(update->minimize_style,"spin") != 0)
|
if (!utils::strmatch(update->minimize_style,"^spin"))
|
||||||
error->all(FLERR,"NEBSpin requires spin minimizer");
|
error->all(FLERR,"NEBSpin requires a spin minimizer");
|
||||||
|
|
||||||
// setup regular NEBSpin minimization
|
// setup regular NEBSpin minimization
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user