const Mapping<dim,spacedim> &mapping = (StaticMappingQ1<dim,spacedim>::mapping));
/**
- * Return the diameter of the smallest active cell of a triangulation. See
- * step-24 for an example of use of this function.
+ * Return an approximation of the diameter of the smallest active cell of a
+ * triangulation. See step-24 for an example of use of this function.
+ *
+ * Notice that, even if you pass a non-trivial mapping, the returned value is
+ * computed only using information on the vertices of the triangulation,
+ * possibly transformed by the mapping. While this is accurate most of the
+ * times, it may fail to give the correct result when the triangulation
+ * contains very distorted cells.
*/
template <int dim, int spacedim>
double
const Mapping<dim,spacedim> &mapping = (StaticMappingQ1<dim,spacedim>::mapping));
/**
- * Return the diameter of the largest active cell of a triangulation.
+ * Return an approximation of the diameter of the largest active cell of a
+ * triangulation.
+ *
+ * Notice that, even if you pass a non-trivial mapping to this function, the
+ * returned value is computed only using information on the vertices of the
+ * triangulation, possibly transformed by the mapping. While this is accurate
+ * most of the times, it may fail to give the correct result when the
+ * triangulation contains very distorted cells.
*/
template <int dim, int spacedim>
double
double diameter(const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const Mapping<dim,spacedim> &mapping)
{
- auto vertices = mapping.get_vertices(cell);
+ const auto vertices = mapping.get_vertices(cell);
switch (dim)
{
case 1:
//
// ---------------------------------------------------------------------
+// test GridTools::minimal_cell_diameter and GridTools::maximal_cell_diameter with a mapping
+
#include "../tests.h"
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/lac/vector.h>
#define PRECISION 2
+
template <int dim, int spacedim>
void test(const unsigned int degree)
{