From: Wasim Niyaz Munshi Date: Fri, 13 Dec 2024 23:19:41 +0000 (-0700) Subject: Move transfer of current solution to old solution from check_convergence() to run X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c7421e01878db96939bdca547836b4a12da3166;p=code-gallery.git Move transfer of current solution to old solution from check_convergence() to run --- diff --git a/Phase_field_fracture_model_in_3D/phase_field.cc b/Phase_field_fracture_model_in_3D/phase_field.cc index 2d80780..d643e9f 100644 --- a/Phase_field_fracture_model_in_3D/phase_field.cc +++ b/Phase_field_fracture_model_in_3D/phase_field.cc @@ -1317,11 +1317,6 @@ namespace PF error_elastic_solution = error_elastic_solution_numerator / error_elastic_solution_denominator; - completely_distributed_solution_elastic_old = - locally_relevant_solution_elastic; - completely_distributed_solution_damage_old = - locally_relevant_solution_damage; - if ((error_elastic_solution < tol) && (error_damage_solution < tol)) return true; else @@ -1394,16 +1389,14 @@ namespace PF locally_relevant_solution_damage.update_ghost_values (); locally_relevant_solution_elastic.update_ghost_values (); - if (iteration == 0) - { - completely_distributed_solution_damage_old = - locally_relevant_solution_damage; - completely_distributed_solution_elastic_old = - locally_relevant_solution_elastic; - } - else + if (iteration > 0) stoppingCriterion = check_convergence (); + completely_distributed_solution_elastic_old = + locally_relevant_solution_elastic; + completely_distributed_solution_damage_old = + locally_relevant_solution_damage; + if (stoppingCriterion == false) { refine_grid (load_step);