]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust tests. Remove a variable. 17549/head
authorMarc Fehling <mafehling.git@gmail.com>
Mon, 19 Aug 2024 19:30:41 +0000 (13:30 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Mon, 19 Aug 2024 19:30:41 +0000 (13:30 -0600)
source/fe/fe_system.cc
tests/hp/fe_collection_05.cc
tests/hp/fe_collection_06.cc
tests/hp/fe_collection_06.output

index 050576bda139b39d4a38f7fb363f283851381937..c711de134437e9ee0f461d4887c283ea22195cb4 100644 (file)
@@ -2429,12 +2429,10 @@ FESystem<dim, spacedim>::compare_for_domination(
                         std::to_string(fe_sys_other->n_components()) +
                         " vector components."));
 
-      const unsigned int n_components = this->n_components();
-
       FiniteElementDomination::Domination domination =
         FiniteElementDomination::no_requirements;
 
-      for (unsigned int c = 0; c < n_components; ++c)
+      for (unsigned int c = 0; c < this->n_components(); ++c)
         {
           const unsigned int base_element_index_in_fe_sys_this =
             this->component_to_base_index(c).first;
index 038814358df834bd0e20107d70997557ce15e903..714eeff13b3bdf5dbb6b0ece3bde783f42c59261 100644 (file)
@@ -15,8 +15,9 @@
 
 /* clang-format off */
 // find the least dominating FE from a set of FEs on faces (codim=1).
-// for this task we concatenate the two functions
-// FECollection::find_common_subspace() and FECollection::find_dominated_fe().
+// for this task we call FECollection::find_dominating_fe_extended(), which
+// concatenates the two functions FECollection::find_common_fes() and
+// FECollection::find_dominated_fe().
 // we test the results for the following collections:
 //   {Q1, Q2, Q3, Q4}             with {2,3} => Q3          2
 //   {Q1xQ1, Q2xQ2, Q3xQ4, Q4xQ3} with {2,3} => Q2xQ2       1
@@ -62,8 +63,8 @@ test()
   // {Q1xQ1, Q2xQ2, Q3xQ4, Q4xQ3}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 1, FE_Q<dim>(1), 1));
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 1, FE_Q<dim>(2), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(4), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     deallog << fe_collection.find_dominating_fe_extended(fes, /*codim=*/1)
@@ -73,7 +74,7 @@ test()
   // {Q1xQ1, Q3xQ4, Q4xQ3}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 1, FE_Q<dim>(1), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(4), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     std::set<unsigned int> fes;
@@ -86,10 +87,8 @@ test()
   // {0x0, 0x0, Q1x0, 0xQ1}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(), 1, FE_Nothing<dim>(), 1));
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(), 1, FE_Nothing<dim>(), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(), 2));
     fe_collection.push_back(
       FESystem<dim>(FE_Q<dim>(1), 1, FE_Nothing<dim>(), 1));
     fe_collection.push_back(
@@ -106,10 +105,8 @@ test()
   // {0x0, 0x0, Q1x0, 0xQ1}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(1, true), 1, FE_Nothing<dim>(1, true), 1));
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(1, true), 1, FE_Nothing<dim>(1, true), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(1, true), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(1, true), 2));
     fe_collection.push_back(
       FESystem<dim>(FE_Q<dim>(1), 1, FE_Nothing<dim>(1, true), 1));
     fe_collection.push_back(
@@ -122,8 +119,8 @@ test()
   // {Q1xQ1, Q1xQ1, Q2xQ1, Q1xQ2}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 1, FE_Q<dim>(1), 1));
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 1, FE_Q<dim>(1), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 1, FE_Q<dim>(2), 1));
     deallog << fe_collection.find_dominating_fe_extended(fes, /*codim=*/1)
