]> https://gitweb.dealii.org/ - dealii.git/commitdiff
More moving around to allow sharing code between non-hp and hp accessors. Also move...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 1 May 2006 21:29:08 +0000 (21:29 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 1 May 2006 21:29:08 +0000 (21:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@12944 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/include/dofs/hp_dof_handler.h
deal.II/deal.II/include/dofs/hp_dof_levels.h
deal.II/deal.II/source/dofs/dof_accessor.cc
deal.II/deal.II/source/dofs/hp_dof_levels.cc

index 45563660f75ad84f86d7efee946c530e58621811..e1c63110f3c74dbe73b856abc5158065cd73cf83 100644 (file)
@@ -188,7 +188,133 @@ class DoFAccessor : public DoFObjectAccessor_Inheritance<structdim, DH::dimensio
     void copy_from (const DoFAccessor<structdim, DH> &a);
 
                                     /**
-                                     * Exception for child classes
+                                     * Return an iterator pointing to
+                                     * the the @p c-th child.
+                                     */
+    TriaIterator<DH::dimension,DoFObjectAccessor<structdim,DH> >
+    child (const unsigned int c) const;
+    
+                                    /**
+                                     * Set the index of the
+                                     * <i>i</i>th degree of freedom
+                                     * of this object to @p index.
+                                     *
+                                     * The last argument denotes the
+                                     * finite element index. For the
+                                     * standard ::DoFHandler class,
+                                     * this value must be equal to
+                                     * its default value since that
+                                     * class only supports the same
+                                     * finite element on all cells
+                                     * anyway.
+                                     *
+                                     * However, for hp objects
+                                     * (i.e. the hp::DoFHandler
+                                     * class), different finite
+                                     * element objects may be used on
+                                     * different cells. On faces
+                                     * between two cells, as well as
+                                     * vertices, there may therefore
+                                     * be two sets of degrees of
+                                     * freedom, one for each of the
+                                     * finite elements used on the
+                                     * adjacent cells. In order to
+                                     * specify which set of degrees
+                                     * of freedom to work on, the
+                                     * last argument is used to
+                                     * disambiguate. Finally, if this
+                                     * function is called for a cell
+                                     * object, there can only be a
+                                     * single set of degrees of
+                                     * freedom, and fe_index has to
+                                     * match the result of
+                                     * active_fe_index().
+                                     */
+    void set_dof_index (const unsigned int i,
+                       const unsigned int index,
+                       const unsigned int fe_index = DH::default_fe_index) const;
+
+                                    /**
+                                     * Index of the <i>i</i> degree
+                                     * on the @p vertexth vertex.
+                                     *
+                                     * The last argument denotes the
+                                     * finite element index. For the
+                                     * standard ::DoFHandler class,
+                                     * this value must be equal to
+                                     * its default value since that
+                                     * class only supports the same
+                                     * finite element on all cells
+                                     * anyway.
+                                     *
+                                     * However, for hp objects
+                                     * (i.e. the hp::DoFHandler
+                                     * class), different finite
+                                     * element objects may be used on
+                                     * different cells. On faces
+                                     * between two cells, as well as
+                                     * vertices, there may therefore
+                                     * be two sets of degrees of
+                                     * freedom, one for each of the
+                                     * finite elements used on the
+                                     * adjacent cells. In order to
+                                     * specify which set of degrees
+                                     * of freedom to work on, the
+                                     * last argument is used to
+                                     * disambiguate. Finally, if this
+                                     * function is called for a cell
+                                     * object, there can only be a
+                                     * single set of degrees of
+                                     * freedom, and fe_index has to
+                                     * match the result of
+                                     * active_fe_index().
+                                     */
+    unsigned int vertex_dof_index (const unsigned int vertex,
+                                  const unsigned int i,
+                                  const unsigned int fe_index = DH::default_fe_index) const;
+
+                                    /**
+                                     * Set the index of the <i>i</i> degree
+                                     * on the @p vertexth vertex to @p index.
+                                     *
+                                     * The last argument denotes the
+                                     * finite element index. For the
+                                     * standard ::DoFHandler class,
+                                     * this value must be equal to
+                                     * its default value since that
+                                     * class only supports the same
+                                     * finite element on all cells
+                                     * anyway.
+                                     *
+                                     * However, for hp objects
+                                     * (i.e. the hp::DoFHandler
+                                     * class), different finite
+                                     * element objects may be used on
+                                     * different cells. On faces
+                                     * between two cells, as well as
+                                     * vertices, there may therefore
+                                     * be two sets of degrees of
+                                     * freedom, one for each of the
+                                     * finite elements used on the
+                                     * adjacent cells. In order to
+                                     * specify which set of degrees
+                                     * of freedom to work on, the
+                                     * last argument is used to
+                                     * disambiguate. Finally, if this
+                                     * function is called for a cell
+                                     * object, there can only be a
+                                     * single set of degrees of
+                                     * freedom, and fe_index has to
+                                     * match the result of
+                                     * active_fe_index().
+                                     */
+    void set_vertex_dof_index (const unsigned int vertex,
+                              const unsigned int i,
+                              const unsigned int index,
+                              const unsigned int fe_index = DH::default_fe_index) const;
+
+                                    /**
+                                     * Exceptions for child classes
                                      *
                                      * @ingroup Exceptions
                                      */
@@ -368,125 +494,6 @@ class DoFObjectAccessor : public DoFAccessor<celldim, DH>
     unsigned int dof_index (const unsigned int i,
                            const unsigned int fe_index = DH::default_fe_index) const;
 
-                                    /**
-                                     * Set the index of the
-                                     * <i>i</i>th degree of freedom
-                                     * of this object to @p index.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    void set_dof_index (const unsigned int i,
-                       const unsigned int index,
-                       const unsigned int fe_index = DH::default_fe_index) const;
-
-                                    /**
-                                     * Index of the <i>i</i> degree
-                                     * on the @p vertexth vertex.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    unsigned int vertex_dof_index (const unsigned int vertex,
-                                  const unsigned int i,
-                                  const unsigned int fe_index = DH::default_fe_index) const;
-
-                                    /**
-                                     * Set the index of the <i>i</i> degree
-                                     * on the @p vertexth vertex to @p index.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    void set_vertex_dof_index (const unsigned int vertex,
-                              const unsigned int i,
-                              const unsigned int index,
-                              const unsigned int fe_index = DH::default_fe_index) const;
-
                                     /**
                                      * Return the indices of the dofs of this
                                      * object in the standard ordering: dofs
@@ -574,15 +581,6 @@ class DoFObjectAccessor : public DoFAccessor<celldim, DH>
                                      */
     TriaIterator<dim,DoFObjectAccessor<2, DH> >
     quad (const unsigned int i) const;
-    
-                                    /**
-                                     * <i>i</i>th child as a DoFObjectAccessor
-                                     * iterator. This function is needed since
-                                     * the child function of the base
-                                     * class returns a hex accessor without
-                                     * access to the DoF data.
-                                     */
-    TriaIterator<dim,DoFObjectAccessor<celldim, DH> > child (const unsigned int) const;
 };
 
 
@@ -763,85 +761,6 @@ class DoFObjectAccessor<1, DH> : public DoFAccessor<1,DH>
                        const unsigned int index,
                        const unsigned int fe_index = DH::default_fe_index) const;
 
