From b7d63d21c423399cdde07bd756c2c65720b8a01f Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 23 Apr 2001 23:15:48 +0000 Subject: [PATCH] map_support_points_to_dofs git-svn-id: https://svn.dealii.org/trunk@4472 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_tools.h | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/deal.II/deal.II/include/dofs/dof_tools.h b/deal.II/deal.II/include/dofs/dof_tools.h index c4106f24f7..7a872b17bf 100644 --- a/deal.II/deal.II/include/dofs/dof_tools.h +++ b/deal.II/deal.II/include/dofs/dof_tools.h @@ -894,6 +894,39 @@ class DoFTools const DoFHandler &dof_handler, std::vector > &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 + static void + map_support_points_to_dofs (const Mapping &mapping, + const DoFHandler &dof_handler, + std::map, unsigned int, Comp> &point_to_index_map); + /** * Exception */ @@ -976,4 +1009,29 @@ class DoFTools }; + +// ---------------------- inline and template functions -------------------- + +template +void +DoFTools:: +map_support_points_to_dofs (const Mapping &mapping, + const DoFHandler &dof_handler, + std::map, unsigned int, Comp> &point_to_index_map) +{ + // let the checking of arguments be + // done by the function first + // called + std::vector > 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