]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add colorized parameter in GridGenerator::half_hyper_shell() and update changes.h.
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Aug 2011 19:05:31 +0000 (19:05 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Aug 2011 19:05:31 +0000 (19:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@24077 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/grid/grid_generator.h
deal.II/source/grid/grid_generator.cc

index f2eddb807efac5ad3ce4807f7dd71218cd08fc6a..8717958f3b5c216f8c69d4d1b135f09eff12cf65 100644 (file)
@@ -91,7 +91,15 @@ changed to use std_cxx1x::_1, std_cxx1x::_2, etc from now on.
 <h3>General</h3>
 
 <ol>
-<li> Extended: Many operations on objects of type Point<0>, Quadrature<0>, etc
+<li> Extended: GridGenerator::half_hyper_shell() got the option
+<code>colorize</code>, which assigns different boundary indicators to the
+different parts of the boundary. Added GridGenerator::quarter_hyper_shell()
+with the same options.
+<br>
+(Timo Heister, 2011/08/15)
+
+<li> Extended: Many operations on objects of
+type Point<0>, Quadrature<0>, etc
 (including creation) were previously forbidden since such objects do not make
 much sense. However, this prevented a lot of code that could otherwise work
 in a dimension independent way, from working in 1d, e.g. integration on
index 188f02aad6ec3a452511612fc0b7157dd2bda075..0e5bc833575563ac31cb7303eadfec5738e9f176 100644 (file)
@@ -673,6 +673,12 @@ class GridGenerator
                                      * computed adaptively such that
                                      * the resulting elements have
                                      * the least aspect ratio.
+                                     * 
+                                     * If colorize is set to true, the
+                                     * inner, outer, left, and right
+                                     * boundary get indicator 0, 1, 2,
+                                     * and 3, respectively. Otherwise 
+                                     * all indicators are set to 0.
                                      *
                                      * @note The triangulation needs to be
                                      * void upon calling this
@@ -683,7 +689,8 @@ class GridGenerator
                                  const Point<dim>     &center,
                                  const double        inner_radius,
                                  const double        outer_radius,
-                                 const unsigned int  n_cells = 0);
+                                 const unsigned int  n_cells = 0,
+                                 const bool colorize = false);
 
     
                                     /**
@@ -706,7 +713,13 @@ class GridGenerator
                                      * the resulting elements have
                                      * the least aspect ratio.
                                      *
-                                     * @note The triangulation needs to be
+                                     * If colorize is set to true, the
+                                     * inner, outer, left, and right
+                                     * boundary get indicator 0, 1, 2,
+                                     * and 3, respectively. Otherwise
+                                     * all indicators are set to 0.
+                                     *
+                                         * @note The triangulation needs to be
                                      * void upon calling this
                                      * function. Only implemented in 2d so far.
                                      */
index 31007f3c5cc38bca4bcd0552dc31a81a4dbf2150..515f92b1f2d1c11a905de9980b7a0b2cdc93186e 100644 (file)
@@ -1208,7 +1208,8 @@ GridGenerator::half_hyper_shell (Triangulation<1>&,
                                 const Point<1>&,
                                 const double,
                                 const double,
-                                const unsigned int)
+                                const unsigned int,
+                                const bool)
 {
   Assert (false, ExcNotImplemented());
 }
@@ -1635,7 +1636,8 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
                                 const Point<2>     &center,
                                 const double        inner_radius,
                                 const double        outer_radius,
-                                const unsigned int  n_cells)
+                                const unsigned int  n_cells,
+                                const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
          ExcInvalidRadii ());
@@ -1695,6 +1697,18 @@ GridGenerator::half_hyper_shell (Triangulation<2>   &tria,
     };
 
   tria.create_triangulation (vertices, cells, SubCellData());
+  
+  if (colorize)
+  {
+      Triangulation<2>::cell_iterator cell = tria.begin();
+      for (;cell!=tria.end();++cell)
+      {
+       cell->face(2)->set_boundary_indicator(1);
+      }
+      tria.begin()->face(0)->set_boundary_indicator(3);
+      
+      tria.last()->face(1)->set_boundary_indicator(2);
+  }
 }
 
 
@@ -2624,10 +2638,12 @@ GridGenerator::half_hyper_shell (Triangulation<3>& tria,
                                 const Point<3>& center,
                                 const double inner_radius,
                                 const double outer_radius,
-                                const unsigned int n)
+                                const unsigned int n,
+                                const bool colorize)
 {
   Assert ((inner_radius > 0) && (inner_radius < outer_radius),
          ExcInvalidRadii ());
+  Assert(colorize == false, ExcNotImplemented());
 
   if (n <= 5)
     {

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.