From: Wolfgang Bangerth Date: Tue, 10 Feb 2009 16:35:02 +0000 (+0000) Subject: Set output array to correct size and only output elements that were actually written to. X-Git-Tag: v8.0.0~8057 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46de020816d21ec6372af0f2de4d54a760898c39;p=dealii.git 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 --- 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