From c87e227128441e253af81cf64d53a9cf897ab654 Mon Sep 17 00:00:00 2001 From: frohne Date: Sun, 31 Mar 2013 00:56:52 +0000 Subject: [PATCH] fixed stopping rule in solve_newton () git-svn-id: https://svn.dealii.org/trunk@29120 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-42/step-42.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index 37d5905fa7..d6c50ee10b 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -1353,16 +1353,15 @@ namespace Step42 break; } - if (resid<1e-8) - break; - resid_old=resid; resid_vector = system_rhs_newton; resid_vector.compress (VectorOperation::insert); - if (active_set == active_set_old && resid < 1e-10) - break; + int is_my_set_changed = (active_set == active_set_old)?0:1; + int num_changed = Utilities::MPI::sum(is_my_set_changed, MPI_COMM_WORLD); + if (num_changed==0 && resid < 1e-8) + break; active_set_old = active_set; } // End of active-set-loop -- 2.39.5