Chi-Tech
chi_math::QuadratureGaussLegendre Class Reference

#include <quadrature_gausslegendre.h>

Inheritance diagram for chi_math::QuadratureGaussLegendre:
chi_math::Quadrature ChiObject chi_math::QuadratureLine

Public Member Functions

 QuadratureGaussLegendre (const chi::InputParameters &params)
 
 QuadratureGaussLegendre (QuadratureOrder in_order, bool verbose=false, unsigned int max_iters=1000, double tol=1.0e-12)
 
 QuadratureGaussLegendre (unsigned int N, bool verbose=false, unsigned int max_iters=1000, double tol=1.0e-12)
 
- Public Member Functions inherited from chi_math::Quadrature
const std::pair< double, double > & GetRange () const
 
void SetRange (const std::pair< double, double > &in_range)
 
- Public Member Functions inherited from ChiObject
 ChiObject ()
 
 ChiObject (const chi::InputParameters &params)
 
void SetStackID (size_t stack_id)
 
size_t StackID () const
 
virtual void PushOntoStack (std::shared_ptr< ChiObject > &new_object)
 
virtual ~ChiObject ()=default
 

Static Public Member Functions

static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from chi_math::Quadrature
static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from ChiObject
static chi::InputParameters GetInputParameters ()
 

Private Member Functions

void Initialize (unsigned int N, bool verbose, unsigned int max_iters, double tol)
 

Static Private Member Functions

static std::vector< double > FindRoots (unsigned int N, unsigned int max_iters=1000, double tol=1.0e-12)
 

Additional Inherited Members

- Data Fields inherited from chi_math::Quadrature
QuadratureOrder order_
 
std::vector< chi_math::QuadraturePointXYZqpoints_
 
std::vector< double > weights_
 
- Protected Member Functions inherited from chi_math::Quadrature
 Quadrature (const chi::InputParameters &params)
 
 Quadrature (QuadratureOrder in_order)
 
- Protected Attributes inherited from chi_math::Quadrature
std::pair< double, double > range_
 
bool verbose_ = false
 

Detailed Description

Gauss-Legendre quadrature.

Definition at line 13 of file quadrature_gausslegendre.h.

Constructor & Destructor Documentation

◆ QuadratureGaussLegendre() [1/3]

chi_math::QuadratureGaussLegendre::QuadratureGaussLegendre ( const chi::InputParameters params)
explicit

Definition at line 45 of file quadrature_gausslegendre.cc.

◆ QuadratureGaussLegendre() [2/3]

chi_math::QuadratureGaussLegendre::QuadratureGaussLegendre ( QuadratureOrder  in_order,
bool  verbose = false,
unsigned int  max_iters = 1000,
double  tol = 1.0e-12 
)
explicit

Populates the abscissae and weights for a Gauss-Legendre quadrature given the degree $ p $ of the mononomial such that the quadrature rule integrates exactly the weighted integrand $ \rho(x) x^{p} $, with $ \rho(x) := 1 $, on the interval $ [-1;+1] $. The number of points generated will be ceil((O+1)/2).

Definition at line 79 of file quadrature_gausslegendre.cc.

◆ QuadratureGaussLegendre() [3/3]

chi_math::QuadratureGaussLegendre::QuadratureGaussLegendre ( unsigned int  N,
bool  verbose = false,
unsigned int  max_iters = 1000,
double  tol = 1.0e-12 
)
explicit

Populates the abscissae and weights for a Gauss-Legendre quadrature given the number of desired quadrature points. The order of the quadrature will be 2N-1.

Definition at line 93 of file quadrature_gausslegendre.cc.

Member Function Documentation

◆ FindRoots()

std::vector< double > chi_math::QuadratureGaussLegendre::FindRoots ( unsigned int  N,
unsigned int  max_iters = 1000,
double  tol = 1.0e-12 
)
staticprivate

Finds the roots of the Legendre polynomial.

The algorithm is that depicted in:

[1] Barrera-Figueroa, et al., "Multiple root finder algorithm for Legendre and Chebyshev polynomials via Newton's method", Annales Mathematicae et Informaticae, 33 (2006) pp. 3-13.

Parameters
NIs the order of the polynomial.
rootsIs a reference to the roots.
max_itersMaximum newton iterations to perform for each root. Default: 1000.
tolTolerance at which the newton iteration will be terminated. Default: 1.0e-12.
Author
Jan

Definition at line 161 of file quadrature_gausslegendre.cc.

◆ GetInputParameters()

chi::InputParameters chi_math::QuadratureGaussLegendre::GetInputParameters ( )
static

Definition at line 20 of file quadrature_gausslegendre.cc.

◆ Initialize()

void chi_math::QuadratureGaussLegendre::Initialize ( unsigned int  N,
bool  verbose,
unsigned int  max_iters,
double  tol 
)
private

Populates the abscissae and weights for a Gauss-Legendre quadrature given the number of desired quadrature points.

Definition at line 105 of file quadrature_gausslegendre.cc.


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