]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust interface in 'dofs' folder to new datatype 'types::fe_index'.
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 26 Aug 2022 21:11:08 +0000 (15:11 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Thu, 6 Oct 2022 17:54:14 +0000 (11:54 -0600)
27 files changed:
include/deal.II/dofs/dof_accessor.h
include/deal.II/dofs/dof_accessor.templates.h
include/deal.II/dofs/dof_handler.h
include/deal.II/dofs/dof_objects.h
include/deal.II/dofs/dof_tools.h
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h
source/dofs/dof_accessor.cc
source/dofs/dof_accessor_get.cc
source/dofs/dof_accessor_get.inst.in
source/dofs/dof_accessor_set.cc
source/dofs/dof_accessor_set.inst.in
source/dofs/dof_handler.cc
source/dofs/dof_handler_policy.cc
source/dofs/dof_renumbering.cc
source/dofs/dof_tools.cc
source/dofs/dof_tools_constraints.cc
source/dofs/dof_tools_sparsity.cc
source/hp/fe_collection.cc
tests/hp/crash_17.cc
tests/hp/crash_18.cc
tests/hp/fe_collection_05.cc
tests/hp/fe_collection_05.output
tests/hp/fe_collection_06.cc
tests/hp/fe_collection_06.output
tests/hp/get_active_fe_indices.cc
tests/matrix_free/fe_nothing_01.cc
tests/multigrid-global-coarsening/mg_transfer_p_02.cc

index 9d4fb5307a13b75e728097895c586694e60b7bfe..3df68c0adb744ee6d7a65083a60a14535743c8ef 100644 (file)
@@ -446,7 +446,7 @@ public:
   void
   get_dof_indices(
     std::vector<types::global_dof_index> &dof_indices,
-    const unsigned int fe_index = numbers::invalid_fe_index) const;
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Return the global multilevel indices of the degrees of freedom that live
@@ -458,15 +458,16 @@ public:
   get_mg_dof_indices(
     const int                             level,
     std::vector<types::global_dof_index> &dof_indices,
-    const unsigned int fe_index = numbers::invalid_fe_index) const;
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Set the level DoF indices that are returned by get_mg_dof_indices.
    */
   void
-  set_mg_dof_indices(const int                                   level,
-                     const std::vector<types::global_dof_index> &dof_indices,
-                     const unsigned int fe_index = numbers::invalid_fe_index);
+  set_mg_dof_indices(
+    const int                                   level,
+    const std::vector<types::global_dof_index> &dof_indices,
+    const types::fe_index fe_index = numbers::invalid_fe_index);
 
   /**
    * Global DoF index of the <i>i</i> degree associated with the @p vertexth
@@ -491,9 +492,9 @@ public:
    */
   types::global_dof_index
   vertex_dof_index(
-    const unsigned int vertex,
-    const unsigned int i,
-    const unsigned int fe_index = numbers::invalid_fe_index) const;
+    const unsigned int    vertex,
+    const unsigned int    i,
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Return the global DoF index of the <code>i</code>th degree of freedom
@@ -502,10 +503,10 @@ public:
    */
   types::global_dof_index
   mg_vertex_dof_index(
-    const int          level,
-    const unsigned int vertex,
-    const unsigned int i,
-    const unsigned int fe_index = numbers::invalid_fe_index) const;
+    const int             level,
+    const unsigned int    vertex,
+    const unsigned int    i,
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Index of the <i>i</i>th degree of freedom of this object.
@@ -535,8 +536,8 @@ public:
    * the face.
    */
   types::global_dof_index
-  dof_index(const unsigned int i,
-            const unsigned int fe_index = numbers::invalid_fe_index) const;
+  dof_index(const unsigned int    i,
+            const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Return the dof_index on the given level. Also see dof_index.
@@ -575,7 +576,7 @@ public:
    * n_active_fe_indices() active finite elements, and this function can be
    * queried for their indices.
    */
-  unsigned int
+  types::fe_index
   nth_active_fe_index(const unsigned int n) const;
 
   /**
@@ -584,7 +585,7 @@ public:
    * The size of the returned set equals the number of finite elements that
    * are active on this object.
    */
-  std::set<unsigned int>
+  std::set<types::fe_index>
   get_active_fe_indices() const;
 
   /**
@@ -597,7 +598,7 @@ public:
    * n_active_fe_indices()).
    */
   bool
-  fe_index_is_active(const unsigned int fe_index) const;
+  fe_index_is_active(const types::fe_index fe_index) const;
 
   /**
    * Return a reference to the finite element used on this object with the
@@ -605,7 +606,7 @@ public:
    * <code>fe_index_is_active(fe_index)</code> must return true.
    */
   const FiniteElement<dim, spacedim> &
-  get_fe(const unsigned int fe_index) const;
+  get_fe(const types::fe_index fe_index) const;
 
   /**
    * @}
@@ -711,9 +712,10 @@ protected:
    * active_fe_index().
    */
   void
-  set_dof_index(const unsigned int            i,
-                const types::global_dof_index index,
-                const unsigned int fe_index = numbers::invalid_fe_index) const;
+  set_dof_index(
+    const unsigned int            i,
+    const types::global_dof_index index,
+    const types::fe_index         fe_index = numbers::invalid_fe_index) const;
 
   void
   set_mg_dof_index(const int                     level,
@@ -726,7 +728,7 @@ protected:
     const unsigned int            vertex,
     const unsigned int            i,
     const types::global_dof_index index,
-    const unsigned int            fe_index = numbers::invalid_fe_index) const;
+    const types::fe_index         fe_index = numbers::invalid_fe_index) const;
 
   // Iterator classes need to be friends because they need to access
   // operator== and operator!=.
@@ -994,7 +996,7 @@ public:
   void
   get_dof_indices(
     std::vector<types::global_dof_index> &dof_indices,
-    const unsigned int fe_index = AccessorData::invalid_fe_index) const;
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Return the global multilevel indices of the degrees of freedom that live
@@ -1006,7 +1008,7 @@ public:
   get_mg_dof_indices(
     const int                             level,
     std::vector<types::global_dof_index> &dof_indices,
-    const unsigned int fe_index = AccessorData::invalid_fe_index) const;
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Global DoF index of the <i>i</i> degree associated with the @p vertexth
@@ -1028,9 +1030,9 @@ public:
    */
   types::global_dof_index
   vertex_dof_index(
-    const unsigned int vertex,
-    const unsigned int i,
-    const unsigned int fe_index = AccessorData::invalid_fe_index) const;
+    const unsigned int    vertex,
+    const unsigned int    i,
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Index of the <i>i</i>th degree of freedom of this object.
@@ -1050,8 +1052,8 @@ public:
    * active_fe_index().
    */
   types::global_dof_index
-  dof_index(const unsigned int i,
-            const unsigned int fe_index = AccessorData::invalid_fe_index) const;
+  dof_index(const unsigned int    i,
+            const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * @}
@@ -1081,7 +1083,7 @@ public:
    * calculated, this method just raises an exception and only exists to
    * enable dimension-independent programming.
    */
-  unsigned int
+  types::fe_index
   nth_active_fe_index(const unsigned int n) const;
 
   /**
@@ -1093,7 +1095,7 @@ public:
    * enable dimension-independent programming.
    */
   bool
-  fe_index_is_active(const unsigned int fe_index) const;
+  fe_index_is_active(const types::fe_index fe_index) const;
 
   /**
    * Return a reference to the finite element used on this object with the
@@ -1101,7 +1103,7 @@ public:
    * <code>fe_index_is_active(fe_index)</code> must return true.
    */
   const FiniteElement<1, spacedim> &
-  get_fe(const unsigned int fe_index) const;
+  get_fe(const types::fe_index fe_index) const;
 
   /**
    * @}
@@ -1198,7 +1200,7 @@ protected:
   set_dof_index(
     const unsigned int            i,
     const types::global_dof_index index,
-    const unsigned int fe_index = AccessorData::invalid_fe_index) const;
+    const types::fe_index         fe_index = numbers::invalid_fe_index) const;
 
   // Iterator classes need to be friends because they need to access
   // operator== and operator!=.
@@ -1287,8 +1289,8 @@ public:
    * all other functions in this class this function only throws an exception.
    */
   types::global_dof_index
-  dof_index(const unsigned int i,
-            const unsigned int fe_index =
+  dof_index(const unsigned int    i,
+            const types::fe_index fe_index =
               DoFHandler<dim, spacedim>::default_fe_index) const;
 
   /**
@@ -1297,9 +1299,10 @@ public:
    * all other functions in this class this function only throws an exception.
    */
   void
-  set_dof_index(const unsigned int            i,
-                const types::global_dof_index index,
-                const unsigned int fe_index = numbers::invalid_fe_index) const;
+  set_dof_index(
+    const unsigned int            i,
+    const types::global_dof_index index,
+    const types::fe_index         fe_index = numbers::invalid_fe_index) const;
 };
 
 
@@ -1687,9 +1690,9 @@ public:
   template <class InputVector, typename number>
   void
   get_interpolated_dof_values(
-    const InputVector &values,
-    Vector<number> &   interpolated_values,
-    const unsigned int fe_index = numbers::invalid_fe_index) const;
+    const InputVector &   values,
+    Vector<number> &      interpolated_values,
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * This function is the counterpart to get_interpolated_dof_values(): you
@@ -1757,7 +1760,7 @@ public:
   set_dof_values_by_interpolation(
     const Vector<number> &local_values,
     OutputVector &        values,
-    const unsigned int    fe_index      = numbers::invalid_fe_index,
+    const types::fe_index fe_index      = numbers::invalid_fe_index,
     const bool            perform_check = false) const;
 
   /**
@@ -1774,7 +1777,7 @@ public:
   distribute_local_to_global_by_interpolation(
     const Vector<number> &local_values,
     OutputVector &        values,
-    const unsigned int    fe_index = numbers::invalid_fe_index) const;
+    const types::fe_index fe_index = numbers::invalid_fe_index) const;
 
   /**
    * Distribute a local (cell based) vector to a global one by mapping the
@@ -1979,7 +1982,7 @@ public:
    * this cell as a ghost cell. See the documentation of DoFHandler for more
    * information.
    */
-  unsigned int
+  types::fe_index
   active_fe_index() const;
 
   /**
@@ -2009,7 +2012,7 @@ public:
    * information.
    */
   void
-  set_active_fe_index(const unsigned int i) const;
+  set_active_fe_index(const types::fe_index i) const;
   /**
    * @}
    */
@@ -2073,7 +2076,7 @@ public:
    * parallel::shared::Triangulation or parallel::distributed::Triangulation
    * classes, it is only allowed to call this function on locally owned cells.
    */
-  unsigned int
+  types::fe_index
   future_fe_index() const;
 
   /**
@@ -2085,7 +2088,7 @@ public:
    * functionality.
    */
   void
-  set_future_fe_index(const unsigned int i) const;
+  set_future_fe_index(const types::fe_index i) const;
 
   /**
    * Return whether a future finite element has been set.
index c062e3db65eeb967e77a4d99bb2971bc8f7b5a3e..f33d039e1814b9f5803ffc671ab2a35762f48421 100644 (file)
@@ -204,10 +204,10 @@ namespace internal
      * numbers::invalid_fe_index to a right value if needed/possible.
      */
     template <int structdim, int dim, int spacedim, bool level_dof_access>
-    unsigned int
+    types::fe_index
     get_fe_index_or_default(
       const DoFAccessor<structdim, dim, spacedim, level_dof_access> &cell,
-      const unsigned int                                             fe_index)
+      const types::fe_index                                          fe_index)
     {
       if (cell.get_dof_handler().has_hp_capabilities() == false)
         {
@@ -279,7 +279,7 @@ namespace internal
       process_dof_index(const DoFHandler<dim, spacedim> &dof_handler,
                         const unsigned int               obj_level,
                         const unsigned int               obj_index,
-                        const unsigned int               fe_index,
+                        const types::fe_index            fe_index,
                         const unsigned int               local_index,
                         const std::integral_constant<int, structdim> &,
                         GlobalIndexType &    global_index,
@@ -339,7 +339,7 @@ namespace internal
                  "You are requesting an active FE index that is not assigned "
                  "to any of the cells connected to this entity."));
 
-        const unsigned int fe_index_ =
+        const types::fe_index fe_index_ =
           std::distance(dof_handler.hp_object_fe_indices[structdim].begin() +
                           dof_handler.hp_object_fe_ptr[structdim][obj_index],
                         ptr);
@@ -386,7 +386,7 @@ namespace internal
       process_object_range(const DoFHandler<dim, spacedim> &dof_handler,
                            const unsigned int               obj_level,
                            const unsigned int               obj_index,
-                           const unsigned int               fe_index,
+                           const types::fe_index            fe_index,
                            const std::integral_constant<int, structdim> &)
       {
         Assert(structdim == dim || obj_level == 0, ExcNotImplemented());
@@ -439,7 +439,7 @@ namespace internal
                    dof_handler.hp_object_fe_ptr[structdim][obj_index + 1],
                ExcNotImplemented());
 
-        const unsigned int fe_index_local =
+        const types::fe_index fe_index_local =
           std::distance(dof_handler.hp_object_fe_indices[structdim].begin() +
                           dof_handler.hp_object_fe_ptr[structdim][obj_index],
                         fe_index_local_ptr);
@@ -466,8 +466,8 @@ namespace internal
       static std::pair<unsigned int, unsigned int>
       process_object_range(
         const dealii::DoFAccessor<structdim, dim, spacedim, level_dof_access>
-                           accessor,
-        const unsigned int fe_index)
+                              accessor,
+        const types::fe_index fe_index)
       {
         return process_object_range(accessor.get_dof_handler(),
                                     accessor.level(),
@@ -505,7 +505,7 @@ namespace internal
       process_object(const DoFHandler<dim, spacedim> &             dof_handler,
                      const unsigned int                            obj_level,
                      const unsigned int                            obj_index,
-                     const unsigned int                            fe_index,
+                     const types::fe_index                         fe_index,
                      const DoFMapping &                            mapping,
                      const std::integral_constant<int, structdim> &dd,
                      types::global_dof_index *&dof_indices_ptr,
@@ -545,7 +545,7 @@ namespace internal
       set_dof_index(const DoFHandler<dim, spacedim> &             dof_handler,
                     const unsigned int                            obj_level,
                     const unsigned int                            obj_index,
-                    const unsigned int                            fe_index,
+                    const types::fe_index                         fe_index,
                     const unsigned int                            local_index,
                     const std::integral_constant<int, structdim> &dd,
                     const types::global_dof_index                 global_index)
@@ -576,7 +576,7 @@ namespace internal
       get_dof_index(const DoFHandler<dim, spacedim> &             dof_handler,
                     const unsigned int                            obj_level,
                     const unsigned int                            obj_index,
-                    const unsigned int                            fe_index,
+                    const types::fe_index                         fe_index,
                     const unsigned int                            local_index,
                     const std::integral_constant<int, structdim> &dd)
       {
@@ -659,7 +659,7 @@ namespace internal
        * get a DoF index on a vertex of the indicated cell.
        */
       template <int dim, int spacedim, int structdim>
-      static unsigned int
+      static types::fe_index
       nth_active_fe_index(const DoFHandler<dim, spacedim> &dof_handler,
                           const unsigned int               obj_level,
                           const unsigned int               obj_index,
@@ -711,7 +711,7 @@ namespace internal
        * get a DoF index on a vertex of the indicated cell.
        */
       template <int dim, int spacedim, int structdim>
-      static std::set<unsigned int>
+      static std::set<types::fe_index>
       get_active_fe_indices(const DoFHandler<dim, spacedim> &dof_handler,
                             const unsigned int               obj_level,
                             const unsigned int               obj_index,
@@ -728,7 +728,7 @@ namespace internal
           return {dof_handler.hp_cell_active_fe_indices[obj_level][obj_index]};
 
         // 3) general entity and hp is used
-        std::set<unsigned int> active_fe_indices;
+        std::set<types::fe_index> active_fe_indices;
         for (unsigned int i = 0;
              i < n_active_fe_indices(dof_handler, obj_level, obj_index, t);
              ++i)
@@ -744,7 +744,7 @@ namespace internal
       fe_index_is_active(const DoFHandler<dim, spacedim> &dof_handler,
                          const unsigned int               obj_level,
                          const unsigned int               obj_index,
-                         const unsigned int               fe_index,
+                         const types::fe_index            fe_index,
                          const std::integral_constant<int, structdim> &)
       {
         Assert(structdim == dim || obj_level == 0, ExcNotImplemented());
@@ -868,9 +868,9 @@ namespace internal
       static unsigned int
       n_dof_indices(
         const dealii::DoFAccessor<structdim, dim, spacedim, level_dof_access>
-          &                accessor,
-        const unsigned int fe_index_,
-        const bool         count_level_dofs)
+          &                   accessor,
+        const types::fe_index fe_index_,
+        const bool            count_level_dofs)
       {
         // note: we cannot rely on the template parameter level_dof_access here,
         // since the function get_mg_dof_indices()/set_mg_dof_indices() can be
@@ -994,12 +994,12 @@ namespace internal
         const dealii::DoFAccessor<structdim, dim, spacedim, level_dof_access>
           &                   accessor,
         const DoFIndicesType &const_dof_indices,
-        const unsigned int    fe_index_,
+        const types::fe_index fe_index_,
         const DoFOperation &  dof_operation,
         const DoFProcessor &  dof_processor,
         const bool            count_level_dofs)
       {
-        const unsigned int fe_index =
+        const types::fe_index fe_index =
           internal::DoFAccessorImplementation::get_fe_index_or_default(
             accessor, fe_index_);
 
@@ -1164,7 +1164,7 @@ namespace internal
         DEAL_II_ALWAYS_INLINE void
         process_vertex_dofs(DoFHandler<dim, spacedim> &dof_handler,
                             const unsigned int         vertex_index,
-                            const unsigned int         fe_index,
+                            const types::fe_index      fe_index,
                             types::global_dof_index *& dof_indices_ptr,
                             const DoFProcessor &       dof_processor) const
         {
@@ -1190,7 +1190,7 @@ namespace internal
         process_dofs(const DoFHandler<dim, spacedim> &dof_handler,
                      const unsigned int               obj_level,
                      const unsigned int               obj_index,
-                     const unsigned int               fe_index,
+                     const types::fe_index            fe_index,
                      const DoFMapping &               mapping,
                      const std::integral_constant<int, structdim>,
                      types::global_dof_index *&dof_indices_ptr,
@@ -1231,7 +1231,7 @@ namespace internal
         DEAL_II_ALWAYS_INLINE void
         process_vertex_dofs(DoFHandler<dim, spacedim> &dof_handler,
                             const unsigned int         vertex_index,
-                            const unsigned int,
+                            const types::fe_index,
                             types::global_dof_index *&dof_indices_ptr,
                             const DoFProcessor &      dof_processor) const
         {
@@ -1252,9 +1252,9 @@ namespace internal
         DEAL_II_ALWAYS_INLINE void
         process_dofs(const DoFHandler<dim, spacedim> &dof_handler,
                      const unsigned int,
-                     const unsigned int obj_index,
-                     const unsigned int fe_index,
-                     const DoFMapping & mapping,
+                     const unsigned int    obj_index,
+                     const types::fe_index fe_index,
+                     const DoFMapping &    mapping,
                      const std::integral_constant<int, structdim>,
                      types::global_dof_index *&dof_indices_ptr,
                      const DoFProcessor &      dof_processor) const
@@ -1286,7 +1286,7 @@ namespace internal
         const dealii::DoFAccessor<structdim, dim, spacedim, level_dof_access>
           &                                   accessor,
         std::vector<types::global_dof_index> &dof_indices,
-        const unsigned int                    fe_index)
+        const types::fe_index                 fe_index)
       {
         process_dof_indices(
           accessor,
@@ -1305,7 +1305,7 @@ namespace internal
         const dealii::DoFAccessor<structdim, dim, spacedim, level_dof_access>
           &                                         accessor,
         const std::vector<types::global_dof_index> &dof_indices,
-        const unsigned int                          fe_index)
+        const types::fe_index                       fe_index)
       {
         // Note: this function is as general as `get_dof_indices()`. This
         // assert is placed here since it is currently only used by the
@@ -1336,7 +1336,7 @@ namespace internal
           &                                   accessor,
         const int                             level,
         std::vector<types::global_dof_index> &dof_indices,
-        const unsigned int                    fe_index)
+        const types::fe_index                 fe_index)
       {
         Assert((fe_index == DoFHandler<dim, spacedim>::default_fe_index),
                ExcMessage("MG DoF indices cannot be queried in hp case"));
@@ -1358,7 +1358,7 @@ namespace internal
           &                                         accessor,
         const int                                   level,
         const std::vector<types::global_dof_index> &dof_indices,
-        const unsigned int                          fe_index)
+        const types::fe_index                       fe_index)
       {
         Assert((fe_index == DoFHandler<dim, spacedim>::default_fe_index),
                ExcMessage("MG DoF indices cannot be queried in hp case"));
@@ -1391,9 +1391,9 @@ namespace internal
           &mg_level,
         const std::unique_ptr<internal::DoFHandlerImplementation::DoFFaces<dim>>
           &,
-        const unsigned int obj_index,
-        const unsigned int fe_index,
-        const unsigned int local_index,
+        const unsigned int    obj_index,
+        const types::fe_index fe_index,
+        const unsigned int    local_index,
         const std::integral_constant<int, dim>)
       {
         Assert(dof_handler.hp_capability_enabled == false,
@@ -1415,10 +1415,10 @@ namespace internal
         const std::unique_ptr<internal::DoFHandlerImplementation::DoFLevel<dim>>
           &,
         const std::unique_ptr<internal::DoFHandlerImplementation::DoFFaces<dim>>
-          &                mg_faces,
-        const unsigned int obj_index,
-        const unsigned int fe_index,
-        const unsigned int local_index,
+          &                   mg_faces,
+        const unsigned int    obj_index,
+        const types::fe_index fe_index,
+        const unsigned int    local_index,
         const std::integral_constant<int, 1>)
       {
         return mg_faces->lines.access_dof_index(
@@ -1437,10 +1437,10 @@ namespace internal
         const std::unique_ptr<internal::DoFHandlerImplementation::DoFLevel<3>>
           &,
         const std::unique_ptr<internal::DoFHandlerImplementation::DoFFaces<3>>
-          &                mg_faces,
-        const unsigned int obj_index,
-        const unsigned int fe_index,
-        const unsigned int local_index,
+          &                   mg_faces,
+        const unsigned int    obj_index,
+        const types::fe_index fe_index,
+        const unsigned int    local_index,
         const std::integral_constant<int, 2>)
       {
         Assert(dof_handler.hp_capability_enabled == false,
@@ -1469,8 +1469,8 @@ namespace internal
 template <int structdim, int dim, int spacedim, bool level_dof_access>
 inline types::global_dof_index
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::dof_index(
-  const unsigned int i,
-  const unsigned int fe_index_) const
+  const unsigned int    i,
+  const types::fe_index fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1509,7 +1509,7 @@ inline void
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::set_dof_index(
   const unsigned int            i,
   const types::global_dof_index index,
-  const unsigned int            fe_index_) const
+  const types::fe_index         fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1563,7 +1563,7 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::n_active_fe_indices()
 
 
 template <int structdim, int dim, int spacedim, bool level_dof_access>
-inline unsigned int
+inline types::fe_index
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::nth_active_fe_index(
   const unsigned int n) const
 {
@@ -1579,11 +1579,11 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::nth_active_fe_index(
 
 
 template <int structdim, int dim, int spacedim, bool level_dof_access>
-inline std::set<unsigned int>
+inline std::set<types::fe_index>
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::get_active_fe_indices()
   const
 {
-  std::set<unsigned int> active_fe_indices;
+  std::set<types::fe_index> active_fe_indices;
   for (unsigned int i = 0; i < n_active_fe_indices(); ++i)
     active_fe_indices.insert(nth_active_fe_index(i));
   return active_fe_indices;
@@ -1594,7 +1594,7 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::get_active_fe_indices()
 template <int structdim, int dim, int spacedim, bool level_dof_access>
 inline bool
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::fe_index_is_active(
-  const unsigned int fe_index) const
+  const types::fe_index fe_index) const
 {
   // access the respective DoF
   return dealii::internal::DoFAccessorImplementation::Implementation::
@@ -1610,11 +1610,11 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::fe_index_is_active(
 template <int structdim, int dim, int spacedim, bool level_dof_access>
 inline types::global_dof_index
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::vertex_dof_index(
-  const unsigned int vertex,
-  const unsigned int i,
-  const unsigned int fe_index_) const
+  const unsigned int    vertex,
+  const unsigned int    i,
+  const types::fe_index fe_index_) const
 {
-  const unsigned int fe_index =
+  const types::fe_index fe_index =
     (((this->dof_handler->hp_capability_enabled == false) &&
       (fe_index_ == numbers::invalid_fe_index)) ?
        // No hp enabled, and the argument is at its default value -> we
@@ -1642,10 +1642,10 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::vertex_dof_index(
 template <int structdim, int dim, int spacedim, bool level_dof_access>
 inline types::global_dof_index
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::mg_vertex_dof_index(
-  const int          level,
-  const unsigned int vertex,
-  const unsigned int i,
-  const unsigned int fe_index_) const
+  const int             level,
+  const unsigned int    vertex,
+  const unsigned int    i,
+  const types::fe_index fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1675,7 +1675,7 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::
                           const unsigned int            vertex,
                           const unsigned int            i,
                           const types::global_dof_index index,
-                          const unsigned int            fe_index_) const
+                          const types::fe_index         fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1698,7 +1698,7 @@ DoFAccessor<structdim, dim, spacedim, level_dof_access>::
 template <int structdim, int dim, int spacedim, bool level_dof_access>
 inline const FiniteElement<dim, spacedim> &
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::get_fe(
-  const unsigned int fe_index) const
+  const types::fe_index fe_index) const
 {
   Assert(fe_index_is_active(fe_index) == true,
          ExcMessage("This function can only be called for active FE indices"));
@@ -1871,7 +1871,7 @@ inline void
 DoFAccessor<0, 1, spacedim, level_dof_access>::set_dof_index(
   const unsigned int /*i*/,
   const types::global_dof_index /*index*/,
-  const unsigned int /*fe_index*/) const
+  const types::fe_index /*fe_index*/) const
 {
   Assert(false, ExcNotImplemented());
 }
@@ -1891,7 +1891,7 @@ template <int spacedim, bool level_dof_access>
 inline void
 DoFAccessor<0, 1, spacedim, level_dof_access>::get_dof_indices(
   std::vector<types::global_dof_index> &dof_indices,
-  const unsigned int                    fe_index_) const
+  const types::fe_index                 fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1914,7 +1914,7 @@ inline void
 DoFAccessor<0, 1, spacedim, level_dof_access>::get_mg_dof_indices(
   const int                             level,
   std::vector<types::global_dof_index> &dof_indices,
-  const unsigned int                    fe_index_) const
+  const types::fe_index                 fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1933,9 +1933,9 @@ DoFAccessor<0, 1, spacedim, level_dof_access>::get_mg_dof_indices(
 template <int spacedim, bool level_dof_access>
 inline types::global_dof_index
 DoFAccessor<0, 1, spacedim, level_dof_access>::vertex_dof_index(
-  const unsigned int vertex,
-  const unsigned int i,
-  const unsigned int fe_index_) const
+  const unsigned int    vertex,
+  const unsigned int    i,
+  const types::fe_index fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1957,8 +1957,8 @@ DoFAccessor<0, 1, spacedim, level_dof_access>::vertex_dof_index(
 template <int spacedim, bool level_dof_access>
 inline types::global_dof_index
 DoFAccessor<0, 1, spacedim, level_dof_access>::dof_index(
-  const unsigned int i,
-  const unsigned int fe_index_) const
+  const unsigned int    i,
+  const types::fe_index fe_index_) const
 {
   const auto fe_index =
     internal::DoFAccessorImplementation::get_fe_index_or_default(*this,
@@ -1989,7 +1989,7 @@ DoFAccessor<0, 1, spacedim, level_dof_access>::n_active_fe_indices() const
 
 
 template <int spacedim, bool level_dof_access>
-inline unsigned int
+inline types::fe_index
 DoFAccessor<0, 1, spacedim, level_dof_access>::nth_active_fe_index(
   const unsigned int /*n*/) const
 {
@@ -2005,7 +2005,7 @@ DoFAccessor<0, 1, spacedim, level_dof_access>::nth_active_fe_index(
 template <int spacedim, bool level_dof_access>
 inline bool
 DoFAccessor<0, 1, spacedim, level_dof_access>::fe_index_is_active(
-  const unsigned int /*fe_index*/) const
+  const types::fe_index /*fe_index*/) const
 {
   Assert(false, ExcNotImplemented());
   return false;
@@ -2016,7 +2016,7 @@ DoFAccessor<0, 1, spacedim, level_dof_access>::fe_index_is_active(
 template <int spacedim, bool level_dof_access>
 inline const FiniteElement<1, spacedim> &
 DoFAccessor<0, 1, spacedim, level_dof_access>::get_fe(
-  const unsigned int fe_index) const
+  const types::fe_index fe_index) const
 {
   Assert(this->dof_handler != nullptr, ExcInvalidObject());
   return dof_handler->get_fe(fe_index);
@@ -2134,7 +2134,7 @@ namespace internal
        * do.
        */
       template <int dim, int spacedim, bool level_dof_access>
-      static unsigned int
+      static types::fe_index
       active_fe_index(
         const DoFCellAccessor<dim, spacedim, level_dof_access> &accessor)
       {
@@ -2163,7 +2163,7 @@ namespace internal
       static void
       set_active_fe_index(
         const DoFCellAccessor<dim, spacedim, level_dof_access> &accessor,
-        const unsigned int                                      i)
+        const types::fe_index                                   i)
       {
         if (accessor.dof_handler->hp_capability_enabled == false)
           {
@@ -2193,7 +2193,7 @@ namespace internal
        * do.
        */
       template <int dim, int spacedim, bool level_dof_access>
-      static unsigned int
+      static types::fe_index
       future_fe_index(
         const DoFCellAccessor<dim, spacedim, level_dof_access> &accessor)
       {
@@ -2229,7 +2229,7 @@ namespace internal
       static void
       set_future_fe_index(
         const DoFCellAccessor<dim, spacedim, level_dof_access> &accessor,
-        const unsigned int                                      i)
+        const types::fe_index                                   i)
       {
         if (accessor.dof_handler->hp_capability_enabled == false)
           {
@@ -2662,7 +2662,7 @@ DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::get_fe() const
 
 
 template <int dimension_, int space_dimension_, bool level_dof_access>
-inline unsigned int
+inline types::fe_index
 DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::
   active_fe_index() const
 {
@@ -2688,7 +2688,7 @@ DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::
 template <int dimension_, int space_dimension_, bool level_dof_access>
 inline void
 DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::
-  set_active_fe_index(const unsigned int i) const
+  set_active_fe_index(const types::fe_index i) const
 {
   Assert((this->dof_handler->hp_capability_enabled == false) ||
            this->is_active(),
@@ -2729,7 +2729,7 @@ DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::get_future_fe()
 
 
 template <int dimension_, int space_dimension_, bool level_dof_access>
-inline unsigned int
+inline types::fe_index
 DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::
   future_fe_index() const
 {
@@ -2754,7 +2754,7 @@ DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::
 template <int dimension_, int space_dimension_, bool level_dof_access>
 inline void
 DoFCellAccessor<dimension_, space_dimension_, level_dof_access>::
-  set_future_fe_index(const unsigned int i) const
+  set_future_fe_index(const types::fe_index i) const
 {
   Assert((this->dof_handler->hp_capability_enabled == false) ||
            (this->has_children() == false),
index de792cb37990aeb7b963e55ebbf5710950c1b86e..657aa8eeaa67c6cfd6904e654477b3bd96cc4d10 100644 (file)
@@ -515,7 +515,7 @@ public:
   /**
    * The default index of the finite element to be used on a given cell.
    */
-  static const unsigned int default_fe_index = 0;
+  static const types::fe_index default_fe_index = 0;
 
   /**
    * Invalid index of the finite element to be used on a given cell.
@@ -580,45 +580,85 @@ public:
   operator=(const DoFHandler &) = delete;
 
   /**
-   * Go through the triangulation and set the active FE indices of all
-   * locally owned cells to the values given in @p active_fe_indices.
+   * For each locally owned cell, set the active finite element index to the
+   * corresponding value given in @p active_fe_indices. Indices must be in the
+   * order how we iterate over active cells.
+   *
+   * Active FE indices will only be set for locally owned cells. Ghost and
+   * artificial cells will be ignored; no active FE index will be assigned to
+   * them.
+   *
+   * The vector @p active_fe_indices is assumed to have as many entries as
+   * there are active cells.
+   */
+  void
+  set_active_fe_indices(const std::vector<types::fe_index> &active_fe_indices);
+
+  /**
+   * @copydoc set_active_fe_indices()
+   *
+   * @deprecated Use set_active_fe_indices() with the types::fe_index datatype.
    */
+  DEAL_II_DEPRECATED_EARLY
   void
   set_active_fe_indices(const std::vector<unsigned int> &active_fe_indices);
 
   /**
-   * Go through the triangulation and return a vector of active FE indices of
-   * all locally relevant cells. Artificial cells will have the value
-   * numbers::invalid_fe_index assigned.
+   * For each locally relevant cell, extract the active finite element index and
+   * return them in the order how we iterate over active cells.
+   *
+   * As we do not know the active FE index on artificial cells, they are set to
+   * the invalid value numbers::invalid_fe_index.
+   *
+   * For DoFHandler objects without hp-capabilities, the vector will consist of
+   * zeros, indicating that all cells use the same finite element. In hp-mode,
+   * the values may be different, though.
    */
-  std::vector<unsigned int>
+  std::vector<types::fe_index>
   get_active_fe_indices() const;
 
   /**
-   * Go through the triangulation and store the active FE indices of all
-   * locally relevant cells to the vector @p active_fe_indices. This vector
-   * is resized, if necessary.
+   * For each locally relevant cell, extract the active finite element index and
+   * fill the vector @p active_fe_indices in the order how we iterate over
+   * active cells. This vector is resized, if necessary.
+   *
+   * As we do not know the active FE index on artificial cells, they are set to
+   * the invalid value numbers::invalid_fe_index.
+   *
+   * For DoFHandler objects without hp-capabilities, the vector will consist of
+   * zeros, indicating that all cells use the same finite element. In hp-mode,
+   * the values may be different, though.
    *
-   * @deprecated Use the function that returns the result vector.
+   * @deprecated Use get_active_fe_indices() that returns the result vector.
    */
   DEAL_II_DEPRECATED_EARLY
   void
   get_active_fe_indices(std::vector<unsigned int> &active_fe_indices) const;
 
   /**
-   * Go through the triangulation and set the future FE indices of all
-   * locally owned cells to the values given in @p future_fe_indices.
-   * Cells corresponding to numbers::invalid_fe_index will be skipped.
+   * For each locally owned cell, set the future finite element index to the
+   * corresponding value given in @p future_fe_indices. Indices must be in the
+   * order how we iterate over active cells.
+   *
+   * Future FE indices will only be set for locally owned cells. Ghost and
+   * artificial cells will be ignored; no future FE index will be assigned to
+   * them.
+   *
+   * The vector @p future_fe_indices is assumed to have as many entries as
+   * there are active cells.
    */
   void
-  set_future_fe_indices(const std::vector<unsigned int> &future_fe_indices);
+  set_future_fe_indices(const std::vector<types::fe_index> &future_fe_indices);
 
   /**
-   * Go through the triangulation and return a vector of future FE indices of
-   * all locally owned cells. If no future FE index has been set on a cell,
-   * its value will be numbers::invalid_fe_index.
+   * For each locally owned cell, extract the future finite element index and
+   * return them in the order how we iterate over active cells.
+   *
+   * As we do not know the future FE index on ghost and artificial cells, they
+   * are set to the invalid value numbers::invalid_fe_index. The same applies to
+   * locally owned cells that have no future FE index assigned.
    */
-  std::vector<unsigned int>
+  std::vector<types::fe_index>
   get_future_fe_indices() const;
 
   /**
@@ -1173,7 +1213,7 @@ public:
    * used by this object.
    */
   const FiniteElement<dim, spacedim> &
-  get_fe(const unsigned int index = 0) const;
+  get_fe(const types::fe_index index = 0) const;
 
   /**
    * Return a constant reference to the set of finite element objects that
@@ -1407,26 +1447,28 @@ private:
      * Container to temporarily store the iterator and future active FE index
      * of cells that persist.
      */
-    std::map<const cell_iterator, const unsigned int> persisting_cells_fe_index;
+    std::map<const cell_iterator, const types::fe_index>
+      persisting_cells_fe_index;
 
     /**
      * Container to temporarily store the iterator and future active FE index
      * of cells that will be refined.
      */
-    std::map<const cell_iterator, const unsigned int> refined_cells_fe_index;
+    std::map<const cell_iterator, const types::fe_index> refined_cells_fe_index;
 
     /**
      * Container to temporarily store the iterator and future active FE index
      * of parent cells that will remain after coarsening.
      */
-    std::map<const cell_iterator, const unsigned int> coarsened_cells_fe_index;
+    std::map<const cell_iterator, const types::fe_index>
+      coarsened_cells_fe_index;
 
     /**
      * Container to temporarily store the active FE index of every locally
      * owned cell for transfer across parallel::distributed::Triangulation
      * objects.
      */
-    std::vector<unsigned int> active_fe_indices;
+    std::vector<types::fe_index> active_fe_indices;
 
     /**
      * Helper object to transfer all active FE indices on
@@ -1435,7 +1477,7 @@ private:
      */
     std::unique_ptr<
       parallel::distributed::
-        CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>
+        CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>
       cell_data_transfer;
   };
 
@@ -1843,7 +1885,7 @@ DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
 
 template <int dim, int spacedim>
 inline const FiniteElement<dim, spacedim> &
-DoFHandler<dim, spacedim>::get_fe(const unsigned int number) const
+DoFHandler<dim, spacedim>::get_fe(const types::fe_index number) const
 {
   Assert(fe_collection.size() > 0,
          ExcMessage("No finite element collection is associated with "
index c9c3444fdd2b9235be27bb0698a0fc9966f0b225..b8259b3a84efb6d32a5afa7990751ad059d9342f 100644 (file)
@@ -90,7 +90,7 @@ namespace internal
       types::global_dof_index &
       access_dof_index(const dealii::DoFHandler<dh_dim, spacedim> &dof_handler,
                        const unsigned int                          obj_index,
-                       const unsigned int                          fe_index,
+                       const types::fe_index                       fe_index,
                        const unsigned int                          local_index);
 
       /**
@@ -113,7 +113,7 @@ namespace internal
       fe_index_is_active(
         const dealii::DoFHandler<dh_dim, spacedim> &dof_handler,
         const types::global_dof_index               index,
-        const unsigned int                          fe_index) const;
+        const types::fe_index                       fe_index) const;
 
       /**
        * Determine an estimate for the memory consumption (in bytes) of this
@@ -160,7 +160,7 @@ namespace internal
     DoFObjects<dim>::fe_index_is_active(
       const dealii::DoFHandler<dh_dim, spacedim> &,
       const types::global_dof_index,
-      const unsigned int fe_index) const
+      const types::fe_index fe_index) const
     {
       (void)fe_index;
       Assert((fe_index ==
@@ -178,7 +178,7 @@ namespace internal
     DoFObjects<dim>::access_dof_index(
       const dealii::DoFHandler<dh_dim, spacedim> &dof_handler,
       const unsigned int                          obj_index,
-      const unsigned int                          fe_index,
+      const types::fe_index                       fe_index,
       const unsigned int                          local_index)
     {
       (void)fe_index;
index 7d9c9838034df9a4fbc473fa0c13cd14d8512ee7..3b0616ed749389637fe6c686fafda132a47d43ba 100644 (file)
@@ -2134,7 +2134,11 @@ namespace DoFTools
    * returned vector will consist of only zeros, indicating that all cells use
    * the same finite element. In hp-mode, the values may be different, though.
    *
-   * @deprecated Use DoFHandler::get_active_fe_indices() instead.
+   * As we do not know the active FE index on artificial cells, we set them to
+   * the invalid value numbers::invalid_fe_index.
+   *
+   * @deprecated Use DoFHandler::get_active_fe_indices() that returns the result
+   * vector.
    */
   template <int dim, int spacedim>
   DEAL_II_DEPRECATED_EARLY void
index 71444b4e54410e339ebcff2437315887790eb59a..de4d42674384d0c638a36cb0697fb2c5c15306b0 100644 (file)
@@ -1264,17 +1264,21 @@ namespace internal
       loop_over_active_or_level_cells(
         dof_handler_fine, mg_level_fine, [&](const auto &cell) {
           min_active_fe_indices[0] =
-            std::min(min_active_fe_indices[0], cell->active_fe_index());
+            std::min<unsigned int>(min_active_fe_indices[0],
+                                   cell->active_fe_index());
           max_active_fe_indices[0] =
-            std::max(max_active_fe_indices[0], cell->active_fe_index());
+            std::max<unsigned int>(max_active_fe_indices[0],
+                                   cell->active_fe_index());
         });
 
       loop_over_active_or_level_cells(
         dof_handler_coarse, mg_level_coarse, [&](const auto &cell) {
           min_active_fe_indices[1] =
-            std::min(min_active_fe_indices[1], cell->active_fe_index());
+            std::min<unsigned int>(min_active_fe_indices[1],
+                                   cell->active_fe_index());
           max_active_fe_indices[1] =
-            std::max(max_active_fe_indices[1], cell->active_fe_index());
+            std::max<unsigned int>(max_active_fe_indices[1],
+                                   cell->active_fe_index());
         });
 
       const auto comm = dof_handler_fine.get_communicator();
index 4493aa851cd6202e2a3202a3795269d9249a7245..6c5d023cb6ea7fe5bc1f38e92cbe0e30554dd1d4 100644 (file)
@@ -77,7 +77,7 @@ template <int structdim, int dim, int spacedim>
 types::global_dof_index
 DoFInvalidAccessor<structdim, dim, spacedim>::dof_index(
   const unsigned int,
-  const unsigned int) const
+  const types::fe_index) const
 {
   Assert(false, ExcInternalError());
   return 0;
@@ -90,7 +90,7 @@ void
 DoFInvalidAccessor<structdim, dim, spacedim>::set_dof_index(
   const unsigned int,
   const types::global_dof_index,
-  const unsigned int) const
+  const types::fe_index) const
 {
   Assert(false, ExcInternalError());
 }
@@ -179,7 +179,7 @@ template <int structdim, int dim, int spacedim, bool level_dof_access>
 inline void
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::get_dof_indices(
   std::vector<types::global_dof_index> &dof_indices,
-  const unsigned int                    fe_index_) const
+  const types::fe_index                 fe_index_) const
 {
   Assert(this->dof_handler != nullptr, ExcInvalidObject());
 
@@ -217,7 +217,7 @@ inline void
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::get_mg_dof_indices(
   const int                             level,
   std::vector<types::global_dof_index> &dof_indices,
-  const unsigned int                    fe_index_) const
+  const types::fe_index                 fe_index_) const
 {
   Assert(this->dof_handler != nullptr, ExcInvalidObject());
   Assert(this->dof_handler->mg_vertex_dofs.size() > 0,
@@ -239,7 +239,7 @@ inline void
 DoFAccessor<structdim, dim, spacedim, level_dof_access>::set_mg_dof_indices(
   const int                                   level,
   const std::vector<types::global_dof_index> &dof_indices,
-  const unsigned int                          fe_index_)
+  const types::fe_index                       fe_index_)
 {
   Assert(this->dof_handler != nullptr, ExcInvalidObject());
 
index cd7861068faedcdf1e88bf53e30c691dc0cd4d6a..529744bb3d9fe80c481856ede02ab56483156dee 100644 (file)
@@ -44,11 +44,11 @@ template <int dim, int spacedim, bool lda>
 template <class InputVector, typename number>
 void
 DoFCellAccessor<dim, spacedim, lda>::get_interpolated_dof_values(
-  const InputVector &values,
-  Vector<number> &   interpolated_values,
-  const unsigned int fe_index_) const
+  const InputVector &   values,
+  Vector<number> &      interpolated_values,
+  const types::fe_index fe_index_) const
 {
-  const unsigned int fe_index =
+  const types::fe_index fe_index =
     (this->dof_handler->hp_capability_enabled == false &&
      fe_index_ == numbers::invalid_fe_index) ?
       DoFHandler<dim, spacedim>::default_fe_index :
index 341bb38d4fb99e0b103652f1d85b773f0a131d8b..f811bec057738fcd2f6aec2ca7a3e388a5bfc2b0 100644 (file)
@@ -20,7 +20,7 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL)
     template void DoFCellAccessor<deal_II_dimension, deal_II_dimension, lda>::
       get_interpolated_dof_values(const VEC &,
                                   Vector<VEC::value_type> &,
-                                  const unsigned int fe_index) const;
+                                  const types::fe_index) const;
 
 #if deal_II_dimension != 3
 
@@ -28,15 +28,14 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL)
     DoFCellAccessor<deal_II_dimension, deal_II_dimension + 1, lda>::
       get_interpolated_dof_values(const VEC &,
                                   Vector<VEC::value_type> &,
-                                  const unsigned int fe_index) const;
+                                  const types::fe_index) const;
 
 #endif
 
 #if deal_II_dimension == 3
 
     template void DoFCellAccessor<1, 3, lda>::get_interpolated_dof_values(
-      const VEC &, Vector<VEC::value_type> &, const unsigned int fe_index)
-      const;
+      const VEC &, Vector<VEC::value_type> &, const types::fe_index) const;
 
 #endif
   }
index fa1b035969398090a86e3f82a28c4a90aa869532..d5396ae9e1364d6deb76967a7d368e79bb137be7 100644 (file)
@@ -180,12 +180,12 @@ namespace internal
     const DoFCellAccessor<dim, spacedim, lda> &      cell,
     const Vector<number> &                           local_values,
     OutputVector &                                   values,
-    const unsigned int                               fe_index_,
+    const types::fe_index                            fe_index_,
     const std::function<void(const DoFCellAccessor<dim, spacedim, lda> &cell,
                              const Vector<number> &local_values,
                              OutputVector &        values)> &processor)
   {
-    const unsigned int fe_index =
+    const types::fe_index fe_index =
       (cell.get_dof_handler().has_hp_capabilities() == false &&
        fe_index_ == numbers::invalid_fe_index) ?
         DoFHandler<dim, spacedim>::default_fe_index :
@@ -272,7 +272,7 @@ void
 DoFCellAccessor<dim, spacedim, lda>::set_dof_values_by_interpolation(
   const Vector<number> &local_values,
   OutputVector &        values,
-  const unsigned int    fe_index_,
+  const types::fe_index fe_index_,
   const bool            perform_check) const
 {
   internal::process_by_interpolation<dim, spacedim, lda, OutputVector, number>(
@@ -295,7 +295,7 @@ DoFCellAccessor<dim, spacedim, lda>::
   distribute_local_to_global_by_interpolation(
     const Vector<number> &local_values,
     OutputVector &        values,
-    const unsigned int    fe_index_) const
+    const types::fe_index fe_index_) const
 {
   internal::process_by_interpolation<dim, spacedim, lda, OutputVector, number>(
     *this,
index a3bfb93ba58381febdb1d4688cc717dfaceed9fe..2274e1e3154437d01ec41b0fa7d0b782bd658a6c 100644 (file)
@@ -20,12 +20,12 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL)
     template void DoFCellAccessor<deal_II_dimension, deal_II_dimension, lda>::
       set_dof_values_by_interpolation(const Vector<VEC::value_type> &,
                                       VEC &,
-                                      const unsigned int fe_index,
+                                      const types::fe_index,
                                       const bool) const;
 
     template void DoFCellAccessor<deal_II_dimension, deal_II_dimension, lda>::
       distribute_local_to_global_by_interpolation(
-        const Vector<VEC::value_type> &, VEC &, const unsigned int fe_index)
+        const Vector<VEC::value_type> &, VEC &, const types::fe_index fe_index)
         const;
 
 #if deal_II_dimension != 3
@@ -34,13 +34,13 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL)
     DoFCellAccessor<deal_II_dimension, deal_II_dimension + 1, lda>::
       set_dof_values_by_interpolation(const Vector<VEC::value_type> &,
                                       VEC &,
-                                      const unsigned int fe_index,
+                                      const types::fe_index,
                                       const bool) const;
 
     template void
     DoFCellAccessor<deal_II_dimension, deal_II_dimension + 1, lda>::
       distribute_local_to_global_by_interpolation(
-        const Vector<VEC::value_type> &, VEC &, const unsigned int fe_index)
+        const Vector<VEC::value_type> &, VEC &, const types::fe_index fe_index)
         const;
 
 #endif
@@ -48,14 +48,12 @@ for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS; lda : BOOL)
 #if deal_II_dimension == 3
 
     template void DoFCellAccessor<1, 3, lda>::set_dof_values_by_interpolation(
-      const Vector<VEC::value_type> &,
-      VEC &,
-      const unsigned int fe_index,
-      const bool) const;
+      const Vector<VEC::value_type> &, VEC &, const types::fe_index, const bool)
+      const;
 
     template void
     DoFCellAccessor<1, 3, lda>::distribute_local_to_global_by_interpolation(
-      const Vector<VEC::value_type> &, VEC &, const unsigned int fe_index)
+      const Vector<VEC::value_type> &, VEC &, const types::fe_index fe_index)
       const;
 
 #endif
index 08cebf1e7234c93e937d87554f4f4fd76086c352..4eab815d31869b262cf83763c57b5a930cd0633e 100644 (file)
@@ -43,7 +43,7 @@
 DEAL_II_NAMESPACE_OPEN
 
 template <int dim, int spacedim>
-const unsigned int DoFHandler<dim, spacedim>::default_fe_index;
+const types::fe_index DoFHandler<dim, spacedim>::default_fe_index;
 
 
 namespace internal
@@ -977,8 +977,8 @@ namespace internal
                            (cell->active_fe_index() ==
                             cell->neighbor(face)->active_fe_index())))
                         {
-                          const unsigned int fe = cell->active_fe_index();
-                          const unsigned int n_dofs =
+                          const types::fe_index fe = cell->active_fe_index();
+                          const unsigned int    n_dofs =
                             dof_handler.get_fe(fe)
                               .template n_dofs_per_object<dim - 1>(face);
                           const unsigned int offset =
@@ -994,9 +994,9 @@ namespace internal
                         }
                       else
                         {
-                          unsigned int fe_1      = cell->active_fe_index();
-                          unsigned int face_no_1 = face;
-                          unsigned int fe_2 =
+                          types::fe_index fe_1      = cell->active_fe_index();
+                          unsigned int    face_no_1 = face;
+                          types::fe_index fe_2 =
                             cell->neighbor(face)->active_fe_index();
                           unsigned int face_no_2 = cell->neighbor_face_no(face);
 
@@ -1509,7 +1509,7 @@ namespace internal
                                    dim>::ExcInconsistentCoarseningFlags());
 #endif
 
-                        const unsigned int fe_index = dealii::internal::hp::
+                        const types::fe_index fe_index = dealii::internal::hp::
                           DoFHandlerImplementation::Implementation::
                             dominated_future_fe_on_children<dim, spacedim>(
                               parent);
@@ -1595,23 +1595,24 @@ namespace internal
          * one dominated by all children for the parent cell.
          */
         template <int dim, int spacedim>
-        static unsigned int
+        static types::fe_index
         determine_fe_from_children(
           const typename Triangulation<dim, spacedim>::cell_iterator &,
-          const std::vector<unsigned int> &              children_fe_indices,
+          const std::vector<types::fe_index> &           children_fe_indices,
           const dealii::hp::FECollection<dim, spacedim> &fe_collection)
         {
           Assert(!children_fe_indices.empty(), ExcInternalError());
 
           // convert vector to set
+          // TODO: Change set to types::fe_index
           const std::set<unsigned int> children_fe_indices_set(
             children_fe_indices.begin(), children_fe_indices.end());
 
-          const unsigned int dominated_fe_index =
+          const types::fe_index dominated_fe_index =
             fe_collection.find_dominated_fe_extended(children_fe_indices_set,
                                                      /*codim=*/0);
 
-          Assert(dominated_fe_index != numbers::invalid_unsigned_int,
+          Assert(dominated_fe_index != numbers::invalid_fe_index,
                  ExcNoDominatedFiniteElementOnChildren());
 
           return dominated_fe_index;
@@ -1626,7 +1627,7 @@ namespace internal
          * See documentation in the header file for more information.
          */
         template <int dim, int spacedim>
-        static unsigned int
+        static types::fe_index
         dominated_future_fe_on_children(
           const typename DoFHandler<dim, spacedim>::cell_iterator &parent)
         {
@@ -1641,6 +1642,7 @@ namespace internal
             dof_handler.has_hp_capabilities(),
             (typename DoFHandler<dim, spacedim>::ExcOnlyAvailableWithHP()));
 
+          // TODO: Change set to types::fe_index
           std::set<unsigned int> future_fe_indices_children;
           for (const auto &child : parent->child_iterators())
             {
@@ -1656,7 +1658,7 @@ namespace internal
               // here and thus call the internal function that does not check
               // for cell ownership. This requires that future FE indices have
               // been communicated prior to calling this function.
-              const unsigned int future_fe_index_child =
+              const types::fe_index future_fe_index_child =
                 dealii::internal::DoFCellAccessorImplementation::
                   Implementation::future_fe_index<dim, spacedim, false>(*child);
 
@@ -1664,12 +1666,12 @@ namespace internal
             }
           Assert(!future_fe_indices_children.empty(), ExcInternalError());
 
-          const unsigned int future_fe_index =
+          const types::fe_index future_fe_index =
             dof_handler.fe_collection.find_dominated_fe_extended(
               future_fe_indices_children,
               /*codim=*/0);
 
-          Assert(future_fe_index != numbers::invalid_unsigned_int,
+          Assert(future_fe_index != numbers::invalid_fe_index,
                  ExcNoDominatedFiniteElementOnChildren());
 
           return future_fe_index;
@@ -2564,7 +2566,7 @@ DoFHandler<dim, spacedim>::max_couplings_between_dofs() const
 template <int dim, int spacedim>
 void
 DoFHandler<dim, spacedim>::set_active_fe_indices(
-  const std::vector<unsigned int> &active_fe_indices)
+  const std::vector<types::fe_index> &active_fe_indices)
 {
   Assert(active_fe_indices.size() == this->get_triangulation().n_active_cells(),
          ExcDimensionMismatch(active_fe_indices.size(),
@@ -2583,10 +2585,21 @@ DoFHandler<dim, spacedim>::set_active_fe_indices(
 
 
 template <int dim, int spacedim>
-std::vector<unsigned int>
+void
+DoFHandler<dim, spacedim>::set_active_fe_indices(
+  const std::vector<unsigned int> &active_fe_indices)
+{
+  set_active_fe_indices(std::vector<types::fe_index>(active_fe_indices.begin(),
+                                                     active_fe_indices.end()));
+}
+
+
+
+template <int dim, int spacedim>
+std::vector<types::fe_index>
 DoFHandler<dim, spacedim>::get_active_fe_indices() const
 {
-  std::vector<unsigned int> active_fe_indices(
+  std::vector<types::fe_index> active_fe_indices(
     this->get_triangulation().n_active_cells(), numbers::invalid_fe_index);
 
   // we could try to extract the values directly, since they are
@@ -2606,7 +2619,9 @@ void
 DoFHandler<dim, spacedim>::get_active_fe_indices(
   std::vector<unsigned int> &active_fe_indices) const
 {
-  active_fe_indices = get_active_fe_indices();
+  std::vector<types::fe_index> indices = get_active_fe_indices();
+
+  active_fe_indices.assign(indices.begin(), indices.end());
 }
 
 
@@ -2614,7 +2629,7 @@ DoFHandler<dim, spacedim>::get_active_fe_indices(
 template <int dim, int spacedim>
 void
 DoFHandler<dim, spacedim>::set_future_fe_indices(
-  const std::vector<unsigned int> &future_fe_indices)
+  const std::vector<types::fe_index> &future_fe_indices)
 {
   Assert(future_fe_indices.size() == this->get_triangulation().n_active_cells(),
          ExcDimensionMismatch(future_fe_indices.size(),
@@ -2635,10 +2650,10 @@ DoFHandler<dim, spacedim>::set_future_fe_indices(
 
 
 template <int dim, int spacedim>
-std::vector<unsigned int>
+std::vector<types::fe_index>
 DoFHandler<dim, spacedim>::get_future_fe_indices() const
 {
-  std::vector<unsigned int> future_fe_indices(
+  std::vector<types::fe_index> future_fe_indices(
     this->get_triangulation().n_active_cells(), numbers::invalid_fe_index);
 
   // we could try to extract the values directly, since they are
@@ -2877,7 +2892,7 @@ DoFHandler<dim, spacedim>::pre_distributed_transfer_action()
 
   // Gather all current future FE indices.
   active_fe_index_transfer->active_fe_indices.resize(
-    get_triangulation().n_active_cells(), numbers::invalid_unsigned_int);
+    get_triangulation().n_active_cells(), numbers::invalid_fe_index);
 
   for (const auto &cell : active_cell_iterators())
     if (cell->is_locally_owned())
@@ -2891,16 +2906,16 @@ DoFHandler<dim, spacedim>::pre_distributed_transfer_action()
 
   active_fe_index_transfer->cell_data_transfer = std::make_unique<
     parallel::distributed::
-      CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
+      CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
     *distributed_tria,
     /*transfer_variable_size_data=*/false,
     /*refinement_strategy=*/
     &dealii::AdaptationStrategies::Refinement::
-      preserve<dim, spacedim, unsigned int>,
+      preserve<dim, spacedim, types::fe_index>,
     /*coarsening_strategy=*/
     [this](const typename Triangulation<dim, spacedim>::cell_iterator &parent,
-           const std::vector<unsigned int> &children_fe_indices)
-      -> unsigned int {
+           const std::vector<types::fe_index> &children_fe_indices)
+      -> types::fe_index {
       return dealii::internal::hp::DoFHandlerImplementation::Implementation::
         determine_fe_from_children<dim, spacedim>(parent,
                                                   children_fe_indices,
@@ -2951,7 +2966,7 @@ DoFHandler<dim, spacedim>::post_distributed_transfer_action()
 
   // Unpack active FE indices.
   this->active_fe_index_transfer->active_fe_indices.resize(
-    this->get_triangulation().n_active_cells(), numbers::invalid_unsigned_int);
+    this->get_triangulation().n_active_cells(), numbers::invalid_fe_index);
   this->active_fe_index_transfer->cell_data_transfer->unpack(
     this->active_fe_index_transfer->active_fe_indices);
 
@@ -2998,16 +3013,16 @@ DoFHandler<dim, spacedim>::prepare_for_serialization_of_active_fe_indices()
 
   active_fe_index_transfer->cell_data_transfer = std::make_unique<
     parallel::distributed::
-      CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
+      CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
     *distributed_tria,
     /*transfer_variable_size_data=*/false,
     /*refinement_strategy=*/
     &dealii::AdaptationStrategies::Refinement::
-      preserve<dim, spacedim, unsigned int>,
+      preserve<dim, spacedim, types::fe_index>,
     /*coarsening_strategy=*/
     [this](const typename Triangulation<dim, spacedim>::cell_iterator &parent,
-           const std::vector<unsigned int> &children_fe_indices)
-      -> unsigned int {
+           const std::vector<types::fe_index> &children_fe_indices)
+      -> types::fe_index {
       return dealii::internal::hp::DoFHandlerImplementation::Implementation::
         determine_fe_from_children<dim, spacedim>(parent,
                                                   children_fe_indices,
@@ -3056,16 +3071,16 @@ DoFHandler<dim, spacedim>::deserialize_active_fe_indices()
 
   active_fe_index_transfer->cell_data_transfer = std::make_unique<
     parallel::distributed::
-      CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
+      CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
     *distributed_tria,
     /*transfer_variable_size_data=*/false,
     /*refinement_strategy=*/
     &dealii::AdaptationStrategies::Refinement::
-      preserve<dim, spacedim, unsigned int>,
+      preserve<dim, spacedim, types::fe_index>,
     /*coarsening_strategy=*/
     [this](const typename Triangulation<dim, spacedim>::cell_iterator &parent,
-           const std::vector<unsigned int> &children_fe_indices)
-      -> unsigned int {
+           const std::vector<types::fe_index> &children_fe_indices)
+      -> types::fe_index {
       return dealii::internal::hp::DoFHandlerImplementation::Implementation::
         determine_fe_from_children<dim, spacedim>(parent,
                                                   children_fe_indices,
@@ -3074,7 +3089,7 @@ DoFHandler<dim, spacedim>::deserialize_active_fe_indices()
 
   // Unpack active FE indices.
   active_fe_index_transfer->active_fe_indices.resize(
-    get_triangulation().n_active_cells(), numbers::invalid_unsigned_int);
+    get_triangulation().n_active_cells(), numbers::invalid_fe_index);
   active_fe_index_transfer->cell_data_transfer->deserialize(
     active_fe_index_transfer->active_fe_indices);
 
index cd5060bc17d5e889eff35f210233e9fda85a5da6..cfe4200b21222ca46bffc1a45e2284ba2cdf3e80 100644 (file)
@@ -85,8 +85,8 @@ namespace internal
         const std::unique_ptr<DoFIdentities> &
         ensure_existence_and_return_dof_identities(
           const dealii::hp::FECollection<dim, spacedim> &fes,
-          const unsigned int                             fe_index_1,
-          const unsigned int                             fe_index_2,
+          const types::fe_index                          fe_index_1,
+          const types::fe_index                          fe_index_2,
           std::unique_ptr<DoFIdentities> &               identities,
           const unsigned int face_no = numbers::invalid_unsigned_int)
         {
@@ -97,6 +97,8 @@ namespace internal
           // exists
           if (identities.get() == nullptr)
             {
+              // TODO: Change to
+              // std::vector<std::map<types::fe_index, unsigned int>>
               std::vector<std::map<unsigned int, unsigned int>>
                 complete_identities;
 
@@ -104,23 +106,26 @@ namespace internal
                 {
                   case 0:
                     {
-                      complete_identities =
-                        fes.hp_vertex_dof_identities({fe_index_1, fe_index_2});
+                      // TODO: Change set to types::fe_index
+                      complete_identities = fes.hp_vertex_dof_identities(
+                        std::set<unsigned int>{fe_index_1, fe_index_2});
                       break;
                     }
 
                   case 1:
                     {
-                      complete_identities =
-                        fes.hp_line_dof_identities({fe_index_1, fe_index_2});
+                      // TODO: Change set to types::fe_index
+                      complete_identities = fes.hp_line_dof_identities(
+                        std::set<unsigned int>{fe_index_1, fe_index_2});
                       break;
                     }
 
                   case 2:
                     {
-                      complete_identities =
-                        fes.hp_quad_dof_identities({fe_index_1, fe_index_2},
-                                                   face_no);
+                      // TODO: Change set to types::fe_index
+                      complete_identities = fes.hp_quad_dof_identities(
+                        std::set<unsigned int>{fe_index_1, fe_index_2},
+                        face_no);
                       break;
                     }
 
@@ -238,7 +243,7 @@ namespace internal
 
                 if (n_active_fe_indices > 1)
                   {
-                    const std::set<unsigned int> fe_indices =
+                    const std::set<types::fe_index> fe_indices =
                       dealii::internal::DoFAccessorImplementation::
                         Implementation::get_active_fe_indices(
                           dof_handler,
@@ -248,15 +253,16 @@ namespace internal
 
                     // find out which is the most dominating finite
                     // element of the ones that are used on this vertex
-                    unsigned int most_dominating_fe_index =
+                    // TODO: Change set to types::fe_index
+                    types::fe_index most_dominating_fe_index =
                       dof_handler.get_fe_collection().find_dominating_fe(
-                        fe_indices,
+                        {fe_indices.begin(), fe_indices.end()},
                         /*codim*/ dim);
 
                     // if we haven't found a dominating finite element,
                     // choose the very first one to be dominant
-                    if (most_dominating_fe_index ==
-                        numbers::invalid_unsigned_int)
+                    // TODO: Change assert to numbers::invalid_fe_index
+                    if (most_dominating_fe_index == numbers::invalid_fe_index)
                       most_dominating_fe_index =
                         dealii::internal::DoFAccessorImplementation::
                           Implementation::nth_active_fe_index(
@@ -426,10 +432,10 @@ namespace internal
                   for (unsigned int f = 0; f < n_active_fe_indices; ++f)
                     for (unsigned int g = f + 1; g < n_active_fe_indices; ++g)
                       {
-                        const unsigned int fe_index_1 =
-                                             line->nth_active_fe_index(f),
-                                           fe_index_2 =
-                                             line->nth_active_fe_index(g);
+                        const types::fe_index fe_index_1 =
+                                                line->nth_active_fe_index(f),
+                                              fe_index_2 =
+                                                line->nth_active_fe_index(g);
 
                         // as described in the hp-paper, we only unify on lines
                         // when there are at most two different FE objects
@@ -488,18 +494,20 @@ namespace internal
 
                                     // determine which one of both finite
                                     // elements is the dominating one.
-                                    const std::set<unsigned int> fe_indices{
+                                    const std::set<types::fe_index> fe_indices{
                                       fe_index_1, fe_index_2};
 
-                                    unsigned int dominating_fe_index =
+                                    // TODO: Change set to types::fe_index
+                                    types::fe_index dominating_fe_index =
                                       dof_handler.get_fe_collection()
-                                        .find_dominating_fe(fe_indices,
+                                        .find_dominating_fe({fe_indices.begin(),
+                                                             fe_indices.end()},
                                                             /*codim=*/dim - 1);
-                                    unsigned int other_fe_index =
-                                      numbers::invalid_unsigned_int;
+                                    types::fe_index other_fe_index =
+                                      numbers::invalid_fe_index;
 
                                     if (dominating_fe_index !=
-                                        numbers::invalid_unsigned_int)
+                                        numbers::invalid_fe_index)
                                       other_fe_index =
                                         (dominating_fe_index == fe_index_1) ?
                                           fe_index_2 :
@@ -621,14 +629,15 @@ namespace internal
                   // is not what we describe in the paper!.
                   if ((unique_sets_of_dofs == 2) && (dim == 2))
                     {
-                      const std::set<unsigned int> fe_indices =
+                      const std::set<types::fe_index> fe_indices =
                         line->get_active_fe_indices();
 
                       // find out which is the most dominating finite element of
                       // the ones that are used on this line
-                      const unsigned int most_dominating_fe_index =
+                      // TODO: Change set to types::fe_index
+                      const types::fe_index most_dominating_fe_index =
                         dof_handler.get_fe_collection().find_dominating_fe(
-                          fe_indices,
+                          {fe_indices.begin(), fe_indices.end()},
                           /*codim=*/dim - 1);
 
                       // if we found the most dominating element, then use this
@@ -636,8 +645,7 @@ namespace internal
                       // identification. otherwise, the code that computes
                       // hanging node constraints will have to deal with it by
                       // computing appropriate constraints along this face/edge
-                      if (most_dominating_fe_index !=
-                          numbers::invalid_unsigned_int)
+                      if (most_dominating_fe_index != numbers::invalid_fe_index)
                         {
                           // loop over the indices of all the finite elements
                           // that are not dominating, and identify their dofs to
@@ -773,14 +781,15 @@ namespace internal
                   const auto quad             = cell->quad(q);
                   quad_touched[quad->index()] = true;
 
-                  const std::set<unsigned int> fe_indices =
+                  const std::set<types::fe_index> fe_indices =
                     quad->get_active_fe_indices();
 
                   // find out which is the most dominating finite
                   // element of the ones that are used on this quad
-                  const unsigned int most_dominating_fe_index =
+                  // TODO: Change set to types::fe_index
+                  const types::fe_index most_dominating_fe_index =
                     dof_handler.get_fe_collection().find_dominating_fe(
-                      fe_indices,
+                      {fe_indices.begin(), fe_indices.end()},
                       /*codim=*/dim - 2);
 
                   const unsigned int most_dominating_fe_index_face_no =
@@ -794,7 +803,7 @@ namespace internal
                   // computes hanging node constraints will have to
                   // deal with it by computing appropriate constraints
                   // along this face/edge
-                  if (most_dominating_fe_index != numbers::invalid_unsigned_int)
+                  if (most_dominating_fe_index != numbers::invalid_fe_index)
                     {
                       // loop over the indices of all the finite
                       // elements that are not dominating, and
@@ -1070,7 +1079,7 @@ namespace internal
 
                 if (n_active_fe_indices > 1)
                   {
-                    const std::set<unsigned int> fe_indices =
+                    const std::set<types::fe_index> fe_indices =
                       dealii::internal::DoFAccessorImplementation::
                         Implementation::get_active_fe_indices(
                           dof_handler,
@@ -1080,16 +1089,16 @@ namespace internal
 
                     // find out which is the most dominating finite
                     // element of the ones that are used on this vertex
-                    unsigned int most_dominating_fe_index =
+                    // TODO: Change set to types::fe_index
+                    types::fe_index most_dominating_fe_index =
                       dof_handler.get_fe_collection().find_dominating_fe(
-                        fe_indices,
+                        {fe_indices.begin(), fe_indices.end()},
                         /*codim=*/dim);
 
                     // if we haven't found a dominating finite element,
                     // choose the very first one to be dominant similar
                     // to compute_vertex_dof_identities()
-                    if (most_dominating_fe_index ==
-                        numbers::invalid_unsigned_int)
+                    if (most_dominating_fe_index == numbers::invalid_fe_index)
                       most_dominating_fe_index =
                         dealii::internal::DoFAccessorImplementation::
                           Implementation::nth_active_fe_index(
@@ -1251,10 +1260,10 @@ namespace internal
                   for (unsigned int f = 0; f < n_active_fe_indices; ++f)
                     for (unsigned int g = f + 1; g < n_active_fe_indices; ++g)
                       {
-                        const unsigned int fe_index_1 =
-                                             line->nth_active_fe_index(f),
-                                           fe_index_2 =
-                                             line->nth_active_fe_index(g);
+                        const types::fe_index fe_index_1 =
+                                                line->nth_active_fe_index(f),
+                                              fe_index_2 =
+                                                line->nth_active_fe_index(g);
 
                         if ((dof_handler.get_fe(fe_index_1).n_dofs_per_line() ==
                              dof_handler.get_fe(fe_index_2)
@@ -1297,18 +1306,20 @@ namespace internal
 
                                     // determine which one of both finite
                                     // elements is the dominating one.
-                                    const std::set<unsigned int> fe_indices{
+                                    const std::set<types::fe_index> fe_indices{
                                       fe_index_1, fe_index_2};
 
-                                    unsigned int dominating_fe_index =
+                                    // TODO: Change set to types::fe_index
+                                    types::fe_index dominating_fe_index =
                                       dof_handler.get_fe_collection()
-                                        .find_dominating_fe(fe_indices,
+                                        .find_dominating_fe({fe_indices.begin(),
+                                                             fe_indices.end()},
                                                             /*codim*/ dim - 1);
-                                    unsigned int other_fe_index =
-                                      numbers::invalid_unsigned_int;
+                                    types::fe_index other_fe_index =
+                                      numbers::invalid_fe_index;
 
                                     if (dominating_fe_index !=
-                                        numbers::invalid_unsigned_int)
+                                        numbers::invalid_fe_index)
                                       other_fe_index =
                                         (dominating_fe_index == fe_index_1) ?
                                           fe_index_2 :
@@ -1370,14 +1381,15 @@ namespace internal
                   // is not what we describe in the paper!.
                   if ((unique_sets_of_dofs == 2) && (dim == 2))
                     {
-                      const std::set<unsigned int> fe_indices =
+                      const std::set<types::fe_index> fe_indices =
                         line->get_active_fe_indices();
 
                       // find out which is the most dominating finite element of
                       // the ones that are used on this line
-                      const unsigned int most_dominating_fe_index =
+                      // TODO: Change set to types::fe_index
+                      const types::fe_index most_dominating_fe_index =
                         dof_handler.get_fe_collection().find_dominating_fe(
-                          fe_indices,
+                          {fe_indices.begin(), fe_indices.end()},
                           /*codim=*/dim - 1);
 
                       // if we found the most dominating element, then use this
@@ -1385,8 +1397,7 @@ namespace internal
                       // identification. otherwise, the code that computes
                       // hanging node constraints will have to deal with it by
                       // computing appropriate constraints along this face/edge
-                      if (most_dominating_fe_index !=
-                          numbers::invalid_unsigned_int)
+                      if (most_dominating_fe_index != numbers::invalid_fe_index)
                         {
                           // loop over the indices of all the finite elements
                           // that are not dominating, and identify their dofs to
@@ -1506,17 +1517,18 @@ namespace internal
                   const auto quad            = cell->quad(q);
                   quad_marked[quad->index()] = false;
 
-                  const std::set<unsigned int> fe_indices =
+                  const std::set<types::fe_index> fe_indices =
                     quad->get_active_fe_indices();
 
                   // find out which is the most dominating finite
                   // element of the ones that are used on this quad
-                  const unsigned int most_dominating_fe_index =
+                  // TODO: Change set to types::fe_index
+                  const types::fe_index most_dominating_fe_index =
                     dof_handler.get_fe_collection().find_dominating_fe(
-                      fe_indices,
+                      {fe_indices.begin(), fe_indices.end()},
                       /*codim=*/dim - 2);
 
-                  const unsigned int most_dominating_fe_index_face_no =
+                  const types::fe_index most_dominating_fe_index_face_no =
                     cell->active_fe_index() == most_dominating_fe_index ?
                       q :
                       cell->neighbor_face_no(q);
@@ -1527,7 +1539,7 @@ namespace internal
                   // computes hanging node constraints will have to
                   // deal with it by computing appropriate constraints
                   // along this face/edge
-                  if (most_dominating_fe_index != numbers::invalid_unsigned_int)
+                  if (most_dominating_fe_index != numbers::invalid_fe_index)
                     {
                       // loop over the indices of all the finite
                       // elements that are not dominating, and
@@ -1875,7 +1887,7 @@ namespace internal
               // us to do
               for (unsigned int f = 0; f < n_active_fe_indices; ++f)
                 {
-                  const unsigned int fe_index =
+                  const types::fe_index fe_index =
                     dealii::internal::DoFAccessorImplementation::
                       Implementation::nth_active_fe_index(
                         dof_handler,
@@ -1995,7 +2007,7 @@ namespace internal
           for (const auto &cell : dof_handler.active_cell_iterators())
             if (!cell->is_artificial())
               {
-                const unsigned int fe_index = cell->active_fe_index();
+                const types::fe_index fe_index = cell->active_fe_index();
 
                 for (unsigned int d = 0;
                      d < dof_handler.get_fe(fe_index)
@@ -2095,7 +2107,7 @@ namespace internal
 
                       for (unsigned int f = 0; f < n_active_fe_indices; ++f)
                         {
-                          const unsigned int fe_index =
+                          const types::fe_index fe_index =
                             line->nth_active_fe_index(f);
 
                           for (unsigned int d = 0;
@@ -2190,7 +2202,7 @@ namespace internal
 
                       for (unsigned int f = 0; f < n_active_fe_indices; ++f)
                         {
-                          const unsigned int fe_index =
+                          const types::fe_index fe_index =
                             line->nth_active_fe_index(f);
 
                           for (unsigned int d = 0;
@@ -2256,7 +2268,7 @@ namespace internal
 
                       for (unsigned int f = 0; f < n_active_fe_indices; ++f)
                         {
-                          const unsigned int fe_index =
+                          const types::fe_index fe_index =
                             quad->nth_active_fe_index(f);
 
                           for (unsigned int d = 0;
index 57fcf93ca0f35abcf9138ad7842b58df065db2f1..3486224312e32a5acb7bb38db202135d5889d129 100644 (file)
@@ -873,8 +873,8 @@ namespace DoFRenumbering
         // on each cell: get dof indices
         // and insert them into the global
         // list using their component
-        const unsigned int fe_index = cell->active_fe_index();
-        const unsigned int dofs_per_cell =
+        const types::fe_index fe_index = cell->active_fe_index();
+        const unsigned int    dofs_per_cell =
           fe_collection[fe_index].n_dofs_per_cell();
         local_dof_indices.resize(dofs_per_cell);
         cell->get_active_or_mg_dof_indices(local_dof_indices);
@@ -1146,8 +1146,8 @@ namespace DoFRenumbering
         // on each cell: get dof indices
         // and insert them into the global
         // list using their component
-        const unsigned int fe_index = cell->active_fe_index();
-        const unsigned int dofs_per_cell =
+        const types::fe_index fe_index = cell->active_fe_index();
+        const unsigned int    dofs_per_cell =
           fe_collection[fe_index].n_dofs_per_cell();
         local_dof_indices.resize(dofs_per_cell);
         cell->get_active_or_mg_dof_indices(local_dof_indices);
index 3d4be7b78a688dbbde166fa5fc3caa973f016919..4bf32a5bb8e5d80e2344181d32709a7f3cd1c356 100644 (file)
@@ -222,8 +222,8 @@ namespace DoFTools
       for (const auto &c :
            dof.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
         {
-          const unsigned int fe_index      = c->active_fe_index();
-          const unsigned int dofs_per_cell = c->get_fe().n_dofs_per_cell();
+          const types::fe_index fe_index      = c->active_fe_index();
+          const unsigned int    dofs_per_cell = c->get_fe().n_dofs_per_cell();
           indices.resize(dofs_per_cell);
           c->get_dof_indices(indices);
           for (unsigned int i = 0; i < dofs_per_cell; ++i)
@@ -282,7 +282,7 @@ namespace DoFTools
       for (const auto &cell : dof.active_cell_iterators())
         if (cell->is_locally_owned())
           {
-            const unsigned int fe_index      = cell->active_fe_index();
+            const types::fe_index fe_index   = cell->active_fe_index();
             const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
             indices.resize(dofs_per_cell);
             cell->get_dof_indices(indices);
@@ -1369,7 +1369,9 @@ namespace DoFTools
     AssertDimension(active_fe_indices.size(),
                     dof_handler.get_triangulation().n_active_cells());
 
-    active_fe_indices = dof_handler.get_active_fe_indices();
+    std::vector<types::fe_index> indices = dof_handler.get_active_fe_indices();
+
+    active_fe_indices.assign(indices.begin(), indices.end());
   }
 
   template <int dim, int spacedim>
index 00e35675a77324bc2c96fdb62eb176aec699916d..7f73278f1d610ba1dab3927eee3389abecff429f 100644 (file)
@@ -695,7 +695,7 @@ namespace DoFTools
 
                 // ok, start up the work
                 const FiniteElement<dim, spacedim> &fe = cell->get_fe();
-                const unsigned int fe_index = cell->active_fe_index();
+                const types::fe_index fe_index = cell->active_fe_index();
 
                 const unsigned int n_dofs_on_mother =
                                      2 * fe.n_dofs_per_vertex() +
@@ -881,7 +881,7 @@ namespace DoFTools
 
                 // ok, start up the work
                 const FiniteElement<dim> &fe       = cell->get_fe();
-                const unsigned int        fe_index = cell->active_fe_index();
+                const types::fe_index     fe_index = cell->active_fe_index();
 
                 const unsigned int n_dofs_on_mother = fe.n_dofs_per_face(face);
                 const unsigned int n_dofs_on_children =
@@ -1135,7 +1135,7 @@ namespace DoFTools
                 // auxiliary variable which holds FE indices of the mother face
                 // and its subfaces. This knowledge will be needed in hp-case
                 // with neither_element_dominates.
-                std::set<unsigned int> fe_ind_face_subface;
+                std::set<types::fe_index> fe_ind_face_subface;
                 fe_ind_face_subface.insert(cell->active_fe_index());
 
                 if (dof_handler.has_hp_capabilities())
@@ -1193,7 +1193,7 @@ namespace DoFTools
                             Assert(subface->n_active_fe_indices() == 1,
                                    ExcInternalError());
 
-                            const unsigned int subface_fe_index =
+                            const types::fe_index subface_fe_index =
                               subface->nth_active_fe_index(0);
 
                             // we sometime run into the situation where for
@@ -1310,12 +1310,15 @@ namespace DoFTools
                         // Note that the last solution covers the first two
                         // scenarios, thus we stick with it assuming that we
                         // won't lose much time/efficiency.
-                        const unsigned int dominating_fe_index =
+                        // TODO: Change set to types::fe_index
+                        const types::fe_index dominating_fe_index =
                           fe_collection.find_dominating_fe_extended(
-                            fe_ind_face_subface, /*codim=*/1);
+                            {fe_ind_face_subface.begin(),
+                             fe_ind_face_subface.end()},
+                            /*codim=*/1);
 
                         AssertThrow(
-                          dominating_fe_index != numbers::invalid_unsigned_int,
+                          dominating_fe_index != numbers::invalid_fe_index,
                           ExcMessage(
                             "Could not find a least face dominating FE."));
 
@@ -1428,7 +1431,7 @@ namespace DoFTools
                                        ->n_active_fe_indices() == 1,
                                    ExcInternalError());
 
-                            const unsigned int subface_fe_index =
+                            const types::fe_index subface_fe_index =
                               cell->face(face)->child(sf)->nth_active_fe_index(
                                 0);
                             const FiniteElement<dim, spacedim> &subface_fe =
@@ -1609,23 +1612,23 @@ namespace DoFTools
                             // to primary dofs based on the interpolation
                             // matrix.
 
-                            const unsigned int this_fe_index =
+                            const types::fe_index this_fe_index =
                               cell->active_fe_index();
-                            const unsigned int neighbor_fe_index =
+                            const types::fe_index neighbor_fe_index =
                               neighbor->active_fe_index();
-                            std::set<unsigned int> fes;
+                            std::set<types::fe_index> fes;
                             fes.insert(this_fe_index);
                             fes.insert(neighbor_fe_index);
                             const dealii::hp::FECollection<dim, spacedim>
                               &fe_collection = dof_handler.get_fe_collection();
 
-                            const unsigned int dominating_fe_index =
+                            // TODO: Change set to types::fe_index
+                            const types::fe_index dominating_fe_index =
                               fe_collection.find_dominating_fe_extended(
-                                fes, /*codim=*/1);
+                                {fes.begin(), fes.end()}, /*codim=*/1);
 
                             AssertThrow(
-                              dominating_fe_index !=
-                                numbers::invalid_unsigned_int,
+                              dominating_fe_index != numbers::invalid_fe_index,
                               ExcMessage(
                                 "Could not find the dominating FE for " +
                                 cell->get_fe().get_name() + " and " +
@@ -1908,8 +1911,8 @@ namespace DoFTools
       // that is left is to match the corresponding DoFs of both faces.
       //
 
-      const unsigned int face_1_index = face_1->nth_active_fe_index(0);
-      const unsigned int face_2_index = face_2->nth_active_fe_index(0);
+      const types::fe_index face_1_index = face_1->nth_active_fe_index(0);
+      const types::fe_index face_2_index = face_2->nth_active_fe_index(0);
       Assert(face_1->get_fe(face_1_index) == face_2->get_fe(face_2_index),
              ExcMessage(
                "Matching periodic cells need to use the same finite element"));
index 960ab2aa787a0c0dfa711c11c4465cecc92198ff..5afba2999f274d8c16293c78f9641357bba1edd0 100644 (file)
@@ -187,8 +187,8 @@ namespace DoFTools
            (subdomain_id == cell->subdomain_id())) &&
           cell->is_locally_owned())
         {
-          const unsigned int fe_index = cell->active_fe_index();
-          const unsigned int dofs_per_cell =
+          const types::fe_index fe_index = cell->active_fe_index();
+          const unsigned int    dofs_per_cell =
             fe_collection[fe_index].n_dofs_per_cell();
 
           dofs_on_this_cell.resize(dofs_per_cell);
index dfe9d317bcef229170157e93293a92abcf855f86..d90012d775079988d4080ec15679589613636731 100644 (file)
@@ -239,7 +239,7 @@ namespace hp
       }
 
     // If we couldn't find the dominating object, return an invalid one.
-    return numbers::invalid_unsigned_int;
+    return numbers::invalid_fe_index;
   }
 
 
@@ -286,7 +286,7 @@ namespace hp
       }
 
     // If we couldn't find the dominated object, return an invalid one.
-    return numbers::invalid_unsigned_int;
+    return numbers::invalid_fe_index;
   }
 
 
@@ -299,7 +299,7 @@ namespace hp
   {
     unsigned int fe_index = find_dominating_fe(fes, codim);
 
-    if (fe_index == numbers::invalid_unsigned_int)
+    if (fe_index == numbers::invalid_fe_index)
       {
         const std::set<unsigned int> dominating_fes =
           find_common_fes(fes, codim);
@@ -319,7 +319,7 @@ namespace hp
   {
     unsigned int fe_index = find_dominated_fe(fes, codim);
 
-    if (fe_index == numbers::invalid_unsigned_int)
+    if (fe_index == numbers::invalid_fe_index)
       {
         const std::set<unsigned int> dominated_fes =
           find_enclosing_fes(fes, codim);
index ce5fed866b787705613f4abad1445214b96d8f42..8c86492ffe8f5049deedc898ea83b5238d6c8345 100644 (file)
@@ -506,7 +506,8 @@ LaplaceProblem<dim>::refine_grid()
         {
           cell->clear_refine_flag();
           cell->set_active_fe_index(
-            std::min(cell->active_fe_index() + 1, fe_collection.size() - 1));
+            std::min<types::fe_index>(cell->active_fe_index() + 1,
+                                      fe_collection.size() - 1));
         }
   }
 
index 05ac3301f29d90ea7b6b2b0a9bf09de9b3868863..4e7c74848b66faa06895b5666184c21d0b15f0f1 100644 (file)
@@ -514,7 +514,8 @@ LaplaceProblem<dim>::refine_grid()
         {
           cell->clear_refine_flag();
           cell->set_active_fe_index(
-            std::min(cell->active_fe_index() + 1, fe_collection.size() - 1));
+            std::min<types::fe_index>(cell->active_fe_index() + 1,
+                                      fe_collection.size() - 1));
         }
   }
 
index e1161b52099868d853f2dd3ab1028c4a5a2a5c41..6d97013b48752ac1ec62a873c681a875c1dccdae 100644 (file)
 //   {Q1, Q2, Q3, Q4}             with {2,3} => Q3          2
 //   {Q1xQ1, Q2xQ2, Q3xQ4, Q4xQ3} with {2,3} => Q2xQ2       1
 //   {Q1xQ1, Q3xQ4, Q4xQ3}        with {1,2} => Q1xQ1       0
-//   {0x0, 0x0, Q1x0, 0xQ1}       with {2,3} => none        invalid_unsigned_int
+//   {0x0, 0x0, Q1x0, 0xQ1}       with {2,3} => none        invalid_fe_index
 //   {0x0, 0x0, Q1x0, 0xQ1}       with {2,3} => 0x0         0   (with dominating FE_Nothing)
 //   {Q1xQ1, Q1xQ1, Q2xQ1, Q1xQ2} with {2,3} => Q1xQ1       0
-//   {Q4xQ4, Q5xQ5, Q3xQ4, Q4xQ3} with {2,3} => none        invalid_unsigned_int
+//   {Q4xQ4, Q5xQ5, Q3xQ4, Q4xQ3} with {2,3} => none        invalid_fe_index
 //   {Q1, Q2, Q4, Q3}             with {3}   => Q3          3
 //   {Q3, Q4, Q1, Q1}             with {2,3} => Q1          2   (self-domination)
 /* clang-format on */
@@ -97,8 +97,8 @@ test()
       FESystem<dim>(FE_Nothing<dim>(), 1, FE_Q<dim>(1), 1));
     const unsigned int ind =
       fe_collection.find_dominating_fe_extended(fes, /*codim=*/1);
-    if (ind == numbers::invalid_unsigned_int)
-      deallog << "numbers::invalid_unsigned_int" << std::endl;
+    if (ind == numbers::invalid_fe_index)
+      deallog << "numbers::invalid_fe_index" << std::endl;
     else
       deallog << ind << std::endl;
   }
@@ -140,8 +140,8 @@ test()
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     const unsigned int ind =
       fe_collection.find_dominating_fe_extended(fes, /*codim=*/1);
-    if (ind == numbers::invalid_unsigned_int)
-      deallog << "numbers::invalid_unsigned_int" << std::endl;
+    if (ind == numbers::invalid_fe_index)
+      deallog << "numbers::invalid_fe_index" << std::endl;
     else
       deallog << ind << std::endl;
   }
index e333ddf30c4ddd431c6fa5802d460ac3565f117c..105278ab841525b986316a2866806083ec7fb42b 100644 (file)
@@ -2,19 +2,19 @@
 DEAL::2
 DEAL::1
 DEAL::0
-DEAL::numbers::invalid_unsigned_int
+DEAL::numbers::invalid_fe_index
 DEAL::0
 DEAL::0
-DEAL::numbers::invalid_unsigned_int
+DEAL::numbers::invalid_fe_index
 DEAL::3
 DEAL::2
 DEAL::2
 DEAL::1
 DEAL::0
-DEAL::numbers::invalid_unsigned_int
+DEAL::numbers::invalid_fe_index
 DEAL::0
 DEAL::0
-DEAL::numbers::invalid_unsigned_int
+DEAL::numbers::invalid_fe_index
 DEAL::3
 DEAL::2
 DEAL::OK
index 075a3f3840872d618545d20366ba2f54f88d12a3..97e746d725a852a3ec646719f2f6318b9c4a800b 100644 (file)
 //   {Q1, Q2, Q3, Q4}             with {2,3} => Q4          3
 //   {Q5xQ5, Q4xQ4, Q3xQ4, Q4xQ3} with {2,3} => Q4xQ4       1
 //   {Q5xQ5, Q3xQ4, Q4xQ3}        with {2,3} => Q5xQ5       0
-//   {Q1x0, 0xQ1, 0x0, 0x0}       with {2,3} => none        invalid_unsigned_int
+//   {Q1x0, 0xQ1, 0x0, 0x0}       with {2,3} => none        invalid_fe_index
 //   {Q1x0, 0xQ1, 0x0, 0x0}       with {2,3} => 0x0         2   (with dominating FE_Nothing)
 //   {Q2xQ2, Q2xQ2, Q2xQ1, Q1xQ2} with {2,3} => Q2xQ2       0
-//   {Q2xQ2, Q3xQ3, Q3xQ4, Q4xQ3} with {2,3} => none        invalid_unsigned_int
+//   {Q2xQ2, Q3xQ3, Q3xQ4, Q4xQ3} with {2,3} => none        invalid_fe_index
 //   {Q1, Q2, Q4, Q3}             with {3}   => Q3          3
 //   {Q3, Q4, Q1, Q1}             with {2,3} => Q1          2   (self-domination)
 /* clang-format on */
@@ -96,8 +96,8 @@ test()
       FESystem<dim>(FE_Nothing<dim>(), 1, FE_Nothing<dim>(), 1));
     const unsigned int ind =
       fe_collection.find_dominated_fe_extended(fes, /*codim=*/1);
-    if (ind == numbers::invalid_unsigned_int)
-      deallog << "numbers::invalid_unsigned_int" << std::endl;
+    if (ind == numbers::invalid_fe_index)
+      deallog << "numbers::invalid_fe_index" << std::endl;
     else
       deallog << ind << std::endl;
   }
@@ -139,8 +139,8 @@ test()
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     const unsigned int ind =
       fe_collection.find_dominated_fe_extended(fes, /*codim=*/1);
-    if (ind == numbers::invalid_unsigned_int)
-      deallog << "numbers::invalid_unsigned_int" << std::endl;
+    if (ind == numbers::invalid_fe_index)
+      deallog << "numbers::invalid_fe_index" << std::endl;
     else
       deallog << ind << std::endl;
   }
index 59f0566c324d83780aec55b9267328f5a2d3b6b1..7c3f39f5f8a98e700350657c07ad4165093538e7 100644 (file)
@@ -2,19 +2,19 @@
 DEAL:2D::3
 DEAL:2D::1
 DEAL:2D::0
-DEAL:2D::numbers::invalid_unsigned_int
+DEAL:2D::numbers::invalid_fe_index
 DEAL:2D::2
 DEAL:2D::0
-DEAL:2D::numbers::invalid_unsigned_int
+DEAL:2D::numbers::invalid_fe_index
 DEAL:2D::3
 DEAL:2D::2
 DEAL:3D::3
 DEAL:3D::1
 DEAL:3D::0
-DEAL:3D::numbers::invalid_unsigned_int
+DEAL:3D::numbers::invalid_fe_index
 DEAL:3D::2
 DEAL:3D::0
-DEAL:3D::numbers::invalid_unsigned_int
+DEAL:3D::numbers::invalid_fe_index
 DEAL:3D::3
 DEAL:3D::2
 DEAL::OK
index e4319dba3764c9f402f13ff19ef6037068872e6e..36461c64ec9c6152ed3e4dc3231262d3426fbea9 100644 (file)
@@ -59,7 +59,7 @@ test()
 
   dof_handler.distribute_dofs(fe_collection);
 
-  std::vector<unsigned int> active_fe_indices =
+  const std::vector<types::fe_index> active_fe_indices =
     dof_handler.get_active_fe_indices();
   for (unsigned int i = 0; i < tria.n_active_cells(); ++i)
     deallog << active_fe_indices[i] << std::endl;
index 1a21edc067152c76da47c0cb497d8d623191728b..1d1f482d0352b90490b912c77d5c5177bbdd1d13 100644 (file)
@@ -41,8 +41,8 @@ test()
 
   DoFHandler<dim> dof(tria);
   {
-    std::vector<unsigned> active_indices(tria.n_active_cells());
-    for (unsigned i = 0; i < tria.n_active_cells() / 2; ++i)
+    std::vector<types::fe_index> active_indices(tria.n_active_cells());
+    for (unsigned int i = 0; i < tria.n_active_cells() / 2; ++i)
       active_indices[i] = 1;
     dof.set_active_fe_indices(active_indices);
 
index 594e3c8a6c86eb13cf5df666371f55ea93e90d3d..829acc6341ddf89e8ffd77c03d4eedabad62a244 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <deal.II/base/conditional_ostream.h>
 #include <deal.II/base/logstream.h>
-#include <deal.II/base/mpi.h>
+#include <deal.II/base/mpi.templates.h>
 #include <deal.II/base/quadrature_lib.h>
 
 #include <deal.II/distributed/tria.h>
@@ -102,7 +102,7 @@ do_test()
             {
               if (cell->is_locally_owned())
                 cell->set_active_fe_index(
-                  std::max(((cell)->active_fe_index() + 1) / 2 /*bisection*/,
+                  std::max((cell->active_fe_index() + 1u) / 2 /*bisection*/,
                            1u) -
                   1);
             }
@@ -115,8 +115,7 @@ do_test()
           {
             if (cell->is_locally_owned())
               cell->set_active_fe_index(
-                std::max(((cell_other)->active_fe_index() + 1) /
-                           2 /*bisection*/,
+                std::max((cell_other->active_fe_index() + 1u) / 2 /*bisection*/,
                          1u) -
                 1);
             cell_other++;
@@ -151,7 +150,7 @@ do_test()
 
       // break if all cells on coarse level have active_fe_index=0
       {
-        unsigned int min = 0;
+        types::fe_index min = 0;
 
         for (auto &cell : dof_handler_coarse.active_cell_iterators())
           {

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.