Spectral ND

SpectralToolbox.SpectralND.MultiIndex(d, N)[source]

MultiIndex(): generates the multi index ordering for the construction of multidimensional Generalized Vandermonde matrices

Syntax:
IDX = MultiIndex(d,N)
Input:
  • d = (int) dimension of the simplex
  • N = (int) the maximum value of the sum of the indeces
OUTPUT:
  • IDX = (2d-array,int) array containing the ordered multi indeces
class SpectralToolbox.SpectralND.PolyND(polys)[source]

Bases: object

Initialization of the N-dimensional Polynomial instance

Syntax:
p = PolyND(polys)
Input:
  • polys = (list,Spectral1D.Poly1D) list of polynomial instances of the class Spectral1D.Poly1D

See also

Spectral1D.Poly1D

GaussLobattoQuadrature(Ns, norm=True, warnings=True)[source]

GaussLobattoQuadrature(): computes the tensor product of the Guass Lobatto Points and weights

Syntax:
(x,w) = GaussLobattoQuadrature(Ns,[norm=True],[warnings=True])
Input:
  • Ns = (list,int) n-dimensional list with the order of approximation of each polynomial
  • norm = (optional,boolean) whether the weights will be normalized or not
  • warnings = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
Output:
  • x = tensor product of the collocation points
  • w = tensor product of the weights

Warning

The lengths of Ns has to be conform to the number of polynomials with which you have instantiated PolyND

GaussQuadrature(Ns, norm=True, warnings=True)[source]

GaussQuadrature(): computes the tensor product of the Guass Points and weights

Syntax:
(x,w) = GaussQuadrature(Ns, [norm=True],[warnings=True])
Input:
  • Ns = (list,int) n-dimensional list with the order of approximation of each polynomial
  • norm = (optional,boolean) whether the weights will be normalized or not
  • warnings = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
Output:
  • x = tensor product of the collocation points
  • w = tensor product of the weights

Warning

The lengths of Ns has to be conform to the number of polynomials with which you have instantiated PolyND

GradVandermonde(rs, Ns, ks=None, norms=None, usekron=True, output=True, warnings=True)[source]

GradVandermonde(): initialize the tensor product of the k-th gradient of the modal basis.

Syntax:
V = GradVandermonde(r,N,k,[norms=None],[usekron=True],[output=True],[warnings=True])
Input:
  • rs = (list of 1d-array,float) n-dimensional list of set of points on which to evaluate the polynomials (by default they are not the kron product of the points. See usekron option)
  • Ns = (list,int) n-dimensional list with the maximum orders of approximation of each polynomial
  • ks = (list,int) n-dimensional list with derivative orders [default=0]
  • norms = (default=None,list,boolean) n-dimensional list of boolean, True -> orthonormal, False -> orthogonal, None -> all orthonormal
  • usekron = (optional,boolean) set whether to apply the kron product of the single dimensional Vandermonde matrices or to multiply column-wise. kron(rs) and usekron==False is equal to rs and usekron==True
  • output = (optional,boolean) set whether to print out information about memory allocation
  • warnings = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
OUTPUT:
  • V = Tensor product of the Generalized Vandermonde matrices

Warning

The lengths of Ns , rs , ks , norms has to be conform to the number of polynomials with which you have instantiated PolyND

GradVandermondePascalSimplex(rs, N, ks=None, norms=None, usekron=True, output=True, warnings=True)[source]

GradVandermondePascalSimplex(): initialize k-th gradient of the modal basis up to the total order N

Syntax:
V = GradVandermonde(r,N,k,[norms=None],[output=True],[warnings=True])
Input:
  • rs = (list of 1d-array,float) n-dimensional list of set of points on which to evaluate the polynomials (by default they are not the kron product of the points. See usekron option)
  • N = (int) the maximum orders of the polynomial basis
  • ks = (list,int) n-dimensional list with derivative orders [default=0]
  • norms = (default=None,list,boolean) n-dimensional list of boolean, True -> orthonormal, False -> orthogonal, None -> all orthonormal
  • usekron = (optional,boolean) set whether to apply the kron product of the single dimensional Vandermonde matrices or to multiply column-wise. kron(rs) and usekron==False is equal to rs and usekron==True
  • output = (optional,boolean) set whether to print out information about memory allocation
  • warnings = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
OUTPUT:
  • V = Generalized Vandermonde matrix up to the N-th order

Warning

The lengths of rs , ks , norms has to be conform to the number of polynomials with which you have instantiated PolyND

Quadrature(Ns, quadTypes=None, norm=True, warnings=True)[source]

GaussQuadrature(): computes the tensor product of the Guass Points and weights

Syntax:
(x,w) = GaussQuadrature(Ns, [quadTypes=None], [norm=True],[warnings=True])
Input:
  • Ns = (list,int) n-dimensional list with the order of approximation of each polynomial
  • quadTypes = (list,``Spectral1D.AVAIL_QUADPOINTS``) n-dimensional list of quadrature point types chosen among Gauss, Gauss-Radau, Gauss-Lobatto (using the definition in Spectral1D). If None, Gauss points will be generated by default
  • norm = (optional,boolean) whether the weights will be normalized or not
  • warnings = (optional,boolean) set whether to ask for confirmation when it is required to allocate more then 100Mb of memory
Output:
  • x = tensor product of the collocation points
  • w = tensor product of the weights

Warning

The lengths of Ns has to be conform to the number of polynomials with which you have instantiated PolyND

ch = <logging.StreamHandler object>
formatter = <logging.Formatter object>
logger = <logging.Logger object>