]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Move a few functions around to avoid the apparently troublesome anonymous namespace...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 28 Apr 2006 14:23:44 +0000 (14:23 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 28 Apr 2006 14:23:44 +0000 (14:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@12934 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/deal.II/include/dofs/hp_dof_levels.h
deal.II/deal.II/source/dofs/hp_dof_levels.cc

index 2cbf59347c054dc3782bbfba1cb6b21287de93f2..df56233c56a78feab7408836e0c369328825d09e 100644 (file)
 #include <vector>
 
 
-
-namespace 
-{
-  template <int dim>
-  inline
-  void
-  set_hp_vertex_dof_index (const hp::FECollection<dim> &fe,
-                          const unsigned int           fe_index,
-                          const unsigned int          *start_of_list,
-                          const unsigned int           local_index,
-                          const unsigned int           global_index)
-  {
-    Assert (fe_index != hp::DoFHandler<1>::default_fe_index,
-           ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
-    abort ();
-  }
-
-
-  template <int dim>
-  inline
-  unsigned int
-  get_hp_vertex_dof_index (const hp::FECollection<dim> &fe,
-                          const unsigned int           fe_index,
-                          const unsigned int          *start_of_list,
-                          const unsigned int           local_index)
-  {
-    Assert (fe_index != hp::DoFHandler<1>::default_fe_index,
-           ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
-    Assert (local_index < fe[fe_index].dofs_per_vertex,
-           ExcIndexRange(local_index, 0, fe[fe_index].dofs_per_vertex));
-                                    // hop along the list of index
-                                    // sets until we find the one
-                                    // with the correct fe_index, and
-                                    // then poke into that
-                                    // part. trigger an exception if
-                                    // we can't find a set for this
-                                    // particular fe_index
-    const unsigned int *pointer = start_of_list;
-    while (true)
-      {
-       Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
-               ExcInternalError());
-       if (*pointer == fe_index)
-         return *(pointer + 1 + local_index);
-       else
-         pointer += fe[*pointer].dofs_per_vertex;
-      }
-  }  
-}
-
   
 
 /*------------------------- Functions: DoFAccessor ---------------------------*/
@@ -1029,10 +979,11 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::vertex_dof_index (const unsigned int ve
   const unsigned int starting_offset
     = this->dof_handler->vertex_dofs_offsets[this->vertex_index(vertex)];
   
-  return get_hp_vertex_dof_index (this->dof_handler->get_fe(),
-                                 fe_index,
-                                 &this->dof_handler->vertex_dofs[starting_offset],
-                                 i);
+  return internal::hp::DoFLevel<0>::
+    get_hp_vertex_dof_index (this->dof_handler->get_fe(),
+                             fe_index,
+                             &this->dof_handler->vertex_dofs[starting_offset],
+                             i);
 }
 
 
@@ -1058,10 +1009,11 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int ve
   const unsigned int starting_offset
     = this->dof_handler->vertex_dofs_offsets[this->vertex_index(vertex)];
   
-  return get_hp_vertex_dof_index (this->dof_handler->get_fe(),
-                                 fe_index,
-                                 &this->dof_handler->vertex_dofs[starting_offset],
-                                 i);
+  return internal::hp::DoFLevel<0>::
+    get_hp_vertex_dof_index (this->dof_handler->get_fe(),
+                             fe_index,
+                             &this->dof_handler->vertex_dofs[starting_offset],
+                             i);
 }
 
 
@@ -1086,10 +1038,11 @@ DoFObjectAccessor<1,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int ve
   const unsigned int starting_offset
     = this->dof_handler->vertex_dofs_offsets[this->vertex_index(vertex)];
   
-  return get_hp_vertex_dof_index (this->dof_handler->get_fe(),
-                                 fe_index,
-                                 &this->dof_handler->vertex_dofs[starting_offset],
-                                 i);
+  return internal::hp::DoFLevel<0>::
+    get_hp_vertex_dof_index (this->dof_handler->get_fe(),
+                             fe_index,
+                             &this->dof_handler->vertex_dofs[starting_offset],
+                             i);
 }
 
 
@@ -1115,10 +1068,11 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::vertex_dof_index (const unsigned int ve
   const unsigned int starting_offset
     = this->dof_handler->vertex_dofs_offsets[this->vertex_index(vertex)];
   
-  return get_hp_vertex_dof_index (this->dof_handler->get_fe(),
-                                 fe_index,
-                                 &this->dof_handler->vertex_dofs[starting_offset],
-                                 i);
+  return internal::hp::DoFLevel<0>::
+    get_hp_vertex_dof_index (this->dof_handler->get_fe(),
+                             fe_index,
+                             &this->dof_handler->vertex_dofs[starting_offset],
+                             i);
 }
 
 
@@ -1145,10 +1099,11 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int ve
   const unsigned int starting_offset
     = this->dof_handler->vertex_dofs_offsets[this->vertex_index(vertex)];
   
-  return get_hp_vertex_dof_index (this->dof_handler->get_fe(),
-                                 fe_index,
-                                 &this->dof_handler->vertex_dofs[starting_offset],
-                                 i);
+  return internal::hp::DoFLevel<0>::
+    get_hp_vertex_dof_index (this->dof_handler->get_fe(),
+                             fe_index,
+                             &this->dof_handler->vertex_dofs[starting_offset],
+                             i);
 }
 
 
