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.
1
#include "
quadrature/gauss_chebyshev.h
"
2
3
#include <cmath>
4
namespace
hummingbird
{
5
GaussChebyshev::GaussChebyshev
(
const
size_t
n_points
)
6
:
QuadratureBase
<double>(
ComputeChebyshevAbscissas
(
n_points
)) {
7
CreateWeightMap
();
8
}
9
10
std::vector<double>
GaussChebyshev::ComputeChebyshevAbscissas
(
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
19
double
GaussChebyshev::ComputeWeight
(
const
size_t
k,
const
size_t
n) {
20
return
M_PI /
static_cast<
double
>
(n);
21
}
22
}
// namespace hummingbird
hummingbird::GaussChebyshev::GaussChebyshev
GaussChebyshev(const size_t n_points)
Construct a new Gauss Chebyshev object.
Definition
gauss_chebyshev.cc:5
hummingbird::GaussChebyshev::ComputeChebyshevAbscissas
std::vector< double > ComputeChebyshevAbscissas(const size_t n_points)
Computes the abscissa values for Gauss Chebyshev quadrature. These are given by the explicit formula:
Definition
gauss_chebyshev.cc:10
hummingbird::GaussChebyshev::ComputeWeight
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,...
Definition
gauss_chebyshev.cc:19
hummingbird::QuadratureBase< double >::abscissas
const std::vector< double > & abscissas() const
Definition
quadrature_base.h:81
hummingbird::QuadratureBase< double >::CreateWeightMap
void CreateWeightMap()
Definition
quadrature_base.h:102
hummingbird::QuadratureBase< double >::QuadratureBase
QuadratureBase()=default
hummingbird::QuadratureBase< double >::n_points
size_t n_points() const
Definition
quadrature_base.h:88
gauss_chebyshev.h
hummingbird
Definition
bank_base.h:13
src
quadrature
gauss_chebyshev.cc
Generated by
1.17.0