<h3>Specific improvements</h3>
<ol>
+<li> New: TriaAccessor<>::minimum_vertex_distance().
+<br>
+(Timo Heister, 2011/10/25)
+
<li> New: TableHandler::print_text now supports not only printing column
keys above their own column, but also in a separate header, to make it simpler
for external plotting programs to skip this line.
*/
double extent_in_direction (const unsigned int axis) const;
-
/**
+ * Returns the minimal distance between
+ * any two vertices.
+ */
+ double minimum_vertex_distance () const;
+
+ /**
* Center of the object. The center of an
* object is defined to be the average of
* the locations of the vertices, which
}
+
+template <int structdim, int dim, int spacedim>
+double
+TriaAccessor<structdim, dim, spacedim>::minimum_vertex_distance () const
+{
+ switch (structdim)
+ {
+ case 1:
+ return std::sqrt((this->vertex(1)-this->vertex(0)).square());
+ case 2:
+ case 3:
+ {
+ double min = std::numeric_limits<double>::max();
+ for (unsigned int i=0;i<GeometryInfo<structdim>::vertices_per_cell;++i)
+ for (unsigned int j=i+1;j<GeometryInfo<structdim>::vertices_per_cell;++j)
+ min = std::min(min, (this->vertex(i)-this->vertex(j)).square());
+ return std::sqrt(min);
+ }
+ default:
+ Assert (false, ExcNotImplemented());
+ return -1e10;
+ }
+}
+
+
+
template <int structdim, int dim, int spacedim>
Point<spacedim>
TriaAccessor<structdim, dim, spacedim>::center () const