@@ -1175,10 +1130,11 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::vertex_dof_index (const unsigned int ve
   const unsigned int starting_offset
     = this->dof_handler->vertex_dofs_offsets[this->vertex_index(vertex)];
   
-  return get_hp_vertex_dof_index (this->dof_handler->get_fe(),
-                                 fe_index,
-                                 &this->dof_handler->vertex_dofs[starting_offset],
-                                 i);
+  return internal::hp::DoFLevel<0>::
+    get_hp_vertex_dof_index (this->dof_handler->get_fe(),
+                             fe_index,
+                             &this->dof_handler->vertex_dofs[starting_offset],
+                             i);
 }
 
 
index 8259f93a5b5952e7635dcddd1dad23fba7b93307..fdc3da243ba62f8b3bdf2d880639274f8d25caa4 100644 (file)
 
 
 #include <base/config.h>
+#include <fe/fe_collection.h>
+
 #include <vector>
 
 
+namespace hp
+{
+  template <int dim>
+  class FECollection;
+}
+
+
 namespace internal
 {
   namespace hp
@@ -76,6 +85,23 @@ namespace internal
                                           */
 
         std::vector<unsigned int> active_fe_indices;
+
+        template <int dim>
+        static
+        unsigned int
+        get_hp_vertex_dof_index (const ::hp::FECollection<dim> &fe,
+                                 const unsigned int           fe_index,
+                                 const unsigned int          *start_of_list,
+                                 const unsigned int           local_index);
+
+        template <int dim>
+        static
+        void
+        set_hp_vertex_dof_index (const ::hp::FECollection<dim> &fe,
+                                 const unsigned int           fe_index,
+                                 const unsigned int          *start_of_list,
+                                 const unsigned int           local_index,
+                                 const unsigned int           global_index);
     };
 
 
@@ -235,7 +261,12 @@ namespace internal
                                           */
         unsigned int memory_consumption () const;
     };
-  
+
+
+// ------------------ inline and template functions
+
+
+    
   } // namespace hp
   
 } // namespace internal
index 8df4c7259849db8764517907a4b0b92ffead5e5d..e6b32b4ef6371efb01b4e7b75dbeb4a6f0ee5ba8 100644 (file)
@@ -46,5 +46,70 @@ namespace internal
               MemoryConsumption::memory_consumption (hex_dofs) +
               MemoryConsumption::memory_consumption (dof_hex_index_offset));
     }
+
+    template <int dim>
+    void
+    DoFLevel<0>::
+    set_hp_vertex_dof_index (const ::hp::FECollection<dim> &fe,
+                             const unsigned int           fe_index,
+                             const unsigned int          *start_of_list,
+                             const unsigned int           local_index,
+                             const unsigned int           global_index)
+    {
+      Assert (fe_index != hp::DoFHandler<dim>::default_fe_index,
+              ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
+      abort ();
+    }
+
+
+    template <int dim>
+    unsigned int
+    DoFLevel<0>::
+    get_hp_vertex_dof_index (const ::hp::FECollection<dim> &fe,
+                             const unsigned int           fe_index,
+                             const unsigned int          *start_of_list,
+                             const unsigned int           local_index)
+    {
+      Assert (fe_index != hp::DoFHandler<dim>::default_fe_index,
+              ExcMessage ("You need to specify a FE index when working with hp DoFHandlers"));
+      Assert (local_index < fe[fe_index].dofs_per_vertex,
+              ExcIndexRange(local_index, 0, fe[fe_index].dofs_per_vertex));
+                                       // hop along the list of index
+                                       // sets until we find the one
+                                       // with the correct fe_index, and
+                                       // then poke into that
+                                       // part. trigger an exception if
+                                       // we can't find a set for this
+                                       // particular fe_index
+      const unsigned int *pointer = start_of_list;
+      while (true)
+        {
+          Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+                  ExcInternalError());
+          if (*pointer == fe_index)
+            return *(pointer + 1 + local_index);
+          else
+            pointer += fe[*pointer].dofs_per_vertex;
+        }
+    }  
+
+
+// explicit instantiations
+    template
+    void
+    DoFLevel<0>::
+    set_hp_vertex_dof_index (const ::hp::FECollection<deal_II_dimension> &fe,
+                             const unsigned int           fe_index,
+                             const unsigned int          *start_of_list,
+                             const unsigned int           local_index,
+                             const unsigned int           global_index);
+    
+    template
+    unsigned int
+    DoFLevel<0>::
+    get_hp_vertex_dof_index (const ::hp::FECollection<deal_II_dimension> &fe,
+                             const unsigned int           fe_index,
+                             const unsigned int          *start_of_list,
+                             const unsigned int           local_index);
   }
 }

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.