NeoPZ
|
Implements the Gaussian quadrature. Numerical Integration Abstract class. More...
#include <tpzgaussrule.h>
Public Types | |
enum | { NRULESLOBATTO_ORDER, NRULESLEGENDRE_ORDER } |
Public Member Functions | |
int | NInt () const |
Returns number of integration points. More... | |
int | Type () |
Returns the gaussian quadrature type (Legendre, Lobatto, Jacobi) More... | |
long double | Loc (int i) const |
Returns location of the ith point. More... | |
long double | W (int i) const |
Returns weight for the ith point. More... | |
long double | Alpha () |
Returns ALPHA: it is the exponent of (1-X) in the quadrature rule: . More... | |
long double | Beta () |
Returns BETA: it is the exponent of (1-X) in the quadrature rule: . More... | |
int | Order () |
return the order of the integration rule More... | |
void | SetParametersJacobi (long double alpha, long double beta) |
Sets alpha and beta, the parameters of the Jacobi polynomials. More... | |
void | SetType (int &type, int order) |
Sets a gaussian quadrature: 0 - Gauss Legendre, 1 - Gauss Lobatto, 2 - Gauss Jacobi with alpha = beta = 1., 3 - Gauss Chebyshev for alpha = beta = -0.5. More... | |
void | Print (std::ostream &out=std::cout) |
Prints the number of integration points, all points and weights (as one dimension) More... | |
Protected Member Functions | |
int | ComputingGaussLegendreQuadrature (int order) |
Computes the points and weights for Gauss Legendre Quadrature over the parametric 1D element [-1.0, 1.0]. More... | |
void | ComputingGaussLegendreQuadrature (int *npoints, TPZVec< long double > &Location, TPZVec< long double > &Weight) |
Computes the points and weights for Gauss Legendre Quadrature over the parametric 1D element [-1.0, 1.0] It is util to be called by another rule that need the Gaussian quadrature based on number of points not on order. More... | |
int | ComputingGaussLobattoQuadrature (int order) |
Computes the points and weights for Gauss Lobatto Quadrature over the parametric 1D element It is to integrate functions , but the first and last integration points are and respectively. More... | |
int | ComputingGaussJacobiQuadrature (int order, long double alpha, long double beta) |
Computes the points and weights for Gauss Lobatto Quadrature over the parametric 1D element It is to integrate functions , but one of integration point is or . More... | |
void | ComputingGaussJacobiQuadrature (int *npoints, long double alpha, long double beta, TPZVec< long double > &Location, TPZVec< long double > &Weight) |
Compute numerical integration points and weight for Gauss Jacobi quadrature over It is to integrate functions as . It is util to be called by another rule. Do not stores the integration points and weights in the current instance. More... | |
long double | JacobiPolinomial (long double x, int order, long double alpha, long double beta, TPZVec< long double > &b, TPZVec< long double > &c, long double *dp2, long double *p1) |
Evaluates the Jacobi polinomial for real x. More... | |
long double | JacobiPolinomial (long double x, int alpha, int beta, unsigned int n) |
Evaluates the polinomial Jacobi on x point. More... | |
int | ComputingGaussChebyshevQuadrature (int order) |
Computes the points and weights for Gauss Chebyshev Quadrature over the parametric 1D element [-1.0, 1.0] It is to integrate functions as . More... | |
Private Member Functions | |
TPZGaussRule (int order, int type=0, long double alpha=0.0L, long double beta=0.0L) | |
Constructor of quadrature rule. More... | |
TPZGaussRule (const TPZGaussRule ©) | |
TPZGaussRule & | operator= (const TPZGaussRule ©) |
~TPZGaussRule () | |
Default destructor. More... | |
Private Attributes | |
int | fType |
fType = 1 (Gauss Lobatto quadrature), fType = 2 (Gauss Jacobi quadrature) for any alpha and beta the parameters of Jacobi polynomials, fType = 3 (Gauss Chebyshev) is a special Gauss Jacobi quadrature for alpha = -.5 and beta = -0.5 fType = 0(default) (Gauss Legendre quadrature) is a special Gauss Jacobi quadrature for alpha = beta = 0.0 More... | |
int | fNumInt |
Number of integration points for this object. More... | |
TPZVec< long double > | fLocation |
Location of the integration point. More... | |
TPZVec< long double > | fWeight |
Weight of the integration point. More... | |
long double | fAlpha |
ALPHA is the exponent of (1-X) in the quadrature rule: weight = (1-X)^ALPHA * (1+X)^BETA. More... | |
long double | fBeta |
BETA is the exponent of (1+X) in the quadrature rule: weight = (1-X)^ALPHA * (1+X)^BETA. More... | |
int | fOrder |
order of the integration rule More... | |
Friends | |
class | TPZIntRuleP3D |
A instance of the cubature rule for pyramid can access computing methods to construct its points and weights. More... | |
class | TPZIntRuleList |
The list can to access the constructor of the current class. More... | |
Implements the Gaussian quadrature. Numerical Integration Abstract class.
Definition at line 19 of file tpzgaussrule.h.
anonymous enum |
Enumerator | |
---|---|
NRULESLOBATTO_ORDER | |
NRULESLEGENDRE_ORDER |
Definition at line 67 of file tpzgaussrule.h.
|
private |
Constructor of quadrature rule.
order | Order of the polinomial will be integrated exactly with this cubature rule |
type | Identifies the type of integration points constructed |
alpha | Exponent of the factor (1 - ksi) to Jacobi type |
beta | Exponent of the factor (1 + ksi) to Jacobi type |
Definition at line 22 of file tpzgaussrule.cpp.
|
private |
Definition at line 66 of file tpzgaussrule.cpp.
|
private |
Default destructor.
Definition at line 88 of file tpzgaussrule.cpp.
References fLocation, fNumInt, fWeight, and TPZVec< T >::Resize().
|
inline |
Returns ALPHA: it is the exponent of (1-X) in the quadrature rule: .
Definition at line 81 of file tpzgaussrule.h.
References fAlpha.
|
inline |
Returns BETA: it is the exponent of (1-X) in the quadrature rule: .
Definition at line 83 of file tpzgaussrule.h.
References fBeta.
|
protected |
Computes the points and weights for Gauss Chebyshev Quadrature over the parametric 1D element [-1.0, 1.0] It is to integrate functions as .
order | Order of the polinomial will be integrated exactly with this cubature rule |
Definition at line 242 of file tpzgaussrule.cpp.
References fLocation, fNumInt, fWeight, and TPZVec< T >::Resize().
Referenced by SetParametersJacobi(), and SetType().
|
protected |
Computes the points and weights for Gauss Lobatto Quadrature over the parametric 1D element It is to integrate functions , but one of integration point is or .
order | Order of the polinomial will be integrated exactly with this cubature rule Compute numerical integration points and weight for Gauss Jacobi quadrature over It is to integrate functions as |
order | Order of the polinomial will be integrated exactly with this cubature rule |
alpha | Exponent of the factor (1 - ksi) to Jacobi type |
beta | Exponent of the factor (1 + ksi) to Jacobi type |
Gauss Jacobi quadrature
Definition at line 379 of file tpzgaussrule.cpp.
References fLocation, fNumInt, and fWeight.
Referenced by TPZIntRuleP3D::ComputingCubatureRuleForPyramid(), SetParametersJacobi(), and SetType().
|
protected |
Compute numerical integration points and weight for Gauss Jacobi quadrature over It is to integrate functions as . It is util to be called by another rule. Do not stores the integration points and weights in the current instance.
npoints | Number of integration points |
alpha | Exponent of factor (1+x) |
beta | Exponent of factor (1-x) |
Location | Vector of integration points ksi |
Weight | Vector of corresponding weights |
Gauss Jacobi quadrature
Definition at line 390 of file tpzgaussrule.cpp.
References gamma(), JacobiPolinomial(), machinePrecision(), pow(), and TPZVec< T >::Resize().
|
protected |
Computes the points and weights for Gauss Legendre Quadrature over the parametric 1D element [-1.0, 1.0].
order | Order of the polinomial will be integrated exactly with this cubature rule |
GAUSS LEGENDRE QUADRATURE
Definition at line 170 of file tpzgaussrule.cpp.
References fLocation, fNumInt, fWeight, and NRULESLEGENDRE_ORDER.
Referenced by TPZIntRuleP3D::ComputingCubatureRuleForPyramid(), SetParametersJacobi(), and SetType().
|
protected |
Computes the points and weights for Gauss Legendre Quadrature over the parametric 1D element [-1.0, 1.0] It is util to be called by another rule that need the Gaussian quadrature based on number of points not on order.
npoints | Number of integration points |
Location | Vector of integration points ksi |
Weight | Vector of corresponding weights |
Definition at line 183 of file tpzgaussrule.cpp.
References fabs, m, machinePrecision(), PZINTEGRAL_MAXITERATIONS_ALLOWED, TPZVec< T >::Resize(), and pzgeom::tol.
|
protected |
Computes the points and weights for Gauss Lobatto Quadrature over the parametric 1D element It is to integrate functions , but the first and last integration points are and respectively.
order | Order of the polinomial will be integrated exactly with this cubature rule |
Computes the points and weights for Gauss Lobatto quadrature
Definition at line 288 of file tpzgaussrule.cpp.
References test::f, fabs, fLocation, fNumInt, fWeight, gamma(), JacobiPolinomial(), m, NRULESLOBATTO_ORDER, PZINTEGRAL_MAXITERATIONS_ALLOWED, TPZVec< T >::Resize(), and pzgeom::tol.
Referenced by SetParametersJacobi(), and SetType().
|
protected |
Evaluates the Jacobi polinomial for real x.
x | Real number to compute J(x) |
order | Order of the polinomial |
alpha | Exponent of factor (1+x) |
beta | Exponent of factor (1-x) |
b | Recursion coefficients (Jacobi matrix) |
c | Recursion coefficients |
dp2 | Returns the value of J'(x) |
p1 | Returns the value of J[order-1](x), where J[order-1] represent the Jacobi polinomial to degree order-1. |
Evaluate the Jacobi polinomial with alpha and beta real numbers
Definition at line 527 of file tpzgaussrule.cpp.
Referenced by ComputingGaussJacobiQuadrature(), ComputingGaussLobattoQuadrature(), and SetParametersJacobi().
|
protected |
Evaluates the polinomial Jacobi on x point.
x | point on the polinomial Jacobi is evaluated, J(x) |
n | is the order of the polinomial |
alpha | is the exponent of the factor (1-x) |
beta | is the exponent of the factor (1+x) |
Definition at line 262 of file tpzgaussrule.cpp.
long double TPZGaussRule::Loc | ( | int | i | ) | const |
Returns location of the ith point.
Definition at line 96 of file tpzgaussrule.cpp.
References fLocation, fNumInt, and PZError.
Referenced by TPZPrInteg< TFather >::Point(), and Type().
|
inline |
Returns number of integration points.
Definition at line 70 of file tpzgaussrule.h.
References fNumInt.
Referenced by TPZPrInteg< TFather >::NPoints(), and TPZPrInteg< TFather >::Point().
|
private |
|
inline |
return the order of the integration rule
Definition at line 86 of file tpzgaussrule.h.
References fOrder.
Referenced by TPZInt1d::SetOrder(), TPZIntCube3D::SetOrder(), TPZInt1d::TPZInt1d(), TPZIntCube3D::TPZIntCube3D(), and TPZIntQuad::TPZIntQuad().
void TPZGaussRule::Print | ( | std::ostream & | out = std::cout | ) |
Prints the number of integration points, all points and weights (as one dimension)
Definition at line 116 of file tpzgaussrule.cpp.
References fLocation, fNumInt, fType, and fWeight.
Referenced by TPZInt1d::Print(), and SetParametersJacobi().
|
inline |
Sets alpha and beta, the parameters of the Jacobi polynomials.
alpha | Exponent of the factor (1 - ksi) to Jacobi type |
beta | Exponent of the factor (1 + ksi) to Jacobi type |
Definition at line 95 of file tpzgaussrule.h.
References ComputingGaussChebyshevQuadrature(), ComputingGaussJacobiQuadrature(), ComputingGaussLegendreQuadrature(), ComputingGaussLobattoQuadrature(), gamma(), JacobiPolinomial(), machinePrecision(), Print(), and SetType().
void TPZGaussRule::SetType | ( | int & | type, |
int | order | ||
) |
Sets a gaussian quadrature: 0 - Gauss Legendre, 1 - Gauss Lobatto, 2 - Gauss Jacobi with alpha = beta = 1., 3 - Gauss Chebyshev for alpha = beta = -0.5.
order | Order of the polinomial will be integrated exactly with this cubature rule |
type | Identifies the type of integration points constructed |
Definition at line 131 of file tpzgaussrule.cpp.
References ComputingGaussChebyshevQuadrature(), ComputingGaussJacobiQuadrature(), ComputingGaussLegendreQuadrature(), ComputingGaussLobattoQuadrature(), DebugStop, fAlpha, fBeta, fLocation, fType, fWeight, and TPZVec< T >::Resize().
Referenced by SetParametersJacobi(), TPZInt1d::SetType(), TPZIntQuad::SetType(), and TPZIntCube3D::SetType().
|
inline |
Returns the gaussian quadrature type (Legendre, Lobatto, Jacobi)
Definition at line 73 of file tpzgaussrule.h.
References fType, Loc(), and W().
Referenced by TPZIntQuad::SetOrder().
long double TPZGaussRule::W | ( | int | i | ) | const |
Returns weight for the ith point.
Definition at line 107 of file tpzgaussrule.cpp.
References fNumInt, fWeight, and PZError.
Referenced by TPZPrInteg< TFather >::Point(), and Type().
|
friend |
The list can to access the constructor of the current class.
Definition at line 32 of file tpzgaussrule.h.
|
friend |
A instance of the cubature rule for pyramid can access computing methods to construct its points and weights.
Definition at line 29 of file tpzgaussrule.h.
|
private |
ALPHA is the exponent of (1-X) in the quadrature rule: weight = (1-X)^ALPHA * (1+X)^BETA.
Definition at line 42 of file tpzgaussrule.h.
Referenced by Alpha(), operator=(), and SetType().
|
private |
BETA is the exponent of (1+X) in the quadrature rule: weight = (1-X)^ALPHA * (1+X)^BETA.
Definition at line 44 of file tpzgaussrule.h.
Referenced by Beta(), operator=(), and SetType().
|
private |
Location of the integration point.
Definition at line 37 of file tpzgaussrule.h.
Referenced by ComputingGaussChebyshevQuadrature(), ComputingGaussJacobiQuadrature(), ComputingGaussLegendreQuadrature(), ComputingGaussLobattoQuadrature(), Loc(), operator=(), Print(), SetType(), and ~TPZGaussRule().
|
private |
Number of integration points for this object.
Definition at line 35 of file tpzgaussrule.h.
Referenced by ComputingGaussChebyshevQuadrature(), ComputingGaussJacobiQuadrature(), ComputingGaussLegendreQuadrature(), ComputingGaussLobattoQuadrature(), Loc(), NInt(), operator=(), Print(), W(), and ~TPZGaussRule().
|
private |
order of the integration rule
Definition at line 47 of file tpzgaussrule.h.
Referenced by operator=(), and Order().
|
private |
fType = 1 (Gauss Lobatto quadrature), fType = 2 (Gauss Jacobi quadrature) for any alpha and beta the parameters of Jacobi polynomials, fType = 3 (Gauss Chebyshev) is a special Gauss Jacobi quadrature for alpha = -.5 and beta = -0.5 fType = 0(default) (Gauss Legendre quadrature) is a special Gauss Jacobi quadrature for alpha = beta = 0.0
Definition at line 26 of file tpzgaussrule.h.
Referenced by operator=(), Print(), SetType(), and Type().
|
private |
Weight of the integration point.
Definition at line 39 of file tpzgaussrule.h.
Referenced by ComputingGaussChebyshevQuadrature(), ComputingGaussJacobiQuadrature(), ComputingGaussLegendreQuadrature(), ComputingGaussLobattoQuadrature(), operator=(), Print(), SetType(), W(), and ~TPZGaussRule().