static void
renumber_vertex_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
DoFHandler<dim, spacedim> & dof_handler,
const bool check_validity)
{
i != dof_handler.vertex_dofs.end();
++i)
if (*i != numbers::invalid_dof_index)
- *i = (indices.size() == 0) ?
+ *i = (indices_we_care_about.size() == 0) ?
(new_numbers[*i]) :
- (new_numbers[indices.index_within_set(*i)]);
+ (new_numbers[indices_we_care_about.index_within_set(*i)]);
else if (check_validity)
// if index is invalid_dof_index: check if this one
// really is unused
static void
renumber_cell_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
DoFHandler<dim, spacedim> & dof_handler)
{
for (unsigned int level = 0; level < dof_handler.levels.size();
i != dof_handler.levels[level]->dof_object.dofs.end();
++i)
if (*i != numbers::invalid_dof_index)
- *i = ((indices.size() == 0) ?
- new_numbers[*i] :
- new_numbers[indices.index_within_set(*i)]);
+ *i =
+ ((indices_we_care_about.size() == 0) ?
+ new_numbers[*i] :
+ new_numbers[indices_we_care_about.index_within_set(*i)]);
}
static void
renumber_face_dofs(
const std::vector<types::global_dof_index> & /*new_numbers*/,
- const IndexSet & /*indices*/,
+ const IndexSet & /*indices_we_care_about*/,
DoFHandler<1, spacedim> & /*dof_handler*/)
{
// nothing to do in 1d since there are no separate faces
static void
renumber_face_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
DoFHandler<2, spacedim> & dof_handler)
{
// treat dofs on lines
i != dof_handler.faces->lines.dofs.end();
++i)
if (*i != numbers::invalid_dof_index)
- *i = ((indices.size() == 0) ?
+ *i = ((indices_we_care_about.size() == 0) ?
new_numbers[*i] :
- new_numbers[indices.index_within_set(*i)]);
+ new_numbers[indices_we_care_about.index_within_set(*i)]);
}
static void
renumber_face_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
DoFHandler<3, spacedim> & dof_handler)
{
// treat dofs on lines
i != dof_handler.faces->lines.dofs.end();
++i)
if (*i != numbers::invalid_dof_index)
- *i = ((indices.size() == 0) ?
+ *i = ((indices_we_care_about.size() == 0) ?
new_numbers[*i] :
- new_numbers[indices.index_within_set(*i)]);
+ new_numbers[indices_we_care_about.index_within_set(*i)]);
// treat dofs on quads
for (std::vector<types::global_dof_index>::iterator i =
i != dof_handler.faces->quads.dofs.end();
++i)
if (*i != numbers::invalid_dof_index)
- *i = ((indices.size() == 0) ?
+ *i = ((indices_we_care_about.size() == 0) ?
new_numbers[*i] :
- new_numbers[indices.index_within_set(*i)]);
+ new_numbers[indices_we_care_about.index_within_set(*i)]);
}
static void
renumber_vertex_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
hp::DoFHandler<dim, spacedim> & dof_handler,
const bool check_validity)
{
// This will later be fixed up after the first ghost
// exchange phase when we unify hp DoFs on neighboring
// cells.
- if (indices.size() == 0)
+ if (indices_we_care_about.size() == 0)
dealii::internal::DoFAccessorImplementation::
Implementation::set_vertex_dof_index(
dof_handler,
new_numbers[old_dof_index]);
else
{
- if (indices.is_element(old_dof_index))
+ if (indices_we_care_about.is_element(
+ old_dof_index))
dealii::internal::DoFAccessorImplementation::
Implementation::set_vertex_dof_index(
dof_handler,
vertex_index,
fe_index,
d,
- new_numbers[indices.index_within_set(
- old_dof_index)]);
+ new_numbers[indices_we_care_about
+ .index_within_set(
+ old_dof_index)]);
else
dealii::internal::DoFAccessorImplementation::
Implementation::set_vertex_dof_index(
static void
renumber_cell_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
hp::DoFHandler<dim, spacedim> & dof_handler)
{
for (typename hp::DoFHandler<dim, spacedim>::active_cell_iterator
// set it to an invalid index. This will later be fixed
// up after the first ghost exchange phase when we unify
// hp DoFs on neighboring cells.
- if (indices.size() == 0)
+ if (indices_we_care_about.size() == 0)
cell->set_dof_index(d,
new_numbers[old_dof_index],
fe_index);
else
{
- if (indices.is_element(old_dof_index))
+ if (indices_we_care_about.is_element(old_dof_index))
cell->set_dof_index(
d,
- new_numbers[indices.index_within_set(
- old_dof_index)],
+ new_numbers[indices_we_care_about
+ .index_within_set(old_dof_index)],
fe_index);
else
cell->set_dof_index(d,
static void
renumber_face_dofs(
const std::vector<types::global_dof_index> & /*new_numbers*/,
- const IndexSet & /*indices*/,
+ const IndexSet & /*indices_we_care_about*/,
hp::DoFHandler<1, spacedim> & /*dof_handler*/)
{
// nothing to do in 1d since there are no separate faces -- we've
static void
renumber_face_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
hp::DoFHandler<2, spacedim> & dof_handler)
{
const unsigned int dim = 2;
// will later be fixed up after the first
// ghost exchange phase when we unify hp DoFs
// on neighboring cells.
- if (indices.size() == 0)
+ if (indices_we_care_about.size() == 0)
line->set_dof_index(
d, new_numbers[old_dof_index], fe_index);
else
{
- if (indices.is_element(old_dof_index))
+ if (indices_we_care_about.is_element(
+ old_dof_index))
line->set_dof_index(
d,
- new_numbers[indices.index_within_set(
- old_dof_index)],
+ new_numbers[indices_we_care_about
+ .index_within_set(
+ old_dof_index)],
fe_index);
else
line->set_dof_index(
static void
renumber_face_dofs(
const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
+ const IndexSet & indices_we_care_about,
hp::DoFHandler<3, spacedim> & dof_handler)
{
const unsigned int dim = 3;
// will later be fixed up after the first
// ghost exchange phase when we unify hp DoFs
// on neighboring cells.
- if (indices.size() == 0)
+ if (indices_we_care_about.size() == 0)
line->set_dof_index(
d, new_numbers[old_dof_index], fe_index);
- else if (indices.is_element(old_dof_index))
+ else if (indices_we_care_about.is_element(
+ old_dof_index))
line->set_dof_index(
d,
- new_numbers[indices.index_within_set(
- old_dof_index)],
+ new_numbers[indices_we_care_about
+ .index_within_set(
+ old_dof_index)],
fe_index);
else
line->set_dof_index(
// will later be fixed up after the first
// ghost exchange phase when we unify hp DoFs
// on neighboring cells.
- if (indices.size() == 0)
+ if (indices_we_care_about.size() == 0)
quad->set_dof_index(
d, new_numbers[old_dof_index], fe_index);
else
{
- if (indices.is_element(old_dof_index))
+ if (indices_we_care_about.is_element(
+ old_dof_index))
quad->set_dof_index(
d,
- new_numbers[indices.index_within_set(
- old_dof_index)],
+ new_numbers[indices_we_care_about
+ .index_within_set(
+ old_dof_index)],
fe_index);
else
quad->set_dof_index(
template <class DoFHandlerType>
static void
renumber_dofs(const std::vector<types::global_dof_index> &new_numbers,
- const IndexSet & indices,
- DoFHandlerType & dof_handler,
- const bool check_validity)
+ const IndexSet &indices_we_care_about,
+ DoFHandlerType &dof_handler,
+ const bool check_validity)
{
if (DoFHandlerType::dimension == 1)
- Assert(indices == IndexSet(0), ExcNotImplemented());
+ Assert(indices_we_care_about == IndexSet(0), ExcNotImplemented());
// renumber DoF indices on vertices, cells, and faces. this
// can be done in parallel because the respective functions
Threads::TaskGroup<> tasks;
tasks += Threads::new_task([&]() {
renumber_vertex_dofs(new_numbers,
- indices,
+ indices_we_care_about,
dof_handler,
check_validity);
});
- tasks += Threads::new_task(
- [&]() { renumber_face_dofs(new_numbers, indices, dof_handler); });
- tasks += Threads::new_task(
- [&]() { renumber_cell_dofs(new_numbers, indices, dof_handler); });
+ tasks += Threads::new_task([&]() {
+ renumber_face_dofs(new_numbers, indices_we_care_about, dof_handler);
+ });
+ tasks += Threads::new_task([&]() {
+ renumber_cell_dofs(new_numbers, indices_we_care_about, dof_handler);
+ });
tasks.join_all();
// update the cache used for cell dof indices
static void
renumber_vertex_mg_dofs(
const std::vector<dealii::types::global_dof_index> &new_numbers,
- const IndexSet & indices,
- DoFHandler<dim, spacedim> & dof_handler,
- const unsigned int level,
- const bool check_validity)
+ const IndexSet & indices_we_care_about,
+ DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level,
+ const bool check_validity)
{
Assert(level < dof_handler.get_triangulation().n_levels(),
ExcInternalError());
ExcInternalError());
if (idx != numbers::invalid_dof_index)
- i->set_index(
- level,
- d,
- dof_handler.get_fe().dofs_per_vertex,
- (indices.size() == 0) ?
- (new_numbers[idx]) :
- (new_numbers[indices.index_within_set(idx)]));
+ i->set_index(level,
+ d,
+ dof_handler.get_fe().dofs_per_vertex,
+ (indices_we_care_about.size() == 0) ?
+ (new_numbers[idx]) :
+ (new_numbers[indices_we_care_about
+ .index_within_set(idx)]));
}
}
static void
renumber_cell_mg_dofs(
const std::vector<dealii::types::global_dof_index> &new_numbers,
- const IndexSet & indices,
- DoFHandler<dim, spacedim> & dof_handler,
- const unsigned int level)
+ const IndexSet & indices_we_care_about,
+ DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level)
{
for (std::vector<types::global_dof_index>::iterator i =
dof_handler.mg_levels[level]->dof_object.dofs.begin();
{
if (*i != numbers::invalid_dof_index)
{
- Assert((indices.size() > 0 ? indices.is_element(*i) :
- (*i < new_numbers.size())),
+ Assert((indices_we_care_about.size() > 0 ?
+ indices_we_care_about.is_element(*i) :
+ (*i < new_numbers.size())),
ExcInternalError());
- *i = (indices.size() == 0) ?
- (new_numbers[*i]) :
- (new_numbers[indices.index_within_set(*i)]);
+ *i =
+ (indices_we_care_about.size() == 0) ?
+ (new_numbers[*i]) :
+ (new_numbers[indices_we_care_about.index_within_set(*i)]);
}
}
}
static void
renumber_face_mg_dofs(
const std::vector<types::global_dof_index> & /*new_numbers*/,
- const IndexSet & /*indices*/,
+ const IndexSet & /*indices_we_care_about*/,
DoFHandler<1, spacedim> & /*dof_handler*/,
const unsigned int /*level*/,
const bool /*check_validity*/)
static void
renumber_face_mg_dofs(
const std::vector<dealii::types::global_dof_index> &new_numbers,
- const IndexSet & indices,
- DoFHandler<2, spacedim> & dof_handler,
- const unsigned int level,
- const bool check_validity)
+ const IndexSet & indices_we_care_about,
+ DoFHandler<2, spacedim> &dof_handler,
+ const unsigned int level,
+ const bool check_validity)
{
if (dof_handler.get_fe().dofs_per_line > 0)
{
cell->line(l)->set_mg_dof_index(
level,
d,
- ((indices.size() == 0) ?
+ ((indices_we_care_about.size() == 0) ?
new_numbers[idx] :
- new_numbers[indices.index_within_set(idx)]));
+ new_numbers[indices_we_care_about
+ .index_within_set(idx)]));
}
cell->line(l)->clear_user_flag();
}
static void
renumber_face_mg_dofs(
const std::vector<dealii::types::global_dof_index> &new_numbers,
- const IndexSet & indices,
- DoFHandler<3, spacedim> & dof_handler,
- const unsigned int level,
- const bool check_validity)
+ const IndexSet & indices_we_care_about,
+ DoFHandler<3, spacedim> &dof_handler,
+ const unsigned int level,
+ const bool check_validity)
{
if (dof_handler.get_fe().dofs_per_line > 0 ||
dof_handler.get_fe().dofs_per_quad > 0)
cell->line(l)->set_mg_dof_index(
level,
d,
- ((indices.size() == 0) ?
+ ((indices_we_care_about.size() == 0) ?
new_numbers[idx] :
- new_numbers[indices.index_within_set(idx)]));
+ new_numbers[indices_we_care_about
+ .index_within_set(idx)]));
}
cell->line(l)->clear_user_flag();
}
cell->quad(l)->set_mg_dof_index(
level,
d,
- ((indices.size() == 0) ?
+ ((indices_we_care_about.size() == 0) ?
new_numbers[idx] :
- new_numbers[indices.index_within_set(idx)]));
+ new_numbers[indices_we_care_about
+ .index_within_set(idx)]));
}
cell->quad(l)->clear_user_flag();
}
static void
renumber_mg_dofs(
const std::vector<dealii::types::global_dof_index> &new_numbers,
- const IndexSet & indices,
- DoFHandler<dim, spacedim> & dof_handler,
- const unsigned int level,
- const bool check_validity)
+ const IndexSet & indices_we_care_about,
+ DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level,
+ const bool check_validity)
{
Assert(level < dof_handler.get_triangulation().n_global_levels(),
ExcInternalError());
// work on separate data structures
Threads::TaskGroup<> tasks;
tasks += Threads::new_task([&]() {
- renumber_vertex_mg_dofs(
- new_numbers, indices, dof_handler, level, check_validity);
+ renumber_vertex_mg_dofs(new_numbers,
+ indices_we_care_about,
+ dof_handler,
+ level,
+ check_validity);
});
tasks += Threads::new_task([&]() {
- renumber_face_mg_dofs(
- new_numbers, indices, dof_handler, level, check_validity);
+ renumber_face_mg_dofs(new_numbers,
+ indices_we_care_about,
+ dof_handler,
+ level,
+ check_validity);
});
tasks += Threads::new_task([&]() {
- renumber_cell_mg_dofs(new_numbers, indices, dof_handler, level);
+ renumber_cell_mg_dofs(new_numbers,
+ indices_we_care_about,
+ dof_handler,
+ level);
});
tasks.join_all();
}
static void
renumber_mg_dofs(
const std::vector<dealii::types::global_dof_index> & /*new_numbers*/,
- const IndexSet & /*indices*/,
+ const IndexSet & /*indices_we_care_about*/,
hp::DoFHandler<dim, spacedim> & /*dof_handler*/,
const unsigned int /*level*/,
const bool /*check_validity*/)