-                                    /**
-                                     * Index of the <i>i</i> degree
-                                     * on the @p vertexth vertex.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    unsigned int vertex_dof_index (const unsigned int vertex,
-                                  const unsigned int i,
-                                  const unsigned int fe_index = DH::default_fe_index) const;
-
-                                    /**
-                                     * Set the index of the <i>i</i> degree
-                                     * on the @p vertexth vertex to @p index.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    void set_vertex_dof_index (const unsigned int vertex,
-                              const unsigned int i,
-                              const unsigned int index,
-                              const unsigned int fe_index = DH::default_fe_index) const;
-
                                     /**
                                      * Return the indices of the dofs of this
                                      * object in the standard ordering: dofs
@@ -915,15 +834,6 @@ class DoFObjectAccessor<1, DH> : public DoFAccessor<1,DH>
                                      */
     void get_dof_indices (std::vector<unsigned int> &dof_indices,
                          const unsigned int fe_index = DH::default_fe_index) const;
-
-                                    /**
-                                     * Return the @p ith child as a DoF line
-                                     * iterator. This function is needed since
-                                     * the child function of the base
-                                     * class returns a line accessor without
-                                     * access to the DoF data.
-                                     */
-    TriaIterator<DH::dimension,DoFObjectAccessor<1,DH> > child (const unsigned int) const;
 };
 
 
@@ -1049,85 +959,6 @@ class DoFObjectAccessor<2, DH> : public DoFAccessor<2,DH>
                        const unsigned int index,
                        const unsigned int fe_index = DH::default_fe_index) const;
 
-                                    /**
-                                     * Index of the <i>i</i> degree
-                                     * on the @p vertexth vertex.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    unsigned int vertex_dof_index (const unsigned int vertex,
-                                  const unsigned int i,
-                                  const unsigned int fe_index = DH::default_fe_index) const;
-
-                                    /**
-                                     * Set the index of the <i>i</i> degree
-                                     * on the @p vertexth vertex to @p index.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    void set_vertex_dof_index (const unsigned int vertex,
-                              const unsigned int i,
-                              const unsigned int index,
-                              const unsigned int fe_index = DH::default_fe_index) const;
-
                                     /**
                                      * Return the indices of the dofs of this
                                      * object in the standard ordering: dofs
@@ -1208,16 +1039,6 @@ class DoFObjectAccessor<2, DH> : public DoFAccessor<2,DH>
                                      */
     TriaIterator<DH::dimension,DoFObjectAccessor<1, DH> >
     line (const unsigned int i) const;
-    
-                                    /**
-                                     * Return the @p ith child as a DoF quad
-                                     * iterator. This function is needed since
-                                     * the child function of the base
-                                     * class returns a quad accessor without
-                                     * access to the DoF data.
-                                     */
-    TriaIterator<DH::dimension,DoFObjectAccessor<2, DH> >
-    child (const unsigned int) const;
 };
 
 
@@ -1344,85 +1165,6 @@ class DoFObjectAccessor<3, DH> : public DoFAccessor<3,DH>
                        const unsigned int index,
                        const unsigned int fe_index = DH::default_fe_index) const;
 
-                                    /**
-                                     * Index of the <i>i</i> degree
-                                     * on the @p vertexth vertex.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    unsigned int vertex_dof_index (const unsigned int vertex,
-                                  const unsigned int i,
-                                  const unsigned int fe_index = DH::default_fe_index) const;
-
-                                    /**
-                                     * Set the index of the <i>i</i> degree
-                                     * on the @p vertexth vertex to @p index.
-                                     *
-                                     * The last argument denotes the
-                                     * finite element index. For the
-                                     * standard ::DoFHandler class,
-                                     * this value must be equal to
-                                     * its default value since that
-                                     * class only supports the same
-                                     * finite element on all cells
-                                     * anyway.
-                                     *
-                                     * However, for hp objects
-                                     * (i.e. the hp::DoFHandler
-                                     * class), different finite
-                                     * element objects may be used on
-                                     * different cells. On faces
-                                     * between two cells, as well as
-                                     * vertices, there may therefore
-                                     * be two sets of degrees of
-                                     * freedom, one for each of the
-                                     * finite elements used on the
-                                     * adjacent cells. In order to
-                                     * specify which set of degrees
-                                     * of freedom to work on, the
-                                     * last argument is used to
-                                     * disambiguate. Finally, if this
-                                     * function is called for a cell
-                                     * object, there can only be a
-                                     * single set of degrees of
-                                     * freedom, and fe_index has to
-                                     * match the result of
-                                     * active_fe_index().
-                                     */
-    void set_vertex_dof_index (const unsigned int vertex,
-                              const unsigned int i,
-                              const unsigned int index,
-                              const unsigned int fe_index = DH::default_fe_index) const;
-
                                     /**
                                      * Return the indices of the dofs of this
                                      * object in the standard ordering: dofs
@@ -1510,15 +1252,6 @@ class DoFObjectAccessor<3, DH> : public DoFAccessor<3,DH>
                                      */
     TriaIterator<DH::dimension,DoFObjectAccessor<2, DH> >
     quad (const unsigned int i) const;
