From a09a10db89584f17c50fc63dd8d4c44455c991b4 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Thu, 29 Jul 2021 19:27:22 -0600 Subject: [PATCH] Standardized output for many mpi/hp_unify_dof_indices_X tests. Added new test for parallel-hp-paper. --- tests/mpi/hp_unify_dof_indices.h | 59 +++++++++ tests/mpi/hp_unify_dof_indices_01.cc | 20 +-- ...indices_01.mpirun=1.with_p4est=true.output | 32 +++-- ...indices_01.mpirun=2.with_p4est=true.output | 64 ++++++---- tests/mpi/hp_unify_dof_indices_02.cc | 46 +++---- ...indices_02.mpirun=1.with_p4est=true.output | 52 ++++---- ...indices_02.mpirun=2.with_p4est=true.output | 104 ++++++++------- tests/mpi/hp_unify_dof_indices_03.cc | 34 +++-- ...indices_03.mpirun=1.with_p4est=true.output | 36 +++++- ...indices_03.mpirun=2.with_p4est=true.output | 72 +++++++++-- tests/mpi/hp_unify_dof_indices_04.cc | 34 +++-- ...indices_04.mpirun=1.with_p4est=true.output | 36 +++++- ...indices_04.mpirun=2.with_p4est=true.output | 72 +++++++++-- tests/mpi/hp_unify_dof_indices_05.cc | 34 +++-- ...indices_05.mpirun=1.with_p4est=true.output | 36 +++++- ...indices_05.mpirun=2.with_p4est=true.output | 72 +++++++++-- tests/mpi/hp_unify_dof_indices_06.cc | 34 +++-- ...indices_06.mpirun=1.with_p4est=true.output | 36 +++++- ...indices_06.mpirun=2.with_p4est=true.output | 72 +++++++++-- tests/mpi/hp_unify_dof_indices_07.cc | 2 - ...indices_07.mpirun=1.with_p4est=true.output | 2 - ...indices_07.mpirun=2.with_p4est=true.output | 4 - tests/mpi/hp_unify_dof_indices_08.cc | 10 +- ...indices_08.mpirun=1.with_p4est=true.output | 14 +- ...indices_08.mpirun=2.with_p4est=true.output | 28 ++-- ...indices_08.mpirun=7.with_p4est=true.output | 120 ++++++++---------- tests/mpi/hp_unify_dof_indices_09.cc | 2 +- ...ndices_09.mpirun=10.with_p4est=true.output | 20 +-- tests/mpi/hp_unify_dof_indices_10.cc | 34 +++-- ...indices_10.mpirun=1.with_p4est=true.output | 36 +++++- ...indices_10.mpirun=2.with_p4est=true.output | 72 +++++++++-- tests/mpi/hp_unify_dof_indices_11.cc | 43 ++----- ...indices_11.mpirun=1.with_p4est=true.output | 32 +++-- ...indices_11.mpirun=2.with_p4est=true.output | 64 ++++++---- tests/mpi/hp_unify_dof_indices_12.cc | 98 ++++++++++++++ ...indices_12.mpirun=1.with_p4est=true.output | 31 +++++ ...indices_12.mpirun=2.with_p4est=true.output | 63 +++++++++ 37 files changed, 1089 insertions(+), 531 deletions(-) create mode 100644 tests/mpi/hp_unify_dof_indices.h create mode 100644 tests/mpi/hp_unify_dof_indices_12.cc create mode 100644 tests/mpi/hp_unify_dof_indices_12.mpirun=1.with_p4est=true.output create mode 100644 tests/mpi/hp_unify_dof_indices_12.mpirun=2.with_p4est=true.output diff --git a/tests/mpi/hp_unify_dof_indices.h b/tests/mpi/hp_unify_dof_indices.h new file mode 100644 index 0000000000..5c7d136bf4 --- /dev/null +++ b/tests/mpi/hp_unify_dof_indices.h @@ -0,0 +1,59 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2021 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.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + +#include + +#include "../tests.h" + + +template +void +log_dof_diagnostics(const DoFHandler &dof_handler) +{ + // locally relevant cells and dof indices on each + for (const auto &cell : dof_handler.active_cell_iterators()) + if (!cell->is_artificial()) + { + deallog << "Cell: " << cell << std::endl; + deallog << " "; + if (cell->is_locally_owned()) + deallog << "locally owned"; + else if (cell->is_ghost()) + deallog << "ghost"; + else + Assert(false, ExcInternalError()); + deallog << std::endl; + + std::vector dof_indices( + cell->get_fe().dofs_per_cell); + cell->get_dof_indices(dof_indices); + deallog << " "; + for (auto i : dof_indices) + deallog << ' ' << i; + deallog << std::endl; + } + + // dof indices that are locally owned + deallog << "locally_owned_dofs: "; + dof_handler.locally_owned_dofs().print(deallog); + + // number of dof indices that are locally owned + deallog << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() + << std::endl; + + // number of all dof indices + deallog << "n_global_dofs: " << dof_handler.n_dofs() << std::endl; +} diff --git a/tests/mpi/hp_unify_dof_indices_01.cc b/tests/mpi/hp_unify_dof_indices_01.cc index 6402e8b118..004545ff5c 100644 --- a/tests/mpi/hp_unify_dof_indices_01.cc +++ b/tests/mpi/hp_unify_dof_indices_01.cc @@ -41,6 +41,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -72,23 +74,7 @@ test() (++dof_handler.begin_active())->set_active_fe_index(1); dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - for (auto &cell : dof_handler.active_cell_iterators()) - { - deallog << " Cell: " << cell << std::endl; - - std::vector dof_indices( - cell->get_fe().dofs_per_cell); - cell->get_dof_indices(dof_indices); - deallog << " "; - for (auto i : dof_indices) - deallog << i << ' '; - deallog << std::endl; - } - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_01.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_01.mpirun=1.with_p4est=true.output index 1ee64a3213..4ed503fd08 100644 --- a/tests/mpi/hp_unify_dof_indices_01.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_01.mpirun=1.with_p4est=true.output @@ -1,15 +1,19 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: Cell: 0.0 -DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 -DEAL:0:2d:: Cell: 0.1 -DEAL:0:2d:: 1 9 3 10 5 11 12 13 14 -DEAL:0:2d:: n_locally_owned_dofs: 15 -DEAL:0:2d:: n_global_dofs: 15 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: Cell: 0.0 -DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -DEAL:0:3d:: Cell: 0.1 -DEAL:0:3d:: 1 27 3 28 5 29 7 30 9 31 32 33 13 34 35 36 17 37 19 38 21 39 40 41 42 43 44 -DEAL:0:3d:: n_locally_owned_dofs: 45 -DEAL:0:3d:: n_global_dofs: 45 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 9 3 10 5 11 12 13 14 +DEAL:0:2d::locally_owned_dofs: {[0,14]} +DEAL:0:2d::n_locally_owned_dofs: 15 +DEAL:0:2d::n_global_dofs: 15 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 27 3 28 5 29 7 30 9 31 32 33 13 34 35 36 17 37 19 38 21 39 40 41 42 43 44 +DEAL:0:3d::locally_owned_dofs: {[0,44]} +DEAL:0:3d::n_locally_owned_dofs: 45 +DEAL:0:3d::n_global_dofs: 45 diff --git a/tests/mpi/hp_unify_dof_indices_01.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_01.mpirun=2.with_p4est=true.output index 1a7e6fb93f..c9bd26301e 100644 --- a/tests/mpi/hp_unify_dof_indices_01.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_01.mpirun=2.with_p4est=true.output @@ -1,31 +1,39 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: Cell: 0.0 -DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 -DEAL:0:2d:: Cell: 0.1 -DEAL:0:2d:: 1 9 3 10 5 11 12 13 14 -DEAL:0:2d:: n_locally_owned_dofs: 9 -DEAL:0:2d:: n_global_dofs: 15 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: Cell: 0.0 -DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -DEAL:0:3d:: Cell: 0.1 -DEAL:0:3d:: 1 27 3 28 5 29 7 30 9 31 32 33 13 34 35 36 17 37 19 38 21 39 40 41 42 43 44 -DEAL:0:3d:: n_locally_owned_dofs: 27 -DEAL:0:3d:: n_global_dofs: 45 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: ghost +DEAL:0:2d:: 1 9 3 10 5 11 12 13 14 +DEAL:0:2d::locally_owned_dofs: {[0,8]} +DEAL:0:2d::n_locally_owned_dofs: 9 +DEAL:0:2d::n_global_dofs: 15 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: ghost +DEAL:0:3d:: 1 27 3 28 5 29 7 30 9 31 32 33 13 34 35 36 17 37 19 38 21 39 40 41 42 43 44 +DEAL:0:3d::locally_owned_dofs: {[0,26]} +DEAL:0:3d::n_locally_owned_dofs: 27 +DEAL:0:3d::n_global_dofs: 45 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: Cell: 0.0 -DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 -DEAL:1:2d:: Cell: 0.1 -DEAL:1:2d:: 1 9 3 10 5 11 12 13 14 -DEAL:1:2d:: n_locally_owned_dofs: 6 -DEAL:1:2d:: n_global_dofs: 15 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: Cell: 0.0 -DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -DEAL:1:3d:: Cell: 0.1 -DEAL:1:3d:: 1 27 3 28 5 29 7 30 9 31 32 33 13 34 35 36 17 37 19 38 21 39 40 41 42 43 44 -DEAL:1:3d:: n_locally_owned_dofs: 18 -DEAL:1:3d:: n_global_dofs: 45 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 1 9 3 10 5 11 12 13 14 +DEAL:1:2d::locally_owned_dofs: {[9,14]} +DEAL:1:2d::n_locally_owned_dofs: 6 +DEAL:1:2d::n_global_dofs: 15 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 1 27 3 28 5 29 7 30 9 31 32 33 13 34 35 36 17 37 19 38 21 39 40 41 42 43 44 +DEAL:1:3d::locally_owned_dofs: {[27,44]} +DEAL:1:3d::n_locally_owned_dofs: 18 +DEAL:1:3d::n_global_dofs: 45 diff --git a/tests/mpi/hp_unify_dof_indices_02.cc b/tests/mpi/hp_unify_dof_indices_02.cc index fb7f847265..599aedeea9 100644 --- a/tests/mpi/hp_unify_dof_indices_02.cc +++ b/tests/mpi/hp_unify_dof_indices_02.cc @@ -45,6 +45,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -72,39 +74,21 @@ test() fe.push_back(FE_Q(2)); DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "2_0:") - cell->set_active_fe_index(2); - if (cell->id().to_string() == "3_0:") - cell->set_active_fe_index(0); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(2); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(0); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - for (auto &cell : dof_handler.active_cell_iterators()) - { - deallog << " Cell: " << cell << std::endl; - - std::vector dof_indices( - cell->get_fe().dofs_per_cell); - cell->get_dof_indices(dof_indices); - deallog << " "; - for (auto i : dof_indices) - deallog << i << ' '; - deallog << std::endl; - } - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_02.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_02.mpirun=1.with_p4est=true.output index b1647afcb4..ada1a1642c 100644 --- a/tests/mpi/hp_unify_dof_indices_02.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_02.mpirun=1.with_p4est=true.output @@ -1,23 +1,31 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: Cell: 0.0 -DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 -DEAL:0:2d:: Cell: 0.1 -DEAL:0:2d:: 1 9 3 17 5 10 11 22 12 -DEAL:0:2d:: Cell: 0.2 -DEAL:0:2d:: 2 3 13 18 14 20 7 15 16 -DEAL:0:2d:: Cell: 0.3 -DEAL:0:2d:: 3 17 18 19 20 21 22 23 24 -DEAL:0:2d:: n_locally_owned_dofs: 25 -DEAL:0:2d:: n_global_dofs: 25 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: Cell: 0.0 -DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -DEAL:0:3d:: Cell: 0.1 -DEAL:0:3d:: 1 27 3 51 5 28 7 54 9 29 30 59 13 31 32 63 17 33 19 65 21 34 35 70 36 37 38 -DEAL:0:3d:: Cell: 0.2 -DEAL:0:3d:: 2 3 39 52 6 7 40 55 41 57 11 42 43 61 15 44 18 19 45 66 46 68 23 47 48 49 50 -DEAL:0:3d:: Cell: 0.3 -DEAL:0:3d:: 3 51 52 53 7 54 55 56 57 58 59 60 61 62 63 64 19 65 66 67 68 69 70 71 72 73 74 -DEAL:0:3d:: n_locally_owned_dofs: 75 -DEAL:0:3d:: n_global_dofs: 75 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 9 3 17 5 10 11 22 12 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 2 3 13 18 14 20 7 15 16 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 3 17 18 19 20 21 22 23 24 +DEAL:0:2d::locally_owned_dofs: {[0,24]} +DEAL:0:2d::n_locally_owned_dofs: 25 +DEAL:0:2d::n_global_dofs: 25 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 27 3 51 5 28 7 54 9 29 30 59 13 31 32 63 17 33 19 65 21 34 35 70 36 37 38 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 2 3 39 52 6 7 40 55 41 57 11 42 43 61 15 44 18 19 45 66 46 68 23 47 48 49 50 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 3 51 52 53 7 54 55 56 57 58 59 60 61 62 63 64 19 65 66 67 68 69 70 71 72 73 74 +DEAL:0:3d::locally_owned_dofs: {[0,74]} +DEAL:0:3d::n_locally_owned_dofs: 75 +DEAL:0:3d::n_global_dofs: 75 diff --git a/tests/mpi/hp_unify_dof_indices_02.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_02.mpirun=2.with_p4est=true.output index 4e57b90d95..0b819a5223 100644 --- a/tests/mpi/hp_unify_dof_indices_02.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_02.mpirun=2.with_p4est=true.output @@ -1,47 +1,63 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: Cell: 0.0 -DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 -DEAL:0:2d:: Cell: 0.1 -DEAL:0:2d:: 1 9 3 17 5 10 11 22 12 -DEAL:0:2d:: Cell: 0.2 -DEAL:0:2d:: 2 3 13 18 14 20 7 15 16 -DEAL:0:2d:: Cell: 0.3 -DEAL:0:2d:: 3 17 18 19 20 21 22 23 24 -DEAL:0:2d:: n_locally_owned_dofs: 13 -DEAL:0:2d:: n_global_dofs: 25 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: Cell: 0.0 -DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -DEAL:0:3d:: Cell: 0.1 -DEAL:0:3d:: 1 27 3 51 5 28 7 54 9 29 30 59 13 31 32 63 17 33 19 65 21 34 35 70 36 37 38 -DEAL:0:3d:: Cell: 0.2 -DEAL:0:3d:: 2 3 39 52 6 7 40 55 41 57 11 42 43 61 15 44 18 19 45 66 46 68 23 47 48 49 50 -DEAL:0:3d:: Cell: 0.3 -DEAL:0:3d:: 3 51 52 53 7 54 55 56 57 58 59 60 61 62 63 64 19 65 66 67 68 69 70 71 72 73 74 -DEAL:0:3d:: n_locally_owned_dofs: 39 -DEAL:0:3d:: n_global_dofs: 75 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 9 3 17 5 10 11 22 12 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 2 3 13 18 14 20 7 15 16 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 3 17 18 19 20 21 22 23 24 +DEAL:0:2d::locally_owned_dofs: {[0,12]} +DEAL:0:2d::n_locally_owned_dofs: 13 +DEAL:0:2d::n_global_dofs: 25 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 27 3 51 5 28 7 54 9 29 30 59 13 31 32 63 17 33 19 65 21 34 35 70 36 37 38 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 2 3 39 52 6 7 40 55 41 57 11 42 43 61 15 44 18 19 45 66 46 68 23 47 48 49 50 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 3 51 52 53 7 54 55 56 57 58 59 60 61 62 63 64 19 65 66 67 68 69 70 71 72 73 74 +DEAL:0:3d::locally_owned_dofs: {[0,38]} +DEAL:0:3d::n_locally_owned_dofs: 39 +DEAL:0:3d::n_global_dofs: 75 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: Cell: 0.0 -DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 -DEAL:1:2d:: Cell: 0.1 -DEAL:1:2d:: 1 9 3 17 5 10 11 22 12 -DEAL:1:2d:: Cell: 0.2 -DEAL:1:2d:: 2 3 13 18 14 20 7 15 16 -DEAL:1:2d:: Cell: 0.3 -DEAL:1:2d:: 3 17 18 19 20 21 22 23 24 -DEAL:1:2d:: n_locally_owned_dofs: 12 -DEAL:1:2d:: n_global_dofs: 25 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: Cell: 0.0 -DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -DEAL:1:3d:: Cell: 0.1 -DEAL:1:3d:: 1 27 3 51 5 28 7 54 9 29 30 59 13 31 32 63 17 33 19 65 21 34 35 70 36 37 38 -DEAL:1:3d:: Cell: 0.2 -DEAL:1:3d:: 2 3 39 52 6 7 40 55 41 57 11 42 43 61 15 44 18 19 45 66 46 68 23 47 48 49 50 -DEAL:1:3d:: Cell: 0.3 -DEAL:1:3d:: 3 51 52 53 7 54 55 56 57 58 59 60 61 62 63 64 19 65 66 67 68 69 70 71 72 73 74 -DEAL:1:3d:: n_locally_owned_dofs: 36 -DEAL:1:3d:: n_global_dofs: 75 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 1 9 3 17 5 10 11 22 12 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 2 3 13 18 14 20 7 15 16 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 3 17 18 19 20 21 22 23 24 +DEAL:1:2d::locally_owned_dofs: {[13,24]} +DEAL:1:2d::n_locally_owned_dofs: 12 +DEAL:1:2d::n_global_dofs: 25 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 1 27 3 51 5 28 7 54 9 29 30 59 13 31 32 63 17 33 19 65 21 34 35 70 36 37 38 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 2 3 39 52 6 7 40 55 41 57 11 42 43 61 15 44 18 19 45 66 46 68 23 47 48 49 50 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 3 51 52 53 7 54 55 56 57 58 59 60 61 62 63 64 19 65 66 67 68 69 70 71 72 73 74 +DEAL:1:3d::locally_owned_dofs: {[39,74]} +DEAL:1:3d::n_locally_owned_dofs: 36 +DEAL:1:3d::n_global_dofs: 75 diff --git a/tests/mpi/hp_unify_dof_indices_03.cc b/tests/mpi/hp_unify_dof_indices_03.cc index cd5f91a755..4abac11f12 100644 --- a/tests/mpi/hp_unify_dof_indices_03.cc +++ b/tests/mpi/hp_unify_dof_indices_03.cc @@ -43,6 +43,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -69,27 +71,21 @@ test() fe.push_back(FE_Q(2)); DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "2_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "3_0:") - cell->set_active_fe_index(0); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(0); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_03.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_03.mpirun=1.with_p4est=true.output index 8f70f2e150..1f14157eb1 100644 --- a/tests/mpi/hp_unify_dof_indices_03.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_03.mpirun=1.with_p4est=true.output @@ -1,7 +1,31 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 57 -DEAL:0:2d:: n_global_dofs: 57 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 282 -DEAL:0:3d:: n_global_dofs: 282 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 20 29 22 1 2 3 4 24 5 6 7 8 9 34 10 11 12 13 14 15 16 17 18 19 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 20 21 22 23 24 25 26 27 28 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 29 22 30 31 32 33 34 35 36 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 22 23 31 37 38 33 39 40 41 42 43 27 44 45 46 47 48 49 50 51 52 53 54 55 56 +DEAL:0:2d::locally_owned_dofs: {[0,56]} +DEAL:0:2d::n_locally_owned_dofs: 57 +DEAL:0:2d::n_global_dofs: 57 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 117 144 119 1 121 147 123 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 137 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 163 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 144 119 145 146 147 123 148 149 150 151 152 153 154 155 156 157 158 135 159 160 161 162 163 164 165 166 167 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 119 120 146 168 123 124 149 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 35 36 37 194 195 196 197 198 199 200 201 202 203 204 205 206 162 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 140 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 +DEAL:0:3d::locally_owned_dofs: {[0,281]} +DEAL:0:3d::n_locally_owned_dofs: 282 +DEAL:0:3d::n_global_dofs: 282 diff --git a/tests/mpi/hp_unify_dof_indices_03.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_03.mpirun=2.with_p4est=true.output index 89f3a37cb3..35d9a2e624 100644 --- a/tests/mpi/hp_unify_dof_indices_03.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_03.mpirun=2.with_p4est=true.output @@ -1,15 +1,63 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 29 -DEAL:0:2d:: n_global_dofs: 57 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 144 -DEAL:0:3d:: n_global_dofs:282 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 20 29 22 1 2 3 4 24 5 6 7 8 9 34 10 11 12 13 14 15 16 17 18 19 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 20 21 22 23 24 25 26 27 28 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 29 22 30 31 32 33 34 35 36 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 22 23 31 37 38 33 39 40 41 42 43 27 44 45 46 47 48 49 50 51 52 53 54 55 56 +DEAL:0:2d::locally_owned_dofs: {[0,28]} +DEAL:0:2d::n_locally_owned_dofs: 29 +DEAL:0:2d::n_global_dofs: 57 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 117 144 119 1 121 147 123 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 137 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 163 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 144 119 145 146 147 123 148 149 150 151 152 153 154 155 156 157 158 135 159 160 161 162 163 164 165 166 167 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 119 120 146 168 123 124 149 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 35 36 37 194 195 196 197 198 199 200 201 202 203 204 205 206 162 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 140 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 +DEAL:0:3d::locally_owned_dofs: {[0,143]} +DEAL:0:3d::n_locally_owned_dofs: 144 +DEAL:0:3d::n_global_dofs: 282 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_locally_owned_dofs: 28 -DEAL:1:2d:: n_global_dofs: 57 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_locally_owned_dofs: 138 -DEAL:1:3d:: n_global_dofs: 282 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 20 29 22 1 2 3 4 24 5 6 7 8 9 34 10 11 12 13 14 15 16 17 18 19 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 20 21 22 23 24 25 26 27 28 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 29 22 30 31 32 33 34 35 36 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 22 23 31 37 38 33 39 40 41 42 43 27 44 45 46 47 48 49 50 51 52 53 54 55 56 +DEAL:1:2d::locally_owned_dofs: {[29,56]} +DEAL:1:2d::n_locally_owned_dofs: 28 +DEAL:1:2d::n_global_dofs: 57 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 117 144 119 1 121 147 123 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 137 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 163 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 144 119 145 146 147 123 148 149 150 151 152 153 154 155 156 157 158 135 159 160 161 162 163 164 165 166 167 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 119 120 146 168 123 124 149 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 35 36 37 194 195 196 197 198 199 200 201 202 203 204 205 206 162 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 140 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 +DEAL:1:3d::locally_owned_dofs: {[144,281]} +DEAL:1:3d::n_locally_owned_dofs: 138 +DEAL:1:3d::n_global_dofs: 282 diff --git a/tests/mpi/hp_unify_dof_indices_04.cc b/tests/mpi/hp_unify_dof_indices_04.cc index 801031e752..c9ee41e3a7 100644 --- a/tests/mpi/hp_unify_dof_indices_04.cc +++ b/tests/mpi/hp_unify_dof_indices_04.cc @@ -44,6 +44,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -70,27 +72,21 @@ test() fe.push_back(FE_Q(2)); DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "2_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "3_0:") - cell->set_active_fe_index(1); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(1); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_04.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_04.mpirun=1.with_p4est=true.output index 645895d597..29063cf67e 100644 --- a/tests/mpi/hp_unify_dof_indices_04.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_04.mpirun=1.with_p4est=true.output @@ -1,7 +1,31 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 55 -DEAL:0:2d:: n_global_dofs: 55 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 262 -DEAL:0:3d:: n_global_dofs: 262 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 40 41 2 3 4 5 6 7 8 9 10 11 46 12 13 14 15 16 17 18 19 20 21 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 22 41 49 5 6 7 23 24 25 26 27 28 29 52 30 31 32 33 34 35 36 37 38 39 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 40 41 42 43 44 45 46 47 48 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 41 49 43 50 45 51 52 53 54 +DEAL:0:2d::locally_owned_dofs: {[0,54]} +DEAL:0:2d::n_locally_owned_dofs: 55 +DEAL:0:2d::n_global_dofs: 55 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 217 218 2 3 221 222 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 239 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 120 218 244 3 121 222 246 7 8 9 122 123 124 125 126 127 128 129 130 19 20 21 131 132 133 134 135 136 137 138 139 31 32 33 140 141 142 37 38 39 143 144 145 49 50 51 52 53 54 55 56 57 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 257 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 218 244 220 245 222 246 224 247 226 248 249 250 230 251 252 253 234 254 236 255 238 256 257 258 259 260 261 +DEAL:0:3d::locally_owned_dofs: {[0,261]} +DEAL:0:3d::n_locally_owned_dofs: 262 +DEAL:0:3d::n_global_dofs: 262 diff --git a/tests/mpi/hp_unify_dof_indices_04.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_04.mpirun=2.with_p4est=true.output index f98ee29351..c6e466ebe6 100644 --- a/tests/mpi/hp_unify_dof_indices_04.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_04.mpirun=2.with_p4est=true.output @@ -1,15 +1,63 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 40 -DEAL:0:2d:: n_global_dofs: 55 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 217 -DEAL:0:3d:: n_global_dofs: 262 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 40 41 2 3 4 5 6 7 8 9 10 11 46 12 13 14 15 16 17 18 19 20 21 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 22 41 49 5 6 7 23 24 25 26 27 28 29 52 30 31 32 33 34 35 36 37 38 39 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 40 41 42 43 44 45 46 47 48 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 41 49 43 50 45 51 52 53 54 +DEAL:0:2d::locally_owned_dofs: {[0,39]} +DEAL:0:2d::n_locally_owned_dofs: 40 +DEAL:0:2d::n_global_dofs: 55 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 217 218 2 3 221 222 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 239 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 120 218 244 3 121 222 246 7 8 9 122 123 124 125 126 127 128 129 130 19 20 21 131 132 133 134 135 136 137 138 139 31 32 33 140 141 142 37 38 39 143 144 145 49 50 51 52 53 54 55 56 57 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 257 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 218 244 220 245 222 246 224 247 226 248 249 250 230 251 252 253 234 254 236 255 238 256 257 258 259 260 261 +DEAL:0:3d::locally_owned_dofs: {[0,216]} +DEAL:0:3d::n_locally_owned_dofs: 217 +DEAL:0:3d::n_global_dofs: 262 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_locally_owned_dofs: 15 -DEAL:1:2d:: n_global_dofs: 55 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_locally_owned_dofs: 45 -DEAL:1:3d:: n_global_dofs: 262 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 40 41 2 3 4 5 6 7 8 9 10 11 46 12 13 14 15 16 17 18 19 20 21 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 1 22 41 49 5 6 7 23 24 25 26 27 28 29 52 30 31 32 33 34 35 36 37 38 39 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 40 41 42 43 44 45 46 47 48 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 41 49 43 50 45 51 52 53 54 +DEAL:1:2d::locally_owned_dofs: {[40,54]} +DEAL:1:2d::n_locally_owned_dofs: 15 +DEAL:1:2d::n_global_dofs: 55 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 217 218 2 3 221 222 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 239 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 1 120 218 244 3 121 222 246 7 8 9 122 123 124 125 126 127 128 129 130 19 20 21 131 132 133 134 135 136 137 138 139 31 32 33 140 141 142 37 38 39 143 144 145 49 50 51 52 53 54 55 56 57 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 257 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 218 244 220 245 222 246 224 247 226 248 249 250 230 251 252 253 234 254 236 255 238 256 257 258 259 260 261 +DEAL:1:3d::locally_owned_dofs: {[217,261]} +DEAL:1:3d::n_locally_owned_dofs: 45 +DEAL:1:3d::n_global_dofs: 262 diff --git a/tests/mpi/hp_unify_dof_indices_05.cc b/tests/mpi/hp_unify_dof_indices_05.cc index 5d4ea7fde4..0496ee418c 100644 --- a/tests/mpi/hp_unify_dof_indices_05.cc +++ b/tests/mpi/hp_unify_dof_indices_05.cc @@ -44,6 +44,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -70,27 +72,21 @@ test() fe.push_back(FE_Q(2)); DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "2_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "3_0:") - cell->set_active_fe_index(1); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(1); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_05.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_05.mpirun=1.with_p4est=true.output index 645895d597..12fe804320 100644 --- a/tests/mpi/hp_unify_dof_indices_05.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_05.mpirun=1.with_p4est=true.output @@ -1,7 +1,31 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 55 -DEAL:0:2d:: n_global_dofs: 55 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 262 -DEAL:0:3d:: n_global_dofs: 262 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 22 1 24 2 3 4 5 26 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 22 23 24 25 26 27 28 29 30 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 24 31 49 32 33 34 35 51 36 10 11 12 37 38 39 40 41 42 43 44 45 46 47 48 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 24 25 49 50 51 52 29 53 54 +DEAL:0:2d::locally_owned_dofs: {[0,54]} +DEAL:0:2d::n_locally_owned_dofs: 55 +DEAL:0:2d::n_global_dofs: 55 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 120 1 122 2 124 3 126 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 140 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 122 147 244 3 126 148 246 149 150 151 152 153 154 13 14 15 155 156 157 158 159 160 161 162 163 25 26 27 164 165 166 34 35 36 37 38 39 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 256 186 187 188 189 66 67 68 69 70 71 72 73 74 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 122 123 244 245 126 127 246 247 248 249 131 250 251 252 135 253 138 139 254 255 256 257 143 258 259 260 261 +DEAL:0:3d::locally_owned_dofs: {[0,261]} +DEAL:0:3d::n_locally_owned_dofs: 262 +DEAL:0:3d::n_global_dofs: 262 diff --git a/tests/mpi/hp_unify_dof_indices_05.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_05.mpirun=2.with_p4est=true.output index d9bb94c1fb..da9cb0048c 100644 --- a/tests/mpi/hp_unify_dof_indices_05.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_05.mpirun=2.with_p4est=true.output @@ -1,15 +1,63 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 31 -DEAL:0:2d:: n_global_dofs: 55 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 147 -DEAL:0:3d:: n_global_dofs: 262 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 22 1 24 2 3 4 5 26 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 22 23 24 25 26 27 28 29 30 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 1 24 31 49 32 33 34 35 51 36 10 11 12 37 38 39 40 41 42 43 44 45 46 47 48 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 24 25 49 50 51 52 29 53 54 +DEAL:0:2d::locally_owned_dofs: {[0,30]} +DEAL:0:2d::n_locally_owned_dofs: 31 +DEAL:0:2d::n_global_dofs: 55 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 120 1 122 2 124 3 126 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 140 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 1 122 147 244 3 126 148 246 149 150 151 152 153 154 13 14 15 155 156 157 158 159 160 161 162 163 25 26 27 164 165 166 34 35 36 37 38 39 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 256 186 187 188 189 66 67 68 69 70 71 72 73 74 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 122 123 244 245 126 127 246 247 248 249 131 250 251 252 135 253 138 139 254 255 256 257 143 258 259 260 261 +DEAL:0:3d::locally_owned_dofs: {[0,146]} +DEAL:0:3d::n_locally_owned_dofs: 147 +DEAL:0:3d::n_global_dofs: 262 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_locally_owned_dofs: 24 -DEAL:1:2d:: n_global_dofs: 55 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_locally_owned_dofs: 115 -DEAL:1:3d:: n_global_dofs: 262 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 22 1 24 2 3 4 5 26 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 22 23 24 25 26 27 28 29 30 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 1 24 31 49 32 33 34 35 51 36 10 11 12 37 38 39 40 41 42 43 44 45 46 47 48 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 24 25 49 50 51 52 29 53 54 +DEAL:1:2d::locally_owned_dofs: {[31,54]} +DEAL:1:2d::n_locally_owned_dofs: 24 +DEAL:1:2d::n_global_dofs: 55 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 120 1 122 2 124 3 126 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 140 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 1 122 147 244 3 126 148 246 149 150 151 152 153 154 13 14 15 155 156 157 158 159 160 161 162 163 25 26 27 164 165 166 34 35 36 37 38 39 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 256 186 187 188 189 66 67 68 69 70 71 72 73 74 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 122 123 244 245 126 127 246 247 248 249 131 250 251 252 135 253 138 139 254 255 256 257 143 258 259 260 261 +DEAL:1:3d::locally_owned_dofs: {[147,261]} +DEAL:1:3d::n_locally_owned_dofs: 115 +DEAL:1:3d::n_global_dofs: 262 diff --git a/tests/mpi/hp_unify_dof_indices_06.cc b/tests/mpi/hp_unify_dof_indices_06.cc index 619dbca6ba..6ffc4614e3 100644 --- a/tests/mpi/hp_unify_dof_indices_06.cc +++ b/tests/mpi/hp_unify_dof_indices_06.cc @@ -44,6 +44,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -71,27 +73,21 @@ test() DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "2_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "3_0:") - cell->set_active_fe_index(0); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(0); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_06.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_06.mpirun=1.with_p4est=true.output index 8872e4f21d..c98b3a48cd 100644 --- a/tests/mpi/hp_unify_dof_indices_06.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_06.mpirun=1.with_p4est=true.output @@ -1,7 +1,31 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 69 -DEAL:0:2d:: n_global_dofs: 69 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 344 -DEAL:0:3d:: n_global_dofs: 344 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 42 43 2 3 4 5 6 7 8 9 10 11 48 12 13 14 15 16 17 18 19 20 21 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 22 43 23 5 6 7 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 42 43 44 45 46 47 48 49 50 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 43 23 45 51 52 47 53 54 55 56 30 31 32 57 58 59 60 61 62 63 64 65 66 67 68 +DEAL:0:2d::locally_owned_dofs: {[0,68]} +DEAL:0:2d::n_locally_owned_dofs: 69 +DEAL:0:2d::n_global_dofs: 69 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 220 221 2 3 224 225 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 242 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 120 221 121 3 122 225 123 7 8 9 124 125 126 127 128 129 130 131 132 19 20 21 133 134 135 136 137 138 139 140 141 31 32 33 142 143 144 37 38 39 145 146 147 49 50 51 52 53 54 55 56 57 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 221 121 223 247 225 123 227 248 249 250 251 252 253 254 130 131 132 255 256 257 258 259 260 261 262 263 139 140 141 264 265 266 37 38 39 145 146 147 267 268 269 270 271 272 273 274 275 276 241 277 278 279 280 281 282 283 284 285 286 287 288 289 166 167 168 169 170 171 172 173 174 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 +DEAL:0:3d::locally_owned_dofs: {[0,343]} +DEAL:0:3d::n_locally_owned_dofs: 344 +DEAL:0:3d::n_global_dofs: 344 diff --git a/tests/mpi/hp_unify_dof_indices_06.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_06.mpirun=2.with_p4est=true.output index 630eeac139..3bca74cecf 100644 --- a/tests/mpi/hp_unify_dof_indices_06.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_06.mpirun=2.with_p4est=true.output @@ -1,15 +1,63 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 42 -DEAL:0:2d:: n_global_dofs: 69 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 220 -DEAL:0:3d:: n_global_dofs: 344 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 42 43 2 3 4 5 6 7 8 9 10 11 48 12 13 14 15 16 17 18 19 20 21 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 22 43 23 5 6 7 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 42 43 44 45 46 47 48 49 50 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 43 23 45 51 52 47 53 54 55 56 30 31 32 57 58 59 60 61 62 63 64 65 66 67 68 +DEAL:0:2d::locally_owned_dofs: {[0,41]} +DEAL:0:2d::n_locally_owned_dofs: 42 +DEAL:0:2d::n_global_dofs: 69 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 220 221 2 3 224 225 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 242 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 120 221 121 3 122 225 123 7 8 9 124 125 126 127 128 129 130 131 132 19 20 21 133 134 135 136 137 138 139 140 141 31 32 33 142 143 144 37 38 39 145 146 147 49 50 51 52 53 54 55 56 57 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 221 121 223 247 225 123 227 248 249 250 251 252 253 254 130 131 132 255 256 257 258 259 260 261 262 263 139 140 141 264 265 266 37 38 39 145 146 147 267 268 269 270 271 272 273 274 275 276 241 277 278 279 280 281 282 283 284 285 286 287 288 289 166 167 168 169 170 171 172 173 174 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 +DEAL:0:3d::locally_owned_dofs: {[0,219]} +DEAL:0:3d::n_locally_owned_dofs: 220 +DEAL:0:3d::n_global_dofs: 344 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_locally_owned_dofs: 27 -DEAL:1:2d:: n_global_dofs: 69 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_locally_owned_dofs: 124 -DEAL:1:3d:: n_global_dofs: 344 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 42 43 2 3 4 5 6 7 8 9 10 11 48 12 13 14 15 16 17 18 19 20 21 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 1 22 43 23 5 6 7 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 42 43 44 45 46 47 48 49 50 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 43 23 45 51 52 47 53 54 55 56 30 31 32 57 58 59 60 61 62 63 64 65 66 67 68 +DEAL:1:2d::locally_owned_dofs: {[42,68]} +DEAL:1:2d::n_locally_owned_dofs: 27 +DEAL:1:2d::n_global_dofs: 69 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 220 221 2 3 224 225 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 242 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 1 120 221 121 3 122 225 123 7 8 9 124 125 126 127 128 129 130 131 132 19 20 21 133 134 135 136 137 138 139 140 141 31 32 33 142 143 144 37 38 39 145 146 147 49 50 51 52 53 54 55 56 57 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 221 121 223 247 225 123 227 248 249 250 251 252 253 254 130 131 132 255 256 257 258 259 260 261 262 263 139 140 141 264 265 266 37 38 39 145 146 147 267 268 269 270 271 272 273 274 275 276 241 277 278 279 280 281 282 283 284 285 286 287 288 289 166 167 168 169 170 171 172 173 174 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 +DEAL:1:3d::locally_owned_dofs: {[220,343]} +DEAL:1:3d::n_locally_owned_dofs: 124 +DEAL:1:3d::n_global_dofs: 344 diff --git a/tests/mpi/hp_unify_dof_indices_07.cc b/tests/mpi/hp_unify_dof_indices_07.cc index 650945e9f1..eff1c01b85 100644 --- a/tests/mpi/hp_unify_dof_indices_07.cc +++ b/tests/mpi/hp_unify_dof_indices_07.cc @@ -83,8 +83,6 @@ test() DoFTools::make_hanging_node_constraints(dof_handler, constraints); constraints.close(); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; deallog << "n_dofs: " << dof_handler.n_dofs() << std::endl; deallog << "n_constraints: " << constraints.n_constraints() << std::endl; constraints.print(deallog.get_file_stream()); diff --git a/tests/mpi/hp_unify_dof_indices_07.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_07.mpirun=1.with_p4est=true.output index e7baa981e0..9b8f624704 100644 --- a/tests/mpi/hp_unify_dof_indices_07.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_07.mpirun=1.with_p4est=true.output @@ -1,7 +1,5 @@ -DEAL:0:2d::Processor: 0 DEAL:0:2d::n_dofs: 15 DEAL:0:2d::n_constraints: 0 -DEAL:0:3d::Processor: 0 DEAL:0:3d::n_dofs: 45 DEAL:0:3d::n_constraints: 0 diff --git a/tests/mpi/hp_unify_dof_indices_07.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_07.mpirun=2.with_p4est=true.output index d568fdc29a..fa620b1fa9 100644 --- a/tests/mpi/hp_unify_dof_indices_07.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_07.mpirun=2.with_p4est=true.output @@ -1,15 +1,11 @@ -DEAL:0:2d::Processor: 0 DEAL:0:2d::n_dofs: 15 DEAL:0:2d::n_constraints: 0 -DEAL:0:3d::Processor: 0 DEAL:0:3d::n_dofs: 45 DEAL:0:3d::n_constraints: 0 -DEAL:1:2d::Processor: 1 DEAL:1:2d::n_dofs: 15 DEAL:1:2d::n_constraints: 0 -DEAL:1:3d::Processor: 1 DEAL:1:3d::n_dofs: 45 DEAL:1:3d::n_constraints: 0 diff --git a/tests/mpi/hp_unify_dof_indices_08.cc b/tests/mpi/hp_unify_dof_indices_08.cc index 65cef2ab89..1adb3913e0 100644 --- a/tests/mpi/hp_unify_dof_indices_08.cc +++ b/tests/mpi/hp_unify_dof_indices_08.cc @@ -89,7 +89,7 @@ test() // that to build a hash value from it that is then used to assign an // active_fe_index DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->is_locally_owned()) cell->set_active_fe_index( (cell->active_cell_index() + @@ -97,13 +97,11 @@ test() fe.size()); dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - deallog << " n_globally_active_cells: " + deallog << "n_globally_active_cells: " << triangulation.n_global_active_cells() << std::endl; - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() + deallog << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + deallog << "n_global_dofs: " << dof_handler.n_dofs() << std::endl; } diff --git a/tests/mpi/hp_unify_dof_indices_08.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_08.mpirun=1.with_p4est=true.output index 250ac01364..5e2a6c2351 100644 --- a/tests/mpi/hp_unify_dof_indices_08.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_08.mpirun=1.with_p4est=true.output @@ -1,9 +1,7 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_globally_active_cells: 29035 -DEAL:0:2d:: n_locally_owned_dofs: 485573 -DEAL:0:2d:: n_global_dofs: 485573 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_globally_active_cells: 13824 -DEAL:0:3d:: n_locally_owned_dofs: 1125219 -DEAL:0:3d:: n_global_dofs: 1125219 +DEAL:0:2d::n_globally_active_cells: 29035 +DEAL:0:2d::n_locally_owned_dofs: 485573 +DEAL:0:2d::n_global_dofs: 485573 +DEAL:0:3d::n_globally_active_cells: 13824 +DEAL:0:3d::n_locally_owned_dofs: 1125219 +DEAL:0:3d::n_global_dofs: 1125219 diff --git a/tests/mpi/hp_unify_dof_indices_08.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_08.mpirun=2.with_p4est=true.output index 6f0e2feeab..8fe0172af7 100644 --- a/tests/mpi/hp_unify_dof_indices_08.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_08.mpirun=2.with_p4est=true.output @@ -1,19 +1,15 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_globally_active_cells: 29035 -DEAL:0:2d:: n_locally_owned_dofs: 242831 -DEAL:0:2d:: n_global_dofs: 485573 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_globally_active_cells: 13824 -DEAL:0:3d:: n_locally_owned_dofs: 567265 -DEAL:0:3d:: n_global_dofs: 1125219 +DEAL:0:2d::n_globally_active_cells: 29035 +DEAL:0:2d::n_locally_owned_dofs: 242831 +DEAL:0:2d::n_global_dofs: 485573 +DEAL:0:3d::n_globally_active_cells: 13824 +DEAL:0:3d::n_locally_owned_dofs: 567265 +DEAL:0:3d::n_global_dofs: 1125219 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_globally_active_cells: 29035 -DEAL:1:2d:: n_locally_owned_dofs: 242742 -DEAL:1:2d:: n_global_dofs: 485573 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_globally_active_cells: 13824 -DEAL:1:3d:: n_locally_owned_dofs: 557954 -DEAL:1:3d:: n_global_dofs: 1125219 +DEAL:1:2d::n_globally_active_cells: 29035 +DEAL:1:2d::n_locally_owned_dofs: 242742 +DEAL:1:2d::n_global_dofs: 485573 +DEAL:1:3d::n_globally_active_cells: 13824 +DEAL:1:3d::n_locally_owned_dofs: 557954 +DEAL:1:3d::n_global_dofs: 1125219 diff --git a/tests/mpi/hp_unify_dof_indices_08.mpirun=7.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_08.mpirun=7.with_p4est=true.output index 6103824ca3..463e18ffc6 100644 --- a/tests/mpi/hp_unify_dof_indices_08.mpirun=7.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_08.mpirun=7.with_p4est=true.output @@ -1,69 +1,55 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_globally_active_cells: 29035 -DEAL:0:2d:: n_locally_owned_dofs: 68397 -DEAL:0:2d:: n_global_dofs: 485573 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_globally_active_cells: 13824 -DEAL:0:3d:: n_locally_owned_dofs: 162762 -DEAL:0:3d:: n_global_dofs: 1125219 - -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_globally_active_cells: 29035 -DEAL:1:2d:: n_locally_owned_dofs: 72246 -DEAL:1:2d:: n_global_dofs: 485573 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_globally_active_cells: 13824 -DEAL:1:3d:: n_locally_owned_dofs: 162413 -DEAL:1:3d:: n_global_dofs: 1125219 - - -DEAL:2:2d::Processor: 2 -DEAL:2:2d:: n_globally_active_cells: 29035 -DEAL:2:2d:: n_locally_owned_dofs: 67840 -DEAL:2:2d:: n_global_dofs: 485573 -DEAL:2:3d::Processor: 2 -DEAL:2:3d:: n_globally_active_cells: 13824 -DEAL:2:3d:: n_locally_owned_dofs: 161549 -DEAL:2:3d:: n_global_dofs: 1125219 - - -DEAL:3:2d::Processor: 3 -DEAL:3:2d:: n_globally_active_cells: 29035 -DEAL:3:2d:: n_locally_owned_dofs: 69235 -DEAL:3:2d:: n_global_dofs: 485573 -DEAL:3:3d::Processor: 3 -DEAL:3:3d:: n_globally_active_cells: 13824 -DEAL:3:3d:: n_locally_owned_dofs: 160833 -DEAL:3:3d:: n_global_dofs: 1125219 - - -DEAL:4:2d::Processor: 4 -DEAL:4:2d:: n_globally_active_cells: 29035 -DEAL:4:2d:: n_locally_owned_dofs: 69494 -DEAL:4:2d:: n_global_dofs: 485573 -DEAL:4:3d::Processor: 4 -DEAL:4:3d:: n_globally_active_cells: 13824 -DEAL:4:3d:: n_locally_owned_dofs: 161477 -DEAL:4:3d:: n_global_dofs: 1125219 - - -DEAL:5:2d::Processor: 5 -DEAL:5:2d:: n_globally_active_cells: 29035 -DEAL:5:2d:: n_locally_owned_dofs: 70925 -DEAL:5:2d:: n_global_dofs: 485573 -DEAL:5:3d::Processor: 5 -DEAL:5:3d:: n_globally_active_cells: 13824 -DEAL:5:3d:: n_locally_owned_dofs: 159501 -DEAL:5:3d:: n_global_dofs: 1125219 - - -DEAL:6:2d::Processor: 6 -DEAL:6:2d:: n_globally_active_cells: 29035 -DEAL:6:2d:: n_locally_owned_dofs: 67436 -DEAL:6:2d:: n_global_dofs: 485573 -DEAL:6:3d::Processor: 6 -DEAL:6:3d:: n_globally_active_cells: 13824 -DEAL:6:3d:: n_locally_owned_dofs: 156684 -DEAL:6:3d:: n_global_dofs: 1125219 +DEAL:0:2d::n_globally_active_cells: 29035 +DEAL:0:2d::n_locally_owned_dofs: 68397 +DEAL:0:2d::n_global_dofs: 485573 +DEAL:0:3d::n_globally_active_cells: 13824 +DEAL:0:3d::n_locally_owned_dofs: 162762 +DEAL:0:3d::n_global_dofs: 1125219 + +DEAL:1:2d::n_globally_active_cells: 29035 +DEAL:1:2d::n_locally_owned_dofs: 72246 +DEAL:1:2d::n_global_dofs: 485573 +DEAL:1:3d::n_globally_active_cells: 13824 +DEAL:1:3d::n_locally_owned_dofs: 162413 +DEAL:1:3d::n_global_dofs: 1125219 + + +DEAL:2:2d::n_globally_active_cells: 29035 +DEAL:2:2d::n_locally_owned_dofs: 67840 +DEAL:2:2d::n_global_dofs: 485573 +DEAL:2:3d::n_globally_active_cells: 13824 +DEAL:2:3d::n_locally_owned_dofs: 161549 +DEAL:2:3d::n_global_dofs: 1125219 + + +DEAL:3:2d::n_globally_active_cells: 29035 +DEAL:3:2d::n_locally_owned_dofs: 69235 +DEAL:3:2d::n_global_dofs: 485573 +DEAL:3:3d::n_globally_active_cells: 13824 +DEAL:3:3d::n_locally_owned_dofs: 160833 +DEAL:3:3d::n_global_dofs: 1125219 + + +DEAL:4:2d::n_globally_active_cells: 29035 +DEAL:4:2d::n_locally_owned_dofs: 69494 +DEAL:4:2d::n_global_dofs: 485573 +DEAL:4:3d::n_globally_active_cells: 13824 +DEAL:4:3d::n_locally_owned_dofs: 161477 +DEAL:4:3d::n_global_dofs: 1125219 + + +DEAL:5:2d::n_globally_active_cells: 29035 +DEAL:5:2d::n_locally_owned_dofs: 70925 +DEAL:5:2d::n_global_dofs: 485573 +DEAL:5:3d::n_globally_active_cells: 13824 +DEAL:5:3d::n_locally_owned_dofs: 159501 +DEAL:5:3d::n_global_dofs: 1125219 + + +DEAL:6:2d::n_globally_active_cells: 29035 +DEAL:6:2d::n_locally_owned_dofs: 67436 +DEAL:6:2d::n_global_dofs: 485573 +DEAL:6:3d::n_globally_active_cells: 13824 +DEAL:6:3d::n_locally_owned_dofs: 156684 +DEAL:6:3d::n_global_dofs: 1125219 diff --git a/tests/mpi/hp_unify_dof_indices_09.cc b/tests/mpi/hp_unify_dof_indices_09.cc index d53811c544..0d7905e233 100644 --- a/tests/mpi/hp_unify_dof_indices_09.cc +++ b/tests/mpi/hp_unify_dof_indices_09.cc @@ -66,7 +66,7 @@ test(MPI_Comm mpi_communicator) dof_handler.distribute_dofs(fe); if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) - deallog << " n_procs/n_dofs: " + deallog << "n_procs/n_dofs: " << Utilities::MPI::n_mpi_processes(mpi_communicator) << '/' << dof_handler.n_dofs() << std::endl; } diff --git a/tests/mpi/hp_unify_dof_indices_09.mpirun=10.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_09.mpirun=10.with_p4est=true.output index 6c03f8ee70..2cadb3d810 100644 --- a/tests/mpi/hp_unify_dof_indices_09.mpirun=10.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_09.mpirun=10.with_p4est=true.output @@ -1,11 +1,11 @@ -DEAL:0:: n_procs/n_dofs: 1/1089 -DEAL:0:: n_procs/n_dofs: 2/1089 -DEAL:0:: n_procs/n_dofs: 3/1089 -DEAL:0:: n_procs/n_dofs: 4/1089 -DEAL:0:: n_procs/n_dofs: 5/1089 -DEAL:0:: n_procs/n_dofs: 6/1089 -DEAL:0:: n_procs/n_dofs: 7/1089 -DEAL:0:: n_procs/n_dofs: 8/1089 -DEAL:0:: n_procs/n_dofs: 9/1089 -DEAL:0:: n_procs/n_dofs: 10/1089 +DEAL:0::n_procs/n_dofs: 1/1089 +DEAL:0::n_procs/n_dofs: 2/1089 +DEAL:0::n_procs/n_dofs: 3/1089 +DEAL:0::n_procs/n_dofs: 4/1089 +DEAL:0::n_procs/n_dofs: 5/1089 +DEAL:0::n_procs/n_dofs: 6/1089 +DEAL:0::n_procs/n_dofs: 7/1089 +DEAL:0::n_procs/n_dofs: 8/1089 +DEAL:0::n_procs/n_dofs: 9/1089 +DEAL:0::n_procs/n_dofs: 10/1089 diff --git a/tests/mpi/hp_unify_dof_indices_10.cc b/tests/mpi/hp_unify_dof_indices_10.cc index e56ea0d8b1..090d13b0aa 100644 --- a/tests/mpi/hp_unify_dof_indices_10.cc +++ b/tests/mpi/hp_unify_dof_indices_10.cc @@ -46,6 +46,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -73,27 +75,21 @@ test() fe.push_back(FESystem(FE_Q(2), dim)); DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(1); - if (cell->id().to_string() == "2_0:") - cell->set_active_fe_index(2); - if (cell->id().to_string() == "3_0:") - cell->set_active_fe_index(0); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(2); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(0); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_10.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_10.mpirun=1.with_p4est=true.output index 79f8b0982a..06dbe1a7e2 100644 --- a/tests/mpi/hp_unify_dof_indices_10.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_10.mpirun=1.with_p4est=true.output @@ -1,7 +1,31 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 50 -DEAL:0:2d:: n_global_dofs: 50 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 225 -DEAL:0:3d:: n_global_dofs: 225 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 2 3 18 19 6 7 34 35 10 11 20 21 22 23 44 45 24 25 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 4 5 6 7 26 27 36 37 28 29 40 41 14 15 30 31 32 33 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 6 7 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 +DEAL:0:2d::locally_owned_dofs: {[0,49]} +DEAL:0:2d::n_locally_owned_dofs: 50 +DEAL:0:2d::n_global_dofs: 50 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 3 4 5 81 82 83 9 10 11 153 154 155 15 16 17 84 85 86 21 22 23 162 163 164 27 28 29 87 88 89 90 91 92 177 178 179 39 40 41 93 94 95 96 97 98 189 190 191 51 52 53 99 100 101 57 58 59 195 196 197 63 64 65 102 103 104 105 106 107 210 211 212 108 109 110 111 112 113 114 115 116 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 6 7 8 9 10 11 117 118 119 156 157 158 18 19 20 21 22 23 120 121 122 165 166 167 123 124 125 171 172 173 33 34 35 126 127 128 129 130 131 183 184 185 45 46 47 132 133 134 54 55 56 57 58 59 135 136 137 198 199 200 138 139 140 204 205 206 69 70 71 141 142 143 144 145 146 147 148 149 150 151 152 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 9 10 11 153 154 155 156 157 158 159 160 161 21 22 23 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 57 58 59 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 +DEAL:0:3d::locally_owned_dofs: {[0,224]} +DEAL:0:3d::n_locally_owned_dofs: 225 +DEAL:0:3d::n_global_dofs: 225 diff --git a/tests/mpi/hp_unify_dof_indices_10.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_10.mpirun=2.with_p4est=true.output index ec186548b1..5cda9300a8 100644 --- a/tests/mpi/hp_unify_dof_indices_10.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_10.mpirun=2.with_p4est=true.output @@ -1,15 +1,63 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: n_locally_owned_dofs: 26 -DEAL:0:2d:: n_global_dofs: 50 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: n_locally_owned_dofs: 117 -DEAL:0:3d:: n_global_dofs: 225 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 2 3 18 19 6 7 34 35 10 11 20 21 22 23 44 45 24 25 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 4 5 6 7 26 27 36 37 28 29 40 41 14 15 30 31 32 33 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 6 7 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 +DEAL:0:2d::locally_owned_dofs: {[0,25]} +DEAL:0:2d::n_locally_owned_dofs: 26 +DEAL:0:2d::n_global_dofs: 50 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 3 4 5 81 82 83 9 10 11 153 154 155 15 16 17 84 85 86 21 22 23 162 163 164 27 28 29 87 88 89 90 91 92 177 178 179 39 40 41 93 94 95 96 97 98 189 190 191 51 52 53 99 100 101 57 58 59 195 196 197 63 64 65 102 103 104 105 106 107 210 211 212 108 109 110 111 112 113 114 115 116 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 6 7 8 9 10 11 117 118 119 156 157 158 18 19 20 21 22 23 120 121 122 165 166 167 123 124 125 171 172 173 33 34 35 126 127 128 129 130 131 183 184 185 45 46 47 132 133 134 54 55 56 57 58 59 135 136 137 198 199 200 138 139 140 204 205 206 69 70 71 141 142 143 144 145 146 147 148 149 150 151 152 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 9 10 11 153 154 155 156 157 158 159 160 161 21 22 23 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 57 58 59 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 +DEAL:0:3d::locally_owned_dofs: {[0,116]} +DEAL:0:3d::n_locally_owned_dofs: 117 +DEAL:0:3d::n_global_dofs: 225 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: n_locally_owned_dofs: 24 -DEAL:1:2d:: n_global_dofs: 50 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: n_locally_owned_dofs: 108 -DEAL:1:3d:: n_global_dofs: 225 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 2 3 18 19 6 7 34 35 10 11 20 21 22 23 44 45 24 25 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 4 5 6 7 26 27 36 37 28 29 40 41 14 15 30 31 32 33 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 6 7 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 +DEAL:1:2d::locally_owned_dofs: {[26,49]} +DEAL:1:2d::n_locally_owned_dofs: 24 +DEAL:1:2d::n_global_dofs: 50 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 3 4 5 81 82 83 9 10 11 153 154 155 15 16 17 84 85 86 21 22 23 162 163 164 27 28 29 87 88 89 90 91 92 177 178 179 39 40 41 93 94 95 96 97 98 189 190 191 51 52 53 99 100 101 57 58 59 195 196 197 63 64 65 102 103 104 105 106 107 210 211 212 108 109 110 111 112 113 114 115 116 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 6 7 8 9 10 11 117 118 119 156 157 158 18 19 20 21 22 23 120 121 122 165 166 167 123 124 125 171 172 173 33 34 35 126 127 128 129 130 131 183 184 185 45 46 47 132 133 134 54 55 56 57 58 59 135 136 137 198 199 200 138 139 140 204 205 206 69 70 71 141 142 143 144 145 146 147 148 149 150 151 152 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 9 10 11 153 154 155 156 157 158 159 160 161 21 22 23 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 57 58 59 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 +DEAL:1:3d::locally_owned_dofs: {[117,224]} +DEAL:1:3d::n_locally_owned_dofs: 108 +DEAL:1:3d::n_global_dofs: 225 diff --git a/tests/mpi/hp_unify_dof_indices_11.cc b/tests/mpi/hp_unify_dof_indices_11.cc index 091a5e76c5..ba4c6828fc 100644 --- a/tests/mpi/hp_unify_dof_indices_11.cc +++ b/tests/mpi/hp_unify_dof_indices_11.cc @@ -36,6 +36,8 @@ #include "../tests.h" +#include "hp_unify_dof_indices.h" + template void @@ -61,40 +63,17 @@ test() fe.push_back(FESystem(FE_Q(2), 1, FE_Q(1), 1)); DoFHandler dof_handler(triangulation); - for (auto &cell : dof_handler.active_cell_iterators()) - { - if (cell->is_locally_owned()) - { - if (cell->id().to_string() == "0_0:") - cell->set_active_fe_index(0); - if (cell->id().to_string() == "1_0:") - cell->set_active_fe_index(1); - } - } + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(1); + } dof_handler.distribute_dofs(fe); - deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << std::endl; - for (auto &cell : dof_handler.active_cell_iterators()) - { - deallog << " Cell: " << cell; - if (cell->is_locally_owned()) - deallog << " is locally owned"; - else if (cell->is_ghost()) - deallog << " is ghost"; - deallog << std::endl; - - std::vector dof_indices( - cell->get_fe().dofs_per_cell); - cell->get_dof_indices(dof_indices); - deallog << " "; - for (auto i : dof_indices) - deallog << i << ' '; - deallog << std::endl; - } - deallog << " n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() - << std::endl; - deallog << " n_global_dofs: " << dof_handler.n_dofs() << std::endl; + log_dof_diagnostics(dof_handler); } diff --git a/tests/mpi/hp_unify_dof_indices_11.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_11.mpirun=1.with_p4est=true.output index fbb78d57ac..4238df51cd 100644 --- a/tests/mpi/hp_unify_dof_indices_11.mpirun=1.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_11.mpirun=1.with_p4est=true.output @@ -1,15 +1,19 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: Cell: 0.0 is locally owned -DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 -DEAL:0:2d:: Cell: 0.1 is locally owned -DEAL:0:2d:: 2 3 13 14 6 7 15 16 17 18 19 20 21 -DEAL:0:2d:: n_locally_owned_dofs: 22 -DEAL:0:2d:: n_global_dofs: 22 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: Cell: 0.0 is locally owned -DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 -DEAL:0:3d:: Cell: 0.1 is locally owned -DEAL:0:3d:: 2 3 35 36 6 7 37 38 10 11 39 40 14 15 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 -DEAL:0:3d:: n_locally_owned_dofs: 62 -DEAL:0:3d:: n_global_dofs: 62 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 2 3 13 14 6 7 15 16 17 18 19 20 21 +DEAL:0:2d::locally_owned_dofs: {[0,21]} +DEAL:0:2d::n_locally_owned_dofs: 22 +DEAL:0:2d::n_global_dofs: 22 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 2 3 35 36 6 7 37 38 10 11 39 40 14 15 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 +DEAL:0:3d::locally_owned_dofs: {[0,61]} +DEAL:0:3d::n_locally_owned_dofs: 62 +DEAL:0:3d::n_global_dofs: 62 diff --git a/tests/mpi/hp_unify_dof_indices_11.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_11.mpirun=2.with_p4est=true.output index 92c03fcd02..5b73f51ba0 100644 --- a/tests/mpi/hp_unify_dof_indices_11.mpirun=2.with_p4est=true.output +++ b/tests/mpi/hp_unify_dof_indices_11.mpirun=2.with_p4est=true.output @@ -1,31 +1,39 @@ -DEAL:0:2d::Processor: 0 -DEAL:0:2d:: Cell: 0.0 is locally owned -DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 -DEAL:0:2d:: Cell: 0.1 is ghost -DEAL:0:2d:: 2 3 13 14 6 7 15 16 17 18 19 20 21 -DEAL:0:2d:: n_locally_owned_dofs: 13 -DEAL:0:2d:: n_global_dofs: 22 -DEAL:0:3d::Processor: 0 -DEAL:0:3d:: Cell: 0.0 is locally owned -DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 -DEAL:0:3d:: Cell: 0.1 is ghost -DEAL:0:3d:: 2 3 35 36 6 7 37 38 10 11 39 40 14 15 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 -DEAL:0:3d:: n_locally_owned_dofs: 35 -DEAL:0:3d:: n_global_dofs: 62 +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: ghost +DEAL:0:2d:: 2 3 13 14 6 7 15 16 17 18 19 20 21 +DEAL:0:2d::locally_owned_dofs: {[0,12]} +DEAL:0:2d::n_locally_owned_dofs: 13 +DEAL:0:2d::n_global_dofs: 22 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: ghost +DEAL:0:3d:: 2 3 35 36 6 7 37 38 10 11 39 40 14 15 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 +DEAL:0:3d::locally_owned_dofs: {[0,34]} +DEAL:0:3d::n_locally_owned_dofs: 35 +DEAL:0:3d::n_global_dofs: 62 -DEAL:1:2d::Processor: 1 -DEAL:1:2d:: Cell: 0.0 is ghost -DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 -DEAL:1:2d:: Cell: 0.1 is locally owned -DEAL:1:2d:: 2 3 13 14 6 7 15 16 17 18 19 20 21 -DEAL:1:2d:: n_locally_owned_dofs: 9 -DEAL:1:2d:: n_global_dofs: 22 -DEAL:1:3d::Processor: 1 -DEAL:1:3d:: Cell: 0.0 is ghost -DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 -DEAL:1:3d:: Cell: 0.1 is locally owned -DEAL:1:3d:: 2 3 35 36 6 7 37 38 10 11 39 40 14 15 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 -DEAL:1:3d:: n_locally_owned_dofs: 27 -DEAL:1:3d:: n_global_dofs: 62 +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 2 3 13 14 6 7 15 16 17 18 19 20 21 +DEAL:1:2d::locally_owned_dofs: {[13,21]} +DEAL:1:2d::n_locally_owned_dofs: 9 +DEAL:1:2d::n_global_dofs: 22 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 2 3 35 36 6 7 37 38 10 11 39 40 14 15 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 +DEAL:1:3d::locally_owned_dofs: {[35,61]} +DEAL:1:3d::n_locally_owned_dofs: 27 +DEAL:1:3d::n_global_dofs: 62 diff --git a/tests/mpi/hp_unify_dof_indices_12.cc b/tests/mpi/hp_unify_dof_indices_12.cc new file mode 100644 index 0000000000..f8edd3386c --- /dev/null +++ b/tests/mpi/hp_unify_dof_indices_12.cc @@ -0,0 +1,98 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2021 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.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + + +// have a 2x2 coarse mesh (or 2x2x1) and verify DoF indices in the hp- +// case with an FECollection that contains a FE_Q(4) and a FE_Q(2) element. +// the hp-code will unify DoF indices on boundaries between all subdomains. +// +// same as hp_unify_dof_indices_03, but with inverted active FE indices. same +// scenario is for the demonstration in the parallel-hp-paper. + + +#include + +#include + +#include +#include + +#include + +#include + +#include "../tests.h" + +#include "hp_unify_dof_indices.h" + + +template +void +test() +{ + parallel::distributed::Triangulation triangulation( + MPI_COMM_WORLD, Triangulation::limit_level_difference_at_vertices); + + std::vector reps(dim, 1U); + reps[0] = 2; + reps[1] = 2; + Point top_right; + for (unsigned int d = 0; d < dim; ++d) + top_right[d] = (d == 0 ? 2 : 1); + GridGenerator::subdivided_hyper_rectangle(triangulation, + reps, + Point(), + top_right); + Assert(triangulation.n_global_active_cells() == 4, ExcInternalError()); + Assert(triangulation.n_active_cells() == 4, ExcInternalError()); + + hp::FECollection fe; + fe.push_back(FE_Q(4)); + fe.push_back(FE_Q(2)); + + DoFHandler dof_handler(triangulation); + for (const auto &cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + { + if (cell->id().to_string() == "0_0:") + cell->set_active_fe_index(1); + if (cell->id().to_string() == "1_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "2_0:") + cell->set_active_fe_index(0); + if (cell->id().to_string() == "3_0:") + cell->set_active_fe_index(1); + } + dof_handler.distribute_dofs(fe); + + log_dof_diagnostics(dof_handler); +} + + +int +main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + MPILogInitAll log; + + deallog.push("2d"); + test<2>(); + deallog.pop(); + + deallog.push("3d"); + test<3>(); + deallog.pop(); +} diff --git a/tests/mpi/hp_unify_dof_indices_12.mpirun=1.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_12.mpirun=1.with_p4est=true.output new file mode 100644 index 0000000000..2d73e679d3 --- /dev/null +++ b/tests/mpi/hp_unify_dof_indices_12.mpirun=1.with_p4est=true.output @@ -0,0 +1,31 @@ + +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 9 3 49 10 5 11 12 13 14 15 16 17 18 54 19 20 21 22 23 24 25 26 27 28 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 2 3 29 50 30 31 32 33 52 34 35 7 36 37 38 39 40 41 42 43 44 45 46 47 48 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 3 49 50 51 52 53 54 55 56 +DEAL:0:2d::locally_owned_dofs: {[0,56]} +DEAL:0:2d::n_locally_owned_dofs: 57 +DEAL:0:2d::n_global_dofs: 57 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 27 3 258 5 28 7 261 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 21 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 277 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 2 3 144 259 6 7 145 262 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 59 60 61 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 275 192 193 194 195 196 197 198 199 23 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 3 258 259 260 7 261 262 263 264 265 266 267 268 269 270 271 19 272 273 274 275 276 277 278 279 280 281 +DEAL:0:3d::locally_owned_dofs: {[0,281]} +DEAL:0:3d::n_locally_owned_dofs: 282 +DEAL:0:3d::n_global_dofs: 282 diff --git a/tests/mpi/hp_unify_dof_indices_12.mpirun=2.with_p4est=true.output b/tests/mpi/hp_unify_dof_indices_12.mpirun=2.with_p4est=true.output new file mode 100644 index 0000000000..be83a47ea3 --- /dev/null +++ b/tests/mpi/hp_unify_dof_indices_12.mpirun=2.with_p4est=true.output @@ -0,0 +1,63 @@ + +DEAL:0:2d::Cell: 0.0 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:0:2d::Cell: 0.1 +DEAL:0:2d:: locally owned +DEAL:0:2d:: 1 9 3 49 10 5 11 12 13 14 15 16 17 18 54 19 20 21 22 23 24 25 26 27 28 +DEAL:0:2d::Cell: 0.2 +DEAL:0:2d:: ghost +DEAL:0:2d:: 2 3 29 50 30 31 32 33 52 34 35 7 36 37 38 39 40 41 42 43 44 45 46 47 48 +DEAL:0:2d::Cell: 0.3 +DEAL:0:2d:: ghost +DEAL:0:2d:: 3 49 50 51 52 53 54 55 56 +DEAL:0:2d::locally_owned_dofs: {[0,28]} +DEAL:0:2d::n_locally_owned_dofs: 29 +DEAL:0:2d::n_global_dofs: 57 +DEAL:0:3d::Cell: 0.0 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:0:3d::Cell: 0.1 +DEAL:0:3d:: locally owned +DEAL:0:3d:: 1 27 3 258 5 28 7 261 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 21 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 277 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +DEAL:0:3d::Cell: 0.2 +DEAL:0:3d:: ghost +DEAL:0:3d:: 2 3 144 259 6 7 145 262 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 59 60 61 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 275 192 193 194 195 196 197 198 199 23 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 +DEAL:0:3d::Cell: 0.3 +DEAL:0:3d:: ghost +DEAL:0:3d:: 3 258 259 260 7 261 262 263 264 265 266 267 268 269 270 271 19 272 273 274 275 276 277 278 279 280 281 +DEAL:0:3d::locally_owned_dofs: {[0,143]} +DEAL:0:3d::n_locally_owned_dofs: 144 +DEAL:0:3d::n_global_dofs: 282 + +DEAL:1:2d::Cell: 0.0 +DEAL:1:2d:: ghost +DEAL:1:2d:: 0 1 2 3 4 5 6 7 8 +DEAL:1:2d::Cell: 0.1 +DEAL:1:2d:: ghost +DEAL:1:2d:: 1 9 3 49 10 5 11 12 13 14 15 16 17 18 54 19 20 21 22 23 24 25 26 27 28 +DEAL:1:2d::Cell: 0.2 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 2 3 29 50 30 31 32 33 52 34 35 7 36 37 38 39 40 41 42 43 44 45 46 47 48 +DEAL:1:2d::Cell: 0.3 +DEAL:1:2d:: locally owned +DEAL:1:2d:: 3 49 50 51 52 53 54 55 56 +DEAL:1:2d::locally_owned_dofs: {[29,56]} +DEAL:1:2d::n_locally_owned_dofs: 28 +DEAL:1:2d::n_global_dofs: 57 +DEAL:1:3d::Cell: 0.0 +DEAL:1:3d:: ghost +DEAL:1:3d:: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +DEAL:1:3d::Cell: 0.1 +DEAL:1:3d:: ghost +DEAL:1:3d:: 1 27 3 258 5 28 7 261 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 21 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 277 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 +DEAL:1:3d::Cell: 0.2 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 2 3 144 259 6 7 145 262 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 59 60 61 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 275 192 193 194 195 196 197 198 199 23 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 +DEAL:1:3d::Cell: 0.3 +DEAL:1:3d:: locally owned +DEAL:1:3d:: 3 258 259 260 7 261 262 263 264 265 266 267 268 269 270 271 19 272 273 274 275 276 277 278 279 280 281 +DEAL:1:3d::locally_owned_dofs: {[144,281]} +DEAL:1:3d::n_locally_owned_dofs: 138 +DEAL:1:3d::n_global_dofs: 282 + -- 2.39.5