// Then check whether the neighbor is active. If it is, then it
// is on the same level or one level coarser (if we are not in
// 1D), and we are interested in it in any case.
- if (neighbor->active())
+ if (neighbor->is_active())
scratch_data.active_neighbors.push_back(neighbor);
else
{
++child_index)
{
const auto child = cell->child(child_index);
- Assert(child->active() && child->coarsen_flag_set(),
+ Assert(child->is_active() && child->coarsen_flag_set(),
typename dealii::Triangulation<
dim>::ExcInconsistentCoarseningFlags());
DoFCellAccessor<DoFHandlerType, level_dof_access>::get_dof_indices(
std::vector<types::global_dof_index> &dof_indices) const
{
- Assert(this->active(),
+ Assert(this->is_active(),
ExcMessage("get_dof_indices() only works on active cells."));
Assert(this->is_artificial() == false,
ExcMessage("Can't ask for DoF indices on artificial cells."));
// check if at least one child is locally owned on our process
for (unsigned int child_n = 0; child_n < dealii_cell->n_children();
++child_n)
- if (dealii_cell->child(child_n)->active())
+ if (dealii_cell->child(child_n)->is_active())
if (dealii_cell->child(child_n)->is_locally_owned())
{
locally_owned_children = true;
for (unsigned int child_n = 0; child_n < dealii_cell->n_children();
++child_n)
- if (dealii_cell->child(child_n)->active())
+ if (dealii_cell->child(child_n)->is_active())
if (dealii_cell->child(child_n)->is_locally_owned())
{
locally_owned_children = true;
dof2.end(level);
for (; cell != endc; ++cell)
- if (!cell->active())
+ if (!cell->is_active())
{
// check whether this
// cell has active
bool active_children = false;
for (unsigned int child_n = 0; child_n < cell->n_children();
++child_n)
- if (cell->child(child_n)->active())
+ if (cell->child(child_n)->is_active())
{
active_children = true;
break;
* template <class Iterator>
* bool operator () (const Iterator &i) const
* {
- * return (i->active());
+ * return (i->is_active());
* }
* };
* @endcode
inline bool
Active::operator()(const Iterator &i) const
{
- return (i->active());
+ return (i->is_active());
}
// children bound to the present cell
typename MeshType::cell_iterator neighbor_child =
cell->neighbor(n);
- if (!neighbor_child->active())
+ if (!neighbor_child->is_active())
{
while (neighbor_child->has_children())
neighbor_child = neighbor_child->child(n == 0 ? 1 : 0);
{
// the neighbor must be active
// himself
- Assert(cell->neighbor(n)->active(), ExcInternalError());
+ Assert(cell->neighbor(n)->is_active(), ExcInternalError());
active_neighbors.push_back(cell->neighbor(n));
}
}
// but activity may change when refinement is
// executed and for some reason the refine
// flag is not cleared).
- Assert(this->active() || !this->tria->levels[this->present_level]
- ->refine_flags[this->present_index],
+ Assert(this->is_active() || !this->tria->levels[this->present_level]
+ ->refine_flags[this->present_index],
ExcRefineCellNotActive());
return RefinementCase<dim>(
this->tria->levels[this->present_level]->refine_flags[this->present_index]);
CellAccessor<dim, spacedim>::set_refine_flag(
const RefinementCase<dim> refinement_case) const
{
- Assert(this->used() && this->active(), ExcRefineCellNotActive());
+ Assert(this->used() && this->is_active(), ExcRefineCellNotActive());
Assert(!coarsen_flag_set(), ExcCellFlaggedForCoarsening());
this->tria->levels[this->present_level]->refine_flags[this->present_index] =
inline void
CellAccessor<dim, spacedim>::clear_refine_flag() const
{
- Assert(this->used() && this->active(), ExcRefineCellNotActive());
+ Assert(this->used() && this->is_active(), ExcRefineCellNotActive());
this->tria->levels[this->present_level]->refine_flags[this->present_index] =
RefinementCase<dim>::no_refinement;
}
// but activity may change when refinement is
// executed and for some reason the refine
// flag is not cleared).
- Assert(this->active() || !this->tria->levels[this->present_level]
- ->coarsen_flags[this->present_index],
+ Assert(this->is_active() || !this->tria->levels[this->present_level]
+ ->coarsen_flags[this->present_index],
ExcRefineCellNotActive());
return this->tria->levels[this->present_level]
->coarsen_flags[this->present_index];
inline void
CellAccessor<dim, spacedim>::set_coarsen_flag() const
{
- Assert(this->used() && this->active(), ExcRefineCellNotActive());
+ Assert(this->used() && this->is_active(), ExcRefineCellNotActive());
Assert(!refine_flag_set(), ExcCellFlaggedForRefinement());
this->tria->levels[this->present_level]->coarsen_flags[this->present_index] =
inline void
CellAccessor<dim, spacedim>::clear_coarsen_flag() const
{
- Assert(this->used() && this->active(), ExcRefineCellNotActive());
+ Assert(this->used() && this->is_active(), ExcRefineCellNotActive());
this->tria->levels[this->present_level]->coarsen_flags[this->present_index] =
false;
}
inline bool
CellAccessor<dim, spacedim>::is_locally_owned() const
{
- Assert(this->active(),
+ Assert(this->is_active(),
ExcMessage("is_locally_owned() can only be called on active cells!"));
#ifndef DEAL_II_WITH_MPI
return true;
inline bool
CellAccessor<dim, spacedim>::is_ghost() const
{
- Assert(this->active(),
+ Assert(this->is_active(),
ExcMessage("is_ghost() can only be called on active cells!"));
if (this->has_children())
return false;
inline bool
CellAccessor<dim, spacedim>::is_artificial() const
{
- Assert(this->active(),
+ Assert(this->is_active(),
ExcMessage("is_artificial() can only be called on active cells!"));
#ifndef DEAL_II_WITH_MPI
return false;
CellAccessor<dim, spacedim>::subdomain_id() const
{
Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(this->active(),
+ Assert(this->is_active(),
ExcMessage("subdomain_id() can only be called on active cells!"));
return this->tria->levels[this->present_level]
->subdomain_ids[this->present_index];
++line)
{
const unsigned int line_idx = cell->line(line)->index();
- if (cell->active())
+ if (cell->is_active())
line_to_cells[line_idx].push_back(std::make_pair(cell, line));
else
line_to_inactive_cells[line_idx].push_back(
{
typename dealii::Triangulation<dim>::cell_iterator dcell(
&triangulation, cell_level.first, cell_level.second);
- Assert(dcell->active(), ExcInternalError());
+ Assert(dcell->is_active(), ExcInternalError());
}
# endif
typename dealii::Triangulation<dim>::cell_iterator dcell(
&triangulation, cell_levels[i].first, cell_levels[i].second);
if (use_active_cells)
- Assert(dcell->active(), ExcNotImplemented());
+ Assert(dcell->is_active(), ExcNotImplemented());
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
{
if (dcell->at_boundary(f) && !dcell->has_periodic_neighbor(f))
fe_val.reinit(cell_it, face);
const bool is_local =
- (cell_it->active() ?
+ (cell_it->is_active() ?
cell_it->is_locally_owned() :
cell_it->is_locally_owned_on_level()) &&
(!cell_it->at_boundary(face) ||
else if (subdomain_id == numbers::invalid_subdomain_id ||
cell->subdomain_id() == subdomain_id)
{
- Assert(cell->active(), ExcInternalError());
+ Assert(cell->is_active(), ExcInternalError());
cell_its.emplace_back(cell->level(), cell->index());
}
}
if (neighbor->is_level_cell())
neighbid = neighbor->level_subdomain_id();
// subdomain id is only valid for active cells
- else if (neighbor->active())
+ else if (neighbor->is_active())
neighbid = neighbor->subdomain_id();
const bool own_neighbor =
if (neighbor->is_level_cell())
neighbor_subdomain_id = neighbor->level_subdomain_id();
// subdomain id is only valid for active cells
- else if (neighbor->active())
+ else if (neighbor->is_active())
neighbor_subdomain_id = neighbor->subdomain_id();
const bool own_neighbor =
++child_index)
{
const auto sibling = parent->child(child_index);
- Assert(sibling->active() && sibling->coarsen_flag_set(),
+ Assert(sibling->is_active() && sibling->coarsen_flag_set(),
typename dealii::Triangulation<
dim>::ExcInconsistentCoarseningFlags());
// Transfer data of persisting cells.
for (const auto &persisting : persisting_cells_active_index)
{
- Assert(persisting.first->active(), ExcInternalError());
+ Assert(persisting.first->is_active(), ExcInternalError());
out[persisting.first->active_cell_index()] = in[persisting.second];
}
++child_index)
{
const auto child = refined.first->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
out[child->active_cell_index()] = in[refined.second];
}
const value_type parent_value = coarsening_strategy(children_values);
// Set value for the parent cell.
- Assert(coarsened.first->active(), ExcInternalError());
+ Assert(coarsened.first->is_active(), ExcInternalError());
out[coarsened.first->active_cell_index()] = parent_value;
}
bool
is_locally_owned(const cell_iterator &cell)
{
- if (cell->active())
+ if (cell->is_active())
return cell->is_locally_owned();
for (unsigned int c = 0; c < cell->n_children(); ++c)
if (cell1->level() != cell2->level())
continue;
// .. or none of them is active.
- if (!cell1->active() && !cell2->active())
+ if (!cell1->is_active() && !cell2->is_active())
continue;
Assert(
"The two Triangulations are required to have the same parallel partitioning."));
// Skip foreign cells.
- if (cell1->active() && !cell1->is_locally_owned())
+ if (cell1->is_active() && !cell1->is_locally_owned())
continue;
- if (cell2->active() && !cell2->is_locally_owned())
+ if (cell2->is_active() && !cell2->is_locally_owned())
continue;
// Get and set the corresponding
// dof_values by interpolation.
- if (cell1->active())
+ if (cell1->is_active())
{
cache.reinit(cell1->get_fe().dofs_per_cell);
cell1->get_interpolated_dof_values(u1,
++child_index)
{
const auto child = cell->child(child_index);
- Assert(child->active() && child->coarsen_flag_set(),
+ Assert(child->is_active() && child->coarsen_flag_set(),
typename dealii::Triangulation<
dim>::ExcInconsistentCoarseningFlags());
// (level_)subdomain_ids in the next step)
for (auto cell = this->begin(); cell != this->end(); ++cell)
{
- if (cell->active())
+ if (cell->is_active())
cell->set_subdomain_id(
dealii::numbers::artificial_subdomain_id);
++cell;
// subdomain id
- if (cell->active())
+ if (cell->is_active())
cell->set_subdomain_id(cell_info->subdomain_id);
// level subdomain id
std::vector<bool> vertices_owned_by_locally_owned_cells(
tria.n_vertices());
for (auto cell : tria.cell_iterators())
- if (cell->active() && cell->subdomain_id() == my_rank)
+ if (cell->is_active() && cell->subdomain_id() == my_rank)
add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells(
cell, vertices_owned_by_locally_owned_cells);
construction_data.cell_infos.resize(1);
for (auto cell : tria.cell_iterators())
- if (cell->active() && is_locally_relevant(cell))
+ if (cell->is_active() && is_locally_relevant(cell))
{
// to be filled
CellData<dim> cell_info;
tria.n_vertices());
for (auto cell : tria.cell_iterators_on_level(level))
if (cell->level_subdomain_id() == my_rank ||
- (cell->active() && cell->subdomain_id() == my_rank))
+ (cell->is_active() && cell->subdomain_id() == my_rank))
add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells(
cell, vertices_owned_by_locally_owned_cells_on_level);
// on active level
auto is_locally_relevant_on_active_level =
[&](TriaIterator<CellAccessor<dim, spacedim>> &cell) {
- if (cell->active())
+ if (cell->is_active())
for (unsigned int v = 0;
v < GeometryInfo<dim>::vertices_per_cell;
++v)
tria.n_vertices());
for (auto cell : tria.cell_iterators_on_level(level))
if (cell->level_subdomain_id() == my_rank ||
- (cell->active() && cell->subdomain_id() == my_rank))
+ (cell->is_active() && cell->subdomain_id() == my_rank))
add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells(
cell, vertices_owned_by_locally_owned_cells_on_level);
++child_index)
{
const auto child = cell->child(child_index);
- Assert(child->active() && child->coarsen_flag_set(),
+ Assert(child->is_active() && child->coarsen_flag_set(),
typename dealii::Triangulation<
dim>::ExcInconsistentCoarseningFlags());
// *---*---*
// | | M |
// *---*---*
- if (!used && dealii_cell->active() &&
+ if (!used && dealii_cell->is_active() &&
dealii_cell->is_artificial() == false &&
dealii_cell->level() + 1 < static_cast<int>(marked_vertices.size()))
{
}
// Like above, but now the other way around
- if (!used && dealii_cell->active() &&
+ if (!used && dealii_cell->is_active() &&
dealii_cell->is_artificial() == false && dealii_cell->level() > 0)
{
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
CELL_REFINE:
// double check the condition that we will only ever attach
// data to active cells when we get here
- Assert(dealii_cell->active(), ExcInternalError());
+ Assert(dealii_cell->is_active(), ExcInternalError());
break;
case parallel::distributed::Triangulation<dim, spacedim>::
// data to cells with children when we get here. however, we
// can only tolerate one level of coarsening at a time, so
// check that the children are all active
- Assert(dealii_cell->active() == false, ExcInternalError());
+ Assert(dealii_cell->is_active() == false, ExcInternalError());
for (unsigned int c = 0;
c < GeometryInfo<dim>::max_children_per_cell;
++c)
- Assert(dealii_cell->child(c)->active(), ExcInternalError());
+ Assert(dealii_cell->child(c)->is_active(),
+ ExcInternalError());
break;
case parallel::distributed::Triangulation<dim, spacedim>::
++cell)
{
// nothing to do if we are already on the finest level
- if (cell->active())
+ if (cell->is_active())
continue;
const unsigned int n_children = cell->n_children();
unsigned int flagged_children = 0;
for (unsigned int child = 0; child < n_children; ++child)
- if (cell->child(child)->active() &&
+ if (cell->child(child)->is_active() &&
cell->child(child)->coarsen_flag_set())
++flagged_children;
// coarsen flags
if (flagged_children < n_children)
for (unsigned int child = 0; child < n_children; ++child)
- if (cell->child(child)->active())
+ if (cell->child(child)->is_active())
cell->child(child)->clear_coarsen_flag();
}
}
cell = this->begin(maybe_coarser_lvl),
endc = this->end(lvl);
for (; cell != endc; ++cell)
- if (cell->level() == static_cast<int>(lvl) || cell->active())
+ if (cell->level() == static_cast<int>(lvl) || cell->is_active())
{
const bool is_level_artificial =
(cell->level_subdomain_id() ==
typename DoFHandlerType::level_cell_iterator cell = dof.begin(0);
while (!cell->at_boundary(direction))
cell = cell->neighbor(direction);
- while (!cell->active())
+ while (!cell->is_active())
cell = cell->child(direction);
const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex;
// face twice and hence put the indices the other way
// around
if (!cell->neighbor_or_periodic_neighbor(face)
- ->active() ||
+ ->is_active() ||
(neighbor->subdomain_id() != cell->subdomain_id()))
{
constraints.add_entries_local_to_global(
// the total ordering.
if (neighbor->level() == cell->level() &&
neighbor->index() > cell->index() &&
- neighbor->active() && neighbor->is_locally_owned())
+ neighbor->is_active() && neighbor->is_locally_owned())
continue;
// If we are more refined then the neighbor, then we
// will automatically find the active neighbor cell when
// is 'greater' in the total ordering.
if (neighbor->level() == cell->level() &&
neighbor->index() > cell->index() &&
- neighbor->active() && neighbor->is_locally_owned())
+ neighbor->is_active() && neighbor->is_locally_owned())
continue;
// Again, like the non-hp case: If we are more refined
// then the neighbor, then we will automatically find
const typename DoFHandler<dim, spacedim>::cell_iterator dof_cell(
*cell, euler_dof_handler);
- Assert(uses_level_dofs || dof_cell->active() == true, ExcInactiveCell());
+ Assert(uses_level_dofs || dof_cell->is_active() == true, ExcInactiveCell());
AssertDimension(GeometryInfo<dim>::vertices_per_cell,
fe_values.n_quadrature_points);
AssertDimension(fe_to_real.size(),
ExcMessage("euler_dof_handler is empty"));
typename DoFHandlerType::cell_iterator dof_cell(*cell, euler_dof_handler);
- Assert(uses_level_dofs || dof_cell->active() == true, ExcInactiveCell());
+ Assert(uses_level_dofs || dof_cell->is_active() == true, ExcInactiveCell());
if (uses_level_dofs)
{
AssertIndexRange(cell->level(), euler_vector.size());
// We require the cell to be active since we can only then get nodal
// values for the shifts
- Assert(dof_cell->active() == true, ExcInactiveCell());
+ Assert(dof_cell->is_active() == true, ExcInactiveCell());
// now get the values of the shift vectors at the vertices
Vector<typename VectorType::value_type> mapping_values(
typename DoFHandler<dim, spacedim>::cell_iterator dof_cell(
*cell, mapping_q_eulerian.euler_dof_handler);
- Assert(mg_vector || dof_cell->active() == true, ExcInactiveCell());
+ Assert(mg_vector || dof_cell->is_active() == true, ExcInactiveCell());
// our quadrature rule is chosen so that each quadrature point corresponds
// to a support point in the undeformed configuration. We can then query
for (const auto &cell : tria.cell_iterators())
{
// If depth is not encoded, write finest level only
- if (!xfig_flags.level_depth && !cell->active())
+ if (!xfig_flags.level_depth && !cell->is_active())
continue;
// Code for polygon
out << "2 3 " << xfig_flags.line_style << ' '
materials.insert(cell->material_id());
levels.insert(cell->level());
- if (cell->active())
+ if (cell->is_active())
subdomains.insert(cell->subdomain_id() + 2);
level_subdomains.insert(cell->level_subdomain_id() + 2);
}
{
for (const auto &cell : tria.cell_iterators_on_level(level_index))
{
- if (!svg_flags.convert_level_number_to_height && !cell->active())
+ if (!svg_flags.convert_level_number_to_height && !cell->is_active())
continue;
// draw the current cell
{
out << " class=\"p";
- if (!cell->active() && svg_flags.convert_level_number_to_height)
+ if (!cell->is_active() &&
+ svg_flags.convert_level_number_to_height)
out << 's';
switch (svg_flags.coloring)
out << static_cast<unsigned int>(cell->level());
break;
case GridOutFlags::Svg::subdomain_id:
- if (cell->active())
+ if (cell->is_active())
out << cell->subdomain_id() + 2;
else
out << 'X';
if (svg_flags.label_level_number ||
svg_flags.label_cell_index || svg_flags.label_material_id)
out << ',';
- if (cell->active())
+ if (cell->is_active())
out << static_cast<
std::make_signed<types::subdomain_id>::type>(
cell->subdomain_id());
GeometryInfo<dim>::vertex_to_face[v][vface];
if (!cell->at_boundary(face) &&
- cell->neighbor(face)->active())
+ cell->neighbor(face)->is_active())
{
// there is a (possibly) coarser cell behind a
// face to which the vertex belongs. the
bool has_predicate =
false; // Start assuming there's no cells with predicate inside
std::vector<typename MeshType::active_cell_iterator> active_cells;
- if (parent_cell->active())
+ if (parent_cell->is_active())
active_cells = {parent_cell};
else
// Finding all active cells descendants of the current one (or the
for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
{
if ((cell->at_boundary(i) == false) &&
- (cell->neighbor(i)->active()))
+ (cell->neighbor(i)->is_active()))
{
typename Triangulation<dim, spacedim>::active_cell_iterator
adjacent_cell = cell->neighbor(i);
{
if (cell->at_boundary(i) == false)
{
- if (cell->neighbor(i)->active())
+ if (cell->neighbor(i)->is_active())
{
typename Triangulation<dim,
spacedim>::active_cell_iterator
const unsigned int n_active_cells,
const unsigned int n_partitions)
{
- if (cell->active())
+ if (cell->is_active())
{
while (current_cell_idx >=
std::floor(static_cast<uint_least64_t>(n_active_cells) *
endc = triangulation.end();
for (; cell != endc; ++cell)
{
- if (cell->active())
+ if (cell->is_active())
continue;
bool all_children_active = true;
std::map<unsigned int, unsigned int> map_cpu_n_cells;
for (unsigned int n = 0; n < cell->n_children(); ++n)
- if (!cell->child(n)->active())
+ if (!cell->child(n)->is_active())
{
all_children_active = false;
break;
const typename Triangulation<dim, spacedim>::cell_iterator cell =
*cell_ptr;
- Assert(!cell->active(),
+ Assert(!cell->is_active(),
ExcMessage(
"This function is only valid for a list of cells that "
"have children (i.e., no cell in the list may be active)."));
GeometryInfo<dim>::vertex_to_face[v][vface];
if (!cell->at_boundary(face) &&
- cell->neighbor(face)->active())
+ cell->neighbor(face)->is_active())
{
// there is a (possibly) coarser cell behind a
// face to which the vertex belongs. the
{
// at least one cell is active
if (remove_ghost_cells &&
- ((cell_pair->first->active() &&
+ ((cell_pair->first->is_active() &&
!cell_pair->first->is_locally_owned()) ||
- (cell_pair->second->active() &&
+ (cell_pair->second->is_active() &&
!cell_pair->second->is_locally_owned())))
{
// we only exclude ghost cells for distributed Triangulations
// least one active iterator or have different refinement_cases
for (cell_pair = cell_list.begin(); cell_pair != cell_list.end();
++cell_pair)
- Assert(cell_pair->first->active() || cell_pair->second->active() ||
+ Assert(cell_pair->first->is_active() || cell_pair->second->is_active() ||
(cell_pair->first->refinement_case() !=
cell_pair->second->refinement_case()),
ExcInternalError());
cell_is_patch_level_1(
const TriaIterator<dealii::CellAccessor<dim, spacedim>> &cell)
{
- Assert(cell->active() == false, ExcInternalError());
+ Assert(cell->is_active() == false, ExcInternalError());
unsigned int n_active_children = 0;
for (unsigned int i = 0; i < cell->n_children(); ++i)
- if (cell->child(i)->active())
+ if (cell->child(i)->is_active())
++n_active_children;
return (n_active_children == 0) ||
const unsigned int n_children = cell->n_children();
for (unsigned int c = 0; c < n_children; ++c)
- if (cell->child(c)->active() && cell->child(c)->coarsen_flag_set())
+ if (cell->child(c)->is_active() && cell->child(c)->coarsen_flag_set())
++children_to_coarsen;
if (children_to_coarsen == n_children)
return true;
else
for (unsigned int c = 0; c < n_children; ++c)
- if (cell->child(c)->active())
+ if (cell->child(c)->is_active())
cell->child(c)->clear_coarsen_flag();
}
// no children, so no coarsening
// the same.
if (dim == 2)
{
- if (cell->active() && face->has_children())
+ if (cell->is_active() && face->has_children())
{
adjacent_cells[2 * face->child(0)->index() + offset] = cell;
adjacent_cells[2 * face->child(1)->index() + offset] = cell;
// visit cells on finer levels, so no
// harm will be done.
if (face->has_children() &&
- (cell->active() ||
+ (cell->is_active() ||
GeometryInfo<dim>::face_refinement_case(
cell->refinement_case(), f) ==
RefinementCase<dim - 1>::isotropic_refinement))
first_child->set_neighbor(1, second_child);
if (cell->neighbor(0).state() != IteratorState::valid)
first_child->set_neighbor(0, cell->neighbor(0));
- else if (cell->neighbor(0)->active())
+ else if (cell->neighbor(0)->is_active())
{
// since the neighbors level is always <=level,
// if the cell is active, then there are no
if (cell->neighbor(1).state() != IteratorState::valid)
second_child->set_neighbor(1, cell->neighbor(1));
- else if (cell->neighbor(1)->active())
+ else if (cell->neighbor(1)->is_active())
{
Assert(cell->neighbor(1)->level() <= cell->level(),
ExcInternalError());
if (cell != end())
{
// then move to the last active one
- if (cell->active() == true)
+ if (cell->is_active() == true)
return cell;
while ((--cell).state() == IteratorState::valid)
- if (cell->active() == true)
+ if (cell->is_active() == true)
return cell;
}
return cell;
cell_iterator cell = begin(), endc = end();
for (; cell != endc; ++cell)
- if (!cell->active())
+ if (!cell->is_active())
if (cell->child(0)->coarsen_flag_set())
{
cell->set_user_flag();
for (; cell != endc; ++cell)
{
// nothing to do if we are already on the finest level
- if (cell->active())
+ if (cell->is_active())
continue;
const unsigned int n_children = cell->n_children();
unsigned int flagged_children = 0;
for (unsigned int child = 0; child < n_children; ++child)
- if (cell->child(child)->active() &&
+ if (cell->child(child)->is_active() &&
cell->child(child)->coarsen_flag_set())
{
++flagged_children;
for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
++face)
- if (!cell->at_boundary(face) && (!cell->neighbor(face)->active()) &&
+ if (!cell->at_boundary(face) &&
+ (!cell->neighbor(face)->is_active()) &&
(cell_will_be_coarsened(cell->neighbor(face))))
possibly_do_not_produce_unrefined_islands<dim, spacedim>(
cell->neighbor(face));
{
// only do something if this
// cell will be coarsened
- if (!cell->active() && cell_will_be_coarsened(cell))
+ if (!cell->is_active() && cell_will_be_coarsened(cell))
possibly_do_not_produce_unrefined_islands<dim, spacedim>(cell);
}
}
!(smooth_grid & patch_level_1))
{
for (const auto &cell : cell_iterators())
- if (!cell->active() || (cell->active() && cell->refine_flag_set() &&
- cell->is_locally_owned()))
+ if (!cell->is_active() ||
+ (cell->is_active() && cell->refine_flag_set() &&
+ cell->is_locally_owned()))
{
// check whether all children are active, i.e. not
// refined themselves. This is a precondition that the
// flagged for refinement, then all future children
// will be active
bool all_children_active = true;
- if (!cell->active())
+ if (!cell->is_active())
for (unsigned int c = 0; c < cell->n_children(); ++c)
- if (!cell->child(c)->active() ||
+ if (!cell->child(c)->is_active() ||
cell->child(c)->is_ghost() ||
cell->child(c)->is_artificial())
{
eliminate_refined_boundary_islands))) &&
(total_neighbors != 0))
{
- if (!cell->active())
+ if (!cell->is_active())
for (unsigned int c = 0; c < cell->n_children(); ++c)
{
cell->child(c)->clear_refine_flag();
// children is set then set_refine_flag and
// clear_coarsen_flag of all children.
for (const auto &cell : cell_iterators())
- if (!cell->active())
+ if (!cell->is_active())
{
// ensure the invariant. we can then check whether all
// of its children are further refined or not by
// that we know that it is patch_level_1, i.e. if one of
// its children is active then so are all, and it isn't
// going to have any grandchildren at all:
- if (cell->active() || cell->child(0)->active())
+ if (cell->is_active() || cell->child(0)->is_active())
continue;
// cell is not active, and so are none of its
bool has_active_grandchildren = false;
for (unsigned int i = 0; i < n_children; ++i)
- if (cell->child(i)->child(0)->active())
+ if (cell->child(i)->child(0)->is_active())
{
has_active_grandchildren = true;
break;
// if child is found to be a patch of active cells
// itself, then add up how many of its children are
// supposed to be coarsened
- if (child->child(0)->active())
+ if (child->child(0)->is_active())
for (unsigned int cc = 0; cc < nn_children; ++cc)
if (child->child(cc)->coarsen_flag_set())
++n_coarsen_flags;
for (unsigned int c = 0; c < n_children; ++c)
{
const cell_iterator child = cell->child(c);
- if (child->child(0)->active())
+ if (child->child(0)->is_active())
for (unsigned int cc = 0; cc < child->n_children(); ++cc)
child->child(cc)->clear_coarsen_flag();
}
// coarsen flag of our neighbor,
// fix_coarsen_flags() makes sure, that the
// mother cell will not be coarsened
- if (cell->neighbor_or_periodic_neighbor(i)->active())
+ if (cell->neighbor_or_periodic_neighbor(i)->is_active())
{
if ((!has_periodic_neighbor &&
cell->neighbor_is_coarser(i)) ||
const types::subdomain_id new_subdomain_id) const
{
Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(this->active(),
+ Assert(this->is_active(),
ExcMessage("set_subdomain_id() can only be called on active cells!"));
this->tria->levels[this->present_level]->subdomain_ids[this->present_index] =
new_subdomain_id;
++child_index)
{
const auto sibling = parent->child(child_index);
- Assert(sibling->active() &&
+ Assert(sibling->is_active() &&
sibling->coarsen_flag_set(),
typename dealii::Triangulation<
dim>::ExcInconsistentCoarseningFlags());
if (cell->is_locally_owned())
{
- Assert(cell->active(), ExcInternalError());
+ Assert(cell->is_active(), ExcInternalError());
cell->set_active_fe_index(persist.second);
}
}
++child_index)
{
const auto &child = parent->child(child_index);
- Assert(child->is_locally_owned() && child->active(),
+ Assert(child->is_locally_owned() && child->is_active(),
ExcInternalError());
child->set_active_fe_index(refine.second);
}
for (const auto &coarsen : fe_transfer->coarsened_cells_fe_index)
{
const auto &cell = coarsen.first;
- Assert(cell->is_locally_owned() && cell->active(),
+ Assert(cell->is_locally_owned() && cell->is_active(),
ExcInternalError());
cell->set_active_fe_index(coarsen.second);
}
++child_index)
{
const auto &child = parent->child(child_index);
- if (child->active())
+ if (child->is_active())
{
if (child->coarsen_flag_set())
++h_flagged_children;
// drop all h coarsening flags.
for (unsigned int child_index = 0; child_index < n_children;
++child_index)
- if (parent->child(child_index)->active())
+ if (parent->child(child_index)->is_active())
parent->child(child_index)->clear_coarsen_flag();
}
}
{
// move forward until active_cell points at the cell (cell) we are
// looking at to compute the current active_index
- while (active_cell != this->triangulation->end() && cell->active() &&
+ while (active_cell != this->triangulation->end() && cell->is_active() &&
decltype(active_cell)(cell) != active_cell)
{
++active_cell;
// belongs in order to access the cell data. this is not readily
// available, so choose the following rather inefficient way:
Assert(
- cell_and_face->first->active(),
+ cell_and_face->first->is_active(),
ExcMessage(
"The current function is trying to generate cell-data output "
"for a face that does not belong to an active cell. This is "
// we need to get at the number of the cell to which this face
// belongs in order to access the cell data. this is not readily
// available, so choose the following rather inefficient way:
- Assert((*cell)->active(),
+ Assert((*cell)->is_active(),
ExcMessage("Cell must be active for cell data"));
const unsigned int cell_number = std::distance(
this->triangulation->begin_active(),
for (typename DoFHandlerType::cell_iterator cell = dof_handler->begin();
cell != dof_handler->end();
++cell)
- if (!cell->active() && cell->child(0)->coarsen_flag_set())
+ if (!cell->is_active() && cell->child(0)->coarsen_flag_set())
++n_coarsen_fathers;
Assert(n_cells_to_coarsen >= 2 * n_coarsen_fathers, ExcInternalError());
++cell)
{
// CASE 1: active cell that remains as it is
- if (cell->active() && !cell->coarsen_flag_set())
+ if (cell->is_active() && !cell->coarsen_flag_set())
{
const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
indices_on_cell[n_sr].resize(dofs_per_cell);
++child_index)
{
const auto child = cell->child(child_index);
- Assert(child->active() && child->coarsen_flag_set(),
+ Assert(child->is_active() && child->coarsen_flag_set(),
typename dealii::Triangulation<
dim>::ExcInconsistentCoarseningFlags());
// no problem at all, if it is on a lower
// level than the present one, then it
// will be refined below anyway.
- if (new_cell->active())
+ if (new_cell->is_active())
{
- if (new_cell->refine_flag_set() && old_cell->active())
+ if (new_cell->refine_flag_set() && old_cell->is_active())
{
if (old_cell->coarsen_flag_set())
old_cell->clear_coarsen_flag();
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- if (cell->has_children() && cell->child(0)->active())
+ if (cell->has_children() && cell->child(0)->is_active())
{
// first make sure that what
// we do is reasonable. for
// to be active, not only
// some of them
for (unsigned int c = 0; c < cell->n_children(); ++c)
- AssertThrow(cell->child(c)->active(), ExcInternalError());
+ AssertThrow(cell->child(c)->is_active(), ExcInternalError());
// then restrict and prolongate
cell->get_interpolated_dof_values(tmp, v);
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- if (cell->has_children() && cell->child(0)->active())
+ if (cell->has_children() && cell->child(0)->is_active())
{
cell->get_interpolated_dof_values(x, v);
cell->set_dof_values_by_interpolation(v, x2);
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- if (cell->has_children() && cell->child(0)->active())
+ if (cell->has_children() && cell->child(0)->is_active())
{
// first make sure that what
// we do is reasonable. for
// some of them
for (unsigned int c = 0; c < GeometryInfo<dim>::max_children_per_cell;
++c)
- Assert(cell->child(c)->active(), ExcInternalError());
+ Assert(cell->child(c)->is_active(), ExcInternalError());
// then restrict and prolongate
cell->get_interpolated_dof_values(tmp, v);
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- if (cell->has_children() && cell->child(0)->active())
+ if (cell->has_children() && cell->child(0)->is_active())
{
cell->get_interpolated_dof_values(x, v);
cell->set_dof_values_by_interpolation(v, x2);
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- if (cell->has_children() && cell->child(0)->active())
+ if (cell->has_children() && cell->child(0)->is_active())
{
// first make sure that what
// we do is reasonable. for
// some of them
for (unsigned int c = 0; c < GeometryInfo<dim>::max_children_per_cell;
++c)
- AssertThrow(cell->child(c)->active(), ExcInternalError());
+ AssertThrow(cell->child(c)->is_active(), ExcInternalError());
// then restrict and prolongate
cell->get_interpolated_dof_values(tmp, v);
for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- if (cell->has_children() && cell->child(0)->active())
+ if (cell->has_children() && cell->child(0)->is_active())
{
cell->get_interpolated_dof_values(x, v);
cell->set_dof_values_by_interpolation(v, x2);
cell = dof_1.begin();
endc = dof_1.end();
for (unsigned int index = 0; cell != endc; ++cell)
- if (cell->active())
+ if (cell->is_active())
{
++index;
if (index % (2 * dim) == 0)
cell = dof_2.begin();
endc = dof_2.end();
for (unsigned int index = 0; cell != endc; ++cell)
- if (cell->active())
+ if (cell->is_active())
{
++index;
if (index % (2 * dim) == 1)
// produces quite random grids
cell = dof_1.begin();
for (unsigned int index = 0; cell != endc; ++cell)
- if (cell->active())
+ if (cell->is_active())
{
++index;
if (index % 3 == 0)
cell = dof_2.begin();
endc = dof_2.end();
for (unsigned int index = 0; cell != endc; ++cell)
- if (cell->active())
+ if (cell->is_active())
{
++index;
if (index % 3 == 1)
bool
cell_is_patch_level_1(const typename Triangulation<dim>::cell_iterator &cell)
{
- Assert(cell->active() == false, ExcInternalError());
+ Assert(cell->is_active() == false, ExcInternalError());
unsigned int n_active_children = 0;
for (unsigned int i = 0; i < cell->n_children(); ++i)
- if (cell->child(i)->active())
+ if (cell->child(i)->is_active())
++n_active_children;
return (n_active_children == 0) || (n_active_children == cell->n_children());
++cell)
{
deallog << "Cell = " << cell
- << (cell->active() ? " is active " : " is not active ");
- if (!cell->active())
+ << (cell->is_active() ? " is active " : " is not active ");
+ if (!cell->is_active())
{
deallog << "and has children: ";
for (unsigned int i = 0; i < 4; ++i)
AssertThrow((cell->refine_flag_set() == false) &&
(cell->coarsen_flag_set() == false),
ExcInternalError());
- if (!cell->active())
+ if (!cell->is_active())
AssertThrow(cell_is_patch_level_1<2>(cell), ExcInternalError());
}
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
endc = dh.end(1);
for (unsigned int counter = 0; cell != endc; ++counter, ++cell)
{
- Assert(!cell->active(), ExcInternalError());
+ Assert(!cell->is_active(), ExcInternalError());
for (unsigned int child_index = 0; child_index < cell->n_children();
++child_index)
{
const auto &child = cell->child(child_index);
- Assert(child->active(), ExcInternalError());
+ Assert(child->is_active(), ExcInternalError());
child->set_active_fe_index(1);
}
// If the neighbor is not active, then it is at a higher
// refinement level (so we do not need to integrate now)
- if (neighbor_cell->active())
+ if (neighbor_cell->is_active())
{
if (neighbor_cell->is_locally_owned())
{
if (coarsen_me)
for (unsigned int i = 0; i < cell->n_children(); ++i)
{
- if (cell->child(i)->active() &&
+ if (cell->child(i)->is_active() &&
cell->child(i)->is_locally_owned())
{
cell->child(i)->clear_refine_flag();
if (coarsen_me)
for (unsigned int i = 0; i < cell->n_children(); ++i)
{
- if (cell->child(i)->active() &&
+ if (cell->child(i)->is_active() &&
cell->child(i)->is_locally_owned())
{
cell->child(i)->clear_refine_flag();
++face)
{
if ((cell->face(face)->at_boundary()) ||
- (cell->neighbor(face)->active() &&
+ (cell->neighbor(face)->is_active() &&
cell->neighbor(face)->is_ghost()))
{
fe_face_values.reinit(cell, face);
++face)
{
if ((cell->face(face)->at_boundary()) ||
- (cell->neighbor(face)->active() &&
+ (cell->neighbor(face)->is_active() &&
cell->neighbor(face)->is_ghost()))
{
fe_face_values.reinit(cell, face);
}
}
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
(c1->subdomain_id() != c2->subdomain_id()))
return false;
}
}
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
(c1->subdomain_id() != c2->subdomain_id()))
return false;
if (c1->user_flag_set() != c2->user_flag_set())
return false;
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
c1->get_fe().get_name() != c2->get_fe().get_name())
return false;
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
c1->active_fe_index() != c2->active_fe_index())
return false;
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
c1->future_fe_index() != c2->future_fe_index())
return false;
}
}
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
(c1->subdomain_id() != c2->subdomain_id()))
return false;
if (c1->manifold_id() != c2->manifold_id())
return false;
- if (c1->active() && c2->active())
+ if (c1->is_active() && c2->is_active())
if (c1->active_cell_index() != c2->active_cell_index())
return false;
}
}
- if (c1->active() && c2->active() &&
+ if (c1->is_active() && c2->is_active() &&
(c1->subdomain_id() != c2->subdomain_id()))
return false;
if (c1->manifold_id() != c2->manifold_id())
return false;
- if (c1->active() && c2->active())
+ if (c1->is_active() && c2->is_active())
if (c1->active_cell_index() != c2->active_cell_index())
return false;
lvl);
for (; cell != endc; ++cell)
{
- if (cell->active())
+ if (cell->is_active())
cell->set_level_subdomain_id(cell->subdomain_id());
else
cell->set_level_subdomain_id(cell->child(0)->level_subdomain_id());
}
// If the neighbor is not active, then it is at a higher
// refinement level (so we do not need to integrate now)
- if (neighbor_cell->active())
+ if (neighbor_cell->is_active())
{
if (neighbor_cell->is_locally_owned())
{