Nektar++
Namespaces | Macros | Functions
Polylib.cpp File Reference
#include "Polylib.h"
#include <cfloat>
#include <cmath>
#include <complex>
#include <cstdio>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>

Go to the source code of this file.

Namespaces

namespace  Polylib
 The namespace associated with the the Polylib library (Polylib introduction)
 

Macros

#define STOP   30
 Maximum number of iterations in polynomial defalation routine Jacobz. More...
 
#define EPS   100 * DBL_EPSILON
 Precision tolerance for two points to be similar. More...
 
#define sign(a, b)   ((b) < 0 ? -fabs(a) : fabs(a))
 return the sign(b)*a More...
 
#define POLYNOMIAL_DEFLATION   0
 Define whether to use polynomial deflation (1) or tridiagonal solver (0). More...
 
#define jacobz(n, z, alpha, beta)   Jacobz(n, z, alpha, beta)
 zero determination using Newton iteration with polynomial deflation More...
 

Functions

double Polylib::optdiff (double xl, double xr)
 The following function is used to circumvent/reduce "Subtractive Cancellation" The expression 1/dz is replaced by optinvsub(.,.) Added on 26 April 2017. More...
 
double Polylib::laginterp (double z, int j, const double *zj, int np)
 
double Polylib::laginterpderiv (double z, int k, const double *zj, int np)
 
static void Polylib::Jacobz (const int n, double *z, const double alpha, const double beta)
 Calculate the n zeros, z, of the Jacobi polynomial, i.e. \( P_n^{\alpha,\beta}(z) = 0 \). More...
 
static void Polylib::RecCoeff (const int n, double *a, double *b, const double alpha, const double beta)
 The routine finds the recurrence coefficients a and b of the orthogonal polynomials. More...
 
static void Polylib::TriQL (const int n, double *d, double *e, double **z)
 QL algorithm for symmetric tridiagonal matrix. More...
 
void Polylib::JKMatrix (int n, double *a, double *b)
 Calcualtes the Jacobi-kronrod matrix by determining the a and coefficients. More...
 
void Polylib::chri1 (int n, double *a, double *b, double *a0, double *b0, double z)
 Given a weight function \(w(t)\) through the first n+1 coefficients a and b of its orthogonal polynomials this routine generates the first n recurrence coefficients for the orthogonal polynomials relative to the modified weight function \((t-z)w(t)\). More...
 
void Polylib::zwgj (double *z, double *w, const int np, const double alpha, const double beta)
 Gauss-Jacobi zeros and weights. More...
 
void Polylib::zwgrjm (double *z, double *w, const int np, const double alpha, const double beta)
 Gauss-Radau-Jacobi zeros and weights with end point at z=-1. More...
 
void Polylib::zwgrjp (double *z, double *w, const int np, const double alpha, const double beta)
 Gauss-Radau-Jacobi zeros and weights with end point at z=1. More...
 
void Polylib::zwglj (double *z, double *w, const int np, const double alpha, const double beta)
 Gauss-Lobatto-Jacobi zeros and weights with end point at z=-1,1. More...
 
void Polylib::zwgk (double *z, double *w, const int npt, const double alpha, const double beta)
 Gauss-Kronrod-Jacobi zeros and weights. More...
 
void Polylib::zwrk (double *z, double *w, const int npt, const double alpha, const double beta)
 Gauss-Radau-Kronrod-Jacobi zeros and weights. More...
 
void Polylib::zwlk (double *z, double *w, const int npt, const double alpha, const double beta)
 Gauss-Lobatto-Kronrod-Jacobi zeros and weights. More...
 
void Polylib::Qg (double *Q, const double *z, const int np)
 Compute the Integration Matrix. More...
 
void Polylib::Dgj (double *D, const double *z, const int np, const double alpha, const double beta)
 Compute the Derivative Matrix and its transpose associated with the Gauss-Jacobi zeros. More...
 
void Polylib::Dgrjm (double *D, const double *z, const int np, const double alpha, const double beta)
 Compute the Derivative Matrix and its transpose associated with the Gauss-Radau-Jacobi zeros with a zero at z=-1. More...
 
void Polylib::Dgrjp (double *D, const double *z, const int np, const double alpha, const double beta)
 Compute the Derivative Matrix associated with the Gauss-Radau-Jacobi zeros with a zero at z=1. More...
 
void Polylib::Dglj (double *D, const double *z, const int np, const double alpha, const double beta)
 Compute the Derivative Matrix associated with the Gauss-Lobatto-Jacobi zeros. More...
 
