]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Split out functions that are different between DoFHandler and hp::DoFHandler. The...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Apr 2006 22:13:59 +0000 (22:13 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Apr 2006 22:13:59 +0000 (22:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@12914 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_accessor.templates.h

index 226cbe2f59d2c7000f6c399a5f09212d9032ef99..63761b4c65ff4a726d8adb204e6849a362006b5b 100644 (file)
@@ -222,10 +222,12 @@ class DoFObjectAccessor_Inheritance<dim,dim>
  * Common template for access to the data on a line, quad, hex. Note
  * that this class is only here for documentation purposes, the actual
  * implementation of functions is in classes with specialized template
- * parameters. In this class here, we only collect all functions which
- * are in the specialized classes for simpler reference. Some
- * functions, however, might be missing in the specialized classes,
- * such as @p quad in the accessors for lines and quads, etc.
+ * parameters (see @ref DoFObjectAccessor<1,DH>, @ref
+ * DoFObjectAccessor<2,DH>, @ref DoFObjectAccessor<3,DH>). In this
+ * class here, we only collect all functions which are in the
+ * specialized classes for simpler reference. Some functions, however,
+ * might be missing in the specialized classes, such as @p quad in the
+ * accessors for lines and quads, etc.
  *
  * This class follows mainly the route laid out by the accessor library
  * declared in the triangulation library (TriaAccessor). It enables
@@ -250,7 +252,7 @@ class DoFObjectAccessor_Inheritance<dim,dim>
  * documentation directory.
  *
  * @ingroup dofs
- * @ingroup Accessors 
+ * @ingroup Accessors
  * @author Wolfgang Bangerth, 1998; Guido Kanschat, 1999
  */
 template <int celldim, class DH>
@@ -497,6 +499,7 @@ class DoFObjectAccessor : public DoFAccessor<DH>,
 /**
  * Closure class.
  * @ingroup dofs
+ * @ingroup Accessors
  */
 template <class DH>
 class DoFObjectAccessor<0, DH> : public DoFAccessor<DH>,
@@ -552,6 +555,7 @@ class DoFObjectAccessor<0, DH> : public DoFAccessor<DH>,
  * like an ordinary line in all other cases.
  *
  * @ingroup dofs
+ * @ingroup Accessors
  * @author Wolfgang Bangerth, 1998
  */
 template <class DH>
@@ -782,6 +786,7 @@ class DoFObjectAccessor<1, DH> :
  * Grant access to the degrees of freedom located on quads.
  *
  * @ingroup dofs
+ * @ingroup Accessors
  */
 template <class DH>
 class DoFObjectAccessor<2, DH> :
@@ -1020,6 +1025,7 @@ class DoFObjectAccessor<2, DH> :
  * Grant access to the degrees of freedom located on hexes.
  *
  * @ingroup dofs
+ * @ingroup Accessors
  */
 template <class DH>
 class DoFObjectAccessor<3, DH> :
@@ -1278,6 +1284,7 @@ class DoFObjectAccessor<3, DH> :
  * DoFCellAccessor class as well.
  *
  * @ingroup dofs
+ * @ingroup Accessors
  * @author Wolfgang Bangerth, 1998
  */
 template <class DH>
index c1fd53f8342bfae42d19ca4d8a870366ddcbf632..050c7d6fc5fe1249167323c3b561be8279cf2f25 100644 (file)
@@ -128,122 +128,6 @@ DoFObjectAccessor (const Triangulation<DH::dimension> *tria,
 
 
 
-template <class DH>
-inline
-unsigned int
-DoFObjectAccessor<1,DH>::dof_index (const unsigned int i) const
-{
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-                                   // since the exception classes are
-                                  // from a template dependent base
-                                  // class, we have to fully qualify
-                                  // them. to work around more
-                                  // trouble, typedef the template
-                                  // dependent base class to a
-                                  // non-template dependent name and
-                                  // use that to specify the
-                                  // qualified exception names
-  typedef DoFAccessor<DH> BaseClass;
-  
-  Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject());
-  Assert (i<this->get_fe().dofs_per_line,
-         ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
-
-  return this->dof_handler->levels[this->present_level]
-    ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i];
-}
-
-
-
-template <class DH>
-inline
-unsigned int
-DoFObjectAccessor<1,DH>::vertex_dof_index (const unsigned int vertex,
-                                           const unsigned int i) const
-{
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-                                   // since the exception classes are
-                                  // from a template dependent base
-                                  // class, we have to fully qualify
-                                  // them. to work around more
-                                  // trouble, typedef the template
-                                  // dependent base class to a
-                                  // non-template dependent name and
-                                  // use that to specify the
-                                  // qualified exception names
-  typedef DoFAccessor<DH> BaseClass;
-  
-  Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
-  Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject());
-  Assert (vertex<2, ExcIndexRange (i,0,2));
-  Assert (i<this->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
-
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
-template <class DH>
-inline
-void
-DoFObjectAccessor<1,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
-{
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-                                   // since the exception classes are
-                                  // from a template dependent base
-                                  // class, we have to fully qualify
-                                  // them. to work around more
-                                  // trouble, typedef the template
-                                  // dependent base class to a
-                                  // non-template dependent name and
-                                  // use that to specify the
-                                  // qualified exception names
-  typedef DoFAccessor<DH> BaseClass;
-  
-  Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
-  Assert (&this->get_fe() != 0, typename BaseClass::ExcInvalidObject());
-  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
-                                this->get_fe().dofs_per_line),
-         typename BaseClass::ExcVectorDoesNotMatch());
-
-                                  // this function really only makes
-                                  // sense on non-active objects if
-                                  // all degrees of freedom are
-                                  // located on vertices, since
-                                  // otherwise there are degrees of
-                                  // freedom on sub-objects which are
-                                  // not allocated for this
-                                  // non-active thing
-  Assert (!this->has_children() ||
-         (this->get_fe().dofs_per_cell ==
-          2*this->get_fe().dofs_per_vertex),
-         typename BaseClass::ExcNotActive());
-  
-  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
-                    dofs_per_line   = this->get_fe().dofs_per_line;
-  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);
-  for (unsigned int d=0; d<dofs_per_line; ++d)
-    *next++ = dof_index(d);
-}
-
-
-
 template <class DH>
 inline
 TriaIterator<DH::dimension,DoFObjectAccessor<1,DH> >
