Compute Chebychev-Gauss nodes and integration weights (algorithm 27, Kopriva book)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | N_in |
polynomial degree, (N_in+1) CLpoints |
||
| real(kind=wp), | intent(out) | :: | xGP(0:N_in) |
Gauss point positions for the reference interval [-1,1] |
||
| real(kind=wp), | intent(out), | optional | :: | wGP(0:N_in) |
Gauss point integration weights |
SUBROUTINE ChebyshevGaussNodesAndWeights(N_in,xGP,wGP) IMPLICIT NONE !---------------------------------------------------------------------------------------------------------------------------------- ! INPUT/OUTPUT VARIABLES INTEGER,INTENT(IN) :: N_in !! polynomial degree, (N_in+1) CLpoints REAL(wp),INTENT(OUT) :: xGP(0:N_in) !! Gauss point positions for the reference interval [-1,1] REAL(wp),INTENT(OUT),OPTIONAL :: wGP(0:N_in) !! Gauss point integration weights !---------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES INTEGER :: iGP !================================================================================================================================== DO iGP=0,N_in xGP(iGP)=-cos(REAL(2*iGP+1,wp)/REAL(2*N_in+2,wp)*PP_Pi) END DO IF(PRESENT(wGP))THEN DO iGP=0,N_in wGP(iGP)=PP_Pi/REAL(N_in+1,wp) END DO END IF END SUBROUTINE ChebyshevGaussNodesAndWeights