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 \
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)
############################################################
--- /dev/null
+//---------------------------- 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");
+}
+
--- /dev/null
+
+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
--- /dev/null
+
+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
--- /dev/null
+
+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