From edf3f3b0b9a9d2d2a8b19050f9cabc9e43fa64fe Mon Sep 17 00:00:00 2001 From: guido Date: Mon, 15 Feb 1999 16:23:07 +0000 Subject: [PATCH] constructor for mixed elements git-svn-id: https://svn.dealii.org/trunk@802 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_system.h | 41 ++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index df5fa8cbce..5a5beaabf8 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -63,7 +63,7 @@ * function) to the respective component of the finite element, without interaction * of the different components. * - * @author Wolfgang Bangerth, 1999 + * @author Wolfgang Bangerth, Guido Kanschat, 1999 */ template class FESystem : public FiniteElement @@ -95,9 +95,20 @@ class FESystem : public FiniteElement * class needs to be of the same dimension * as is this object. */ - template + template FESystem (const FE &fe, const unsigned int n_elements); + /** + * Constructor for mixed + * discretizations with two + * components. + * + * See the other constructor. + */ + template + FESystem (const FE1 &fe1, const unsigned int n1, + const FE2 &fe2, const unsigned int n2); + /** * Destructor. */ @@ -377,6 +388,15 @@ class FESystem : public FiniteElement multiply_dof_numbers (const FiniteElementData &fe_data, const unsigned int N); + /** + * Same as above for mixed elements. + */ + static FiniteElementData + multiply_dof_numbers (const FiniteElementData &fe1, + const unsigned int N1, + const FiniteElementData &fe2, + const unsigned int N2); + /** * This function is simply singled out of * the constructor. It sets up the @@ -429,8 +449,23 @@ FESystem::FESystem (const FE &fe, const unsigned int n_elements) : FiniteElement (multiply_dof_numbers(fe, n_elements)), base_elements(1) { - base_elements[0] = ElementPair(&fe, n_elements); + base_elements[0] = ElementPair(new FE, n_elements); + base_elements[0].first -> subscribe (); + initialize (); +}; + +template +template +FESystem::FESystem (const FE1 &fe1, const unsigned int n1, + const FE2 &fe2, const unsigned int n2) + : + FiniteElement (multiply_dof_numbers(fe1, n1, fe2, n2)), + base_elements(2) +{ + base_elements[0] = ElementPair(new FE1, n1); base_elements[0].first -> subscribe (); + base_elements[1] = ElementPair(new FE2, n2); + base_elements[1].first -> subscribe (); initialize (); }; -- 2.39.5