From: Mohamad Ghadban Date: Sat, 17 Aug 2024 05:53:24 +0000 (-0600) Subject: added test X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad031d6932c861031a648b679f008de8218c0403;p=dealii.git added test --- diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 22fe0a6862..050576bda1 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -2447,11 +2447,7 @@ FESystem::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::compare_for_domination( .compare_for_domination(fe_sys_other->base_element( base_element_index_in_fe_sys_other), codim)); + domination = domination & base_domination; } diff --git a/tests/hp/fe_collection_06.cc b/tests/hp/fe_collection_06.cc index 4ca7d2b987..10f52e5ef0 100644 --- a/tests/hp/fe_collection_06.cc +++ b/tests/hp/fe_collection_06.cc @@ -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 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 7c3f39f5f8..cf7f2d8560 100644 --- a/tests/hp/fe_collection_06.output +++ b/tests/hp/fe_collection_06.output @@ -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