]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix mistaken std::move assignment. 16335/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 8 Dec 2023 17:43:05 +0000 (10:43 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 8 Dec 2023 17:43:05 +0000 (10:43 -0700)
examples/step-31/step-31.cc
examples/step-32/step-32.cc

index 4b01b57787519f50a97ecb87f1ef95a660f24b43..788028c6823cdff61ba8b6c7cea159e76e56cf92 100644 (file)
@@ -1975,8 +1975,8 @@ namespace Step31
       TrilinosWrappers::MPI::Vector(temperature_solution)};
     temperature_trans.interpolate(x_temperature, tmp);
 
-    temperature_solution     = std::move(tmp[0]);
-    old_temperature_solution = std::move(tmp[1]);
+    temperature_solution     = tmp[0];
+    old_temperature_solution = tmp[1];
 
     // After the solution has been transferred we then enforce the constraints
     // on the transferred solution.
index 4ff165b3c1a8a2a97c4b6b03b430417eb9f0397b..cb3b2ff255c0ec6c7131941c0eeb460a74d87dd5 100644 (file)
@@ -3326,8 +3326,11 @@ namespace Step32
         temperature_constraints.distribute(distributed_temp1);
         temperature_constraints.distribute(distributed_temp2);
 
-        temperature_solution     = std::move(distributed_temp1);
-        old_temperature_solution = std::move(distributed_temp2);
+        temperature_solution     = distributed_temp1;
+        old_temperature_solution = distributed_temp2;
+
+        Assert(old_temperature_solution.has_ghost_elements(),
+               ExcInternalError());
       }
 
       {
@@ -3344,8 +3347,8 @@ namespace Step32
         stokes_constraints.distribute(distributed_stokes);
         stokes_constraints.distribute(old_distributed_stokes);
 
-        stokes_solution     = std::move(distributed_stokes);
-        old_stokes_solution = std::move(old_distributed_stokes);
+        stokes_solution     = distributed_stokes;
+        old_stokes_solution = old_distributed_stokes;
       }
     }
   }

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.