hp2FEM  0.1
Public Member Functions
Jacobi1D Class Reference

Class for 1D Jacobi polynomials. Calculates 1D Jacobi polynomials with weights Alpha and Beta and first and second order derivatives on the given coordinates. This class does not store any data. More...

#include <Jacobi1D.h>

List of all members.

Public Member Functions

 Jacobi1D ()
 Default constructor.
double Factorial (unsigned long n)
 Returns the factorial of an integer number n.
void GetPolynomialValue (unsigned long PolyOrder, unsigned long Alpha, unsigned long Beta, double *const Coordinates, unsigned long NumCoordinates, double *Phi)
 Calculates the Jacobi polynomials of orders 0 to PolyOrder with weights Alpha and Beta on the coordinates given in the vector Coordinates = [x0 x1 x2 ...]'.
void Get1stDerivative (unsigned long PolyOrder, unsigned long Alpha, unsigned long Beta, double *const Coordinates, unsigned long NumCoordinates, double *d1Phi)
 Computes the first derivative of the Jacobi polynomials of orders 0 to PolyOrder with weights Alpha and Beta on Coordinates. Uses expression (A.8) of pg. 351 of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.
void Get2ndDerivative (unsigned long PolyOrder, unsigned long Alpha, unsigned long Beta, double *const Coordinates, unsigned long NumCoordinates, double *d2Phi)
 Calculates the second derivative of the Jacobi polynomials of orders 0 to PolyOrder with weights Alpha and Beta on coordinates given in Coordinates. Employ expression (A.8) of pg. 351 of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.
void GetJacobiRoot (unsigned long PolyOrder, unsigned long Alpha, unsigned long Beta, double *const Roots)
 Newton-Raphson procedure with deflection to find the Jacobi polynomial roots with weights Alpha and Beta of order PolyOrder. Use algorithm given in Appendix A of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.
void GetJacobiWeight (unsigned long Alpha, unsigned long Beta, QuadCollocType_E QuadratureType, unsigned long NumCoordinates, double *const Coordinates, double *const Weights)
 Calculates the weights for the 1D Gauss-Jacobi, Gauss-Radau-Jacobi or Gauss-Jacobi-Lobato numerical quadratures. Use expresions indicated in Appendix A of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.

Detailed Description

Class for 1D Jacobi polynomials. Calculates 1D Jacobi polynomials with weights Alpha and Beta and first and second order derivatives on the given coordinates. This class does not store any data.

Author:
Gilberto Lus/Fabiano Fernandes Bargos/Marco Lcio Bittencourt
Date:
March/17/2011

Member Function Documentation

double Jacobi1D::Factorial ( unsigned long  n)

Returns the factorial of an integer number n.

Parameters:
[in]n- integer number
Returns:
Factorial of n
void Jacobi1D::Get1stDerivative ( unsigned long  PolyOrder,
unsigned long  Alpha,
unsigned long  Beta,
double *const  Coordinates,
unsigned long  NumCoordinates,
double *  d1Phi 
)

Computes the first derivative of the Jacobi polynomials of orders 0 to PolyOrder with weights Alpha and Beta on Coordinates. Uses expression (A.8) of pg. 351 of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.

Parameters:
[in]PolyOrder- polynomial order.
[in]Alpha,Beta- Weights of the Jacobi polynomials (integers and greater than -1).
[in]Coordinates- Coordinates on which the polynomial first derivative values are calculated.
[in]NumCoordinates- number of coordinates qhere the polynomials are calculated.
[out]d1Phi: array with the polynomial first derivatives values for all coordinates.

Auxiliary variables that store the expressions used to calculate the first derivative of the polynomial values.

Auxiliary pointer used to determinate the first derivative values to each polynomial.

void Jacobi1D::Get2ndDerivative ( unsigned long  PolyOrder,
unsigned long  Alpha,
unsigned long  Beta,
double *const  Coordinates,
unsigned long  NumCoordinates,
double *  d2Phi 
)

Calculates the second derivative of the Jacobi polynomials of orders 0 to PolyOrder with weights Alpha and Beta on coordinates given in Coordinates. Employ expression (A.8) of pg. 351 of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.

