LagrangeEvalAll
Evaluate Lagrange polynomials on Quadrangle.
Interface 1
- ܀ Interface
- ️܀ Monomial
- Legendre
- Chebyshev
- ↢
INTERFACE LagrangeEvalAll_Quadrangle
MODULE FUNCTION LagrangeEvalAll_Quadrangle1( &
& order, &
& x, &
& xij, &
& refQuadrangle, &
& coeff, &
& firstCall, &
& basisType, &
& alpha, &
& beta, &
& lambda) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! order of Lagrange polynomials
REAL(DFP), INTENT(IN) :: x(2)
!! point of evaluation
!! x(1) is x coord
!! x(2) is y coord
REAL(DFP), INTENT(INOUT) :: xij(:, :)
!! Interpolation points
!! The number of rows in xij can be 2 or 3
!! The number of columns in xij should be equal to total
!! degree of freedom
CHARACTER(*), INTENT(IN) :: refQuadrangle
!! It should be BIUNIT
REAL(DFP), OPTIONAL, INTENT(INOUT) :: coeff(SIZE(xij, 2), SIZE(xij, 2))
!! coefficient of Lagrange polynomials
LOGICAL(LGT), OPTIONAL :: firstCall
!! If firstCall is true, then coeff will be computed and returned
!! by this routine.
!! If firstCall is False, then coeff should be given, which will be
!! used.
!! Default value of firstCall is True
INTEGER(I4B), OPTIONAL, INTENT(IN) :: basisType
!! Monomials *Default
!! Legendre
!! Lobatto
!! Chebyshev
!! Jacobi
!! Ultraspherical
!! Heirarchical
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha
!! Jacobi parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: beta
!! Jacobi parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: lambda
!! Ultraspherical parameter
REAL(DFP) :: ans(SIZE(xij, 2))
!! Value of n+1 Lagrange polynomials at point x
END FUNCTION LagrangeEvalAll_Quadrangle1
END INTERFACE LagrangeEvalAll_Quadrangle
program main
use easifembase
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, cnt, n
real(dfp), allocatable :: ans(:), coeff(:,:)
integer(i4b) :: order, basisType
order = 1
basisType = Monomial
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
order = 2
basisType = Monomial
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
end program main
See results for order 1
ans =
0.25 | 0.25 | 0.25 | 0.25 |
See results for order 2
ans =
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
program main
use easifembase
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, cnt, n
real(dfp), allocatable :: ans(:), coeff(:,:)
integer(i4b) :: order, basisType
real(dfp) :: alpha, beta
order = 2
basisType = Legendre
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
end program main
See results for order 2
ans =
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
program main
use easifembase
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, cnt, n
real(dfp), allocatable :: ans(:), coeff(:,:)
integer(i4b) :: order, basisType
real(dfp) :: alpha, beta
order = 2
basisType = Chebyshev
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
end program main
See results for order 2
ans =
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Interface 2
- ܀ Interface
- ️܀ Monomials
- Legendre
- Heirarchical
- ↢
INTERFACE LagrangeEvalAll_Quadrangle
MODULE FUNCTION LagrangeEvalAll_Quadrangle2( &
& order, &
& x, &
& xij, &
& refQuadrangle, &
& coeff, &
& firstCall, &
& basisType, &
& alpha, &
& beta, &
& lambda &
& ) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: order
!! Order of Lagrange polynomials
REAL(DFP), INTENT(IN) :: x(:, :)
!! Point of evaluation
!! x(1, :) is x coord
!! x(2, :) is y coord
REAL(DFP), INTENT(INOUT) :: xij(:, :)
!! Interpolation points
CHARACTER(*), INTENT(IN) :: refQuadrangle
!! Reference quadrangle, it should be BIUNIT
REAL(DFP), OPTIONAL, INTENT(INOUT) :: coeff(SIZE(xij, 2), SIZE(xij, 2))
!! Coefficient of Lagrange polynomials
LOGICAL(LGT), OPTIONAL :: firstCall
!! If firstCall is true, then coeff will be made
!! If firstCall is False, then coeff will be used
!! Default value of firstCall is True
INTEGER(I4B), OPTIONAL, INTENT(IN) :: basisType
!! Monomials *Default
!! Jacobi=Dubiner
!! Heirarchical
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha
!! Jacobi parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: beta
!! Jacobi parameter
REAL(DFP), OPTIONAL, INTENT(IN) :: lambda
!! Ultraspherical parameter
REAL(DFP) :: ans(SIZE(x, 2), SIZE(xij, 2))
!! Value of n+1 Lagrange polynomials at point x
END FUNCTION LagrangeEvalAll_Quadrangle2
END INTERFACE LagrangeEvalAll_Quadrangle
program main
use easifembase
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, cnt, n
real(dfp), allocatable :: ans(:, :), coeff(:,:)
integer(i4b) :: order, basisType
real(dfp) :: alpha, beta
order = 2
basisType = Monomial
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=xij, &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
end program main
See results for order 2
ans =
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
program main
use easifembase
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, cnt, n
real(dfp), allocatable :: ans(:, :), coeff(:,:)
integer(i4b) :: order, basisType
real(dfp) :: alpha, beta
order = 2
basisType = Legendre
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=xij, &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
end program main
See results for order 2
ans =
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
program main
use easifembase
implicit none
real(dfp), allocatable :: xij(:,:), avec(:)
integer(i4b) :: ii, jj, cnt, n
real(dfp), allocatable :: ans(:, :), coeff(:,:)
integer(i4b) :: order, basisType
real(dfp) :: alpha, beta
order = 2
basisType = Heirarchical
xij = InterpolationPoint_Quadrangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefQuadrangleCoord("BIUNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Quadrangle(&
& order=order, &
& x=xij, &
& xij=xij, &
& basisType=basisType, &
& coeff=coeff)
call display(mdencode(ans), "ans = " // char_lf // char_lf )
end program main
See results for order 2
ans =
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |