revert changes to force tolerance computations

This commit is contained in:
Axel Kohlmeyer
2019-10-25 15:06:19 -04:00
parent 22288e06b7
commit a54f191c2a
3 changed files with 12 additions and 32 deletions

View File

@ -17,7 +17,6 @@
#include "update.h"
#include "output.h"
#include "timer.h"
#include "universe.h"
using namespace LAMMPS_NS;
@ -78,18 +77,11 @@ int MinSD::iterate(int maxiter)
return ETOL;
// force tolerance criterion
// sync across replicas if running multi-replica minimization
if (normstyle == MAX) {
fdotfloc = fnorm_max(); // max force norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_MAX,universe->uworld);
} else if (normstyle == INF) {
fdotfloc = fnorm_inf(); // infinite force norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_MAX,universe->uworld);
} else if (normstyle == TWO) {
fdotfloc = fnorm_sqr(); // Euclidean force 2-norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_MAX,universe->uworld);
} else error->all(FLERR,"Illegal min_modify command");
if (normstyle == MAX) fdotf = fnorm_max(); // max force norm
else if (normstyle == INF) fdotf = fnorm_inf(); // infinite force norm
else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm
else error->all(FLERR,"Illegal min_modify command");
if (fdotf < update->ftol*update->ftol) return FTOL;
// set new search direction h to f = -Grad(x)