From: Peter Munch Date: Sat, 21 Nov 2020 13:45:05 +0000 (+0100) Subject: Add hp capabilities to Simplex::FE_P X-Git-Tag: v9.3.0-rc1~865^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11224%2Fhead;p=dealii.git Add hp capabilities to Simplex::FE_P --- 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))