]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Provide nth_active_fe_index. Simplify implementation of n_active_fe_indices, since...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Jul 2006 16:20:40 +0000 (16:20 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Jul 2006 16:20:40 +0000 (16:20 +0000)
git-svn-id: https://svn.dealii.org/trunk@13447 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e2713aeb3fcb6dbfed779bc3f86a3d2f8f224959..d5f3c99f990722d981981a4d5d991db8e2845f68 100644 (file)
@@ -1121,13 +1121,30 @@ class DoFHandler  :  public Subscriptor
                        const unsigned int       global_index) const;
     
                                     /**
-                                     * Number of active fe-indices,
-                                     * calls the respective
-                                     * function in DoFObjects
+                                     * Return the number of active
+                                     * fe-indices on the given
+                                     * object. Since we have a non-hp
+                                     * handler here, this function
+                                     * always returns 1.
                                      */
     template <int structdim>
     unsigned int n_active_fe_indices (const unsigned int obj_level,
                                      const unsigned int obj_index) const;
+
+                                    /**
+                                     * Return the fe index of the
+                                     * n-th active finite element on
+                                     * this object. Since this is a
+                                     * non-hp object, there is
+                                     * exactly one active fe index;
+                                     * the function therefore asserts
+                                     * that @p n equals zero, and the
+                                     * returns default_fe_index.
+                                     */
+    template <int structdim>
+    unsigned int nth_active_fe_index (const unsigned int obj_level,
+                                     const unsigned int obj_index,
+                                     const unsigned int n) const;
     
                                     /**
                                      * Return, wether fe-index is an
@@ -1381,6 +1398,46 @@ set_vertex_dof_index (const unsigned int vertex_index,
 }  
 
 
+
+template <int dim>
+template <int structdim>
+inline
+bool
+DoFHandler<dim>::fe_index_is_active (const unsigned int,
+                                    const unsigned int,
+                                    const unsigned int fe_index) const
+{
+  return (fe_index == 0);
+}
+
+
+
+template <int dim>
+template <int structdim>
+inline
+unsigned int
+DoFHandler<dim>::n_active_fe_indices (const unsigned int,
+                                     const unsigned int) const
+{
+  return 1;
+}
+
+
+
+template <int dim>
+template <int structdim>
+inline
+unsigned int
+DoFHandler<dim>::nth_active_fe_index (const unsigned int,
+                                     const unsigned int,
+                                     const unsigned int n) const
+{
+  Assert (n == 0, ExcIndexRange (n, 0, 1));
+  
+  return default_fe_index;
+}
+
+
 #endif // DOXYGEN
 
 /*----------------------------   dof_handler.h     ---------------------------*/
index a6ed831b6ad35fbc3f993b3c5490580d184916c0..05c93a1e3b23a4ea34cb44b03c07c4498fdd29f4 100644 (file)
@@ -1405,30 +1405,6 @@ DoFHandler<1>::set_dof_index<1> (const unsigned int       obj_level,
                   global_index);
   
 }
-
-
-template <>
-template <>
-bool
-DoFHandler<1>::fe_index_is_active<1> (const unsigned int obj_level,
-                                     const unsigned int obj_index,
-                                     const unsigned int fe_index) const
-{
-  return this->levels[obj_level]->lines.fe_index_is_active(*this,
-                                                          obj_index,
-                                                          fe_index);
-}
-
-
-template <>
-template <>
-unsigned int
-DoFHandler<1>::n_active_fe_indices<1> (const unsigned int obj_level,
-                                      const unsigned int obj_index) const
-{
-  return this->levels[obj_level]->lines.n_active_fe_indices (*this,
-                                                            obj_index);
-}
 #endif
 
 #if deal_II_dimension == 2
@@ -1467,29 +1443,6 @@ DoFHandler<2>::set_dof_index<1> (const unsigned int       ,
 }
 
 