-    
-                                    /**
-                                     * Return the @p ith child as a DoF hex
-                                     * iterator. This function is needed since
-                                     * the child function of the base
-                                     * class returns a hex accessor without
-                                     * access to the DoF data.
-                                     */
-    TriaIterator<DH::dimension,DoFObjectAccessor<3, DH> > child (const unsigned int) const;
 };
 
 
@@ -1991,31 +1724,6 @@ template <>
 TriaIterator<3, DoFObjectAccessor<2,DoFHandler<3> > >
 DoFCellAccessor<DoFHandler<3> >::face (const unsigned int i) const;
 
-template <>
-void DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_index (const unsigned int,
-                                                            const unsigned int,
-                                                            const unsigned int) const;
-template <>
-void DoFObjectAccessor<1,hp::DoFHandler<2> >::set_dof_index (const unsigned int,
-                                                            const unsigned int,
-                                                            const unsigned int) const;
-template <>
-void DoFObjectAccessor<1,hp::DoFHandler<3> >::set_dof_index (const unsigned int,
-                                                            const unsigned int,
-                                                            const unsigned int) const;
-template <>
-void DoFObjectAccessor<2,hp::DoFHandler<2> >::set_dof_index (const unsigned int,
-                                                            const unsigned int,
-                                                            const unsigned int) const;
-template <>
-void DoFObjectAccessor<2,hp::DoFHandler<3> >::set_dof_index (const unsigned int,
-                                                            const unsigned int,
-                                                            const unsigned int) const;
-template <>
-void DoFObjectAccessor<3,hp::DoFHandler<3> >::set_dof_index (const unsigned int,
-                                                            const unsigned int,
-                                                            const unsigned int) const;
-
 
 template <>
 const FiniteElement<1> &
index b88f02b6c7983eca419e09b6c65c1adde4b1b6d4..2f4702ed62e1355ed623464c41885f0298c7157a 100644 (file)
@@ -118,6 +118,61 @@ DoFAccessor<structdim,DH>::operator != (const DoFAccessor<structdim,DH> &a) cons
 
 
 
+template <int structdim, class DH>
+inline
+TriaIterator<DH::dimension,DoFObjectAccessor<structdim,DH> >
+DoFAccessor<structdim,DH>::child (const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  TriaIterator<DH::dimension,DoFObjectAccessor<structdim,DH> > q (this->tria,
+                                                                 this->present_level+1,
+                                                                 this->child_index (i),
+                                                                 this->dof_handler);
+
+                                  // make sure that we either created
+                                  // a past-the-end iterator or one
+                                  // pointing to a used cell
+  Assert ((q.state() == IteratorState::past_the_end)
+         ||
+         q->used(),
+         typename TriaAccessor<DH::dimension>::ExcUnusedCellAsChild());
+
+  return q;
+}
+
+
+
+template <int structdim, class DH>
+inline
+unsigned int
+DoFAccessor<structdim, DH>::vertex_dof_index (const unsigned int vertex,
+                                             const unsigned int i,
+                                             const unsigned int fe_index) const
+{
+  return this->dof_handler->get_vertex_dof_index (this->vertex_index(vertex),
+                                                 fe_index,
+                                                 i);
+}
+
+
+
+template <int structdim, class DH>
+void DoFAccessor<structdim, DH>::set_vertex_dof_index (const unsigned int vertex,
+                                                      const unsigned int i,
+                                                      const unsigned int index,
+                                                      const unsigned int fe_index) const
+{
+  this->dof_handler->set_vertex_dof_index (this->vertex_index(vertex),
+                                          fe_index,
+                                          i,
+                                          index);
+}
+
+
+
+
 
 /*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/
 
@@ -135,27 +190,6 @@ DoFObjectAccessor (const Triangulation<DH::dimension> *tria,
 
 
 
-template <class DH>
-inline
-TriaIterator<DH::dimension,DoFObjectAccessor<1,DH> >
-DoFObjectAccessor<1,DH>::child (const unsigned int i) const
-{
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  TriaIterator<dim,DoFObjectAccessor<1,DH> > q (this->tria,
-                                               this->present_level+1,
-                                               this->child_index (i),
-                                               this->dof_handler);
-  
-#ifdef DEBUG
-  if (q.state() != IteratorState::past_the_end)
-    Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
-#endif
-  return q;
-}
-
-
 
 
 /*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
@@ -192,28 +226,6 @@ DoFObjectAccessor<2,DH>::line (const unsigned int i) const
 
 
 
-template <class DH>
-inline
-TriaIterator<DH::dimension,DoFObjectAccessor<2,DH> >
-DoFObjectAccessor<2,DH>::child (const unsigned int i) const
-{
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  TriaIterator<dim,DoFObjectAccessor<2,DH> > q (this->tria,
-                                               this->present_level+1,
-                                               this->child_index (i),
-                                               this->dof_handler);
-  
-#ifdef DEBUG
-  if (q.state() != IteratorState::past_the_end)
-    Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
-#endif
-  return q;
-}
-
-
-
 /*------------------------- Functions: DoFObjectAccessor<3,dim> -----------------------*/
 
 template <class DH>
