From: Wolfgang Bangerth Date: Fri, 12 Oct 2012 16:20:34 +0000 (+0000) Subject: New test. X-Git-Tag: v8.0.0~1953 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7882be4fdcebd1b53b25bb3d498a5a6488848a21;p=dealii.git New test. git-svn-id: https://svn.dealii.org/trunk@27088 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/number_cache_03.cc b/tests/deal.II/number_cache_03.cc new file mode 100644 index 0000000000..f2bf47bdcc --- /dev/null +++ b/tests/deal.II/number_cache_03.cc @@ -0,0 +1,113 @@ +//---------------------------- number_cache_03.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2008, 2012 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. +// +//---------------------------- number_cache_03.cc --------------------------- + + +// test that we correctly compute the number of lines, quads, hexes, +// etc and store them in the number cache of the Triangulation +// class. compare a pristine mesh with one that has first been +// globally refined and then globally coarsened +// +// this is sort of a pathological case because there now is a level in +// the hierarchy but it is completely unused and only consists of raw +// cells + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +std::ofstream logfile("number_cache_03/output"); + + + +template +void output (const Triangulation &tria) +{ + + deallog << " " << tria.n_active_cells() << std::endl; + deallog << " " << tria.n_cells() << std::endl; + deallog << " " << tria.n_active_lines() << std::endl; + deallog << " " << tria.n_lines() << std::endl; + deallog << " " << tria.n_active_quads() << std::endl; + deallog << " " << tria.n_quads() << std::endl; + deallog << " " << tria.n_active_hexs() << std::endl; + deallog << " " << tria.n_hexs() << std::endl; + + for (unsigned int i=0; i +void test () +{ + deallog << dim << "d" << std::endl; + + Triangulation tria; + GridGenerator::hyper_cube (tria); + + output (tria); + + tria.refine_global(1); + + for (typename Triangulation::active_cell_iterator cell = tria.begin_active(); + cell != tria.end(); ++cell) + cell->set_coarsen_flag (); + tria.execute_coarsening_and_refinement (); + + output (tria); +} + + +int main () +{ + deallog << std::setprecision (2); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1> (); + test<2> (); + test<3> (); +} + diff --git a/tests/deal.II/number_cache_03/cmp/generic b/tests/deal.II/number_cache_03/cmp/generic new file mode 100644 index 0000000000..e974b9c1b3 --- /dev/null +++ b/tests/deal.II/number_cache_03/cmp/generic @@ -0,0 +1,76 @@ + +DEAL::1d +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 0 +DEAL:: 0 +DEAL:: 0 +DEAL:: 0 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 0 +DEAL:: 0 +DEAL:: 0 +DEAL:: 0 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL::2d +DEAL:: 1 +DEAL:: 1 +DEAL:: 4 +DEAL:: 4 +DEAL:: 1 +DEAL:: 1 +DEAL:: 0 +DEAL:: 0 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 4 +DEAL:: 4 +DEAL:: 1 +DEAL:: 1 +DEAL:: 0 +DEAL:: 0 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL::3d +DEAL:: 1 +DEAL:: 1 +DEAL:: 12 +DEAL:: 12 +DEAL:: 6 +DEAL:: 6 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 12 +DEAL:: 12 +DEAL:: 6 +DEAL:: 6 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1 +DEAL:: 1