TriaIterator<TriaAccessor<structdim, dim, spacedim>>
child(const unsigned int i) const;
+ /**
+ * Return the child number of @p child on the current cell. This is the
+ * inverse function of TriaAccessor::child().
+ */
+ unsigned int
+ child_iterator_to_index(
+ const TriaIterator<TriaAccessor<structdim, dim, spacedim>> &child) const;
+
/**
* Return an iterator to that object that is identical to the ith child for
* isotropic refinement. If the current object is refined isotropically,
static unsigned int
max_refinement_depth();
+ /**
+ * @brief Return an invalid unsigned integer.
+ */
+ static unsigned int
+ child_iterator_to_index(const TriaIterator<TriaAccessor<0, dim, spacedim>> &);
+
/**
* @brief Return an invalid object.
*/
static unsigned int
max_refinement_depth();
+ /**
+ * @brief Return an invalid unsigned integer.
+ */
+ static unsigned int
+ child_iterator_to_index(const TriaIterator<TriaAccessor<0, 1, spacedim>> &);
+
/**
* @brief Return an invalid object
*/
TriaIterator<TriaAccessor<dim - 1, dim, spacedim>>
face(const unsigned int i) const;
+ /**
+ * Return the face number of @p face on the current cell. This is the
+ * inverse function of TriaAccessor::face().
+ */
+ unsigned int
+ face_iterator_to_index(
+ const TriaIterator<TriaAccessor<dim - 1, dim, spacedim>> &face) const;
/**
* Return an array of iterators to all faces of this cell.
+template <int structdim, int dim, int spacedim>
+inline unsigned int
+TriaAccessor<structdim, dim, spacedim>::child_iterator_to_index(
+ const TriaIterator<TriaAccessor<structdim, dim, spacedim>> &child) const
+{
+ const auto n_children = this->n_children();
+ for (unsigned int child_n = 0; child_n < n_children; ++child_n)
+ if (this->child(child_n) == child)
+ return child_n;
+
+ Assert(false,
+ ExcMessage("The given child is not a child of the current object."));
+ return numbers::invalid_unsigned_int;
+}
+
+
+
template <int structdim, int dim, int spacedim>
inline TriaIterator<TriaAccessor<structdim, dim, spacedim>>
TriaAccessor<structdim, dim, spacedim>::isotropic_child(
+template <int dim, int spacedim>
+inline unsigned int
+TriaAccessor<0, dim, spacedim>::child_iterator_to_index(
+ const TriaIterator<TriaAccessor<0, dim, spacedim>> &)
+{
+ return numbers::invalid_unsigned_int;
+}
+
+
+
template <int dim, int spacedim>
inline TriaIterator<TriaAccessor<0, dim, spacedim>>
TriaAccessor<0, dim, spacedim>::child(const unsigned int)
}
+
+template <int spacedim>
+inline unsigned int
+TriaAccessor<0, 1, spacedim>::child_iterator_to_index(
+ const TriaIterator<TriaAccessor<0, 1, spacedim>> &)
+{
+ return numbers::invalid_unsigned_int;
+}
+
+
+
template <int spacedim>
inline TriaIterator<TriaAccessor<0, 1, spacedim>>
TriaAccessor<0, 1, spacedim>::child(const unsigned int)
+template <int dim, int spacedim>
+inline unsigned int
+CellAccessor<dim, spacedim>::face_iterator_to_index(
+ const TriaIterator<TriaAccessor<dim - 1, dim, spacedim>> &face) const
+{
+ for (unsigned int face_n = 0; face_n < GeometryInfo<dim>::faces_per_cell;
+ ++face_n)
+ if (this->face(face_n) == face)
+ return face_n;
+
+ Assert(false,
+ ExcMessage("The given face is not a face of the current cell."));
+ return numbers::invalid_unsigned_int;
+}
+
+
+
template <int dim, int spacedim>
inline std::array<TriaIterator<TriaAccessor<dim - 1, dim, spacedim>>,
GeometryInfo<dim>::faces_per_cell>