* to a @p{NULL} pointer.
*/
void clear_user_pointer () const;
-
+
/**
* Access the value of the user
* pointer. It is in the
*/
void * user_pointer () const;
+ /**
+ * Set the user pointer of this
+ * object and all its children to
+ * the given value. This is
+ * useful for example if all
+ * cells of a certain subdomain,
+ * or all faces of a certain part
+ * of the boundary should have
+ * user pointers pointing to
+ * objects describing this part
+ * of the domain or boundary.
+ *
+ * Note that the user pointer is
+ * not inherited under mesh
+ * refinement, so after mesh
+ * refinement there might be
+ * cells or faces that don't have
+ * user pointers pointing to the
+ * describing object. In this
+ * case, simply loop over all the
+ * elements of the coarsest level
+ * that has this information, and
+ * use this function to
+ * recursively set the user
+ * pointer of all finer levels of
+ * the triangulation.
+ */
+ void recursively_set_user_pointer (void *p) const;
+
+ /**
+ * Clear the user pointer of this
+ * object and all of its
+ * descendants. The same holds as
+ * said for the
+ * @ref{recursively_set_user_pointer}
+ * function.
+ */
+ void recursively_clear_user_pointer () const;
+
/**
* Pointer to the @p{i}th
* child.
*/
void set_user_pointer (void *p) const;
+ /**
+ * Set the user pointer of this
+ * object and all its children to
+ * the given value. This is
+ * useful for example if all
+ * cells of a certain subdomain,
+ * or all faces of a certain part
+ * of the boundary should have
+ * user pointers pointing to
+ * objects describing this part
+ * of the domain or boundary.
+ *
+ * Note that the user pointer is
+ * not inherited under mesh
+ * refinement, so after mesh
+ * refinement there might be
+ * cells or faces that don't have
+ * user pointers pointing to the
+ * describing object. In this
+ * case, simply loop over all the
+ * elements of the coarsest level
+ * that has this information, and
+ * use this function to
+ * recursively set the user
+ * pointer of all finer levels of
+ * the triangulation.
+ */
+ void recursively_set_user_pointer (void *p) const;
+
+ /**
+ * Clear the user pointer of this
+ * object and all of its
+ * descendants. The same holds as
+ * said for the
+ * @ref{recursively_set_user_pointer}
+ * function.
+ */
+ void recursively_clear_user_pointer () const;
+
/**
* Reset the user pointer of this
* line to a @p{NULL} pointer.
*/
void * user_pointer () const;
+ /**
+ * Set the user pointer of this
+ * object and all its children to
+ * the given value. This is
+ * useful for example if all
+ * cells of a certain subdomain,
+ * or all faces of a certain part
+ * of the boundary should have
+ * user pointers pointing to
+ * objects describing this part
+ * of the domain or boundary.
+ *
+ * Note that the user pointer is
+ * not inherited under mesh
+ * refinement, so after mesh
+ * refinement there might be
+ * cells or faces that don't have
+ * user pointers pointing to the
+ * describing object. In this
+ * case, simply loop over all the
+ * elements of the coarsest level
+ * that has this information, and
+ * use this function to
+ * recursively set the user
+ * pointer of all finer levels of
+ * the triangulation.
+ */
+ void recursively_set_user_pointer (void *p) const;
+
+ /**
+ * Clear the user pointer of this
+ * object and all of its
+ * descendants. The same holds as
+ * said for the
+ * @ref{recursively_set_user_pointer}
+ * function.
+ */
+ void recursively_clear_user_pointer () const;
+
/**
* Return a pointer to the @p{i}th
* child.
*/
void * user_pointer () const;
+ /**
+ * Set the user pointer of this
+ * object and all its children to
+ * the given value. This is
+ * useful for example if all
+ * cells of a certain subdomain,
+ * or all faces of a certain part
+ * of the boundary should have
+ * user pointers pointing to
+ * objects describing this part
+ * of the domain or boundary.
+ *
+ * Note that the user pointer is
+ * not inherited under mesh
+ * refinement, so after mesh
+ * refinement there might be
+ * cells or faces that don't have
+ * user pointers pointing to the
+ * describing object. In this
+ * case, simply loop over all the
+ * elements of the coarsest level
+ * that has this information, and
+ * use this function to
+ * recursively set the user
+ * pointer of all finer levels of
+ * the triangulation.
+ */
+ void recursively_set_user_pointer (void *p) const;
+
+ /**
+ * Clear the user pointer of this
+ * object and all of its
+ * descendants. The same holds as
+ * said for the
+ * @ref{recursively_set_user_pointer}
+ * function.
+ */
+ void recursively_clear_user_pointer () const;
+
/**
* Return a pointer to the
* @p{i}th child.
+template <int dim>
+void
+TriaObjectAccessor<1, dim>::recursively_set_user_pointer (void *p) const
+{
+ set_user_pointer (p);
+
+ if (has_children())
+ for (unsigned int c=0; c<2; ++c)
+ child(c)->recursively_set_user_pointer (p);
+}
+
+
+
+template <int dim>
+void
+TriaObjectAccessor<1, dim>::recursively_clear_user_pointer () const
+{
+ clear_user_pointer ();
+
+ if (has_children())
+ for (unsigned int c=0; c<2; ++c)
+ child(c)->recursively_clear_user_pointer ();
+}
+
+
+
template <int dim>
void TriaObjectAccessor<1, dim>::set_children (const int index) const
{
+template <int dim>
+void
+TriaObjectAccessor<2, dim>::recursively_set_user_pointer (void *p) const
+{
+ set_user_pointer (p);
+
+ if (has_children())
+ for (unsigned int c=0; c<4; ++c)
+ child(c)->recursively_set_user_pointer (p);
+}
+
+
+
+template <int dim>
+void
+TriaObjectAccessor<2, dim>::recursively_clear_user_pointer () const
+{
+ clear_user_pointer ();
+
+ if (has_children())
+ for (unsigned int c=0; c<4; ++c)
+ child(c)->recursively_clear_user_pointer ();
+}
+
+
+
template <int dim>
void TriaObjectAccessor<2, dim>::set_children (const int index) const
{
+template <int dim>
+void
+TriaObjectAccessor<3, dim>::recursively_set_user_pointer (void *p) const
+{
+ set_user_pointer (p);
+
+ if (has_children())
+ for (unsigned int c=0; c<8; ++c)
+ child(c)->recursively_set_user_pointer (p);
+}
+
+
+
+template <int dim>
+void
+TriaObjectAccessor<3, dim>::recursively_clear_user_pointer () const
+{
+ clear_user_pointer ();
+
+ if (has_children())
+ for (unsigned int c=0; c<8; ++c)
+ child(c)->recursively_clear_user_pointer ();
+}
+
+
+
template <int dim>
void TriaObjectAccessor<3, dim>::set_children (const int index) const
{