From: WasimNiyazMunshi Date: Mon, 2 Dec 2024 22:32:38 +0000 (-0700) Subject: Update phase_field.cc X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07d920a6101bcbcb1c5ab2dab2e63bbdd9249755;p=code-gallery.git Update phase_field.cc Removed the *else break* line in the run function. Also moved incrementing the iteration counter to the end of the while loop. --- diff --git a/Phase_field_fracture_model_in_3D/phase_field.cc b/Phase_field_fracture_model_in_3D/phase_field.cc index b3c3b65..61f5eca 100644 --- a/Phase_field_fracture_model_in_3D/phase_field.cc +++ b/Phase_field_fracture_model_in_3D/phase_field.cc @@ -1435,7 +1435,6 @@ namespace Step854 bool stoppingCriterion = false; while (stoppingCriterion == false) { - iteration = iteration + 1; pcout << " \n iteration number:" << iteration << std::endl; solve_elastic_subproblem (load_step); solve_damage_subproblem (); @@ -1443,7 +1442,7 @@ namespace Step854 locally_relevant_solution_damage.update_ghost_values (); locally_relevant_solution_elastic.update_ghost_values (); - if (iteration == 1) + if (iteration == 0) { completely_distributed_solution_damage_old = locally_relevant_solution_damage; @@ -1454,9 +1453,10 @@ namespace Step854 stoppingCriterion = check_convergence (); if (stoppingCriterion == false) + { refine_grid (load_step); - else - break; + } + iteration = iteration + 1; } // Once converged, do some clean-up operations