]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add make_boundary_list also for IndexSet arguments.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 13 Feb 2010 00:52:05 +0000 (00:52 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 13 Feb 2010 00:52:05 +0000 (00:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@20582 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_tools.h
deal.II/deal.II/source/multigrid/mg_dof_tools.cc

index 6967a36a6d9208b40bae2242442be9fb8db635c6..9f6bf212521ef75015a97fc6b6ed19df70a301d5 100644 (file)
 #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;
@@ -237,14 +237,29 @@ class MGTools
                                      * 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 (
index 7f0d8146befe24220fa63b86134e48d51b16de66..c1ea3c7c70a66ab01e641b31b1d4838e5778eb6c 100644 (file)
@@ -1298,6 +1298,26 @@ MGTools::make_boundary_list(
 #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>
@@ -1555,6 +1575,12 @@ template void MGTools::make_boundary_list(
   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::

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.