-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>
-inline
-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);
-}
-
-
-
namespace internal
{
namespace DoFAccessor
obj_index,
n);
}
+
+ /**
+ * 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.
+ */
+ template <int dim, int spacedim>
+ static
+ void
+ set_vertex_dof_index (dealii::DoFHandler<dim,spacedim> &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 == dealii::DoFHandler<dim,spacedim>::default_fe_index),
+ ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
+ Assert (dof_handler.selected_fe != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.selected_fe->dofs_per_vertex,
+ ExcIndexRange(local_index, 0,
+ dof_handler.selected_fe->dofs_per_vertex));
+
+ dof_handler.vertex_dofs[vertex_index *
+ dof_handler.selected_fe->dofs_per_vertex
+ + local_index]
+ = global_index;
+ }
+
+
+ template <int dim, int spacedim>
+ static
+ void
+ set_vertex_dof_index (dealii::hp::DoFHandler<dim,spacedim> &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 != dealii::hp::DoFHandler<dim,spacedim>::default_fe_index),
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (dof_handler.finite_elements != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < (*dof_handler.finite_elements)[fe_index].dofs_per_vertex,
+ ExcIndexRange(local_index, 0,
+ (*dof_handler.finite_elements)[fe_index].dofs_per_vertex));
+ Assert (fe_index < dof_handler.finite_elements->size(),
+ ExcInternalError());
+ Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
+ numbers::invalid_unsigned_int,
+ ExcMessage ("This vertex is unused and has no DoFs associated with it"));
+
+ // 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 <= &dof_handler.vertex_dofs.back(), ExcInternalError());
+
+ const unsigned int this_fe_index = *pointer;
+
+ Assert (this_fe_index != numbers::invalid_unsigned_int,
+ ExcInternalError());
+ Assert (this_fe_index < dof_handler.finite_elements->size(),
+ ExcInternalError());
+
+ if (this_fe_index == fe_index)
+ {
+ *(pointer + 1 + local_index) = global_index;
+ return;
+ }
+ else
+ pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+ }
+ }
+
+
+ /**
+ * 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.
+ */
+
+ template <int dim, int spacedim>
+ static
+ unsigned int
+ get_vertex_dof_index (const dealii::DoFHandler<dim,spacedim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index)
+ {
+ Assert ((fe_index == dealii::DoFHandler<dim,spacedim>::default_fe_index),
+ ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects"));
+ Assert (dof_handler.selected_fe != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < dof_handler.selected_fe->dofs_per_vertex,
+ ExcIndexRange(local_index, 0,
+ dof_handler.selected_fe->dofs_per_vertex));
+
+ return
+ dof_handler.vertex_dofs[vertex_index *
+ dof_handler.selected_fe->dofs_per_vertex
+ + local_index];
+ }
+
+
+ template<int dim, int spacedim>
+ static
+ unsigned int
+ get_vertex_dof_index (const dealii::hp::DoFHandler<dim,spacedim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index,
+ const unsigned int local_index)
+ {
+ Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::default_fe_index),
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (dof_handler.finite_elements != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (local_index < (*dof_handler.finite_elements)[fe_index].dofs_per_vertex,
+ ExcIndexRange(local_index, 0,
+ (*dof_handler.finite_elements)[fe_index].dofs_per_vertex));
+ Assert (vertex_index < dof_handler.vertex_dofs_offsets.size(),
+ ExcIndexRange (vertex_index, 0,
+ dof_handler.vertex_dofs_offsets.size()));
+ Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
+ numbers::invalid_unsigned_int,
+ ExcMessage ("This vertex is unused and has no DoFs associated with it"));
+
+ // 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 <= &dof_handler.vertex_dofs.back(), ExcInternalError());
+
+ const unsigned int this_fe_index = *pointer;
+
+ Assert (this_fe_index != numbers::invalid_unsigned_int,
+ ExcInternalError());
+ Assert (this_fe_index < dof_handler.finite_elements->size(),
+ ExcInternalError());
+
+ if (this_fe_index == fe_index)
+ return *(pointer + 1 + local_index);
+ else
+ pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+ }
+ }
+
+
+ /**
+ * Return the number of
+ * different finite elements
+ * that are active on a given
+ * vertex.
+ */
+ template<int dim, int spacedim>
+ static
+ unsigned int
+ n_active_vertex_fe_indices (const dealii::hp::DoFHandler<dim,spacedim> &dof_handler,
+ const unsigned int vertex_index)
+ {
+ Assert (dof_handler.finite_elements != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+
+ // if this vertex is unused, return 0
+ if (dof_handler.vertex_dofs_offsets[vertex_index] == numbers::invalid_unsigned_int)
+ return 0;
+
+ // hop along the list of index
+ // sets and count the number of
+ // hops
+ const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+ const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset];
+
+ Assert (*pointer != numbers::invalid_unsigned_int,
+ ExcInternalError());
+
+ unsigned int counter = 0;
+ while (true)
+ {
+ Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
+
+ const unsigned int this_fe_index = *pointer;
+
+ if (this_fe_index == numbers::invalid_unsigned_int)
+ return counter;
+ else
+ {
+ pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+ ++counter;
+ }
+ }
+ }
+
+
+
+ /**
+ * Return the fe index of the
+ * n-th finite element active
+ * on a given vertex.
+ */
+ template<int dim, int spacedim>
+ static
+ unsigned int
+ nth_active_vertex_fe_index (const dealii::hp::DoFHandler<dim,spacedim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int n)
+ {
+ Assert (dof_handler.finite_elements != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (n < n_active_vertex_fe_indices(dof_handler, vertex_index),
+ ExcIndexRange (n, 0, n_active_vertex_fe_indices(dof_handler,
+ vertex_index)));
+ // make sure we don't ask on
+ // unused vertices
+ Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
+ numbers::invalid_unsigned_int,
+ ExcInternalError());
+
+ // hop along the list of index
+ // sets and count the number of
+ // hops
+ const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+ const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset];
+
+ Assert (*pointer != numbers::invalid_unsigned_int,
+ ExcInternalError());
+
+ unsigned int counter = 0;
+ while (true)
+ {
+ Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
+
+ const unsigned int this_fe_index = *pointer;
+
+ Assert (this_fe_index < dof_handler.finite_elements->size(),
+ ExcInternalError());
+
+ if (counter == n)
+ return this_fe_index;
+
+ Assert (this_fe_index != numbers::invalid_unsigned_int,
+ ExcInternalError());
+
+ pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+ ++counter;
+ }
+ }
+
+
+
+ /**
+ * Return whether a particular
+ * finite element index is
+ * active on the specified
+ * vertex.
+ */
+ template<int dim, int spacedim>
+ static
+ bool
+ fe_is_active_on_vertex (const dealii::hp::DoFHandler<dim,spacedim> &dof_handler,
+ const unsigned int vertex_index,
+ const unsigned int fe_index)
+ {
+ Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::default_fe_index),
+ ExcMessage ("You need to specify a FE index when working "
+ "with hp DoFHandlers"));
+ Assert (dof_handler.finite_elements != 0,
+ ExcMessage ("No finite element collection is associated with "
+ "this DoFHandler"));
+ Assert (fe_index < dof_handler.finite_elements->size(),
+ ExcInternalError());
+
+ // make sure we don't ask on
+ // unused vertices
+ Assert (dof_handler.vertex_dofs_offsets[vertex_index] !=
+ numbers::invalid_unsigned_int,
+ ExcInternalError());
+
+ // hop along the list of index
+ // sets and see whether we find
+ // the given index
+ const unsigned int starting_offset = dof_handler.vertex_dofs_offsets[vertex_index];
+ const unsigned int *pointer = &dof_handler.vertex_dofs[starting_offset];
+
+ Assert (*pointer != numbers::invalid_unsigned_int,
+ ExcInternalError());
+
+ while (true)
+ {
+ Assert (pointer <= &dof_handler.vertex_dofs.back(), ExcInternalError());
+
+ const unsigned int this_fe_index = *pointer;
+
+ Assert (this_fe_index < dof_handler.finite_elements->size(),
+ ExcInternalError());
+
+ if (this_fe_index == numbers::invalid_unsigned_int)
+ return false;
+ else
+ if (this_fe_index == fe_index)
+ return true;
+ else
+ pointer += (*dof_handler.finite_elements)[this_fe_index].dofs_per_vertex + 1;
+ }
+ }
+
};
}
}
+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
+ internal::DoFAccessor::Implementation::get_vertex_dof_index
+ (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i);
+}
+
+
+
+template <int structdim, class DH>
+inline
+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
+{
+ internal::DoFAccessor::Implementation::set_vertex_dof_index
+ (*this->dof_handler,
+ this->vertex_index(vertex),
+ fe_index,
+ i,
+ index);
+}
+
+
+
+
+
+
namespace internal
{
namespace DoFAccessor
* Free all used memory.
*/
void clear_space ();
-
- /**
- * 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
* <tt>levels[]</tt> tree of the
* Triangulation objects.
*/
- std::vector<internal::DoFHandler::DoFLevel<dim>*> levels;
+ std::vector<internal::DoFHandler::DoFLevel<dim>*> levels;
/**
* Space to store DoF numbers of
* hierarchically, but in a flat
* array.
*/
- internal::DoFHandler::DoFFaces<dim> * faces;
+ internal::DoFHandler::DoFFaces<dim> *faces;
/**
* Store the number of dofs
-template <int dim, int spacedim>
-inline
-unsigned int
-DoFHandler<dim,spacedim>::
-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,spacedim>::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, int spacedim>
-inline
-void
-DoFHandler<dim,spacedim>::
-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,spacedim>::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
virtual void pre_refinement_notification (const Triangulation<dim,spacedim> &tria);
virtual void post_refinement_notification (const Triangulation<dim,spacedim> &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;
-
- /**
- * Return the number of
- * different finite elements
- * that are active on a given
- * vertex.
- */
- unsigned int
- n_active_vertex_fe_indices (const unsigned int vertex_index) const;
-
- /**
- * Return the fe index of the
- * n-th finite element active
- * on a given vertex.
- */
- unsigned int
- nth_active_vertex_fe_index (const unsigned int vertex_index,
- const unsigned int n) const;
-
- /**
- * Return whether a particular
- * finite element index is
- * active on the specified
- * vertex.
- */
- bool
- fe_is_active_on_vertex (const unsigned int vertex_index,
- const unsigned int fe_index) const;
-
/**
* Compute identities between
* DoFs located on
*
* Access to this field is
* generally through the
- * get_vertex_dof_index() and
- * set_vertex_dof_index()
+ * DoFAccessor::get_vertex_dof_index() and
+ * DoFAccessor::set_vertex_dof_index()
* functions, encapsulating the
* actual data format used to
* the present class.
*
* Access to this field is
* generally through the
- * get_vertex_dof_index() and
- * set_vertex_dof_index()
+ * Accessor::get_vertex_dof_index() and
+ * Accessor::set_vertex_dof_index()
* functions, encapsulating the
* actual data format used to
* the present class.
- template<int dim, int spacedim>
- inline
- unsigned int
- DoFHandler<dim,spacedim>::
- get_vertex_dof_index (const unsigned int vertex_index,
- const unsigned int fe_index,
- const unsigned int local_index) const
- {
- Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::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));
- Assert (vertex_index < vertex_dofs_offsets.size(),
- ExcIndexRange (vertex_index, 0, vertex_dofs_offsets.size()));
- Assert (vertex_dofs_offsets[vertex_index] !=
- numbers::invalid_unsigned_int,
- ExcMessage ("This vertex is unused and has no DoFs associated with it"));
-
- // 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 <= &vertex_dofs.back(), ExcInternalError());
-
- const unsigned int this_fe_index = *pointer;
-
- Assert (this_fe_index != numbers::invalid_unsigned_int,
- ExcInternalError());
- Assert (this_fe_index < finite_elements->size(),
- ExcInternalError());
-
- if (this_fe_index == fe_index)
- return *(pointer + 1 + local_index);
- else
- pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1;
- }
- }
-
-
-
- template <int dim, int spacedim>
- inline
- void
- DoFHandler<dim,spacedim>::
- 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 != dealii::hp::DoFHandler<dim,spacedim>::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));
- Assert (fe_index < finite_elements->size(),
- ExcInternalError());
- Assert (vertex_dofs_offsets[vertex_index] !=
- numbers::invalid_unsigned_int,
- ExcMessage ("This vertex is unused and has no DoFs associated with it"));
-
- // 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 <= &vertex_dofs.back(), ExcInternalError());
-
- const unsigned int this_fe_index = *pointer;
-
- Assert (this_fe_index != numbers::invalid_unsigned_int,
- ExcInternalError());
- Assert (this_fe_index < finite_elements->size(),
- ExcInternalError());
-
- if (this_fe_index == fe_index)
- {
- *(pointer + 1 + local_index) = global_index;
- return;
- }
- else
- pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1;
- }
- }
-
-
-
- template<int dim, int spacedim>
- inline
- unsigned int
- DoFHandler<dim,spacedim>::
- n_active_vertex_fe_indices (const unsigned int vertex_index) const
- {
- Assert (finite_elements != 0,
- ExcMessage ("No finite element collection is associated with "
- "this DoFHandler"));
-
- // if this vertex is unused, return 0
- if (vertex_dofs_offsets[vertex_index] == numbers::invalid_unsigned_int)
- return 0;
-
- // hop along the list of index
- // sets and count the number of
- // hops
- const unsigned int starting_offset = vertex_dofs_offsets[vertex_index];
- const unsigned int *pointer = &vertex_dofs[starting_offset];
-
- Assert (*pointer != numbers::invalid_unsigned_int,
- ExcInternalError());
-
- unsigned int counter = 0;
- while (true)
- {
- Assert (pointer <= &vertex_dofs.back(), ExcInternalError());
-
- const unsigned int this_fe_index = *pointer;
-
- if (this_fe_index == numbers::invalid_unsigned_int)
- return counter;
- else
- {
- pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1;
- ++counter;
- }
- }
- }
-
-
-
- template<int dim, int spacedim>
- inline
- unsigned int
- DoFHandler<dim,spacedim>::
- nth_active_vertex_fe_index (const unsigned int vertex_index,
- const unsigned int n) const
- {
- Assert (finite_elements != 0,
- ExcMessage ("No finite element collection is associated with "
- "this DoFHandler"));
- Assert (n < n_active_vertex_fe_indices(vertex_index),
- ExcIndexRange (n, 0, n_active_vertex_fe_indices(vertex_index)));
- // make sure we don't ask on
- // unused vertices
- Assert (vertex_dofs_offsets[vertex_index] !=
- numbers::invalid_unsigned_int,
- ExcInternalError());
-
- // hop along the list of index
- // sets and count the number of
- // hops
- const unsigned int starting_offset = vertex_dofs_offsets[vertex_index];
- const unsigned int *pointer = &vertex_dofs[starting_offset];
-
- Assert (*pointer != numbers::invalid_unsigned_int,
- ExcInternalError());
-
- unsigned int counter = 0;
- while (true)
- {
- Assert (pointer <= &vertex_dofs.back(), ExcInternalError());
-
- const unsigned int this_fe_index = *pointer;
-
- Assert (this_fe_index < finite_elements->size(),
- ExcInternalError());
-
- if (counter == n)
- return this_fe_index;
-
- Assert (this_fe_index != numbers::invalid_unsigned_int,
- ExcInternalError());
-
- pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1;
- ++counter;
- }
- }
-
-
-
- template<int dim, int spacedim>
- inline
- bool
- DoFHandler<dim,spacedim>::
- fe_is_active_on_vertex (const unsigned int vertex_index,
- const unsigned int fe_index) const
- {
- Assert ( (fe_index != dealii::hp::DoFHandler<dim,spacedim>::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 (fe_index < finite_elements->size(),
- ExcInternalError());
-
- // make sure we don't ask on
- // unused vertices
- Assert (vertex_dofs_offsets[vertex_index] !=
- numbers::invalid_unsigned_int,
- ExcInternalError());
-
- // hop along the list of index
- // sets and see whether we find
- // the given index
- const unsigned int starting_offset = vertex_dofs_offsets[vertex_index];
- const unsigned int *pointer = &vertex_dofs[starting_offset];
-
- Assert (*pointer != numbers::invalid_unsigned_int,
- ExcInternalError());
-
- while (true)
- {
- Assert (pointer <= &vertex_dofs.back(), ExcInternalError());
-
- const unsigned int this_fe_index = *pointer;
-
- Assert (this_fe_index < finite_elements->size(),
- ExcInternalError());
-
- if (this_fe_index == numbers::invalid_unsigned_int)
- return false;
- else
- if (this_fe_index == fe_index)
- return true;
- else
- pointer += (*finite_elements)[this_fe_index].dofs_per_vertex + 1;
- }
- }
-
#endif
++vertex_index)
{
const unsigned int n_active_fe_indices
- = n_active_vertex_fe_indices (vertex_index);
+ = internal::DoFAccessor::Implementation::
+ n_active_vertex_fe_indices (*this, vertex_index);
if (n_active_fe_indices > 1)
{
const unsigned int
- first_fe_index = nth_active_vertex_fe_index (vertex_index, 0);
+ first_fe_index
+ = internal::DoFAccessor::Implementation::
+ nth_active_vertex_fe_index (*this, vertex_index, 0);
// loop over all the
// other FEs with which
for (unsigned int f=1; f<n_active_fe_indices; ++f)
{
const unsigned int
- other_fe_index = nth_active_vertex_fe_index (vertex_index, f);
+ other_fe_index
+ = internal::DoFAccessor::Implementation::
+ nth_active_vertex_fe_index (*this, vertex_index, f);
// make sure the
// entry in the
for (unsigned int i=0; i<identities.size(); ++i)
{
const unsigned int lower_dof_index
- = get_vertex_dof_index (vertex_index,
- first_fe_index,
- identities[i].first);
+ = internal::DoFAccessor::Implementation::
+ get_vertex_dof_index (*this,
+ vertex_index,
+ first_fe_index,
+ identities[i].first);
const unsigned int higher_dof_index
- = get_vertex_dof_index (vertex_index,
- other_fe_index,
- identities[i].second);
+ = internal::DoFAccessor::Implementation::
+ get_vertex_dof_index (*this,
+ vertex_index,
+ other_fe_index,
+ identities[i].second);
Assert ((new_dof_indices[higher_dof_index] ==
numbers::invalid_unsigned_int)
++vertex_index)
{
const unsigned int n_active_fe_indices
- = n_active_vertex_fe_indices (vertex_index);
+ = internal::DoFAccessor::Implementation::
+ n_active_vertex_fe_indices (*this, vertex_index);
for (unsigned int f=0; f<n_active_fe_indices; ++f)
{
const unsigned int fe_index
- = nth_active_vertex_fe_index (vertex_index, f);
+ = internal::DoFAccessor::Implementation::
+ nth_active_vertex_fe_index (*this, vertex_index, f);
for (unsigned int d=0; d<(*finite_elements)[fe_index].dofs_per_vertex; ++d)
- set_vertex_dof_index (vertex_index,
- fe_index,
- d,
- new_numbers[get_vertex_dof_index(vertex_index,
- fe_index,
- d)]);
+ {
+ const unsigned int vertex_dof_index
+ = internal::DoFAccessor::Implementation::
+ get_vertex_dof_index(*this,
+ vertex_index,
+ fe_index,
+ d);
+ internal::DoFAccessor::Implementation::
+ set_vertex_dof_index (*this,
+ vertex_index,
+ fe_index,
+ d,
+ new_numbers[vertex_dof_index]);
+ }
}
}
}