]> https://gitweb.dealii.org/ - dealii.git/commitdiff
added test
authorMohamad Ghadban <mghadban@ualberta.ca>
Sat, 17 Aug 2024 05:53:24 +0000 (23:53 -0600)
committerMohamad Ghadban <mghadban@ualberta.ca>
Sat, 17 Aug 2024 05:53:24 +0000 (23:53 -0600)
source/fe/fe_system.cc
tests/hp/fe_collection_06.cc
tests/hp/fe_collection_06.output

index 22fe0a686275d71bdf43a54ff08808ed2e552c46..050576bda139b39d4a38f7fb363f283851381937 100644 (file)
@@ -2447,11 +2447,7 @@ FESystem<dim, spacedim>::compare_for_domination(
                      ->base_element(base_element_index_in_fe_sys_other)
                      .n_components(),
                  ExcNotImplemented());
-          Assert(this->element_multiplicity(
-                   base_element_index_in_fe_sys_this) ==
-                   fe_sys_other->element_multiplicity(
-                     base_element_index_in_fe_sys_other),
-                 ExcNotImplemented());
+
           // for this pair of base elements, check who dominates and combine
           // with previous result
           const FiniteElementDomination::Domination base_domination =
@@ -2459,6 +2455,7 @@ FESystem<dim, spacedim>::compare_for_domination(
                .compare_for_domination(fe_sys_other->base_element(
                                          base_element_index_in_fe_sys_other),
                                        codim));
+
           domination = domination & base_domination;
         }
 
index 4ca7d2b987aebd82559da42229447308931f974d..10f52e5ef0b5742a974660730510bc121db799df 100644 (file)
@@ -167,6 +167,19 @@ test()
     deallog << fe_collection.find_dominated_fe_extended(fes, /*codim=*/1)
             << std::endl;
   }
+
+  // Test compare_for_domination().
+  // The test returns
+  // FiniteElementDomination::Domination::either_element_can_dominate or 3.
+  {
+    hp::FECollection<dim> fe_collection;
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 3));
+    fe_collection.push_back(
+      FESystem<dim>(FE_Q<dim>(1), 2, FE_Nothing<dim>(), 1));
+    deallog << "hello: "
+            << fe_collection[0].compare_for_domination(fe_collection[1])
+            << std::endl;
+  }
 }
 
 int
index 7c3f39f5f8a98e700350657c07ad4165093538e7..cf7f2d85602bc52e34fc33a53626ce5ce6d23a4a 100644 (file)
@@ -8,6 +8,7 @@ DEAL:2D::0
 DEAL:2D::numbers::invalid_fe_index
 DEAL:2D::3
 DEAL:2D::2
+DEAL:2D::3
 DEAL:3D::3
 DEAL:3D::1
 DEAL:3D::0
@@ -17,4 +18,5 @@ DEAL:3D::0
 DEAL:3D::numbers::invalid_fe_index
 DEAL:3D::3
 DEAL:3D::2
+DEAL:3D::3
 DEAL::OK

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.