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
};
* 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
* 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.
* 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
* 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}
// 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()))
{
// 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