@@ -347,104 +231,6 @@ DoFObjectAccessor (const Triangulation<DH::dimension> *tria,
 
 
 
-template <class DH>
-inline
-unsigned int
-DoFObjectAccessor<2,DH>::dof_index (const unsigned int i) const
-{
-  typedef DoFAccessor<DH> BaseClass;
-  
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->get_fe().dofs_per_quad,
-         ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  return this->dof_handler->levels[this->present_level]
-    ->quad_dofs[this->present_index*this->get_fe().dofs_per_quad+i];
-}
-
-
-
-template <class DH>
-inline
-unsigned int
-DoFObjectAccessor<2,DH>::vertex_dof_index (const unsigned int vertex,
-                                          const unsigned int i) const
-{
-  typedef DoFAccessor<DH> BaseClass;
-
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (&this->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (vertex<4, ExcIndexRange (i,0,4));
-  Assert (i<this->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->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->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
-}
-
-
-
-template <class DH>
-inline
-void
-DoFObjectAccessor<2,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
-{
-  typedef DoFAccessor<DH> BaseClass;
-
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (&this->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex +
-                                4*this->get_fe().dofs_per_line +
-                                this->get_fe().dofs_per_quad),
-         typename BaseClass::ExcVectorDoesNotMatch());
-
-                                  // this function really only makes
-                                  // sense on non-active objects if
-                                  // all degrees of freedom are
-                                  // located on vertices, since
-                                  // otherwise there are degrees of
-                                  // freedom on sub-objects which are
-                                  // not allocated for this
-                                  // non-active thing
-  Assert (!this->has_children() ||
-         (this->get_fe().dofs_per_cell ==
-          4*this->get_fe().dofs_per_vertex),
-         typename BaseClass::ExcNotActive());
-  
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  
-  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
-                    dofs_per_line   = this->get_fe().dofs_per_line,
-                    dofs_per_quad   = this->get_fe().dofs_per_quad;
-  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);
-  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);
-  for (unsigned int d=0; d<dofs_per_quad; ++d)
-    *next++ = dof_index(d);
-}
-
-
-
 template <class DH>
 inline
 TriaIterator<DH::dimension,DoFObjectAccessor<1,DH> >
