From 3c21a6facc53a7d3614619741bd3139193566e0d Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 18 Jan 2016 22:13:40 -0500 Subject: [PATCH] add failing test --- tests/multigrid/transfer_prebuilt_04.cc | 99 +++++++++++++++++++ .../transfer_prebuilt_04.mpirun=2.output | 11 +++ .../transfer_prebuilt_04.mpirun=3.output | 11 +++ 3 files changed, 121 insertions(+) create mode 100644 tests/multigrid/transfer_prebuilt_04.cc create mode 100644 tests/multigrid/transfer_prebuilt_04.mpirun=2.output create mode 100644 tests/multigrid/transfer_prebuilt_04.mpirun=3.output diff --git a/tests/multigrid/transfer_prebuilt_04.cc b/tests/multigrid/transfer_prebuilt_04.cc new file mode 100644 index 0000000000..8f4d34548b --- /dev/null +++ b/tests/multigrid/transfer_prebuilt_04.cc @@ -0,0 +1,99 @@ +// --------------------------------------------------------------------- +// +// 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. +// +// --------------------------------------------------------------------- + + +// Deadlock reported by Kronbichler (github +// https://github.com/dealii/dealii/issues/2051) with 3 processes +// in MgTransferPrebuilt + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + + +template +void check() +{ + FE_Q fe(1); + + parallel::distributed::Triangulation + tr(MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + parallel::distributed::Triangulation::construct_multigrid_hierarchy); + GridGenerator::subdivided_hyper_cube (tr, 3); + for (unsigned int cycle=0; cycle<(dim == 2 ? 10 : 7); ++cycle) + { + // adaptive refinement into a circle + for (typename Triangulation::active_cell_iterator cell=tr.begin_active(); cell != tr.end(); ++cell) + if (cell->is_locally_owned() && + cell->vertex(0).norm() < 1e-10) + cell->set_refine_flag(); + tr.execute_coarsening_and_refinement(); + + deallog << "no. cells: " << tr.n_global_active_cells() << " on " + << tr.n_global_levels() << " levels" << std::endl; + + DoFHandler mgdof(tr); + mgdof.distribute_dofs(fe); + mgdof.distribute_mg_dofs(fe); + + ConstraintMatrix hanging_node_constraints; + IndexSet relevant_dofs; + DoFTools::extract_locally_relevant_dofs(mgdof, relevant_dofs); + hanging_node_constraints.reinit(relevant_dofs); + DoFTools::make_hanging_node_constraints(mgdof, hanging_node_constraints); + hanging_node_constraints.close(); + + MGConstrainedDoFs mg_constrained_dofs; + ZeroFunction zero_function; + typename FunctionMap::type dirichlet_boundary; + dirichlet_boundary[0] = &zero_function; + mg_constrained_dofs.initialize(mgdof, dirichlet_boundary); + + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + + if (0) + { + std::ofstream grid_output (("out"+Utilities::to_string(myid)+".svg").c_str()); + GridOut grid_out; + GridOutFlags::Svg flags; + flags.label_level_subdomain_id = true; + flags.coloring = GridOutFlags::Svg::level_subdomain_id; + flags.convert_level_number_to_height = true; + grid_out.set_flags(flags); + + grid_out.write_svg (tr, grid_output); + } + + MGTransferPrebuilt > + transfer_ref(hanging_node_constraints, mg_constrained_dofs); + transfer_ref.build_matrices(mgdof); + } +} + +int main(int argc, char **argv) +{ + Utilities::MPI::MPI_InitFinalize mpi(argc, argv); + mpi_initlog(); + + check<2>(); +} diff --git a/tests/multigrid/transfer_prebuilt_04.mpirun=2.output b/tests/multigrid/transfer_prebuilt_04.mpirun=2.output new file mode 100644 index 0000000000..2df36ef18f --- /dev/null +++ b/tests/multigrid/transfer_prebuilt_04.mpirun=2.output @@ -0,0 +1,11 @@ + +DEAL::no. cells: 12 on 2 levels +DEAL::no. cells: 15 on 3 levels +DEAL::no. cells: 18 on 4 levels +DEAL::no. cells: 21 on 5 levels +DEAL::no. cells: 24 on 6 levels +DEAL::no. cells: 27 on 7 levels +DEAL::no. cells: 30 on 8 levels +DEAL::no. cells: 33 on 9 levels +DEAL::no. cells: 36 on 10 levels +DEAL::no. cells: 39 on 11 levels diff --git a/tests/multigrid/transfer_prebuilt_04.mpirun=3.output b/tests/multigrid/transfer_prebuilt_04.mpirun=3.output new file mode 100644 index 0000000000..2df36ef18f --- /dev/null +++ b/tests/multigrid/transfer_prebuilt_04.mpirun=3.output @@ -0,0 +1,11 @@ + +DEAL::no. cells: 12 on 2 levels +DEAL::no. cells: 15 on 3 levels +DEAL::no. cells: 18 on 4 levels +DEAL::no. cells: 21 on 5 levels +DEAL::no. cells: 24 on 6 levels +DEAL::no. cells: 27 on 7 levels +DEAL::no. cells: 30 on 8 levels +DEAL::no. cells: 33 on 9 levels +DEAL::no. cells: 36 on 10 levels +DEAL::no. cells: 39 on 11 levels -- 2.39.5