* extract_dofs() for one level
* of a multi-grid DoF numbering.
*/
- template <int dim, int spacedim>
+ template <class DH>
void
extract_level_dofs (const unsigned int level,
- const MGDoFHandler<dim,spacedim> &dof,
- const std::vector<bool> &select,
- std::vector<bool> &selected_dofs,
- const bool blocks = false);
+ const DH &dof,
+ const std::vector<bool> &select,
+ std::vector<bool> &selected_dofs,
+ const bool blocks = false);
-
+
/**
* Extract all degrees of freedom
* which are at the boundary and
template <class DH>
void
count_dofs_per_block (const DH &dof,
- std::vector<unsigned int> &dofs_per_block,
- const std::vector<unsigned int> &target_block
- = std::vector<unsigned int>());
+ std::vector<types::global_dof_index> &dofs_per_block,
- std::vector<types::global_dof_index> target_block
++ const std::vector<types::global_dof_index> &target_block
+ = std::vector<types::global_dof_index>());
/**
* @deprecated See the previous
template <int dim, int spacedim>
void
-BlockInfo::initialize(const DoFHandler<dim, spacedim>& dof)
+BlockInfo::initialize(const DoFHandler<dim, spacedim>& dof, bool levels_only, bool multigrid)
{
- const FiniteElement<dim, spacedim>& fe = dof.get_fe();
- std::vector<unsigned int> sizes(fe.n_blocks());
- DoFTools::count_dofs_per_block(dof, sizes);
- bi_global.reinit(sizes);
+ if (!levels_only) {
+ const FiniteElement<dim, spacedim>& fe = dof.get_fe();
+ std::vector<unsigned int> sizes(fe.n_blocks());
+ DoFTools::count_dofs_per_block(dof, sizes);
+ bi_global.reinit(sizes);
+ }
+
+ if (multigrid) {
+ std::vector<std::vector<unsigned int> > sizes (dof.get_tria ().n_levels ());
+
+ for (unsigned int i = 0; i < sizes.size (); ++i)
+ sizes[i].resize (dof.get_fe ().n_blocks ());
+
- //TODO[MB]:
- Assert (false, ExcMessage("Markus: This still needs to be fixed, it doesn't compile."));
- // MGTools::count_dofs_per_block (dof, sizes);
++ MGTools::count_dofs_per_block (dof, sizes);
+ levels.resize (sizes.size ());
+
+ for (unsigned int i = 0; i < sizes.size (); ++i)
+ levels[i].reinit (sizes[i]);
+ }
}
template <class DH>
void
count_dofs_per_block (const DH &dof_handler,
- std::vector<unsigned int> &dofs_per_block,
+ std::vector<types::global_dof_index> &dofs_per_block,
- std::vector<unsigned int> target_block)
+ const std::vector<unsigned int> &target_block_)
{
+ std::vector<unsigned int> target_block = target_block_;
+
const dealii::hp::FECollection<DH::dimension,DH::space_dimension>
fe_collection (dof_handler.get_fe());
Assert (fe_collection.size() < 256, ExcNotImplemented());