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

@ -251,16 +251,10 @@ int MinFire::iterate(int maxiter)
// sync across replicas if running multi-replica minimization // sync across replicas if running multi-replica minimization
if (update->ftol > 0.0) { if (update->ftol > 0.0) {
if (normstyle == MAX) { if (normstyle == MAX) fdotf = fnorm_max(); // max force norm
fdotfloc = fnorm_max(); // max force norm else if (normstyle == INF) fdotf = fnorm_inf(); // inf force norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_MAX,universe->uworld); else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm
} else if (normstyle == INF) { else error->all(FLERR,"Illegal min_modify command");
fdotfloc = fnorm_inf(); // inf force norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_MAX,universe->uworld);
} else if (normstyle == TWO) {
fdotf = fnorm_sqr(); // Euclidean force 2-norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
} else error->all(FLERR,"Illegal min_modify command");
if (update->multireplica == 0) { if (update->multireplica == 0) {
if (fdotf < update->ftol*update->ftol) return FTOL; if (fdotf < update->ftol*update->ftol) return FTOL;
} else { } else {

View File

@ -216,16 +216,10 @@ int MinQuickMin::iterate(int maxiter)
// sync across replicas if running multi-replica minimization // sync across replicas if running multi-replica minimization
if (update->ftol > 0.0) { if (update->ftol > 0.0) {
if (normstyle == MAX) { if (normstyle == MAX) fdotfloc = fnorm_max(); // max force norm
fdotfloc = fnorm_max(); // max force norm else if (normstyle == INF) fdotfloc = fnorm_inf(); // inf force norm
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_DOUBLE,MPI_MAX,universe->uworld); else if (normstyle == TWO) fdotfloc = fnorm_sqr(); // Euclidean force 2-norm
} else if (normstyle == INF) { else error->all(FLERR,"Illegal min_modify command");
fdotfloc = fnorm_inf(); // inf 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_SUM,universe->uworld);
} else error->all(FLERR,"Illegal min_modify command");
if (update->multireplica == 0) { if (update->multireplica == 0) {
if (fdotf < update->ftol*update->ftol) return FTOL; if (fdotf < update->ftol*update->ftol) return FTOL;
} else { } else {

View File

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