]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix dof_accessor warning
authorTimo Heister <timo.heister@gmail.com>
Sat, 1 Aug 2020 19:08:25 +0000 (15:08 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sat, 1 Aug 2020 19:08:25 +0000 (15:08 -0400)
fixes:
```
/jenkins/workspace/dealii_PR-10786/include/deal.II/base/exceptions.h:1414:72:
error: ‘fe_index_’ may be used uninitialized in this function [-Werror
=maybe-uninitialized]
/jenkins/workspace/dealii_PR-10786/include/deal.II/dofs/dof_accessor.templates.h:284:22:
note: ‘fe_index_’ was declared here
```

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

index 3b9f9631857911038418d6cca08bacf8ec1888fe..8229ac7fd7b98748e81d660709e294383254a95c 100644 (file)
@@ -282,28 +282,28 @@ namespace internal
         AssertIndexRange(d, dof_handler.object_dof_indices[obj_level].size());
 
         unsigned int fe_index_;
+        Assert(dof_handler.hp_capability_enabled, ExcInternalError());
 
-        if (dof_handler.hp_capability_enabled)
-          {
-            AssertIndexRange(d, dof_handler.hp_object_fe_ptr.size());
-            AssertIndexRange(obj_index, dof_handler.hp_object_fe_ptr[d].size());
+        {
+          AssertIndexRange(d, dof_handler.hp_object_fe_ptr.size());
+          AssertIndexRange(obj_index, dof_handler.hp_object_fe_ptr[d].size());
 
-            const auto ptr =
-              std::find(dof_handler.hp_object_fe_indices[d].begin() +
-                          dof_handler.hp_object_fe_ptr[d][obj_index],
-                        dof_handler.hp_object_fe_indices[d].begin() +
-                          dof_handler.hp_object_fe_ptr[d][obj_index + 1],
-                        fe_index);
+          const auto ptr =
+            std::find(dof_handler.hp_object_fe_indices[d].begin() +
+                        dof_handler.hp_object_fe_ptr[d][obj_index],
+                      dof_handler.hp_object_fe_indices[d].begin() +
+                        dof_handler.hp_object_fe_ptr[d][obj_index + 1],
+                      fe_index);
 
-            Assert(ptr != dof_handler.hp_object_fe_indices[d].begin() +
-                            dof_handler.hp_object_fe_ptr[d][obj_index + 1],
-                   ExcNotImplemented());
+          Assert(ptr != dof_handler.hp_object_fe_indices[d].begin() +
+                          dof_handler.hp_object_fe_ptr[d][obj_index + 1],
+                 ExcNotImplemented());
 
-            fe_index_ =
-              std::distance(dof_handler.hp_object_fe_indices[d].begin() +
-                              dof_handler.hp_object_fe_ptr[d][obj_index],
-                            ptr);
-          }
+          fe_index_ =
+            std::distance(dof_handler.hp_object_fe_indices[d].begin() +
+                            dof_handler.hp_object_fe_ptr[d][obj_index],
+                          ptr);
+        }
 
         AssertIndexRange(dof_handler.hp_capability_enabled ?
                            (dof_handler.hp_object_fe_ptr[d][obj_index] +

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.