]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Convert another algorithm to no longer use deprecated functions.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 31 Mar 2004 22:17:13 +0000 (22:17 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 31 Mar 2004 22:17:13 +0000 (22:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@8931 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_constraints.cc

index 19266ae773caab6c319b28f413a45f08901bca3b..a77c2b5a612e1975a608fa4bf8ff43f98d7e2033 100644 (file)
@@ -917,13 +917,12 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
            {
              const SparsityPattern &
                block_sparsity = sparsity.block(block_row, block_col);
-             
-             const unsigned int
-               first = block_sparsity.get_rowstart_indices()[block_index.second],
-               last  = block_sparsity.get_rowstart_indices()[block_index.second+1];
-             for (unsigned int j=first; j<last; ++j)
+
+              for (SparsityPattern::const_iterator
+                     entry = block_sparsity.begin(block_index.second);
+                   entry != block_sparsity.end(block_index.second); ++entry)
                                                 // end of row reached?
-               if (block_sparsity.get_column_numbers()[j] == SparsityPattern::invalid_entry)
+               if (entry->column() == SparsityPattern::invalid_entry)
                  {
                                                     // nothing more
                                                     // to do
@@ -932,8 +931,7 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                else
                  {
                    const unsigned int global_col
-                     = index_mapping.local_to_global(block_col,
-                                                     block_sparsity.get_column_numbers()[j]);
+                     = index_mapping.local_to_global(block_col, entry->column());
                    
                    if (distribute[global_col] != -1)
                                                       // distribute entry at regular
@@ -941,13 +939,12 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                                                       // global_col
                      {
                        for (unsigned int q=0;
-                            q!=lines[distribute[global_col]]
-                                           .entries.size(); ++q)
+                            q!=lines[distribute[global_col]].entries.size(); ++q)
                          sparsity.add (row,
-                                       lines[distribute[global_col]].entries[q].first);
-                     };
-                 };
-           };
+                                        lines[distribute[global_col]].entries[q].first);
+                     }
+                 }
+           }
        }
       else
        {
@@ -961,13 +958,11 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
              const SparsityPattern &
                block_sparsity = sparsity.block(block_row,block_col);
              
-             const unsigned int
-               first = block_sparsity.get_rowstart_indices()[block_index.second],
-               last  = block_sparsity.get_rowstart_indices()[block_index.second+1];
-      
-             for (unsigned int j=first; j<last; ++j)
+              for (SparsityPattern::const_iterator
+                     entry = block_sparsity.begin(block_index.second);
+                   entry != block_sparsity.end(block_index.second); ++entry)
                                                 // end of row reached?
-               if (block_sparsity.get_column_numbers()[j] == SparsityPattern::invalid_entry)
+               if (entry->column() == SparsityPattern::invalid_entry)
                  {
                                                     // nothing more to do
                    break;
@@ -975,8 +970,7 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                else
                  {
                    const unsigned int global_col
-                     = index_mapping.local_to_global (block_col,
-                                                      block_sparsity.get_column_numbers()[j]);
+                     = index_mapping.local_to_global (block_col, entry->column());
                    
                    if (distribute[global_col] == -1)
                                                       // distribute entry at irregular
@@ -984,8 +978,7 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                                                       // global_col.
                      {
                        for (unsigned int q=0; q!=lines[distribute[row]].entries.size(); ++q) 
-                         sparsity.add (lines[distribute[row]].entries[q].first,
-                                       global_col);
+                         sparsity.add (lines[distribute[row]].entries[q].first, global_col);
                      }
                    else
                                                       // distribute entry at irregular
@@ -996,11 +989,11 @@ void ConstraintMatrix::condense (BlockSparsityPattern &sparsity) const
                          for (unsigned int q=0; q!=lines[distribute[global_col]].entries.size(); ++q)
                            sparsity.add (lines[distribute[row]].entries[p].first,
                                          lines[distribute[global_col]].entries[q].first);
-                     };
-                 };
-           };
-       };
-    };
+                     }
+                 }
+           }
+       }
+    }
   
   sparsity.compress();
 }

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.