@@ -572,70 +358,620 @@ DoFObjectAccessor (const Triangulation<DH::dimension> *tria,
 
 template <class DH>
 inline
-unsigned int
-DoFObjectAccessor<3,DH>::dof_index (const unsigned int i) const
+TriaIterator<DH::dimension,DoFObjectAccessor<1,DH> >
+DoFObjectAccessor<3,DH>::line (const unsigned int i) const
 {
-  typedef DoFAccessor<DH> BaseClass;
-
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->get_fe().dofs_per_hex,
-         ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-
-  return this->dof_handler->levels[this->present_level]
-    ->hex_dofs[this->present_index*this->get_fe().dofs_per_hex+i];
+  TriaIterator<dim,TriaObjectAccessor<1,dim> > l = BaseClass::line(i);
+  return TriaIterator<dim,DoFObjectAccessor<1,DH> >
+    (
+      this->tria,
+      this->present_level,
+      l->index(),
+      this->dof_handler
+    );
 }
 
 
-
 template <class DH>
 inline
-unsigned int
-DoFObjectAccessor<3,DH>::vertex_dof_index (const unsigned int vertex,
-                                          const unsigned int i) const
+TriaIterator<DH::dimension,DoFObjectAccessor<2,DH> >
+DoFObjectAccessor<3,DH>::quad (const unsigned int i) const
 {
-  typedef DoFAccessor<DH> BaseClass;
-
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (&this->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (vertex<8, ExcIndexRange (i,0,8));
-  Assert (i<this->get_fe().dofs_per_vertex,
-         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
+  Assert (i<6, ExcIndexRange (i, 0, 6));
 
-  const unsigned int dof_number = (this->vertex_index(vertex) *
-                                  this->get_fe().dofs_per_vertex +
-                                  i);
-  return this->dof_handler->vertex_dofs[dof_number];
+  return TriaIterator<dim,DoFObjectAccessor<2,DH> >
+    (
+      this->tria,
+      this->present_level,
+      this->quad_index (i),
+      this->dof_handler
+    );
 }
 
 
-
 template <class DH>
 inline
-void
-DoFObjectAccessor<3,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+TriaIterator<DH::dimension,DoFObjectAccessor<3,DH> >
+DoFObjectAccessor<3,DH>::child (const unsigned int i) const
 {
-  typedef DoFAccessor<DH> BaseClass;
+  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;
+}
+
+
+template <class DH>
+inline
+const FiniteElement<DH::dimension> &
+DoFObjectAccessor<3,DH>::get_fe () const
+{
+  return *this->dof_handler->selected_fe;
+}
+
+
+
+template <class DH>
+inline
+unsigned int
+DoFObjectAccessor<3,DH>::active_fe_index () const
+{
+    return 0;
+}
+
+
+
+template <class DH>
+inline
+void
+DoFObjectAccessor<3,DH>::set_active_fe_index (const unsigned int i)
+{
+  typedef DoFAccessor<DH> BaseClass;
+  Assert (i == 0, typename BaseClass::ExcInvalidObject());
+}
+
+
+
+template <class DH>
+void DoFObjectAccessor<3,DH>::copy_from (const DoFObjectAccessor<3,DH> &a)
+{
+  BaseClass::copy_from (a);
+  this->set_dof_handler (a.dof_handler);
+}
+
+
+
+template <class DH>
+inline
+bool
+DoFObjectAccessor<3,DH>::operator == (const DoFObjectAccessor<3,DH> &a) const
+{
+  return (TriaObjectAccessor<3,dim>::operator == (a)
+          &&
+          DoFAccessor<DH>::operator == (a));
+}
+
+
+template <class DH>
+inline
+bool
+DoFObjectAccessor<3,DH>::operator != (const DoFObjectAccessor<3,DH> &a) const
+{
+  return (TriaObjectAccessor<3,dim>::operator != (a)
+          ||
+          DoFAccessor<DH>::operator != (a));
+}
+
+
+/*--------------- Functions: DoFObjectAccessor<1,DoFHandler> -----------*/
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,DoFHandler<1> >::dof_index (const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<1> >::ExcInvalidObject());
+                                  // make sure a FE has been selected
+                                  // and enough room was reserved
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<1> >::ExcInvalidObject());
+  Assert (i<this->get_fe().dofs_per_line,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+  return this->dof_handler->levels[this->present_level]
+    ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i];
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,DoFHandler<1> >::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<1> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<1> >::ExcInvalidObject());
+  Assert (vertex<2, ExcIndexRange (i,0,2));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<1,DoFHandler<1> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<1> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<1> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+                                this->get_fe().dofs_per_line),
+         DoFAccessor<DoFHandler<1> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          2*this->get_fe().dofs_per_vertex),
+         DoFAccessor<DoFHandler<1> >::ExcNotActive());
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line;
+  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);
+  for (unsigned int d=0; d<dofs_per_line; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,DoFHandler<2> >::dof_index (const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+                                  // make sure a FE has been selected
+                                  // and enough room was reserved
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (i<this->get_fe().dofs_per_line,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+  return this->dof_handler->levels[this->present_level]
+    ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i];
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (vertex<2, ExcIndexRange (i,0,2));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<1,DoFHandler<2> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+                                this->get_fe().dofs_per_line),
+         DoFAccessor<DoFHandler<2> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          2*this->get_fe().dofs_per_vertex),
+         DoFAccessor<DoFHandler<2> >::ExcNotActive());
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line;
+  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);
+  for (unsigned int d=0; d<dofs_per_line; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,DoFHandler<3> >::dof_index (const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+                                  // make sure a FE has been selected
+                                  // and enough room was reserved
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (i<this->get_fe().dofs_per_line,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
+
+  return this->dof_handler->levels[this->present_level]
+    ->line_dofs[this->present_index*this->get_fe().dofs_per_line+i];
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<1,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (vertex<2, ExcIndexRange (i,0,2));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<1,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+                                this->get_fe().dofs_per_line),
+         DoFAccessor<DoFHandler<3> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          2*this->get_fe().dofs_per_vertex),
+         DoFAccessor<DoFHandler<3> >::ExcNotActive());
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line;
+  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);
+  for (unsigned int d=0; d<dofs_per_line; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
+/*--------------- Functions: DoFObjectAccessor<2,DoFHandler> -----------*/
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,DoFHandler<2> >::dof_index (const unsigned int i) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+                                  // make sure a FE has been selected
+                                  // and enough room was reserved
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (i<this->get_fe().dofs_per_quad,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  return this->dof_handler->levels[this->present_level]
+    ->quad_dofs[this->present_index*this->get_fe().dofs_per_quad+i];
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
+                                          const unsigned int i) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (vertex<4, ExcIndexRange (i,0,4));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->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->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<2,DoFHandler<2> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<2> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex +
+                                4*this->get_fe().dofs_per_line +
+                                this->get_fe().dofs_per_quad),
+         DoFAccessor<DoFHandler<2> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          4*this->get_fe().dofs_per_vertex),
+         DoFAccessor<DoFHandler<2> >::ExcNotActive());
+  
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line,
+                    dofs_per_quad   = this->get_fe().dofs_per_quad;
+  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);
+  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);
+  for (unsigned int d=0; d<dofs_per_quad; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,DoFHandler<3> >::dof_index (const unsigned int i) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+                                  // make sure a FE has been selected
+                                  // and enough room was reserved
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (i<this->get_fe().dofs_per_quad,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  return this->dof_handler->levels[this->present_level]
+    ->quad_dofs[this->present_index*this->get_fe().dofs_per_quad+i];
+}
+
 
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
+                                          const unsigned int i) const
+{
   Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
   Assert (&this->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (vertex<4, ExcIndexRange (i,0,4));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->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->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<2,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex +
+                                4*this->get_fe().dofs_per_line +
+                                this->get_fe().dofs_per_quad),
+         DoFAccessor<DoFHandler<3> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          4*this->get_fe().dofs_per_vertex),
+         DoFAccessor<DoFHandler<3> >::ExcNotActive());
+  
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line,
+                    dofs_per_quad   = this->get_fe().dofs_per_quad;
+  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);
+  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);
+  for (unsigned int d=0; d<dofs_per_quad; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
+/*--------------- Functions: DoFObjectAccessor<3,DoFHandler> -----------*/
+
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<3,DoFHandler<3> >::dof_index (const unsigned int i) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+                                  // make sure a FE has been selected
+                                  // and enough room was reserved
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (i<this->get_fe().dofs_per_hex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  return this->dof_handler->levels[this->present_level]
+    ->hex_dofs[this->present_index*this->get_fe().dofs_per_hex+i];
+}
+
+
+
+template <>
+inline
+unsigned int
+DoFObjectAccessor<3,DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
+                                          const unsigned int i) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (vertex<8, ExcIndexRange (i,0,8));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->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->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<3,DoFHandler<3> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<DoFHandler<3> >::ExcInvalidObject());
   Assert (dof_indices.size() == (8*this->get_fe().dofs_per_vertex +
                                 12*this->get_fe().dofs_per_line +
                                 6*this->get_fe().dofs_per_quad +
                                 this->get_fe().dofs_per_hex),
-         typename BaseClass::ExcVectorDoesNotMatch());
+         DoFAccessor<DoFHandler<3> >::ExcVectorDoesNotMatch());
   Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
           ExcMessage ("DoFHandler not initialized"));
 
