From 5d0540d262d59021d12af28275a01d2a31030f52 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 3 Sep 2006 00:10:40 +0000 Subject: [PATCH] Implement hp identities for the DGP* element git-svn-id: https://svn.dealii.org/trunk@13807 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_dgp.h | 81 +++++++++++++++++++ deal.II/deal.II/include/fe/fe_dgp_monomial.h | 81 +++++++++++++++++++ .../deal.II/include/fe/fe_dgp_nonparametric.h | 81 +++++++++++++++++++ deal.II/deal.II/source/fe/fe_dgp.cc | 57 +++++++++++++ deal.II/deal.II/source/fe/fe_dgp_monomial.cc | 57 +++++++++++++ .../deal.II/source/fe/fe_dgp_nonparametric.cc | 57 +++++++++++++ 6 files changed, 414 insertions(+) diff --git a/deal.II/deal.II/include/fe/fe_dgp.h b/deal.II/deal.II/include/fe/fe_dgp.h index d790e9689d..1e9385d3ec 100644 --- a/deal.II/deal.II/include/fe/fe_dgp.h +++ b/deal.II/deal.II/include/fe/fe_dgp.h @@ -101,6 +101,83 @@ class FE_DGP : public FE_Poly,dim> */ virtual std::string get_name () 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 @@ -130,6 +207,10 @@ class FE_DGP : public FE_Poly,dim> FiniteElementDomination::Domination compare_for_domination (const FiniteElement &fe_other) const; + /** + * @} + */ + /** * Return the matrix * interpolating from a face of diff --git a/deal.II/deal.II/include/fe/fe_dgp_monomial.h b/deal.II/deal.II/include/fe/fe_dgp_monomial.h index e27bb6826c..cabf430e63 100644 --- a/deal.II/deal.II/include/fe/fe_dgp_monomial.h +++ b/deal.II/deal.II/include/fe/fe_dgp_monomial.h @@ -101,6 +101,83 @@ class FE_DGPMonomial : public FE_Poly,dim> */ virtual std::string get_name () 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 @@ -131,6 +208,10 @@ class FE_DGPMonomial : public FE_Poly,dim> FiniteElementDomination::Domination compare_for_domination (const FiniteElement &fe_other) const; + /** + * @} + */ + /** * Return the matrix * interpolating from the given diff --git a/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h b/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h index 01a79fb166..260ebc4bea 100644 --- a/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h +++ b/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h @@ -256,6 +256,83 @@ class FE_DGPNonparametric : public FiniteElement 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 @@ -286,6 +363,10 @@ class FE_DGPNonparametric : public FiniteElement 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_dgp.cc b/deal.II/deal.II/source/fe/fe_dgp.cc index 7d264e6734..bc3945796e 100644 --- a/deal.II/deal.II/source/fe/fe_dgp.cc +++ b/deal.II/deal.II/source/fe/fe_dgp.cc @@ -155,6 +155,63 @@ FE_DGP::hp_constraints_are_implemented () const +template +std::vector > +FE_DGP:: +hp_vertex_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGP + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGP:: +hp_line_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGP + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGP:: +hp_quad_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGP + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + template FiniteElementDomination::Domination FE_DGP::compare_for_domination (const FiniteElement &fe_other) const diff --git a/deal.II/deal.II/source/fe/fe_dgp_monomial.cc b/deal.II/deal.II/source/fe/fe_dgp_monomial.cc index b0c3245d71..c5950e0e16 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_monomial.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_monomial.cc @@ -316,6 +316,63 @@ FE_DGPMonomial::hp_constraints_are_implemented () const +template +std::vector > +FE_DGPMonomial:: +hp_vertex_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGPMonomial + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGPMonomial:: +hp_line_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGPMonomial + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGPMonomial:: +hp_quad_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGPMonomial + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + template FiniteElementDomination::Domination FE_DGPMonomial:: diff --git a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc index 1d98ec84ad..4050ac8d26 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc @@ -485,6 +485,63 @@ FE_DGPNonparametric::hp_constraints_are_implemented () const +template +std::vector > +FE_DGPNonparametric:: +hp_vertex_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGPNonparametric + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGPNonparametric:: +hp_line_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGPNonparametric + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + +template +std::vector > +FE_DGPNonparametric:: +hp_quad_dof_identities (const FiniteElement &fe_other) const +{ + // there are no such constraints for DGPNonparametric + // elements at all + if (dynamic_cast*>(&fe_other) != 0) + return + std::vector > (); + else + { + Assert (false, ExcNotImplemented()); + return std::vector > (); + } +} + + + template FiniteElementDomination::Domination FE_DGPNonparametric:: -- 2.39.5