Use TriaAccessor::n_active_descendants() instead.
@endcode
Here the number of subfaces is three. It is important to note the subtle
differences between, for a face, TriaAccessor::n_children() and
- TriaAccessor::number_of_children(). The first function returns the number of
+ TriaAccessor::n_active_descendants(). The first function returns the number of
immediate children, which would be two for the above example, whereas the
second returns the number of active offspring (i.e., including children,
grandchildren, and further descendants), which is the correct three in
- the example above. Using <code>face->number_of_children()</code> works for
+ the example above. Using <code>face->n_active_descendants()</code> works for
isotropic and anisotropic as well as 2D and 3D cases, so it should always be
used. It should be noted that if any of the cells behind the two
small subfaces on the left side of the rightmost image is further
// Now we loop over all subfaces, i.e. the children and
// possibly grandchildren of the current face.
for (unsigned int subface_no = 0;
- subface_no < face->number_of_children();
+ subface_no < face->n_active_descendants();
++subface_no)
{
// To get the cell behind the current subface we can
unsigned int neighbor2 = cell->neighbor_face_no(face_no);
// Now we loop over all subfaces,
for (unsigned int subface_no = 0;
- subface_no < face->number_of_children();
+ subface_no < face->n_active_descendants();
++subface_no)
{
// get an iterator pointing to the cell behind the
ExcInternalError());
Assert(neighbor_face_subface.second <
neighbor->face(neighbor_face_subface.first)
- ->number_of_children(),
+ ->n_active_descendants(),
ExcInternalError());
Assert(neighbor->neighbor_child_on_subface(
neighbor_face_subface.first,
// out which border to the present
// cell
for (unsigned int c = 0;
- c < cell->face(n)->number_of_children();
+ c < cell->face(n)->n_active_descendants();
++c)
active_neighbors.push_back(
cell->neighbor_child_on_subface(n, c));
unsigned int
n_children() const;
+ /**
+ * @deprecated Use n_active_descendants() instead.
+ */
+ DEAL_II_DEPRECATED_EARLY
+ unsigned int
+ number_of_children() const;
+
/**
* Compute and return the number of active descendants of this objects. For
* example, if all of the eight children of a hex are further refined
* current object is not further refined, the answer is one.
*/
unsigned int
- number_of_children() const;
+ n_active_descendants() const;
/**
* Return the number of times that this object is refined. Note that not all
* Always zero.
*/
static unsigned int
+ n_active_descendants();
+
+ /**
+ * @deprecated Use n_active_descendants() instead.
+ */
+ DEAL_II_DEPRECATED_EARLY
+ static unsigned int
number_of_children();
+
/**
* Return the number of times that this object is refined. Always 0.
*/
* Always zero.
*/
static unsigned int
+ n_active_descendants();
+
+ /**
+ * @deprecated Use n_active_descendants() instead.
+ */
+ DEAL_II_DEPRECATED_EARLY
+ static unsigned int
number_of_children();
+
/**
* Return the number of times that this object is refined. Always 0.
*/
template <int structdim, int dim, int spacedim>
unsigned int
TriaAccessor<structdim, dim, spacedim>::number_of_children() const
+{
+ return n_active_descendants();
+}
+
+
+
+template <int structdim, int dim, int spacedim>
+unsigned int
+TriaAccessor<structdim, dim, spacedim>::n_active_descendants() const
{
if (!this->has_children())
return 1;
{
unsigned int sum = 0;
for (unsigned int c = 0; c < n_children(); ++c)
- sum += this->child(c)->number_of_children();
+ sum += this->child(c)->n_active_descendants();
return sum;
}
}
+template <int dim, int spacedim>
+inline unsigned int
+TriaAccessor<0, dim, spacedim>::n_active_descendants()
+{
+ return 0;
+}
+
+
+
template <int dim, int spacedim>
inline unsigned int
TriaAccessor<0, dim, spacedim>::max_refinement_depth()
+template <int spacedim>
+inline unsigned int
+TriaAccessor<0, 1, spacedim>::n_active_descendants()
+{
+ return 0;
+}
+
+
+
template <int spacedim>
inline unsigned int
TriaAccessor<0, 1, spacedim>::max_refinement_depth()
if (dof_handler.has_hp_capabilities())
for (unsigned int c = 0;
- c < cell->face(face)->number_of_children();
+ c < cell->face(face)->n_active_descendants();
++c)
{
const auto subcell =
if (neighbor->has_children())
{
for (unsigned int sub_nr = 0;
- sub_nr != cell_face->number_of_children();
+ sub_nr != cell_face->n_active_descendants();
++sub_nr)
{
const typename DoFHandler<dim, spacedim>::
0,
GeometryInfo<dim>::max_children_per_face));
Assert(!cell->face(face_no)->has_children() ||
- subface_no < cell->face(face_no)->number_of_children(),
+ subface_no < cell->face(face_no)->n_active_descendants(),
ExcIndexRange(subface_no,
0,
- cell->face(face_no)->number_of_children()));
+ cell->face(face_no)->n_active_descendants()));
Assert(cell->has_children() == false,
ExcMessage("You can't use subface data for cells that are "
"already refined. Iterate over their children "
if (face_ref_case ==
RefinementCase<dim - 1>::isotropic_refinement)
{
- if (aface->number_of_children() < 4)
+ if (aface->n_active_descendants() < 4)
// we use user_flags to denote needed
// isotropic refinement
aface->set_user_flag();
const typename Triangulation<dim, spacedim>::face_iterator
mother_face = this->face(face);
const unsigned int total_children =
- mother_face->number_of_children();
+ mother_face->n_active_descendants();
AssertIndexRange(subface, total_children);
Assert(total_children <= GeometryInfo<3>::max_children_per_face,
ExcInternalError());
for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(face_no) && cell->face(face_no)->has_children())
for (unsigned int subface_no = 0;
- subface_no < cell->face(face_no)->number_of_children();
+ subface_no < cell->face(face_no)->n_active_descendants();
++subface_no)
{
unsigned int neighbor_neighbor = cell->neighbor_face_no(face_no);