@@ -650,7 +986,7 @@ DoFObjectAccessor<3,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices
   Assert (!this->has_children() ||
          (this->get_fe().dofs_per_cell ==
           8*this->get_fe().dofs_per_vertex),
-         typename BaseClass::ExcNotActive());
+         DoFAccessor<DoFHandler<3> >::ExcNotActive());
   Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
           ExcMessage ("DoFHandler not initialized"));
   
@@ -674,120 +1010,147 @@ DoFObjectAccessor<3,DH>::get_dof_indices (std::vector<unsigned int> &dof_indices
 
 
 
-template <class DH>
-inline
-TriaIterator<DH::dimension,DoFObjectAccessor<1,DH> >
-DoFObjectAccessor<3,DH>::line (const unsigned int i) const
-{
-  TriaIterator<dim,TriaObjectAccessor<1,dim> > l = BaseClass::line(i);
-  return TriaIterator<dim,DoFObjectAccessor<1,DH> >
-    (
-      this->tria,
-      this->present_level,
-      l->index(),
-      this->dof_handler
-    );
-}
-
+/* -------------- hp vertex dofs stuff ------------------------------------ */
 
-template <class DH>
+template <>
 inline
-TriaIterator<DH::dimension,DoFObjectAccessor<2,DH> >
-DoFObjectAccessor<3,DH>::quad (const unsigned int i) const
+unsigned int
+DoFObjectAccessor<1,hp::DoFHandler<1> >::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
 {
-  Assert (i<6, ExcIndexRange (i, 0, 6));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("hp::DoFHandler not initialized"));
 
-  return TriaIterator<dim,DoFObjectAccessor<2,DH> >
-    (
-      this->tria,
-      this->present_level,
-      this->quad_index (i),
-      this->dof_handler
-    );
+  Assert (this->dof_handler != 0, DoFAccessor<hp::DoFHandler<1> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<hp::DoFHandler<1> >::ExcInvalidObject());
+  Assert (vertex<2, ExcIndexRange (i,0,2));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
 }
 
 
