*/
template <int dim, int spacedim>
double
- minimal_cell_diameter (const Triangulation<dim, spacedim> &triangulation);
+ minimal_cell_diameter (const Triangulation<dim, spacedim> &triangulation,
+ const Mapping<dim,spacedim> &mapping = (StaticMappingQ1<dim,spacedim>::mapping));
/**
* Return the diameter of the largest active cell of a triangulation.
*/
template <int dim, int spacedim>
double
- maximal_cell_diameter (const Triangulation<dim, spacedim> &triangulation);
+ maximal_cell_diameter (const Triangulation<dim, spacedim> &triangulation,
+ const Mapping<dim,spacedim> &mapping = (StaticMappingQ1<dim,spacedim>::mapping));
/**
* Given a list of vertices (typically obtained using
+ namespace
+ {
+ template <int dim, int spacedim>
+ double diameter(const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const Mapping<dim,spacedim> &mapping)
+ {
+ auto vertices = mapping.get_vertices(cell);
+ switch (dim)
+ {
+ case 1:
+ return (vertices[1]-vertices[0]).norm();
+ case 2:
+ return std::max((vertices[3]-vertices[0]).norm(),
+ (vertices[2]-vertices[1]).norm());
+ case 3:
+ return std::max( std::max((vertices[7]-vertices[0]).norm(),
+ (vertices[6]-vertices[1]).norm()),
+ std::max((vertices[2]-vertices[5]).norm(),
+ (vertices[3]-vertices[4]).norm()) );
+ default:
+ Assert (false, ExcNotImplemented());
+ return -1e10;
+ }
+ }
+ }
+
+
template <int dim, int spacedim>
double
- minimal_cell_diameter (const Triangulation<dim, spacedim> &triangulation)
+ minimal_cell_diameter (const Triangulation<dim, spacedim> &triangulation,
+ const Mapping<dim,spacedim> &mapping)
{
double min_diameter = std::numeric_limits<double>::max();
for (const auto &cell: triangulation.active_cell_iterators())
if (!cell->is_artificial())
min_diameter = std::min (min_diameter,
- cell->diameter());
+ diameter<dim,spacedim>(cell, mapping));
double global_min_diameter = 0;
template <int dim, int spacedim>
double
- maximal_cell_diameter (const Triangulation<dim, spacedim> &triangulation)
+ maximal_cell_diameter (const Triangulation<dim, spacedim> &triangulation,
+ const Mapping<dim, spacedim> &mapping)
{
double max_diameter = 0.;
for (const auto &cell: triangulation.active_cell_iterators())
if (!cell->is_artificial())
max_diameter = std::max (max_diameter,
- cell->diameter());
+ diameter(cell, mapping));
double global_max_diameter = 0;
template
double
- minimal_cell_diameter (const Triangulation<deal_II_dimension, deal_II_space_dimension> &triangulation);
+ minimal_cell_diameter (const Triangulation<deal_II_dimension, deal_II_space_dimension> &triangulation,
+ const Mapping<deal_II_dimension, deal_II_space_dimension> &);
template
double
- maximal_cell_diameter (const Triangulation<deal_II_dimension, deal_II_space_dimension> &triangulation);
+ maximal_cell_diameter (const Triangulation<deal_II_dimension, deal_II_space_dimension> &triangulation,
+ const Mapping<deal_II_dimension, deal_II_space_dimension> &);
template
std::map<unsigned int,Point<deal_II_space_dimension> >