hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
gauss_legendre_chebyshev.cc
Go to the documentation of this file.
2
3#include <cmath>
4
7
8namespace hummingbird {
9
11 const size_t n_polar) {
12 GaussChebyshev gc_azim_quad(n_half_azim);
13 GaussLegendre gl_polar_quad(n_polar);
14 size_t n_azim = 2 * n_half_azim;
15 size_t n_total = n_polar * n_azim;
16 abscissas_.reserve(n_total);
17
18 size_t counter = 0;
19 for (auto i = 0; i < n_polar; i++) {
20 double polar = gl_polar_quad.GetAbscissa(i);
21 for (auto j = 0; j < n_half_azim; j++) {
22 double azim = gc_azim_quad.GetAbscissa(j);
23
24 Ordinate positive(std::acos(azim), std::acos(polar));
25 abscissas_.push_back(std::move(positive));
26 double weight = gl_polar_quad.GetWeight(i) * gc_azim_quad.GetWeight(j);
27 weight_map_.insert({counter, weight});
28 counter++;
29
30 Ordinate negative(-std::acos(azim), std::acos(polar));
31 abscissas_.push_back(std::move(negative));
32 weight_map_.insert({counter, weight});
33 counter++;
34 }
35 }
36}
37
38} // namespace hummingbird
Class defines a Gauss-Chebyshev quadrature set, which approximates the integral of the form:
GaussLegendreChebyshev(const size_t n_half_azim, const size_t n_polar)
Construct a new Gauss Legendre Chebyshev object.
Defines a Gauss-Legendre quadrature set on the interval [-1,1].
Defines a solid angle, or ordinate, in spherical geometry.
Definition ordinate.h:15
std::map< unsigned int, double > weight_map_
T GetAbscissa(const unsigned int index) const
Get the abscissa corresponding to the index.
double GetWeight(const unsigned int abscissa_index) const
Get the weight value corresponding to a given abscissa value.