From: Wolfgang Bangerth Date: Wed, 21 Aug 2019 20:05:43 +0000 (-0600) Subject: Mark a bunch of input argument as 'const'. X-Git-Tag: v9.2.0-rc1~1185^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cbf8e0cd7fbdd745c9d9e97eba1721456e1c025;p=dealii.git Mark a bunch of input argument as 'const'. --- diff --git a/include/deal.II/base/polynomials_abf.h b/include/deal.II/base/polynomials_abf.h index 73f1017b86..041a10b21f 100644 --- a/include/deal.II/base/polynomials_abf.h +++ b/include/deal.II/base/polynomials_abf.h @@ -97,7 +97,7 @@ public: * FiniteElement classes. */ static unsigned int - n_polynomials(unsigned int degree); + n_polynomials(const unsigned int degree); /** * @copydoc TensorPolynomialsBase::clone() diff --git a/include/deal.II/base/polynomials_bdm.h b/include/deal.II/base/polynomials_bdm.h index 2e6a8055f3..b16e2c3f79 100644 --- a/include/deal.II/base/polynomials_bdm.h +++ b/include/deal.II/base/polynomials_bdm.h @@ -150,7 +150,7 @@ public: * by the FiniteElement classes. */ static unsigned int - n_polynomials(unsigned int degree); + n_polynomials(const unsigned int degree); /** * @copydoc TensorPolynomialsBase::clone() diff --git a/include/deal.II/base/polynomials_nedelec.h b/include/deal.II/base/polynomials_nedelec.h index 604a248749..07df872a71 100644 --- a/include/deal.II/base/polynomials_nedelec.h +++ b/include/deal.II/base/polynomials_nedelec.h @@ -94,7 +94,7 @@ public: * the FiniteElement classes. */ static unsigned int - n_polynomials(unsigned int degree); + n_polynomials(const unsigned int degree); /** * @copydoc TensorPolynomialsBase::clone() diff --git a/include/deal.II/base/polynomials_raviart_thomas.h b/include/deal.II/base/polynomials_raviart_thomas.h index 4ad47da7f2..8c5cd8eae1 100644 --- a/include/deal.II/base/polynomials_raviart_thomas.h +++ b/include/deal.II/base/polynomials_raviart_thomas.h @@ -92,7 +92,7 @@ public: * required by the FiniteElement classes. */ static unsigned int - n_polynomials(unsigned int degree); + n_polynomials(const unsigned int degree); /** * @copydoc TensorPolynomialsBase::clone() diff --git a/include/deal.II/fe/fe_dg_vector.templates.h b/include/deal.II/fe/fe_dg_vector.templates.h index edba144969..b200a94fe4 100644 --- a/include/deal.II/fe/fe_dg_vector.templates.h +++ b/include/deal.II/fe/fe_dg_vector.templates.h @@ -39,8 +39,8 @@ FE_DGVector::FE_DGVector(const unsigned int deg, dim, deg + 1, FiniteElementData::L2), - std::vector(PolynomialType::compute_n_pols(deg), true), - std::vector(PolynomialType::compute_n_pols(deg), + std::vector(PolynomialType::n_polynomials(deg), true), + std::vector(PolynomialType::n_polynomials(deg), ComponentMask(dim, true))) { this->mapping_kind = {map}; @@ -81,7 +81,7 @@ FE_DGVector::get_dpo_vector( const unsigned int deg) { std::vector dpo(dim + 1); - dpo[dim] = PolynomialType::compute_n_pols(deg); + dpo[dim] = PolynomialType::n_polynomials(deg); return dpo; } diff --git a/source/base/polynomials_bdm.cc b/source/base/polynomials_bdm.cc index a5388f6e58..702f54a306 100644 --- a/source/base/polynomials_bdm.cc +++ b/source/base/polynomials_bdm.cc @@ -429,7 +429,7 @@ square for (unsigned int j=0;j unsigned int -PolynomialsBDM::n_polynomials(unsigned int k) +PolynomialsBDM::n_polynomials(const unsigned int k) { if (dim == 1) return k + 1; diff --git a/source/base/polynomials_nedelec.cc b/source/base/polynomials_nedelec.cc index 96ab333ad8..26a97e752b 100644 --- a/source/base/polynomials_nedelec.cc +++ b/source/base/polynomials_nedelec.cc @@ -1486,7 +1486,7 @@ PolynomialsNedelec::compute( template unsigned int -PolynomialsNedelec::n_polynomials(unsigned int k) +PolynomialsNedelec::n_polynomials(const unsigned int k) { switch (dim) { diff --git a/source/base/polynomials_raviart_thomas.cc b/source/base/polynomials_raviart_thomas.cc index 531aee636e..9889e0b8c5 100644 --- a/source/base/polynomials_raviart_thomas.cc +++ b/source/base/polynomials_raviart_thomas.cc @@ -170,7 +170,7 @@ PolynomialsRaviartThomas::compute( template unsigned int -PolynomialsRaviartThomas::n_polynomials(unsigned int k) +PolynomialsRaviartThomas::n_polynomials(const unsigned int k) { if (dim == 1) return k + 1; diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index 6a62cd7788..6c1b97c67e 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -52,8 +52,8 @@ FE_ABF::FE_ABF(const unsigned int deg) dim, deg + 2, FiniteElementData::Hdiv), - std::vector(PolynomialsABF::compute_n_pols(deg), true), - std::vector(PolynomialsABF::compute_n_pols(deg), + std::vector(PolynomialsABF::n_polynomials(deg), true), + std::vector(PolynomialsABF::n_polynomials(deg), std::vector(dim, true))) , rt_order(deg) { diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index c80345675b..0a09f141f8 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -45,7 +45,7 @@ FE_BDM::FE_BDM(const unsigned int deg) deg + 1, FiniteElementData::Hdiv), get_ria_vector(deg), - std::vector(PolynomialsBDM::compute_n_pols(deg), + std::vector(PolynomialsBDM::n_polynomials(deg), std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); @@ -222,12 +222,12 @@ FE_BDM::get_dpo_vector(const unsigned int deg) // the element is face-based and we have as many degrees of freedom // on the faces as there are polynomials of degree up to // deg. Observe the odd convention of - // PolynomialSpace::compute_n_pols()! + // PolynomialSpace::n_polynomials()! std::vector dpo(dim + 1, 0u); dpo[dim] = - (deg > 1 ? dim * PolynomialSpace::compute_n_pols(deg - 1) : 0u); - dpo[dim - 1] = PolynomialSpace::compute_n_pols(deg + 1); + (deg > 1 ? dim * PolynomialSpace::n_polynomials(deg - 1) : 0u); + dpo[dim - 1] = PolynomialSpace::n_polynomials(deg + 1); return dpo; } @@ -244,9 +244,9 @@ FE_BDM::get_ria_vector(const unsigned int deg) return std::vector(); } - const unsigned int dofs_per_cell = PolynomialsBDM::compute_n_pols(deg); + const unsigned int dofs_per_cell = PolynomialsBDM::n_polynomials(deg); const unsigned int dofs_per_face = - PolynomialSpace::compute_n_pols(deg + 1); + PolynomialSpace::n_polynomials(deg + 1); Assert(GeometryInfo::faces_per_cell * dofs_per_face <= dofs_per_cell, ExcInternalError()); diff --git a/source/fe/fe_bernardi_raugel.cc b/source/fe/fe_bernardi_raugel.cc index f4fbd7874b..4408442b88 100644 --- a/source/fe/fe_bernardi_raugel.cc +++ b/source/fe/fe_bernardi_raugel.cc @@ -44,9 +44,8 @@ FE_BernardiRaugel::FE_BernardiRaugel(const unsigned int p) dim, 2, FiniteElementData::Hdiv), - std::vector(PolynomialsBernardiRaugel::compute_n_pols(p), - true), - std::vector(PolynomialsBernardiRaugel::compute_n_pols( + std::vector(PolynomialsBernardiRaugel::n_polynomials(p), true), + std::vector(PolynomialsBernardiRaugel::n_polynomials( p), std::vector(dim, true))) { diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index c92aeed119..d62b61436c 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -75,8 +75,8 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) dim, order + 1, FiniteElementData::Hcurl), - std::vector(PolynomialsNedelec::compute_n_pols(order), true), - std::vector(PolynomialsNedelec::compute_n_pols(order), + std::vector(PolynomialsNedelec::n_polynomials(order), true), + std::vector(PolynomialsNedelec::n_polynomials(order), std::vector(dim, true))) { #ifdef DEBUG_NEDELEC @@ -2003,7 +2003,7 @@ FE_Nedelec::get_dpo_vector(const unsigned int degree, bool dg) if (dg) { - dpo[dim] = PolynomialsNedelec::compute_n_pols(degree); + dpo[dim] = PolynomialsNedelec::n_polynomials(degree); } else { diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index 7007d543b5..cb2a9ec571 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -51,9 +51,9 @@ FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) dim, deg + 1, FiniteElementData::Hdiv), - std::vector(PolynomialsRaviartThomas::compute_n_pols(deg), + std::vector(PolynomialsRaviartThomas::n_polynomials(deg), true), - std::vector(PolynomialsRaviartThomas::compute_n_pols( + std::vector(PolynomialsRaviartThomas::n_polynomials( deg), std::vector(dim, true))) { diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index 802979994b..ca1b97bcf5 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -45,7 +45,7 @@ FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int deg) FiniteElementData::Hdiv), get_ria_vector(deg), std::vector( - PolynomialsRaviartThomas::compute_n_pols(deg), + PolynomialsRaviartThomas::n_polynomials(deg), std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); @@ -253,7 +253,7 @@ std::vector FE_RaviartThomasNodal::get_ria_vector(const unsigned int deg) { const unsigned int dofs_per_cell = - PolynomialsRaviartThomas::compute_n_pols(deg); + PolynomialsRaviartThomas::n_polynomials(deg); unsigned int dofs_per_face = deg + 1; for (unsigned int d = 2; d < dim; ++d) dofs_per_face *= deg + 1; diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index 7319cf29e4..2aed8efd00 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -37,15 +37,15 @@ DEAL_II_NAMESPACE_OPEN template FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) - : FE_PolyTensor(PolynomialsRT_Bubbles(deg), - FiniteElementData(get_dpo_vector(deg), - dim, - deg + 1, - FiniteElementData::Hdiv), - get_ria_vector(deg), - std::vector( - PolynomialsRT_Bubbles::compute_n_pols(deg), - std::vector(dim, true))) + : FE_PolyTensor( + PolynomialsRT_Bubbles(deg), + FiniteElementData(get_dpo_vector(deg), + dim, + deg + 1, + FiniteElementData::Hdiv), + get_ria_vector(deg), + std::vector(PolynomialsRT_Bubbles::n_polynomials(deg), + std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); Assert( @@ -239,7 +239,7 @@ std::vector FE_RT_Bubbles::get_ria_vector(const unsigned int deg) { const unsigned int dofs_per_cell = - PolynomialsRT_Bubbles::compute_n_pols(deg); + PolynomialsRT_Bubbles::n_polynomials(deg); unsigned int dofs_per_face = deg + 1; for (unsigned int d = 2; d < dim; ++d) dofs_per_face *= deg + 1;