explicit FECollection (const FiniteElement<dim,spacedim> &fe);
/**
- * Constructor. This constructor creates a FECollection from two finite
- * elements.
+ * Constructor. This constructor creates a FECollection from more than
+ * one finite element.
*/
- FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2);
-
- /**
- * Constructor. This constructor creates a FECollection from three finite
- * elements.
- */
- FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2,
- const FiniteElement<dim,spacedim> &fe3);
-
- /**
- * Constructor. This constructor creates a FECollection from four finite
- * elements.
- */
- FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2,
- const FiniteElement<dim,spacedim> &fe3,
- const FiniteElement<dim,spacedim> &fe4);
-
- /**
- * Constructor. This constructor creates a FECollection from five finite
- * elements.
- */
- FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2,
- const FiniteElement<dim,spacedim> &fe3,
- const FiniteElement<dim,spacedim> &fe4,
- const FiniteElement<dim,spacedim> &fe5);
+ template<class... FETypes>
+ explicit FECollection (const FETypes &... fes);
/**
* Constructor. Same as above but for any number of elements. Pointers to
/**
* Copy constructor.
*/
- FECollection (const FECollection<dim,spacedim> &fe_collection);
+ FECollection (const FECollection<dim,spacedim> &fe_collection) = default;
+
+ /**
+ * Move constructor.
+ */
+ FECollection (FECollection<dim,spacedim> &&fe_collection) = default;
+
+ /**
+ * Move assignement operator.
+ */
+ FECollection<dim, spacedim> &
+ operator= (FECollection<dim,spacedim> &&fe_collection) = default;
/**
* Add a finite element. This function generates a copy of the given
/* --------------- inline functions ------------------- */
+ template <int dim, int spacedim>
+ template <class... FETypes>
+ FECollection<dim,spacedim>::FECollection (const FETypes &... fes)
+ {
+ [](...) {}((push_back(fes),0)...);
+ }
+
+
template <int dim, int spacedim>
inline
unsigned int
- template <int dim, int spacedim>
- FECollection<dim,spacedim>::FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2)
- {
- push_back(fe1);
- push_back(fe2);
- }
-
-
-
- template <int dim, int spacedim>
- FECollection<dim,spacedim>::FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2,
- const FiniteElement<dim,spacedim> &fe3)
- {
- push_back(fe1);
- push_back(fe2);
- push_back(fe3);
- }
-
-
-
- template <int dim, int spacedim>
- FECollection<dim,spacedim>::FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2,
- const FiniteElement<dim,spacedim> &fe3,
- const FiniteElement<dim,spacedim> &fe4)
- {
- push_back(fe1);
- push_back(fe2);
- push_back(fe3);
- push_back(fe4);
- }
-
-
-
- template <int dim, int spacedim>
- FECollection<dim,spacedim>::FECollection (const FiniteElement<dim,spacedim> &fe1,
- const FiniteElement<dim,spacedim> &fe2,
- const FiniteElement<dim,spacedim> &fe3,
- const FiniteElement<dim,spacedim> &fe4,
- const FiniteElement<dim,spacedim> &fe5)
- {
- push_back(fe1);
- push_back(fe2);
- push_back(fe3);
- push_back(fe4);
- push_back(fe5);
- }
-
-
-
template <int dim, int spacedim>
FECollection<dim,spacedim>::
FECollection (const std::vector<const FiniteElement<dim,spacedim>*> &fes)
- template <int dim, int spacedim>
- FECollection<dim,spacedim>::
- FECollection (const FECollection<dim,spacedim> &fe_collection)
- :
- Subscriptor (),
- // copy the array
- // of shared
- // pointers. nothing
- // bad should
- // happen -- they
- // simply all point
- // to the same
- // objects, and the
- // last one to die
- // will delete the
- // mappings
- finite_elements (fe_collection.finite_elements)
- {}
-
-
-
template <int dim, int spacedim>
void FECollection<dim,spacedim>::push_back (const FiniteElement<dim,spacedim> &new_fe)
{