Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
quadrature_lib.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_quadrature_lib_h
17 #define dealii_quadrature_lib_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/quadrature.h>
23 
24 DEAL_II_NAMESPACE_OPEN
25 
28 
39 template <int dim>
40 class QGauss : public Quadrature<dim>
41 {
42 public:
47  QGauss(const unsigned int n);
48 };
49 
50 
75 template <int dim>
76 class QGaussLobatto : public Quadrature<dim>
77 {
78 public:
83  QGaussLobatto(const unsigned int n);
84 };
85 
86 
87 
92 template <int dim>
93 class QMidpoint : public Quadrature<dim>
94 {
95 public:
96  QMidpoint();
97 };
98 
99 
104 template <int dim>
105 class QSimpson : public Quadrature<dim>
106 {
107 public:
108  QSimpson();
109 };
110 
111 
112 
125 template <int dim>
126 class QTrapez : public Quadrature<dim>
127 {
128 public:
129  QTrapez();
130 };
131 
132 
133 
140 template <int dim>
141 class QMilne : public Quadrature<dim>
142 {
143 public:
144  QMilne();
145 };
146 
147 
154 template <int dim>
155 class QWeddle : public Quadrature<dim>
156 {
157 public:
158  QWeddle();
159 };
160 
161 
162 
176 template <int dim>
177 class QGaussLog : public Quadrature<dim>
178 {
179 public:
183  QGaussLog(const unsigned int n, const bool revert = false);
184 
185 private:
189  static std::vector<double>
190  get_quadrature_points(const unsigned int n);
191 
195  static std::vector<double>
196  get_quadrature_weights(const unsigned int n);
197 };
198 
199 
200 
237 template <int dim>
238 class QGaussLogR : public Quadrature<dim>
239 {
240 public:
248  QGaussLogR(const unsigned int n,
249  const Point<dim> x0 = Point<dim>(),
250  const double alpha = 1,
251  const bool factor_out_singular_weight = false);
252 
258  QGaussLogR(QGaussLogR<dim> &&) noexcept = default;
259 
260 protected:
265  const double fraction;
266 };
267 
268 
292 template <int dim>
293 class QGaussOneOverR : public Quadrature<dim>
294 {
295 public:
328  QGaussOneOverR(const unsigned int n,
329  const Point<dim> singularity,
330  const bool factor_out_singular_weight = false);
365  QGaussOneOverR(const unsigned int n,
366  const unsigned int vertex_index,
367  const bool factor_out_singular_weight = false);
368 
369 private:
375  static unsigned int
376  quad_size(const Point<dim> singularity, const unsigned int n);
377 };
378 
379 
380 
390 template <int dim>
391 class QSorted : public Quadrature<dim>
392 {
393 public:
398  QSorted(const Quadrature<dim> &quad);
399 
400 private:
406  bool
407  compare_weights(const unsigned int a, const unsigned int b) const;
408 };
409 
466 template <int dim>
467 class QTelles : public Quadrature<dim>
468 {
469 public:
476  QTelles(const Quadrature<1> &base_quad, const Point<dim> &singularity);
482  QTelles(const unsigned int n, const Point<dim> &singularity);
483 };
484 
498 template <int dim>
499 class QGaussChebyshev : public Quadrature<dim>
500 {
501 public:
503  QGaussChebyshev(const unsigned int n);
504 };
505 
506 
523 template <int dim>
524 class QGaussRadauChebyshev : public Quadrature<dim>
525 {
526 public:
527  /* EndPoint is used to specify which of the two endpoints of the unit interval
528  * is used also as quadrature point
529  */
530  enum EndPoint
531  {
539  right
540  };
542  QGaussRadauChebyshev(const unsigned int n,
544 
549  QGaussRadauChebyshev(QGaussRadauChebyshev<dim> &&) noexcept = default;
550 
551 private:
552  const EndPoint ep;
553 };
554 
570 template <int dim>
572 {
573 public:
575  QGaussLobattoChebyshev(const unsigned int n);
576 };
577 
610 template <int dim>
611 class QSimplex : public Quadrature<dim>
612 {
613 public:
620  QSimplex(const Quadrature<dim> &quad);
621 
646  compute_affine_transformation(
647  const std::array<Point<dim>, dim + 1> &vertices) const;
648 };
649 
670 class QTrianglePolar : public QSimplex<2>
671 {
672 public:
680  QTrianglePolar(const Quadrature<1> &radial_quadrature,
681  const Quadrature<1> &angular_quadrature);
682 
689  QTrianglePolar(const unsigned int n);
690 };
691 
726 class QDuffy : public QSimplex<2>
727 {
728 public:
743  QDuffy(const Quadrature<1> &radial_quadrature,
744  const Quadrature<1> &angular_quadrature,
745  const double beta = 1.0);
746 
754  QDuffy(const unsigned int n, const double beta);
755 };
756 
763 template <int dim>
764 class QSplit : public Quadrature<dim>
765 {
766 public:
801  QSplit(const QSimplex<dim> &base, const Point<dim> &split_point);
802 };
803 
806 /* -------------- declaration of explicit specializations ------------- */
807 
808 template <>
809 QGauss<1>::QGauss(const unsigned int n);
810 template <>
811 QGaussLobatto<1>::QGaussLobatto(const unsigned int n);
812 
813 template <>
814 std::vector<double>
815 QGaussLog<1>::get_quadrature_points(const unsigned int);
816 template <>
817 std::vector<double>
818 QGaussLog<1>::get_quadrature_weights(const unsigned int);
819 
820 template <>
822 template <>
824 template <>
826 template <>
828 template <>
830 template <>
831 QGaussLog<1>::QGaussLog(const unsigned int n, const bool revert);
832 template <>
833 QGaussLogR<1>::QGaussLogR(const unsigned int n,
834  const Point<1> x0,
835  const double alpha,
836  const bool flag);
837 template <>
838 QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n,
839  const unsigned int index,
840  const bool flag);
841 template <>
842 QTelles<1>::QTelles(const Quadrature<1> &base_quad,
843  const Point<1> & singularity);
844 
845 
846 
847 DEAL_II_NAMESPACE_CLOSE
848 
849 #endif
QGaussLog(const unsigned int n, const bool revert=false)
QGaussOneOverR(const unsigned int n, const Point< dim > singularity, const bool factor_out_singular_weight=false)
const double fraction
static std::vector< double > get_quadrature_points(const unsigned int n)
QGauss(const unsigned int n)
static std::vector< double > get_quadrature_weights(const unsigned int n)
QGaussLobatto(const unsigned int n)
QTelles(const Quadrature< 1 > &base_quad, const Point< dim > &singularity)
QGaussLogR(const unsigned int n, const Point< dim > x0=Point< dim >(), const double alpha=1, const bool factor_out_singular_weight=false)