@@ -262,24 +274,6 @@ DoFObjectAccessor<3,DH>::quad (const unsigned int i) const
 }
 
 
-template <class DH>
-inline
-TriaIterator<DH::dimension,DoFObjectAccessor<3,DH> >
-DoFObjectAccessor<3,DH>::child (const unsigned int i) const
-{
-  TriaIterator<dim,DoFObjectAccessor<3,DH> > q (this->tria,
-                                               this->present_level+1,
-                                               this->child_index (i),
-                                               this->dof_handler);
-  
-#ifdef DEBUG
-  if (q.state() != IteratorState::past_the_end)
-    Assert (q->used(), typename TriaAccessor<dim>::ExcUnusedCellAsChild());
-#endif
-  return q;
-}
-
-
 /*--------------- Functions: DoFObjectAccessor<1,DoFHandler> -----------*/
 
 
@@ -307,32 +301,6 @@ DoFObjectAccessor<1,DoFHandler<1> >::dof_index (const unsigned int i,
 
 
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<1,DoFHandler<1> >::vertex_dof_index (const unsigned int vertex,
-                                                      const unsigned int i,
-                                                      const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<1>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject());
-  Assert (vertex<2, ExcIndexRange (i,0,2));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
 template <>
 inline
 void
@@ -368,7 +336,7 @@ DoFObjectAccessor<1,DoFHandler<1> >::get_dof_indices (std::vector<unsigned int>
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d);
+      *next++ = this->vertex_dof_index(vertex,d);
   for (unsigned int d=0; d<dofs_per_line; ++d)
     *next++ = dof_index(d);
 }
@@ -399,32 +367,6 @@ DoFObjectAccessor<1,DoFHandler<2> >::dof_index (const unsigned int i,
 
 
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<1,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
-                                                      const unsigned int i,
-                                                      const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<2>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject());
-  Assert (vertex<2, ExcIndexRange (i,0,2));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
 template <>
 inline
 void
@@ -460,7 +402,7 @@ DoFObjectAccessor<1,DoFHandler<2> >::get_dof_indices (std::vector<unsigned int>
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d);
+      *next++ = this->vertex_dof_index(vertex,d);
   for (unsigned int d=0; d<dofs_per_line; ++d)
     *next++ = dof_index(d);
 }
@@ -491,32 +433,6 @@ DoFObjectAccessor<1,DoFHandler<3> >::dof_index (const unsigned int i,
 
 
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<1,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
-                                                      const unsigned int i,
-                                                      const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<3>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  Assert (this->dof_handler != 0, BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0, BaseClass::ExcInvalidObject());
-  Assert (vertex<2, ExcIndexRange (i,0,2));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
 template <>
 inline
 void
@@ -552,7 +468,7 @@ DoFObjectAccessor<1,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int>
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d);
+      *next++ = this->vertex_dof_index(vertex,d);
   for (unsigned int d=0; d<dofs_per_line; ++d)
     *next++ = dof_index(d);
 }
@@ -586,33 +502,6 @@ DoFObjectAccessor<2,DoFHandler<2> >::dof_index (const unsigned int i,
 
 
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<2,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
-                                                      const unsigned int i,
-                                                      const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<2>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (this->dof_handler != 0,
-         BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0,
-         BaseClass::ExcInvalidObject());
-  Assert (vertex<4, ExcIndexRange (i,0,4));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
 template <>
 inline
 void
@@ -652,7 +541,7 @@ DoFObjectAccessor<2,DoFHandler<2> >::get_dof_indices (std::vector<unsigned int>
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<4; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d);
+      *next++ = this->vertex_dof_index(vertex,d);
   for (unsigned int line=0; line<4; ++line)
     for (unsigned int d=0; d<dofs_per_line; ++d)
       *next++ = this->line(line)->dof_index(d);
@@ -687,33 +576,6 @@ DoFObjectAccessor<2,DoFHandler<3> >::dof_index (const unsigned int i,
 
 
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<2,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
-                                                      const unsigned int i,
-                                                      const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<3>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (this->dof_handler != 0,
-         BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0,
-         BaseClass::ExcInvalidObject());
-  Assert (vertex<4, ExcIndexRange (i,0,4));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
 template <>
 inline
 void
@@ -753,7 +615,7 @@ DoFObjectAccessor<2,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int>
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<4; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d);
+      *next++ = this->vertex_dof_index(vertex,d);
   for (unsigned int line=0; line<4; ++line)
     for (unsigned int d=0; d<dofs_per_line; ++d)
       *next++ = this->line(line)->dof_index(d);
@@ -793,33 +655,6 @@ DoFObjectAccessor<3,DoFHandler<3> >::dof_index (const unsigned int i,
 
 
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<3,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
-                                                      const unsigned int i,
-                                                      const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<3>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (this->dof_handler != 0,
-         BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0,
-         BaseClass::ExcInvalidObject());
-  Assert (vertex<8, ExcIndexRange (i,0,8));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
 template <>
 inline
 void
@@ -862,7 +697,7 @@ DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int>
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<8; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d);
+      *next++ = this->vertex_dof_index(vertex,d);
   for (unsigned int line=0; line<12; ++line)
     for (unsigned int d=0; d<dofs_per_line; ++d)
       *next++ = this->line(line)->dof_index(d);
@@ -877,98 +712,6 @@ DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int>
 
 /* -------------- hp vertex dofs stuff ------------------------------------ */
 
-template <>
-inline
-unsigned int
-DoFObjectAccessor<1,hp::DoFHandler<1> >::vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const unsigned int fe_index) const
-{
-  return internal::hp::DoFLevel<0>::
-    get_vertex_dof_index (*this->dof_handler,
-                          this->vertex_index(vertex),
-                          fe_index,
-                          i);
-}
-
-
-
-template <>
-inline
-unsigned int
-DoFObjectAccessor<1,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const unsigned int fe_index) const
-{
-  return internal::hp::DoFLevel<0>::
-    get_vertex_dof_index (*this->dof_handler,
-                          this->vertex_index(vertex),
-                          fe_index,
-                          i);
-}
-
-
-template <>
-inline
-unsigned int
-DoFObjectAccessor<1,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const unsigned int fe_index) const
-{
-  return internal::hp::DoFLevel<0>::
-    get_vertex_dof_index (*this->dof_handler,
-                          this->vertex_index(vertex),
-                          fe_index,
-                          i);
-}
-
-
-template <>
-inline
-unsigned int
-DoFObjectAccessor<2,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const unsigned int fe_index) const
-{
-  return internal::hp::DoFLevel<0>::
-    get_vertex_dof_index (*this->dof_handler,
-                          this->vertex_index(vertex),
-                          fe_index,
-                          i);
-}
-
-
-
-template <>
-inline
-unsigned int
-DoFObjectAccessor<2,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const unsigned int fe_index) const
-{
-  return internal::hp::DoFLevel<0>::
-    get_vertex_dof_index (*this->dof_handler,
-                          this->vertex_index(vertex),
-                          fe_index,
-                          i);
-}
-
-
-
-template <>
-inline
-unsigned int
-DoFObjectAccessor<3,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
-                                                          const unsigned int i,
-                                                          const unsigned int fe_index) const
-{
-  return internal::hp::DoFLevel<0>::
-    get_vertex_dof_index (*this->dof_handler,
-                          this->vertex_index(vertex),
-                          fe_index,
-                          i);
-}
-
 
 /*--------------- Functions: DoFObjectAccessor<1,hp::DoFHandler> -----------*/
 
