From 049365fe1fae2bff7a9d93100c3338d51409db0a Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 26 Jan 2016 09:29:54 +0100 Subject: [PATCH] add test --- tests/metis/metis_04.cc | 72 +++++++++++++++++++++++++++++++++++++ tests/metis/metis_04.output | 40 +++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 tests/metis/metis_04.cc create mode 100644 tests/metis/metis_04.output diff --git a/tests/metis/metis_04.cc b/tests/metis/metis_04.cc new file mode 100644 index 0000000000..476e03ef9b --- /dev/null +++ b/tests/metis/metis_04.cc @@ -0,0 +1,72 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2004 - 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. +// +// --------------------------------------------------------------------- + + + +// check GridTools::partition_triangulation with too many subdomains + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template +void test () +{ + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation); + triangulation.refine_global (1); + { + triangulation.begin_active()->set_refine_flag(); + triangulation.execute_coarsening_and_refinement (); + } + + for (unsigned int procs=1; procs<20; ++procs) + { + deallog << " procs = " << procs << std::endl; + GridTools::partition_triangulation (procs, triangulation); + { + typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); + for (; cell!=triangulation.end(); ++cell) + { + deallog << cell->subdomain_id() << " "; + } + deallog << std::endl; + } + } + deallog << "OK" << std::endl; +} + + + +int main () +{ + initlog(); + + test<2> (); +} diff --git a/tests/metis/metis_04.output b/tests/metis/metis_04.output new file mode 100644 index 0000000000..753e2b4819 --- /dev/null +++ b/tests/metis/metis_04.output @@ -0,0 +1,40 @@ + +DEAL:: procs = 1 +DEAL::0 0 0 0 0 0 0 +DEAL:: procs = 2 +DEAL::0 1 0 1 0 1 0 +DEAL:: procs = 3 +DEAL::0 1 0 2 2 1 1 +DEAL:: procs = 4 +DEAL::0 2 0 3 1 2 1 +DEAL:: procs = 5 +DEAL::1 3 0 2 2 4 3 +DEAL:: procs = 6 +DEAL::1 3 0 5 1 5 2 +DEAL:: procs = 7 +DEAL::2 3 0 6 2 5 4 +DEAL:: procs = 8 +DEAL::1 5 0 7 3 4 2 +DEAL:: procs = 9 +DEAL::3 3 3 3 3 3 3 +DEAL:: procs = 10 +DEAL::4 4 4 4 4 4 4 +DEAL:: procs = 11 +DEAL::10 10 10 10 10 10 10 +DEAL:: procs = 12 +DEAL::11 11 11 11 11 11 11 +DEAL:: procs = 13 +DEAL::2 2 2 2 2 2 2 +DEAL:: procs = 14 +DEAL::9 9 9 9 9 9 9 +DEAL:: procs = 15 +DEAL::6 6 6 6 6 6 6 +DEAL:: procs = 16 +DEAL::7 7 7 7 7 7 7 +DEAL:: procs = 17 +DEAL::7 7 7 7 7 7 7 +DEAL:: procs = 18 +DEAL::8 8 8 8 8 8 8 +DEAL:: procs = 19 +DEAL::8 8 8 8 8 8 8 +DEAL::OK -- 2.39.5