*/
static std::vector<bool>
compute_restriction_is_additive_flags (
- const FiniteElement<dim,spacedim> &fe,
- const unsigned int N);
-
- /**
- * Same as above for mixed elements
- * with two different sub-elements.
- */
- static std::vector<bool>
- compute_restriction_is_additive_flags (
- const FiniteElement<dim,spacedim> &fe1,
- const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2);
-
- /**
- * Same as above for mixed elements
- * with three different sub-elements.
- */
- static std::vector<bool>
- compute_restriction_is_additive_flags (
- const FiniteElement<dim,spacedim> &fe1,
- const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2,
- const FiniteElement<dim,spacedim> &fe3,
- const unsigned int N3);
-
- /**
- * with four different sub-elements
- */
- static std::vector<bool>
- compute_restriction_is_additive_flags (
- const FiniteElement<dim,spacedim> &fe1,
- const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2,
- const FiniteElement<dim,spacedim> &fe3,
- const unsigned int N3,
- const FiniteElement<dim,spacedim> &fe4,
- const unsigned int N4);
-
- /**
- * and with five different sub-elements
- */
- static std::vector<bool>
- compute_restriction_is_additive_flags (
- const FiniteElement<dim,spacedim> &fe1,
+ const FiniteElement<dim,spacedim> *fe1,
const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2,
- const FiniteElement<dim,spacedim> &fe3,
- const unsigned int N3,
- const FiniteElement<dim,spacedim> &fe4,
- const unsigned int N4,
- const FiniteElement<dim,spacedim> &fe5,
- const unsigned int N5);
+ const FiniteElement<dim,spacedim> *fe2=NULL,
+ const unsigned int N2=0,
+ const FiniteElement<dim,spacedim> *fe3=NULL,
+ const unsigned int N3=0,
+ const FiniteElement<dim,spacedim> *fe4=NULL,
+ const unsigned int N4=0,
+ const FiniteElement<dim,spacedim> *fe5=NULL,
+ const unsigned int N5=0);
/**
* Compute the named flags for a
FESystem<dim,spacedim>::FESystem (const FiniteElement<dim,spacedim> &fe,
const unsigned int n_elements) :
FiniteElement<dim,spacedim> (multiply_dof_numbers(&fe, n_elements),
- compute_restriction_is_additive_flags (fe, n_elements),
+ compute_restriction_is_additive_flags (&fe, n_elements),
compute_nonzero_components(fe, n_elements)),
base_elements((n_elements>0))
{
const FiniteElement<dim,spacedim> &fe2,
const unsigned int n2) :
FiniteElement<dim,spacedim> (multiply_dof_numbers(&fe1, n1, &fe2, n2),
- compute_restriction_is_additive_flags (fe1, n1,
- fe2, n2),
+ compute_restriction_is_additive_flags (&fe1, n1,
+ &fe2, n2),
compute_nonzero_components(fe1, n1,
fe2, n2)),
base_elements((n1>0)+(n2>0))
FiniteElement<dim,spacedim> (multiply_dof_numbers(&fe1, n1,
&fe2, n2,
&fe3, n3),
- compute_restriction_is_additive_flags (fe1, n1,
- fe2, n2,
- fe3, n3),
+ compute_restriction_is_additive_flags (&fe1, n1,
+ &fe2, n2,
+ &fe3, n3),
compute_nonzero_components(fe1, n1,
fe2, n2,
fe3, n3)),
&fe2, n2,
&fe3, n3,
&fe4, n4),
- compute_restriction_is_additive_flags (fe1, n1,
- fe2, n2,
- fe3, n3,
- fe4, n4),
+ compute_restriction_is_additive_flags (&fe1, n1,
+ &fe2, n2,
+ &fe3, n3,
+ &fe4, n4),
compute_nonzero_components(fe1, n1,
fe2, n2,
fe3, n3,
&fe3, n3,
&fe4, n4,
&fe5, n5),
- compute_restriction_is_additive_flags (fe1, n1,
- fe2, n2,
- fe3, n3,
- fe4, n4,
- fe5, n5),
+ compute_restriction_is_additive_flags (&fe1, n1,
+ &fe2, n2,
+ &fe3, n3,
+ &fe4, n4,
+ &fe5, n5),
compute_nonzero_components(fe1, n1,
fe2, n2,
fe3, n3,
template <int dim, int spacedim>
std::vector<bool>
-FESystem<dim,spacedim>::compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> &fe,
- const unsigned int n_elements)
-{
- std::vector<const FiniteElement<dim,spacedim>*> fe_list;
- std::vector<unsigned int> multiplicities;
-
- fe_list.push_back (&fe);
- multiplicities.push_back (n_elements);
-
- return compute_restriction_is_additive_flags (fe_list, multiplicities);
-}
-
-
-
-template <int dim, int spacedim>
-std::vector<bool>
-FESystem<dim,spacedim>::compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> &fe1,
- const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2)
-{
- std::vector<const FiniteElement<dim,spacedim>*> fe_list;
- std::vector<unsigned int> multiplicities;
-
- fe_list.push_back (&fe1);
- multiplicities.push_back (N1);
-
- fe_list.push_back (&fe2);
- multiplicities.push_back (N2);
-
- return compute_restriction_is_additive_flags (fe_list, multiplicities);
-}
-
-
-
-template <int dim, int spacedim>
-std::vector<bool>
-FESystem<dim,spacedim>::compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> &fe1,
- const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2,
- const FiniteElement<dim,spacedim> &fe3,
- const unsigned int N3)
-{
- std::vector<const FiniteElement<dim,spacedim>*> fe_list;
- std::vector<unsigned int> multiplicities;
-
- fe_list.push_back (&fe1);
- multiplicities.push_back (N1);
-
- fe_list.push_back (&fe2);
- multiplicities.push_back (N2);
-
- fe_list.push_back (&fe3);
- multiplicities.push_back (N3);
-
- return compute_restriction_is_additive_flags (fe_list, multiplicities);
-}
-
-
-template <int dim, int spacedim>
-std::vector<bool>
-FESystem<dim,spacedim>::compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> &fe1,
+FESystem<dim,spacedim>::compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> *fe1,
const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
+ const FiniteElement<dim,spacedim> *fe2,
const unsigned int N2,
- const FiniteElement<dim,spacedim> &fe3,
+ const FiniteElement<dim,spacedim> *fe3,
const unsigned int N3,
- const FiniteElement<dim,spacedim> &fe4,
- const unsigned int N4)
-{
- std::vector<const FiniteElement<dim,spacedim>*> fe_list;
- std::vector<unsigned int> multiplicities;
-
- fe_list.push_back (&fe1);
- multiplicities.push_back (N1);
-
- fe_list.push_back (&fe2);
- multiplicities.push_back (N2);
-
- fe_list.push_back (&fe3);
- multiplicities.push_back (N3);
-
- fe_list.push_back (&fe4);
- multiplicities.push_back (N4);
-
- return compute_restriction_is_additive_flags (fe_list, multiplicities);
-}
-
-
-template <int dim, int spacedim>
-std::vector<bool>
-FESystem<dim,spacedim>::compute_restriction_is_additive_flags (const FiniteElement<dim,spacedim> &fe1,
- const unsigned int N1,
- const FiniteElement<dim,spacedim> &fe2,
- const unsigned int N2,
- const FiniteElement<dim,spacedim> &fe3,
- const unsigned int N3,
- const FiniteElement<dim,spacedim> &fe4,
+ const FiniteElement<dim,spacedim> *fe4,
const unsigned int N4,
- const FiniteElement<dim,spacedim> &fe5,
+ const FiniteElement<dim,spacedim> *fe5,
const unsigned int N5)
{
std::vector<const FiniteElement<dim,spacedim>*> fe_list;
std::vector<unsigned int> multiplicities;
- fe_list.push_back (&fe1);
+ fe_list.push_back (fe1);
multiplicities.push_back (N1);
- fe_list.push_back (&fe2);
+ fe_list.push_back (fe2);
multiplicities.push_back (N2);
- fe_list.push_back (&fe3);
+ fe_list.push_back (fe3);
multiplicities.push_back (N3);
- fe_list.push_back (&fe4);
+ fe_list.push_back (fe4);
multiplicities.push_back (N4);
- fe_list.push_back (&fe5);
+ fe_list.push_back (fe5);
multiplicities.push_back (N5);
return compute_restriction_is_additive_flags (fe_list, multiplicities);
}
// from the given FEs
unsigned int n_shape_functions = 0;
for (unsigned int i=0; i<fes.size(); ++i)
- n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i];
+ if (multiplicities[i]>0) // check needed as fe might be NULL
+ n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i];
// generate the array that will
// hold the output