]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make element_multiplicity a function that is available from the FE base class, instea...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Oct 2002 15:29:25 +0000 (15:29 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Oct 2002 15:29:25 +0000 (15:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@6673 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/deal.II/include/fe/fe.h
deal.II/deal.II/include/fe/fe_dgp.h
deal.II/deal.II/include/fe/fe_dgp_nonparametric.h
deal.II/deal.II/include/fe/fe_dgq.h
deal.II/deal.II/include/fe/fe_nedelec.h
deal.II/deal.II/include/fe/fe_q.h
deal.II/deal.II/include/fe/fe_system.h
deal.II/deal.II/source/fe/fe_dgp.cc
deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc
deal.II/deal.II/source/fe/fe_nedelec.cc
deal.II/deal.II/source/fe/fe_q.cc
deal.II/deal.II/source/fe/fe_system.cc

index 98b2a7a8fa1d43d218b4eb7eaa1e458b20c8990b..f831045315525bfcd980c33a47ef9b2c41375106 100644 (file)
@@ -105,8 +105,24 @@ class FiniteElement : public FiniteElementBase<dim>
                                      * @p{base_element(0)} is
                                      * @p{this}.
                                      */
-    virtual const FiniteElement<dim> & base_element (const unsigned int index) const = 0;
+    virtual
+    const FiniteElement<dim> &
+    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.
                                      *
index 0c5ff412405be4cd2b71ae523e64c112755ccffe..3ea1c2761b131174c987a5a83b110cb7372ad38a 100644 (file)
@@ -168,7 +168,18 @@ class FE_DGP : public FiniteElement<dim>
                                      * @p{this}, and all other
                                      * indices throw an error.
                                      */
-    virtual const FiniteElement<dim> & base_element (const unsigned int index) const;
+    virtual const FiniteElement<dim> &
+    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.
index e8de069edd8b12f013d4c7cc0d4519f2aebe629c..58696250a9d2cca07c201817bfd80b71d90d8a6c 100644 (file)
@@ -178,7 +178,18 @@ class FE_DGPNonparametric : public FiniteElement<dim>
                                      * @p{this}, and all other
                                      * indices throw an error.
                                      */
-    virtual const FiniteElement<dim> & base_element (const unsigned int index) const;
+    virtual const FiniteElement<dim> &
+    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.
index fce607f6cab9ed889a47ad3ffd4e7b2c3dbb315a..99d91998f7fc092587eea1e33174104055929b68 100644 (file)
@@ -168,7 +168,18 @@ class FE_DGQ : public FiniteElement<dim>
                                      * @p{this}, and all other
                                      * indices throw an error.
                                      */
-    virtual const FiniteElement<dim> & base_element (const unsigned int index) const;
+    virtual const FiniteElement<dim> &
+    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.
index 2772a06758b870c7a2dbb0f07e619bb5c4e53d97..a909a4c35b0fdbd7cd6e057697d282ba7288313d 100644 (file)
@@ -252,7 +252,18 @@ class FE_Nedelec : public FiniteElement<dim>
                                      * @p{this}, and all other
                                      * indices throw an error.
                                      */
-    virtual const FiniteElement<dim> & base_element (const unsigned int index) const;
+    virtual const FiniteElement<dim> &
+    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
index c70c0fb9eded705b0467be2b14ba4b3fd97c6146..5b821b303f347a8251a5cb9e272caa5cbee10a3d 100644 (file)
@@ -372,7 +372,18 @@ class FE_Q : public FiniteElement<dim>
                                      * @p{this}, and all other
                                      * indices throw an error.
                                      */
-    virtual const FiniteElement<dim> & base_element (const unsigned int index) const;
+    virtual const FiniteElement<dim> &
+    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.
index 1247420c46151b9257a04497eb89d6e4599877a7..2d01d61b33c2ec87f06287779ee69603ed561fba 100644 (file)
@@ -294,7 +294,7 @@ class FESystem : public FiniteElement<dim>
                                      * 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<dim>
 template <> void FESystem<1>::initialize_unit_face_support_points ();
 
 
-/* ------------------------- inline functions ------------------------- */
-
-
-template<int dim>
-inline unsigned int
-FESystem<dim>::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
index 8d6e8f4540fa115006372558b4c35167f28cd55e..b95d42aade8d97e0cabbc79c7042cb168e550f89 100644 (file)
@@ -444,6 +444,16 @@ FE_DGP<dim>::base_element (const unsigned int index) const
 
 
 
+template <int dim>
+unsigned int
+FE_DGP<dim>::element_multiplicity (const unsigned int index) const
+{
+  Assert (index==0, ExcIndexRange(index, 0, 1));
+  return 1;
+};
+
+
+
 template <int dim>
 bool
 FE_DGP<dim>::has_support_on_face (const unsigned int,
index b6367ac44b84df57b695889c13d6c9b2c98fb36c..11fd8f9586da714e253d349eecf15e29e87d92cd 100644 (file)
@@ -395,6 +395,16 @@ FE_DGPNonparametric<dim>::base_element (const unsigned int index) const
 
 
 
+template <int dim>
+unsigned int
+FE_DGPNonparametric<dim>::element_multiplicity (const unsigned int index) const
+{
+  Assert (index==0, ExcIndexRange(index, 0, 1));
+  return 1;
+};
+
+
+
 template <int dim>
 bool
 FE_DGPNonparametric<dim>::has_support_on_face (const unsigned int,
index 079b01e0f18bf4bf3bead99b71ccd84c97810e1f..e4cb3128475566ef9e8c64545d9404af91c50fb4 100644 (file)
@@ -1251,6 +1251,16 @@ FE_Nedelec<dim>::base_element (const unsigned int index) const
 
 
 
+template <int dim>
+unsigned int
+FE_Nedelec<dim>::element_multiplicity (const unsigned int index) const
+{
+  Assert (index==0, ExcIndexRange(index, 0, 1));
+  return 1;
+};
+
+
+
 template <int dim>
 bool
 FE_Nedelec<dim>::has_support_on_face (const unsigned int shape_index,
index 6bcdfbbf19c3ee45d5e0a924a85f8b1c4e2112b1..9a7e53f6872be12183d133dd2024c6a218894e0b 100644 (file)
@@ -1324,6 +1324,16 @@ FE_Q<dim>::base_element (const unsigned int index) const
 
 
 
+template <int dim>
+unsigned int
+FE_Q<dim>::element_multiplicity (const unsigned int index) const
+{
+  Assert (index==0, ExcIndexRange(index, 0, 1));
+  return 1;
+};
+
+
+
 template <int dim>
 bool
 FE_Q<dim>::has_support_on_face (const unsigned int shape_index_,
index 4b23850bf9a834a7180f46f8853561a3c3295df5..a4f2e49aaadfd85e99434fdde4150d0aedf15579 100644 (file)
@@ -2197,6 +2197,18 @@ FESystem<dim>::n_base_elements () const
 };
 
 
+
+template<int dim>
+unsigned int
+FESystem<dim>::element_multiplicity (const unsigned int index) const
+{
+  Assert (index < base_elements.size(), 
+         ExcIndexRange(index, 0, base_elements.size()));
+  return base_elements[index].second;
+};
+
+
+
 template <int dim>
 bool
 FESystem<dim>::has_support_on_face (const unsigned int shape_index,

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.