parameter_handler_2.exe : parameter_handler_2.g.$(OBJEXT) $(libraries)
sparse_lu_decomposition_1.exe: sparse_lu_decomposition_1.g.$(OBJEXT) $(libraries)
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)
tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \
roy_1 \
denis_1 \
unit_support_points parameter_handler_1 parameter_handler_2 \
- sparse_lu_decomposition_1 block_sparse_matrix_1
+ sparse_lu_decomposition_1 block_sparse_matrix_1 \
+ hyper_ball_3d cylinder
############################################################
--- /dev/null
+//---------------------------- cylinder.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.
+//
+//---------------------------- cylinder.cc ---------------------------
+
+// similar to the hyper_ball_3d test, but for the cylinder grid. here,
+// the cause for the failure was different, though: the description of
+// the cells was wrong, and they were not sent through the
+// GridReordering class which would have cured the problem.
+
+
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_generator.h>
+#include <fstream>
+
+
+
+int main ()
+{
+ std::ofstream logfile("cylinder.output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ logfile.precision (2);
+
+ // generate a cylinder
+ Triangulation<3> tria;
+ GridGenerator::cylinder (tria, std::sqrt(2.));
+
+ // output all faces. here, we
+ // should have 18 (two layers of
+ // cells, each with 4 outer faces,
+ // plus 5 faces each for the top
+ // and bottom of the cylinder)
+ unsigned int external_faces = 0;
+ for (Triangulation<3>::face_iterator face=tria.begin_face();
+ face!=tria.end_face(); ++face)
+ {
+ deallog << face << " "
+ << (int)face->boundary_indicator() << " "
+ << '<' << face->vertex(0) << '>' << std::endl
+ << " <" << face->vertex(1) << '>' << std::endl
+ << " <" << face->vertex(2) << '>' << std::endl
+ << " <" << face->vertex(3) << '>' << std::endl;
+ if (face->at_boundary())
+ ++external_faces;
+ }
+
+ deallog << "External faces: " << external_faces << std::endl;
+
+ Assert (external_faces == 18, ExcInternalError());
+
+ return 0;
+}
--- /dev/null
+//---------------------------- hyper_ball_3d.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.
+//
+//---------------------------- hyper_ball_3d.cc ---------------------------
+
+// test that the grid generated by GridGenerator::hyper_ball<3> has
+// the right number of external faces. this was not always the case,
+// due to a bug in the 3d grid reordering code that didn't find a
+// valid reordering, though we know that there is one. when not
+// calling the grid reordering, the triangulation can generate a mesh,
+// but it will have internal faces with the "external" 255 marker,
+// leading to more external faces than one originally wanted
+
+
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_generator.h>
+#include <fstream>
+
+
+
+int main ()
+{
+ std::ofstream logfile("hyper_ball_3d.output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ logfile.precision (2);
+
+ // generate a hyperball in 3d
+ Triangulation<3> tria;
+ GridGenerator::hyper_ball (tria, Point<3>(), std::sqrt(3.));
+
+ // output all faces. there should
+ // be 6 external ones, but there
+ // used to be a bug in the
+ // triangulation code that
+ // generated more than that, with
+ // some of them internal to the
+ // ball
+ unsigned int external_faces = 0;
+ for (Triangulation<3>::face_iterator face=tria.begin_face();
+ face!=tria.end_face(); ++face)
+ {
+ deallog << face << " "
+ << (int)face->boundary_indicator() << " "
+ << face->vertex_index(0)
+ << " <" << face->vertex(0) << '>'
+ << std::endl
+ << " " << face->vertex_index(1)
+ << " <" << face->vertex(1) << '>'
+ << std::endl
+ << " " << face->vertex_index(2)
+ << " <" << face->vertex(2) << '>'
+ << std::endl
+ << " " << face->vertex_index(3)
+ << " <" << face->vertex(3) << '>'
+ << std::endl;
+ if (face->at_boundary())
+ ++external_faces;
+ }
+
+ deallog << "External faces: " << external_faces << std::endl;
+
+ Assert (external_faces == 6, ExcInternalError());
+
+ return 0;
+}