-template <class DH>
+
+template <>
 inline
-TriaIterator<DH::dimension,DoFObjectAccessor<3,DH> >
-DoFObjectAccessor<3,DH>::child (const unsigned int i) const
+unsigned int
+DoFObjectAccessor<1,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
+                                           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;
-}
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("hp::DoFHandler not initialized"));
 
+  Assert (this->dof_handler != 0, DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (vertex<2, ExcIndexRange (i,0,2));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
 
-template <class DH>
-inline
-const FiniteElement<DH::dimension> &
-DoFObjectAccessor<3,DH>::get_fe () const
-{
-  return *this->dof_handler->selected_fe;
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
 }
 
 
-
-template <class DH>
+template <>
 inline
 unsigned int
-DoFObjectAccessor<3,DH>::active_fe_index () const
+DoFObjectAccessor<1,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
+                                           const unsigned int i) const
 {
-    return 0;
-}
-
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("hp::DoFHandler not initialized"));
 
+  Assert (this->dof_handler != 0, DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (vertex<2, ExcIndexRange (i,0,2));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
 
-template <class DH>
-inline
-void
-DoFObjectAccessor<3,DH>::set_active_fe_index (const unsigned int i)
-{
-  typedef DoFAccessor<DH> BaseClass;
-  Assert (i == 0, typename BaseClass::ExcInvalidObject());
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
 }
 
 
-
-template <class DH>
-void DoFObjectAccessor<3,DH>::copy_from (const DoFObjectAccessor<3,DH> &a)
+template <>
+inline
+unsigned int
+DoFObjectAccessor<2,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int vertex,
+                                          const unsigned int i) const
 {
-  BaseClass::copy_from (a);
-  this->set_dof_handler (a.dof_handler);
+  Assert (this->dof_handler != 0,
+         DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (vertex<4, ExcIndexRange (i,0,4));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("hp::DoFHandler not initialized"));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
 }
 
 
 
