UltrasphericalGradientEval
Evaluate gradient of Ultraspherical polynomials.
Interface 1
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION UltrasphericalGradientEval(n, lambda, x) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of polynomial
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
REAL(DFP), INTENT(IN) :: x
REAL(DFP) :: ans
END FUNCTION UltrasphericalGradientEval
END INTERFACE
This example shows the usage of UltrasphericalGradientEval
method.
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ) :: ans, x, exact
real( dfp ), parameter :: tol=1.0E-10, lambda=0.5_DFP
n = 3
x = -1.0_DFP; call callme
exact = 0.5_DFP*(3*5.0 * x**2 - 3.0)
call ok( SOFTEQ(ans, exact, tol ))
x = 0.0_DFP; call callme
exact = 0.5_DFP*(3*5.0 * x**2 - 3.0)
call ok( SOFTEQ(ans, exact, tol ))
x = +1.0_DFP; call callme
exact = 0.5_DFP*(3*5.0 * x**2 - 3.0)
call ok( SOFTEQ(ans, exact, tol ))
contains
subroutine callme
ans= UltrasphericalGradientEval( n=n, x=x, &
& lambda=lambda )
end subroutine callme
end program main
Interface 2
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION UltrasphericalGradientEval(n, lambda, x) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of polynomial
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
REAL(DFP), INTENT(IN) :: x(:)
REAL(DFP) :: ans(1:SIZE(x))
END FUNCTION UltrasphericalGradientEval
END INTERFACE
This example shows the usage of UltrasphericalGradientEval
method.
This routine evaluates gradient of Ultraspherical polynomial of order n, at several points.
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ), allocatable :: ans(:), x(:), exact(:)
real( dfp ), parameter :: tol=1.0E-10, lambda=0.5_DFP
type(string) :: astr
n = 3
x = [-1.0, 0.0, 1.0]; call callme
exact = 0.5_DFP*(3*5.0 * x**2 - 3.0)
call ok( ALL(SOFTEQ(ans, exact, tol )))
contains
subroutine callme
ans= UltrasphericalGradientEval( n=n, x=x, &
& lambda=lambda )
end subroutine callme
end program main