Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Macros | Functions
Polylib.cpp File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "Polylib.h"
#include <float.h>
#include <complex>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>
Include dependency graph for Polylib.cpp:

Go to the source code of this file.

Namespaces

 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

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. More...
 
static void Polylib::TriQL (const int n, double *d, double *e, double **z)
 QL algorithm for symmetric tridiagonal matrix. More...
 
double Polylib::gammaF (const double x)
 Calculate the Gamma function , $ \Gamma(n)$, for integer. 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. More...
 
void Polylib::JKMatrix (int n, double *a, double *b)
 Calcualtes the Jacobi-kronrod matrix by determining the. 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. 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::Dgj (double *D, const double *z, const int np, const double alpha, const double beta)
 Compute the Derivative Matrix and its transpose associated. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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...
 
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. 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...
 

Macro Definition Documentation

#define EPS   100*DBL_EPSILON

Precision tolerance for two points to be similar.

Definition at line 23 of file Polylib.cpp.

Referenced by Polylib::hgj(), Polylib::hglj(), Polylib::hgrjm(), Polylib::hgrjp(), and Polylib::Jacobz().

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

zero determination using Newton iteration with polynomial deflation

Definition at line 45 of file Polylib.cpp.

Referenced by Polylib::zwgj(), Polylib::zwglj(), Polylib::zwgrjm(), and Polylib::zwgrjp().

#define POLYNOMIAL_DEFLATION   0

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

Definition at line 37 of file Polylib.cpp.

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

return the sign(b)*a

Definition at line 27 of file Polylib.cpp.

Referenced by Nektar::LocalRegions::Expansion2D::AddEdgeBoundaryInt(), Nektar::LocalRegions::Expansion2D::AddHDGHelmholtzEdgeTerms(), Nektar::MultiRegions::AssemblyMap::AssemblyMap(), Nektar::MultiRegions::PreconditionerBlock::BlockPreconditionerCG(), Nektar::MultiRegions::GlobalLinSysStaticCond::ConstructNextLevelCondensedSystem(), Nektar::StdRegions::StdExpansion::CreateIndexMap(), Nektar::MultiRegions::PreconditionerLowEnergy::CreateMultiplicityMap(), Nektar::LibUtilities::functions::functions(), Nektar::MultiRegions::ContField3D::GenerateDirBndCondForcing(), Nektar::LocalRegions::Expansion2D::GetPhysEdgeVarCoeffsFromElement(), main(), Nektar::Utilities::InputNek5000::Process(), Nektar::MultiRegions::PatchMap::SetPatchMap(), Nektar::MultiRegions::LocTraceToTraceMap::Setup2D(), Nektar::MultiRegions::LocTraceToTraceMap::Setup3D(), Nektar::NekMeshUtils::BLMesh::TestIntersectionEl(), Polylib::TriQL(), Nektar::LocalRegions::Expansion2D::v_AddRobinEdgeContribution(), Nektar::LocalRegions::Expansion3D::v_AddRobinMassMatrix(), Nektar::LocalRegions::Expansion2D::v_AddRobinMassMatrix(), Nektar::LinearElasticSystem::v_DoSolve(), Nektar::MultiRegions::ContField3D::v_FillBndCondFromField(), Nektar::MultiRegions::ContField2D::v_FillBndCondFromField(), Nektar::StdRegions::StdQuadExp::v_FwdTrans_BndConstrained(), Nektar::LocalRegions::TriExp::v_FwdTrans_BndConstrained(), Nektar::LocalRegions::QuadExp::v_FwdTrans_BndConstrained(), Nektar::StdRegions::StdTriExp::v_FwdTrans_BndConstrained(), Nektar::LocalRegions::Expansion3D::v_GenMatrix(), Nektar::LocalRegions::Expansion2D::v_GenMatrix(), Nektar::MultiRegions::ContField3D::v_HelmSolve(), Nektar::MultiRegions::ContField3D::v_ImposeDirichletConditions(), Nektar::MultiRegions::ContField2D::v_ImposeDirichletConditions(), Nektar::MultiRegions::ExpListHomogeneous2D::v_PhysDeriv(), Nektar::MultiRegions::ExpListHomogeneous1D::v_PhysDeriv(), Nektar::LaxFriedrichsSolver::v_PointSolve(), and Nektar::SolverUtils::DriverArnoldi::WriteEvs().

#define STOP   30

Maximum number of iterations in polynomial defalation routine Jacobz.

Definition at line 19 of file Polylib.cpp.

Referenced by Polylib::Jacobz(), and Polylib::TriQL().