]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid one set of uses of deprecated functions.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 21:12:01 +0000 (21:12 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 21:12:01 +0000 (21:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@28344 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/sparse_vanka.templates.h

index 85570af42396d6f66955ab923deb8ea5db4dc2e2..586bad6e08ada8302c80eeb0d63deb3689048af2 100644 (file)
@@ -157,9 +157,7 @@ SparseVanka<number>::compute_inverse (const unsigned int         row,
 
   const unsigned int row_length = structure.row_length(row);
 
-  FullMatrix<float> &this_inverse = *new FullMatrix<float> (row_length,
-                                                            row_length);
-  inverses[row] = &this_inverse;
+  inverses[row] = new FullMatrix<float> (row_length, row_length);
 
   // collect the dofs that couple
   // with @p row
@@ -168,31 +166,12 @@ SparseVanka<number>::compute_inverse (const unsigned int         row,
     local_indices[i] = structure.column_number(row, i);
 
   // Build local matrix
-  for (unsigned int i=0; i<row_length; ++i)
-    for (unsigned int j=0; j<row_length; ++j)
-      {
-        // if DoFs local_index[i] and
-        // local_index[j] couple with
-        // each other, then get the
-        // value from the global
-        // matrix. if not, then leave
-        // the value in the small
-        // matrix at zero
-        //
-        // the explicit use of operator()
-        // works around a bug in some gcc
-        // versions (see PR 18803)
-        const unsigned int global_entry =
-          structure.operator()(local_indices[i], local_indices[j]);
-        if (global_entry != SparsityPattern::invalid_entry)
-          // the explicit use of operator()
-          // works around a bug in some gcc
-          // versions (see PR 18803)
-          this_inverse.operator()(i,j) = matrix->global_entry(global_entry);
-      }
+  inverses[row]->extract_submatrix_from (*matrix,
+                                         local_indices,
+                                         local_indices);
 
   // Compute inverse
-  this_inverse.gauss_jordan();
+  inverses[row]->gauss_jordan();
 }
 
 

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.