From 1e79c06a1f24c57e6f8e6095c185e087f477b8ac Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 21 Nov 2020 14:45:05 +0100 Subject: [PATCH] Add hp capabilities to Simplex::FE_P --- include/deal.II/simplex/fe_lib.h | 21 +++++++++++ source/simplex/fe_lib.cc | 61 ++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/include/deal.II/simplex/fe_lib.h b/include/deal.II/simplex/fe_lib.h index 2573906922..4c8a01572b 100644 --- a/include/deal.II/simplex/fe_lib.h +++ b/include/deal.II/simplex/fe_lib.h @@ -84,6 +84,27 @@ namespace Simplex */ std::string get_name() const override; + + /** + * @copydoc dealii::FiniteElement::compare_for_domination() + */ + FiniteElementDomination::Domination + compare_for_domination(const FiniteElement &fe_other, + const unsigned int codim) const override; + + /** + * @copydoc dealii::FiniteElement::hp_vertex_dof_identities() + */ + std::vector> + hp_vertex_dof_identities( + const FiniteElement &fe_other) const override; + + /** + * @copydoc dealii::FiniteElement::hp_line_dof_identities() + */ + std::vector> + hp_line_dof_identities( + const FiniteElement &fe_other) const override; }; diff --git a/source/simplex/fe_lib.cc b/source/simplex/fe_lib.cc index abcde7aaca..cf532af094 100644 --- a/source/simplex/fe_lib.cc +++ b/source/simplex/fe_lib.cc @@ -15,6 +15,8 @@ #include +#include + #include DEAL_II_NAMESPACE_OPEN @@ -239,6 +241,65 @@ namespace Simplex } + + template + FiniteElementDomination::Domination + FE_P::compare_for_domination( + const FiniteElement &fe_other, + const unsigned int codim) const + { + (void)fe_other; + (void)codim; + + Assert((dynamic_cast *>(&fe_other)), + ExcNotImplemented()); + AssertDimension(dim, 2); + AssertDimension(this->degree, fe_other.tensor_degree()); + + return FiniteElementDomination::either_element_can_dominate; + } + + + + template + std::vector> + FE_P::hp_vertex_dof_identities( + const FiniteElement &fe_other) const + { + (void)fe_other; + + Assert((dynamic_cast *>(&fe_other)), + ExcNotImplemented()); + AssertDimension(dim, 2); + AssertDimension(this->degree, fe_other.tensor_degree()); + + return {{0, 0}}; + } + + + + template + std::vector> + FE_P::hp_line_dof_identities( + const FiniteElement &fe_other) const + { + (void)fe_other; + + Assert((dynamic_cast *>(&fe_other)), + ExcNotImplemented()); + AssertDimension(dim, 2); + AssertDimension(this->degree, fe_other.tensor_degree()); + + std::vector> result; + + for (unsigned int i = 0; i < this->degree - 1; ++i) + result.emplace_back(i, i); + + return result; + } + + + template FE_DGP::FE_DGP(const unsigned int degree) : FE_Poly(degree, get_dpo_vector_fe_dgp(dim, degree)) -- 2.39.5