From: Joerg Frohne Date: Sun, 31 Mar 2013 00:56:52 +0000 (+0000) Subject: fixed stopping rule in solve_newton () X-Git-Tag: v8.0.0~840 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cbd7d28cb7feefd6f56d9fe9def595a26729618;p=dealii.git fixed stopping rule in solve_newton () git-svn-id: https://svn.dealii.org/trunk@29120 0785d39b-7218-0410-832d-ea1e28bc413d --- 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