UnscaledLobattoEval
Evaluate UnscaledLobatto polynomial.
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION UnscaledLobattoEval(n, x) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
REAL(DFP), INTENT(IN) :: x
REAL(DFP) :: ans
!! Evaluate UnscaledLobatto polynomial of order n at point x
END FUNCTION UnscaledLobattoEval
END INTERFACE
This example shows the usage of UnscaledLobattoEval
method.
This routine evaluates UnscaledLobatto polynomial of order n, at single point
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ) :: ans, x, exact
real( dfp ), parameter :: tol=1.0E-8
n = 5
x = -0.5_DFP; call callme
exact = (1.0_DFP/8.0_DFP/9.0_DFP)*(63.0*x**5-90.0*x**3+27.0*x)
call ok( SOFTEQ(ans, exact, tol ))
x = 0.5_DFP; call callme
exact = (1.0_DFP/8.0_DFP/9.0_DFP)*(63.0*x**5-90.0*x**3+27.0*x)
call ok( SOFTEQ(ans, exact, tol ))
x = 0.2_DFP; call callme
exact = (1.0_DFP/8.0_DFP/9.0_DFP)*(63.0*x**5-90.0*x**3+27.0*x)
call ok( SOFTEQ(ans, exact, tol ))
contains
subroutine callme
ans= UnscaledLobattoEval( n=n, x=x )
end subroutine callme
end program main
Interface 2
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION UnscaledLobattoEval(n, x) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
REAL(DFP), INTENT(IN) :: x(:)
REAL(DFP) :: ans(SIZE(x))
!! Evaluate UnscaledLobatto polynomial of order n at point x
END FUNCTION UnscaledLobattoEval
END INTERFACE
This example shows the usage of UnscaledLobattoEval
method.
This routine evaluates UnscaledLobatto 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-08
type(string) :: astr
n = 5
x = [-0.5, 0.5, 0.5]; call callme
exact = (1.0_DFP/8.0_DFP/9.0_DFP)*(63.0*x**5-90.0*x**3+27.0*x)
call ok( ALL(SOFTEQ(ans, exact, tol )))
contains
subroutine callme
ans= UnscaledLobattoEval( n=n, x=x )
end subroutine callme
end program main