]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 18 Oct 2003 19:18:29 +0000 (19:18 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 18 Oct 2003 19:18:29 +0000 (19:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@8106 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/Makefile
tests/deal.II/face_orientations_3d.cc [new file with mode: 0644]
tests/results/i686-pc-linux-gnu+gcc2.95/deal.II/face_orientations_3d.output [new file with mode: 0644]
tests/results/i686-pc-linux-gnu+gcc3.2/deal.II/face_orientations_3d.output [new file with mode: 0644]
tests/results/sparc-sun-solaris2.7+gcc2.95/deal.II/face_orientations_3d.output [new file with mode: 0644]

index 0e62d50923d63ef77712f379bc92b090b384d5b5..be0a05c0bf7cb27fbec0977081408c07af27c489 100644 (file)
@@ -50,6 +50,7 @@ subdomain_ids.exe            : subdomain_ids.g.$(OBJEXT)     $(lib-1d) $(lib-2d)
 filtered_iterator.exe        : filtered_iterator.g.$(OBJEXT)           $(lib-2d)           $(libraries)
 grid_in.exe                  : grid_in.g.$(OBJEXT)                     $(lib-2d)           $(libraries)
 grid_in_3d.exe               : grid_in_3d.g.$(OBJEXT)                            $(lib-3d) $(libraries)
+face_orientations_3d.exe     : face_orientations_3d.g.$(OBJEXT)                  $(lib-3d) $(libraries)
 
 
 tests = $(sort \
@@ -58,7 +59,7 @@ tests = $(sort \
           matrices error_estimator intergrid_constraints intergrid_map \
           wave-test-3 dof_renumbering support_point_map filtered_matrix \
          boundaries sparsity_pattern grid_tools subdomain_ids \
-         filtered_iterator grid_out grid_in grid_in_3d)
+         filtered_iterator grid_out grid_in grid_in_3d face_orientations_3d)
 
 ############################################################
 
diff --git a/tests/deal.II/face_orientations_3d.cc b/tests/deal.II/face_orientations_3d.cc
new file mode 100644 (file)
index 0000000..df97b95
--- /dev/null
@@ -0,0 +1,86 @@
+//----------------------------  face_orientations_3d.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2002, 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.
+//
+//----------------------------  face_orientations_3d.cc  ---------------------------
+
+
+// just like grid_in_3d, but count the number of misoriented faces in
+// the meshes that can be oriented
+
+#include <dofs/dof_handler.h>
+#include <grid/tria.h>
+#include <grid/tria_boundary.h>
+#include <grid/tria_boundary_lib.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_out.h>
+#include <grid/grid_in.h>
+#include <grid/grid_generator.h>
+#include <base/logstream.h>
+
+#include <fstream>
+
+
+std::ofstream logfile("face_orientations_3d.output");
+
+
+void test (const char *filename)
+{
+  deallog << "Reading " << filename << std::endl;
+  
+  Triangulation<3> tria;
+  GridIn<3> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in (filename);
+
+  gi.read_xda (in);
+  deallog << "  " << tria.n_active_hexs() << " active cells" << std::endl;
+  deallog << "  " << tria.n_active_quads() << " active faces" << std::endl;
+
+  unsigned int misoriented_faces = 0;
+  for (Triangulation<3>::active_cell_iterator cell=tria.begin_active();
+       cell!=tria.end(); ++cell)
+    for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
+      if (cell->face_orientation (f) == false)
+        {
+          ++misoriented_faces;
+
+                                           // check that the face is
+                                           // correctly oriented from
+                                           // the other side at
+                                           // least. note that if this
+                                           // face is misoriented,
+                                           // then there must be a
+                                           // neighbor over there
+          Assert (cell->neighbor(f)
+                  ->face_orientation(cell->neighbor_of_neighbor(f))
+                  == true,
+                  ExcInternalError());
+        }
+  deallog << "  " << misoriented_faces << " misoriented faces" << std::endl;
+}
+
+
+int main ()
+{
+  logfile.precision (2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  test ("grid_in_3d_1.in");
+  test ("grid_in_3d_2.in");
+  test ("grid_in_3d_3.in");
+  test ("grid_in_3d_4.in");
+
+  test ("grid_in_3d_evil_0.in");
+  test ("grid_in_3d_evil_4.in");
+}
+
diff --git a/tests/results/i686-pc-linux-gnu+gcc2.95/deal.II/face_orientations_3d.output b/tests/results/i686-pc-linux-gnu+gcc2.95/deal.II/face_orientations_3d.output
new file mode 100644 (file)
index 0000000..f0346ba
--- /dev/null
@@ -0,0 +1,25 @@
+
+DEAL::Reading grid_in_3d_1.in
+DEAL::  16480 active cells
+DEAL::  52008 active faces
+DEAL::  9600 misoriented faces
+DEAL::Reading grid_in_3d_2.in
+DEAL::  360 active cells
+DEAL::  1218 active faces
+DEAL::  498 misoriented faces
+DEAL::Reading grid_in_3d_3.in
+DEAL::  2 active cells
+DEAL::  11 active faces
+DEAL::  0 misoriented faces
+DEAL::Reading grid_in_3d_4.in
+DEAL::  13824 active cells
+DEAL::  42816 active faces
+DEAL::  1728 misoriented faces
+DEAL::Reading grid_in_3d_evil_0.in
+DEAL::  10 active cells
+DEAL::  50 active faces
+DEAL::  0 misoriented faces
+DEAL::Reading grid_in_3d_evil_4.in
+DEAL::  10 active cells
+DEAL::  50 active faces
+DEAL::  0 misoriented faces
diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/deal.II/face_orientations_3d.output b/tests/results/i686-pc-linux-gnu+gcc3.2/deal.II/face_orientations_3d.output
new file mode 100644 (file)
index 0000000..f0346ba
--- /dev/null
@@ -0,0 +1,25 @@
+
+DEAL::Reading grid_in_3d_1.in
+DEAL::  16480 active cells
+DEAL::  52008 active faces
+DEAL::  9600 misoriented faces
+DEAL::Reading grid_in_3d_2.in
+DEAL::  360 active cells
+DEAL::  1218 active faces
+DEAL::  498 misoriented faces
+DEAL::Reading grid_in_3d_3.in
+DEAL::  2 active cells
+DEAL::  11 active faces
+DEAL::  0 misoriented faces
+DEAL::Reading grid_in_3d_4.in
+DEAL::  13824 active cells
+DEAL::  42816 active faces
+DEAL::  1728 misoriented faces
+DEAL::Reading grid_in_3d_evil_0.in
+DEAL::  10 active cells
+DEAL::  50 active faces
+DEAL::  0 misoriented faces
+DEAL::Reading grid_in_3d_evil_4.in
+DEAL::  10 active cells
+DEAL::  50 active faces
+DEAL::  0 misoriented faces
diff --git a/tests/results/sparc-sun-solaris2.7+gcc2.95/deal.II/face_orientations_3d.output b/tests/results/sparc-sun-solaris2.7+gcc2.95/deal.II/face_orientations_3d.output
new file mode 100644 (file)
index 0000000..f0346ba
--- /dev/null
@@ -0,0 +1,25 @@
+
+DEAL::Reading grid_in_3d_1.in
+DEAL::  16480 active cells
+DEAL::  52008 active faces
+DEAL::  9600 misoriented faces
+DEAL::Reading grid_in_3d_2.in
+DEAL::  360 active cells
+DEAL::  1218 active faces
+DEAL::  498 misoriented faces
+DEAL::Reading grid_in_3d_3.in
+DEAL::  2 active cells
+DEAL::  11 active faces
+DEAL::  0 misoriented faces
+DEAL::Reading grid_in_3d_4.in
+DEAL::  13824 active cells
+DEAL::  42816 active faces
+DEAL::  1728 misoriented faces
+DEAL::Reading grid_in_3d_evil_0.in
+DEAL::  10 active cells
+DEAL::  50 active faces
+DEAL::  0 misoriented faces
+DEAL::Reading grid_in_3d_evil_4.in
+DEAL::  10 active cells
+DEAL::  50 active faces
+DEAL::  0 misoriented faces

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.