From d2d9e1f349fd1277c1f14dabc8abbe65303c7cb1 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 25 Feb 2018 17:27:53 +0100 Subject: [PATCH] Move computation of QGaussLobattoChebyshev support points into helper namespace --- include/deal.II/base/quadrature_lib.h | 10 ----- source/base/quadrature_lib.cc | 62 +++++++++++++++------------ 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/include/deal.II/base/quadrature_lib.h b/include/deal.II/base/quadrature_lib.h index 2ff37bb651..ea545fa23c 100644 --- a/include/deal.II/base/quadrature_lib.h +++ b/include/deal.II/base/quadrature_lib.h @@ -575,16 +575,6 @@ class QGaussLobattoChebyshev : public Quadrature public: /// Generate a formula with n quadrature points QGaussLobattoChebyshev(const unsigned int n); - -private: - /// Computes the points of the quadrature formula. - static std::vector - get_quadrature_points(const unsigned int n); - - /// Computes the weights of the quadrature formula. - static std::vector - get_quadrature_weights(const unsigned int n); - }; /** diff --git a/source/base/quadrature_lib.cc b/source/base/quadrature_lib.cc index 1dec63ee94..bf7d86d59c 100644 --- a/source/base/quadrature_lib.cc +++ b/source/base/quadrature_lib.cc @@ -1322,43 +1322,49 @@ QGaussRadauChebyshev::QGaussRadauChebyshev (const unsigned int n, {} -template <> -std::vector -QGaussLobattoChebyshev<1>::get_quadrature_points(const unsigned int n) + +namespace internal { + namespace QGaussLobattoChebyshev + { + // Computes the points of the quadrature formula. + std::vector + get_quadrature_points(const unsigned int n) + { - std::vector points(n); - // n point quadrature: index from 0 to n-1 - for (unsigned short i=0; i points(n); + // n point quadrature: index from 0 to n-1 + for (unsigned short i=0; i + get_quadrature_weights(const unsigned int n) + { -template <> -std::vector -QGaussLobattoChebyshev<1>::get_quadrature_weights(const unsigned int n) -{ + std::vector weights(n); - std::vector weights(n); + for (unsigned short i=0; i QGaussLobattoChebyshev<1>::QGaussLobattoChebyshev(const unsigned int n) : @@ -1366,8 +1372,8 @@ QGaussLobattoChebyshev<1>::QGaussLobattoChebyshev(const unsigned int n) { Assert(n>1,ExcMessage("Need at least two points for Gauss-Lobatto quadrature rule")); - std::vector p=get_quadrature_points(n); - std::vector w=get_quadrature_weights(n); + std::vector p=internal::QGaussLobattoChebyshev::get_quadrature_points(n); + std::vector w=internal::QGaussLobattoChebyshev::get_quadrature_weights(n); for (unsigned int i=0; isize(); ++i) { -- 2.39.5