]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
colorize for slit domain
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 7 Nov 2002 09:43:07 +0000 (09:43 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 7 Nov 2002 09:43:07 +0000 (09:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@6738 0785d39b-7218-0410-832d-ea1e28bc413d

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

index a036785a064db27084134a8d1fcc55151026125b..d27009c435b5fb1d94e7e59e61438bea451d29f9 100644 (file)
@@ -100,14 +100,18 @@ template <typename number> class SparseMatrix;
  *      of the eight child-cubes from one of their neighbors.
  * @end{itemize}
  *
+ * Some of these functions receive a flag @p{colorize}. If this is
+ * set, parts of the boundary receive different boundary numbers,
+ * allowing them to be distinguished by application programs. See the
+ * documentation of the functions for details.
+ * 
  * Additionally this class provides a function
  * (@p{laplace_transformation}) that smoothly transforms a grid
  * according to given new boundary points. This can be used to
  * transform (simple-shaped) grids to a more complicated ones, like a
  * shell onto a grid of an airfoil, for example.
  *
- * @author Wolfgang Bangerth, 1998, 1999. Slit domain by Stefan
- * Nauber, 1999. Laplace transformation by Ralf Hartmann, 2001.
+ * @author Wolfgang Bangerth, Ralf Hartmann, Guido Kanschat, Stefan Nauber, 1998, 1999, 2000, 2001, 2002.
  */
 class GridGenerator
 {
@@ -360,23 +364,35 @@ class GridGenerator
                                      */
     static void hyper_cube_slit (Triangulation<1> &tria,
                                 const double      left = 0.,
-                                const double      right= 1.);
+                                const double      right= 1.,
+                                const bool colorize = false);
 
                                     /**
                                      * Declaration of same function
                                      * for different space dimension.
+                                     *
+                                     * If colorize is selected, then
+                                     * the two edges forming the slit
+                                     * carry numbers 1 and 2, while
+                                     * the outer boundary has number
+                                     * 0.
                                      */
     static void hyper_cube_slit (Triangulation<2> &tria,
                                 const double      left = 0.,
-                                const double      right= 1.);
+                                const double      right= 1.,
+                                const bool colorize = false);
 
                                     /**
                                      * Declaration of same function
                                      * for different space dimension.
+                                     *
+                                     * Colorization is not
+                                     * implemented in 3D.
                                      */
     static void hyper_cube_slit (Triangulation<3> &tria,
                                 const double      left = 0.,
-                                const double      right= 1.);
+                                const double      right= 1.,
+                                const bool colorize = false);
 
                                     /**
                                      * Produce a hyper-shell,
index 9d45b7ba7b25873288186dd694dadf56ba50b2e7..b3a67b781c0f1e1b2ff0dd5f2b02bc36f599d334 100644 (file)
@@ -162,7 +162,8 @@ void GridGenerator::hyper_cube (Triangulation<dim> &tria,
 
 void GridGenerator::hyper_cube_slit (Triangulation<1> &,
                                     const double,
-                                    const double)
+                                    const double,
+                                    const bool)
 {
   Assert (false, ExcNotImplemented());
 };
@@ -257,7 +258,8 @@ void GridGenerator::enclosed_hyper_cube (Triangulation<2> &tria,
 void
 GridGenerator::hyper_cube_slit (Triangulation<2> &tria,
                                const double left,
-                               const double right)
+                               const double right,
+                               const bool colorize)
 {
   const double rl2=(right+left)/2;
   const Point<2> vertices[10] = { Point<2>(left, left ),
@@ -284,6 +286,14 @@ GridGenerator::hyper_cube_slit (Triangulation<2> &tria,
   tria.create_triangulation (std::vector<Point<2> >(&vertices[0], &vertices[10]),
                             cells,
                             SubCellData());       // no boundary information
+
+  if (colorize)
+    {
+      Triangulation<2>::cell_iterator cell = tria.begin();
+      cell->face(1)->set_boundary_indicator(1);
+      ++cell;
+      cell->face(3)->set_boundary_indicator(2);
+    }
 };
 
 
@@ -531,7 +541,8 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
 
 void GridGenerator::hyper_cube_slit (Triangulation<3> &,
                                     const double,
-                                    const double)
+                                    const double,
+                                    const bool)
 {
   Assert (false, ExcNotImplemented());
 };

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.