]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Set output array to correct size and only output elements that were actually written to.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Feb 2009 16:35:02 +0000 (16:35 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Feb 2009 16:35:02 +0000 (16:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@18350 0785d39b-7218-0410-832d-ea1e28bc413d

tests/multigrid/transfer_select.cc

index 459a892d3d0acea8363a38d4ab056bb830855b2b..34403bf805332442c14627d7fb4725fc77d6b224 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000 - 2007 by the deal.II authors
+//    Copyright (C) 2000 - 2007, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -57,7 +57,8 @@ void check_select(const FiniteElement<dim>& fe,
   mgdof.distribute_dofs(fe);
   DoFRenumbering::component_wise(static_cast<DoFHandler<dim>&>(mgdof),
                                  target_component);
-  vector<unsigned int> ndofs(fe.n_components());
+  vector<unsigned int> ndofs(*std::max_element (target_component.begin(),
+                                               target_component.end()) + 1);
   DoFTools::count_dofs_per_component(mgdof, ndofs, true, target_component);
   
   for (unsigned int l=0;l<tr.n_levels();++l)

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.