]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
First step towards getting rid of the last occurrence of SparseMatrix::global_value.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Jan 2013 03:48:57 +0000 (03:48 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Jan 2013 03:48:57 +0000 (03:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@27972 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/numerics/matrix_tools.cc

index c207c009b10aec65d7af570dbbc96ffbf14c3207..9e33193338ef6f1151348632ece10c1ff11ba648 100644 (file)
@@ -2286,6 +2286,11 @@ namespace MatrixTools
                 const SparsityPattern &transpose_sparsity
                   = sparsity_pattern.block (block_index.first, block_row);
 
+                SparseMatrix<number> &this_matrix
+                  = matrix.block(block_row, block_index.first);
+                SparseMatrix<number> &transpose_matrix
+                  = matrix.block(block_index.first, block_row);
+
                 // traverse the row of
                 // the transpose block
                 // to find the
@@ -2350,23 +2355,16 @@ namespace MatrixTools
                                                  [this_sparsity.get_rowstart_indices()[row+1]],
                                                  block_index.second);
 
-                    // check whether this line has
-                    // an entry in the regarding column
-                    // (check for ==dof_number and
-                    // != next_row, since if
-                    // row==dof_number-1, *p is a
-                    // past-the-end pointer but points
-                    // to dof_number anyway...)
+                    // check whether this line has an entry in the
+                    // regarding column (check for ==dof_number and !=
+                    // next_row, since if row==dof_number-1, *p is a
+                    // past-the-end pointer but points to dof_number
+                    // anyway...)
                     //
-                    // there should be
-                    // such an entry!
-                    // note, however,
-                    // that this
-                    // assertion will
-                    // fail sometimes
-                    // if the sparsity
-                    // pattern is not
-                    // symmetric!
+                    // there should be such an entry! we know this because
+                    // we have assumed that the sparsity pattern is
+                    // symmetric and we only walk over those rows for
+                    // which the current row has a column entry
                     Assert ((*p == block_index.second) &&
                             (p != &this_sparsity.get_column_numbers()
                              [this_sparsity.get_rowstart_indices()[row+1]]),
@@ -2380,11 +2378,11 @@ namespace MatrixTools
 
                     // correct right hand side
                     right_hand_side.block(block_row)(row)
-                    -= matrix.block(block_row,block_index.first).global_entry(global_entry) /
+                    -= this_matrix.global_entry(global_entry) /
                        diagonal_entry * new_rhs;
 
                     // set matrix entry to zero
-                    matrix.block(block_row,block_index.first).global_entry(global_entry) = 0.;
+                    this_matrix.global_entry(global_entry) = 0.;
                   }
               }
           }

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.