template <int dim, int spacedim>
static
double diameter (const Triangulation<dim, spacedim> &tria);
-
- /**
- * Same function, but for 1d.
- */
- static
- double diameter (const Triangulation<1> &tria);
- /**
- * Same function, but for 1d, 2sd.
- */
- static
- double diameter (const Triangulation<1,2> &tria);
-
+
/**
* Given a list of vertices (typically
* obtained using
-double
-GridTools::diameter (const Triangulation<1> &tria)
-{
- // for 1d, simply check the
- // vertices of the left- and
- // rightmost coarse grid cell
- Triangulation<1>::cell_iterator leftmost = tria.begin(0);
- Triangulation<1>::cell_iterator rightmost = tria.begin(0);
-
- while (!leftmost->at_boundary(0)) leftmost = leftmost->neighbor(0);
- while (!rightmost->at_boundary(1)) rightmost = rightmost->neighbor(1);
-
- return std::sqrt((leftmost->vertex(0) - rightmost->vertex(1)).square());
-}
-
-
-
template <>
double
GridTools::cell_measure<3>(const std::vector<Point<3> > &all_vertices,
for (deal_II_dimension : DIMENSIONS)
{
-
-#if deal_II_dimension != 1
template
double
GridTools::diameter<deal_II_dimension> (const Triangulation<deal_II_dimension> &);
-#endif
-#if deal_II_dimension == 2
+#if deal_II_dimension < 3
template
double
GridTools::diameter<deal_II_dimension, deal_II_dimension+1> (const Triangulation<deal_II_dimension, deal_II_dimension+1> &);