]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplify logic in 1d compute_row_length_vector.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Jul 2005 15:17:12 +0000 (15:17 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Jul 2005 15:17:12 +0000 (15:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@11158 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_tools.cc

index 3e9cabf8bb9d738482db3138988aef13abbb3a63..74a3a82a58a737ede55701b24bc5ca4c8a4bc66c 100644 (file)
 
 template <int dim>
 void
-DoFTools::compute_row_length_vector(
-  const DoFHandler<dim>& dofs,
-  std::vector<unsigned int>& row_lengths,
-  const Coupling)
+DoFTools::
+compute_row_length_vector(const DoFHandler<dim>     &dofs,
+                          std::vector<unsigned int> &row_lengths,
+                          const Coupling)
 {
   const FiniteElement<dim>& fe = dofs.get_fe();
   Assert (row_lengths.size() == dofs.n_dofs(),
@@ -63,10 +63,11 @@ DoFTools::compute_row_length_vector(
   for (cell = dofs.begin_active(); cell != end; ++cell)
     {
       cell->get_dof_indices(cell_indices);
-      unsigned int i = 0;
-      unsigned int increment = fe.dofs_per_cell;
-      while (i < fe.dofs_per_cell)
-       row_lengths[cell_indices[i++]] += increment;
+
+                                       // each dof can couple with each other
+                                       // dof on this cell
+      for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+       row_lengths[cell_indices[i]] += fe.dofs_per_cell;
     }
 }
 

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.