-template <class DH>
+template <>
 inline
-bool
-DoFObjectAccessor<3,DH>::operator == (const DoFObjectAccessor<3,DH> &a) const
+unsigned int
+DoFObjectAccessor<2,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
+                                          const unsigned int i) const
 {
-  return (TriaObjectAccessor<3,dim>::operator == (a)
-          &&
-          DoFAccessor<DH>::operator == (a));
+  Assert (this->dof_handler != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (vertex<4, ExcIndexRange (i,0,4));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("hp::DoFHandler not initialized"));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
 }
 
 
-template <class DH>
+
+template <>
 inline
-bool
-DoFObjectAccessor<3,DH>::operator != (const DoFObjectAccessor<3,DH> &a) const
+unsigned int
+DoFObjectAccessor<3,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int vertex,
+                                          const unsigned int i) const
 {
-  return (TriaObjectAccessor<3,dim>::operator != (a)
-          ||
-          DoFAccessor<DH>::operator != (a));
+  Assert (this->dof_handler != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (vertex<4, ExcIndexRange (i,0,4));
+  Assert (i<this->get_fe().dofs_per_vertex,
+         ExcIndexRange (i, 0, this->get_fe().dofs_per_vertex));
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("hp::DoFHandler not initialized"));
+
+  const unsigned int dof_number = (this->vertex_index(vertex) *
+                                  this->get_fe().dofs_per_vertex +
+                                  i);
+  return this->dof_handler->vertex_dofs[dof_number];
 }
 
 
-/*--------------- Functions: DoFObjectAccessor<1,dim,hp::DoFHandler> -----------*/
+/*--------------- Functions: DoFObjectAccessor<1,hp::DoFHandler> -----------*/
 
 template <>
 inline
@@ -831,6 +1194,45 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::dof_index (const unsigned int i) const
 
 
 
+template <>
+inline
+void
+DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<hp::DoFHandler<1> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<hp::DoFHandler<1> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+                                this->get_fe().dofs_per_line),
+         DoFAccessor<hp::DoFHandler<1> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          2*this->get_fe().dofs_per_vertex),
+         DoFAccessor<hp::DoFHandler<1> >::ExcNotActive());
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line;
+  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);
+  for (unsigned int d=0; d<dofs_per_line; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
 template <>
 inline
 unsigned int
@@ -869,6 +1271,45 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::dof_index (const unsigned int i) const
 
 
 
+template <>
+inline
+void
+DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+                                this->get_fe().dofs_per_line),
+         DoFAccessor<hp::DoFHandler<2> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          2*this->get_fe().dofs_per_vertex),
+         DoFAccessor<hp::DoFHandler<2> >::ExcNotActive());
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line;
+  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);
+  for (unsigned int d=0; d<dofs_per_line; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
 template <>
 inline
 unsigned int
@@ -907,6 +1348,45 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::dof_index (const unsigned int i) const
 
 
 
+template <>
+inline
+void
+DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+  Assert (this->dof_handler != 0, DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0, DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (2*this->get_fe().dofs_per_vertex +
+                                this->get_fe().dofs_per_line),
+         DoFAccessor<hp::DoFHandler<3> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          2*this->get_fe().dofs_per_vertex),
+         DoFAccessor<hp::DoFHandler<3> >::ExcNotActive());
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line;
+  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);
+  for (unsigned int d=0; d<dofs_per_line; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
 template <>
 inline
 void
@@ -1135,7 +1615,7 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int
 }
 
 
