From: Wolfgang Bangerth Date: Fri, 16 Dec 2005 04:20:40 +0000 (+0000) Subject: Add one more DoFRenumbering::component_wise function that handles MGDoFHandlers X-Git-Tag: v8.0.0~12779 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6c9277e76fd540909fc5c0c5c11ba2bee4bc78b;p=dealii.git Add one more DoFRenumbering::component_wise function that handles MGDoFHandlers properly. git-svn-id: https://svn.dealii.org/trunk@11867 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_renumbering.h b/deal.II/deal.II/include/dofs/dof_renumbering.h index 2a8aa51a85..c8fae18298 100644 --- a/deal.II/deal.II/include/dofs/dof_renumbering.h +++ b/deal.II/deal.II/include/dofs/dof_renumbering.h @@ -338,8 +338,10 @@ class DoFRenumbering * 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 static void @@ -347,6 +349,22 @@ class DoFRenumbering unsigned int level, const std::vector& target_component = std::vector()); + + /** + * 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 + static void + component_wise (MGDoFHandler& dof_handler, + const std::vector& target_component = std::vector()); + /** * Computes the renumbering * vector needed by the diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index dd00d10baa..f171a12cf8 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -18,6 +18,7 @@ // sparsity structure, possibly compressed and return a vector // of numbers. Simple task. +#include #include #include #include @@ -616,7 +617,7 @@ component_wise (MGDoFHandler &dof_handler, iend = dof_handler.end(level); const ITERATOR end = iend; - unsigned int result = + const unsigned int result = compute_component_wise( renumbering, start, end, component_order_arg); @@ -631,6 +632,29 @@ component_wise (MGDoFHandler &dof_handler, +template +void DoFRenumbering:: +component_wise (MGDoFHandler &dof_handler, + const std::vector &component_order_arg) +{ + Threads::ThreadGroup<> threads; + + void (*non_mg_part) (DoFHandler &, const std::vector &) + = &DoFRenumbering::component_wise; + void (*mg_part) (MGDoFHandler &, unsigned int, const std::vector &) + = &DoFRenumbering::component_wise; + + threads += Threads::spawn (non_mg_part) (static_cast&> (dof_handler), + component_order_arg); + for (unsigned int level=0; level unsigned int DoFRenumbering:: @@ -1254,6 +1278,11 @@ void DoFRenumbering::component_wise unsigned int, const std::vector&); +template +void DoFRenumbering::component_wise +(MGDoFHandler&, + const std::vector&); + template void