]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use locally_owned_size for vectors in MatrixFree operators
authorDavid Wells <drwells@email.unc.edu>
Mon, 25 May 2020 16:55:39 +0000 (12:55 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 11 Feb 2021 16:52:47 +0000 (11:52 -0500)
include/deal.II/matrix_free/operators.h

index c72d24d994d978d4b5c20cb8f253646e0423b604..74f3a23e81691ba964a94219b58c285a8905325e 100644 (file)
@@ -1529,7 +1529,7 @@ namespace MatrixFreeOperators
               .local_element(edge_constrained_indices[j][i]) =
               edge_constrained_values[j][i].first;
           }
-        for (; c < BlockHelper::subblock(dst, j).local_size(); ++c)
+        for (; c < BlockHelper::subblock(dst, j).locally_owned_size(); ++c)
           BlockHelper::subblock(dst, j).local_element(c) = 0.;
       }
   }
@@ -1563,7 +1563,7 @@ namespace MatrixFreeOperators
               BlockHelper::subblock(src_cpy, j).local_element(c) = 0.;
             ++c;
           }
-        for (; c < BlockHelper::subblock(src_cpy, j).local_size(); ++c)
+        for (; c < BlockHelper::subblock(src_cpy, j).locally_owned_size(); ++c)
           BlockHelper::subblock(src_cpy, j).local_element(c) = 0.;
       }
 
@@ -1798,8 +1798,9 @@ namespace MatrixFreeOperators
     this->set_constrained_entries_to_one(diagonal_vector);
     inverse_diagonal_vector = diagonal_vector;
 
-    const unsigned int local_size = inverse_diagonal_vector.local_size();
-    for (unsigned int i = 0; i < local_size; ++i)
+    const unsigned int locally_owned_size =
+      inverse_diagonal_vector.locally_owned_size();
+    for (unsigned int i = 0; i < locally_owned_size; ++i)
       inverse_diagonal_vector.local_element(i) =
         Number(1.) / inverse_diagonal_vector.local_element(i);
 
@@ -1990,7 +1991,8 @@ namespace MatrixFreeOperators
 
     inverse_diagonal_vector = diagonal_vector;
 
-    for (unsigned int i = 0; i < inverse_diagonal_vector.local_size(); ++i)
+    for (unsigned int i = 0; i < inverse_diagonal_vector.locally_owned_size();
+         ++i)
       if (std::abs(inverse_diagonal_vector.local_element(i)) >
           std::sqrt(std::numeric_limits<Number>::epsilon()))
         inverse_diagonal_vector.local_element(i) =

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.