From 791d6428c8d62f3e3f218e6bfcd84b529805137a Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sun, 8 Aug 2021 17:40:48 -0400 Subject: [PATCH] add broken test --- tests/multigrid/transfer_matrix_free_14.cc | 94 +++++++++++++++++++ ...ix_free_14.with_p4est=true.mpirun=2.output | 19 ++++ 2 files changed, 113 insertions(+) create mode 100644 tests/multigrid/transfer_matrix_free_14.cc create mode 100644 tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output diff --git a/tests/multigrid/transfer_matrix_free_14.cc b/tests/multigrid/transfer_matrix_free_14.cc new file mode 100644 index 0000000000..e683c5e67a --- /dev/null +++ b/tests/multigrid/transfer_matrix_free_14.cc @@ -0,0 +1,94 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2016 - 2020 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. +// +// --------------------------------------------------------------------- + + +// document a bug in MGLevelGlobalTransfer in 3d: + +/* +An error occurred in line <341> of file +<../source/multigrid/mg_level_global_transfer.cc> in function void +dealii::MGLevelGlobalTransfer >::fill_and_communicate_copy_indices(const +dealii::DoFHandler&) [with int dim = 3; int spacedim = 3; +Number = double] The violated condition was: + ::dealii::deal_II_exceptions::internals::compare_for_equality(this->copy_indices_level_mine.back().n_rows(), +0) Additional information: Dimension 2 not equal to 0. +*/ + +#include + +#include + +#include + +#include +#include + +#include "../tests.h" + +template +void +check() +{ + parallel::distributed::Triangulation tr( + MPI_COMM_WORLD, + Triangulation::limit_level_difference_at_vertices, + typename parallel::distributed::Triangulation::Settings( + parallel::distributed::Triangulation< + dim>::mesh_reconstruction_after_repartitioning | + parallel::distributed::Triangulation< + dim>::construct_multigrid_hierarchy)); + + GridGenerator::hyper_cube(tr); + + tr.refine_global(2); + + // coarsen a few cells: + for (const auto &cell : tr.active_cell_iterators()) + { + if (cell->is_artificial()) + continue; + const std::string id = cell->parent()->id().to_string(); + if (id == "0_1:0" || id == "0_1:1" || id == "0_1:2" || id == "0_1:3") + cell->set_coarsen_flag(); + } + + tr.execute_coarsening_and_refinement(); + + FE_Q fe(1); + DoFHandler mgdof(tr); + MGTransferMatrixFree transfer_mf; + + mgdof.distribute_dofs(fe); + mgdof.distribute_mg_dofs(); + + deallog << "n_dofs = " << mgdof.n_dofs() << std::endl; + + transfer_mf.build(mgdof); + + tr.coarsen_global(); + deallog << "OK" << std::endl; +} + + +int +main(int argc, char **argv) +{ + Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1); + MPILogInitAll all; + + check<2>(); + check<3>(); +} diff --git a/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output b/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output new file mode 100644 index 0000000000..ee2f46465a --- /dev/null +++ b/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output @@ -0,0 +1,19 @@ + +DEAL::n_dofs = 50 +DEAL::OK +DEAL::n_dofs = 18 +DEAL::OK +DEAL::n_dofs = 8 +DEAL::OK +DEAL::n_dofs = 8 +DEAL::OK +DEAL:: +DEAL::n_dofs = 375 +DEAL::OK +DEAL::n_dofs = 81 +DEAL::OK +DEAL::n_dofs = 24 +DEAL::OK +DEAL::n_dofs = 24 +DEAL::OK +DEAL:: -- 2.39.5