From cac219d5e0160f58a4c3dbce5c81760a771f100f Mon Sep 17 00:00:00 2001 From: heister Date: Thu, 2 May 2013 01:28:28 +0000 Subject: [PATCH] add 2d test (does not trigger the right error) git-svn-id: https://svn.dealii.org/trunk@29425 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/distributed_grids/2d_refinement_07.cc | 74 +++++++++++++++++++ .../2d_refinement_07/cmp/generic | 21 ++++++ 2 files changed, 95 insertions(+) create mode 100644 tests/distributed_grids/2d_refinement_07.cc create mode 100644 tests/distributed_grids/2d_refinement_07/cmp/generic diff --git a/tests/distributed_grids/2d_refinement_07.cc b/tests/distributed_grids/2d_refinement_07.cc new file mode 100644 index 0000000000..61292d4e6f --- /dev/null +++ b/tests/distributed_grids/2d_refinement_07.cc @@ -0,0 +1,74 @@ +//--------------------------------------------------------------------------- +// $Id: 3d_refinement_01.cc 29075 2013-03-27 15:07:57Z heister $ +// Version: $Name$ +// +// Copyright (C) 2008, 2009 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. +// +//--------------------------------------------------------------------------- + + +// Test that we abort if you refine further than p4est::max_level + +#include "../tests.h" +#include "coarse_grid_common.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +template +void test(std::ostream& /*out*/) +{ + parallel::distributed::Triangulation tr(MPI_COMM_WORLD); + + GridGenerator::hyper_cube(tr); + for (unsigned int i=0;i<35;++i) + { + std::cout << "cells: " << tr.n_active_cells() << " level:" << tr.n_levels() << std::endl; + + typename parallel::distributed::Triangulation::cell_iterator it; + it=tr.begin_active(); + while (it->level()(tr.n_levels()-1)) + ++it; + + + it->set_refine_flag(); + try + { + tr.execute_coarsening_and_refinement (); + } + catch (ExceptionBase &e) + { + deallog << e.get_exc_name() << std::endl; + } + } + +} + + +int main(int argc, char *argv[]) +{ + deal_II_exceptions::disable_abort_on_exception(); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + + std::ofstream logfile("2d_refinement_07/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + deallog.push("2d"); + test<2>(logfile); + deallog.pop(); +} diff --git a/tests/distributed_grids/2d_refinement_07/cmp/generic b/tests/distributed_grids/2d_refinement_07/cmp/generic new file mode 100644 index 0000000000..eb291e1225 --- /dev/null +++ b/tests/distributed_grids/2d_refinement_07/cmp/generic @@ -0,0 +1,21 @@ + +DEAL:3d::cells: 1 level:1 +DEAL:3d::cells: 8 level:2 +DEAL:3d::cells: 15 level:3 +DEAL:3d::cells: 22 level:4 +DEAL:3d::cells: 29 level:5 +DEAL:3d::cells: 36 level:6 +DEAL:3d::cells: 43 level:7 +DEAL:3d::cells: 50 level:8 +DEAL:3d::cells: 57 level:9 +DEAL:3d::cells: 64 level:10 +DEAL:3d::cells: 71 level:11 +DEAL:3d::cells: 78 level:12 +DEAL:3d::cells: 85 level:13 +DEAL:3d::cells: 92 level:14 +DEAL:3d::cells: 99 level:15 +DEAL:3d::cells: 106 level:16 +DEAL:3d::cells: 113 level:17 +DEAL:3d::cells: 120 level:18 +DEAL:3d::cells: 127 level:19 +DEAL:3d::ExcMessage("Fatal Error: maximum refinement level of p4est reached.") -- 2.39.5