From: wolf Date: Thu, 17 Oct 2002 15:29:25 +0000 (+0000) Subject: Make element_multiplicity a function that is available from the FE base class, instea... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d1f9aadd4d03cfa92f45b718f892a36630326cf;p=dealii-svn.git Make element_multiplicity a function that is available from the FE base class, instead of only the FESystem class. git-svn-id: https://svn.dealii.org/trunk@6673 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index 98b2a7a8fa..f831045315 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -105,8 +105,24 @@ class FiniteElement : public FiniteElementBase * @p{base_element(0)} is * @p{this}. */ - virtual const FiniteElement & base_element (const unsigned int index) const = 0; + virtual + const FiniteElement & + base_element (const unsigned int index) const = 0; + /** + * This index denotes how often + * the base element @p{index} is + * used in a composed element. If + * the element is scalar, then + * the result is always equal to + * one. See the documentation for + * the @p{n_base_elements} + * function for more details. + */ + virtual + unsigned int + element_multiplicity (const unsigned int index) const = 0; + /** * Check for non-zero values on a face. * diff --git a/deal.II/deal.II/include/fe/fe_dgp.h b/deal.II/deal.II/include/fe/fe_dgp.h index 0c5ff41240..3ea1c2761b 100644 --- a/deal.II/deal.II/include/fe/fe_dgp.h +++ b/deal.II/deal.II/include/fe/fe_dgp.h @@ -168,7 +168,18 @@ class FE_DGP : public FiniteElement * @p{this}, and all other * indices throw an error. */ - virtual const FiniteElement & base_element (const unsigned int index) const; + virtual const FiniteElement & + base_element (const unsigned int index) const; + + /** + * Multiplicity of base element + * @p{index}. Since this is a + * scalar element, + * @p{element_multiplicity(0)} + * returns one, and all other + * indices will throw an error. + */ + virtual unsigned int element_multiplicity (const unsigned int index); /** * Check for non-zero values on a face. 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 e8de069edd..58696250a9 100644 --- a/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h +++ b/deal.II/deal.II/include/fe/fe_dgp_nonparametric.h @@ -178,7 +178,18 @@ class FE_DGPNonparametric : public FiniteElement * @p{this}, and all other * indices throw an error. */ - virtual const FiniteElement & base_element (const unsigned int index) const; + virtual const FiniteElement & + base_element (const unsigned int index) const; + + /** + * Multiplicity of base element + * @p{index}. Since this is a + * scalar element, + * @p{element_multiplicity(0)} + * returns one, and all other + * indices will throw an error. + */ + virtual unsigned int element_multiplicity (const unsigned int index); /** * Check for non-zero values on a face. diff --git a/deal.II/deal.II/include/fe/fe_dgq.h b/deal.II/deal.II/include/fe/fe_dgq.h index fce607f6ca..99d91998f7 100644 --- a/deal.II/deal.II/include/fe/fe_dgq.h +++ b/deal.II/deal.II/include/fe/fe_dgq.h @@ -168,7 +168,18 @@ class FE_DGQ : public FiniteElement * @p{this}, and all other * indices throw an error. */ - virtual const FiniteElement & base_element (const unsigned int index) const; + virtual const FiniteElement & + base_element (const unsigned int index) const; + + /** + * Multiplicity of base element + * @p{index}. Since this is a + * scalar element, + * @p{element_multiplicity(0)} + * returns one, and all other + * indices will throw an error. + */ + virtual unsigned int element_multiplicity (const unsigned int index); /** * Check for non-zero values on a face. diff --git a/deal.II/deal.II/include/fe/fe_nedelec.h b/deal.II/deal.II/include/fe/fe_nedelec.h index 2772a06758..a909a4c35b 100644 --- a/deal.II/deal.II/include/fe/fe_nedelec.h +++ b/deal.II/deal.II/include/fe/fe_nedelec.h @@ -252,7 +252,18 @@ class FE_Nedelec : public FiniteElement * @p{this}, and all other * indices throw an error. */ - virtual const FiniteElement & base_element (const unsigned int index) const; + virtual const FiniteElement & + base_element (const unsigned int index) const; + + /** + * Multiplicity of base element + * @p{index}. Since this is an + * atomic element, + * @p{element_multiplicity(0)} + * returns one, and all other + * indices will throw an error. + */ + virtual unsigned int element_multiplicity (const unsigned int index); /** * This function returns diff --git a/deal.II/deal.II/include/fe/fe_q.h b/deal.II/deal.II/include/fe/fe_q.h index c70c0fb9ed..5b821b303f 100644 --- a/deal.II/deal.II/include/fe/fe_q.h +++ b/deal.II/deal.II/include/fe/fe_q.h @@ -372,7 +372,18 @@ class FE_Q : public FiniteElement * @p{this}, and all other * indices throw an error. */ - virtual const FiniteElement & base_element (const unsigned int index) const; + virtual const FiniteElement & + base_element (const unsigned int index) const; + + /** + * Multiplicity of base element + * @p{index}. Since this is a + * scalar element, + * @p{element_multiplicity(0)} + * returns one, and all other + * indices will throw an error. + */ + virtual unsigned int element_multiplicity (const unsigned int index); /** * Check for non-zero values on a face. diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index 1247420c46..2d01d61b33 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -294,7 +294,7 @@ class FESystem : public FiniteElement * How often is a composing * element used. */ - unsigned int element_multiplicity (const unsigned int index) const; + virtual unsigned int element_multiplicity (const unsigned int index) const; /** * Access to a composing @@ -799,19 +799,6 @@ class FESystem : public FiniteElement template <> void FESystem<1>::initialize_unit_face_support_points (); -/* ------------------------- inline functions ------------------------- */ - - -template -inline unsigned int -FESystem::element_multiplicity (const unsigned int index) const -{ - Assert (index < base_elements.size(), - ExcIndexRange(index, 0, base_elements.size())); - return base_elements[index].second; -}; - - /*---------------------------- fe_system.h ---------------------------*/ #endif diff --git a/deal.II/deal.II/source/fe/fe_dgp.cc b/deal.II/deal.II/source/fe/fe_dgp.cc index 8d6e8f4540..b95d42aade 100644 --- a/deal.II/deal.II/source/fe/fe_dgp.cc +++ b/deal.II/deal.II/source/fe/fe_dgp.cc @@ -444,6 +444,16 @@ FE_DGP::base_element (const unsigned int index) const +template +unsigned int +FE_DGP::element_multiplicity (const unsigned int index) const +{ + Assert (index==0, ExcIndexRange(index, 0, 1)); + return 1; +}; + + + template bool FE_DGP::has_support_on_face (const unsigned int, 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 b6367ac44b..11fd8f9586 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc @@ -395,6 +395,16 @@ FE_DGPNonparametric::base_element (const unsigned int index) const +template +unsigned int +FE_DGPNonparametric::element_multiplicity (const unsigned int index) const +{ + Assert (index==0, ExcIndexRange(index, 0, 1)); + return 1; +}; + + + template bool FE_DGPNonparametric::has_support_on_face (const unsigned int, diff --git a/deal.II/deal.II/source/fe/fe_nedelec.cc b/deal.II/deal.II/source/fe/fe_nedelec.cc index 079b01e0f1..e4cb312847 100644 --- a/deal.II/deal.II/source/fe/fe_nedelec.cc +++ b/deal.II/deal.II/source/fe/fe_nedelec.cc @@ -1251,6 +1251,16 @@ FE_Nedelec::base_element (const unsigned int index) const +template +unsigned int +FE_Nedelec::element_multiplicity (const unsigned int index) const +{ + Assert (index==0, ExcIndexRange(index, 0, 1)); + return 1; +}; + + + template bool FE_Nedelec::has_support_on_face (const unsigned int shape_index, diff --git a/deal.II/deal.II/source/fe/fe_q.cc b/deal.II/deal.II/source/fe/fe_q.cc index 6bcdfbbf19..9a7e53f687 100644 --- a/deal.II/deal.II/source/fe/fe_q.cc +++ b/deal.II/deal.II/source/fe/fe_q.cc @@ -1324,6 +1324,16 @@ FE_Q::base_element (const unsigned int index) const +template +unsigned int +FE_Q::element_multiplicity (const unsigned int index) const +{ + Assert (index==0, ExcIndexRange(index, 0, 1)); + return 1; +}; + + + template bool FE_Q::has_support_on_face (const unsigned int shape_index_, diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 4b23850bf9..a4f2e49aaa 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -2197,6 +2197,18 @@ FESystem::n_base_elements () const }; + +template +unsigned int +FESystem::element_multiplicity (const unsigned int index) const +{ + Assert (index < base_elements.size(), + ExcIndexRange(index, 0, base_elements.size())); + return base_elements[index].second; +}; + + + template bool FESystem::has_support_on_face (const unsigned int shape_index,