Quadratures

ClimaCore.Quadratures.unique_degrees_of_freedomFunction
unique_degrees_of_freedom(quadstyle::QuadratureStyle)

Return the number of quadrature points of quadstyle per element that are not shared with a neighbouring element. This is Nq - 1 for rules that include the element endpoints (Quadratures.GLL and ClosedUniform), whose endpoint nodes are shared, and Nq for rules that do not (Quadratures.GL and Uniform).

source
ClimaCore.Quadratures.quadrature_pointsFunction
quadrature_points(::Type{FT}, quadstyle::QuadratureStyle)

Return the points and weights of the quadrature rule quadstyle on [-1, 1] as a tuple of two SVectors with element type FT.

source
ClimaCore.Quadratures.barycentric_weightsFunction
barycentric_weights(x::SVector{Nq})
barycentric_weights(::Type{FT}, quadstyle::QuadratureStyle)

Return the barycentric weights associated with the point locations x, or with the quadrature points of quadstyle in float type FT:

\[w_j = \frac{1}{\prod_{k \ne j} (x_k - x_j)}\]

See [19], equation 3.2.

source
ClimaCore.Quadratures.interpolation_matrixFunction
interpolation_matrix(x::SVector, r::SVector{Nq})
interpolation_matrix(x::Vector, r)
interpolation_matrix(::Type{FT}, quadto::QuadratureStyle, quadfrom::QuadratureStyle)

Return the matrix that interpolates the Lagrange polynomial of degree Nq - 1 through the points r to the points x. The third method uses the quadrature points of quadfrom and quadto in float type FT. The matrix coefficients are computed with the barycentric formula of [19], section 4:

\[I_{ij} = \begin{cases} 1 & \text{if } x_i = r_j, \\ 0 & \text{if } x_i = r_k \text{ for } k \ne j, \\ \frac{\displaystyle \frac{w_j}{x_i - r_j}}{\displaystyle \sum_k \frac{w_k}{x_i - r_k}} & \text{otherwise,} \end{cases}\]

where $w_j$ are the barycentric weights, see barycentric_weights.

source
ClimaCore.Quadratures.differentiation_matrixFunction
differentiation_matrix(r::SVector{Nq, T})

Return the spectral differentiation matrix for the Lagrange polynomial of degree Nq - 1 interpolating at the points r.

The matrix coefficients are computed following [19], section 9.3:

\[D_{ij} = \begin{cases} \displaystyle \frac{w_j}{w_i (x_i - x_j)} &\text{ if } i \ne j, \\ \displaystyle \sum_{k \ne i} \frac{1}{x_i - x_k} &\text{ if } i = j, \end{cases}\]

where $w_j$ are the barycentric weights, see barycentric_weights. The rows of $D$ sum to zero.

source
differentiation_matrix(::Type{FT}, quadstyle::QuadratureStyle)

Return the spectral differentiation matrix at the quadrature points of quadstyle, in float type FT.

source
ClimaCore.Quadratures.cutoff_filter_matrixFunction
cutoff_filter_matrix(::Type{FT}, quad::GLL{Nq}, Nc::Integer)

Return the Nq × Nq SMatrix{Nq, Nq, FT} that applies a spectral cutoff filter to nodal values at the Quadratures.GLL points of quad: the values are projected onto the orthonormal Legendre basis, the first Nc modes (polynomial degrees 0 to Nc - 1) are kept and the remaining modes are set to zero, and the result is transformed back to nodal values.

source
ClimaCore.Quadratures.orthonormal_polyFunction
orthonormal_poly(points::SVector, quad::GLL)

Return the matrix V whose entry V[i, j] is the orthonormal Legendre polynomial of degree j - 1 evaluated at points[i], i.e. the map from the modal to the nodal representation for the polynomial space of quad.

source