]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Switch ScalarPolynomial<dim> -> BarycentricPolynomials<dim>
authorDavid Wells <drwells@email.unc.edu>
Fri, 15 Jan 2021 00:21:41 +0000 (19:21 -0500)
committerDavid Wells <drwells@email.unc.edu>
Thu, 21 Jan 2021 03:02:33 +0000 (22:02 -0500)
include/deal.II/simplex/polynomials.h
source/base/qprojector.cc
source/simplex/fe_lib.cc
source/simplex/polynomials.cc
tests/simplex/polynomials_01.cc

index b3cd474e9527a27188e7e1af48407e48ed686e3b..31acf50362fc7169dfe8d953528626dc5e092547 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <deal.II/base/scalar_polynomials_base.h>
 
+#include <deal.II/simplex/barycentric_polynomials.h>
+
 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;
   };
 
 
index 85a997f514aa9bd836b984fd3796979828ef037e..858a03c8f60af18805110bf1b04f4bd5b5c0769c 100644 (file)
@@ -18,7 +18,7 @@
 #include <deal.II/base/qprojector.h>
 #include <deal.II/base/tensor_product_polynomials.h>
 
-#include <deal.II/simplex/polynomials.h>
+#include <deal.II/simplex/barycentric_polynomials.h>
 
 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<Point<2>> points;
@@ -668,8 +668,8 @@ QProjector<3>::project_to_all_faces(
     std::vector<Point<3>> points;
     std::vector<double>   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)}));
 
index d06188f983304f1f7ec5ffba8c28525f934a3600..61c14b5a43a880e0b5b0bd14d4874e2279d86806 100644 (file)
@@ -283,7 +283,7 @@ namespace Simplex
     const std::vector<unsigned int> &                 dpo_vector,
     const typename FiniteElementData<dim>::Conformity conformity)
     : dealii::FE_Poly<dim, spacedim>(
-        Simplex::ScalarPolynomial<dim>(degree),
+        BarycentricPolynomials<dim>::get_fe_p_basis(degree),
         FiniteElementData<dim>(dpo_vector,
                                dim == 2 ? ReferenceCell::Type::Tri :
                                           ReferenceCell::Type::Tet,
index 4d8dff665abe10da0cf4ef42a43b6631d4dce776..58910a9a8749a0739400a1ae78145cb8eb6fae6a 100644 (file)
@@ -14,6 +14,7 @@
 // ---------------------------------------------------------------------
 
 
+#include <deal.II/simplex/barycentric_polynomials.h>
 #include <deal.II/simplex/polynomials.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -636,8 +637,8 @@ namespace Simplex
   ScalarWedgePolynomial<dim>::ScalarWedgePolynomial(const unsigned int degree)
     : ScalarPolynomialsBase<dim>(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))
   {}
 
 
index eb8c82cfccbc4026ed131fdbd4dcd9ec02ee7778..c501094a14876cbf49e6441629815c8d79ce2eac 100644 (file)
@@ -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 <deal.II/base/quadrature_lib.h>
@@ -30,8 +30,9 @@ template <int dim>
 void
 test(const unsigned int degree)
 {
-  Simplex::ScalarPolynomial<dim> poly(degree);
-  QSimplex<dim>                  quad(QGauss<dim>(degree + 1));
+  const auto poly =
+    Simplex::BarycentricPolynomials<dim>::get_fe_p_basis(degree);
+  QSimplex<dim> quad(QGauss<dim>(degree + 1));
 
   std::vector<double>         values(poly.n());
   std::vector<Tensor<1, dim>> grads(poly.n());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.