]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 10 Jul 2009 21:05:34 +0000 (21:05 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 10 Jul 2009 21:05:34 +0000 (21:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@19059 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/distorted_cells_02.cc [new file with mode: 0644]
tests/bits/distorted_cells_02/2d [new file with mode: 0644]
tests/bits/distorted_cells_02/3d [new file with mode: 0644]
tests/bits/distorted_cells_02/cmp/generic [new file with mode: 0644]

diff --git a/tests/bits/distorted_cells_02.cc b/tests/bits/distorted_cells_02.cc
new file mode 100644 (file)
index 0000000..a5e92c0
--- /dev/null
@@ -0,0 +1,78 @@
+//----------------------------  distorted_cells_02.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2003, 2004, 2005, 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.
+//
+//----------------------------  distorted_cells_02.cc  ---------------------------
+
+
+// check that indeed Triangulation::create_triangulation throws an
+// exception if we have distorted cells. this test is like the _01
+// case except that it reads the mesh from a file
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <base/quadrature_lib.h>
+#include <grid/tria.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_reordering.h>
+#include <grid/grid_in.h>
+#include <dofs/dof_handler.h>
+#include <fe/fe_q.h>
+#include <fe/fe_values.h>
+
+#include <fstream>
+
+
+template <int dim>
+void check ()
+{
+  Triangulation<dim> coarse_grid;
+
+  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
+    {
+      gi.read_ucd (in);
+    }
+  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),
+             ExcInternalError());
+    }
+
+  Assert (flag == true, ExcInternalError());
+  Assert (coarse_grid.n_levels() == 1, ExcInternalError());
+  Assert (coarse_grid.n_active_cells() == 1, ExcInternalError());
+}
+
+
+int main () 
+{
+  std::ofstream logfile("distorted_cells_02/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  check<2> ();
+  check<3> ();
+}
+
+  
+  
diff --git a/tests/bits/distorted_cells_02/2d b/tests/bits/distorted_cells_02/2d
new file mode 100644 (file)
index 0000000..1a53889
--- /dev/null
@@ -0,0 +1,6 @@
+4 1 0 0 0 
+1 0 0 0
+2 1 0 0 
+3 0 1 0
+4 1 1 0
+1 0 quad 1 2 3 4
diff --git a/tests/bits/distorted_cells_02/3d b/tests/bits/distorted_cells_02/3d
new file mode 100644 (file)
index 0000000..dd37099
--- /dev/null
@@ -0,0 +1,10 @@
+8 1 0 0 0
+1 0 0 0
+2 1 0 0 
+3 0 1 0
+4 1 1 0
+5 0 0 1
+6 1 0 1 
+7 0 1 1
+8 1 1 1
+1 0 hex 1 2 3 4 5 6 7 8
diff --git a/tests/bits/distorted_cells_02/cmp/generic b/tests/bits/distorted_cells_02/cmp/generic
new file mode 100644 (file)
index 0000000..09b3dbd
--- /dev/null
@@ -0,0 +1,3 @@
+
+DEAL::1 distorted cells
+DEAL::1 distorted cells

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.