]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add constructors and other functions for FESystem with three different sub-elements.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 23 Mar 1999 12:26:19 +0000 (12:26 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 23 Mar 1999 12:26:19 +0000 (12:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@1034 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_system.h
deal.II/deal.II/source/fe/fe_system.cc

index 8d6d5d385926c2c3419ad5e2df0f0586127520f2..98d77ad4a11710564557fe1fc8356697e73ef6c7 100644 (file)
@@ -112,6 +112,18 @@ class FESystem //<dim>
     FESystem (const FE1 &fe1, const unsigned int n1,
              const FE2 &fe2, const unsigned int n2);
 
+                                    /** 
+                                     * Constructor for mixed
+                                     * discretizations with three
+                                     * base elements.
+                                     *
+                                     * See the other constructor.
+                                     */
+    template <class FE1, class FE2, class FE3>
+    FESystem (const FE1 &fe1, const unsigned int n1,
+             const FE2 &fe2, const unsigned int n2,
+             const FE3 &fe3, const unsigned int n3);
+
                                     /**
                                      * Destructor.
                                      */
@@ -423,14 +435,27 @@ class FESystem //<dim>
                          const unsigned int            N);
     
                                     /**
-                                     * Same as above for mixed elements.
+                                     * Same as above for mixed elements
+                                     * with two different sub-elements.
                                      */
     static FiniteElementData<dim>
     multiply_dof_numbers (const FiniteElementData<dim> &fe1,
                          const unsigned int            N1,
                          const FiniteElementData<dim> &fe2,
                          const unsigned int            N2);
-    
+
+                                    /**
+                                     * Same as above for mixed elements
+                                     * with three different sub-elements.
+                                     */
+    static FiniteElementData<dim>
+    multiply_dof_numbers (const FiniteElementData<dim> &fe1,
+                         const unsigned int            N1,
+                         const FiniteElementData<dim> &fe2,
+                         const unsigned int            N2,
+                         const FiniteElementData<dim> &fe3,
+                         const unsigned int            N3);
+
                                     /**
                                      * This function is simply singled out of
                                      * the constructor. It sets up the
@@ -476,6 +501,7 @@ FESystem<dim>::n_base_elements() const
 }
 
 
+
 template<int dim>
 inline unsigned
 FESystem<dim>::element_multiplicity(unsigned index) const
@@ -484,6 +510,7 @@ FESystem<dim>::element_multiplicity(unsigned index) const
 }
 
 
+
 template <int dim>
 inline const FiniteElement<dim>&
 FESystem<dim>::base_element(unsigned index) const
@@ -492,6 +519,7 @@ FESystem<dim>::base_element(unsigned index) const
 }
 
 
+
 template <int dim>
 template <class FE>
 FESystem<dim>::FESystem (const FE &fe, const unsigned int n_elements) :
@@ -504,6 +532,8 @@ FESystem<dim>::FESystem (const FE &fe, const unsigned int n_elements) :
   initialize ();
 };
 
+
+
 template <int dim>
 template <class FE1, class FE2>
 FESystem<dim>::FESystem (const FE1 &fe1, const unsigned int n1,
@@ -525,6 +555,34 @@ FESystem<dim>::FESystem (const FE1 &fe1, const unsigned int n1,
 
 
 
+template <int dim>
+template <class FE1, class FE2, class FE3>
+FESystem<dim>::FESystem (const FE1 &fe1, const unsigned int n1,
+                        const FE2 &fe2, const unsigned int n2,
+                        const FE3 &fe3, const unsigned int n3)
+               :
+               FiniteElement (multiply_dof_numbers(fe1, n1,
+                                                   fe2, n2,
+                                                   fe3, n3)),
+               base_elements(3),
+               component_to_base_table(n_components)
+{
+  Assert(fe1.n_transform_functions == fe2.n_transform_functions,
+        ExcElementTransformNotEqual());
+  Assert(fe1.n_transform_functions == fe3.n_transform_functions,
+        ExcElementTransformNotEqual());
+  
+  base_elements[0] = ElementPair(new FE1, n1);
+  base_elements[0].first -> subscribe ();
+  base_elements[1] = ElementPair(new FE2, n2);
+  base_elements[1].first -> subscribe ();
+  base_elements[2] = ElementPair(new FE3, n3);
+  base_elements[2].first -> subscribe ();
+  initialize ();
+};
+
+
+
 
 /*----------------------------  fe_lib.system.h  ---------------------------*/
 /* end of #ifndef __fe_system_H */
index c7cbb58a4863f7af2f725a0c57c3b4f21b04e795..20c0b9c5d5b92bed1bae49a955a180e219edb7cd 100644 (file)
@@ -301,6 +301,7 @@ FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe_data,
                               fe_data.n_components * N);
 };
 
+
 template <>
 FiniteElementData<1>
 FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe1,
@@ -314,6 +315,28 @@ FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe1,
                               fe1.n_components * N1 + fe2.n_components * N2 );
 };
 
+
+template <>
+FiniteElementData<1>
+FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe1,
+                                  const unsigned int          N1,
+                                  const FiniteElementData<1> &fe2,
+                                  const unsigned int          N2,
+                                  const FiniteElementData<1> &fe3,
+                                  const unsigned int          N3)
+{
+  return FiniteElementData<1> (fe1.dofs_per_vertex * N1
+                              + fe2.dofs_per_vertex * N2
+                              + fe3.dofs_per_vertex * N3,
+                              fe1.dofs_per_line * N1
+                              + fe2.dofs_per_line * N2
+                              + fe3.dofs_per_line * N3,
+                              fe1.n_transform_functions,
+                              fe1.n_components * N1
+                              + fe2.n_components * N2
+                              + fe3.n_components * N3);
+};
+
 #endif
 
 
@@ -345,6 +368,31 @@ FESystem<2>::multiply_dof_numbers (const FiniteElementData<2> &fe1,
                               fe1.n_components * N1 + fe2.n_components * N2 );
 };
 
+
+template <>
+FiniteElementData<2>
+FESystem<2>::multiply_dof_numbers (const FiniteElementData<2> &fe1,
+                                  const unsigned int          N1,
+                                  const FiniteElementData<2> &fe2,
+                                  const unsigned int          N2,
+                                  const FiniteElementData<2> &fe3,
+                                  const unsigned int          N3)
+{
+  return FiniteElementData<2> (fe1.dofs_per_vertex * N1
+                              + fe2.dofs_per_vertex * N2
+                              + fe3.dofs_per_vertex * N3 ,
+                              fe1.dofs_per_line * N1
+                              + fe2.dofs_per_line * N2
+                              + fe3.dofs_per_line * N3 ,
+                              fe1.dofs_per_quad * N1
+                              + fe2.dofs_per_quad * N2
+                              + fe3.dofs_per_quad * N3 ,
+                              fe1.n_transform_functions,
+                              fe1.n_components * N1
+                              + fe2.n_components * N2
+                              + fe3.n_components * N3 );
+};
+
 #endif
 
 

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.