Commit JT 072619

- added a min_style option for norm type (euclidean or Max)
- adapted and tested spin minimizers
- adapted (net tested) regular minimizers
This commit is contained in:
julient31
2019-07-26 17:33:49 -06:00
parent 883f6d1e8d
commit c5b7a36eeb
13 changed files with 266 additions and 258 deletions

View File

@ -80,7 +80,7 @@ void MinFire::reset_vectors()
int MinFire::iterate(int maxiter)
{
bigint ntimestep;
double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfall;
double vmax,vdotf,vdotfall,vdotv,vdotvall,fdotf,fdotfloc,fdotfall;
double scale1,scale2;
double dtvone,dtv,dtf,dtfm;
int flag,flagall;
@ -250,7 +250,15 @@ int MinFire::iterate(int maxiter)
// sync across replicas if running multi-replica minimization
if (update->ftol > 0.0) {
fdotf = fnorm_sqr();
if (normstyle == 1) { // max force norm
fdotf = fnorm_inf();
fdotfloc = fdotf;
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_INT,MPI_MAX,universe->uworld);
} else { // Euclidean force norm
fdotf = fnorm_sqr();
fdotfloc = fdotf;
MPI_Allreduce(&fdotfloc,&fdotf,1,MPI_INT,MPI_SUM,universe->uworld);
}
if (update->multireplica == 0) {
if (fdotf < update->ftol*update->ftol) return FTOL;
} else {