]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add hp capabilities to Simplex::FE_P 11224/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 21 Nov 2020 13:45:05 +0000 (14:45 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 21 Nov 2020 13:45:05 +0000 (14:45 +0100)
include/deal.II/simplex/fe_lib.h
source/simplex/fe_lib.cc

index 2573906922c6e98ca82c2adb6e4bf17e2e78d343..4c8a01572bf9fab58c0a55137c738d5c7d5ddb49 100644 (file)
@@ -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<dim, spacedim> &fe_other,
+                           const unsigned int codim) const override;
+
+    /**
+     * @copydoc dealii::FiniteElement::hp_vertex_dof_identities()
+     */
+    std::vector<std::pair<unsigned int, unsigned int>>
+    hp_vertex_dof_identities(
+      const FiniteElement<dim, spacedim> &fe_other) const override;
+
+    /**
+     * @copydoc dealii::FiniteElement::hp_line_dof_identities()
+     */
+    std::vector<std::pair<unsigned int, unsigned int>>
+    hp_line_dof_identities(
+      const FiniteElement<dim, spacedim> &fe_other) const override;
   };
 
 
index abcde7aaca3deece026dde11876f9cc63d5e9bd2..cf532af094fae8c8cd384b71f38796a3c86d56e1 100644 (file)
@@ -15,6 +15,8 @@
 
 #include <deal.II/base/config.h>
 
+#include <deal.II/fe/fe_q.h>
+
 #include <deal.II/simplex/fe_lib.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -239,6 +241,65 @@ namespace Simplex
   }
 
 
+
+  template <int dim, int spacedim>
+  FiniteElementDomination::Domination
+  FE_P<dim, spacedim>::compare_for_domination(
+    const FiniteElement<dim, spacedim> &fe_other,
+    const unsigned int                  codim) const
+  {
+    (void)fe_other;
+    (void)codim;
+
+    Assert((dynamic_cast<const FE_Q<dim, spacedim> *>(&fe_other)),
+           ExcNotImplemented());
+    AssertDimension(dim, 2);
+    AssertDimension(this->degree, fe_other.tensor_degree());
+
+    return FiniteElementDomination::either_element_can_dominate;
+  }
+
+
+
+  template <int dim, int spacedim>
+  std::vector<std::pair<unsigned int, unsigned int>>
+  FE_P<dim, spacedim>::hp_vertex_dof_identities(
+    const FiniteElement<dim, spacedim> &fe_other) const
+  {
+    (void)fe_other;
+
+    Assert((dynamic_cast<const FE_Q<dim, spacedim> *>(&fe_other)),
+           ExcNotImplemented());
+    AssertDimension(dim, 2);
+    AssertDimension(this->degree, fe_other.tensor_degree());
+
+    return {{0, 0}};
+  }
+
+
+
+  template <int dim, int spacedim>
+  std::vector<std::pair<unsigned int, unsigned int>>
+  FE_P<dim, spacedim>::hp_line_dof_identities(
+    const FiniteElement<dim, spacedim> &fe_other) const
+  {
+    (void)fe_other;
+
+    Assert((dynamic_cast<const FE_Q<dim, spacedim> *>(&fe_other)),
+           ExcNotImplemented());
+    AssertDimension(dim, 2);
+    AssertDimension(this->degree, fe_other.tensor_degree());
+
+    std::vector<std::pair<unsigned int, unsigned int>> result;
+
+    for (unsigned int i = 0; i < this->degree - 1; ++i)
+      result.emplace_back(i, i);
+
+    return result;
+  }
+
+
+
   template <int dim, int spacedim>
   FE_DGP<dim, spacedim>::FE_DGP(const unsigned int degree)
     : FE_Poly<dim, spacedim>(degree, get_dpo_vector_fe_dgp(dim, degree))

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.