modepy.modes
provides orthonormal bases and their
derivatives on unit simplices.
modepy.
jacobi
(alpha, beta, n, x)¶Evaluate Jacobi polynomials of type \((\alpha, \beta)\) with \(\alpha, \beta > -1\) and \(\alpha+\beta \ne -1\) at a vector of points x for order n. The points x must lie on the interval \([-1,1]\).
Returns: | a vector of \(P^{(\alpha, \beta)}_n\) evaluated at all x. |
---|
The polynomials are normalized to be orthonormal with respect to the Jacobi weight \((1-x)^\alpha(1+x)^\beta\).
Observe that choosing \(\alpha=\beta=0\) will yield the Legendre polynomials.
modepy.
simplex_onb
(dims, n)¶Return a list of orthonormal basis functions in dimension dims of maximal total degree n.
Returns: | a class:tuple of functions, each of which accepts arrays of shape (dims, npts) and return the function values as an array of size npts. ‘Scalar’ evaluation, by passing just one vector of length dims, is also supported. |
---|
See the following publications:
Changed in version 2013.2: Made return value a tuple, to make bases hashable.
modepy.
grad_simplex_onb
(dims, n)¶Return the gradients of the functions returned by simplex_onb()
.
Returns: | a tuple of functions, each of which
accepts arrays of shape (dims, npts)
and returns a tuple of length dims containing
the derivatives along each axis as an array of size npts.
‘Scalar’ evaluation, by passing just one vector of length dims,
is also supported. |
---|
See the following publications:
Changed in version 2013.2: Made return value a tuple, to make bases hashable.
modepy.modes.
pkdo_2d
(order, rs)¶Evaluate a 2D orthonormal (with weight 1) polynomial on the unit simplex.
Parameters: |
|
---|---|
Returns: | a vector of values of the same length as the rs arrays. |
See the following publications:
modepy.modes.
grad_pkdo_2d
(order, rs)¶Evaluate the derivatives of pkdo_2d()
.
Parameters: |
|
---|---|
Returns: | a tuple of vectors (dphi_dr, dphi_ds), each of the same length as the rs arrays. |
See the following publications:
modepy.modes.
pkdo_3d
(order, rst)¶Evaluate a 2D orthonormal (with weight 1) polynomial on the unit simplex.
Parameters: |
|
---|---|
Returns: | a vector of values of the same length as the rst arrays. |
See the following publications:
modepy.modes.
grad_pkdo_3d
(order, rst)¶Evaluate the derivatives of pkdo_3d()
.
Parameters: |
|
---|---|
Returns: | a tuple of vectors (dphi_dr, dphi_ds, dphi_dt), each of the same length as the rst arrays. |
See the following publications: