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

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

diff --git a/tests/deal.II/grid_out_04.cc b/tests/deal.II/grid_out_04.cc
new file mode 100644 (file)
index 0000000..79e9f71
--- /dev/null
@@ -0,0 +1,63 @@
+//----------------------------  grid_out_04.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_04.cc  ---------------------------
+
+// make sure that we write boundary lines marked with a non-zero boundary
+// indicator correctly in MSH 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_04/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::Msh flags;
+  flags.write_lines = flags.write_faces = true;
+  grid_out.set_flags (flags);
+  grid_out.write_msh (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_04/cmp/generic b/tests/deal.II/grid_out_04/cmp/generic
new file mode 100644 (file)
index 0000000..5403b23
--- /dev/null
@@ -0,0 +1,31 @@
+
+$NOD
+4
+1  0.0 0.0 0
+2  1.0 0.0 0
+3  0.0 1.0 0
+4  1.0 1.0 0
+$ENDNOD
+$ELM
+3
+1 3 0 0 4 1 2 4 3 
+2 1 1 1 2 1 3
+3 1 2 2 2 3 4
+$ENDELM
+$NOD
+8
+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
+$ENDNOD
+$ELM
+3
+1 5 0 0 8 1 2 6 5 3 4 8 7 
+2 3 2 2 4 5 6 8 7
+2 1 1 1 2  1 3
+$ENDELM

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.