]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
map_support_points_to_dofs
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 Apr 2001 23:15:48 +0000 (23:15 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 Apr 2001 23:15:48 +0000 (23:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@4472 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_tools.h

index c4106f24f75ff0cbd7a9f03fcb062dae9c76e807..7a872b17bf29e177250fd5a118ed012fc202387b 100644 (file)
@@ -894,6 +894,39 @@ class DoFTools
                                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
                                      */
@@ -976,4 +1009,29 @@ class DoFTools
 };
 
 
+
+// ---------------------- 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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.