From c7c3a74161032211f415c0cb5e82d0f60993dbb0 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 29 Apr 2015 16:34:52 -0400 Subject: [PATCH] add serial test for DoFRenumbering::block_wise for MG --- tests/multigrid/renumbering_04.cc | 108 ++++++++++++++++++++++++++ tests/multigrid/renumbering_04.output | 48 ++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 tests/multigrid/renumbering_04.cc create mode 100644 tests/multigrid/renumbering_04.output diff --git a/tests/multigrid/renumbering_04.cc b/tests/multigrid/renumbering_04.cc new file mode 100644 index 0000000000..2bd6c0f430 --- /dev/null +++ b/tests/multigrid/renumbering_04.cc @@ -0,0 +1,108 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2000 - 2015 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// Test DoFRenumbering::block_wise(dh, level) + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace std; + +template +void check() +{ + FESystem fe(FE_Q(1), 1, FE_DGQ(0), 1); + + deallog << fe.get_name() << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube(tria); + tria.refine_global(1); + tria.begin_active()->set_refine_flag(); + tria.execute_coarsening_and_refinement (); + + DoFHandler dh(tria); + dh.distribute_dofs(fe); + dh.distribute_mg_dofs(fe); + + deallog << "** before:" << std::endl; + { + unsigned int n_dofs_per_cell = fe.dofs_per_cell; + std::vector local_dofs(n_dofs_per_cell); + for (unsigned int level=0; level::cell_iterator cell = dh.begin(level); + cell != dh.end(level); ++cell) + { + deallog << "cell " << cell->id() << ":" << std::endl; + cell->get_mg_dof_indices(local_dofs); + for (unsigned int i=0; i local_dofs(n_dofs_per_cell); + for (unsigned int level=0; level::cell_iterator cell = dh.begin(level); + cell != dh.end(level); ++cell) + { + deallog << "cell " << cell->id() << ":" << std::endl; + cell->get_mg_dof_indices(local_dofs); + for (unsigned int i=0; i (); + check<2> (); + //check<3> (); + + deallog << "OK" << endl; +} diff --git a/tests/multigrid/renumbering_04.output b/tests/multigrid/renumbering_04.output new file mode 100644 index 0000000000..f10b3dd1db --- /dev/null +++ b/tests/multigrid/renumbering_04.output @@ -0,0 +1,48 @@ + +DEAL::FESystem<2>[FE_Q<2>(1)-FE_DGQ<2>(0)] +DEAL::** before: +DEAL::* level 0 +DEAL::cell 0_0:: +DEAL::0 1 2 3 4 +DEAL::* level 1 +DEAL::cell 0_1:0: +DEAL::0 1 2 3 4 +DEAL::cell 0_1:1: +DEAL::1 5 3 6 7 +DEAL::cell 0_1:2: +DEAL::2 3 8 9 10 +DEAL::cell 0_1:3: +DEAL::3 6 9 11 12 +DEAL::* level 2 +DEAL::cell 0_2:00: +DEAL::0 1 2 3 4 +DEAL::cell 0_2:01: +DEAL::1 5 3 6 7 +DEAL::cell 0_2:02: +DEAL::2 3 8 9 10 +DEAL::cell 0_2:03: +DEAL::3 6 9 11 12 +DEAL:: +DEAL::** after: +DEAL::* level 0 +DEAL::cell 0_0:: +DEAL::0 1 2 3 4 +DEAL::* level 1 +DEAL::cell 0_1:0: +DEAL::0 1 2 3 9 +DEAL::cell 0_1:1: +DEAL::1 4 3 5 10 +DEAL::cell 0_1:2: +DEAL::2 3 6 7 11 +DEAL::cell 0_1:3: +DEAL::3 5 7 8 12 +DEAL::* level 2 +DEAL::cell 0_2:00: +DEAL::0 1 2 3 9 +DEAL::cell 0_2:01: +DEAL::1 4 3 5 10 +DEAL::cell 0_2:02: +DEAL::2 3 6 7 11 +DEAL::cell 0_2:03: +DEAL::3 5 7 8 12 +DEAL::OK -- 2.39.5