queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::WignerChebyshev2nd1DQuadrature Class Reference

Class for second type Chebyshev-Gauss quadrature rule for one-dimensional functions. More...

#include <1DQuadrature.h>

Inheritance diagram for QUESO::WignerChebyshev2nd1DQuadrature:
QUESO::Base1DQuadrature QUESO::BaseQuadrature

Public Member Functions

Constructor/Destructor methods
 WignerChebyshev2nd1DQuadrature (double minDomainValue, double maxDomainValue, unsigned int order)
 Default constructor. More...
 
 ~WignerChebyshev2nd1DQuadrature ()
 Destructor. More...
 
- Public Member Functions inherited from QUESO::Base1DQuadrature
 Base1DQuadrature (double minDomainValue, double maxDomainValue, unsigned int order)
 Default constructor. More...
 
virtual ~Base1DQuadrature ()=0
 Pure virtual destructor, forcing this to be an abstract object. More...
 
double minDomainValue () const
 Returns the minimum value of the domain of the (one-dimensional) function. More...
 
double maxDomainValue () const
 Returns the maximum value of the domain of the (one-dimensional) function. More...
 
unsigned int order () const
 Returns the order of the quadrature rule. More...
 
const std::vector< double > & positions () const
 Array of the positions for the numerical integration. More...
 
- Public Member Functions inherited from QUESO::BaseQuadrature
 BaseQuadrature ()
 
virtual ~BaseQuadrature ()=0
 Pure virtual destructor, forcing this to be an abstract object. More...
 
const std::vector< double > & weights () const
 Array of the weights used in the numerical integration. More...
 

Additional Inherited Members

- Protected Attributes inherited from QUESO::Base1DQuadrature
double m_minDomainValue
 
double m_maxDomainValue
 
unsigned int m_order
 
std::vector< double > m_positions
 
- Protected Attributes inherited from QUESO::BaseQuadrature
std::vector< double > m_weights
 

Detailed Description

Class for second type Chebyshev-Gauss quadrature rule for one-dimensional functions.

Chebyshev-Gauss quadrature, also called Chebyshev Type 2 quadrature, is a Gaussian quadrature over the interval [-1,1] with weighting function \( W(x)=\sqrt{1-x^2}\).
The abscissas for quadrature order \( n \) are given by the roots of the Chebyshev polynomial of the second kind \( U_n(x) \), which occur symmetrically about 0.
The abscissas are given explicitly by \( x_i=\cos[\frac{i\pi}{n+1}].\) and all the weights are \( w_i=\frac{\pi}{n+1}\sin^2[\frac{i\pi}{n+1}]. \)

See Also
Weisstein, Eric W. "Gaussian Quadrature." From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/GaussianQuadrature.html.
http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature.

Definition at line 267 of file 1DQuadrature.h.

Constructor & Destructor Documentation

QUESO::WignerChebyshev2nd1DQuadrature::WignerChebyshev2nd1DQuadrature ( double  minDomainValue,
double  maxDomainValue,
unsigned int  order 
)

Default constructor.

Constructs a Gaussian-Chebyshev quadrature (of second type) of order order, in the interval [minDomainValue,maxDomainValue]. This method scales the abscissas (positions) of the quadrature from the interval [-1,1] to [minDomainValue,maxDomainValue].

Definition at line 653 of file 1DQuadrature.C.

References QUESO::Base1DQuadrature::m_maxDomainValue, QUESO::Base1DQuadrature::m_minDomainValue, QUESO::Base1DQuadrature::m_order, QUESO::Base1DQuadrature::m_positions, and QUESO::BaseQuadrature::m_weights.

657  :
659 {
660  m_positions.resize(m_order+1,0.); // Yes, '+1'
661  m_weights.resize (m_order+1,0.); // Yes, '+1'
662 
663  // http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature
664  unsigned int n = m_order+1;
665  for (unsigned int i = 0; i < n; ++i) {
666  double angle = M_PI*((double)(i+1))/((double)(n+1));
667  double cosValue = cos(angle);
668  double sinValue = sin(angle);
669  m_positions[i] = cosValue;
670  m_weights[i] = ( M_PI/((double)(n+1)) )*sinValue*sinValue;
671  }
672 
673  // Scale positions from the interval [-1, 1] to the interval [min,max]
674  for (unsigned int j = 0; j < m_positions.size(); ++j) {
677  }
678 }
double maxDomainValue() const
Returns the maximum value of the domain of the (one-dimensional) function.
Definition: 1DQuadrature.C:61
double minDomainValue() const
Returns the minimum value of the domain of the (one-dimensional) function.
Definition: 1DQuadrature.C:55
Base1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order)
Default constructor.
Definition: 1DQuadrature.C:34
std::vector< double > m_weights
std::vector< double > m_positions
Definition: 1DQuadrature.h:83
unsigned int order() const
Returns the order of the quadrature rule.
Definition: 1DQuadrature.C:67
QUESO::WignerChebyshev2nd1DQuadrature::~WignerChebyshev2nd1DQuadrature ( )

Destructor.

Definition at line 680 of file 1DQuadrature.C.

681 {
682 }

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

Generated on Tue Jun 5 2018 19:49:19 for queso-0.57.1 by  doxygen 1.8.5