]> https://gitweb.dealii.org/ - dealii.git/commitdiff
The meshes we create here are distorted. Right now we can't fix it,
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 15 Jul 2009 14:55:26 +0000 (14:55 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 15 Jul 2009 14:55:26 +0000 (14:55 +0000)
but at least catch the exception that was thrown.

git-svn-id: https://svn.dealii.org/trunk@19088 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/grid_hyper_shell.cc

index 9cea5745ab3ecbfe44d5011c5f1c7c56e7f1bcb6..fb4909fdaa9f53127e114a10424aec18b51721ea 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2007, 2008 by the deal.II authors
+//    Copyright (C) 2007, 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
@@ -19,6 +19,7 @@
 #include <grid/tria.h>
 #include <grid/grid_generator.h>
 #include <grid/grid_out.h>
+#include <grid/grid_tools.h>
 #include <base/logstream.h>
 #include <cmath>
 #include <cstdlib>
@@ -39,7 +40,24 @@ void check (double r1, double r2, unsigned int n, bool)
   static const HyperShellBoundary<dim> boundary(center);
   tria.set_boundary(0, boundary);
 
-  tria.refine_global(2);
+  for (unsigned int i=0; i<2; ++i)
+    {
+      try
+       {
+         tria.refine_global(1);
+       }
+      catch (typename Triangulation<dim>::DistortedCellList &dcv)
+       {
+         deallog << "Found " << dcv.distorted_cells.size()
+                 << " distorted cells" << std::endl;
+      
+         typename Triangulation<dim>::DistortedCellList
+           subset = GridTools::fix_up_distorted_child_cells (dcv,
+                                                             tria);
+         Assert (subset.distorted_cells.size() == 0,
+                 ExcInternalError());
+       }
+    }
   
   GridOut grid_out;
   GridOutFlags::DX flags;

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.