From 85a6dc9eae16430cc8967d3ed09e25482baf15db Mon Sep 17 00:00:00 2001 From: heister Date: Sat, 25 May 2013 08:24:07 +0000 Subject: [PATCH] add failing test git-svn-id: https://svn.dealii.org/trunk@29586 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/grid/subdomain_id_01.cc | 72 ++++++++++++++++++++++++++ tests/grid/subdomain_id_01/cmp/generic | 10 ++++ 2 files changed, 82 insertions(+) create mode 100644 tests/grid/subdomain_id_01.cc create mode 100644 tests/grid/subdomain_id_01/cmp/generic diff --git a/tests/grid/subdomain_id_01.cc b/tests/grid/subdomain_id_01.cc new file mode 100644 index 0000000000..0881a69417 --- /dev/null +++ b/tests/grid/subdomain_id_01.cc @@ -0,0 +1,72 @@ +//---------------------------- refine_and_coarsen_3d.cc --------------------------- +// $Id: refine_and_coarsen_for_parents_02.cc 23710 2011-05-17 04:50:10Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 2010 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//----------------------- refine_and_coarsen_for_parents_02.cc ---------------------- + + +// check (level)subdomain_id(). Should be =0. + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + +template +void check (TRIA & tr) +{ + typename TRIA::cell_iterator cell = tr.begin(), + endc = tr.end(); + + for (; cell!=endc; ++cell) + { + deallog << cell->level_subdomain_id() + << " " << cell->subdomain_id() << std::endl; + } + + deallog << "OK" << std::endl; +} + + +int main (int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + std::ofstream logfile("subdomain_id_01/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + Triangulation<2> tria; + + deallog << tria.locally_owned_subdomain() << std::endl; + + + parallel::distributed::Triangulation<2> tria2(MPI_COMM_WORLD); + GridGenerator::hyper_cube (tria); + tria.refine_global (2); + GridGenerator::hyper_cube (tria2); + tria2.refine_global (2); + check(tria); + check(tria2); +} + + + diff --git a/tests/grid/subdomain_id_01/cmp/generic b/tests/grid/subdomain_id_01/cmp/generic new file mode 100644 index 0000000000..521a63a515 --- /dev/null +++ b/tests/grid/subdomain_id_01/cmp/generic @@ -0,0 +1,10 @@ + +DEAL::n_active_cells: 4 +DEAL::n_active_cells: 5 +DEAL::OK for 1d +DEAL::n_active_cells: 16 +DEAL::n_active_cells: 28 +DEAL::OK for 2d +DEAL::n_active_cells: 64 +DEAL::n_active_cells: 176 +DEAL::OK for 3d -- 2.39.5