UltrasphericalGaussLobattoQuadrature
This routine returns the Quadrature points and weights.
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE UltrasphericalGaussLobattoQuadrature(n, lambda, pt, wt)
INTEGER(I4B), INTENT(IN) :: n
!! order of Ultraspherical polynomials
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
REAL(DFP), INTENT(OUT) :: pt(:)
!! n+2 quad points indexed from 1 to n+2
REAL(DFP), OPTIONAL, INTENT(OUT) :: wt(:)
!! n+2 weights, index from 1 to n+2
END SUBROUTINE UltrasphericalGaussLobattoQuadrature
END INTERFACE
- This example shows the usage of
UltrasphericalGaussLobattoQuadrature
method. - This routine returns the quadrature points for Ultraspherical weights.
Note that this routine returns n+2 points, the first point is -1 and last point is +1
program main
use easifembase
implicit none
integer( i4b ) :: n
real(dfp), parameter :: lambda=0.5_DFP
real( dfp ), allocatable :: pt( : ), wt( : )
type(string) :: msg, astr
n = 0; call callme
See results
Ultraspherical Gauss Lobatto points, n+2 = 3
pt | wt |
---|---|
-1 | 0.33333 |
-4.48639E-17 | 1.3333 |
1 | 0.33333 |
n = 1; call callme
See results
Ultraspherical Gauss Lobatto points, n+2 = 3
pt | wt |
---|---|
-1 | 0.33333 |
-4.48639E-17 | 1.3333 |
1 | 0.33333 |
n = 2; call callme
See results
Ultraspherical Gauss Lobatto points, n+2 = 4
pt | wt |
---|---|
-1 | 0.16667 |
-0.44721 | 0.83333 |
0.44721 | 0.83333 |
1 | 0.16667 |
n = 3; call callme
See results
Ultraspherical Gauss Lobatto points, n+2 = 4
pt | wt |
---|---|
-1 | 0.1 |
-0.65465 | 0.54444 |
-6.41178E-17 | 0.71111 |
0.65465 | 0.54444 |
1 | 0.1 |
contains
subroutine callme
call reallocate( pt, n+2, wt, n+2 )
call UltrasphericalGaussLobattoQuadrature( n=n, &
& pt=pt, wt=wt, lambda=lambda )
msg="Ultraspherical Gauss Lobatto points, n+2 = " &
& // tostring( n+2 )
call display(msg%chars())
astr = MdEncode( pt .COLCONCAT. wt )
call display( astr%chars(), "" )
end subroutine callme
end program main