]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Apply fix to dataype mismatch to all occurences in MeshWorker::ScratchData.
authorMarc Fehling <mafehling.git@gmail.com>
Sat, 20 May 2023 17:47:26 +0000 (11:47 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Sun, 21 May 2023 03:53:54 +0000 (21:53 -0600)
source/meshworker/scratch_data.cc

index 8bb1d6b51263ae7c2a2eac77d3136d409a0cf059..208000e0c8208856654ed5652e04a24c9bc24925 100644 (file)
@@ -410,9 +410,15 @@ namespace MeshWorker
             // face, then we defer to the dominance of one FE over another. This
             // should ensure that the optimal integration order and mapping
             // order are selected for this situation.
-            const unsigned int dominated_fe_index =
-              fe_collection->find_dominated_fe(
-                {cell->active_fe_index(), neighbor_cell->active_fe_index()});
+            unsigned int dominated_fe_index = fe_collection->find_dominated_fe(
+              {cell->active_fe_index(), neighbor_cell->active_fe_index()});
+
+            // TODO: find_dominated_fe returns invalid_fe_index when no
+            // dominated FE has been found. We want to pass this value to
+            // FEFaceValues, but it expects an invalid_unsigned_int in this
+            // case. We need to match the interfaces in the future.
+            if (dominated_fe_index == numbers::invalid_fe_index)
+              dominated_fe_index = numbers::invalid_unsigned_int;
 
             hp_fe_subface_values->reinit(cell,
                                          face_no,
@@ -498,9 +504,15 @@ namespace MeshWorker
         // face, then we defer to the dominance of one FE over another. This
         // should ensure that the optimal integration order and mapping
         // order are selected for this situation.
-        const unsigned int dominated_fe_index =
-          fe_collection->find_dominated_fe(
-            {cell->active_fe_index(), cell_neighbor->active_fe_index()});
+        unsigned int dominated_fe_index = fe_collection->find_dominated_fe(
+          {cell->active_fe_index(), cell_neighbor->active_fe_index()});
+
+        // TODO: find_dominated_fe returns invalid_fe_index when no dominated FE
+        // has been found. We want to pass this value to FEFaceValues, but it
+        // expects an invalid_unsigned_int in this case. We need to match the
+        // interfaces in the future.
+        if (dominated_fe_index == numbers::invalid_fe_index)
+          dominated_fe_index = numbers::invalid_unsigned_int;
 
         interface_fe_values->reinit(cell,
                                     face_no,
@@ -617,9 +629,15 @@ namespace MeshWorker
         // then we defer to the dominance of one FE over another. This should
         // ensure that the optimal integration order and mapping order are
         // selected for this situation.
-        const unsigned int dominated_fe_index =
-          fe_collection->find_dominated_fe(
-            {cell->active_fe_index(), neighbor_cell->active_fe_index()});
+        unsigned int dominated_fe_index = fe_collection->find_dominated_fe(
+          {cell->active_fe_index(), neighbor_cell->active_fe_index()});
+
+        // TODO: find_dominated_fe returns invalid_fe_index when no dominated FE
+        // has been found. We want to pass this value to FEFaceValues, but it
+        // expects an invalid_unsigned_int in this case. We need to match the
+        // interfaces in the future.
+        if (dominated_fe_index == numbers::invalid_fe_index)
+          dominated_fe_index = numbers::invalid_unsigned_int;
 
         neighbor_hp_fe_face_values->reinit(neighbor_cell,
                                            face_no,
@@ -706,9 +724,15 @@ namespace MeshWorker
             // face, then we defer to the dominance of one FE over another. This
             // should ensure that the optimal integration order and mapping
             // order are selected for this situation.
-            const unsigned int dominated_fe_index =
-              fe_collection->find_dominated_fe(
-                {cell->active_fe_index(), neighbor_cell->active_fe_index()});
+            unsigned int dominated_fe_index = fe_collection->find_dominated_fe(
+              {cell->active_fe_index(), neighbor_cell->active_fe_index()});
+
+            // TODO: find_dominated_fe returns invalid_fe_index when no
+            // dominated FE has been found. We want to pass this value to
+            // FEFaceValues, but it expects an invalid_unsigned_int in this
+            // case. We need to match the interfaces in the future.
+            if (dominated_fe_index == numbers::invalid_fe_index)
+              dominated_fe_index = numbers::invalid_unsigned_int;
 
             neighbor_hp_fe_subface_values->reinit(neighbor_cell,
                                                   face_no,

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.