-template <>
-template <>
-bool
-DoFHandler<2>::fe_index_is_active<1> (const unsigned int ,
-                                     const unsigned int obj_index,
-                                     const unsigned int fe_index) const
-{
-  return this->faces->lines.fe_index_is_active(*this,
-                                              obj_index,
-                                              fe_index);
-}
-
-
-template <>
-template <>
-unsigned int
-DoFHandler<2>::n_active_fe_indices<1> (const unsigned int ,
-                                      const unsigned int obj_index) const
-{
-  return this->faces->lines.n_active_fe_indices (*this,
-                                                obj_index);
-}
-
 
 template <>
 template <>
@@ -1524,30 +1477,6 @@ DoFHandler<2>::set_dof_index<2> (const unsigned int       obj_level,
                   global_index);
   
 }
-
-
-template <>
-template <>
-bool
-DoFHandler<2>::fe_index_is_active<2> (const unsigned int obj_level,
-                                     const unsigned int obj_index,
-                                     const unsigned int fe_index) const
-{
-  return this->levels[obj_level]->quads.fe_index_is_active(*this,
-                                                          obj_index,
-                                                          fe_index);
-}
-
-
-template <>
-template <>
-unsigned int
-DoFHandler<2>::n_active_fe_indices<2> (const unsigned int obj_level,
-                                      const unsigned int obj_index) const
-{
-  return this->levels[obj_level]->quads.n_active_fe_indices (*this,
-                                                            obj_index);
-}
 #endif
 
 #if deal_II_dimension == 3
@@ -1586,28 +1515,6 @@ DoFHandler<3>::set_dof_index<1> (const unsigned int       ,
 }
 
 
-template <>
-template <>
-bool
-DoFHandler<3>::fe_index_is_active<1> (const unsigned int ,
-                                     const unsigned int obj_index,
-                                     const unsigned int fe_index) const
-{
-  return this->faces->lines.fe_index_is_active(*this,
-                                              obj_index,
-                                              fe_index);
-}
-
-
-template <>
-template <>
-unsigned int
-DoFHandler<3>::n_active_fe_indices<1> (const unsigned int ,
-                                      const unsigned int obj_index) const
-{
-  return this->faces->lines.n_active_fe_indices (*this,
-                                                obj_index);
-}
 
 template <>
 template <>
@@ -1625,6 +1532,7 @@ DoFHandler<3>::get_dof_index<2> (const unsigned int       ,
 }
 
 
+
 template <>
 template <>
 unsigned int
@@ -1641,6 +1549,7 @@ DoFHandler<3>::get_dof_index<3> (const unsigned int       obj_level,
 }
 
 
+
 template <>
 template <>
 void
@@ -1660,6 +1569,7 @@ DoFHandler<3>::set_dof_index<2> (const unsigned int       ,
 }
 
 
+
 template <>
 template <>
 void
@@ -1677,52 +1587,6 @@ DoFHandler<3>::set_dof_index<3> (const unsigned int       obj_level,
                   global_index);
   
 }
-
-
-template <>
-template <>
-bool
-DoFHandler<3>::fe_index_is_active<2> (const unsigned int ,
-                                     const unsigned int obj_index,
-                                     const unsigned int fe_index) const
-{
-  return this->faces->quads.fe_index_is_active(*this,
-                                              obj_index,
-                                              fe_index);
-}
-
-template <>
-template <>
-bool
-DoFHandler<3>::fe_index_is_active<3> (const unsigned int obj_level,
-                                     const unsigned int obj_index,
-                                     const unsigned int fe_index) const
-{
-  return this->levels[obj_level]->hexes.fe_index_is_active(*this,
-                                                          obj_index,
-                                                          fe_index);
-}
-
-
-template <>
-template <>
-unsigned int
-DoFHandler<3>::n_active_fe_indices<2> (const unsigned int ,
-                                      const unsigned int obj_index) const
-{
-  return this->faces->quads.n_active_fe_indices (*this,
-                                                obj_index);
-}
-
-template <>
-template <>
-unsigned int
-DoFHandler<3>::n_active_fe_indices<3> (const unsigned int obj_level,
-                                      const unsigned int obj_index) const
-{
-  return this->levels[obj_level]->hexes.n_active_fe_indices (*this,
-                                                            obj_index);
-}
 #endif
 
 

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.