const DoFHandler<dim> &dof_handler,
std::vector<Point<dim> > &support_points);
+ /**
+ * This is the opposite function
+ * to the one above. It generates
+ * a map where the keys are the
+ * support points of the degrees
+ * of freedom, while the values
+ * are the DoF indices.
+ *
+ * Since there is no natural
+ * order in the space of points
+ * (except for the 1d case), you
+ * have to provide a map with an
+ * explicitely specified
+ * comparator object. This
+ * function is therefore
+ * templetized on the comparator
+ * object. Previous content of
+ * the map object is deleted in
+ * this function.
+ *
+ * Just as with the function
+ * above, it is assumed that the
+ * finite element in use here
+ * actually supports the notion
+ * of support points of all its
+ * components.
+ */
+ template <int dim, class Comp>
+ static void
+ map_support_points_to_dofs (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
+ std::map<Point<dim>, unsigned int, Comp> &point_to_index_map);
+
/**
* Exception
*/
};
+
+// ---------------------- inline and template functions --------------------
+
+template <int dim, class Comp>
+void
+DoFTools::
+map_support_points_to_dofs (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
+ std::map<Point<dim>, unsigned int, Comp> &point_to_index_map)
+{
+ // let the checking of arguments be
+ // done by the function first
+ // called
+ std::vector<Point<dim> > support_points (dof_handler.n_dofs());
+ map_dofs_to_support_points (mapping, dof_handler, support_points);
+ // now copy over the results of the
+ // previous function into the
+ // output arg
+ point_to_index_map.clear ();
+ for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+ point_to_index_map[support_points[i]] = i;
+};
+
+
+
#endif