Reference documentation for deal.II version 9.1.0-pre
quadrature_lib.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2018 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:
742  QDuffy(const Quadrature<1> &radial_quadrature,
743  const Quadrature<1> &angular_quadrature,
744  const double beta = 1.0);
745 
752  QDuffy(const unsigned int n, const double beta);
753 };
754 
761 template <int dim>
762 class QSplit : public Quadrature<dim>
763 {
764 public:
799  QSplit(const QSimplex<dim> &base, const Point<dim> &split_point);
800 };
801 
804 /* -------------- declaration of explicit specializations ------------- */
805 
806 template <>
807 QGauss<1>::QGauss(const unsigned int n);
808 template <>
809 QGaussLobatto<1>::QGaussLobatto(const unsigned int n);
810 
811 template <>
812 std::vector<double>
813 QGaussLog<1>::get_quadrature_points(const unsigned int);
814 template <>
815 std::vector<double>
816 QGaussLog<1>::get_quadrature_weights(const unsigned int);
817 
818 template <>
820 template <>
822 template <>
824 template <>
826 template <>
828 template <>
829 QGaussLog<1>::QGaussLog(const unsigned int n, const bool revert);
830 template <>
831 QGaussLogR<1>::QGaussLogR(const unsigned int n,
832  const Point<1> x0,
833  const double alpha,
834  const bool flag);
835 template <>
836 QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n,
837  const unsigned int index,
838  const bool flag);
839 template <>
840 QTelles<1>::QTelles(const Quadrature<1> &base_quad,
841  const Point<1> & singularity);
842 
843 
844 
845 DEAL_II_NAMESPACE_CLOSE
846 
847 #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)