]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add new failing testcase.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Sep 2003 14:52:17 +0000 (14:52 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Sep 2003 14:52:17 +0000 (14:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@8034 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/Makefile
tests/bits/mesh_3d_1.cc [new file with mode: 0644]

index c39bf2b314adea2bb4fd4587d4824ca0a9d2cb60..b9e69344a59f121ab54b6991611f13c752646637 100644 (file)
@@ -103,6 +103,7 @@ block_sparse_matrix_1.exe:block_sparse_matrix_1.g.$(OBJEXT) $(libraries)
 hyper_ball_3d.exe       : hyper_ball_3d.g.$(OBJEXT)        $(libraries)
 cylinder.exe            : cylinder.g.$(OBJEXT)             $(libraries)
 coarsening_3d.exe       : coarsening_3d.g.$(OBJEXT)        $(libraries)
+mesh_3d_1.exe           : mesh_3d_1.g.$(OBJEXT)            $(libraries)
 
 
 tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \
@@ -131,7 +132,7 @@ tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \
        parameter_handler_3 parameter_handler_4 \
        parameter_handler_5 \
        sparse_lu_decomposition_1 block_sparse_matrix_1 \
-       hyper_ball_3d cylinder coarsening_3d
+       hyper_ball_3d cylinder coarsening_3d mesh_3d_1
 
 ############################################################
 
diff --git a/tests/bits/mesh_3d_1.cc b/tests/bits/mesh_3d_1.cc
new file mode 100644 (file)
index 0000000..4c0b277
--- /dev/null
@@ -0,0 +1,120 @@
+//----------------------------  mesh_3d_1.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2003 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.
+//
+//----------------------------  mesh_3d_1.cc  ---------------------------
+
+
+// the real reason why coarsening_3d failed: take three cells to form an
+// L, and we end up with an external face between two of them, which
+// however has edges that are shared by the two cells. this creates a
+// major upheaval in the data structures later on (as testified by
+// coarsening_3d), but we can check this fact much earlier already (done
+// here)
+
+
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_reordering.h>
+#include <grid/grid_generator.h>
+
+#include <fstream>
+
+
+
+void create_coarse_grid (Triangulation<3> &coarse_grid)
+{
+  std::vector<Point<3> >    vertices;
+  std::vector<CellData<3> > cells;
+  SubCellData               sub_cell_data;
+  
+  const Point<3> outer_points[8] = { Point<3>(-1,0,0),
+                                     Point<3>(-1,-1,0),
+                                     Point<3>(0,-1,0),
+                                     Point<3>(+1,-1,0),
+                                     Point<3>(+1,0,0),
+                                     Point<3>(+1,+1,0),
+                                     Point<3>(0,+1,0),
+                                     Point<3>(-1,+1,0) };
+
+                                   // first the point in the middle
+                                   // and the rest of those on the
+                                   // upper surface
+  vertices.push_back (Point<3>(0,0,0));
+  for (unsigned int i=0; i<7; ++i)
+    vertices.push_back (outer_points[i]);
+
+                                   // then points on lower surface
+  vertices.push_back (Point<3>(0,0,-1));
+  for (unsigned int i=0; i<7; ++i)
+    vertices.push_back (outer_points[i]
+                        +
+                        Point<3>(0,0,-1));
+
+  const unsigned int n_vertices_per_surface = 8;
+  Assert (vertices.size() == n_vertices_per_surface*2,
+          ExcInternalError());
+    
+  const unsigned int connectivity[3][4]
+    = { { 1, 2, 3, 0 },
+        { 3, 4, 5, 0 },
+        { 0, 5, 6, 7 } };
+  for (unsigned int i=0; i<3; ++i)
+    {
+      CellData<3> cell;
+      for (unsigned int j=0; j<4; ++j)
+        {
+          cell.vertices[j]   = connectivity[i][j];
+          cell.vertices[j+4] = connectivity[i][j]+n_vertices_per_surface;
+        }
+      cells.push_back (cell);
+    }
+
+                                   // finally generate a triangulation
+                                   // out of this
+  GridReordering<3>::reorder_cells (cells);
+  coarse_grid.create_triangulation (vertices, cells, sub_cell_data);
+}
+
+
+int main () 
+{
+  std::ofstream logfile("mesh_3d_1.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  Triangulation<3> coarse_grid;
+  create_coarse_grid (coarse_grid);
+
+                                   // output all lines and faces
+  for (Triangulation<3>::active_cell_iterator cell=coarse_grid.begin_active();
+       cell != coarse_grid.end(); ++cell)
+    {
+      deallog << "Cell = " << cell << std::endl;
+      for (unsigned int i=0; i<GeometryInfo<3>::lines_per_cell; ++i)
+        deallog << "    Line = " << cell->line(i)
+                << " : " << cell->line(i)->vertex_index(0)
+                << " -> " << cell->line(i)->vertex_index(1)
+                << std::endl;
+
+      for (unsigned int i=0; i<GeometryInfo<3>::quads_per_cell; ++i)
+        deallog << "    Quad = " << cell->quad(i)
+                << " : " << cell->quad(i)->vertex_index(0)
+                << " -> " << cell->quad(i)->vertex_index(1)
+                << " -> " << cell->quad(i)->vertex_index(2)
+                << " -> " << cell->quad(i)->vertex_index(3)
+                << std::endl;
+    }
+}
+
+  
+  

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.