@@ -1020,7 +763,7 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_indices (std::vector<unsigned i
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d,fe_index);
+      *next++ = this->vertex_dof_index(vertex,d,fe_index);
   for (unsigned int d=0; d<dofs_per_line; ++d)
     *next++ = dof_index(d,fe_index);
 }
@@ -1075,7 +818,7 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_indices (std::vector<unsigned i
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d,fe_index);
+      *next++ = this->vertex_dof_index(vertex,d,fe_index);
   for (unsigned int d=0; d<dofs_per_line; ++d)
     *next++ = dof_index(d,fe_index);
 }
@@ -1130,7 +873,7 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_indices (std::vector<unsigned i
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<2; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d,fe_index);
+      *next++ = this->vertex_dof_index(vertex,d,fe_index);
   for (unsigned int d=0; d<dofs_per_line; ++d)
     *next++ = dof_index(d,fe_index);
 }
@@ -1290,7 +1033,7 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_indices (std::vector<unsigned i
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<4; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d,fe_index);
+      *next++ = this->vertex_dof_index(vertex,d,fe_index);
   for (unsigned int line=0; line<4; ++line)
     for (unsigned int d=0; d<dofs_per_line; ++d)
       *next++ = this->line(line)->dof_index(d,fe_index);
@@ -1337,7 +1080,7 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_indices (std::vector<unsigned i
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<4; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d,fe_index);
+      *next++ = this->vertex_dof_index(vertex,d,fe_index);
   for (unsigned int line=0; line<4; ++line)
     for (unsigned int d=0; d<dofs_per_line; ++d)
       *next++ = this->line(line)->dof_index(d,fe_index);
