From: David Wells Date: Thu, 12 Nov 2015 20:38:08 +0000 (-0500) Subject: Prefer PolynomialType to POLY. X-Git-Tag: v8.4.0-rc2~230^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3adfa167f7ee569f40024266bbde98694874339;p=dealii.git Prefer PolynomialType to POLY. --- diff --git a/include/deal.II/base/tensor_product_polynomials.h b/include/deal.II/base/tensor_product_polynomials.h index 8f71e53ae1..daff8beebc 100644 --- a/include/deal.II/base/tensor_product_polynomials.h +++ b/include/deal.II/base/tensor_product_polynomials.h @@ -60,7 +60,7 @@ DEAL_II_NAMESPACE_OPEN * @author Ralf Hartmann, 2000, 2004, Guido Kanschat, 2000, Wolfgang Bangerth * 2003 */ -template > +template > class TensorProductPolynomials { public: @@ -73,8 +73,8 @@ public: /** * Constructor. pols is a vector of objects that should be derived * or otherwise convertible to one-dimensional polynomial objects of type @p - * POLY (template argument of class). It will be copied element by element - * into a private variable. + * PolynomialType (template argument of class). It will be copied element by + * element into a private variable. */ template TensorProductPolynomials (const std::vector &pols); @@ -193,7 +193,7 @@ protected: /** * Copy of the vector pols of polynomials given to the constructor. */ - std::vector polynomials; + std::vector polynomials; /** * Number of tensor product polynomials. See n(). @@ -380,10 +380,10 @@ private: /* ---------------- template and inline functions ---------- */ -template +template template inline -TensorProductPolynomials:: +TensorProductPolynomials:: TensorProductPolynomials(const std::vector &pols) : polynomials (pols.begin(), pols.end()), @@ -402,10 +402,10 @@ TensorProductPolynomials(const std::vector &pols) -template +template inline unsigned int -TensorProductPolynomials::n() const +TensorProductPolynomials::n() const { if (dim == 0) return numbers::invalid_unsigned_int; @@ -415,28 +415,29 @@ TensorProductPolynomials::n() const -template +template inline const std::vector & -TensorProductPolynomials::get_numbering() const +TensorProductPolynomials::get_numbering() const { return index_map; } -template +template inline const std::vector & -TensorProductPolynomials::get_numbering_inverse() const +TensorProductPolynomials::get_numbering_inverse() const { return index_map_inverse; } -template +template template Tensor -TensorProductPolynomials::compute_derivative (const unsigned int i, - const Point &p) const +TensorProductPolynomials::compute_derivative +(const unsigned int i, + const Point &p) const { unsigned int indices[dim]; compute_index (i, indices); diff --git a/include/deal.II/fe/fe_dg_vector.h b/include/deal.II/fe/fe_dg_vector.h index 254fd10906..bb575e0232 100644 --- a/include/deal.II/fe/fe_dg_vector.h +++ b/include/deal.II/fe/fe_dg_vector.h @@ -43,7 +43,7 @@ template class MappingQ; * are suitable for DG and hybrid formulations involving these function * spaces. * - * The template argument POLY refers to a vector valued polynomial + * The template argument PolynomialType refers to a vector valued polynomial * space like PolynomialsRaviartThomas or PolynomialsNedelec. Note that the * dimension of the polynomial space and the argument dim must * coincide. @@ -52,10 +52,10 @@ template class MappingQ; * @author Guido Kanschat * @date 2010 */ -template +template class FE_DGVector : - public FE_PolyTensor + public FE_PolyTensor { public: /** diff --git a/include/deal.II/fe/fe_dg_vector.templates.h b/include/deal.II/fe/fe_dg_vector.templates.h index b972a85af3..17e10b14cc 100644 --- a/include/deal.II/fe/fe_dg_vector.templates.h +++ b/include/deal.II/fe/fe_dg_vector.templates.h @@ -23,16 +23,16 @@ DEAL_II_NAMESPACE_OPEN //TODO:[GK] deg+1 is wrong here and should be fixed after FiniteElementData was cleaned up -template -FE_DGVector::FE_DGVector ( +template +FE_DGVector::FE_DGVector ( const unsigned int deg, MappingType map) : - FE_PolyTensor( + FE_PolyTensor( deg, FiniteElementData( get_dpo_vector(deg), dim, deg+1, FiniteElementData::L2, 1), - std::vector(POLY::compute_n_pols(deg), true), - std::vector(POLY::compute_n_pols(deg), + std::vector(PolynomialType::compute_n_pols(deg), true), + std::vector(PolynomialType::compute_n_pols(deg), ComponentMask(dim,true))) { this->mapping_type = map; @@ -47,17 +47,17 @@ FE_DGVector::FE_DGVector ( } -template +template FiniteElement * -FE_DGVector::clone() const +FE_DGVector::clone() const { - return new FE_DGVector(*this); + return new FE_DGVector(*this); } -template +template std::string -FE_DGVector::get_name() const +FE_DGVector::get_name() const { std::ostringstream namebuf; namebuf << "FE_DGVector_" << this->poly_space.name() @@ -66,59 +66,60 @@ FE_DGVector::get_name() const } -template +template std::vector -FE_DGVector::get_dpo_vector (const unsigned int deg) +FE_DGVector::get_dpo_vector (const unsigned int deg) { std::vector dpo(dim+1); - dpo[dim] = POLY::compute_n_pols(deg); + dpo[dim] = PolynomialType::compute_n_pols(deg); return dpo; } -template +template bool -FE_DGVector::has_support_on_face (const unsigned int, - const unsigned int) const +FE_DGVector::has_support_on_face +(const unsigned int, + const unsigned int) const { return true; } -template +template void -FE_DGVector::interpolate( - std::vector &, - const std::vector &) const +FE_DGVector::interpolate +(std::vector &, + const std::vector &) const { Assert(false, ExcNotImplemented()); } -template +template void -FE_DGVector::interpolate( - std::vector & /*local_dofs*/, - const std::vector > & /*values*/, - unsigned int /*offset*/) const +FE_DGVector::interpolate +(std::vector & /*local_dofs*/, + const std::vector > & /*values*/, + unsigned int /*offset*/) const { Assert(false, ExcNotImplemented()); } -template +template void -FE_DGVector::interpolate( - std::vector & /*local_dofs*/, - const VectorSlice > > & /*values*/) const +FE_DGVector::interpolate +(std::vector & /*local_dofs*/, + const VectorSlice > > & /*values*/) const { Assert(false, ExcNotImplemented()); } -template +template std::size_t -FE_DGVector::memory_consumption() const +FE_DGVector::memory_consumption() const { Assert(false, ExcNotImplemented()); return 0; diff --git a/include/deal.II/fe/fe_poly.h b/include/deal.II/fe/fe_poly.h index b74c75cb62..134b5ef3a0 100644 --- a/include/deal.II/fe/fe_poly.h +++ b/include/deal.II/fe/fe_poly.h @@ -31,7 +31,7 @@ DEAL_II_NAMESPACE_OPEN * TensorProductPolynomials or PolynomialSpace classes. * * Every class conforming to the following interface can be used as template - * parameter POLY. + * parameter PolynomialType. * * @code * static const unsigned int dimension; @@ -65,14 +65,14 @@ DEAL_II_NAMESPACE_OPEN * @author Ralf Hartmann 2004, Guido Kanschat, 2009 */ -template +template class FE_Poly : public FiniteElement { public: /** * Constructor. */ - FE_Poly (const POLY &poly_space, + FE_Poly (const PolynomialType &poly_space, const FiniteElementData &fe_data, const std::vector &restriction_is_additive_flags, const std::vector &nonzero_components); @@ -91,13 +91,13 @@ public: /** * Return the numbering of the underlying polynomial space compared to * lexicographic ordering of the basis functions. Returns - * POLY::get_numbering(). + * PolynomialType::get_numbering(). */ std::vector get_poly_space_numbering() const; /** * Return the inverse numbering of the underlying polynomial space. Returns - * POLY::get_numbering_inverse(). + * PolynomialType::get_numbering_inverse(). */ std::vector get_poly_space_numbering_inverse() const; @@ -463,9 +463,9 @@ protected: const unsigned int dof) const; /** - * The polynomial space. Its type is given by the template parameter POLY. + * The polynomial space. Its type is given by the template parameter PolynomialType. */ - POLY poly_space; + PolynomialType poly_space; }; /*@}*/ diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index fb160960b2..c55bf59053 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -25,43 +25,45 @@ DEAL_II_NAMESPACE_OPEN -template -FE_Poly::FE_Poly (const POLY &poly_space, - const FiniteElementData &fe_data, - const std::vector &restriction_is_additive_flags, - const std::vector &nonzero_components): +template +FE_Poly::FE_Poly +(const PolynomialType &poly_space, + const FiniteElementData &fe_data, + const std::vector &restriction_is_additive_flags, + const std::vector &nonzero_components): FiniteElement (fe_data, restriction_is_additive_flags, nonzero_components), poly_space(poly_space) { - AssertDimension(dim, POLY::dimension); + AssertDimension(dim, PolynomialType::dimension); } -template +template unsigned int -FE_Poly::get_degree () const +FE_Poly::get_degree () const { return this->degree; } -template +template double -FE_Poly::shape_value (const unsigned int i, - const Point &p) const +FE_Poly::shape_value (const unsigned int i, + const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); return poly_space.compute_value(i, p); } -template +template double -FE_Poly::shape_value_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_Poly::shape_value_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { (void)component; Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); @@ -71,10 +73,10 @@ FE_Poly::shape_value_component (const unsigned int i, -template +template Tensor<1,dim> -FE_Poly::shape_grad (const unsigned int i, - const Point &p) const +FE_Poly::shape_grad (const unsigned int i, + const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); return poly_space.template compute_derivative<1>(i, p); @@ -82,11 +84,11 @@ FE_Poly::shape_grad (const unsigned int i, -template +template Tensor<1,dim> -FE_Poly::shape_grad_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_Poly::shape_grad_component (const unsigned int i, + const Point &p, + const unsigned int component) const { (void)component; Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); @@ -96,10 +98,10 @@ FE_Poly::shape_grad_component (const unsigned int i, -template +template Tensor<2,dim> -FE_Poly::shape_grad_grad (const unsigned int i, - const Point &p) const +FE_Poly::shape_grad_grad (const unsigned int i, + const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); return poly_space.template compute_derivative<2>(i, p); @@ -107,11 +109,12 @@ FE_Poly::shape_grad_grad (const unsigned int i, -template +template Tensor<2,dim> -FE_Poly::shape_grad_grad_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_Poly::shape_grad_grad_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { (void)component; Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); @@ -121,10 +124,10 @@ FE_Poly::shape_grad_grad_component (const unsigned int i, -template +template Tensor<3,dim> -FE_Poly::shape_3rd_derivative (const unsigned int i, - const Point &p) const +FE_Poly::shape_3rd_derivative (const unsigned int i, + const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); return poly_space.template compute_derivative<3>(i, p); @@ -132,11 +135,12 @@ FE_Poly::shape_3rd_derivative (const unsigned int i, -template +template Tensor<3,dim> -FE_Poly::shape_3rd_derivative_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_Poly::shape_3rd_derivative_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { (void)component; Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); @@ -146,10 +150,10 @@ FE_Poly::shape_3rd_derivative_component (const unsigned int i -template +template Tensor<4,dim> -FE_Poly::shape_4th_derivative (const unsigned int i, - const Point &p) const +FE_Poly::shape_4th_derivative (const unsigned int i, + const Point &p) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); return poly_space.template compute_derivative<4>(i, p); @@ -157,11 +161,12 @@ FE_Poly::shape_4th_derivative (const unsigned int i, -template +template Tensor<4,dim> -FE_Poly::shape_4th_derivative_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_Poly::shape_4th_derivative_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { (void)component; Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); @@ -176,18 +181,18 @@ FE_Poly::shape_4th_derivative_component (const unsigned int i //--------------------------------------------------------------------------- -template +template UpdateFlags -FE_Poly::requires_update_flags (const UpdateFlags flags) const +FE_Poly::requires_update_flags (const UpdateFlags flags) const { return update_once(flags) | update_each(flags); } -template +template UpdateFlags -FE_Poly::update_once (const UpdateFlags flags) const +FE_Poly::update_once (const UpdateFlags flags) const { // for this kind of elements, only // the values can be precomputed @@ -199,9 +204,9 @@ FE_Poly::update_once (const UpdateFlags flags) const -template +template UpdateFlags -FE_Poly::update_each (const UpdateFlags flags) const +FE_Poly::update_each (const UpdateFlags flags) const { UpdateFlags out = update_default; @@ -228,9 +233,9 @@ FE_Poly::update_each (const UpdateFlags flags) const //--------------------------------------------------------------------------- -template +template void -FE_Poly:: +FE_Poly:: fill_fe_values (const typename Triangulation::cell_iterator &, const CellSimilarity::Similarity cell_similarity, const Quadrature &quadrature, @@ -292,9 +297,9 @@ fill_fe_values (const typename Triangulation::cell_iterator &, -template +template void -FE_Poly:: +FE_Poly:: fill_fe_face_values (const typename Triangulation::cell_iterator &cell, const unsigned int face_no, const Quadrature &quadrature, @@ -369,9 +374,9 @@ fill_fe_face_values (const typename Triangulation::cell_iterator } } -template +template void -FE_Poly:: +FE_Poly:: fill_fe_subface_values (const typename Triangulation::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, @@ -450,9 +455,9 @@ fill_fe_subface_values (const typename Triangulation::cell_iterato -template +template inline void -FE_Poly:: +FE_Poly:: correct_third_derivatives (internal::FEValues::FiniteElementRelatedData &output_data, const internal::FEValues::MappingRelatedData &mapping_data, const unsigned int n_q_points, @@ -479,36 +484,36 @@ correct_third_derivatives (internal::FEValues::FiniteElementRelatedData + template inline std::vector - get_poly_space_numbering (const POLY &) + get_poly_space_numbering (const PolynomialType &) { Assert (false, ExcNotImplemented()); return std::vector(); } - template + template inline std::vector - get_poly_space_numbering_inverse (const POLY &) + get_poly_space_numbering_inverse (const PolynomialType &) { Assert (false, ExcNotImplemented()); return std::vector(); } - template + template inline std::vector - get_poly_space_numbering (const TensorProductPolynomials &poly) + get_poly_space_numbering (const TensorProductPolynomials &poly) { return poly.get_numbering(); } - template + template inline std::vector - get_poly_space_numbering_inverse (const TensorProductPolynomials &poly) + get_poly_space_numbering_inverse (const TensorProductPolynomials &poly) { return poly.get_numbering_inverse(); } @@ -532,9 +537,9 @@ namespace internal -template +template std::vector -FE_Poly::get_poly_space_numbering () const +FE_Poly::get_poly_space_numbering () const { return internal::get_poly_space_numbering (poly_space); } @@ -542,9 +547,9 @@ FE_Poly::get_poly_space_numbering () const -template +template std::vector -FE_Poly::get_poly_space_numbering_inverse () const +FE_Poly::get_poly_space_numbering_inverse () const { return internal::get_poly_space_numbering_inverse (poly_space); } diff --git a/include/deal.II/fe/fe_poly_face.h b/include/deal.II/fe/fe_poly_face.h index 4e53f7408b..649097de66 100644 --- a/include/deal.II/fe/fe_poly_face.h +++ b/include/deal.II/fe/fe_poly_face.h @@ -35,7 +35,7 @@ DEAL_II_NAMESPACE_OPEN * classes. * * Every class that implements the following functions can be used as template - * parameter POLY. + * parameter PolynomialType. * * @code * double compute_value (const unsigned int i, @@ -57,14 +57,14 @@ DEAL_II_NAMESPACE_OPEN * * @author Guido Kanschat, 2009 */ -template +template class FE_PolyFace : public FiniteElement { public: /** * Constructor. */ - FE_PolyFace (const POLY &poly_space, + FE_PolyFace (const PolynomialType &poly_space, const FiniteElementData &fe_data, const std::vector &restriction_is_additive_flags); @@ -264,9 +264,9 @@ protected: }; /** - * The polynomial space. Its type is given by the template parameter POLY. + * The polynomial space. Its type is given by the template parameter PolynomialType. */ - POLY poly_space; + PolynomialType poly_space; }; /*@}*/ diff --git a/include/deal.II/fe/fe_poly_face.templates.h b/include/deal.II/fe/fe_poly_face.templates.h index abeb919b75..5b45aaaa86 100644 --- a/include/deal.II/fe/fe_poly_face.templates.h +++ b/include/deal.II/fe/fe_poly_face.templates.h @@ -22,9 +22,9 @@ DEAL_II_NAMESPACE_OPEN -template -FE_PolyFace::FE_PolyFace ( - const POLY &poly_space, +template +FE_PolyFace::FE_PolyFace ( + const PolynomialType &poly_space, const FiniteElementData &fe_data, const std::vector &restriction_is_additive_flags): FiniteElement (fe_data, @@ -32,13 +32,13 @@ FE_PolyFace::FE_PolyFace ( std::vector (1, ComponentMask(1,true))), poly_space(poly_space) { - AssertDimension(dim, POLY::dimension+1); + AssertDimension(dim, PolynomialType::dimension+1); } -template +template unsigned int -FE_PolyFace::get_degree () const +FE_PolyFace::get_degree () const { return this->degree; } @@ -49,26 +49,26 @@ FE_PolyFace::get_degree () const //--------------------------------------------------------------------------- -template +template UpdateFlags -FE_PolyFace::requires_update_flags (const UpdateFlags flags) const +FE_PolyFace::requires_update_flags (const UpdateFlags flags) const { return update_once(flags) | update_each(flags); } -template +template UpdateFlags -FE_PolyFace::update_once (const UpdateFlags) const +FE_PolyFace::update_once (const UpdateFlags) const { return update_default; } -template +template UpdateFlags -FE_PolyFace::update_each (const UpdateFlags flags) const +FE_PolyFace::update_each (const UpdateFlags flags) const { UpdateFlags out = flags & update_values; if (flags & update_gradients) @@ -85,9 +85,9 @@ FE_PolyFace::update_each (const UpdateFlags flags) const //--------------------------------------------------------------------------- // Fill data of FEValues //--------------------------------------------------------------------------- -template +template void -FE_PolyFace:: +FE_PolyFace:: fill_fe_values (const typename Triangulation::cell_iterator &, const CellSimilarity::Similarity , const Quadrature &, @@ -103,9 +103,9 @@ fill_fe_values (const typename Triangulation::cell_iterator &, -template +template void -FE_PolyFace:: +FE_PolyFace:: fill_fe_face_values (const typename Triangulation::cell_iterator &, const unsigned int face_no, const Quadrature &quadrature, @@ -173,9 +173,9 @@ fill_fe_face_values (const typename Triangulation::cell_iterator & } -template +template void -FE_PolyFace:: +FE_PolyFace:: fill_fe_subface_values (const typename Triangulation::cell_iterator &, const unsigned int face_no, const unsigned int sub_no, diff --git a/include/deal.II/fe/fe_poly_tensor.h b/include/deal.II/fe/fe_poly_tensor.h index 2fb7e5c703..1d014d47f5 100644 --- a/include/deal.II/fe/fe_poly_tensor.h +++ b/include/deal.II/fe/fe_poly_tensor.h @@ -30,7 +30,7 @@ DEAL_II_NAMESPACE_OPEN * PolynomialsBDM and PolynomialsRaviartThomas. * * Every class that implements following function can be used as template - * parameter POLY. + * parameter PolynomialType. * * @code * void compute (const Point &unit_point, @@ -94,7 +94,7 @@ DEAL_II_NAMESPACE_OPEN * * @note The matrix #inverse_node_matrix should have dimensions zero before * this piece of code is executed. Only then, shape_value_component() will - * return the raw polynomial j as defined in the polynomial space POLY. + * return the raw polynomial j as defined in the polynomial space PolynomialType. * *

Setting the transformation

* @@ -111,7 +111,7 @@ DEAL_II_NAMESPACE_OPEN * @author Guido Kanschat * @date 2005 */ -template +template class FE_PolyTensor : public FiniteElement { public: @@ -397,9 +397,9 @@ protected: /** - * The polynomial space. Its type is given by the template parameter POLY. + * The polynomial space. Its type is given by the template parameter PolynomialType. */ - POLY poly_space; + PolynomialType poly_space; /** * The inverse of the matrix aij of node values diff --git a/include/deal.II/fe/fe_q_base.h b/include/deal.II/fe/fe_q_base.h index a5a9f83377..c33471332f 100644 --- a/include/deal.II/fe/fe_q_base.h +++ b/include/deal.II/fe/fe_q_base.h @@ -35,14 +35,14 @@ DEAL_II_NAMESPACE_OPEN * 2001, 2004, 2005; Oliver Kayser-Herold, 2004; Katharina Kormann, 2008; * Martin Kronbichler, 2008, 2013 */ -template -class FE_Q_Base : public FE_Poly +template +class FE_Q_Base : public FE_Poly { public: /** * Constructor. */ - FE_Q_Base (const POLY &poly_space, + FE_Q_Base (const PolynomialType &poly_space, const FiniteElementData &fe_data, const std::vector &restriction_is_additive_flags); @@ -317,7 +317,7 @@ protected: /* * Declare implementation friend. */ - friend struct FE_Q_Base::Implementation; + friend struct FE_Q_Base::Implementation; private: /* diff --git a/include/deal.II/fe/mapping_q.h b/include/deal.II/fe/mapping_q.h index 545d6fc37a..d0fec52125 100644 --- a/include/deal.II/fe/mapping_q.h +++ b/include/deal.II/fe/mapping_q.h @@ -22,7 +22,7 @@ DEAL_II_NAMESPACE_OPEN -template class TensorProductPolynomials; +template class TensorProductPolynomials; /*!@addtogroup mapping */ diff --git a/source/base/tensor_product_polynomials.cc b/source/base/tensor_product_polynomials.cc index 4349369801..d1700253ba 100644 --- a/source/base/tensor_product_polynomials.cc +++ b/source/base/tensor_product_polynomials.cc @@ -73,10 +73,10 @@ namespace internal -template +template inline void -TensorProductPolynomials:: +TensorProductPolynomials:: compute_index (const unsigned int i, unsigned int (&indices)[(dim > 0 ? dim : 1)]) const { @@ -87,9 +87,9 @@ compute_index (const unsigned int i, -template +template void -TensorProductPolynomials::output_indices(std::ostream &out) const +TensorProductPolynomials::output_indices(std::ostream &out) const { unsigned int ix[dim]; for (unsigned int i=0; i::output_indices(std::ostream &out) const -template +template void -TensorProductPolynomials::set_numbering( - const std::vector &renumber) +TensorProductPolynomials::set_numbering +(const std::vector &renumber) { Assert(renumber.size()==index_map.size(), ExcDimensionMismatch(renumber.size(), index_map.size())); @@ -131,10 +131,11 @@ TensorProductPolynomials<0,Polynomials::Polynomial > -template +template double -TensorProductPolynomials::compute_value (const unsigned int i, - const Point &p) const +TensorProductPolynomials::compute_value +(const unsigned int i, + const Point &p) const { Assert(dim>0, ExcNotImplemented()); @@ -150,10 +151,10 @@ TensorProductPolynomials::compute_value (const unsigned int i, -template +template Tensor<1,dim> -TensorProductPolynomials::compute_grad (const unsigned int i, - const Point &p) const +TensorProductPolynomials::compute_grad (const unsigned int i, + const Point &p) const { unsigned int indices[dim]; compute_index (i, indices); @@ -186,10 +187,11 @@ TensorProductPolynomials::compute_grad (const unsigned int i, -template +template Tensor<2,dim> -TensorProductPolynomials::compute_grad_grad (const unsigned int i, - const Point &p) const +TensorProductPolynomials::compute_grad_grad +(const unsigned int i, + const Point &p) const { unsigned int indices[dim]; compute_index (i, indices); @@ -231,9 +233,9 @@ TensorProductPolynomials::compute_grad_grad (const unsigned int i, -template +template void -TensorProductPolynomials:: +TensorProductPolynomials:: compute (const Point &p, std::vector &values, std::vector > &grads, diff --git a/source/fe/fe_poly_tensor.cc b/source/fe/fe_poly_tensor.cc index 99aa1f533a..9aaad2904e 100644 --- a/source/fe/fe_poly_tensor.cc +++ b/source/fe/fe_poly_tensor.cc @@ -131,16 +131,17 @@ namespace -template -FE_PolyTensor::FE_PolyTensor (const unsigned int degree, - const FiniteElementData &fe_data, - const std::vector &restriction_is_additive_flags, - const std::vector &nonzero_components) +template +FE_PolyTensor::FE_PolyTensor +(const unsigned int degree, + const FiniteElementData &fe_data, + const std::vector &restriction_is_additive_flags, + const std::vector &nonzero_components) : FiniteElement (fe_data, restriction_is_additive_flags, nonzero_components), - poly_space(POLY(degree)) + poly_space(PolynomialType(degree)) { cached_point(0) = -1; // Set up the table converting @@ -156,9 +157,10 @@ FE_PolyTensor::FE_PolyTensor (const unsigned int degree, -template +template double -FE_PolyTensor::shape_value (const unsigned int, const Point &) const +FE_PolyTensor::shape_value +(const unsigned int, const Point &) const { typedef FiniteElement FEE; @@ -168,11 +170,12 @@ FE_PolyTensor::shape_value (const unsigned int, const Point +template double -FE_PolyTensor::shape_value_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_PolyTensor::shape_value_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); Assert (component < dim, ExcIndexRange (component, 0, dim)); @@ -198,10 +201,10 @@ FE_PolyTensor::shape_value_component (const unsigned int i, -template +template Tensor<1,dim> -FE_PolyTensor::shape_grad (const unsigned int, - const Point &) const +FE_PolyTensor::shape_grad (const unsigned int, + const Point &) const { typedef FiniteElement FEE; Assert(false, typename FEE::ExcFENotPrimitive()); @@ -210,11 +213,12 @@ FE_PolyTensor::shape_grad (const unsigned int, -template +template Tensor<1,dim> -FE_PolyTensor::shape_grad_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_PolyTensor::shape_grad_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); Assert (component < dim, ExcIndexRange (component, 0, dim)); @@ -241,9 +245,11 @@ FE_PolyTensor::shape_grad_component (const unsigned int i, -template +template Tensor<2,dim> -FE_PolyTensor::shape_grad_grad (const unsigned int, const Point &) const +FE_PolyTensor::shape_grad_grad +(const unsigned int, + const Point &) const { typedef FiniteElement FEE; Assert(false, typename FEE::ExcFENotPrimitive()); @@ -252,11 +258,12 @@ FE_PolyTensor::shape_grad_grad (const unsigned int, const Poi -template +template Tensor<2,dim> -FE_PolyTensor::shape_grad_grad_component (const unsigned int i, - const Point &p, - const unsigned int component) const +FE_PolyTensor::shape_grad_grad_component +(const unsigned int i, + const Point &p, + const unsigned int component) const { Assert (idofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell)); Assert (component < dim, ExcIndexRange (component, 0, dim)); @@ -286,17 +293,18 @@ FE_PolyTensor::shape_grad_grad_component (const unsigned int // Fill data of FEValues //--------------------------------------------------------------------------- -template +template void -FE_PolyTensor:: -fill_fe_values (const typename Triangulation::cell_iterator &cell, - const CellSimilarity::Similarity cell_similarity, - const Quadrature &quadrature, - const Mapping &mapping, - const typename Mapping::InternalDataBase &mapping_internal, - const dealii::internal::FEValues::MappingRelatedData &mapping_data, - const typename FiniteElement::InternalDataBase &fe_internal, - dealii::internal::FEValues::FiniteElementRelatedData &output_data) const +FE_PolyTensor:: +fill_fe_values +(const typename Triangulation::cell_iterator &cell, + const CellSimilarity::Similarity cell_similarity, + const Quadrature &quadrature, + const Mapping &mapping, + const typename Mapping::InternalDataBase &mapping_internal, + const dealii::internal::FEValues::MappingRelatedData &mapping_data, + const typename FiniteElement::InternalDataBase &fe_internal, + dealii::internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -755,17 +763,18 @@ fill_fe_values (const typename Triangulation::cell_iterator -template +template void -FE_PolyTensor:: -fill_fe_face_values (const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const Mapping &mapping, - const typename Mapping::InternalDataBase &mapping_internal, - const dealii::internal::FEValues::MappingRelatedData &mapping_data, - const typename FiniteElement::InternalDataBase &fe_internal, - dealii::internal::FEValues::FiniteElementRelatedData &output_data) const +FE_PolyTensor:: +fill_fe_face_values +(const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const Quadrature &quadrature, + const Mapping &mapping, + const typename Mapping::InternalDataBase &mapping_internal, + const dealii::internal::FEValues::MappingRelatedData &mapping_data, + const typename FiniteElement::InternalDataBase &fe_internal, + dealii::internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -1214,18 +1223,19 @@ fill_fe_face_values (const typename Triangulation::cell_iterator -template +template void -FE_PolyTensor:: -fill_fe_subface_values (const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const Mapping &mapping, - const typename Mapping::InternalDataBase &mapping_internal, - const dealii::internal::FEValues::MappingRelatedData &mapping_data, - const typename FiniteElement::InternalDataBase &fe_internal, - dealii::internal::FEValues::FiniteElementRelatedData &output_data) const +FE_PolyTensor:: +fill_fe_subface_values +(const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const Mapping &mapping, + const typename Mapping::InternalDataBase &mapping_internal, + const dealii::internal::FEValues::MappingRelatedData &mapping_data, + const typename FiniteElement::InternalDataBase &fe_internal, + dealii::internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -1676,17 +1686,17 @@ fill_fe_subface_values (const typename Triangulation::cell_iterato -template +template UpdateFlags -FE_PolyTensor::requires_update_flags(const UpdateFlags flags) const +FE_PolyTensor::requires_update_flags(const UpdateFlags flags) const { return update_once(flags) | update_each(flags); } -template +template UpdateFlags -FE_PolyTensor::update_once (const UpdateFlags flags) const +FE_PolyTensor::update_once (const UpdateFlags flags) const { const bool values_once = (mapping_type == mapping_none); @@ -1699,9 +1709,9 @@ FE_PolyTensor::update_once (const UpdateFlags flags) const } -template +template UpdateFlags -FE_PolyTensor::update_each (const UpdateFlags flags) const +FE_PolyTensor::update_each (const UpdateFlags flags) const { UpdateFlags out = update_default; diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 3c2b3d39e2..9137d03e37 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -102,8 +102,8 @@ namespace FE_Q_Helper * A class with the same purpose as the similarly named class of the * Triangulation class. See there for more information. */ -template -struct FE_Q_Base::Implementation +template +struct FE_Q_Base::Implementation { /** * Initialize the hanging node constraints matrices. Called from the @@ -112,7 +112,7 @@ struct FE_Q_Base::Implementation template static void initialize_constraints (const std::vector > &, - FE_Q_Base &) + FE_Q_Base &) { // no constraints in 1d } @@ -121,12 +121,12 @@ struct FE_Q_Base::Implementation template static void initialize_constraints (const std::vector > &/*points*/, - FE_Q_Base &fe) + FE_Q_Base &fe) { const unsigned int dim = 2; unsigned int q_deg = fe.degree; - if (types_are_equal >::value) + if (types_are_equal >::value) q_deg = fe.degree-1; // restricted to each face, the traces of the shape functions is an @@ -228,12 +228,12 @@ struct FE_Q_Base::Implementation template static void initialize_constraints (const std::vector > &/*points*/, - FE_Q_Base &fe) + FE_Q_Base &fe) { const unsigned int dim = 3; unsigned int q_deg = fe.degree; - if (types_are_equal >::value) + if (types_are_equal >::value) q_deg = fe.degree-1; // For a detailed documentation of the interpolation see the @@ -408,23 +408,24 @@ struct FE_Q_Base::Implementation -template -FE_Q_Base::FE_Q_Base (const POLY &poly_space, - const FiniteElementData &fe_data, - const std::vector &restriction_is_additive_flags) +template +FE_Q_Base::FE_Q_Base +(const PolynomialType &poly_space, + const FiniteElementData &fe_data, + const std::vector &restriction_is_additive_flags) : - FE_Poly(poly_space, fe_data, restriction_is_additive_flags, - std::vector(1, std::vector(1,true))), - q_degree (types_are_equal >::value + FE_Poly(poly_space, fe_data, restriction_is_additive_flags, + std::vector(1, std::vector(1,true))), + q_degree (types_are_equal >::value ?this->degree-1 :this->degree) {} -template +template void -FE_Q_Base::initialize (const std::vector > &points) +FE_Q_Base::initialize (const std::vector > &points) { Assert (points[0][0] == 0, ExcMessage ("The first support point has to be zero.")); @@ -465,15 +466,15 @@ FE_Q_Base::initialize (const std::vector > &points) -template +template void -FE_Q_Base:: +FE_Q_Base:: get_interpolation_matrix (const FiniteElement &x_source_fe, - FullMatrix &interpolation_matrix) const + FullMatrix &interpolation_matrix) const { // go through the list of elements we can interpolate from - if (const FE_Q_Base *source_fe - = dynamic_cast*>(&x_source_fe)) + if (const FE_Q_Base *source_fe + = dynamic_cast*>(&x_source_fe)) { // ok, source is a Q element, so we will be able to do the work Assert (interpolation_matrix.m() == this->dofs_per_cell, @@ -559,11 +560,11 @@ get_interpolation_matrix (const FiniteElement &x_source_fe, -template +template void -FE_Q_Base:: +FE_Q_Base:: get_face_interpolation_matrix (const FiniteElement &source_fe, - FullMatrix &interpolation_matrix) const + FullMatrix &interpolation_matrix) const { Assert (dim > 1, ExcImpossibleInDim(1)); get_subface_interpolation_matrix (source_fe, numbers::invalid_unsigned_int, @@ -572,20 +573,20 @@ get_face_interpolation_matrix (const FiniteElement &source_fe, -template +template void -FE_Q_Base:: +FE_Q_Base:: get_subface_interpolation_matrix (const FiniteElement &x_source_fe, - const unsigned int subface, - FullMatrix &interpolation_matrix) const + const unsigned int subface, + FullMatrix &interpolation_matrix) const { Assert (interpolation_matrix.m() == x_source_fe.dofs_per_face, ExcDimensionMismatch (interpolation_matrix.m(), x_source_fe.dofs_per_face)); // see if source is a Q element - if (const FE_Q_Base *source_fe - = dynamic_cast *>(&x_source_fe)) + if (const FE_Q_Base *source_fe + = dynamic_cast *>(&x_source_fe)) { // have this test in here since a table of size 2x0 reports its size as // 0x0 @@ -665,9 +666,9 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe -template +template bool -FE_Q_Base::hp_constraints_are_implemented () const +FE_Q_Base::hp_constraints_are_implemented () const { return true; } @@ -675,16 +676,16 @@ FE_Q_Base::hp_constraints_are_implemented () const -template +template std::vector > -FE_Q_Base:: +FE_Q_Base:: hp_vertex_dof_identities (const FiniteElement &fe_other) const { // we can presently only compute these identities if both FEs are FE_Qs or // if the other one is an FE_Nothing. in the first case, there should be // exactly one single DoF of each FE at a vertex, and they should have // identical value - if (dynamic_cast*>(&fe_other) != 0) + if (dynamic_cast*>(&fe_other) != 0) { return std::vector > @@ -716,14 +717,15 @@ hp_vertex_dof_identities (const FiniteElement &fe_other) const -template +template std::vector > -FE_Q_Base:: +FE_Q_Base:: hp_line_dof_identities (const FiniteElement &fe_other) const { // we can presently only compute these identities if both FEs are FE_Qs or // if the other one is an FE_Nothing - if (const FE_Q_Base *fe_q_other = dynamic_cast*>(&fe_other)) + if (const FE_Q_Base *fe_q_other + = dynamic_cast*>(&fe_other)) { // dofs are located along lines, so two dofs are identical if they are // located at identical positions. if we had only equidistant points, we @@ -778,14 +780,15 @@ hp_line_dof_identities (const FiniteElement &fe_other) const -template +template std::vector > -FE_Q_Base:: +FE_Q_Base:: hp_quad_dof_identities (const FiniteElement &fe_other) const { // we can presently only compute these identities if both FEs are FE_Qs or // if the other one is an FE_Nothing - if (const FE_Q_Base *fe_q_other = dynamic_cast*>(&fe_other)) + if (const FE_Q_Base *fe_q_other + = dynamic_cast*>(&fe_other)) { // this works exactly like the line case above, except that now we have // to have two indices i1, i2 and j1, j2 to characterize the dofs on the @@ -844,13 +847,13 @@ hp_quad_dof_identities (const FiniteElement &fe_other) cons -template +template FiniteElementDomination::Domination -FE_Q_Base:: +FE_Q_Base:: compare_for_face_domination (const FiniteElement &fe_other) const { - if (const FE_Q_Base *fe_q_other - = dynamic_cast*>(&fe_other)) + if (const FE_Q_Base *fe_q_other + = dynamic_cast*>(&fe_other)) { if (this->degree < fe_q_other->degree) return FiniteElementDomination::this_element_dominates; @@ -884,8 +887,9 @@ compare_for_face_domination (const FiniteElement &fe_other) const -template -void FE_Q_Base::initialize_unit_support_points (const std::vector > &points) +template +void FE_Q_Base::initialize_unit_support_points +(const std::vector > &points) { const std::vector &index_map_inverse= this->poly_space.get_numbering_inverse(); @@ -900,8 +904,9 @@ void FE_Q_Base::initialize_unit_support_points (const std::ve -template -void FE_Q_Base::initialize_unit_face_support_points (const std::vector > &points) +template +void FE_Q_Base::initialize_unit_face_support_points +(const std::vector > &points) { // no faces in 1d, so nothing to do if (dim == 1) @@ -923,9 +928,9 @@ void FE_Q_Base::initialize_unit_face_support_points (const st -template +template void -FE_Q_Base::initialize_quad_dof_index_permutation () +FE_Q_Base::initialize_quad_dof_index_permutation () { // for 1D and 2D, do nothing if (dim < 3) @@ -990,9 +995,9 @@ FE_Q_Base::initialize_quad_dof_index_permutation () -template +template unsigned int -FE_Q_Base:: +FE_Q_Base:: face_to_cell_index (const unsigned int face_index, const unsigned int face, const bool face_orientation, @@ -1111,9 +1116,9 @@ face_to_cell_index (const unsigned int face_index, -template +template std::vector -FE_Q_Base::get_dpo_vector(const unsigned int deg) +FE_Q_Base::get_dpo_vector(const unsigned int deg) { AssertThrow(deg>0,ExcMessage("FE_Q needs to be of degree > 0.")); std::vector dpo(dim+1, 1U); @@ -1124,18 +1129,19 @@ FE_Q_Base::get_dpo_vector(const unsigned int deg) -template +template void -FE_Q_Base::initialize_constraints (const std::vector > &points) +FE_Q_Base::initialize_constraints +(const std::vector > &points) { Implementation::initialize_constraints (points, *this); } -template +template const FullMatrix & -FE_Q_Base +FE_Q_Base ::get_prolongation_matrix (const unsigned int child, const RefinementCase &refinement_case) const { @@ -1310,9 +1316,9 @@ FE_Q_Base -template +template const FullMatrix & -FE_Q_Base +FE_Q_Base ::get_restriction_matrix (const unsigned int child, const RefinementCase &refinement_case) const { @@ -1446,10 +1452,11 @@ FE_Q_Base //--------------------------------------------------------------------------- -template +template bool -FE_Q_Base::has_support_on_face (const unsigned int shape_index, - const unsigned int face_index) const +FE_Q_Base::has_support_on_face +(const unsigned int shape_index, + const unsigned int face_index) const { Assert (shape_index < this->dofs_per_cell, ExcIndexRange (shape_index, 0, this->dofs_per_cell)); @@ -1546,9 +1553,9 @@ FE_Q_Base::has_support_on_face (const unsigned int shape_inde -template +template std::pair, std::vector > -FE_Q_Base::get_constant_modes () const +FE_Q_Base::get_constant_modes () const { Table<2,bool> constant_modes(1, this->dofs_per_cell); // We here just care for the constant mode due to the polynomial space diff --git a/tests/base/anisotropic_1.cc b/tests/base/anisotropic_1.cc index 17fd2b860a..31c308db77 100644 --- a/tests/base/anisotropic_1.cc +++ b/tests/base/anisotropic_1.cc @@ -32,10 +32,10 @@ using namespace Polynomials; -template -void check_poly(const Point &x, - const POLY1 &p, - const POLY2 &q) +template +void check_poly(const Point &x, + const PolynomialType1 &p, + const PolynomialType2 &q) { const unsigned int n = p.n(); diff --git a/tests/base/polynomial_test.cc b/tests/base/polynomial_test.cc index ab8f3251b6..16914f9bda 100644 --- a/tests/base/polynomial_test.cc +++ b/tests/base/polynomial_test.cc @@ -33,9 +33,9 @@ using namespace Polynomials; -template -void check_poly(const Point &x, - const POLY &p) +template +void check_poly(const Point &x, + const PolynomialType &p) { const unsigned int n = p.n(); const double eps = 5.0e-15; diff --git a/tests/base/polynomials_tensor.cc b/tests/base/polynomials_tensor.cc index 759873345f..1ddc6001aa 100644 --- a/tests/base/polynomials_tensor.cc +++ b/tests/base/polynomials_tensor.cc @@ -30,9 +30,9 @@ using namespace std; -template -void check_point (const Point &x, - const POLY &p) +template +void check_point (const Point &x, + const PolynomialType &p) { const unsigned int n = p.n(); std::vector > values(n);