From 46de020816d21ec6372af0f2de4d54a760898c39 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 10 Feb 2009 16:35:02 +0000 Subject: [PATCH] Set output array to correct size and only output elements that were actually written to. git-svn-id: https://svn.dealii.org/trunk@18350 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/multigrid/transfer_select.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/multigrid/transfer_select.cc b/tests/multigrid/transfer_select.cc index 459a892d3d..34403bf805 100644 --- a/tests/multigrid/transfer_select.cc +++ b/tests/multigrid/transfer_select.cc @@ -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& fe, mgdof.distribute_dofs(fe); DoFRenumbering::component_wise(static_cast&>(mgdof), target_component); - vector ndofs(fe.n_components()); + vector 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