spectral.LegendreLobattoBasis#

class spectral.LegendreLobattoBasis(domain: tuple[float, float] = (-1.0, 1.0))[source]#

Bases: SpectralBasis

Legendre-Gauss-Lobatto nodal polynomial basis.

Methods

__init__

diff_matrix

Return derivative matrix scaled to the physical domain.

mass_matrix

Return mass matrix associated with Legendre basis.

nodes

Return nodes mapped to the configured domain.

diff_matrix(nodes: ndarray) ndarray[source]#

Return derivative matrix scaled to the physical domain.

Parameters:
nodesnp.ndarray

Physical domain nodes

Returns:
np.ndarray

Scaled differentiation matrix of shape (N, N)

mass_matrix(nodes: ndarray) ndarray[source]#

Return mass matrix associated with Legendre basis.

Parameters:
nodesnp.ndarray

Physical domain nodes

Returns:
np.ndarray

Scaled mass matrix of shape (N, N)

nodes(num_points: int) ndarray[source]#

Return nodes mapped to the configured domain.

Parameters:
num_pointsint

Number of Legendre-Gauss-Lobatto nodes

Returns:
np.ndarray

LGL nodes mapped to the physical domain