From: wolf Date: Mon, 18 Jul 2005 15:17:12 +0000 (+0000) Subject: Simplify logic in 1d compute_row_length_vector. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dd2ea3036afd892f020afdecaa67a0e12d46f2a;p=dealii-svn.git Simplify logic in 1d compute_row_length_vector. git-svn-id: https://svn.dealii.org/trunk@11158 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 3e9cabf8bb..74a3a82a58 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -43,10 +43,10 @@ template void -DoFTools::compute_row_length_vector( - const DoFHandler& dofs, - std::vector& row_lengths, - const Coupling) +DoFTools:: +compute_row_length_vector(const DoFHandler &dofs, + std::vector &row_lengths, + const Coupling) { const FiniteElement& 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