]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add assertions for fe_index in MG case 14066/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 29 Jun 2022 07:48:01 +0000 (09:48 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 29 Jun 2022 07:48:01 +0000 (09:48 +0200)
include/deal.II/dofs/dof_accessor.templates.h

index fdbb395ddfe5d115c1f91d91537c4264c4a8dd89..982da7e0a07d107064e03bec13869c160e9b8e0e 100644 (file)
@@ -997,11 +997,15 @@ namespace internal
         const dealii::DoFAccessor<structdim, dim, spacedim, level_dof_access>
           &                   accessor,
         const DoFIndicesType &const_dof_indices,
-        const unsigned int    fe_index,
+        const unsigned int    fe_index_,
         const DoFOperation &  dof_operation,
         const DoFProcessor &  dof_processor,
         const bool            count_level_dofs)
       {
+        const unsigned int fe_index =
+          internal::DoFAccessorImplementation::get_fe_index_or_default(
+            accessor, fe_index_);
+
         // we cannot rely on the template parameter level_dof_access here, since
         // the function get_mg_dof_indices()/set_mg_dof_indices() can be called
         // even if level_dof_access==false.
@@ -1337,6 +1341,8 @@ namespace internal
         std::vector<types::global_dof_index> &dof_indices,
         const unsigned int                    fe_index)
       {
+        Assert((fe_index == DoFHandler<dim, spacedim>::default_fe_index),
+               ExcMessage("MG DoF indices cannot be queried in hp case"));
         process_dof_indices(
           accessor,
           dof_indices,
@@ -1357,6 +1363,9 @@ namespace internal
         const std::vector<types::global_dof_index> &dof_indices,
         const unsigned int                          fe_index)
       {
+        Assert((fe_index == DoFHandler<dim, spacedim>::default_fe_index),
+               ExcMessage("MG DoF indices cannot be queried in hp case"));
+
         // Note: this function is as general as `get_mg_dof_indices()`. This
         // assert is placed here since it is currently only used by the
         // function DoFCellAccessor::set_mg_dof_indices(), which is called by

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.