std::vector<std::set<typename Triangulation<dim,spacedim>::active_cell_iterator> >
vertex_to_cell_map(const Triangulation<dim,spacedim> &triangulation);
+ /**
+
+
+ /**
+ * Returns the local vertex index of cell @p cell that is closest to
+ * the given location @p position.
+ *
+ * @author Rene Gassmoeller, Luca Heltai, 2017.
+ */
+ template <int dim, int spacedim>
+ unsigned int
+ get_closest_vertex_of_cell(const typename Triangulation<dim,spacedim>::active_cell_iterator &cell,
+ const Point<spacedim> &position);
+
/**
* Compute a globally unique index for each vertex and hanging node
* associated with a locally owned active cell. The vertices of a ghost cell
+ template <int dim, int spacedim>
+ unsigned int
+ get_closest_vertex_of_cell(const typename Triangulation<dim,spacedim>::active_cell_iterator &cell,
+ const Point<spacedim> &position)
+ {
+ double minimum_distance = std::numeric_limits<double>::max();
+ unsigned int closest_vertex = numbers::invalid_unsigned_int;
+
+ for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
+ {
+ const double vertex_distance = position.distance(cell->vertex(v));
+ if (vertex_distance < minimum_distance)
+ {
+ closest_vertex = v;
+ minimum_distance = vertex_distance;
+ }
+ }
+ return closest_vertex;
+ }
+
+
+
template <int dim, int spacedim>
std::pair<typename hp::DoFHandler<dim,spacedim>::active_cell_iterator, Point<dim> >
find_active_cell_around_point (const hp::MappingCollection<dim,spacedim> &mapping,