From: David Wells Date: Fri, 15 Jan 2021 00:21:41 +0000 (-0500) Subject: Switch ScalarPolynomial -> BarycentricPolynomials X-Git-Tag: v9.3.0-rc1~587^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d031fef8c62400ed46079ce79c2a6799f9137a4e;p=dealii.git Switch ScalarPolynomial -> BarycentricPolynomials --- diff --git a/include/deal.II/simplex/polynomials.h b/include/deal.II/simplex/polynomials.h index b3cd474e95..31acf50362 100644 --- a/include/deal.II/simplex/polynomials.h +++ b/include/deal.II/simplex/polynomials.h @@ -21,6 +21,8 @@ #include +#include + DEAL_II_NAMESPACE_OPEN /** @@ -264,14 +266,14 @@ namespace Simplex private: /** - * Scalar polynomial defined on a triangle. + * Scalar polynomials defined on a triangle. */ - const ScalarPolynomial<2> poly_tri; + const BarycentricPolynomials<2> poly_tri; /** - * Scalar polynomial defined on a line. + * Scalar polynomials defined on a line. */ - const ScalarPolynomial<1> poly_line; + const BarycentricPolynomials<1> poly_line; }; diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index 85a997f514..858a03c8f6 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -18,7 +18,7 @@ #include #include -#include +#include DEAL_II_NAMESPACE_OPEN @@ -529,7 +529,7 @@ QProjector<2>::project_to_all_faces( // linear polynomial to map the reference quadrature points correctly // on faces - const Simplex::ScalarPolynomial<1> poly(1); + const auto poly = Simplex::BarycentricPolynomials<1>::get_fe_p_basis(1); // new (projected) quadrature points and weights std::vector> points; @@ -668,8 +668,8 @@ QProjector<3>::project_to_all_faces( std::vector> points; std::vector weights; - const Simplex::ScalarPolynomial<2> poly_tri(1); - const TensorProductPolynomials<2> poly_quad( + const auto poly_tri = Simplex::BarycentricPolynomials<2>::get_fe_p_basis(1); + const TensorProductPolynomials<2> poly_quad( Polynomials::generate_complete_Lagrange_basis( {Point<1>(0.0), Point<1>(1.0)})); diff --git a/source/simplex/fe_lib.cc b/source/simplex/fe_lib.cc index d06188f983..61c14b5a43 100644 --- a/source/simplex/fe_lib.cc +++ b/source/simplex/fe_lib.cc @@ -283,7 +283,7 @@ namespace Simplex const std::vector & dpo_vector, const typename FiniteElementData::Conformity conformity) : dealii::FE_Poly( - Simplex::ScalarPolynomial(degree), + BarycentricPolynomials::get_fe_p_basis(degree), FiniteElementData(dpo_vector, dim == 2 ? ReferenceCell::Type::Tri : ReferenceCell::Type::Tet, diff --git a/source/simplex/polynomials.cc b/source/simplex/polynomials.cc index 4d8dff665a..58910a9a87 100644 --- a/source/simplex/polynomials.cc +++ b/source/simplex/polynomials.cc @@ -14,6 +14,7 @@ // --------------------------------------------------------------------- +#include #include DEAL_II_NAMESPACE_OPEN @@ -636,8 +637,8 @@ namespace Simplex ScalarWedgePolynomial::ScalarWedgePolynomial(const unsigned int degree) : ScalarPolynomialsBase(degree, compute_n_polynomials_wedge(dim, degree)) - , poly_tri(degree) - , poly_line(degree) + , poly_tri(BarycentricPolynomials<2>::get_fe_p_basis(degree)) + , poly_line(BarycentricPolynomials<1>::get_fe_p_basis(degree)) {} diff --git a/tests/simplex/polynomials_01.cc b/tests/simplex/polynomials_01.cc index eb8c82cfcc..c501094a14 100644 --- a/tests/simplex/polynomials_01.cc +++ b/tests/simplex/polynomials_01.cc @@ -14,8 +14,8 @@ // --------------------------------------------------------------------- -// Test Simplex::ScalarPolynomial on an the points of an arbitrary quadrature -// rule. +// Test Simplex::BarycentricPolynomials on an the points of an arbitrary +// quadrature rule. #include @@ -30,8 +30,9 @@ template void test(const unsigned int degree) { - Simplex::ScalarPolynomial poly(degree); - QSimplex quad(QGauss(degree + 1)); + const auto poly = + Simplex::BarycentricPolynomials::get_fe_p_basis(degree); + QSimplex quad(QGauss(degree + 1)); std::vector values(poly.n()); std::vector> grads(poly.n());