hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
gauss_legendre.cc
Go to the documentation of this file.
2
4
5namespace hummingbird {
10
11double GaussLegendre::ComputeWeight(const size_t k, const size_t n) {
12 double abscissa = abscissas_.at(k);
13 double derivative_weight = LegendrePolynomialPrime(n, abscissa);
14 return 2.0 / (1 - abscissa * abscissa) / derivative_weight /
15 derivative_weight;
16}
17} // namespace hummingbird
GaussLegendre(const unsigned int n_points)
Construct a new GaussLegendre object.
double ComputeWeight(const size_t k, const size_t n) override
Compute the weight for abscissa value k for a n-th order Gauss-Legendre polynomial.
double LegendrePolynomialPrime(const int n, const double x)
Computes the first derivative of the Legendre polynomial of degree n at a point x using the recurrenc...
std::vector< double > AllLegendreRoots(const int n)
Compute all roots of the Legendre polynomial of order n.