* answer is Q3 and therefore this function will return its index in
* FECollection, namely 2.
*
+ * For the purpose of this function by domination we consider either
+ * this_element_dominate or either_element_can_dominate ; therefore the
+ * element can dominate itself. Thus if FECollection contains {Q1,Q2,Q4,Q3}
+ * and @p fes = {3}, the function returns 3.
+ *
* If we were not able to find a finite element, the function returns
* numbers::invalid_unsigned_int .
*
* will not find the most dominating element as the default behavior of
* FE_Nothing is to return FiniteElementDomination::no_requirements when
* comparing for face domination. This, therefore, can't be considered as a
- * dominating element in the sense defined in FiniteElementDomination .
- *
- * Finally, for the purpose of this function we consider that an element
- * dominates itself. Thus if FECollection contains {Q1,Q2,Q4,Q3} and @p fes
- * = {3}, the function returns 3.
+ * dominating element in the sense described above .
*/
unsigned int
find_least_face_dominating_fe (const std::set<unsigned int> &fes) const;
const hp::FECollection<dim,spacedim> &fe_collection = *this;
std::set<unsigned int> candidate_fes;
- // first loop over all FEs and check which can dominate those given in FEs:
+ // first loop over all FEs and check which can dominate those given in @p fes:
for (unsigned int cur_fe = 0; cur_fe < fe_collection.size(); cur_fe++)
{
FiniteElementDomination::Domination domination = FiniteElementDomination::no_requirements;
}
// if we found dominating element, keep them in a set.
- if (domination == FiniteElementDomination::this_element_dominates)
+ if (domination == FiniteElementDomination::this_element_dominates ||
+ domination == FiniteElementDomination::either_element_can_dominate /*covers cases like {Q2,Q3,Q1,Q1} with fes={2,3}*/)
candidate_fes.insert(cur_fe);
}
// {Q1xQ1,Q1xQ1,Q2xQ1,Q1,Q2} with {2,3} => Q1 0
// {Q4xQ4, Q5xQ5, Q3xQ4, Q4xQ3} with {2,3} => none invalid_unsigned_int
// {Q1,Q2,Q4,Q3} with {3} => Q3 3
+// {Q3,Q4,Q1,Q1} with {2,3} => Q1 2 // self-domination
#include "../tests.h"
deallog << fe_collection.find_least_face_dominating_fe(fes) << std::endl;
}
+ {
+ hp::FECollection<dim> fe_collection;
+ fe_collection.push_back (FE_Q<dim>(3));
+ fe_collection.push_back (FE_Q<dim>(4));
+ fe_collection.push_back (FE_Q<dim>(1));
+ fe_collection.push_back (FE_Q<dim>(1));
+ deallog << fe_collection.find_least_face_dominating_fe(fes) << std::endl;
+ }
+
+
}
DEAL::numbers::invalid_unsigned_int
DEAL::3
DEAL::2
+DEAL::2
DEAL::1
DEAL::0
DEAL::numbers::invalid_unsigned_int
DEAL::0
DEAL::numbers::invalid_unsigned_int
DEAL::3
+DEAL::2
DEAL::OK