]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Move transfer of current solution to old solution from check_convergence() to run
authorWasim Niyaz Munshi <munshiw0@gmail.com>
Fri, 13 Dec 2024 23:19:41 +0000 (16:19 -0700)
committerWasim Niyaz Munshi <munshiw0@gmail.com>
Fri, 13 Dec 2024 23:19:41 +0000 (16:19 -0700)
Phase_field_fracture_model_in_3D/phase_field.cc

index 2d807803327e866efed47d9e4f2eda3348c3a351..d643e9fe3088e4c310a58f0e23b583143db64523 100644 (file)
@@ -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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.