hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
gauss_chebyshev.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2// Copyright (c) 2026, Liam Pohlmann
3
4#ifndef HUMMINGBIRD_QUADRATURE_GAUSS_CHEBYSHEV_H_
5#define HUMMINGBIRD_QUADRATURE_GAUSS_CHEBYSHEV_H_
6
8
9namespace hummingbird {
10/**
11 * @brief Class defines a Gauss-Chebyshev quadrature set, which approximates the
12 * integral of the form:
13 *
14 * \f[
15 * \int^{1}_{-1}\frac{u(x)}{\sqrt{1-x^2}}dx\approx \sum_{k=0}^{N-1}w_k u(\xi_k)
16 * \f]
17 *
18 * Formulae for this class were taken from the textbook "High-Order Methods for
19 * Incompressible Fluid Flow" by Deville, Fischer, and Mund.
20 * https://doi.org/10.1017/CBO9780511546792 and
21 * https://mathworld.wolfram.com/Chebyshev-GaussQuadrature.html
22 */
23class GaussChebyshev : public QuadratureBase<double> {
24 public:
25 /**
26 * @brief Construct a new Gauss Chebyshev object
27 *
28 * @param n_points Total number of points desired
29 */
30 GaussChebyshev(const size_t n_points);
31
32 private:
33 /**
34 * @brief Computes the abscissa values for Gauss Chebyshev quadrature. These
35 * are given by the explicit formula:
36 *
37 * \f[
38 * \xi_k=\cos \left( \frac{(2k+1)\pi}{2N} \right)
39 * \f]
40 * for N total points.
41 *
42 * @param n_points Total number of points desired
43 * @return std::vector<double>
44 */
45 std::vector<double> ComputeChebyshevAbscissas(const size_t n_points);
46
47 /**
48 * @brief Computes the quadrature weight for abscissa k of n total points. In
49 * Gauss-Chebyshev quadrature, all weights are equal and are given by:
50 *
51 * \f[
52 * w_k=\frac{\pi}{n}
53 * \f]
54 *
55 * @param k Abscissa number (not used in computation)
56 * @param n Total number of points
57 * @return Weight for abscissa k
58 */
59 double ComputeWeight(const size_t k, const size_t n) override;
60};
61} // namespace hummingbird
62
63#endif // HUMMINGBIRD_QUADRATURE_GAUSS_CHEBYSHEV_H_
GaussChebyshev(const size_t n_points)
Construct a new Gauss Chebyshev object.
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,...