-/*------------- Functions: DoFObjectAccessor<2,dim,hp::DoFHandler> -------------*/
+/*------------- Functions: DoFObjectAccessor<2,hp::DoFHandler> -------------*/
 
 template <>
 inline
@@ -1269,6 +1749,98 @@ DoFObjectAccessor<2, hp::DoFHandler<3> >::set_dof_index (const unsigned int i,
 
 
 
+template <>
+inline
+void
+DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<hp::DoFHandler<2> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex +
+                                4*this->get_fe().dofs_per_line +
+                                this->get_fe().dofs_per_quad),
+         DoFAccessor<hp::DoFHandler<2> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          4*this->get_fe().dofs_per_vertex),
+         DoFAccessor<hp::DoFHandler<2> >::ExcNotActive());
+  
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line,
+                    dofs_per_quad   = this->get_fe().dofs_per_quad;
+  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);
+  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);
+  for (unsigned int d=0; d<dofs_per_quad; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
+template <>
+inline
+void
+DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (4*this->get_fe().dofs_per_vertex +
+                                4*this->get_fe().dofs_per_line +
+                                this->get_fe().dofs_per_quad),
+         DoFAccessor<hp::DoFHandler<3> >::ExcVectorDoesNotMatch());
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          4*this->get_fe().dofs_per_vertex),
+         DoFAccessor<hp::DoFHandler<3> >::ExcNotActive());
+  
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line,
+                    dofs_per_quad   = this->get_fe().dofs_per_quad;
+  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);
+  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);
+  for (unsigned int d=0; d<dofs_per_quad; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
 template <>
 inline
 const FiniteElement<2> &
@@ -1358,7 +1930,7 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int
 }
 
 
-/*------------- Functions: DoFObjectAccessor<3,dim,hp::DoFHandler> -------------*/
+/*------------- Functions: DoFObjectAccessor<3,hp::DoFHandler> -------------*/
 
 template <>
 inline
@@ -1431,6 +2003,58 @@ DoFObjectAccessor<3, hp::DoFHandler<3> >::set_dof_index (const unsigned int i,
 
 
 
+template <>
+inline
+void
+DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_indices (std::vector<unsigned int> &dof_indices) const
+{
+  Assert (this->dof_handler != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (&this->get_fe() != 0,
+         DoFAccessor<hp::DoFHandler<3> >::ExcInvalidObject());
+  Assert (dof_indices.size() == (8*this->get_fe().dofs_per_vertex +
+                                12*this->get_fe().dofs_per_line +
+                                6*this->get_fe().dofs_per_quad +
+                                this->get_fe().dofs_per_hex),
+         DoFAccessor<hp::DoFHandler<3> >::ExcVectorDoesNotMatch());
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+
+                                  // this function really only makes
+                                  // sense on non-active objects if
+                                  // all degrees of freedom are
+                                  // located on vertices, since
+                                  // otherwise there are degrees of
+                                  // freedom on sub-objects which are
+                                  // not allocated for this
+                                  // non-active thing
+  Assert (!this->has_children() ||
+         (this->get_fe().dofs_per_cell ==
+          8*this->get_fe().dofs_per_vertex),
+         DoFAccessor<hp::DoFHandler<3> >::ExcNotActive());
+  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
+          ExcMessage ("DoFHandler not initialized"));
+  
+  const unsigned int dofs_per_vertex = this->get_fe().dofs_per_vertex,
+                    dofs_per_line   = this->get_fe().dofs_per_line,
+                    dofs_per_quad   = this->get_fe().dofs_per_quad,
+                    dofs_per_hex    = this->get_fe().dofs_per_hex;
+  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);
+  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);
+  for (unsigned int quad=0; quad<6; ++quad)
+    for (unsigned int d=0; d<dofs_per_quad; ++d)
+      *next++ = this->quad(quad)->dof_index(d);
+  for (unsigned int d=0; d<dofs_per_hex; ++d)
+    *next++ = dof_index(d);
+}
+
+
+
 template <>
 inline
 const FiniteElement<3> &
@@ -1478,6 +2102,7 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int
 }
 
 
+
 /*------------------------- Functions: DoFCellAccessor -----------------------*/
 
 template <class DH>

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.