From 3ec080315814846c5e87d722b523271f6ac6a587 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 2 Sep 2006 23:25:48 +0000 Subject: [PATCH] Implement hp identities for the DGQ element git-svn-id: https://svn.dealii.org/trunk@13801 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_dgq.h | 81 +++++++++++++++++++++++++++++ deal.II/deal.II/source/fe/fe_dgq.cc | 57 ++++++++++++++++++++ 2 files changed, 138 insertions(+) diff --git a/deal.II/deal.II/include/fe/fe_dgq.h b/deal.II/deal.II/include/fe/fe_dgq.h index 2eeca8b1ed..112dc39c82 100644 --- a/deal.II/deal.II/include/fe/fe_dgq.h +++ b/deal.II/deal.II/include/fe/fe_dgq.h @@ -173,6 +173,83 @@ class FE_DGQ : public FE_Poly,dim> const unsigned int subface, FullMatrix &matrix) const; + /** + * @name Functions to support hp + * @{ + */ + + /** + * If, on a vertex, several + * finite elements are active, + * the hp code first assigns the + * degrees of freedom of each of + * these FEs different global + * indices. It then calls this + * function to find out which of + * them should get identical + * values, and consequently can + * receive the same global DoF + * index. This function therefore + * returns a list of identities + * between DoFs of the present + * finite element object with the + * DoFs of @p fe_other, which is + * a reference to a finite + * element object representing + * one of the other finite + * elements active on this + * particular vertex. The + * function computes which of the + * degrees of freedom of the two + * finite element objects are + * equivalent, and returns a list + * of pairs of global dof indices + * in @p identities. The first + * index of each pair denotes one + * of the vertex dofs of the + * present element, whereas the + * second is the corresponding + * index of the other finite + * element. + * + * This being a discontinuous element, + * the set of such constraints is of + * course empty. + */ + virtual + std::vector > + hp_vertex_dof_identities (const FiniteElement &fe_other) const; + + /** + * Same as + * hp_vertex_dof_indices(), + * except that the function + * treats degrees of freedom on + * lines. + * + * This being a discontinuous element, + * the set of such constraints is of + * course empty. + */ + virtual + std::vector > + hp_line_dof_identities (const FiniteElement &fe_other) const; + + /** + * Same as + * hp_vertex_dof_indices(), + * except that the function + * treats degrees of freedom on + * quads. + * + * This being a discontinuous element, + * the set of such constraints is of + * course empty. + */ + virtual + std::vector > + hp_quad_dof_identities (const FiniteElement &fe_other) const; + /** * Return whether this element * implements its hanging node @@ -202,6 +279,10 @@ class FE_DGQ : public FE_Poly,dim> FiniteElementDomination::Domination compare_for_domination (const FiniteElement &fe_other) const; + /** + * @} + */ + /** * Check for non-zero values on a face. * diff --git a/deal.II/deal.II/source/fe/fe_dgq.cc b/deal.II/deal.II/source/fe/fe_dgq.cc index 8dd3b05ded..42b433651c 100644 --- a/deal.II/deal.II/source/fe/fe_dgq.cc +++ b/deal.II/deal.II/source/fe/fe_dgq.cc @@ -492,6 +492,63 @@ FE_DGQ::hp_constraints_are_implemented () const +template +std::vector > +FE_DGQ:: +hp_vertex_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGQ + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGQ:: +hp_line_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGQ + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGQ:: +hp_quad_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGQ + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + template FiniteElementDomination::Domination FE_DGQ::compare_for_domination (const FiniteElement &fe_other) const -- 2.39.5