From 1daa43a7ffe3c2a521740e6550146be846597db4 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 15 Jan 2010 19:02:30 +0000 Subject: [PATCH] Make compile again. git-svn-id: https://svn.dealii.org/trunk@20377 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/multigrid/transfer.cc | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/tests/multigrid/transfer.cc b/tests/multigrid/transfer.cc index f940fd6d45..38534bf4c6 100644 --- a/tests/multigrid/transfer.cc +++ b/tests/multigrid/transfer.cc @@ -1,8 +1,8 @@ //---------------------------------------------------------------------------- // transfer.cc,v 1.13 2005/12/30 16:07:03 guido Exp -// Version: +// Version: // -// Copyright (C) 2000 - 2007, 2009 by the deal.II authors +// Copyright (C) 2000 - 2007, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -38,15 +38,31 @@ using namespace std; +template +void +reinit_vector (const dealii::MGDoFHandler &mg_dof, + std::vector , + MGLevelObject > &v) +{ + for (unsigned int level=v.get_minlevel(); + level<=v.get_maxlevel();++level) + { + unsigned int n = mg_dof.n_dofs (level); + v[level].reinit(n); + } + +} + + template void check_simple(const FiniteElement& fe) { deallog << fe.get_name() << std::endl; - + Triangulation tr; GridGenerator::hyper_cube(tr); tr.refine_global(2); - + MGDoFHandler mgdof(tr); mgdof.distribute_dofs(fe); @@ -72,7 +88,7 @@ void check_simple(const FiniteElement& fe) transfer.restrict_and_add(1,u[0],u[1]); deallog << "u1\t" << (u[1]*u[1]+.5) << std::endl << "u0\t" << (u[0]*u[0]+.5) << std::endl; - + // Now the same for a non-constant // vector for (unsigned int i=0;i& fe) v.reinit (mgdof.n_dofs()); for (unsigned int i=0;i& fe) transfer.copy_from_mg(mgdof, v, u); for (unsigned int i=0; i(0)); check_simple (FE_DGP<2>(1)); check_simple (FE_DGQ<2>(1)); @@ -137,7 +153,7 @@ int main() check_simple (FE_RaviartThomasNodal<2>(1)); // check_simple (FESystem<2>(FE_RaviartThomas<2>(1),1,FE_DGQ<2>(0),2)); - + check_simple (FE_DGQ<3>(1)); check_simple (FE_Q<3>(2)); } -- 2.39.5