Skip to main content

LagrangeCoeff_Line

Interface 1

INTERFACE
MODULE FUNCTION LagrangeCoeff_Line(order, i, xij) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order of polynomial, it should be SIZE(xij,2)-1
INTEGER(I4B), INTENT(IN) :: i
!! ith coefficients for lagrange polynomial
REAL(DFP), INTENT(IN) :: xij(:, :)
!! points in xij format, size(xij,2) = order+1
REAL(DFP) :: ans(order + 1)
!! coefficients
END FUNCTION LagrangeCoeff_Line
END INTERFACE
order

order of polynomial space.

i

ith polynomial

xij
  • Interpolation points
  • SIZE(xij,1) is equal to 1
  • SIZE(xij,2) is equal to order+1
ans

order+1 coefficients of ith Lagrange polynomial.

Interface 2

INTERFACE
MODULE FUNCTION LagrangeCoeff_Line(order, i, v, isVandermonde) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order of polynomial, it should be SIZE(v,2)-1
INTEGER(I4B), INTENT(IN) :: i
!! coefficient for ith lagrange polynomial
REAL(DFP), INTENT(IN) :: v(:, :)
!! vandermonde matrix size should be (order+1,order+1)
LOGICAL(LGT), INTENT(IN) :: isVandermonde
!! This is just to resolve interface issue
REAL(DFP) :: ans(order + 1)
!! coefficients
END FUNCTION LagrangeCoeff_Line
END INTERFACE
order

order of polynomial space.

i

ith polynomial

v
  • Vandermonde matrix
  • The jth col of v denotes the values of basis function on interpolation points.
  • The ith row of v denotes the values of all basis function on ith interpolation points.
ans

order+1 coefficients of ith Lagrange polynomial.

Interface 3

INTERFACE
MODULE FUNCTION LagrangeCoeff_Line(order, i, v, ipiv) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order of polynomial, it should be SIZE(x,2)-1
INTEGER(I4B), INTENT(IN) :: i
!! ith coefficients for lagrange polynomial
REAL(DFP), INTENT(INOUT) :: v(:, :)
!! LU decomposition of vandermonde matrix
INTEGER(I4B), INTENT(IN) :: ipiv(:)
!! inverse pivoting mapping, compes from LU decomposition
REAL(DFP) :: ans(order + 1)
!! coefficients
END FUNCTION LagrangeCoeff_Line
END INTERFACE
order

order of polynomial space.

i

ith polynomial

v
  • LU decomposition of Vandermonde matrix
  • The jth col of v denotes the values of basis function on interpolation points.
  • The ith row of v denotes the values of all basis function on ith interpolation points.
ipiv

ipiv is returned by Lapack when performing LU decomposition.

ans

order+1 coefficients of ith Lagrange polynomial.

Interface 4

INTERFACE
MODULE FUNCTION LagrangeCoeff_Line(order, xij) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order of polynomial, it should be SIZE(xij,2)-1
REAL(DFP), INTENT(IN) :: xij(:, :)
!! points in xij format, size(xij,2) = order+1
REAL(DFP) :: ans(order + 1, order + 1)
!! coefficients
!! jth column of ans corresponds to the coeff of lagrange polynomial
!! at the jth point
END FUNCTION LagrangeCoeff_Line
END INTERFACE
xij

Interpolation points. SIZE(xij, 1) is 1. SIZE(xij, 2) should be equal to order+1.

order

order denotes the order of polynomial space.

ans

The jth col of ans denotes the order+1 coefficents of jth polynomial.

Interace 5

INTERFACE LagrangeCoeff_Line
MODULE FUNCTION LagrangeCoeff_Line5(order, xij, orthopol, alpha, &
& beta, lambda) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order of polynomial, it should be SIZE(xij,2)-1
REAL(DFP), INTENT(IN) :: xij(:, :)
!! points in xij format, size(xij,2) = order+1
INTEGER(I4B), INTENT(IN) :: orthopol
!! Monomial
!! Jacobi
!! Legendre
!! Chebyshev
!! Lobatto
!! UnscaledLobatto
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha
!! Jacobi polynomial parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: beta
!! Jacobi polynomial parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: lambda
!! Ultraspherical parameter
REAL(DFP) :: ans(order + 1, order + 1)
!! coefficients
!! jth column of ans corresponds to the coeff of lagrange polynomial
!! at the jth point
END FUNCTION LagrangeCoeff_Line5
END INTERFACE LagrangeCoeff_Line
xij

Interpolation points. SIZE(xij, 1) is 1. SIZE(xij, 2) should be equal to order+1.

order

order denotes the order of polynomial space.

orthopol

Currently, we can specify following types of orthogonal polynomials:

  • Jacobi
  • Ultraspherical
  • Legendre
  • Chebyshev
  • Lobatto
  • UnscaledLobatto
alpha, beta

alpha and beta are parameters of Jacobi Polynomials. They should be present when orthopol is equal to Jacobi

lambda

lambda is parameter for Ultraspherical polynomials. They should be present when orthopol is equal to the Ultraspherical

ans

The jth col of ans denotes the order+1 coefficents of jth polynomial.