]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Oct 2012 03:08:44 +0000 (03:08 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Oct 2012 03:08:44 +0000 (03:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@27068 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/grid_out_03.cc [new file with mode: 0644]
tests/deal.II/grid_out_03/cmp/generic [new file with mode: 0644]

diff --git a/tests/deal.II/grid_out_03.cc b/tests/deal.II/grid_out_03.cc
new file mode 100644 (file)
index 0000000..6954885
--- /dev/null
@@ -0,0 +1,63 @@
+//----------------------------  grid_out_03.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2002, 2003, 2004, 2005, 2008, 2012 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.
+//
+//----------------------------  grid_out_03.cc  ---------------------------
+
+// make sure that we write boundary lines marked with a non-zero boundary
+// indicator correctly in UCD format
+
+#include "../tests.h"
+#include <deal.II/base/geometry_info.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_boundary.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_out.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/base/logstream.h>
+
+#include <fstream>
+#include <iomanip>
+
+
+std::ofstream logfile("grid_out_03/output");
+
+
+template <int dim>
+void test ()
+{
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube (tria);
+  tria.begin_active()->line(0)->set_boundary_indicator(1);
+  tria.begin_active()->face(2*dim-1)->set_boundary_indicator(2);
+
+  GridOut grid_out;
+  GridOutFlags::Ucd flags;
+  flags.write_lines = flags.write_faces = true;
+  grid_out.set_flags (flags);
+  grid_out.write_ucd (tria, logfile);
+}
+
+
+int main ()
+{
+  deallog << std::setprecision (2);
+  logfile << std::setprecision (2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<2> ();
+  test<3> ();
+}
+
diff --git a/tests/deal.II/grid_out_03/cmp/generic b/tests/deal.II/grid_out_03/cmp/generic
new file mode 100644 (file)
index 0000000..53428aa
--- /dev/null
@@ -0,0 +1,21 @@
+
+4 3 0 0 0
+1  0.0 0.0 0
+2  1.0 0.0 0
+3  0.0 1.0 0
+4  1.0 1.0 0
+1 0 quad    1 2 4 3 
+2  1  line    1 3 
+3  2  line    3 4 
+8 3 0 0 0
+1  0.0 0.0 0.0
+2  1.0 0.0 0.0
+3  0.0 1.0 0.0
+4  1.0 1.0 0.0
+5  0.0 0.0 1.0
+6  1.0 0.0 1.0
+7  0.0 1.0 1.0
+8  1.0 1.0 1.0
+1 0 hex     1 2 6 5 3 4 8 7 
+2  2  quad    5 6 8 7 
+2  1  line    1 3 

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.