Class defines a Gauss-Chebyshev quadrature set, which approximates the integral of the form: More...
#include <gauss_chebyshev.h>
Public Member Functions | |
| GaussChebyshev (const size_t n_points) | |
| Construct a new Gauss Chebyshev object. | |
| Public Member Functions inherited from hummingbird::QuadratureBase< double > | |
| QuadratureBase ()=default | |
| double | GetWeight (const unsigned int abscissa_index) const |
| Get the weight value corresponding to a given abscissa value. | |
| double | GetAbscissa (const unsigned int index) const |
| Get the abscissa corresponding to the index. | |
| double | Integrate (const std::vector< QuadraturePair > &quad_pairs) const |
| Integrate the function using the function value and its location on the quadrature grid. | |
| const std::vector< double > & | abscissas () const |
| Getter for the abscissas in the quadrature set. | |
| size_t | n_points () const |
| Get total number of abscissas. | |
Private Member Functions | |
| std::vector< double > | ComputeChebyshevAbscissas (const size_t n_points) |
| Computes the abscissa values for Gauss Chebyshev quadrature. These are given by the explicit formula: | |
| double | ComputeWeight (const size_t k, const size_t n) override |
| Computes the quadrature weight for abscissa k of n total points. In Gauss-Chebyshev quadrature, all weights are equal and are given by: | |
Additional Inherited Members | |
| Protected Member Functions inherited from hummingbird::QuadratureBase< double > | |
| void | CreateWeightMap () |
| Create the weight map. | |
| Protected Attributes inherited from hummingbird::QuadratureBase< double > | |
| std::vector< double > | abscissas_ |
| Abscissa values. | |
| std::map< unsigned int, double > | weight_map_ |
| Map to store the weights of the quadrature set where the keys are the indices corresponding to abscissa values. | |
Class defines a Gauss-Chebyshev quadrature set, which approximates the integral of the form:
\[\int^{1}_{-1}\frac{u(x)}{\sqrt{1-x^2}}dx\approx \sum_{k=0}^{N-1}w_k u(\xi_k) \]
Formulae for this class were taken from the textbook "High-Order Methods for Incompressible Fluid Flow" by Deville, Fischer, and Mund. https://doi.org/10.1017/CBO9780511546792 and https://mathworld.wolfram.com/Chebyshev-GaussQuadrature.html
Definition at line 23 of file gauss_chebyshev.h.
| hummingbird::GaussChebyshev::GaussChebyshev | ( | const size_t | n_points | ) |
Construct a new Gauss Chebyshev object.
| n_points | Total number of points desired |
Definition at line 5 of file gauss_chebyshev.cc.
|
private |
Computes the abscissa values for Gauss Chebyshev quadrature. These are given by the explicit formula:
\[\xi_k=\cos \left( \frac{(2k+1)\pi}{2N} \right) \]
for N total points.
| n_points | Total number of points desired |
Definition at line 10 of file gauss_chebyshev.cc.
|
overrideprivatevirtual |
Computes the quadrature weight for abscissa k of n total points. In Gauss-Chebyshev quadrature, all weights are equal and are given by:
\[w_k=\frac{\pi}{n} \]
| k | Abscissa number (not used in computation) |
| n | Total number of points |
Reimplemented from hummingbird::QuadratureBase< double >.
Definition at line 19 of file gauss_chebyshev.cc.