static void hyper_L (Triangulation<dim> &tria,
const double left = -1.,
const double right= 1.);
+
+ /**
+ * Initialize the given
+ * Triangulation with a hypercube
+ * with a slit. The slot goes
+ * from the middle of the top
+ * boundary to the middle of the
+ * area.
+ */
+ template <int dim>
+ static void hyper_cube_slit (Triangulation<dim> &tria,
+ const double left = 0.,
+ const double right= 1.);
};
+template <>
+void GridGenerator::hyper_cube_slit<> (Triangulation<1> &,
+ const double,
+ const double) {
+ Assert (false, ExcInternalError());
+};
+
+
+
template <>
void GridGenerator::hyper_L<> (Triangulation<1> &,
const double,
+template <>
+void GridGenerator::hyper_cube_slit<> (Triangulation<2> &tria,
+ const double left,
+ const double right) {
+ const double rl2=(right+left)/2;
+ const Point<2> vertices[10] = { Point<2>(left, left ),
+ Point<2>(rl2, left ),
+ Point<2>(rl2, rl2 ),
+ Point<2>(left, rl2 ),
+ Point<2>(right,left ),
+ Point<2>(right,rl2 ),
+ Point<2>(rl2, right),
+ Point<2>(left, right),
+ Point<2>(right,right),
+ Point<2>(rl2, left ) };
+ const int cell_vertices[4][4] = { { 0,1,2,3 },
+ { 9,4,5,2 },
+ { 3,2,6,7 },
+ { 2,5,8,6 } };
+ vector<CellData<2> > cells (4, CellData<2>());
+ for (unsigned int i=0; i<4; ++i)
+ {
+ for (unsigned int j=0; j<4; ++j)
+ cells[i].vertices[j] = cell_vertices[i][j];
+ cells[i].material_id = 0;
+ };
+ tria.create_triangulation (vector<Point<2> >(&vertices[0], &vertices[10]),
+ cells,
+ SubCellData()); // no boundary information
+};
+
+
+
template <>
void GridGenerator::hyper_L<> (Triangulation<2> &tria,
const double a,
+template <>
+void GridGenerator::hyper_cube_slit<> (Triangulation<3> &,
+ const double,
+ const double) {
+ Assert (false, ExcInternalError());
+};
+
+
+
template <>
void GridGenerator::hyper_L<> (Triangulation<3> &tria,
const double a,