hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
hummingbird::GaussChebyshev Class Reference

Class defines a Gauss-Chebyshev quadrature set, which approximates the integral of the form: More...

#include <gauss_chebyshev.h>

Inheritance diagram for hummingbird::GaussChebyshev:
[legend]
Collaboration diagram for hummingbird::GaussChebyshev:
[legend]

Public Member Functions

 GaussChebyshev (const size_t n_points)
 Construct a new Gauss Chebyshev object.
Public Member Functions inherited from hummingbird::QuadratureBase< double >
 QuadratureBase ()=default
double GetWeight (const unsigned int abscissa_index) const
 Get the weight value corresponding to a given abscissa value.
double GetAbscissa (const unsigned int index) const
 Get the abscissa corresponding to the index.
double Integrate (const std::vector< QuadraturePair > &quad_pairs) const
 Integrate the function using the function value and its location on the quadrature grid.
const std::vector< double > & abscissas () const
 Getter for the abscissas in the quadrature set.
size_t n_points () const
 Get total number of abscissas.

Private Member Functions

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, all weights are equal and are given by:

Additional Inherited Members

Protected Member Functions inherited from hummingbird::QuadratureBase< double >
void CreateWeightMap ()
 Create the weight map.
Protected Attributes inherited from hummingbird::QuadratureBase< double >
std::vector< double > abscissas_
 Abscissa values.
std::map< unsigned int, double > weight_map_
 Map to store the weights of the quadrature set where the keys are the indices corresponding to abscissa values.

Detailed Description

Class defines a Gauss-Chebyshev quadrature set, which approximates the integral of the form:

\[\int^{1}_{-1}\frac{u(x)}{\sqrt{1-x^2}}dx\approx \sum_{k=0}^{N-1}w_k u(\xi_k) \]

Formulae for this class were taken from the textbook "High-Order Methods for Incompressible Fluid Flow" by Deville, Fischer, and Mund. https://doi.org/10.1017/CBO9780511546792 and https://mathworld.wolfram.com/Chebyshev-GaussQuadrature.html

Definition at line 23 of file gauss_chebyshev.h.

Constructor & Destructor Documentation

◆ GaussChebyshev()

hummingbird::GaussChebyshev::GaussChebyshev ( const size_t n_points)

Construct a new Gauss Chebyshev object.

Parameters
n_pointsTotal number of points desired

Definition at line 5 of file gauss_chebyshev.cc.

Member Function Documentation

◆ ComputeChebyshevAbscissas()

std::vector< double > hummingbird::GaussChebyshev::ComputeChebyshevAbscissas ( const size_t n_points)
private

Computes the abscissa values for Gauss Chebyshev quadrature. These are given by the explicit formula:

\[\xi_k=\cos \left( \frac{(2k+1)\pi}{2N} \right) \]

for N total points.

Parameters
n_pointsTotal number of points desired
Returns
std::vector<double>

Definition at line 10 of file gauss_chebyshev.cc.

◆ ComputeWeight()

double hummingbird::GaussChebyshev::ComputeWeight ( const size_t k,
const size_t n )
overrideprivatevirtual

Computes the quadrature weight for abscissa k of n total points. In Gauss-Chebyshev quadrature, all weights are equal and are given by:

\[w_k=\frac{\pi}{n} \]

Parameters
kAbscissa number (not used in computation)
nTotal number of points
Returns
Weight for abscissa k

Reimplemented from hummingbird::QuadratureBase< double >.

Definition at line 19 of file gauss_chebyshev.cc.


The documentation for this class was generated from the following files: