* already in the collection.
*/
unsigned int
- add_fe (const FiniteElement<dim> &new_fe);
+ push_back (const FiniteElement<dim> &new_fe);
/**
* Get a reference to the given element
* first, followed by the mapping
* object for active_fe_index 1.
*/
- unsigned int add_mapping (const Mapping<dim> &new_mapping);
+ unsigned int push_back (const Mapping<dim> &new_mapping);
private:
/**
* this object upon destruction of the
* entire collection.
*/
- unsigned int add_quadrature (const Quadrature<dim> &new_quadrature);
+ unsigned int push_back (const Quadrature<dim> &new_quadrature);
/**
* Determine an estimate for the
namespace hp
{
template <int dim>
- unsigned int FECollection<dim>::add_fe (const FiniteElement<dim> &new_fe)
+ unsigned int FECollection<dim>::push_back (const FiniteElement<dim> &new_fe)
{
// check that the new element has the right
// number of components. only check with
template <int dim>
- MappingCollection<dim>::MappingCollection (const Mapping<dim> &mapping) :
+ MappingCollection<dim>::MappingCollection (const Mapping<dim> &mapping)
+ :
single_mapping (true)
{
mappings
template <int dim>
- unsigned int MappingCollection<dim>::
- add_mapping (const Mapping<dim> &new_mapping)
+ unsigned int
+ MappingCollection<dim>::push_back (const Mapping<dim> &new_mapping)
{
// A MappingCollection, which was
// initialized as single
template <int dim>
- unsigned int QCollection<dim>::
- add_quadrature (const Quadrature<dim> &new_quadrature)
+ unsigned int
+ QCollection<dim>::
+ push_back (const Quadrature<dim> &new_quadrature)
{
// A QCollection, which was initialized
// as single QCollection cannot
* hp::MappingCollection class allows to do this.
*
* All of these three classes, the hp::FECollection, hp::QCollection,
- * and hp::MappingCollection classes, implement a similar
- * interface. They have functions <code>add_*()</code> to add a finite
- * element, quadrature formula, or mapping to the collection. They
- * have an <code>operator[] (unsigned int)</code> function that allows to
+ * and hp::MappingCollection classes, implement an interface very
+ * similar to that of <code>std::vector</code>. They have functions
+ * <code>push_back()</code> to add a finite element, quadrature
+ * formula, or mapping to the collection. They have an
+ * <code>operator[] (unsigned int)</code> function that allows to
* retrieve a reference to a given element of the collection. And they
* have a <code>size()</code> function that returns the number of
* elements in the collection. Some of the classes, in particular that
* @verbatim
* FECollection<dim> fe_collection;
* for (unsigned int degree=1; degree<5; ++degree)
- * fe_collection.add_fe (FE_Q<dim>(degree));
+ * fe_collection.push_back (FE_Q<dim>(degree));
* @endverbatim
*
* This way, one can add elements of polynomial degree 1 through 4 to the
unsigned int elm_no;
for (unsigned int i = 0; i < hp_degree; ++i)
{
- elm_no = fe_collection.add_fe (FE_DGQ<dim> (i));
- quadratures.add_quadrature (QGauss<dim> (i+2));
- face_quadratures.add_quadrature (QGauss<dim-1> (i+2));
+ elm_no = fe_collection.push_back (FE_DGQ<dim> (i));
+ quadratures.push_back (QGauss<dim> (i+2));
+ face_quadratures.push_back (QGauss<dim-1> (i+2));
}
static const MappingQ1<dim> mapping;
- mapping_collection.add_mapping (mapping);
+ mapping_collection.push_back (mapping);
}
GridGenerator::hyper_cube(tria);
hp::FECollection<dim> fe_collection;
- fe_collection.add_fe (FE_DGQ<dim> (1));
+ fe_collection.push_back (FE_DGQ<dim> (1));
hp::DoFHandler<dim> dof_handler(tria);
dof_handler.distribute_dofs(fe_collection);
GridGenerator::hyper_cube(tria);
hp::FECollection<dim> fe_collection;
- fe_collection.add_fe (FE_DGQ<dim> (1));
+ fe_collection.push_back (FE_DGQ<dim> (1));
hp::DoFHandler<dim> dof_handler(tria);
dof_handler.distribute_dofs(fe_collection);
GridGenerator::hyper_cube(tria);
hp::FECollection<dim> fe_collection;
- fe_collection.add_fe (FE_DGQ<dim> (1));
+ fe_collection.push_back (FE_DGQ<dim> (1));
hp::DoFHandler<dim> dof_handler(tria);