@@ -1423,7 +1166,7 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_indices (std::vector<unsigned i
   std::vector<unsigned int>::iterator next = dof_indices.begin();
   for (unsigned int vertex=0; vertex<8; ++vertex)
     for (unsigned int d=0; d<dofs_per_vertex; ++d)
-      *next++ = vertex_dof_index(vertex,d,fe_index);
+      *next++ = this->vertex_dof_index(vertex,d,fe_index);
   for (unsigned int line=0; line<12; ++line)
     for (unsigned int d=0; d<dofs_per_line; ++d)
       *next++ = this->line(line)->dof_index(d,fe_index);
index 8353b7df5ba7e1483a5ba3da095de51e6a911480..2d66793722c7ee80f6d212292218c0a77b825023 100644 (file)
@@ -1048,6 +1048,77 @@ class DoFHandler  :  public Subscriptor
     unsigned int distribute_dofs_on_cell (active_cell_iterator &cell,
                                          unsigned int next_free_dof);
 
+                                    /**
+                                     * Set the @p local_index-th
+                                     * degree of freedom
+                                     * corresponding to the finite
+                                     * element specified by @p
+                                     * fe_index on the vertex with
+                                     * global number @p
+                                     * vertex_index to @p
+                                     * global_index.
+                                     *
+                                     * This function is needed by
+                                     * DoFAccessor::set_vertex_dof_index
+                                     * when distributing degrees of
+                                     * freedom on a mesh.
+                                     *
+                                     * Since here we are dealing
+                                     * with a non-hp finite element
+                                     * DoF handler, the only
+                                     * reasonable choice for
+                                     * fe_index is
+                                     * default_fe_index. All other
+                                     * values will be ignored. The
+                                     * parameter to this function
+                                     * exists nevertheless to make
+                                     * sure that the accessor
+                                     * classes can be templatized
+                                     * on the type of the DoF
+                                     * handler.
+                                     */
+    void
+    set_vertex_dof_index (const unsigned int vertex_index,
+                         const unsigned int fe_index,
+                         const unsigned int local_index,
+                         const unsigned int global_index);
+
+                                    /**
+                                     * Get the @p local_index-th
+                                     * degree of freedom
+                                     * corresponding to the finite
+                                     * element specified by @p
+                                     * fe_index on the vertex with
+                                     * global number @p
+                                     * vertex_index to @p
+                                     * global_index.
+                                     *
+                                     * This function is needed by
+                                     * DoFAccessor::vertex_dof_index,
+                                     * which in turn is called for
+                                     * example when doing things
+                                     * like
+                                     * <code>cell-@>get_dof_indices()</code>.
+                                     *
+                                     * Since here we are dealing
+                                     * with a non-hp finite element
+                                     * DoF handler, the only
+                                     * reasonable choice for
+                                     * fe_index is
+                                     * default_fe_index. All other
+                                     * values will be ignored. The
+                                     * parameter to this function
+                                     * exists nevertheless to make
+                                     * sure that the accessor
+                                     * classes can be templatized
+                                     * on the type of the DoF
+                                     * handler.
+                                     */
+    unsigned int
+    get_vertex_dof_index (const unsigned int vertex_index,
+                         const unsigned int fe_index,
+                         const unsigned int local_index) const;
+
                                     /**
                                      * Space to store the DoF numbers for the
                                      * different levels. Analogous to the
@@ -1240,6 +1311,51 @@ DoFHandler<dim>::get_tria () const
 }
 
 
+
+template <int dim>
+inline
+unsigned int
+DoFHandler<dim>::
+get_vertex_dof_index (const unsigned int vertex_index,
+                     const unsigned int fe_index,
+                     const unsigned int local_index) const
+{
+  Assert (fe_index == DoFHandler<dim>::default_fe_index,
+         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
+  Assert (selected_fe != 0,
+         ExcMessage ("No finite element collection is associated with "
+                     "this DoFHandler"));
+  Assert (local_index < selected_fe->dofs_per_vertex,
+         ExcIndexRange(local_index, 0,
+                       selected_fe->dofs_per_vertex));
+
+  return vertex_dofs[vertex_index * selected_fe->dofs_per_vertex + local_index];
+}  
+
+
+
+template <int dim>
+inline
+void
+DoFHandler<dim>::
+set_vertex_dof_index (const unsigned int vertex_index,
+                     const unsigned int fe_index,
+                     const unsigned int local_index,
+                     const unsigned int global_index)
+{
+  Assert (fe_index == DoFHandler<dim>::default_fe_index,
+         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
+  Assert (selected_fe != 0,
+         ExcMessage ("No finite element collection is associated with "
+                     "this DoFHandler"));
+  Assert (local_index < selected_fe->dofs_per_vertex,
+         ExcIndexRange(local_index, 0,
+                       selected_fe->dofs_per_vertex));
+
+  vertex_dofs[vertex_index * selected_fe->dofs_per_vertex + local_index] = global_index;
+}  
+
+
 #endif // DOXYGEN
 
 /*----------------------------   dof_handler.h     ---------------------------*/
index 19c42f9e83ae393c4647250260b12bff5b36c79d..c8ed3ddd3307e0f4ee346c7a9524873ed15a9b67 100644 (file)
@@ -1004,10 +1004,51 @@ namespace hp
                                         *  active_fe_fields during the
                                         *  spatial refinement.
                                         */
-
       virtual void pre_refinement_notification (const Triangulation<dim> &tria);
       virtual void post_refinement_notification (const Triangulation<dim> &tria);
 
+                                      /**
+                                       * Set the @p local_index-th
+                                       * degree of freedom
+                                       * corresponding to the finite
+                                       * element specified by @p
+                                       * fe_index on the vertex with
+                                       * global number @p
+                                       * vertex_index to @p
+                                       * global_index.
+                                       *
+                                       * This function is needed by
+                                       * DoFAccessor::set_vertex_dof_index
+                                       * when distributing degrees of
+                                       * freedom on a mesh.
+                                       */
+      void
+      set_vertex_dof_index (const unsigned int vertex_index,
+                           const unsigned int fe_index,
+                           const unsigned int local_index,
+                           const unsigned int global_index);
+
+                                      /**
+                                       * Get the @p local_index-th
+                                       * degree of freedom
+                                       * corresponding to the finite
+                                       * element specified by @p
+                                       * fe_index on the vertex with
+                                       * global number @p
+                                       * vertex_index to @p
+                                       * global_index.
+                                       *
+                                       * This function is needed by
+                                       * DoFAccessor::vertex_dof_index,
+                                       * which in turn is called for
+                                       * example when doing things
+                                       * like
+                                       * <code>cell-@>get_dof_indices()</code>.
+                                       */
+      unsigned int
+      get_vertex_dof_index (const unsigned int vertex_index,
+                           const unsigned int fe_index,
+                           const unsigned int local_index) const;
 
                                        /**
                                         * Space to store the DoF
@@ -1239,6 +1280,90 @@ namespace hp
     return *tria;
   }
 
+
+
+  template <int dim>
+  inline
+  unsigned int
+  DoFHandler<dim>::
+  get_vertex_dof_index (const unsigned int vertex_index,
+                       const unsigned int fe_index,
+                       const unsigned int local_index) const
+  {
+    Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+           ExcMessage ("You need to specify a FE index when working "
+                       "with hp DoFHandlers"));
+    Assert (finite_elements != 0,
+           ExcMessage ("No finite element collection is associated with "
+                       "this DoFHandler"));
+    Assert (local_index < (*finite_elements)[fe_index].dofs_per_vertex,
+           ExcIndexRange(local_index, 0,
+                         (*finite_elements)[fe_index].dofs_per_vertex));
+
+                                    // hop along the list of index
+                                    // sets until we find the one
+                                    // with the correct fe_index, and
+                                    // then poke into that
+                                    // part. trigger an exception if
+                                    // we can't find a set for this
+                                    // particular fe_index
+    const unsigned int starting_offset = vertex_dofs_offsets[vertex_index];
+    const unsigned int *pointer        = &vertex_dofs[starting_offset];
+    while (true)
+      {
+       Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+               ExcInternalError());
+       if (*pointer == fe_index)
+         return *(pointer + 1 + local_index);
+       else
+         pointer += (*finite_elements)[*pointer].dofs_per_vertex;
+      }
+  }  
+
+
+
+  template <int dim>
+  inline
+  void
+  DoFHandler<dim>::
+  set_vertex_dof_index (const unsigned int vertex_index,
+                       const unsigned int fe_index,
+                       const unsigned int local_index,
+                       const unsigned int global_index)
+  {
+    Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
+           ExcMessage ("You need to specify a FE index when working "
+                       "with hp DoFHandlers"));
+    Assert (finite_elements != 0,
+           ExcMessage ("No finite element collection is associated with "
+                       "this DoFHandler"));
+    Assert (local_index < (*finite_elements)[fe_index].dofs_per_vertex,
+           ExcIndexRange(local_index, 0,
+                         (*finite_elements)[fe_index].dofs_per_vertex));
+
+                                    // hop along the list of index
+                                    // sets until we find the one
+                                    // with the correct fe_index, and
+                                    // then poke into that
+                                    // part. trigger an exception if
+                                    // we can't find a set for this
+                                    // particular fe_index
+    const unsigned int starting_offset = vertex_dofs_offsets[vertex_index];
+    unsigned int *pointer              = &vertex_dofs[starting_offset];
+    while (true)
+      {
+       Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+               ExcInternalError());
+       if (*pointer == fe_index)
+         {
+           *(pointer + 1 + local_index) = global_index;
+           return;
+         }
+       else
+         pointer += (*finite_elements)[*pointer].dofs_per_vertex;
+      }
+  }  
+  
 #endif
     
 }
index 3b8f6b8deaeb1af8253bad4232b487913a45a131..42fc106fad52fa67cc46bdeecc1f897fa34e7ed0 100644 (file)
@@ -85,23 +85,6 @@ namespace internal
                                           */
 
         std::vector<unsigned int> active_fe_indices;
-
-        template <int dim>
-        static
-        void
-        set_vertex_dof_index (::hp::DoFHandler<dim> &dof_handler,
-                              const unsigned int     vertex_index,
-                              const unsigned int     fe_index,
-                              const unsigned int     local_index,
-                              const unsigned int     global_index);
-
-        template <int dim>
-        static
-        unsigned int
-        get_vertex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
-                              const unsigned int           vertex_index,
-                              const unsigned int           fe_index,
-                              const unsigned int           local_index);
     };
 
 
