From e1ed43c7a18f69c8ffb28dfd73d3d2d11ceb3db0 Mon Sep 17 00:00:00 2001
From: Rene Gassmoeller <rene.gassmoeller@mailbox.org>
Date: Thu, 7 Nov 2024 11:06:27 +0100
Subject: [PATCH] Fix in parallel

---
 source/simulator/solver_schemes.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/source/simulator/solver_schemes.cc b/source/simulator/solver_schemes.cc
index c6ada035829..9d9443a3a83 100644
--- a/source/simulator/solver_schemes.cc
+++ b/source/simulator/solver_schemes.cc
@@ -654,8 +654,11 @@ namespace aspect
                 current_linearization_point.block(velocity_block_index) = backup_linearization_point.block(velocity_block_index);
               }
 
-            current_linearization_point.block(pressure_block_index).add(step_length_factor, search_direction.block(pressure_block_index));
-            current_linearization_point.block(velocity_block_index).add(step_length_factor, search_direction.block(velocity_block_index));
+            search_direction.block(pressure_block_index) *= step_length_factor;
+            search_direction.block(velocity_block_index) *= step_length_factor;
+
+            current_linearization_point.block(pressure_block_index) += search_direction.block(pressure_block_index);
+            current_linearization_point.block(velocity_block_index) += search_direction.block(velocity_block_index);
 
             // Rebuild the rhs to determine the new residual.
             assemble_newton_stokes_matrix = rebuild_stokes_preconditioner = false;
@@ -692,7 +695,7 @@ namespace aspect
                  * The line search step was not sufficient to decrease the residual
                  * enough, so we take a smaller step to see if it improves the residual.
                  */
-                step_length_factor *= (2.0/3.0);// TODO: make a parameter out of this.
+                step_length_factor = 2.0/3.0;// TODO: make a parameter out of this.
               }
 
             ++line_search_iteration;