]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Update phase_field.cc
authorWasimNiyazMunshi <munshiw0@gmail.com>
Mon, 2 Dec 2024 22:32:38 +0000 (15:32 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Dec 2024 22:32:38 +0000 (15:32 -0700)
Removed the *else break* line in the run function. Also moved incrementing the iteration counter to the end of the while loop.

Phase_field_fracture_model_in_3D/phase_field.cc

index b3c3b6591fab95b4df2e0c0c77da78d16ab0f14e..61f5eca3ff5759931a50c6b7b3cb25e057f5a788 100644 (file)
@@ -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

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.