From: wolf Date: Thu, 18 May 2000 13:52:28 +0000 (+0000) Subject: Fix alleged bugs and add comments. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce2582229073f6911b7be3c96f3c8eb07efadf05;p=dealii-svn.git Fix alleged bugs and add comments. git-svn-id: https://svn.dealii.org/trunk@2893 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index fa62dc9371..5fd52aa90d 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -758,7 +758,10 @@ MatrixTools::apply_boundary_values (const map &boundar for (; dof != endd; ++dof) { Assert (dof->first < n_dofs, ExcInternalError()); - + + // get global index and index + // in the block in which this + // dof is located const unsigned int dof_number = dof->first; const pair block_index = index_mapping.global_to_local (dof_number); @@ -773,6 +776,7 @@ MatrixTools::apply_boundary_values (const map &boundar // we shall not set // matrix.global_entry( // sparsity_rowstart[dof.first]) + // of the diagonal block for (unsigned int block_col=0; block_col::apply_boundary_values (const map &boundar else { matrix.block(block_index.first, block_index.first) - .set (block_index.second, - block_index.second, - first_nonzero_diagonal_entry); + .diag_element(block_index.second) + = first_nonzero_diagonal_entry; new_rhs = dof->second * first_nonzero_diagonal_entry; }; right_hand_side.block(block_index.first)(block_index.second) @@ -873,14 +876,23 @@ MatrixTools::apply_boundary_values (const map &boundar // transpose block for (unsigned int block_row=0; block_row::apply_boundary_values (const map &boundar for (unsigned int j=first; j::apply_boundary_values (const map &boundar // // there should be such an entry! Assert ((*p == block_index.second) && - (p != &transpose_sparsity.get_column_numbers() - [transpose_sparsity.get_rowstart_indices()[row+1]]), + (p != &this_sparsity.get_column_numbers() + [this_sparsity.get_rowstart_indices()[row+1]]), ExcInternalError()); const unsigned int global_entry = (p - - &transpose_sparsity.get_column_numbers() - [transpose_sparsity.get_rowstart_indices()[0]]); - + &this_sparsity.get_column_numbers() + [this_sparsity.get_rowstart_indices()[0]]); + // correct right hand side right_hand_side.block(block_row)(row) -= matrix.block(block_row,block_index.first).global_entry(global_entry) /