From: David Wells Date: Mon, 25 May 2020 16:55:39 +0000 (-0400) Subject: Use locally_owned_size for vectors in MatrixFree operators X-Git-Tag: v9.3.0-rc1~449^2~7 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=956655b0a9ba8bdc923a703a2c866794995dc43d;p=dealii.git Use locally_owned_size for vectors in MatrixFree operators --- diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index c72d24d994..74f3a23e81 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -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::epsilon())) inverse_diagonal_vector.local_element(i) =