]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix the last place where we were using deprecated functions.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 21:21:53 +0000 (21:21 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 12 Feb 2013 21:21:53 +0000 (21:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@28346 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 586bad6e08ada8302c80eeb0d63deb3689048af2..afa510530d4cf3d174f270ed83b58bbc0b181802 100644 (file)
@@ -280,27 +280,24 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
             // row corresponding to DoF @p row.
             // runs between 0 and row_length
             const unsigned int i = is->second;
-            // number of DoFs coupling to
-            // irow (including irow itself)
-            const unsigned int irow_length = structure.row_length(irow);
 
             // copy rhs
             b(i) = src(irow);
 
             // for all the DoFs that irow
             // couples with
-            for (unsigned int j=0; j<irow_length; ++j)
+            // number of DoFs coupling to
+            // irow (including irow itself)
+            for (typename SparseMatrix<number>::const_iterator p=matrix->begin(row);
+                p != matrix->end(row); ++p)
               {
-                // col is the number of
-                // this dof
-                const unsigned int col = structure.column_number(irow, j);
                 // find out whether this DoF
                 // (that couples with @p irow,
                 // which itself couples with
                 // @p row) also couples with
                 // @p row.
                 const std::map<unsigned int, unsigned int>::const_iterator js
-                  = local_index.find(col);
+                  = local_index.find(p->column());
                 // if not, then still use
                 // this dof to modify the rhs
                 //
@@ -309,16 +306,16 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
                 if (js == local_index.end())
                   {
                     if (!range_is_restricted ||
-                        ((*dof_mask)[col] == true))
-                      b(i) -= matrix->raw_entry(irow,j) * dst(col);
+                        ((*dof_mask)[p->column()] == true))
+                      b(i) -= p->value() * dst(p->column());
                   }
                 else
                   // if so, then build the
                   // matrix out of it
                   if (conserve_mem == true)
-                    (*inverses[row])(i,js->second) = matrix->raw_entry(irow,j);
-              };
-          };
+                    (*inverses[row])(i,js->second) = p->value();
+              }
+          }
 
         // Compute new values
         if (conserve_mem == true)
@@ -339,14 +336,14 @@ SparseVanka<number>::apply_preconditioner (Vector<number2>         &dst,
               dst(irow) = x(i);
             // do nothing if not in
             // the range
-          };
+          }
 
         // if we don't store the
         // inverses, then unalias the
         // local matrix
         if (conserve_mem == true)
           inverses[row] = 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.