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.
*/
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
}
+
template<int dim>
inline unsigned
FESystem<dim>::element_multiplicity(unsigned index) const
}
+
template <int dim>
inline const FiniteElement<dim>&
FESystem<dim>::base_element(unsigned index) const
}
+
template <int dim>
template <class FE>
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,
+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 */
fe_data.n_components * N);
};
+
template <>
FiniteElementData<1>
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
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