index c95bf0490bb320f6aa7ffc5d64b97679e3361e16..e18099bb2c84a1c42a5012e427f3f8108e5866f9 100644 (file)
@@ -58,32 +58,6 @@ void DoFObjectAccessor<1, DH>::set_dof_index (const unsigned int i,
 
 
 
-
-template <class DH>
-void DoFObjectAccessor<1, DH>::set_vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i,
-                                                     const unsigned int index,
-                                                     const unsigned int fe_index) const
-
-{
-  Assert (fe_index == DoFHandler<1>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (vertex<2, ExcIndexRange (i,0,2));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  this->dof_handler->vertex_dofs[dof_number] = index;
-}
-
-
-
 /*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
 
 
@@ -109,29 +83,6 @@ void DoFObjectAccessor<2, DH>::set_dof_index (const unsigned int i,
 
 
 
-template <class DH>
-void
-DoFObjectAccessor<2, DH>::set_vertex_dof_index (const unsigned int vertex,
-                                                const unsigned int i,
-                                                const unsigned int index,
-                                                const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<1>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (vertex<4, ExcIndexRange (i,0,4));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  this->dof_handler->vertex_dofs[dof_number] = index;
-}
-
 
 
 /*------------------------- Functions: DoFObjectAccessor<3,dim> -----------------------*/
@@ -158,142 +109,6 @@ void DoFObjectAccessor<3, DH>::set_dof_index (const unsigned int i,
 }
 
 
-
-template <class DH>
-void DoFObjectAccessor<3, DH>::set_vertex_dof_index (const unsigned int vertex,
-                                                     const unsigned int i,
-                                                     const unsigned int index,
-                                                     const unsigned int fe_index) const
-{
-  Assert (fe_index == DoFHandler<1>::default_fe_index,
-         ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (vertex<8,
-         ExcIndexRange (i,0,8));
-  Assert (i<this->dof_handler->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->dof_handler->get_fe().dofs_per_vertex +
-                                  i);
-  this->dof_handler->vertex_dofs[dof_number] = index;
-}
-
-
-
-
-// --------------- hp::DoFHandler specializations for 1d objects -----------
-
-
-#if deal_II_dimension == 1
-
-template <>
-void DoFObjectAccessor<1, hp::DoFHandler<1> >::set_vertex_dof_index (const unsigned int vertex,
-                                                                     const unsigned int i,
-                                                                     const unsigned int index,
-                                                                     const unsigned int fe_index) const
-{
-  internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
-                                                   this->vertex_index(vertex),
-                                                   fe_index,
-                                                   i,
-                                                   index);
-}
-
-
-#endif
-
-
-
-
-// --------------- hp::DoFHandler specializations for 2d objects -----------
-
-
-
-#if deal_II_dimension == 2
-
-template <>
-void DoFObjectAccessor<1, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int vertex,
-                                                                     const unsigned int i,
-                                                                     const unsigned int index,
-                                                                     const unsigned int fe_index) const
-{
-  internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
-                                                   this->vertex_index(vertex),
-                                                   fe_index,
-                                                   i,
-                                                   index);
-}
-
-template <>
-void DoFObjectAccessor<2, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int vertex,
-                                                                     const unsigned int i,
-                                                                     const unsigned int index,
-                                                                     const unsigned int fe_index) const
-{
-  internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
-                                                   this->vertex_index(vertex),
-                                                   fe_index,
-                                                   i,
-                                                   index);
-}
-
-
-#endif
-
-
-
-// --------------- hp::DoFHandler specializations for 3d objects -----------
-
-#if deal_II_dimension == 3
-
-template <>
-void DoFObjectAccessor<1, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int vertex,
-                                                                     const unsigned int i,
-                                                                     const unsigned int index,
-                                                                     const unsigned int fe_index) const
-{
-  internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
-                                                   this->vertex_index(vertex),
-                                                   fe_index,
-                                                   i,
-                                                   index);
-}
-
-template <>
-void DoFObjectAccessor<2, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int vertex,
-                                                                     const unsigned int i,
-                                                                     const unsigned int index,
-                                                                     const unsigned int fe_index) const
-{
-  internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
-                                                   this->vertex_index(vertex),
-                                                   fe_index,
-                                                   i,
-                                                   index);
-}
-
-
-template <>
-void DoFObjectAccessor<3, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int vertex,
-                                                                     const unsigned int i,
-                                                                     const unsigned int index,
-                                                                     const unsigned int fe_index) const
-{
-  internal::hp::DoFLevel<0>::set_vertex_dof_index (*this->dof_handler,
-                                                   this->vertex_index(vertex),
-                                                   fe_index,
-                                                   i,
-                                                   index);
-}
-
-
-#endif
-
-
 /*------------------------- Functions: DoFCellAccessor -----------------------*/
 
 
