]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make a lot of things simpler now that we no longer use DoFObjects in hp::DoFLevels...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 30 Aug 2013 02:35:13 +0000 (02:35 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 30 Aug 2013 02:35:13 +0000 (02:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@30531 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/dof_accessor.templates.h
deal.II/include/deal.II/hp/dof_levels.h

index 486db2a4f55fcc4e27a15950029036ad56821cff..402b71dbf2697e11a8c82817fabed3c04443c75d 100644 (file)
@@ -820,20 +820,20 @@ namespace internal
                           const dealii::internal::int2type<1> &)
       {
         return dof_handler.levels[obj_level]->fe_index_is_active(obj_index,
-               fe_index,
-               obj_level);
+               fe_index);
       }
 
 
       template <int spacedim>
       static
       unsigned int
-      n_active_fe_indices (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
+      n_active_fe_indices (const dealii::hp::DoFHandler<1,spacedim> &,
                            const unsigned int obj_level,
                            const unsigned int obj_index,
                            const dealii::internal::int2type<1> &)
       {
-        return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index);
+       // on a cell, the number of active elements is one
+        return 1;
       }
 
 
@@ -847,9 +847,8 @@ namespace internal
                            const unsigned int n,
                            const dealii::internal::int2type<1> &)
       {
-        return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level,
-               obj_index,
-               n);
+       Assert (n==0, ExcMessage("On cells, there can only be one active FE index"));
+        return dof_handler.levels[obj_level]->active_fe_index (obj_index);
       }
 
 
@@ -909,20 +908,20 @@ namespace internal
                           const dealii::internal::int2type<2> &)
       {
         return dof_handler.levels[obj_level]->fe_index_is_active(obj_index,
-               fe_index,
-               obj_level);
+               fe_index);
       }
 
 
       template <int spacedim>
       static
       unsigned int
-      n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+      n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &,
                            const unsigned int obj_level,
                            const unsigned int obj_index,
                            const dealii::internal::int2type<2> &)
       {
-        return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index);
+       // on a cell, the number of active elements is one
+        return 1;
       }
 
 
@@ -936,9 +935,8 @@ namespace internal
                            const unsigned int n,
                            const dealii::internal::int2type<2> &)
       {
-        return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level,
-               obj_index,
-               n);
+       Assert (n==0, ExcMessage("On cells, there can only be one active FE index"));
+        return dof_handler.levels[obj_level]->active_fe_index (obj_index);
       }
 
 
@@ -1015,8 +1013,7 @@ namespace internal
                           const dealii::internal::int2type<3> &)
       {
         return dof_handler.levels[obj_level]->fe_index_is_active(obj_index,
-               fe_index,
-               obj_level);
+               fe_index);
       }
 
 
@@ -1054,12 +1051,13 @@ namespace internal
       template <int spacedim>
       static
       unsigned int
-      n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+      n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &,
                            const unsigned int obj_level,
                            const unsigned int obj_index,
                            const dealii::internal::int2type<3> &)
       {
-        return dof_handler.levels[obj_level]->n_active_fe_indices (obj_index);
+       // on a cell, the number of active elements is one
+        return 1;
       }
 
 
@@ -1073,9 +1071,8 @@ namespace internal
                            const unsigned int n,
                            const dealii::internal::int2type<3> &)
       {
-        return dof_handler.levels[obj_level]->nth_active_fe_index (obj_level,
-               obj_index,
-               n);
+       Assert (n==0, ExcMessage("On cells, there can only be one active FE index"));
+        return dof_handler.levels[obj_level]->active_fe_index (obj_index);
       }
 
       /**
index 5d3fe4df65e92530cae95e43bf24dc4e0b8f4f29..7bd350cdf6c49f69d662ad69798e710ecf08d488 100644 (file)
@@ -199,41 +199,13 @@ namespace internal
                      const unsigned int               local_index,
                      const unsigned int               obj_level) const;
 
-      /**
-       * Return the number of
-       * finite elements that are
-       * active on a given
-       * object. If this is a cell,
-       * the answer is of course
-       * one. If it is a face, the
-       * answer may be one or two,
-       * depending on whether the
-       * two adjacent cells use the
-       * same finite element or
-       * not. If it is an edge in
-       * 3d, the possible return
-       * value may be one or any
-       * other value larger than
-       * that.
-       *
-       * If the object is not part
-       * of an active cell, then no
-       * degrees of freedom have
-       * been distributed and zero
-       * is returned.
-       */
-      unsigned int
-      n_active_fe_indices (const unsigned int               obj_index) const;
-
       /**
        * Return the fe_index of the
        * n-th active finite element
        * on this object.
        */
-      types::global_dof_index
-      nth_active_fe_index (const unsigned int               obj_level,
-                           const unsigned int               obj_index,
-                           const unsigned int               n) const;
+      unsigned int
+      active_fe_index (const unsigned int obj_index) const;
 
       /**
        * Check whether a given
@@ -243,8 +215,7 @@ namespace internal
        */
       bool
       fe_index_is_active (const unsigned int               obj_index,
-                          const unsigned int               fe_index,
-                          const unsigned int               obj_level) const;
+                          const unsigned int               fe_index) const;
 
       /**
        * Determine an estimate for the
@@ -316,31 +287,7 @@ namespace internal
     inline
     unsigned int
     DoFLevel<dim>::
-    n_active_fe_indices (const unsigned int obj_index) const
-    {
-      Assert (obj_index < dof_offsets.size(),
-              ExcIndexRange (obj_index, 0, dof_offsets.size()));
-
-      // make sure we are on an
-      // object for which DoFs have
-      // been allocated at all
-      if (dof_offsets[obj_index] == numbers::invalid_dof_index)
-        return 0;
-
-      // we are on a cell, so the only set of indices we store is the
-      // one for the cell, which is unique
-      return 1;
-    }
-
-
-
-    template <int dim>
-    inline
-    types::global_dof_index
-    DoFLevel<dim>::
-    nth_active_fe_index (const unsigned int                obj_level,
-                         const unsigned int                obj_index,
-                         const unsigned int                n) const
+    active_fe_index (const unsigned int obj_index) const
     {
       Assert (obj_index < dof_offsets.size(),
               ExcIndexRange (obj_index, 0, dof_offsets.size()));
@@ -353,9 +300,6 @@ namespace internal
                           "information for an object on which no such "
                           "information is available"));
 
-      // this is a cell, so there is only a single fe_index
-      Assert (n == 0, ExcIndexRange (n, 0, 1));
-
       return active_fe_indices[obj_index];
     }
 
@@ -366,8 +310,7 @@ namespace internal
     bool
     DoFLevel<dim>::
     fe_index_is_active (const unsigned int                obj_index,
-                        const unsigned int                fe_index,
-                        const unsigned int                obj_level) const
+                        const unsigned int                fe_index) const
     {
       Assert ((fe_index != dealii::hp::DoFHandler<1,1>::default_fe_index),
               ExcMessage ("You need to specify a FE index when working "

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.