--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2002 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// read a 3d file in the VTK format
+
+#include "../tests.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_in.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/base/logstream.h>
+
+#include <fstream>
+#include <iomanip>
+#include <string>
+
+std::ofstream logfile("output");
+
+
+template<int dim>
+void check_file (const std::string name,
+ typename GridIn<dim>::Format format)
+{
+ Triangulation<dim> tria;
+ GridIn<dim> gi;
+ gi.attach_triangulation (tria);
+ gi.read(name, format);
+ deallog << '\t' << tria.n_vertices()
+ << '\t' << tria.n_cells()
+ << std::endl;
+
+ GridOut grid_out;
+ grid_out.write_gnuplot (tria, deallog.get_file_stream());
+}
+
+void filename_resolution()
+{
+ check_file<3> (std::string(SOURCE_DIR "/grid_in_vtk_3d_02.vtk"), GridIn<3>::vtk);
+}
+
+
+int main ()
+{
+ deallog << std::setprecision (2);
+ logfile << std::setprecision (2);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ filename_resolution();
+}
+
--- /dev/null
+
+DEAL:: 20 4
+0.0 0.0 10. 0 0
+10. 0.0 10. 0 0
+10. 10. 10. 0 0
+0.0 10. 10. 0 0
+0.0 0.0 10. 0 0
+
+0.0 0.0 0.0 0 0
+10. 0.0 0.0 0 0
+10. 10. 0.0 0 0
+0.0 10. 0.0 0 0
+0.0 0.0 0.0 0 0
+
+0.0 0.0 10. 0 0
+0.0 0.0 0.0 0 0
+
+10. 0.0 10. 0 0
+10. 0.0 0.0 0 0
+
+10. 10. 10. 0 0
+10. 10. 0.0 0 0
+
+0.0 10. 10. 0 0
+0.0 10. 0.0 0 0
+
+10. 0.0 10. 0 0
+20. 0.0 10. 0 0
+20. 10. 10. 0 0
+10. 10. 10. 0 0
+10. 0.0 10. 0 0
+
+10. 0.0 0.0 0 0
+20. 0.0 0.0 0 0
+20. 10. 0.0 0 0
+10. 10. 0.0 0 0
+10. 0.0 0.0 0 0
+
+10. 0.0 10. 0 0
+10. 0.0 0.0 0 0
+
+20. 0.0 10. 0 0
+20. 0.0 0.0 0 0
+
+20. 10. 10. 0 0
+20. 10. 0.0 0 0
+
+10. 10. 10. 0 0
+10. 10. 0.0 0 0
+
+10. 10. 10. 0 0
+20. 10. 10. 0 0
+20. 20. 10. 0 0
+10. 20. 10. 0 0
+10. 10. 10. 0 0
+
+10. 10. 0.0 0 0
+20. 10. 0.0 0 0
+20. 20. 0.0 0 0
+10. 20. 0.0 0 0
+10. 10. 0.0 0 0
+
+10. 10. 10. 0 0
+10. 10. 0.0 0 0
+
+20. 10. 10. 0 0
+20. 10. 0.0 0 0
+
+20. 20. 10. 0 0
+20. 20. 0.0 0 0
+
+10. 20. 10. 0 0
+10. 20. 0.0 0 0
+
+20. 10. 10. 0 0
+30. 10. 10. 0 0
+30. 20. 10. 0 0
+20. 20. 10. 0 0
+20. 10. 10. 0 0
+
+20. 10. 0.0 0 0
+30. 10. 0.0 0 0
+30. 20. 0.0 0 0
+20. 20. 0.0 0 0
+20. 10. 0.0 0 0
+
+20. 10. 10. 0 0
+20. 10. 0.0 0 0
+
+30. 10. 10. 0 0
+30. 10. 0.0 0 0
+
+30. 20. 10. 0 0
+30. 20. 0.0 0 0
+
+20. 20. 10. 0 0
+20. 20. 0.0 0 0
+
--- /dev/null
+# vtk DataFile Version 3.0
+write mesh on file
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 20 double
+0.000000 0.000000 10.000000
+10.000000 0.000000 10.000000
+10.000000 10.000000 10.000000
+0.000000 10.000000 10.000000
+20.000000 0.000000 10.000000
+20.000000 10.000000 10.000000
+30.000000 10.000000 10.000000
+10.000000 20.000000 10.000000
+20.000000 20.000000 10.000000
+30.000000 20.000000 10.000000
+0.000000 0.000000 0.000000
+10.000000 0.000000 0.000000
+10.000000 10.000000 0.000000
+0.000000 10.000000 0.000000
+20.000000 0.000000 0.000000
+20.000000 10.000000 0.000000
+30.000000 10.000000 0.000000
+10.000000 20.000000 0.000000
+20.000000 20.000000 0.000000
+30.000000 20.000000 0.000000
+CELLS 4 36
+8 10 11 12 13 0 1 2 3
+8 11 14 15 12 1 4 5 2
+8 12 15 18 17 2 5 8 7
+8 15 16 19 18 5 6 9 8
+CELL_TYPES 4
+12
+12
+12
+12
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2002 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// read a 3d file in the VTK format
+
+#include "../tests.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_in.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/base/logstream.h>
+
+#include <fstream>
+#include <iomanip>
+#include <string>
+
+std::ofstream logfile("output");
+
+
+template<int dim>
+void check_file (const std::string name,
+ typename GridIn<dim>::Format format)
+{
+ Triangulation<dim> tria;
+ GridIn<dim> gi;
+ gi.attach_triangulation (tria);
+ gi.read(name, format);
+ deallog << '\t' << tria.n_vertices()
+ << '\t' << tria.n_cells()
+ << std::endl;
+
+ GridOut grid_out;
+ grid_out.write_gnuplot (tria, deallog.get_file_stream());
+}
+
+void filename_resolution()
+{
+ check_file<3> (std::string(SOURCE_DIR "/grid_in_vtk_3d_03.vtk"), GridIn<3>::vtk);
+}
+
+
+int main ()
+{
+ deallog << std::setprecision (2);
+ logfile << std::setprecision (2);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ filename_resolution();
+}
+
--- /dev/null
+
+DEAL:: 20 4
+0.0 0.0 10. 0 1
+10. 0.0 10. 0 1
+10. 10. 10. 0 1
+0.0 10. 10. 0 1
+0.0 0.0 10. 0 1
+
+0.0 0.0 0.0 0 1
+10. 0.0 0.0 0 1
+10. 10. 0.0 0 1
+0.0 10. 0.0 0 1
+0.0 0.0 0.0 0 1
+
+0.0 0.0 10. 0 1
+0.0 0.0 0.0 0 1
+
+10. 0.0 10. 0 1
+10. 0.0 0.0 0 1
+
+10. 10. 10. 0 1
+10. 10. 0.0 0 1
+
+0.0 10. 10. 0 1
+0.0 10. 0.0 0 1
+
+10. 0.0 10. 0 0
+20. 0.0 10. 0 0
+20. 10. 10. 0 0
+10. 10. 10. 0 0
+10. 0.0 10. 0 0
+
+10. 0.0 0.0 0 0
+20. 0.0 0.0 0 0
+20. 10. 0.0 0 0
+10. 10. 0.0 0 0
+10. 0.0 0.0 0 0
+
+10. 0.0 10. 0 0
+10. 0.0 0.0 0 0
+
+20. 0.0 10. 0 0
+20. 0.0 0.0 0 0
+
+20. 10. 10. 0 0
+20. 10. 0.0 0 0
+
+10. 10. 10. 0 0
+10. 10. 0.0 0 0
+
+10. 10. 10. 0 0
+20. 10. 10. 0 0
+20. 20. 10. 0 0
+10. 20. 10. 0 0
+10. 10. 10. 0 0
+
+10. 10. 0.0 0 0
+20. 10. 0.0 0 0
+20. 20. 0.0 0 0
+10. 20. 0.0 0 0
+10. 10. 0.0 0 0
+
+10. 10. 10. 0 0
+10. 10. 0.0 0 0
+
+20. 10. 10. 0 0
+20. 10. 0.0 0 0
+
+20. 20. 10. 0 0
+20. 20. 0.0 0 0
+
+10. 20. 10. 0 0
+10. 20. 0.0 0 0
+
+20. 10. 10. 0 0
+30. 10. 10. 0 0
+30. 20. 10. 0 0
+20. 20. 10. 0 0
+20. 10. 10. 0 0
+
+20. 10. 0.0 0 0
+30. 10. 0.0 0 0
+30. 20. 0.0 0 0
+20. 20. 0.0 0 0
+20. 10. 0.0 0 0
+
+20. 10. 10. 0 0
+20. 10. 0.0 0 0
+
+30. 10. 10. 0 0
+30. 10. 0.0 0 0
+
+30. 20. 10. 0 0
+30. 20. 0.0 0 0
+
+20. 20. 10. 0 0
+20. 20. 0.0 0 0
+
--- /dev/null
+# vtk DataFile Version 3.0
+write mesh on file
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 20 double
+0.000000 0.000000 10.000000
+10.000000 0.000000 10.000000
+10.000000 10.000000 10.000000
+0.000000 10.000000 10.000000
+20.000000 0.000000 10.000000
+20.000000 10.000000 10.000000
+30.000000 10.000000 10.000000
+10.000000 20.000000 10.000000
+20.000000 20.000000 10.000000
+30.000000 20.000000 10.000000
+0.000000 0.000000 0.000000
+10.000000 0.000000 0.000000
+10.000000 10.000000 0.000000
+0.000000 10.000000 0.000000
+20.000000 0.000000 0.000000
+20.000000 10.000000 0.000000
+30.000000 10.000000 0.000000
+10.000000 20.000000 0.000000
+20.000000 20.000000 0.000000
+30.000000 20.000000 0.000000
+CELLS 4 36
+8 10 11 12 13 0 1 2 3
+8 11 14 15 12 1 4 5 2
+8 12 15 18 17 2 5 8 7
+8 15 16 19 18 5 6 9 8
+CELL_TYPES 4
+12
+12
+12
+12
+CELL_DATA 4
+SCALARS MaterialID double 1
+LOOKUP_TABLE default
+1.000000
+2.000000
+3.000000
+4.000000