]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Added slit domain
authornauber <nauber@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Jun 1999 06:30:23 +0000 (06:30 +0000)
committernauber <nauber@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Jun 1999 06:30:23 +0000 (06:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@1406 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/grid_generator.h
deal.II/deal.II/source/grid/grid_generator.cc

index 9ec58e2c22a5ca73a768f546478410565596f20d..707fc7cdf94565ba608b4413d60e968872f2c2f8 100644 (file)
@@ -98,6 +98,19 @@ class GridGenerator
     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.);
 };
 
 
index ace7d6beec45df560adf2f0b32b5467c5c3a5f45..6b52fed0f8adf317c866bac5a4aa688af9afd81d 100644 (file)
@@ -28,6 +28,15 @@ void GridGenerator::hyper_cube<> (Triangulation<1> &tria,
 
 
 
+template <>
+void GridGenerator::hyper_cube_slit<> (Triangulation<1> &,
+                                      const double,
+                                      const double) {
+  Assert (false, ExcInternalError());
+};
+
+
+
 template <>
 void GridGenerator::hyper_L<> (Triangulation<1> &,
                               const double,
@@ -71,6 +80,39 @@ void GridGenerator::hyper_cube<> (Triangulation<2> &tria,
 
 
 
+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,
@@ -171,6 +213,15 @@ void GridGenerator::hyper_cube<> (Triangulation<3> &tria,
 
 
 
+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,

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.