--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2005 - 2015 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Test grid generation functions in GridGenerator for spacedim>dim
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <fstream>
+#include <iomanip>
+
+
+template<int dim, int spacedim>
+void test(std::ostream &out)
+{
+ Point<spacedim> p1;
+ p1[0] = 2.;
+ if (dim>1) p1[1] = -1.;
+ if (dim>2) p1[2] = 0.;
+ Point<spacedim> p2;
+ p2[0] = 3.;
+ if (dim>1) p2[1] = 2.;
+ if (dim>2) p2[2] = 4.;
+ Point<spacedim> p3;
+ p3[0] = 2.;
+ if (dim>1) p3[1] = 1.;
+ if (dim>2) p3[2] = 4.;
+
+ GridOut go;
+ GridOut::OutputFormat format = GridOut::msh;
+
+ if (true)
+ {
+ deallog << "hyper_cube" << std::endl;
+ Triangulation<dim,spacedim> tr;
+ GridGenerator::hyper_cube(tr, 3., 7.);
+ if (tr.n_cells() > 0)
+ go.write(tr, out, format);
+ }
+ if (true)
+ {
+ deallog << "subdivided_hyper_cube" << std::endl;
+ Triangulation<dim,spacedim> tr;
+ GridGenerator::subdivided_hyper_cube(tr, 3, 1., 7.);
+ if (tr.n_cells() > 0)
+ go.write(tr, out, format);
+ }
+ if (true)
+ {
+ deallog << "hyper_rectangle" << std::endl;
+ Triangulation<dim,spacedim> tr;
+ GridGenerator::hyper_rectangle(tr, p1, p2, true);
+ if (tr.n_cells() > 0)
+ go.write(tr, out, format);
+ }
+ if (true)
+ {
+ deallog << "subdivided_hyper_rectangle" << std::endl;
+ Triangulation<dim,spacedim> tr;
+ std::vector<unsigned int> sub(dim);
+ sub[0] = 2;
+ if (dim>1) sub[1] = 3;
+ if (dim>2) sub[2] = 4;
+ GridGenerator::subdivided_hyper_rectangle(tr, sub, p1, p2, true);
+ if (tr.n_cells() > 0)
+ go.write(tr, out, format);
+ }
+}
+
+
+int main()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+// deallog.push("1d");
+// test<1,2>(logfile);
+// deallog.pop();
+// deallog.push("2d");
+// test<1,3>(logfile);
+// deallog.pop();
+ deallog.push("2-3");
+ test<2,3>(logfile);
+ deallog.pop();
+}
--- /dev/null
+
+DEAL:2-3::hyper_cube
+$NOD
+4
+1 3.00000 3.00000 0.00000
+2 7.00000 3.00000 0.00000
+3 3.00000 7.00000 0.00000
+4 7.00000 7.00000 0.00000
+$ENDNOD
+$ELM
+1
+1 3 0 0 4 1 2 4 3
+$ENDELM
+DEAL:2-3::subdivided_hyper_cube
+$NOD
+16
+1 1.00000 1.00000 0.00000
+2 3.00000 1.00000 0.00000
+3 5.00000 1.00000 0.00000
+4 7.00000 1.00000 0.00000
+5 1.00000 3.00000 0.00000
+6 3.00000 3.00000 0.00000
+7 5.00000 3.00000 0.00000
+8 7.00000 3.00000 0.00000
+9 1.00000 5.00000 0.00000
+10 3.00000 5.00000 0.00000
+11 5.00000 5.00000 0.00000
+12 7.00000 5.00000 0.00000
+13 1.00000 7.00000 0.00000
+14 3.00000 7.00000 0.00000
+15 5.00000 7.00000 0.00000
+16 7.00000 7.00000 0.00000
+$ENDNOD
+$ELM
+9
+1 3 0 0 4 1 2 6 5
+2 3 0 0 4 2 3 7 6
+3 3 0 0 4 3 4 8 7
+4 3 0 0 4 5 6 10 9
+5 3 0 0 4 6 7 11 10
+6 3 0 0 4 7 8 12 11
+7 3 0 0 4 9 10 14 13
+8 3 0 0 4 10 11 15 14
+9 3 0 0 4 11 12 16 15
+$ENDELM
+DEAL:2-3::hyper_rectangle
+$NOD
+4
+1 2.00000 -1.00000 0.00000
+2 3.00000 -1.00000 0.00000
+3 2.00000 2.00000 0.00000
+4 3.00000 2.00000 0.00000
+$ENDNOD
+$ELM
+1
+1 3 0 0 4 1 2 4 3
+$ENDELM
+DEAL:2-3::subdivided_hyper_rectangle
+$NOD
+12
+1 2.00000 -1.00000 0.00000
+2 2.50000 -1.00000 0.00000
+3 3.00000 -1.00000 0.00000
+4 2.00000 0.00000 0.00000
+5 2.50000 0.00000 0.00000
+6 3.00000 0.00000 0.00000
+7 2.00000 1.00000 0.00000
+8 2.50000 1.00000 0.00000
+9 3.00000 1.00000 0.00000
+10 2.00000 2.00000 0.00000
+11 2.50000 2.00000 0.00000
+12 3.00000 2.00000 0.00000
+$ENDNOD
+$ELM
+6
+1 3 1 0 4 1 2 5 4
+2 3 1 0 4 2 3 6 5
+3 3 3 0 4 4 5 8 7
+4 3 3 0 4 5 6 9 8
+5 3 3 0 4 7 8 11 10
+6 3 3 0 4 8 9 12 11
+$ENDELM