From 1e6b467e3070b4011c2899c791cce55257cf21c7 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Mon, 19 Aug 2024 13:30:41 -0600 Subject: [PATCH] Adjust tests. Remove a variable. --- source/fe/fe_system.cc | 4 +-- tests/hp/fe_collection_05.cc | 31 ++++++++++------------ tests/hp/fe_collection_06.cc | 44 ++++++++++---------------------- tests/hp/fe_collection_06.output | 2 -- 4 files changed, 29 insertions(+), 52 deletions(-) diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 050576bda1..c711de1344 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -2429,12 +2429,10 @@ FESystem::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; diff --git a/tests/hp/fe_collection_05.cc b/tests/hp/fe_collection_05.cc index 038814358d..714eeff13b 100644 --- a/tests/hp/fe_collection_05.cc +++ b/tests/hp/fe_collection_05.cc @@ -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 fe_collection; - fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Q(1), 1)); - fe_collection.push_back(FESystem(FE_Q(2), 1, FE_Q(2), 1)); + fe_collection.push_back(FESystem(FE_Q(1), 2)); + fe_collection.push_back(FESystem(FE_Q(2), 2)); fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(4), 1)); fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(3), 1)); deallog << fe_collection.find_dominating_fe_extended(fes, /*codim=*/1) @@ -73,7 +74,7 @@ test() // {Q1xQ1, Q3xQ4, Q4xQ3} { hp::FECollection fe_collection; - fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Q(1), 1)); + fe_collection.push_back(FESystem(FE_Q(1), 2)); fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(4), 1)); fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(3), 1)); std::set fes; @@ -86,10 +87,8 @@ test() // {0x0, 0x0, Q1x0, 0xQ1} { hp::FECollection fe_collection; - fe_collection.push_back( - FESystem(FE_Nothing(), 1, FE_Nothing(), 1)); - fe_collection.push_back( - FESystem(FE_Nothing(), 1, FE_Nothing(), 1)); + fe_collection.push_back(FESystem(FE_Nothing(), 2)); + fe_collection.push_back(FESystem(FE_Nothing(), 2)); fe_collection.push_back( FESystem(FE_Q(1), 1, FE_Nothing(), 1)); fe_collection.push_back( @@ -106,10 +105,8 @@ test() // {0x0, 0x0, Q1x0, 0xQ1} { hp::FECollection fe_collection; - fe_collection.push_back( - FESystem(FE_Nothing(1, true), 1, FE_Nothing(1, true), 1)); - fe_collection.push_back( - FESystem(FE_Nothing(1, true), 1, FE_Nothing(1, true), 1)); + fe_collection.push_back(FESystem(FE_Nothing(1, true), 2)); + fe_collection.push_back(FESystem(FE_Nothing(1, true), 2)); fe_collection.push_back( FESystem(FE_Q(1), 1, FE_Nothing(1, true), 1)); fe_collection.push_back( @@ -122,8 +119,8 @@ test() // {Q1xQ1, Q1xQ1, Q2xQ1, Q1xQ2} { hp::FECollection fe_collection; - fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Q(1), 1)); - fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Q(1), 1)); + fe_collection.push_back(FESystem(FE_Q(1), 2)); + fe_collection.push_back(FESystem(FE_Q(1), 2)); fe_collection.push_back(FESystem(FE_Q(2), 1, FE_Q(1), 1)); fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Q(2), 1)); deallog << fe_collection.find_dominating_fe_extended(fes, /*codim=*/1) @@ -133,8 +130,8 @@ test() // {Q4xQ4, Q5xQ5, Q3xQ4, Q4xQ3} { hp::FECollection fe_collection; - fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(4), 1)); - fe_collection.push_back(FESystem(FE_Q(5), 1, FE_Q(5), 1)); + fe_collection.push_back(FESystem(FE_Q(4), 2)); + fe_collection.push_back(FESystem(FE_Q(5), 2)); fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(4), 1)); fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(3), 1)); const unsigned int ind = diff --git a/tests/hp/fe_collection_06.cc b/tests/hp/fe_collection_06.cc index 10f52e5ef0..a481586801 100644 --- a/tests/hp/fe_collection_06.cc +++ b/tests/hp/fe_collection_06.cc @@ -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 fe_collection; - fe_collection.push_back(FESystem(FE_Q(5), 1, FE_Q(5), 1)); - fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(4), 1)); + fe_collection.push_back(FESystem(FE_Q(5), 2)); + fe_collection.push_back(FESystem(FE_Q(4), 2)); fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(4), 1)); fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(3), 1)); deallog << fe_collection.find_dominated_fe_extended(fes, /*codim=*/1) @@ -72,7 +73,7 @@ test() // {Q5xQ5, Q3xQ4, Q4xQ3} { hp::FECollection fe_collection; - fe_collection.push_back(FESystem(FE_Q(5), 1, FE_Q(5), 1)); + fe_collection.push_back(FESystem(FE_Q(5), 2)); fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(4), 1)); fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(3), 1)); std::set fes; @@ -89,10 +90,8 @@ test() FESystem(FE_Q(1), 1, FE_Nothing(), 1)); fe_collection.push_back( FESystem(FE_Nothing(), 1, FE_Q(1), 1)); - fe_collection.push_back( - FESystem(FE_Nothing(), 1, FE_Nothing(), 1)); - fe_collection.push_back( - FESystem(FE_Nothing(), 1, FE_Nothing(), 1)); + fe_collection.push_back(FESystem(FE_Nothing(), 2)); + fe_collection.push_back(FESystem(FE_Nothing(), 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(FE_Q(1), 1, FE_Nothing(1, true), 1)); fe_collection.push_back( FESystem(FE_Nothing(1, true), 1, FE_Q(1), 1)); - fe_collection.push_back( - FESystem(FE_Nothing(1, true), 1, FE_Nothing(1, true), 1)); - fe_collection.push_back( - FESystem(FE_Nothing(1, true), 1, FE_Nothing(1, true), 1)); + fe_collection.push_back(FESystem(FE_Nothing(1, true), 2)); + fe_collection.push_back(FESystem(FE_Nothing(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 fe_collection; - fe_collection.push_back(FESystem(FE_Q(2), 1, FE_Q(2), 1)); - fe_collection.push_back(FESystem(FE_Q(2), 1, FE_Q(2), 1)); + fe_collection.push_back(FESystem(FE_Q(2), 2)); + fe_collection.push_back(FESystem(FE_Q(2), 2)); fe_collection.push_back(FESystem(FE_Q(2), 1, FE_Q(1), 1)); fe_collection.push_back(FESystem(FE_Q(1), 1, FE_Q(2), 1)); deallog << fe_collection.find_dominated_fe_extended(fes, /*codim=*/1) @@ -132,8 +129,8 @@ test() // {Q2xQ2, Q3xQ3, Q3xQ4, Q4xQ3} { hp::FECollection fe_collection; - fe_collection.push_back(FESystem(FE_Q(2), 1, FE_Q(2), 1)); - fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(3), 1)); + fe_collection.push_back(FESystem(FE_Q(2), 2)); + fe_collection.push_back(FESystem(FE_Q(3), 2)); fe_collection.push_back(FESystem(FE_Q(3), 1, FE_Q(4), 1)); fe_collection.push_back(FESystem(FE_Q(4), 1, FE_Q(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 fe_collection; - fe_collection.push_back(FESystem(FE_Q(1), 3)); - fe_collection.push_back( - FESystem(FE_Q(1), 2, FE_Nothing(), 1)); - deallog << "hello: " - << fe_collection[0].compare_for_domination(fe_collection[1]) - << std::endl; - } } int diff --git a/tests/hp/fe_collection_06.output b/tests/hp/fe_collection_06.output index cf7f2d8560..7c3f39f5f8 100644 --- a/tests/hp/fe_collection_06.output +++ b/tests/hp/fe_collection_06.output @@ -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 -- 2.39.5