Parameters:
[in]PolyOrder- polynomial order.
[in]Alpha,Beta- Weights of the Jacobi polynomials (integers and greater than -1).
[in]Coordinates- Coordinates on which the polynomial second derivatives values are calculated.
[in]NumCoordinates- number of coordinates qhere the polynomials are calculated.
[out]d2Phi: array with the polynomial second derivatives values for all coordinates.

Auxiliary variables that store the expressions used to calculate the second derivative of the polynomial values.

void Jacobi1D::GetJacobiRoot ( unsigned long  PolyOrder,
unsigned long  Alpha,
unsigned long  Beta,
double *const  Roots 
)

Newton-Raphson procedure with deflection to find the Jacobi polynomial roots with weights Alpha and Beta of order PolyOrder. Use algorithm given in Appendix A of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.

Parameters:
[in]PolyOrder- polynomial order.
[in]Alpha,Beta- Weights of the Jacobi polynomials (integers and greater than -1).
[in]NumCoordinates- number of coordinates qhere the polynomials are calculated.
[out]Roots: roots of Jacobi polynomial with weights Alpha, Beta and order PolyOrder.

Auxiliary variables to calculate roots of the jacobi polynomial.

Auxiliary variables: Pm is a matrix that stores the polynomial values. Dpm is a matrix that stores the first derivative of the polynomial values. r stores the roots of jacobi polynomial.

In this loop, calculates the roots of jacobi polynomial. The "k" represents the roots number of polynomial.

void Jacobi1D::GetJacobiWeight ( unsigned long  Alpha,
unsigned long  Beta,
QuadCollocType_E  QuadratureType,
unsigned long  NumCoordinates,
double *const  Coordinates,
double *const  Weights 
)

Calculates the weights for the 1D Gauss-Jacobi, Gauss-Radau-Jacobi or Gauss-Jacobi-Lobato numerical quadratures. Use expresions indicated in Appendix A of the book George Karniadakis and Spencer J. Sherwin, Spectral / hp Element Methods for CFD.

Parameters:
[in]QuadratureType- Type of quadrature. The following opitons are avaialble: 'GAUSS_JACOBI', 'GAUSS_LEGENDRE', 'GAUSS_RADAU_JACOBI', 'GAUSS_RADAU_LEGENDRE', 'GAUSS_LOBATTO_JACOBI', 'GAUSS_LOBATTO_LEGENDRE' and 'EQUALLY_SPACED'.
[in]Alpha,Beta- Weights of the Jacobi polynomials (integers and greater than -1).
[in]NumCoordinates- number of coordinates qhere the polynomials are calculated.
[in]Coordinates- roots of Jacobi polynomial.
[out]Weights- weights for numerical quadrature.

Auxiliary variables: Pm is a matrix that stores the polynomial values. Dpm is a matrix that stores the first derivative of the polynomial values.

Calculate the weights for the Gauss_Jacobi and Gauss_Legendre quadratures

Calculate the weights for the Gauss_Radau_Jacobi and Gauss_Radau_Legendre quadratures.

Calculate the factorial of g1, g2, g3, NumCoords (Note: Gamma [n]: (n-1)! For integer n).

Calculate the weights for the Gauss_Radau_Jacobi and Gauss_Radau_Legendre quadratures.

Calculating the factorial of g1, g2, g3, NumCoords (Note: Gamma [n]: (n-1)! For integer n).

void Jacobi1D::GetPolynomialValue ( unsigned long  PolyOrder,
unsigned long  Alpha,
unsigned long  Beta,
double *const  Coordinates,
unsigned long  NumCoordinates,
double *  Phi 
)

Calculates the Jacobi polynomials of orders 0 to PolyOrder with weights Alpha and Beta on the coordinates given in the vector Coordinates = [x0 x1 x2 ...]'.

Parameters:
[in]PolyOrder- polynomial order.
[in]Alpha,Beta- Weights of the Jacobi polynomials (integers and greater than -1).
[in]Coordinates- Coordinates on which the polynomial values are calculated.
[in]NumCoordinates- number of coordinates where the polynomials are calculated.
[out]Phi: array with the polynomial values for all coordinates.

Auxiliary pointers used to determine the polynomial values. pPn access the first polynomial, pPn1 access the second polynomial and pPn2 access the third polynomial.

Recurrence relation. First, checks the polynomial order that should be greater than 0 to calculate the polynomial values matrix.

Determines the third polynomial from the first and second polynomial and using auxiliary expressions above.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Friends Defines