]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix active fe index in MFT
authorPeter Munch <peterrmuench@gmail.com>
Thu, 10 Apr 2025 14:30:44 +0000 (16:30 +0200)
committerNils Much <nils.much@tum.de>
Thu, 10 Apr 2025 14:30:44 +0000 (16:30 +0200)
include/deal.II/matrix_free/fe_evaluation.h
include/deal.II/matrix_free/fe_evaluation_data.h
include/deal.II/matrix_free/matrix_free.h
include/deal.II/matrix_free/tools.h

index d819941a541ffd84fc39f7d01368d0dce03630fe..496bae9dd7d683740724113480e485fc4f5327d1 100644 (file)
@@ -6160,7 +6160,9 @@ inline FEEvaluation<dim,
                  dof_no,
                  quad_no,
                  first_selected_component,
-                 matrix_free.get_cell_active_fe_index(range))
+                 (matrix_free.first_hp_dof_handler_index == dof_no) ?
+                   matrix_free.get_cell_active_fe_index(range) :
+                   0)
 {}
 
 
index b03dbb5f88573883e1ce2e5baa1c05ca82bc5639..afadfe494697085a4b4d3515627dfc80558d1a47 100644 (file)
@@ -1086,7 +1086,9 @@ inline FEEvaluationData<dim, Number, is_face>::FEEvaluationData(
   , subface_index(0)
   , cell_type(internal::MatrixFreeFunctions::general)
   , divergence_is_requested(false)
-{}
+{
+  Assert(!data->data.empty(), ExcInternalError());
+}
 
 
 
@@ -1199,6 +1201,9 @@ FEEvaluationData<dim, Number, is_face>::set_data_pointers(
   const unsigned int     n_components)
 {
   Assert(scratch_data_array != nullptr, ExcInternalError());
+  Assert(data != nullptr, ExcInternalError());
+  Assert(!data->data.empty(), ExcInternalError());
+
 
   const unsigned int tensor_dofs_per_component =
     Utilities::fixed_power<dim>(data->data.front().fe_degree + 1);
index 38fef3f1b70dfe1e77669ce91b3d242bf6057e46..aef158d9e58fe3b0aeac0e0a82114de000904b15 100644 (file)
@@ -2353,6 +2353,7 @@ private:
    * Stores the index of the first DoFHandler that is in hp-mode. If no
    * DoFHandler is in hp-mode, the value is 0.
    */
+public:
   unsigned int first_hp_dof_handler_index;
 };
 
index 1e1aca39cae2bd2ab7027a9a308a90a5fc75d916..2740936df3c54bd1891902150b9cd9cd380aa895 100644 (file)
@@ -1352,7 +1352,9 @@ namespace MatrixFreeTools
 
       unsigned int active_fe_index = 0;
       if (!is_face)
-        active_fe_index = matrix_free.get_cell_active_fe_index(range);
+        active_fe_index = (matrix_free.first_hp_dof_handler_index == dof_no) ?
+                            matrix_free.get_cell_active_fe_index(range) :
+                            0;
       else if (is_interior_face)
         active_fe_index = matrix_free.get_face_range_category(range).first;
       else

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.