template <typename InIterator>
void
resolve_cell(const InIterator & cell,
- std::vector<std::pair<unsigned int, unsigned int>> &cell_its,
- const unsigned int subdomain_id)
+ std::vector<std::pair<unsigned int, unsigned int>> &cell_its)
{
if (cell->has_children())
for (unsigned int child = 0; child < cell->n_children(); ++child)
- resolve_cell(cell->child(child), cell_its, subdomain_id);
- else if (subdomain_id == numbers::invalid_subdomain_id ||
- cell->subdomain_id() == subdomain_id)
+ resolve_cell(cell->child(child), cell_its);
+ else if (cell->is_locally_owned())
{
Assert(cell->is_active(), ExcInternalError());
cell_its.emplace_back(cell->level(), cell->index());
for (unsigned int no = 0; no < dof_handlers.size(); ++no)
dof_info[no].vectorization_length = VectorizedArrayType::size();
- const unsigned int n_mpi_procs = task_info.n_procs;
- const unsigned int my_pid = task_info.my_pid;
-
const Triangulation<dim> &tria = dof_handlers[0]->get_triangulation();
const unsigned int level = additional_data.mg_level;
if (level == numbers::invalid_unsigned_int)
{
- if (n_mpi_procs == 1)
- cell_level_index.reserve(tria.n_active_cells());
- // For serial Triangulations always take all cells
- const unsigned int subdomain_id =
- (dynamic_cast<const parallel::TriangulationBase<dim> *>(
- &dof_handlers[0]->get_triangulation()) != nullptr) ?
- my_pid :
- numbers::invalid_subdomain_id;
+ cell_level_index.reserve(tria.n_active_cells());
// Go through cells on zeroth level and then successively step down into
// children. This gives a z-ordering of the cells, which is beneficial
// when setting up neighboring relations between cells for thread
// parallelization
for (const auto &cell : tria.cell_iterators_on_level(0))
- internal::MatrixFreeFunctions::resolve_cell(cell,
- cell_level_index,
- subdomain_id);
+ internal::MatrixFreeFunctions::resolve_cell(cell, cell_level_index);
- Assert(n_mpi_procs > 1 ||
+ Assert(task_info.n_procs > 1 ||
cell_level_index.size() == tria.n_active_cells(),
ExcInternalError());
}
{
cell_level_index.reserve(tria.n_cells(level));
for (const auto &cell : tria.cell_iterators_on_level(level))
- if (cell->level_subdomain_id() == my_pid)
+ if (cell->is_locally_owned_on_level())
cell_level_index.emplace_back(cell->level(), cell->index());
}
}
const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell();
std::vector<types::global_dof_index> dofs_on_this_cell(dofs_per_cell);
- typename DoFHandler<dim, spacedim>::cell_iterator cell = dof.begin(level),
- endc = dof.end(level);
- for (; cell != endc; ++cell)
- if (dof.get_triangulation().locally_owned_subdomain() ==
- numbers::invalid_subdomain_id ||
- cell->level_subdomain_id() ==
- dof.get_triangulation().locally_owned_subdomain())
+ for (const auto &cell : dof.cell_iterators_on_level(level))
+ if (cell->is_locally_owned_on_level())
{
cell->get_mg_dof_indices(dofs_on_this_cell);
constraints.add_entries_local_to_global(dofs_on_this_cell,
{
for (const auto &cell : dof.cell_iterators())
{
- if (dof.get_triangulation().locally_owned_subdomain() !=
- numbers::invalid_subdomain_id &&
- cell->level_subdomain_id() == numbers::artificial_subdomain_id)
+ if (cell->is_artificial_on_level())
continue;
const FiniteElement<dim> &fe = cell->get_fe();
const unsigned int level = cell->level();
"It's probably worthwhile to select at least one component."));
for (const auto &cell : dof.cell_iterators())
- if (dof.get_triangulation().locally_owned_subdomain() ==
- numbers::invalid_subdomain_id ||
- cell->level_subdomain_id() != numbers::artificial_subdomain_id)
+ if (!cell->is_artificial_on_level())
for (const unsigned int face_no : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(face_no) == false)
{
// Do not look at artificial level cells (in a serial computation we
// need to ignore the level_subdomain_id() because it is never set).
- if (mg_dof_handler.get_triangulation().locally_owned_subdomain() !=
- numbers::invalid_subdomain_id &&
- cell->level_subdomain_id() == numbers::artificial_subdomain_id)
+ if (cell->is_artificial_on_level())
continue;
bool has_coarser_neighbor = false;
// only process cell pairs if one or both of them are owned by
// me (ignore if running in serial)
- if (mg_dof_handler.get_triangulation()
- .locally_owned_subdomain() !=
- numbers::invalid_subdomain_id &&
- neighbor->level_subdomain_id() ==
- numbers::artificial_subdomain_id)
+ if (neighbor->is_artificial_on_level())
continue;
// Do refinement face from the coarse side
DoFTools::extract_locally_relevant_level_dofs(dof_handler,
level + 1,
level_p1_relevant_dofs);
- DynamicSparsityPattern dsp(this->sizes[level + 1],
+ DynamicSparsityPattern dsp(this->sizes[level + 1],
this->sizes[level],
level_p1_relevant_dofs);
- typename DoFHandler<dim>::cell_iterator cell,
- endc = dof_handler.end(level);
- for (cell = dof_handler.begin(level); cell != endc; ++cell)
- if (cell->has_children() &&
- (dof_handler.get_triangulation().locally_owned_subdomain() ==
- numbers::invalid_subdomain_id ||
- cell->level_subdomain_id() ==
- dof_handler.get_triangulation().locally_owned_subdomain()))
+ for (const auto &cell : dof_handler.cell_iterators_on_level(level))
+ if (cell->has_children() && cell->is_locally_owned_on_level())
{
cell->get_mg_dof_indices(dof_indices_parent);
FullMatrix<typename VectorType::value_type> prolongation;
// now actually build the matrices
- for (cell = dof_handler.begin(level); cell != endc; ++cell)
- if (cell->has_children() &&
- (dof_handler.get_triangulation().locally_owned_subdomain() ==
- numbers::invalid_subdomain_id ||
- cell->level_subdomain_id() ==
- dof_handler.get_triangulation().locally_owned_subdomain()))
+ for (const auto &cell : dof_handler.cell_iterators_on_level(level))
+ if (cell->has_children() && cell->is_locally_owned_on_level())
{
cell->get_mg_dof_indices(dof_indices_parent);