From 4d469a6b45f8b060b1fbaeb06f66a484571cc73b Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 16 Feb 1999 17:31:08 +0000 Subject: [PATCH] Unify the constructors of FiniteElementBase to be a template again. This was not possible before, since the FiniteElementBase classes were divided. git-svn-id: https://svn.dealii.org/trunk@821 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe.cc | 95 +++++++++------------------------ 1 file changed, 25 insertions(+), 70 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc index 90eaa5e2f2..366661276d 100644 --- a/deal.II/deal.II/source/fe/fe.cc +++ b/deal.II/deal.II/source/fe/fe.cc @@ -124,87 +124,44 @@ bool FiniteElementData::operator== (const FiniteElementData &f) const /*------------------------------- FiniteElementBase ----------------------*/ -#if deal_II_dimension == 1 -template <> -FiniteElementBase<1>::FiniteElementBase (const FiniteElementData<1> &fe_data) : - FiniteElementData<1> (fe_data), - system_to_component_table(total_dofs), - component_to_system_table(n_components, vector(total_dofs)) -{ - const unsigned int dim=1; - for (unsigned int i=0; i::children_per_cell; ++i) - { - restriction[i].reinit (total_dofs, total_dofs); - prolongation[i].reinit (total_dofs, total_dofs); - }; - interface_constraints.reinit (1,1); - interface_constraints(0,0)=1.; - // this is the default way, if there is only - // one component; if there are several, then - // the constructor of the derived class needs - // to fill these arrays - for (unsigned int j=0 ; j(0,j); - component_to_system_table[0][j] = j; - } -}; - -#endif - - -#if deal_II_dimension == 2 - -template <> -FiniteElementBase<2>::FiniteElementBase (const FiniteElementData<2> &fe_data) : - FiniteElementData<2> (fe_data), +template +FiniteElementBase::FiniteElementBase (const FiniteElementData &fe_data) : + FiniteElementData (fe_data), system_to_component_table(total_dofs), component_to_system_table(n_components, vector(total_dofs)) { - const unsigned int dim=2; for (unsigned int i=0; i::children_per_cell; ++i) { restriction[i].reinit (total_dofs, total_dofs); prolongation[i].reinit (total_dofs, total_dofs); }; - interface_constraints.reinit (dofs_per_vertex+2*dofs_per_line, - dofs_per_face); - // this is the default way, if there is only - // one component; if there are several, then - // the constructor of the derived class needs - // to fill these arrays - for (unsigned int j=0 ; j(0,j); - component_to_system_table[0][j] = j; - } -}; - -#endif - - - -#if deal_II_dimension == 3 - -template <> -FiniteElementBase<3>::FiniteElementBase (const FiniteElementData<3> &fe_data) : - FiniteElementData<3> (fe_data), - system_to_component_table(total_dofs), - component_to_system_table(n_components, vector(total_dofs)) -{ - const unsigned int dim=3; - for (unsigned int i=0; i::children_per_cell; ++i) - { - restriction[i].reinit (total_dofs, total_dofs); - prolongation[i].reinit (total_dofs, total_dofs); + case 1: + interface_constraints.reinit (1,1); + interface_constraints(0,0)=1.; + break; + + case 2: + interface_constraints.reinit (dofs_per_vertex+2*dofs_per_line, + dofs_per_face); + break; + + case 3: + interface_constraints.reinit (5*dofs_per_vertex + + 12*dofs_per_line + + 4*dofs_per_quad, + dofs_per_face); + break; + + default: + Assert (false, ExcNotImplemented()); }; - interface_constraints.reinit (5*dofs_per_vertex+12*dofs_per_line+4*dofs_per_quad, - dofs_per_face); - - // this is the default way, if there is only + + // this is the default way, if there is only // one component; if there are several, then // the constructor of the derived class needs // to fill these arrays @@ -215,8 +172,6 @@ FiniteElementBase<3>::FiniteElementBase (const FiniteElementData<3> &fe_data) : } }; -#endif - template -- 2.39.5