From: Ralf Hartmann Date: Mon, 23 Jan 2006 12:34:09 +0000 (+0000) Subject: Test MGDoFHandler::distribute_dofs and renumber functions. X-Git-Tag: v8.0.0~12548 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32ac7df6049ce0fcfee8f7b9cb833936fddaa153;p=dealii.git Test MGDoFHandler::distribute_dofs and renumber functions. git-svn-id: https://svn.dealii.org/trunk@12127 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/multigrid/renumbering_02.cc b/tests/multigrid/renumbering_02.cc new file mode 100644 index 0000000000..95562b6706 --- /dev/null +++ b/tests/multigrid/renumbering_02.cc @@ -0,0 +1,72 @@ +//---------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2000 - 2006 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------------------------------------------------------- + +// Until version 1.50 of mg_dof_handler.cc, the +// MGDoFHandler::renumbering function could not handle coarsened grids +// (unused cells). Check that this works now. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace std; + +template +void check() +{ + FE_DGQ fe(1); + deallog << fe.get_name() << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube(tria); + tria.refine_global(2); + typename Triangulation::active_cell_iterator cell=tria.begin_active(); + for (unsigned int i=0; i::children_per_cell; ++i, ++cell) + cell->set_coarsen_flag(); + tria.execute_coarsening_and_refinement (); + + MGDoFHandler mg_dof_handler(tria); + mg_dof_handler.distribute_dofs(fe); + Point a; + a(0)=1; + for (unsigned int level=0; level (); + check<2> (); + check<3> (); + + deallog << "OK" << endl; +} diff --git a/tests/multigrid/renumbering_03.cc b/tests/multigrid/renumbering_03.cc new file mode 100644 index 0000000000..836fc5a611 --- /dev/null +++ b/tests/multigrid/renumbering_03.cc @@ -0,0 +1,79 @@ +//---------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2000 - 2006 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------------------------------------------------------- + +// Until version 1.50 of mg_dof_handler.cc, the +// MGDoFHandler::distribute_dofs function in 1d and 3d could not +// handle coarsened grids (unused vertices). Also, the +// MGDoFHandler::renumbering function could not handle coarsened grids +// (unused vertices, unused faces). Check that all this works now. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace std; + +template +void check() +{ + FE_Q fe(3); + deallog << fe.get_name() << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube(tria); + tria.refine_global(2); + typename Triangulation::active_cell_iterator cell=tria.begin_active(); + for (unsigned int i=0; i::children_per_cell; ++i, ++cell) + cell->set_coarsen_flag(); + tria.execute_coarsening_and_refinement (); + + MGDoFHandler mg_dof_handler(tria); + mg_dof_handler.distribute_dofs(fe); + for (unsigned int level=0; level new_numbers(n_dofs); + for (unsigned int i=0; i (); + check<2> (); + check<3> (); + + deallog << "OK" << endl; +}