]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only test for distorted cells if so instructed by the user.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 20 Feb 2010 00:08:53 +0000 (00:08 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 20 Feb 2010 00:08:53 +0000 (00:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@20656 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/distorted_cells_01.cc
tests/bits/distorted_cells_02.cc
tests/bits/distorted_cells_03.cc
tests/bits/distorted_cells_04.cc
tests/bits/distorted_cells_05.cc
tests/bits/distorted_cells_06.cc
tests/deal.II/grid_hyper_shell.cc
tests/deal.II/grid_in.cc
tests/deal.II/grid_in_02.cc
tests/deal.II/number_cache_02.cc

index cb53cd8f2aad957525ae885de912789162073d2e..5b97d5f35c39f81326923437051a9227ae2be927 100644 (file)
@@ -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<CellData<dim> > cells;
   {
@@ -62,7 +62,7 @@ void check (const unsigned int testcase)
     cells.push_back (cell);
   }
 
-  Triangulation<dim> coarse_grid;
+  Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
 
   bool flag = false;
   try
@@ -72,7 +72,7 @@ void check (const unsigned int testcase)
   catch (typename Triangulation<dim>::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 ()
     }
 }
 
-  
-  
+
+
index a5e92c0cbb38536c898b25b09dc5cc5fd8bdeb96..82e70dc5e47fd6ccbabbaeabd49e7fa25ff64fee 100644 (file)
@@ -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
 template <int dim>
 void check ()
 {
-  Triangulation<dim> coarse_grid;
+  Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
 
   GridIn<dim> 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<dim>::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> ();
 }
 
-  
-  
+
+
index e56ec4ef176ee597582befca650b531f4c9621e8..bce0410c8b6385ae3d3ec62ec26f3b9d39e0d56b 100644 (file)
@@ -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 <int dim>
 void check ()
 {
   MyBoundary<dim> my_boundary;
-  
+
                                   // create a single square/cube
-  Triangulation<dim> coarse_grid;
+  Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
   GridGenerator::hyper_cube (coarse_grid, -1, 1);
 
                                   // set bottom face to use MyBoundary
@@ -96,7 +96,7 @@ void check ()
   catch (typename Triangulation<dim>::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> ();
 }
 
-  
-  
+
+
index c82d443cb68e04deae5608c51ffb2641a555436b..3c39dcca8cb97749c00b1c020aab576ab1309da5 100644 (file)
@@ -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 <int dim>
 void check ()
 {
   MyBoundary<dim> my_boundary;
-  
+
                                   // create a single square/cube
-  Triangulation<dim> coarse_grid;
+  Triangulation<dim> coarse_grid (Triangulation<dim>::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> ();
 }
 
-  
-  
+
+
index 04788f11de007ae8e4a55d1409b48908b9e69bf5..01496f8506bad937765872d24a29044fa2bd801e 100644 (file)
@@ -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 <int dim>
 void check ()
 {
   MyBoundary<dim> my_boundary;
-  
+
                                   // create a single square/cube
-  Triangulation<dim> coarse_grid;
+  Triangulation<dim> coarse_grid (Triangulation<dim>::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> ();
 }
 
-  
-  
+
+
index aadadfb058a0eb7d7ac841d49ff56a3ab14a9a14..85996da34efe1ef3aae5b3ef6c34fa450d4f86d4 100644 (file)
@@ -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 <int dim>
 void check ()
 {
   MyBoundary<dim> my_boundary;
-  
+
                                   // create two cubes
-  Triangulation<dim> coarse_grid;
+  Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
 
   std::vector<unsigned int> sub(dim, 1);
   sub[0] = 2;
   Point<dim> 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<GeometryInfo<dim>::faces_per_cell; ++f)
     for (unsigned int e=0; e<GeometryInfo<dim-1>::faces_per_cell; ++e)
@@ -91,7 +91,7 @@ void check ()
 
       Assert (dcv.distorted_cells.size() == 2,
              ExcInternalError());
-      
+
       typename Triangulation<dim>::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> ();
 }
 
-  
-  
+
+
index fb4909fdaa9f53127e114a10424aec18b51721ea..dd6b3e608d15b0f6bea846658dc539e476a0e28f 100644 (file)
@@ -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<int dim>
 void check (double r1, double r2, unsigned int n, bool)
 {
   Point<dim> center;
-  Triangulation<dim> tria;
+  Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridGenerator::hyper_shell (tria, center, r1, r2, n, true);
   static const HyperShellBoundary<dim> 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<dim>::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;
index 316148b10317250e369e4552a36480f85b29ebfa..49d3c57643749e7595fa8204535ecb9b5e1d399e 100644 (file)
@@ -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 <int dim>
 void test1 ()
-{  
+{
   Triangulation<dim> tria;
   GridIn<dim> 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<dim> tria;
+  Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> 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<int dim>
 void check_file (const std::string name,
                 typename GridIn<dim>::Format format)
 {
-  Triangulation<dim> tria;
+  Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> 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()
index 3c7531d03abcb508f4b35dc91f50c28fbb42713a..78b87972cce78a551c473293058bfcec9d710aa7 100644 (file)
@@ -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<dim> tria;
+  Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   std::ifstream in ("grid_in_02/2d.xda");
index eac4f99f7a37eb65e9954279bee7e76c0b76399d..5c7eb1181763c8f2e2fedd51a3bced3985966b5e 100644 (file)
@@ -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 <int dim>
 void output (const Triangulation<dim> &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<dim> &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 <int dim>
 void test (const char *filename)
 {
   deallog << "Reading " << filename << std::endl;
-  
-  Triangulation<dim> tria;
+
+  Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> 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<dim>::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");

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.