From: Wolfgang Bangerth Date: Sat, 20 Feb 2010 00:08:53 +0000 (+0000) Subject: Only test for distorted cells if so instructed by the user. X-Git-Tag: v8.0.0~6419 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96a007e47b340f40e198ee4d305057373c439dea;p=dealii.git Only test for distorted cells if so instructed by the user. git-svn-id: https://svn.dealii.org/trunk@20656 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/distorted_cells_01.cc b/tests/bits/distorted_cells_01.cc index cb53cd8f2a..5b97d5f35c 100644 --- a/tests/bits/distorted_cells_01.cc +++ b/tests/bits/distorted_cells_01.cc @@ -1,8 +1,8 @@ //---------------------------- distorted_cells_01.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -52,7 +52,7 @@ void check (const unsigned int testcase) default: Assert (false, ExcNotImplemented()); } - + std::vector > cells; { @@ -62,7 +62,7 @@ void check (const unsigned int testcase) cells.push_back (cell); } - Triangulation coarse_grid; + Triangulation coarse_grid (Triangulation::none, true); bool flag = false; try @@ -72,7 +72,7 @@ void check (const unsigned int testcase) catch (typename Triangulation::DistortedCellList &dcv) { flag = true; - + deallog << dcv.distorted_cells.size() << " distorted cells" << std::endl; Assert (dcv.distorted_cells.front() == coarse_grid.begin(0), @@ -83,7 +83,7 @@ void check (const unsigned int testcase) } -int main () +int main () { std::ofstream logfile("distorted_cells_01/output"); deallog.attach(logfile); @@ -98,5 +98,5 @@ int main () } } - - + + diff --git a/tests/bits/distorted_cells_02.cc b/tests/bits/distorted_cells_02.cc index a5e92c0cbb..82e70dc5e4 100644 --- a/tests/bits/distorted_cells_02.cc +++ b/tests/bits/distorted_cells_02.cc @@ -1,8 +1,8 @@ //---------------------------- distorted_cells_02.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -34,14 +34,14 @@ template void check () { - Triangulation coarse_grid; + Triangulation coarse_grid (Triangulation::none, true); GridIn gi; std::ifstream in (dim == 2 ? "distorted_cells_02/2d" : "distorted_cells_02/3d"); - + gi.attach_triangulation (coarse_grid); - + bool flag = false; try { @@ -50,7 +50,7 @@ void check () catch (typename Triangulation::DistortedCellList &dcv) { flag = true; - + deallog << dcv.distorted_cells.size() << " distorted cells" << std::endl; Assert (dcv.distorted_cells.front() == coarse_grid.begin(0), @@ -63,7 +63,7 @@ void check () } -int main () +int main () { std::ofstream logfile("distorted_cells_02/output"); deallog.attach(logfile); @@ -74,5 +74,5 @@ int main () check<3> (); } - - + + diff --git a/tests/bits/distorted_cells_03.cc b/tests/bits/distorted_cells_03.cc index e56ec4ef17..bce0410c8b 100644 --- a/tests/bits/distorted_cells_03.cc +++ b/tests/bits/distorted_cells_03.cc @@ -1,8 +1,8 @@ //---------------------------- distorted_cells_03.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -74,9 +74,9 @@ template void check () { MyBoundary my_boundary; - + // create a single square/cube - Triangulation coarse_grid; + Triangulation coarse_grid (Triangulation::none, true); GridGenerator::hyper_cube (coarse_grid, -1, 1); // set bottom face to use MyBoundary @@ -96,7 +96,7 @@ void check () catch (typename Triangulation::DistortedCellList &dcv) { flag = true; - + deallog << dcv.distorted_cells.size() << " distorted cells" << std::endl; Assert (dcv.distorted_cells.front() == coarse_grid.begin(0), @@ -117,7 +117,7 @@ void check () } -int main () +int main () { std::ofstream logfile("distorted_cells_03/output"); deallog.attach(logfile); @@ -128,5 +128,5 @@ int main () check<3> (); } - - + + diff --git a/tests/bits/distorted_cells_04.cc b/tests/bits/distorted_cells_04.cc index c82d443cb6..3c39dcca8c 100644 --- a/tests/bits/distorted_cells_04.cc +++ b/tests/bits/distorted_cells_04.cc @@ -1,8 +1,8 @@ //---------------------------- distorted_cells_04.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -71,9 +71,9 @@ template void check () { MyBoundary my_boundary; - + // create a single square/cube - Triangulation coarse_grid; + Triangulation coarse_grid (Triangulation::none, true); GridGenerator::hyper_cube (coarse_grid, -1, 1); // set bottom face to use MyBoundary @@ -107,7 +107,7 @@ void check () } -int main () +int main () { std::ofstream logfile("distorted_cells_04/output"); deallog.attach(logfile); @@ -118,5 +118,5 @@ int main () check<3> (); } - - + + diff --git a/tests/bits/distorted_cells_05.cc b/tests/bits/distorted_cells_05.cc index 04788f11de..01496f8506 100644 --- a/tests/bits/distorted_cells_05.cc +++ b/tests/bits/distorted_cells_05.cc @@ -1,8 +1,8 @@ //---------------------------- distorted_cells_05.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -73,9 +73,9 @@ template void check () { MyBoundary my_boundary; - + // create a single square/cube - Triangulation coarse_grid; + Triangulation coarse_grid (Triangulation::none, true); GridGenerator::hyper_cube (coarse_grid, -1, 1); // set bottom face to use MyBoundary @@ -109,7 +109,7 @@ void check () } -int main () +int main () { std::ofstream logfile("distorted_cells_05/output"); deallog.attach(logfile); @@ -120,5 +120,5 @@ int main () check<3> (); } - - + + diff --git a/tests/bits/distorted_cells_06.cc b/tests/bits/distorted_cells_06.cc index aadadfb058..85996da34e 100644 --- a/tests/bits/distorted_cells_06.cc +++ b/tests/bits/distorted_cells_06.cc @@ -1,8 +1,8 @@ //---------------------------- distorted_cells_06.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2003, 2004, 2005, 2009 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -60,15 +60,15 @@ template void check () { MyBoundary my_boundary; - + // create two cubes - Triangulation coarse_grid; + Triangulation coarse_grid (Triangulation::none, true); std::vector sub(dim, 1); sub[0] = 2; Point p1 (-1,0,0), p2(1,1,1); GridGenerator::subdivided_hyper_rectangle(coarse_grid, sub, p1, p2, true); - + // set bottom middle edge to use MyBoundary for (unsigned int f=0; f::faces_per_cell; ++f) for (unsigned int e=0; e::faces_per_cell; ++e) @@ -91,7 +91,7 @@ void check () Assert (dcv.distorted_cells.size() == 2, ExcInternalError()); - + typename Triangulation::DistortedCellList subset = GridTools::fix_up_distorted_child_cells (dcv, coarse_grid); @@ -112,7 +112,7 @@ void check () } -int main () +int main () { std::ofstream logfile("distorted_cells_06/output"); deallog.attach(logfile); @@ -122,5 +122,5 @@ int main () check<3> (); } - - + + diff --git a/tests/deal.II/grid_hyper_shell.cc b/tests/deal.II/grid_hyper_shell.cc index fb4909fdaa..dd6b3e608d 100644 --- a/tests/deal.II/grid_hyper_shell.cc +++ b/tests/deal.II/grid_hyper_shell.cc @@ -1,8 +1,8 @@ //---------------------------------------------------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2007, 2008, 2009 by the deal.II authors +// Copyright (C) 2007, 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -35,7 +35,7 @@ template void check (double r1, double r2, unsigned int n, bool) { Point center; - Triangulation tria; + Triangulation tria (Triangulation::none, true); GridGenerator::hyper_shell (tria, center, r1, r2, n, true); static const HyperShellBoundary boundary(center); tria.set_boundary(0, boundary); @@ -50,7 +50,7 @@ void check (double r1, double r2, unsigned int n, bool) { deallog << "Found " << dcv.distorted_cells.size() << " distorted cells" << std::endl; - + typename Triangulation::DistortedCellList subset = GridTools::fix_up_distorted_child_cells (dcv, tria); @@ -58,7 +58,7 @@ void check (double r1, double r2, unsigned int n, bool) ExcInternalError()); } } - + GridOut grid_out; GridOutFlags::DX flags; flags.write_faces = true; diff --git a/tests/deal.II/grid_in.cc b/tests/deal.II/grid_in.cc index 316148b103..49d3c57643 100644 --- a/tests/deal.II/grid_in.cc +++ b/tests/deal.II/grid_in.cc @@ -1,6 +1,6 @@ //---------------------------- grid_in.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // // Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 by the deal.II authors // @@ -33,13 +33,13 @@ std::ofstream logfile("grid_in/output"); template void test1 () -{ +{ Triangulation tria; GridIn gi; gi.attach_triangulation (tria); std::ifstream in ("grid_in/2d.inp"); gi.read_ucd (in); - + GridOut grid_out; grid_out.set_flags (GridOutFlags::Ucd(true)); grid_out.write_ucd (tria, logfile); @@ -65,7 +65,7 @@ void test2 () // grid_in_02 testcase fail when using this // input file, but grid_in_02/2d.xda is a // corrected input file. - Triangulation tria; + Triangulation tria (Triangulation::none, true); GridIn gi; gi.attach_triangulation (tria); std::ifstream in ("grid_in/2d.xda"); @@ -81,7 +81,7 @@ void test2 () deallog << dcv.distorted_cells.size() << " cells are distorted." << std::endl; } - + int hash = 0; int index = 0; @@ -102,7 +102,7 @@ void test3 () gi.read ("grid_in/2d.nc"); GridOut grid_out; - std::ofstream gnufile("grid_in_2d.gnuplot"); + std::ofstream gnufile("grid_in_2d.gnuplot"); grid_out.write_gnuplot (tria, gnufile); } @@ -111,7 +111,7 @@ template void check_file (const std::string name, typename GridIn::Format format) { - Triangulation tria; + Triangulation tria (Triangulation::none, true); GridIn gi; gi.attach_triangulation (tria); try @@ -124,7 +124,7 @@ void check_file (const std::string name, deallog << dcv.distorted_cells.size() << " cells are distorted." << std::endl; } - + deallog << name << '\t' << tria.n_vertices() << '\t' << tria.n_cells() diff --git a/tests/deal.II/grid_in_02.cc b/tests/deal.II/grid_in_02.cc index 3c7531d03a..78b87972cc 100644 --- a/tests/deal.II/grid_in_02.cc +++ b/tests/deal.II/grid_in_02.cc @@ -1,8 +1,8 @@ //---------------------------- grid_in_02.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -49,7 +49,7 @@ void test2 () // available, program was killed // before), with the new one it // takes less than 8 seconds - Triangulation tria; + Triangulation tria (Triangulation::none, true); GridIn gi; gi.attach_triangulation (tria); std::ifstream in ("grid_in_02/2d.xda"); diff --git a/tests/deal.II/number_cache_02.cc b/tests/deal.II/number_cache_02.cc index eac4f99f7a..5c7eb11817 100644 --- a/tests/deal.II/number_cache_02.cc +++ b/tests/deal.II/number_cache_02.cc @@ -1,8 +1,8 @@ //---------------------------- number_cache_02.cc --------------------------- // $Id$ -// Version: $Name$ +// Version: $Name$ // -// Copyright (C) 2008, 2009 by the deal.II authors +// Copyright (C) 2008, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -38,7 +38,7 @@ std::ofstream logfile("number_cache_02/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; @@ -57,13 +57,13 @@ void output (const Triangulation &tria) deallog << " " << tria.n_active_lines(i) << std::endl; deallog << " " << tria.n_lines(i) << std::endl; } - + if (dim == 2) { deallog << " " << tria.n_active_quads(i) << std::endl; deallog << " " << tria.n_quads(i) << std::endl; } - + if (dim == 3) { deallog << " " << tria.n_active_hexs(i) << std::endl; @@ -77,8 +77,8 @@ template void test (const char *filename) { deallog << "Reading " << filename << std::endl; - - Triangulation tria; + + Triangulation tria (Triangulation::none, true); GridIn gi; gi.attach_triangulation (tria); std::ifstream in (filename); @@ -104,7 +104,7 @@ void test (const char *filename) } output (tria); - + // now refine a few cells and output again deallog << " Refining..." << std::endl; typename Triangulation::active_cell_iterator @@ -126,7 +126,7 @@ int main () deallog.threshold_double(1.e-10); test<2> ("grid_in/2d.xda"); - + test<3> ("grid_in_3d/1.in"); test<3> ("grid_in_3d/2.in"); test<3> ("grid_in_3d/3.in");