From ca835e0c8947ed980eabd32aee065b0f491c0afc Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 31 Dec 2012 02:23:25 +0000 Subject: [PATCH] Avoid one use of SparseMatrix::global_entry in favor of using iterators. git-svn-id: https://svn.dealii.org/branches/branch_deprecated@27881 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/numerics/matrix_tools.cc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 7d97af1459..46e8f18daf 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -1982,18 +1982,13 @@ namespace MatrixTools const unsigned int dof_number = dof->first; // for each boundary dof: - // set entries of this line - // to zero except for the diagonal - // entry. Note that the diagonal - // entry is always the first one - // for square matrices, i.e. - // we shall not set - // matrix.global_entry( - // sparsity_rowstart[dof.first]) - const unsigned int last = sparsity_rowstart[dof_number+1]; - for (unsigned int j=sparsity_rowstart[dof_number]+1; j::iterator + p = matrix.begin(dof_number); + p != matrix.end(dof_number); ++p) + if (p->column() != dof_number) + p->value() = 0.; // set right hand side to // wanted value: if main diagonal @@ -2053,6 +2048,7 @@ namespace MatrixTools // since that is the // diagonal element and // thus the present row + const unsigned int last = sparsity_rowstart[dof_number+1]; for (unsigned int j=sparsity_rowstart[dof_number]+1; j