hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
gauss_chebyshev.cc
Go to the documentation of this file.
2
3#include <cmath>
4namespace hummingbird {
9
11 const size_t n_points) {
12 std::vector<double> abscissas(n_points);
13 for (auto i = 0; i < n_points; i++)
14 abscissas[i] = std::cos((2.0 * static_cast<double>(i) + 1.0) /
15 (2.0 * static_cast<double>(n_points)) * M_PI);
16 return abscissas;
17}
18
19double GaussChebyshev::ComputeWeight(const size_t k, const size_t n) {
20 return M_PI / static_cast<double>(n);
21}
22} // namespace hummingbird
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,...
const std::vector< double > & abscissas() const