Assert(neighbor_child->face(neighbor2) ==
cell->face(face_no)->child(subface_no),
ExcInternalError());
- Assert(neighbor_child->has_children() == false,
- ExcInternalError());
+ Assert(neighbor_child->is_active(), ExcInternalError());
fe_v_subface.reinit(cell, face_no, subface_no);
fe_v_face_neighbor.reinit(neighbor_child, neighbor2);
(void)local_values_end;
Assert(this->is_artificial() == false,
ExcMessage("Can't ask for DoF indices on artificial cells."));
- Assert(!this->has_children(), ExcMessage("Cell must be active."));
+ Assert(this->is_active(), ExcMessage("Cell must be active."));
Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject());
Assert(static_cast<unsigned int>(local_values_end - local_values_begin) ==
{
Assert(this->is_artificial() == false,
ExcMessage("Can't ask for DoF indices on artificial cells."));
- Assert(!this->has_children(), ExcMessage("Cell must be active."));
+ Assert(this->is_active(), ExcMessage("Cell must be active."));
Assert(static_cast<unsigned int>(local_values_end - local_values_begin) ==
this->get_fe().dofs_per_cell,
{
Assert(this->is_artificial() == false,
ExcMessage("Can't ask for DoF indices on artificial cells."));
- Assert(!this->has_children(), ExcMessage("Cell must be active."));
+ Assert(this->is_active(), ExcMessage("Cell must be active."));
Assert(static_cast<unsigned int>(local_values.size()) ==
this->get_fe().dofs_per_cell,
(dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,
DoFHandlerType::space_dimension> *>(
this->dof_handler) != nullptr) ||
- (this->has_children() == false),
+ this->is_active(),
ExcMessage("In hp::DoFHandler objects, finite elements are only associated "
"with active cells. Consequently, you can not ask for the "
"active finite element on cells with children."));
(dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,
DoFHandlerType::space_dimension> *>(
this->dof_handler) != nullptr) ||
- (this->has_children() == false),
+ this->is_active(),
ExcMessage("You can not ask for the active_fe_index on a cell that has "
"children because no degrees of freedom are assigned "
"to this cell and, consequently, no finite element "
(dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,
DoFHandlerType::space_dimension> *>(
this->dof_handler) != nullptr) ||
- (this->has_children() == false),
+ this->is_active(),
ExcMessage("You can not set the active_fe_index on a cell that has "
"children because no degrees of freedom will be assigned "
"to this cell."));
(dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,
DoFHandlerType::space_dimension> *>(
this->dof_handler) != nullptr) ||
- (this->has_children() == false),
+ this->is_active(),
ExcMessage("In hp::DoFHandler objects, finite elements are only associated "
"with active cells. Consequently, you can not ask for the "
"future finite element on cells with children."));
Vector<value_type> & interpolated_values,
std::vector<CellData> &new_needs)
{
- if (!dealii_cell->has_children())
+ if (dealii_cell->is_active())
{
if (dealii_cell->is_locally_owned())
{
dealii_cell->get_dof_handler().get_fe();
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- if (!dealii_cell->has_children())
+ if (dealii_cell->is_active())
{
if (dealii_cell->is_locally_owned())
{
* template <class Iterator>
* bool operator () (const Iterator &i) const
* {
- * return (i->is_active());
+ * return i->is_active();
* }
* };
* @endcode
inline bool
Active::operator()(const Iterator &i) const
{
- return (i->is_active());
+ return i->is_active();
}
// side). We process a face locally when we are more refined
// (in the active cell case) or when the face is listed in
// the `shared_faces` data structure that we built above.
- if ((id1 == id2 && (use_active_cells == false ||
- neighbor->has_children() == false)) ||
+ if ((id1 == id2 &&
+ (use_active_cells == false || neighbor->is_active())) ||
dcell->level() > neighbor->level() ||
std::binary_search(
inner_faces_at_proc_boundary[id2].shared_faces.begin(),
(periodic_neighbor &&
cell->periodic_neighbor_is_coarser(face_no)))
{
- Assert(!cell->has_children(), ExcInternalError());
- Assert(!neighbor->has_children(), ExcInternalError());
+ Assert(cell->is_active(), ExcInternalError());
+ Assert(neighbor->is_active(), ExcInternalError());
// skip if only one processor needs to assemble the face
// to a ghost cell and the fine cell is not ours.
(periodic_neighbor &&
cell->periodic_neighbor_is_coarser(face_no)))
{
- Assert(!cell->has_children(), ExcInternalError());
- Assert(!neighbor->has_children(), ExcInternalError());
+ Assert(cell->is_active(), ExcInternalError());
+ Assert(neighbor->is_active(), ExcInternalError());
// skip if only one processor needs to assemble the face
// to a ghost cell and the fine cell is not ours.
// if we get to a cell without children (== active), we can
// skip it as there values should be already set by the
// equivalent of copy_to_mg()
- if (!cell->has_children())
+ if (cell->is_active())
continue;
std::fill(dof_values_coarse.begin(), dof_values_coarse.end(), 0.);
* DataOut<dim> data_out;
* data_out.set_cell_selection(
* [](const typename Triangulation<dim>::cell_iterator &cell) {
- * return (!cell->has_children() && cell->subdomain_id() == 0);
+ * return (cell->is_active() && cell->subdomain_id() == 0);
* });
* @endcode
* In this case, the lambda function selects all of those cells that are
// get an iterator pointing to the cell behind the present subface
const typename DoFHandlerType::active_cell_iterator neighbor_child =
cell->neighbor_child_on_subface(face_no, subface_no);
- Assert(!neighbor_child->has_children(), ExcInternalError());
+ Assert(neighbor_child->is_active(), ExcInternalError());
// restrict the finite element on the present cell to the subface
fe_subface_values.reinit(cell,
// also keep its level subdomain id since it is either
// owned by this processor or in the ghost layer of the
// active mesh.
- if (!cell->has_children() &&
+ if (cell->is_active() &&
cell->subdomain_id() !=
numbers::artificial_subdomain_id)
continue;
{
// yes, cell found in local part of p4est
delete_all_children<dim, spacedim>(dealii_cell);
- if (!dealii_cell->has_children())
+ if (dealii_cell->is_active())
dealii_cell->set_subdomain_id(my_subdomain);
}
else
// no children of its own, we need to refine it, and if it does
// already have children then loop over all children and see if they
// are locally available as well
- if (dealii_cell->has_children() == false)
+ if (dealii_cell->is_active())
dealii_cell->set_refine_flag();
else
{
typename Triangulation<dim, spacedim>::cell_iterator cell(tria,
i,
dealii_index);
- if (cell->has_children() == false)
+ if (cell->is_active())
{
cell->clear_coarsen_flag();
cell->set_refine_flag();
const typename internal::p4est::types<dim>::quadrant & p4est_cell,
const types::subdomain_id my_subdomain)
{
- if (!cell->has_children())
+ if (cell->is_active())
{
if (cell->subdomain_id() == my_subdomain)
{
quadrant))
{
Assert(!dealii_cell->is_artificial(), ExcInternalError());
- Assert(!dealii_cell->has_children(), ExcInternalError());
+ Assert(dealii_cell->is_active(), ExcInternalError());
Assert(!dealii_cell->is_locally_owned(), ExcInternalError());
const unsigned int n_vertices = vertex_indices[0];
return;
}
- if (!dealii_cell->has_children())
+ if (dealii_cell->is_active())
return;
if (!dealii::internal::p4est::quadrant_is_ancestor<dim>(p4est_cell,
false)
{
delete_all_children<dim, spacedim>(cell);
- if (!cell->has_children())
+ if (cell->is_active())
cell->set_subdomain_id(numbers::artificial_subdomain_id);
}
endc = this->end(lvl);
for (cell = this->begin(lvl); cell != endc; ++cell)
{
- if ((!cell->has_children() &&
+ if ((cell->is_active() &&
cell->subdomain_id() ==
this->locally_owned_subdomain()) ||
(cell->has_children() &&
Vector<number> & interpolated_values,
const unsigned int fe_index) const
{
- if (!this->has_children())
- // if this cell has no children: simply return the exact values on this
+ if (this->is_active())
+ // If this cell is active: simply return the exact values on this
// cell unless the finite element we need to interpolate to is different
// than the one we have on the current cell
{
}
}
else
- // otherwise obtain them from the children
+ // The cell is not active; we need to obtain data them from
+ // children recursively.
{
// we are on a non-active cell. these do not have any finite
// element associated with them in the hp context (in the non-hp
OutputVector & values,
const unsigned int fe_index) const
{
- if (!this->has_children() && !this->is_artificial())
+ if (this->is_active() && !this->is_artificial())
{
if ((dynamic_cast<DoFHandler<DoFHandlerType::dimension,
DoFHandlerType::space_dimension> *>(
return; // we are done
}
- if (!dealii_cell->has_children())
+ if (dealii_cell->is_active())
return;
if (!dealii_cell->id().is_ancestor_of(CellId(quadrant)))
return;
}
- if (!dealii_cell->has_children())
+ if (dealii_cell->is_active())
return;
if (!dealii_cell->id().is_ancestor_of(CellId(quadrant)))
for (unsigned int block = 0; pcell != endc; ++pcell)
{
- if (!pcell->has_children())
+ if (pcell->is_active())
continue;
for (unsigned int child = 0; child < pcell->n_children(); ++child)
const cell_iterator cell_row = cell_pair.first;
const cell_iterator cell_col = cell_pair.second;
- if (!cell_row->has_children() && !cell_col->has_children())
+ if (cell_row->is_active() && cell_col->is_active())
{
const unsigned int dofs_per_cell_row =
cell_row->get_fe().dofs_per_cell;
const IndexSet & in,
Vector<IndexSet::value_type> &out) const
{
- Assert(cell->has_children() == false, ExcNotImplemented());
+ Assert(cell->is_active(), ExcNotImplemented());
std::vector<types::global_dof_index> dof_indices(
cell->get_fe().dofs_per_cell);
patch.data(2, v) =
static_cast<std::make_signed<types::material_id>::type>(
cell->material_id());
- if (!cell->has_children())
+ if (cell->is_active())
patch.data(3, v) =
static_cast<std::make_signed<types::subdomain_id>::type>(
cell->subdomain_id());
if (cell->has_children() &&
cell->level_subdomain_id() == numbers::artificial_subdomain_id)
continue;
- else if (!cell->has_children() &&
+ else if (cell->is_active() &&
cell->level_subdomain_id() ==
numbers::artificial_subdomain_id &&
cell->subdomain_id() == numbers::artificial_subdomain_id)
{
patch.vertices[vertex] = cell->vertex(vertex);
patch.data(0, vertex) = cell->level();
- if (!cell->has_children())
+ if (cell->is_active())
patch.data(1, vertex) = static_cast<double>(
static_cast<std::make_signed<types::subdomain_id>::type>(
cell->subdomain_id()));
endc = triangulation.end(lvl);
for (; cell != endc; ++cell)
{
- if (!cell->has_children())
+ if (cell->is_active())
cell->set_level_subdomain_id(cell->subdomain_id());
else
{
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const bool allow_anisotropic_smoothing)
{
- Assert(cell->has_children() == false, ExcInternalError());
+ Assert(cell->is_active(), ExcInternalError());
Assert(cell->refine_flag_set() == false, ExcInternalError());
unsigned int
CellAccessor<dim, spacedim>::active_cell_index() const
{
- Assert(this->has_children() == false,
- TriaAccessorExceptions::ExcCellNotActive());
+ Assert(this->is_active(), TriaAccessorExceptions::ExcCellNotActive());
return this->tria->levels[this->present_level]
->active_cell_indices[this->present_index];
}
cell = dof_handler.begin_active(level),
endc = dof_handler.end_active(level);
for (; cell != endc; ++cell)
- if (!cell->has_children() && !cell->is_artificial())
+ if (cell->is_active() && !cell->is_artificial())
{
dof_handler.levels[level]->dof_offsets[cell->index()] =
next_free_dof;
types::global_dof_index counter = 0;
for (const auto &cell :
dof_handler.active_cell_iterators_on_level(level))
- if (!cell->has_children() && !cell->is_artificial())
+ if (cell->is_active() && !cell->is_artificial())
counter += cell->get_fe().template n_dofs_per_object<dim>();
Assert(dof_handler.levels[level]->dof_indices.size() == counter,
unsigned int n_active_non_artificial_cells = 0;
for (const auto &cell :
dof_handler.active_cell_iterators_on_level(level))
- if (!cell->has_children() && !cell->is_artificial())
+ if (cell->is_active() && !cell->is_artificial())
++n_active_non_artificial_cells;
Assert(static_cast<unsigned int>(std::count(
// skip cells if the current one has no children (is active) and is a ghost
// or artificial cell
- while ((cell != this->triangulation->end()) &&
- (cell->has_children() == false) && !cell->is_locally_owned())
+ while ((cell != this->triangulation->end()) && cell->is_active() &&
+ !cell->is_locally_owned())
cell = next_cell(cell);
return cell;
{
typename DataOut<dim, DoFHandlerType>::cell_iterator cell =
next_cell(old_cell);
- while ((cell != this->triangulation->end()) &&
- (cell->has_children() == false) && !cell->is_locally_owned())
+ while ((cell != this->triangulation->end()) && cell->is_active() &&
+ !cell->is_locally_owned())
cell = next_cell(cell);
return cell;
}