From adcb60c30c9b27f63ed358ee1f51c93447608db0 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Thu, 29 Aug 2013 18:37:04 +0200 Subject: [PATCH] [Algorit] Use v to check convergence --- src/one-body-sample.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 0e8cb785..678a7c8e 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -373,11 +373,8 @@ int main(int argc, char *argv[]) { iterationCounter = velocityProblemSolver.getResult().iterations; }; - // Since the velocity explodes in the quasistatic case, use the - // displacement as a convergence criterion - // Q: is this reasonable? Vector u; - Vector u_saved; + Vector v_saved; ScalarVector alpha_saved; double lastStateCorrection; for (size_t stateFPI = 1; stateFPI <= maximumStateFPI; ++stateFPI) { @@ -410,7 +407,7 @@ int main(int argc, char *argv[]) { std::cout << '.' << std::flush; if (stateFPI > 1) { - double const velocityCorrection = AMNorm.diff(u_saved, u); + double const velocityCorrection = AMNorm.diff(v_saved, v); if (velocityCorrection < fixedPointTolerance) break; } @@ -418,7 +415,7 @@ int main(int argc, char *argv[]) { DUNE_THROW(Dune::Exception, "FPI failed to converge"); alpha_saved = alpha; - u_saved = u; + v_saved = v; } if (printProgress) std::cout << std::endl; -- GitLab