From 536e7a969aac5bda077287172b2fc22d223af19d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 9 Mar 2020 09:17:49 -0400 Subject: [PATCH] silence compiler warning and provide extra comment about optimization --- src/min_cg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/min_cg.cpp b/src/min_cg.cpp index c164fb55d6..46da4bfa5b 100644 --- a/src/min_cg.cpp +++ b/src/min_cg.cpp @@ -109,10 +109,11 @@ int MinCG::iterate(int maxiter) dotall[1] += fextra[i]*gextra[i]; } + fdotf = 0.0; if (update->ftol > 0.0) { if (normstyle == MAX) fdotf = fnorm_max(); // max force norm else if (normstyle == INF) fdotf = fnorm_inf(); // infinite force norm - else if (normstyle == TWO) fdotf = dotall[0]; // Euclidean force 2-norm + else if (normstyle == TWO) fdotf = dotall[0]; // same as fnorm_sqr(), Euclidean force 2-norm else error->all(FLERR,"Illegal min_modify command"); if (fdotf < update->ftol*update->ftol) return FTOL; }