From 9dd2ea3036afd892f020afdecaa67a0e12d46f2a Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 18 Jul 2005 15:17:12 +0000 Subject: [PATCH] Simplify logic in 1d compute_row_length_vector. git-svn-id: https://svn.dealii.org/trunk@11158 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_tools.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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