]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add one more DoFRenumbering::component_wise function that handles MGDoFHandlers
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 16 Dec 2005 04:20:40 +0000 (04:20 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 16 Dec 2005 04:20:40 +0000 (04:20 +0000)
properly.

git-svn-id: https://svn.dealii.org/trunk@11867 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_renumbering.h
deal.II/deal.II/source/dofs/dof_renumbering.cc

index 2a8aa51a851bf6d69e9bfdc87652661c8d5d8415..c8fae18298df1bfca769f6a0d23873a57a12d61e 100644 (file)
@@ -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 <int dim>
     static void
@@ -347,6 +349,22 @@ class DoFRenumbering
                    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
index dd00d10baa13d96337b8584f4a9d19c1b58c0212..f171a12cf85bf775c276d0a22a8a101e7e761dab 100644 (file)
@@ -18,6 +18,7 @@
 //    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>
@@ -616,7 +617,7 @@ component_wise (MGDoFHandler<dim> &dof_handler,
     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);
 
@@ -631,6 +632,29 @@ component_wise (MGDoFHandler<dim> &dof_handler,
 
 
 
+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::
@@ -1254,6 +1278,11 @@ void DoFRenumbering::component_wise<deal_II_dimension>
  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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.