Fixed: GridTools::minimal_cell_diameter() and GridTools::maximal_cell_diameter()
-return the maximal respectively minimal cell diameter of the non-artifical part
-of a Triangulation object.
+return the maximal respectively minimal cell diameter over the whole mesh for
+parallel::distributed::Triangulation object, too.
<br>
(Daniel Arndt, 2018/03/25)
const Mapping<dim,spacedim> &mapping = (StaticMappingQ1<dim,spacedim>::mapping));
/**
- * Return the diameter of the smallest active cell of the non-artificial part
- * of a triangulation. See step-24 for an example of use of this function.
+ * Return the diameter of the smallest active cell of a triangulation. See
+ * step-24 for an example of use of this function.
*/
template <int dim, int spacedim>
double
minimal_cell_diameter (const Triangulation<dim, spacedim> &triangulation);
/**
- * Return the diameter of the largest active cell of the non-artificial part
- * of a triangulation.
+ * Return the diameter of the largest active cell of a triangulation.
*/
template <int dim, int spacedim>
double
if (!cell->is_artificial())
min_diameter = std::min (min_diameter,
cell->diameter());
- return min_diameter;
+
+ double global_min_diameter = 0;
+
+#ifdef DEAL_II_WITH_MPI
+ if (const parallel::Triangulation<dim,spacedim> *p_tria
+ = dynamic_cast<const parallel::Triangulation<dim,spacedim>*>(&triangulation))
+ global_min_diameter = Utilities::MPI::min (min_diameter, p_tria->get_communicator());
+ else
+#endif
+ global_min_diameter = min_diameter;
+
+ return global_min_diameter;
}
if (!cell->is_artificial())
max_diameter = std::max (max_diameter,
cell->diameter());
- return max_diameter;
+
+ double global_max_diameter = 0;
+
+#ifdef DEAL_II_WITH_MPI
+ if (const parallel::Triangulation<dim,spacedim> *p_tria
+ = dynamic_cast<const parallel::Triangulation<dim,spacedim>*>(&triangulation))
+ global_max_diameter = Utilities::MPI::max (max_diameter, p_tria->get_communicator());
+ else
+#endif
+ global_max_diameter = max_diameter;
+
+ return global_max_diameter;
}