index a03584683bb40431970b88f6591346bccdeccd38..aefa556a6fb17b546da04c6fe776dbe37b0eb337 100644 (file)
@@ -48,99 +48,7 @@ namespace internal
               MemoryConsumption::memory_consumption (hex_dofs) +
               MemoryConsumption::memory_consumption (dof_hex_index_offset));
     }
-
-
-
     
-    template <int dim>
-    unsigned int
-    DoFLevel<0>::
-    get_vertex_dof_index (const ::hp::DoFHandler<dim> &dof_handler,
-                          const unsigned int           vertex_index,
-                          const unsigned int           fe_index,
-                          const unsigned int           local_index)
-    {
-      Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
-              ExcMessage ("You need to specify a FE index when working "
-                          "with hp DoFHandlers"));
-      Assert (&dof_handler != 0,
-              ExcMessage ("No DoFHandler is specified for this iterator"));
-      Assert (&dof_handler.get_fe() != 0,
-              ExcMessage ("No finite element collection is associated with "
-                          "this DoFHandler"));
-      Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_vertex,
-              ExcIndexRange(local_index, 0,
-                            dof_handler.get_fe()[fe_index].dofs_per_vertex));
-
-                                       // hop along the list of index
-                                       // sets until we find the one
-                                       // with the correct fe_index, and
-                                       // then poke into that
-                                       // part. trigger an exception if
-                                       // we can't find a set for this
-                                       // particular fe_index
-      const unsigned int starting_offset
-        = dof_handler.vertex_dofs_offsets[vertex_index];
-      const unsigned int *pointer
-        = &dof_handler.vertex_dofs[starting_offset];
-      while (true)
-        {
-          Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
-                  ExcInternalError());
-          if (*pointer == fe_index)
-            return *(pointer + 1 + local_index);
-          else
-            pointer += dof_handler.get_fe()[*pointer].dofs_per_vertex;
-        }
-    }  
-
-
-
-    template <int dim>
-    void
-    DoFLevel<0>::
-    set_vertex_dof_index (::hp::DoFHandler<dim> &dof_handler,
-                          const unsigned int           vertex_index,
-                          const unsigned int           fe_index,
-                          const unsigned int           local_index,
-                          const unsigned int           global_index)
-    {
-      Assert (fe_index != ::hp::DoFHandler<dim>::default_fe_index,
-              ExcMessage ("You need to specify a FE index when working "
-                          "with hp DoFHandlers"));
-      Assert (&dof_handler != 0,
-              ExcMessage ("No DoFHandler is specified for this iterator"));
-      Assert (&dof_handler.get_fe() != 0,
-              ExcMessage ("No finite element collection is associated with "
-                          "this DoFHandler"));
-      Assert (local_index < dof_handler.get_fe()[fe_index].dofs_per_vertex,
-              ExcIndexRange(local_index, 0,
-                            dof_handler.get_fe()[fe_index].dofs_per_vertex));
-
-                                       // hop along the list of index
-                                       // sets until we find the one
-                                       // with the correct fe_index, and
-                                       // then poke into that
-                                       // part. trigger an exception if
-                                       // we can't find a set for this
-                                       // particular fe_index
-      const unsigned int starting_offset
-        = dof_handler.vertex_dofs_offsets[vertex_index];
-      unsigned int *pointer
-        = &dof_handler.vertex_dofs[starting_offset];
-      while (true)
-        {
-          Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
-                  ExcInternalError());
-          if (*pointer == fe_index)
-            {
-              *(pointer + 1 + local_index) = global_index;
-              return;
-            }
-          else
-            pointer += dof_handler.get_fe()[*pointer].dofs_per_vertex;
-        }
-    }  
 
 
 
@@ -539,23 +447,6 @@ namespace internal
     
 
 // explicit instantiations
-    template
-    unsigned int
-    DoFLevel<0>::
-    get_vertex_dof_index (const ::hp::DoFHandler<deal_II_dimension> &dof_handler,
-                          const unsigned int           vertex_index,
-                          const unsigned int           fe_index,
-                          const unsigned int           local_index);
-    
-    template
-    void
-    DoFLevel<0>::
-    set_vertex_dof_index (::hp::DoFHandler<deal_II_dimension> &dof_handler,
-                          const unsigned int           vertex_index,
-                          const unsigned int           fe_index,
-                          const unsigned int           local_index,
-                          const unsigned int           global_index);
-
     template
     unsigned int
     DoFLevel<1>::

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.