From 7c7421e01878db96939bdca547836b4a12da3166 Mon Sep 17 00:00:00 2001 From: Wasim Niyaz Munshi Date: Fri, 13 Dec 2024 16:19:41 -0700 Subject: [PATCH] Move transfer of current solution to old solution from check_convergence() to run --- .../phase_field.cc | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) 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); -- 2.39.5