]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Small test case for which neighbor_child_on_subface fails.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Oct 2004 15:12:28 +0000 (15:12 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Oct 2004 15:12:28 +0000 (15:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@9725 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/mesh_3d_17.cc [new file with mode: 0644]
tests/bits/two_cubes.inp [new file with mode: 0644]

diff --git a/tests/bits/mesh_3d_17.cc b/tests/bits/mesh_3d_17.cc
new file mode 100644 (file)
index 0000000..80fdbe6
--- /dev/null
@@ -0,0 +1,102 @@
+// check TriaCellAccessor::neighbor_child_on_subface
+
+#include "../tests.h"
+#include <base/quadrature_lib.h>
+#include <lac/vector.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 <grid/grid_out.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_accessor.h>
+#include <fe/fe_q.h>
+
+#include <fstream>
+#include <iostream>
+
+using namespace std;
+
+void check_this (Triangulation<3> &tria)
+{
+  FE_Q<3> fe(1);
+  
+  DoFHandler<3> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  const unsigned int dim=3;
+  DoFHandler<dim>::active_cell_iterator
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
+  for (unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no)
+    for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
+      {
+       const DoFHandler<dim>::face_iterator
+         face=cell->face(face_no);
+           
+       if (!face->at_boundary())
+         {
+           Assert (cell->neighbor(face_no).state() == IteratorState::valid,
+                   ExcInternalError());
+           DoFHandler<dim>::cell_iterator neighbor=
+             cell->neighbor(face_no);
+
+           if (face->has_children())
+             {
+               const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
+           
+               deallog << "cell_no=" << cell_no << ", face_no=" << face_no << endl;
+               deallog << "  cell->face_orientation(face_no)="
+                       << cell->face_orientation(face_no) << endl;
+               deallog << "  neighbor2=" << neighbor2 << endl;
+               deallog << "  neighbor->face_orientation(neighbor2)="
+                       << neighbor->face_orientation(neighbor2) << endl;
+               
+               
+               for (unsigned int subface_no=0;
+                    subface_no<GeometryInfo<dim>::subfaces_per_face;
+                    ++subface_no)
+                 {
+                   deallog << "subface_no=" << subface_no << endl;
+                   DoFHandler<dim>::cell_iterator neighbor_child=
+                     cell->neighbor_child_on_subface(face_no, subface_no);
+                 }
+             }
+         }
+      }
+}
+
+
+
+void check (Triangulation<3> &tria)
+{
+  tria.begin_active()->set_refine_flag ();
+  tria.execute_coarsening_and_refinement ();
+  
+  if (false)
+    {
+      GridOut grid_out;
+      ofstream grid_stream("grid.gnuplot");
+      grid_out.write_gnuplot(tria, grid_stream);
+    }
+  
+  check_this (tria);
+}
+
+int main () 
+{
+  ofstream logfile("mesh_3d_17.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  
+  Triangulation<3> coarse_grid;
+  GridIn<3> in;
+  in.attach_triangulation(coarse_grid);
+  ifstream ucd_file("two_cubes.inp");
+  in.read_ucd(ucd_file);
+  ucd_file.close();
+  
+  check (coarse_grid);
+}
+
diff --git a/tests/bits/two_cubes.inp b/tests/bits/two_cubes.inp
new file mode 100644 (file)
index 0000000..4fc03cd
--- /dev/null
@@ -0,0 +1,19 @@
+#  9  10 11
+#  6  7  8
+# 3  4  5
+# 0  1  2
+12 2 0 0 0
+0  -1   0   1
+1   0   0   1
+2   1   0   1
+3  -1   1   1
+4   0   1   1
+5   1   1   1
+6  -1   0   0
+7   0   0   0
+8   1   0   0
+9  -1   1   0
+10  0   1   0
+11  1   1   0
+0 0 hex 1 2 5 4 7 8 11 10
+1 0 hex 1 4 3 0 7 10 9 6

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.