From: Wolfgang Bangerth Date: Fri, 17 Feb 2006 21:51:29 +0000 (+0000) Subject: Rename the *Collection::add_* functions to push_back(). X-Git-Tag: v8.0.0~12281 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=640cf65ac9fc03e02c71c9cce3563197b13b298f;p=dealii.git Rename the *Collection::add_* functions to push_back(). git-svn-id: https://svn.dealii.org/trunk@12401 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_collection.h b/deal.II/deal.II/include/fe/fe_collection.h index 0f2fe622aa..44e85df47f 100644 --- a/deal.II/deal.II/include/fe/fe_collection.h +++ b/deal.II/deal.II/include/fe/fe_collection.h @@ -61,7 +61,7 @@ namespace hp * already in the collection. */ unsigned int - add_fe (const FiniteElement &new_fe); + push_back (const FiniteElement &new_fe); /** * Get a reference to the given element diff --git a/deal.II/deal.II/include/fe/mapping_collection.h b/deal.II/deal.II/include/fe/mapping_collection.h index 8495ac566c..a0034f8abc 100644 --- a/deal.II/deal.II/include/fe/mapping_collection.h +++ b/deal.II/deal.II/include/fe/mapping_collection.h @@ -100,7 +100,7 @@ namespace hp * first, followed by the mapping * object for active_fe_index 1. */ - unsigned int add_mapping (const Mapping &new_mapping); + unsigned int push_back (const Mapping &new_mapping); private: /** diff --git a/deal.II/deal.II/include/fe/q_collection.h b/deal.II/deal.II/include/fe/q_collection.h index fece6a715f..b0d5a7a45a 100644 --- a/deal.II/deal.II/include/fe/q_collection.h +++ b/deal.II/deal.II/include/fe/q_collection.h @@ -99,7 +99,7 @@ namespace hp * this object upon destruction of the * entire collection. */ - unsigned int add_quadrature (const Quadrature &new_quadrature); + unsigned int push_back (const Quadrature &new_quadrature); /** * Determine an estimate for the diff --git a/deal.II/deal.II/source/fe/fe_collection.cc b/deal.II/deal.II/source/fe/fe_collection.cc index 917e3ba2d8..98274df165 100644 --- a/deal.II/deal.II/source/fe/fe_collection.cc +++ b/deal.II/deal.II/source/fe/fe_collection.cc @@ -18,7 +18,7 @@ namespace hp { template - unsigned int FECollection::add_fe (const FiniteElement &new_fe) + unsigned int FECollection::push_back (const FiniteElement &new_fe) { // check that the new element has the right // number of components. only check with diff --git a/deal.II/deal.II/source/fe/mapping_collection.cc b/deal.II/deal.II/source/fe/mapping_collection.cc index 3361a0ff31..e37a72947b 100644 --- a/deal.II/deal.II/source/fe/mapping_collection.cc +++ b/deal.II/deal.II/source/fe/mapping_collection.cc @@ -26,7 +26,8 @@ namespace hp template - MappingCollection::MappingCollection (const Mapping &mapping) : + MappingCollection::MappingCollection (const Mapping &mapping) + : single_mapping (true) { mappings @@ -60,8 +61,8 @@ namespace hp template - unsigned int MappingCollection:: - add_mapping (const Mapping &new_mapping) + unsigned int + MappingCollection::push_back (const Mapping &new_mapping) { // A MappingCollection, which was // initialized as single diff --git a/deal.II/deal.II/source/fe/q_collection.cc b/deal.II/deal.II/source/fe/q_collection.cc index 409bbe2471..8f428bb906 100644 --- a/deal.II/deal.II/source/fe/q_collection.cc +++ b/deal.II/deal.II/source/fe/q_collection.cc @@ -68,8 +68,9 @@ namespace hp template - unsigned int QCollection:: - add_quadrature (const Quadrature &new_quadrature) + unsigned int + QCollection:: + push_back (const Quadrature &new_quadrature) { // A QCollection, which was initialized // as single QCollection cannot diff --git a/deal.II/doc/doxygen/headers/hp.h b/deal.II/doc/doxygen/headers/hp.h index cca41d7369..1b2ddbc82c 100644 --- a/deal.II/doc/doxygen/headers/hp.h +++ b/deal.II/doc/doxygen/headers/hp.h @@ -46,10 +46,11 @@ * 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 add_*() to add a finite - * element, quadrature formula, or mapping to the collection. They - * have an operator[] (unsigned int) function that allows to + * and hp::MappingCollection classes, implement an interface very + * similar to that of std::vector. They have functions + * push_back() to add a finite element, quadrature + * formula, or mapping to the collection. They have an + * operator[] (unsigned int) function that allows to * retrieve a reference to a given element of the collection. And they * have a size() function that returns the number of * elements in the collection. Some of the classes, in particular that @@ -63,7 +64,7 @@ * @verbatim * FECollection fe_collection; * for (unsigned int degree=1; degree<5; ++degree) - * fe_collection.add_fe (FE_Q(degree)); + * fe_collection.push_back (FE_Q(degree)); * @endverbatim * * This way, one can add elements of polynomial degree 1 through 4 to the diff --git a/deal.II/examples/step-21/step-21.cc b/deal.II/examples/step-21/step-21.cc index 6a914020d4..46baf65816 100644 --- a/deal.II/examples/step-21/step-21.cc +++ b/deal.II/examples/step-21/step-21.cc @@ -669,13 +669,13 @@ DGMethod::DGMethod () unsigned int elm_no; for (unsigned int i = 0; i < hp_degree; ++i) { - elm_no = fe_collection.add_fe (FE_DGQ (i)); - quadratures.add_quadrature (QGauss (i+2)); - face_quadratures.add_quadrature (QGauss (i+2)); + elm_no = fe_collection.push_back (FE_DGQ (i)); + quadratures.push_back (QGauss (i+2)); + face_quadratures.push_back (QGauss (i+2)); } static const MappingQ1 mapping; - mapping_collection.add_mapping (mapping); + mapping_collection.push_back (mapping); } diff --git a/tests/hp/crash_01.cc b/tests/hp/crash_01.cc index a4e3a9d232..fc607c5563 100644 --- a/tests/hp/crash_01.cc +++ b/tests/hp/crash_01.cc @@ -41,7 +41,7 @@ int main () GridGenerator::hyper_cube(tria); hp::FECollection fe_collection; - fe_collection.add_fe (FE_DGQ (1)); + fe_collection.push_back (FE_DGQ (1)); hp::DoFHandler dof_handler(tria); dof_handler.distribute_dofs(fe_collection); @@ -53,7 +53,7 @@ int main () GridGenerator::hyper_cube(tria); hp::FECollection fe_collection; - fe_collection.add_fe (FE_DGQ (1)); + fe_collection.push_back (FE_DGQ (1)); hp::DoFHandler dof_handler(tria); dof_handler.distribute_dofs(fe_collection); diff --git a/tests/hp/hp_dof_handler.cc b/tests/hp/hp_dof_handler.cc index e4bd763c79..3b22efb5ac 100644 --- a/tests/hp/hp_dof_handler.cc +++ b/tests/hp/hp_dof_handler.cc @@ -40,7 +40,7 @@ int main () GridGenerator::hyper_cube(tria); hp::FECollection fe_collection; - fe_collection.add_fe (FE_DGQ (1)); + fe_collection.push_back (FE_DGQ (1)); hp::DoFHandler dof_handler(tria);