double Polylib::hgj (const int i, const double z, const double *zgj, const int np, const double alpha, const double beta)
 Compute the value of the i th Lagrangian interpolant through the np Gauss-Jacobi points zgj at the arbitrary location z. More...
 
double Polylib::hgrjm (const int i, const double z, const double *zgrj, const int np, const double alpha, const double beta)
 Compute the value of the i th Lagrangian interpolant through the np Gauss-Radau-Jacobi points zgrj at the arbitrary location z. This routine assumes zgrj includes the point -1. More...
 
double Polylib::hgrjp (const int i, const double z, const double *zgrj, const int np, const double alpha, const double beta)
 Compute the value of the i th Lagrangian interpolant through the np Gauss-Radau-Jacobi points zgrj at the arbitrary location z. This routine assumes zgrj includes the point +1. More...
 
double Polylib::hglj (const int i, const double z, const double *zglj, const int np, const double alpha, const double beta)
 Compute the value of the i th Lagrangian interpolant through the np Gauss-Lobatto-Jacobi points zgrj at the arbitrary location z. More...
 
void Polylib::Imgj (double *im, const double *zgj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
 Interpolation Operator from Gauss-Jacobi points to an arbitrary distribution at points zm. More...
 
void Polylib::Imgrjm (double *im, const double *zgrj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
 Interpolation Operator from Gauss-Radau-Jacobi points (including z=-1) to an arbitrary distrubtion at points zm. More...
 
void Polylib::Imgrjp (double *im, const double *zgrj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
 Interpolation Operator from Gauss-Radau-Jacobi points (including z=1) to an arbitrary distrubtion at points zm. More...
 
void Polylib::Imglj (double *im, const double *zglj, const double *zm, const int nz, const int mz, const double alpha, const double beta)
 Interpolation Operator from Gauss-Lobatto-Jacobi points to an arbitrary distrubtion at points zm. More...
 
void Polylib::polycoeffs (double *c, const double *z, const int i, const int np)
 Compute the coefficients of Lagrange interpolation polynomials. More...
 
void Polylib::jacobfd (const int np, const double *z, double *poly_in, double *polyd, const int n, const double alpha, const double beta)
 Routine to calculate Jacobi polynomials, \( P^{\alpha,\beta}_n(z) \), and their first derivative, \( \frac{d}{dz} P^{\alpha,\beta}_n(z) \). More...
 
void Polylib::jacobd (const int np, const double *z, double *polyd, const int n, const double alpha, const double beta)
 Calculate the derivative of Jacobi polynomials. More...
 
double Polylib::gammaF (const double x)
 Calculate the Gamma function , \( \Gamma(n)\), for integer values and halves. More...
 
double Polylib::gammaFracGammaF (const int x, const double alpha, const int y, const double beta)
 Calculate fraction of two Gamma functions, \( \Gamma(x+\alpha)/\Gamma(y+\beta) \), for integer values and halves. More...
 
std::complex< Nektar::NekDoublePolylib::ImagBesselComp (int n, std::complex< Nektar::NekDouble > y)
 Calcualte the bessel function of the first kind with complex double input y. Taken from Numerical Recipies in C. More...
 
void Polylib::JacZeros (const int n, double *a, double *b, const double alpha, const double beta)
 Zero and Weight determination through the eigenvalues and eigenvectors of a tridiagonal matrix from the three term recurrence relationship. More...
 

Macro Definition Documentation

◆ EPS

#define EPS   100 * DBL_EPSILON

Precision tolerance for two points to be similar.

Definition at line 45 of file Polylib.cpp.

◆ jacobz

#define jacobz (   n,
  z,
  alpha,
  beta 
)    Jacobz(n, z, alpha, beta)

zero determination using Newton iteration with polynomial deflation

Definition at line 128 of file Polylib.cpp.

◆ POLYNOMIAL_DEFLATION

#define POLYNOMIAL_DEFLATION   0

Define whether to use polynomial deflation (1) or tridiagonal solver (0).

Definition at line 124 of file Polylib.cpp.

◆ sign

#define sign (   a,
 
)    ((b) < 0 ? -fabs(a) : fabs(a))

return the sign(b)*a

Definition at line 47 of file Polylib.cpp.

◆ STOP

#define STOP   30

Maximum number of iterations in polynomial defalation routine Jacobz.

Definition at line 43 of file Polylib.cpp.