minor optimization, avoiding double computation and extra communication
This commit is contained in:
@ -109,11 +109,10 @@ int MinCG::iterate(int maxiter)
|
|||||||
dotall[1] += fextra[i]*gextra[i];
|
dotall[1] += fextra[i]*gextra[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
fdotf = 0.0;
|
|
||||||
if (update->ftol > 0.0) {
|
if (update->ftol > 0.0) {
|
||||||
if (normstyle == MAX) fdotf = fnorm_max(); // max force norm
|
if (normstyle == MAX) fdotf = fnorm_max(); // max force norm
|
||||||
else if (normstyle == INF) fdotf = fnorm_inf(); // infinite force norm
|
else if (normstyle == INF) fdotf = fnorm_inf(); // infinite force norm
|
||||||
else if (normstyle == TWO) fdotf = fnorm_sqr(); // Euclidean force 2-norm
|
else if (normstyle == TWO) fdotf = dotall[0]; // Euclidean force 2-norm
|
||||||
else error->all(FLERR,"Illegal min_modify command");
|
else error->all(FLERR,"Illegal min_modify command");
|
||||||
if (fdotf < update->ftol*update->ftol) return FTOL;
|
if (fdotf < update->ftol*update->ftol) return FTOL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user