]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change the mode of operation of mesh smoothing once more slightly.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 16 Aug 1998 12:24:39 +0000 (12:24 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 16 Aug 1998 12:24:39 +0000 (12:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@495 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 66fc1c1bfc5a8e24bed1694885ada33448a268a2..fd660175b23805c44bb7d7fe8c192de2e154844b 100644 (file)
@@ -45,11 +45,13 @@ enum MeshSmoothing {
       limit_level_difference_at_vertices = 0x1,     
       eliminate_unrefined_islands        = 0x2,
 
-      eliminate_refined_islands          = 0x4,
+      eliminate_refined_inner_islands    = 0x100,
+      eliminate_refined_boundary_islands = 0x200,
       
       smoothing_on_refinement            = (limit_level_difference_at_vertices |
                                            eliminate_unrefined_islands),
-      smoothing_on_coarsening            = (eliminate_refined_islands),
+      smoothing_on_coarsening            = (eliminate_refined_inner_islands |
+                                           eliminate_refined_boundary_islands),
       maximum_smoothing                  = 0xffff
 };
 
@@ -688,7 +690,7 @@ class TriaDimensionInfo<2> {
  *     name of the flag may indicate. However, no better name came to mind to
  *     the author by now.
  *
- *   \item #eliminate_refined_islands#:
+ *   \item #eliminate_refined_*_islands#:
  *     This algorithm seeks for isolated cells which are refined or flagged
  *     for refinement. This definition is unlike that for
  *     #eliminate_unrefined_islands#, which would mean that an island is
@@ -710,6 +712,16 @@ class TriaDimensionInfo<2> {
  *     refined but are flagged for refinement. If necessary, it takes away the
  *     refinement flag.
  *
+ *     Actually there are two versions of this flag,
+ *     #eliminate_refined_inner_islands# and #eliminate_refined_boundary_islands#.
+ *     There first eliminates islands defined by the definition above which are
+ *     in the interior of the domain, while the second eliminates only those
+ *     islands if the cell is at the boundary. The reason for this split of
+ *     flags is that one often wants to eliminate such islands in the interior
+ *     while those at the boundary may well be wanted, for example if one
+ *     refines the mesh according to a criterion associated with a boundary
+ *     integral or if one has rough boundary data.
+ *
  *   \item #smoothing_on_refinement#:
  *     This flag sums up all smoothing algorithms which may be performed upon
  *     refinement by flagging some more cells for refinement.
@@ -966,7 +978,7 @@ class TriaDimensionInfo<2> {
  *       will need refinement, we will need additional loops of regularisation
  *       and smoothing over all cells until nothing changes any more.
  *
- *     \item #eliminate_refined_islands#:
+ *     \item #eliminate_refined_*_islands#:
  *       This one does much the same as the above one, but for coarsening. If
  *       a cell is flagged for refinement or if all of its children are active
  *       and if the number of neighbors which are either active and not flagged
@@ -975,6 +987,10 @@ class TriaDimensionInfo<2> {
  *       are flagged for coarsening or (if this cell was flagged for refinement)
  *       the refine flag is cleared.
  *
+ *       For a description of the distinction between the two versions of the
+ *       flag see above in the section about mesh smoothing in the general part
+ *       of this class's description.
+ *
  *       The same applies as above: several loops may be necessary.
  *     \end{itemize}
  *   \end{itemize}
index 5b1675582a3b141e4f4974df2c6bc66683effa4d..22fb6df9595bc73e6346aa074968de3228a10a27 100644 (file)
@@ -3251,7 +3251,8 @@ bool Triangulation<dim>::prepare_coarsening () {
   
                                   // do some smoothing on the mesh if required
   if (dim>1)
-    if (smooth_grid & eliminate_refined_islands) 
+    if (smooth_grid & (eliminate_refined_inner_islands |
+                      eliminate_refined_boundary_islands)) 
       for (cell=begin(); cell!=endc; ++cell)
        if (!cell->active() || (cell->active() && cell->refine_flag_set()))
          {
@@ -3303,7 +3304,16 @@ bool Triangulation<dim>::prepare_coarsening () {
                                                 // mark this
                                                 // cell for coarsening or don't
                                                 // refine if marked for that
-               if (unrefined_neighbors == total_neighbors)
+                                                //
+                                                // also do the distinction
+                                                // between the two versions of
+                                                // the eliminate_refined_*_islands
+                                                // flag
+               if ((unrefined_neighbors == total_neighbors) &&
+                   (((unrefined_neighbors==GeometryInfo<dim>::faces_per_cell) &&
+                     (smooth_grid & eliminate_refined_inner_islands)) ||
+                    ((unrefined_neighbors<GeometryInfo<dim>::faces_per_cell) &&
+                     (smooth_grid & eliminate_refined_boundary_islands)) ))
                  if (!cell->active())
                    cell->set_user_flag();
                  else 

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.