LagrangeEvalAll
Evaluate Lagrange polynomials on triangle.
Interface 1
- ܀ Interface
- ️܀ Equidistance
- Jacobi
- Heirarchical
- ↢
INTERFACE LagrangeEvalAll_Triangle
MODULE FUNCTION LagrangeEvalAll_Triangle1(order, x, xij, refTriangle, &
& coeff, firstCall, basisType) 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(:, :)
!!
CHARACTER(*), INTENT(IN) :: refTriangle
!! interpolation points
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
!! Orthogonal, Jacobi, Legendre, Lobatto, Ultraspherical all are same
!! Heirarchical
REAL(DFP) :: ans(SIZE(xij, 2))
!! Value of n+1 Lagrange polynomials at point x
END FUNCTION LagrangeEvalAll_Triangle1
END INTERFACE LagrangeEvalAll_Triangle
xij
xij
is the interpolation points for Lagrange polynomials. xij
is used for constructing the coeff
.
basisType
Type of basis functions used for constructing the Lagrange polynomial. Following values are allowed:
- Monomials
- Orthogonal, Jacobi, Legendre, Ultraspherical, are all the same.
- Hierarchical
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 = 4
basisType = Monomial
xij = InterpolationPoint_Triangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefTriangleCoord("UNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Triangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& refTriangle="UNIT", &
& basisType=basisType, &
& coeff=coeff)
call display(ans, "ans = ")
end program main
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 = 4
basisType = Jacobi
xij = InterpolationPoint_Triangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefTriangleCoord("UNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Triangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& refTriangle="UNIT", &
& basisType=basisType, &
& coeff=coeff)
call display(ans, "ans = ")
end program main
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 = Heirarchical
xij = InterpolationPoint_Triangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefTriangleCoord("UNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Triangle(&
& order=order, &
& x=[0.0_DFP, 0.0_DFP], &
& xij=xij, &
& refTriangle="UNIT", &
& basisType=basisType, &
& coeff=coeff)
call display(ans, "ans = ")
end program main
Interface 2
- ܀ Interface
- ️܀ Equidistance
- Jacobi
- Heirarchical
- ↢
INTERFACE LagrangeEvalAll_Triangle
MODULE FUNCTION LagrangeEvalAll_Triangle2(order, x, xij, refTriangle, &
& coeff, firstCall, basisType) 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) :: refTriangle
!! Reference triangle
!! Biunit
!! Unit
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) :: ans(SIZE(x, 2), SIZE(xij, 2))
!! Value of n+1 Lagrange polynomials at point x
END FUNCTION LagrangeEvalAll_Triangle2
END INTERFACE LagrangeEvalAll_Triangle
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 = 4
basisType = Monomial
xij = InterpolationPoint_Triangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefTriangleCoord("UNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Triangle(&
& order=order, &
& x=xij, &
& xij=xij, &
& refTriangle="UNIT", &
& basisType=basisType, &
& coeff=coeff)
call display(ans, "ans = ")
end program main
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 = 4
basisType = Jacobi
xij = InterpolationPoint_Triangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefTriangleCoord("UNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Triangle(&
& order=order, &
& x=xij, &
& xij=xij, &
& refTriangle="UNIT", &
& basisType=basisType, &
& coeff=coeff)
call display(ans, "ans = ")
end program main
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 = 4
basisType = Heirarchical
xij = InterpolationPoint_Triangle( &
& order=order, &
& ipType=Equidistance, &
& xij=RefTriangleCoord("UNIT"), &
& layout="VEFC")
call reallocate(coeff, size(xij, 2), size(xij,2))
ans = LagrangeEvalAll_Triangle(&
& order=order, &
& x=xij, &
& xij=xij, &
& refTriangle="UNIT", &
& basisType=basisType, &
& coeff=coeff)
call display(ans, "ans = ")
end program main