* component. It does the same
* thing as the above function,
* only that it does this for one
- * level of a multi-level
- * discretization.
+ * single level of a multi-level
+ * discretization. The
+ * non-multigrid part of the
+ * MGDoFHandler is not touched.
*/
template <int dim>
static void
unsigned int level,
const std::vector<unsigned int>& target_component = std::vector<unsigned int>());
+
+ /**
+ * Sort the degrees of freedom by
+ * component. It does the same
+ * thing as the previous
+ * functions, but more: it
+ * renumbers not only every level
+ * of the multigrid part, but
+ * also the global,
+ * i.e. non-multigrid components.
+ */
+ template <int dim>
+ static void
+ component_wise (MGDoFHandler<dim>& dof_handler,
+ const std::vector<unsigned int>& target_component = std::vector<unsigned int>());
+
/**
* Computes the renumbering
* vector needed by the
// sparsity structure, possibly compressed and return a vector
// of numbers. Simple task.
+#include <base/thread_management.h>
#include <lac/sparsity_pattern.h>
#include <lac/compressed_sparsity_pattern.h>
#include <dofs/dof_accessor.h>
iend = dof_handler.end(level);
const ITERATOR end = iend;
- unsigned int result =
+ const unsigned int result =
compute_component_wise<dim, ITERATOR, ITERATOR>(
renumbering, start, end, component_order_arg);
+template <int dim>
+void DoFRenumbering::
+component_wise (MGDoFHandler<dim> &dof_handler,
+ const std::vector<unsigned int> &component_order_arg)
+{
+ Threads::ThreadGroup<> threads;
+
+ void (*non_mg_part) (DoFHandler<dim> &, const std::vector<unsigned int> &)
+ = &DoFRenumbering::component_wise<dim>;
+ void (*mg_part) (MGDoFHandler<dim> &, unsigned int, const std::vector<unsigned int> &)
+ = &DoFRenumbering::component_wise<dim>;
+
+ threads += Threads::spawn (non_mg_part) (static_cast<DoFHandler<dim>&> (dof_handler),
+ component_order_arg);
+ for (unsigned int level=0; level<dof_handler.get_tria().n_levels(); ++level)
+ threads += Threads::spawn (mg_part) (dof_handler, level, component_order_arg);
+
+ threads.join_all();
+}
+
+
+
+
template <int dim, class ITERATOR, class ENDITERATOR>
unsigned int
DoFRenumbering::
unsigned int,
const std::vector<unsigned int>&);
+template
+void DoFRenumbering::component_wise<deal_II_dimension>
+(MGDoFHandler<deal_II_dimension>&,
+ const std::vector<unsigned int>&);
+
template
void