// the block back to dst.
const unsigned int n_blocks =
*std::max_element(target_component.begin(), target_component.end()) + 1;
- std::vector<types::global_dof_index> dofs_per_block(n_blocks);
- DoFTools::count_dofs_per_block(mg_dof_handler,
- dofs_per_block,
- target_component);
+ const std::vector<types::global_dof_index> dofs_per_block =
+ DoFTools::count_dofs_per_fe_block(mg_dof_handler, target_component);
BlockVector<number> tmp;
tmp.reinit(n_blocks);
for (unsigned int b = 0; b < n_blocks; ++b)
{
if (!levels_only && dof.has_active_dofs())
{
- const FiniteElement<dim, spacedim> & fe = dof.get_fe();
- std::vector<types::global_dof_index> sizes(fe.n_blocks());
- DoFTools::count_dofs_per_block(dof, sizes);
+ const std::vector<types::global_dof_index> sizes =
+ DoFTools::count_dofs_per_fe_block(dof);
bi_global.reinit(sizes);
}
// get an array in which we store which dof on the coarse grid is a
// parameter and which is not
- std::vector<bool> coarse_dof_is_parameter(coarse_grid.n_dofs());
- if (true)
- {
- std::vector<bool> mask(coarse_grid.get_fe(0).n_components(), false);
- mask[coarse_component] = true;
+ IndexSet coarse_dof_is_parameter;
+ {
+ std::vector<bool> mask(coarse_grid.get_fe(0).n_components(), false);
+ mask[coarse_component] = true;
+
+ coarse_dof_is_parameter =
extract_dofs<DoFHandler<dim, spacedim>>(coarse_grid,
- ComponentMask(mask),
- coarse_dof_is_parameter);
- }
+ ComponentMask(mask));
+ }
// now we know that the weights in each row constitute a constraint. enter
// this into the constraints object
for (types::global_dof_index parameter_dof = 0;
parameter_dof < n_coarse_dofs;
++parameter_dof)
- if (coarse_dof_is_parameter[parameter_dof] == true)
+ if (coarse_dof_is_parameter.is_element(parameter_dof))
{
// if this is the line of a parameter dof on the coarse grid, then it
// should have at least one dependent node on the fine grid
}
}
- block_start.resize(n_blocks);
- DoFTools::count_dofs_per_block(
- static_cast<const DoFHandler<dim, spacedim> &>(dof_handler), block_start);
+ block_start = DoFTools::count_dofs_per_fe_block(
+ static_cast<const DoFHandler<dim, spacedim> &>(dof_handler));
types::global_dof_index k = 0;
for (types::global_dof_index &first_index : block_start)
}
}
- component_start.resize(
- *std::max_element(target_component.begin(), target_component.end()) + 1);
- DoFTools::count_dofs_per_block(mg_dof, component_start, target_component);
+ component_start = DoFTools::count_dofs_per_fe_block(mg_dof, target_component);
types::global_dof_index k = 0;
for (types::global_dof_index &first_index : component_start)