#ifndef __deal2__mg_tools_h
#define __deal2__mg_tools_h
-// This file moved here from mg_dof_tools.h Revision 1.36
-
#include <base/config.h>
+#include <base/index_set.h>
#include <dofs/dof_tools.h>
#include <multigrid/mg_dof_handler.h>
#include <vector>
#include <set>
+
DEAL_II_NAMESPACE_OPEN
template <class Object> class MGLevelObject;
* of levels.
*/
template <int dim, int spacedim>
- static void make_boundary_list(
- const MGDoFHandler<dim,spacedim>& mg_dof,
- const typename FunctionMap<dim>::type& function_map,
- std::vector<std::set<unsigned int> >& boundary_indices,
- const std::vector<bool>& component_mask = std::vector<bool>());
- /**
- * Maybe no longer needed.
- */
+ static
+ void
+ make_boundary_list (const MGDoFHandler<dim,spacedim> &mg_dof,
+ const typename FunctionMap<dim>::type &function_map,
+ std::vector<std::set<unsigned int> > &boundary_indices,
+ const std::vector<bool> &component_mask = std::vector<bool>());
+
+ /**
+ * The same function as above, but return
+ * an IndexSet rather than a
+ * std::set<unsigned int> on each level.
+ */
+ template <int dim, int spacedim>
+ static
+ void
+ make_boundary_list (const MGDoFHandler<dim,spacedim> &mg_dof,
+ const typename FunctionMap<dim>::type &function_map,
+ std::vector<IndexSet> &boundary_indices,
+ const std::vector<bool> &component_mask = std::vector<bool>());
+
+ /**
+ * Maybe no longer needed.
+ */
template <typename number>
static void apply_boundary_values (
#endif
+template <int dim, int spacedim>
+void
+MGTools::
+make_boundary_list(const MGDoFHandler<dim,spacedim>& dof,
+ const typename FunctionMap<dim>::type& function_map,
+ std::vector<IndexSet>& boundary_indices,
+ const std::vector<bool>& component_mask)
+{
+ std::vector<std::set<unsigned int> >
+ my_boundary_indices (boundary_indices.size());
+ make_boundary_list (dof, function_map, my_boundary_indices, component_mask);
+ for (unsigned int i=0; i<boundary_indices.size(); ++i)
+ {
+ boundary_indices[i] = IndexSet (my_boundary_indices[i].size());
+ boundary_indices[i].add_indices (my_boundary_indices[i].begin(),
+ my_boundary_indices[i].end());
+ }
+}
+
+
#if deal_II_dimension == 1
template <int dim, int spacedim>
std::vector<std::set<unsigned int> >&,
const std::vector<bool>&);
+template void MGTools::make_boundary_list(
+ const MGDoFHandler<deal_II_dimension>&,
+ const FunctionMap<deal_II_dimension>::type&,
+ std::vector<IndexSet>&,
+ const std::vector<bool>&);
+
template
void
MGTools::