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
*/
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
*/
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;
};
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
*/
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;
};
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
*/
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;
};
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
*/
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;
};
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> &
+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> -----------------------*/
-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> -----------------------*/
-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>
}
-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> -----------*/
-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
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);
}
-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
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);
}
-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
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);
}
-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
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);
-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
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);
-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
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);
/* -------------- 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> -----------*/
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);
}
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);
}
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);
}
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);
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);
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);
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
}
+
+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 ---------------------------*/
* 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
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
}
*/
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);
};
-
-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> -----------------------*/
-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> -----------------------*/
}
-
-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 -----------------------*/
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;
- }
- }
// 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>::