template <int dim, int spacedim>
void initialize(const DoFHandler<dim,spacedim> &dof,
const typename FunctionMap<dim>::type &function_map,
- const ComponentMask &component_mask = ComponentMask());
+ const ComponentMask &component_mask = ComponentMask()) DEAL_II_DEPRECATED;
+
+ /**
+ * Fill the internal data structures with information about interface and boundary dofs.
+ *
+ * This function internally calls the initialize() function above and the
+ * constrains degrees on the external boundary of the domain by calling
+ * MGTools::make_boundary_list() with the given second and third argument.
+ */
+ template <int dim, int spacedim>
+ void set_zero_boundary_dofs(const DoFHandler<dim,spacedim> &dof,
+ const std::vector<types::boundary_id> &boundary_indicators,
+ const ComponentMask &component_mask = ComponentMask());
/**
* Reset the data structures.
}
+template <int dim, int spacedim>
+inline
+void
+MGConstrainedDoFs::set_zero_boundary_dofs(const DoFHandler<dim,spacedim> &dof,
+ const std::vector<types::boundary_id> &boundary_indicators,
+ const ComponentMask &component_mask)
+{
+ // allocate an IndexSet for each global level. Contents will be
+ // overwritten inside make_boundary_list.
+ const unsigned int n_levels = dof.get_triangulation().n_global_levels();
+ boundary_indices.resize(n_levels);
+
+ MGTools::make_boundary_list (dof,
+ boundary_indicators,
+ boundary_indices,
+ component_mask);
+}
+
+
inline
void
MGConstrainedDoFs::clear()
std::vector<IndexSet> &boundary_indices,
const ComponentMask &component_mask = ComponentMask());
+ /**
+ * The same function as above, but return an IndexSet rather than a
+ * std::set<unsigned int> on each level.
+ */
+ template <int dim, int spacedim>
+ void
+ make_boundary_list (const DoFHandler<dim,spacedim> &mg_dof,
+ const std::vector<types::boundary_id> &boundary_indicators,
+ std::vector<IndexSet> &boundary_indices,
+ const ComponentMask &component_mask = ComponentMask());
+
/**
* For each level in a multigrid hierarchy, produce an IndexSet that
* indicates which of the degrees of freedom are along interfaces of this
}
+ template <int dim, int spacedim>
+ void
+ make_boundary_list(const DoFHandler<dim,spacedim> &dof,
+ const std::vector<types::boundary_id> &boundary_indicators,
+ std::vector<IndexSet> &boundary_indices,
+ const ComponentMask &component_mask)
+ {
+ Assert (boundary_indices.size() == dof.get_triangulation().n_global_levels(),
+ ExcDimensionMismatch (boundary_indices.size(),
+ dof.get_triangulation().n_global_levels()));
+
+ std::vector<std::set<types::global_dof_index> >
+ my_boundary_indices (dof.get_triangulation().n_global_levels());
+
+ //TODO get rid off this
+ typename FunctionMap<dim>::type homogen_bc;
+ ZeroFunction<dim> zero_function (dim);
+ for (unsigned int i=0;i<boundary_indicators.size();++i)
+ homogen_bc[i] = &zero_function;
+
+ make_boundary_list (dof, homogen_bc, my_boundary_indices, component_mask);
+ for (unsigned int i=0; i<dof.get_triangulation().n_global_levels(); ++i)
+ {
+ if (boundary_indices[i].size()!=dof.n_dofs(i))
+ boundary_indices[i] = IndexSet (dof.n_dofs(i));
+ boundary_indices[i].add_indices (my_boundary_indices[i].begin(),
+ my_boundary_indices[i].end());
+ }
+ }
+
+
template <int dim, int spacedim>
void
extract_non_interface_dofs (const DoFHandler<dim,spacedim> &mg_dof_handler,
std::vector<IndexSet>&,
const ComponentMask &);
+ template void make_boundary_list(
+ const DoFHandler<deal_II_dimension> &dof,
+ const std::vector<types::boundary_id> &boundary_indicators,
+ std::vector<IndexSet> &boundary_indices,
+ const ComponentMask &component_mask);
+
+
template
void
extract_inner_interface_dofs (const DoFHandler<deal_II_dimension> &mg_dof_handler,