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

Base class for defining a quadrature set. More...

#include <quadrature_base.h>

Public Member Functions

 QuadratureBase ()=default
 QuadratureBase (const std::vector< T > abscissas)
 Construct a new Quadrature object.
double GetWeight (const unsigned int abscissa_index) const
 Get the weight value corresponding to a given abscissa value.
T 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< T > & abscissas () const
 Getter for the abscissas in the quadrature set.
size_t n_points () const
 Get total number of abscissas.

Protected Member Functions

void CreateWeightMap ()
 Create the weight map.
virtual double ComputeWeight (const size_t k, const size_t n)
 Compute the weight for the k-th abscissa for n total points.

Protected Attributes

std::vector< T > 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

template<typename T>
class hummingbird::QuadratureBase< T >

Base class for defining a quadrature set.

Template Parameters
TType of ordinates to be used

Definition at line 31 of file quadrature_base.h.

Constructor & Destructor Documentation

◆ QuadratureBase() [1/2]

template<typename T>
hummingbird::QuadratureBase< T >::QuadratureBase ( )
default

◆ QuadratureBase() [2/2]

template<typename T>
hummingbird::QuadratureBase< T >::QuadratureBase ( const std::vector< T > abscissas)
inline

Construct a new Quadrature object.

Parameters
abscissasVector of abscissa values for the quadrature

Definition at line 40 of file quadrature_base.h.

Member Function Documentation

◆ abscissas()

template<typename T>
const std::vector< T > & hummingbird::QuadratureBase< T >::abscissas ( ) const
inline

Getter for the abscissas in the quadrature set.

Returns
const std::vector<T>&

Definition at line 81 of file quadrature_base.h.

◆ ComputeWeight()

template<typename T>
virtual double hummingbird::QuadratureBase< T >::ComputeWeight ( const size_t k,
const size_t n )
inlineprotectedvirtual

Compute the weight for the k-th abscissa for n total points.

Parameters
kAbscissa index
nTotal number of points
Returns
Quadrature weight

Reimplemented in hummingbird::GaussChebyshev, hummingbird::GaussLegendre, and hummingbird::GaussLobattoLegendre.

Definition at line 117 of file quadrature_base.h.

◆ CreateWeightMap()

template<typename T>
void hummingbird::QuadratureBase< T >::CreateWeightMap ( )
inlineprotected

Create the weight map.

Definition at line 102 of file quadrature_base.h.

◆ GetAbscissa()

template<typename T>
T hummingbird::QuadratureBase< T >::GetAbscissa ( const unsigned int index) const
inline

Get the abscissa corresponding to the index.

Parameters
indexAbscissa index
Returns
T Abscissa object at index

Definition at line 58 of file quadrature_base.h.

◆ GetWeight()

template<typename T>
double hummingbird::QuadratureBase< T >::GetWeight ( const unsigned int abscissa_index) const
inline

Get the weight value corresponding to a given abscissa value.

Parameters
abscissa_indexAbscissa index
Returns
Weight value

Definition at line 48 of file quadrature_base.h.

◆ Integrate()

template<typename T>
double hummingbird::QuadratureBase< T >::Integrate ( const std::vector< QuadraturePair > & quad_pairs) const
inline

Integrate the function using the function value and its location on the quadrature grid.

Parameters
quad_pairsQuadraturePair object
Returns
Approximated integral using the quadrature set

Definition at line 67 of file quadrature_base.h.

◆ n_points()

template<typename T>
size_t hummingbird::QuadratureBase< T >::n_points ( ) const
inline

Get total number of abscissas.

Returns
size_t

Definition at line 88 of file quadrature_base.h.

Member Data Documentation

◆ abscissas_

template<typename T>
std::vector<T> hummingbird::QuadratureBase< T >::abscissas_
protected

Abscissa values.

Definition at line 92 of file quadrature_base.h.

◆ weight_map_

template<typename T>
std::map<unsigned int, double> hummingbird::QuadratureBase< T >::weight_map_
protected

Map to store the weights of the quadrature set where the keys are the indices corresponding to abscissa values.

Definition at line 96 of file quadrature_base.h.


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