@@ -133,8 +130,8 @@ test()
   // {Q4xQ4, Q5xQ5, Q3xQ4, Q4xQ3}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(4), 1));
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(5), 1, FE_Q<dim>(5), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(5), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(4), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     const unsigned int ind =
index 10f52e5ef0b5742a974660730510bc121db799df..a4815868019640398b3ec170e592167a3e89d4ee 100644 (file)
@@ -15,8 +15,9 @@
 
 /* clang-format off */
 // find the most dominating FE from a set of FEs on faces (codim=1).
-// for this task we concatenate the two functions
-// FECollection::find_encapsulating_space() and FECollection::find_dominating_fe().
+// for this task we call FECollection::find_dominated_fe_extended(), which
+// concatenates the two functions FECollection::find_enclosing_fes() and
+// FECollection::find_dominating_fe().
 // we test the results for the following collections:
 //   {Q1, Q2, Q3, Q4}             with {2,3} => Q4          3
 //   {Q5xQ5, Q4xQ4, Q3xQ4, Q4xQ3} with {2,3} => Q4xQ4       1
@@ -61,8 +62,8 @@ test()
   // {Q5xQ5, Q4xQ4, Q3xQ4, Q4xQ3}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(5), 1, FE_Q<dim>(5), 1));
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(4), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(5), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(4), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     deallog << fe_collection.find_dominated_fe_extended(fes, /*codim=*/1)
@@ -72,7 +73,7 @@ test()
   // {Q5xQ5, Q3xQ4, Q4xQ3}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(5), 1, FE_Q<dim>(5), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(5), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(4), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     std::set<unsigned int> fes;
@@ -89,10 +90,8 @@ test()
       FESystem<dim>(FE_Q<dim>(1), 1, FE_Nothing<dim>(), 1));
     fe_collection.push_back(
       FESystem<dim>(FE_Nothing<dim>(), 1, FE_Q<dim>(1), 1));
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(), 1, FE_Nothing<dim>(), 1));
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(), 1, FE_Nothing<dim>(), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(), 2));
     const unsigned int ind =
       fe_collection.find_dominated_fe_extended(fes, /*codim=*/1);
     if (ind == numbers::invalid_fe_index)
@@ -109,10 +108,8 @@ test()
       FESystem<dim>(FE_Q<dim>(1), 1, FE_Nothing<dim>(1, true), 1));
     fe_collection.push_back(
       FESystem<dim>(FE_Nothing<dim>(1, true), 1, FE_Q<dim>(1), 1));
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(1, true), 1, FE_Nothing<dim>(1, true), 1));
-    fe_collection.push_back(
-      FESystem<dim>(FE_Nothing<dim>(1, true), 1, FE_Nothing<dim>(1, true), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(1, true), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(1, true), 2));
     deallog << fe_collection.find_dominated_fe_extended(fes, /*codim=*/1)
             << std::endl;
   }
@@ -121,8 +118,8 @@ test()
   // {Q2xQ2, Q2xQ2, Q2xQ1, Q1xQ2}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 1, FE_Q<dim>(2), 1));
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 1, FE_Q<dim>(2), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1), 1, FE_Q<dim>(2), 1));
     deallog << fe_collection.find_dominated_fe_extended(fes, /*codim=*/1)
@@ -132,8 +129,8 @@ test()
   // {Q2xQ2, Q3xQ3, Q3xQ4, Q4xQ3}
   {
     hp::FECollection<dim> fe_collection;
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 1, FE_Q<dim>(2), 1));
-    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(3), 1));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(2), 2));
+    fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 2));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(3), 1, FE_Q<dim>(4), 1));
     fe_collection.push_back(FESystem<dim>(FE_Q<dim>(4), 1, FE_Q<dim>(3), 1));
     const unsigned int ind =
@@ -167,19 +164,6 @@ 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 cf7f2d85602bc52e34fc33a53626ce5ce6d23a4a..7c3f39f5f8a98e700350657c07ad4165093538e7 100644 (file)
@@ -8,7 +8,6 @@ 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
@@ -18,5 +17,4 @@ 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.