cheb_quad Function

public function cheb_quad(tag, a, b, n, x, f) result(valint)

This subroutine evaluates an integral using Gauss-Chebyshev (CGL/CGR/CG) quadrature for a single variable.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: tag

{'CGL', 'CG', 'CGR'}
Type of nodes, where 'CGL': Chebyshev-Gauss-Lobatto, 'CG': Chebyshev-Gauss, and 'CGR': Chebyshev-Gauss-Radau.

real(kind=rp), intent(in) :: a

Domain bounds [a, b]

real(kind=rp), intent(in) :: b

Domain bounds [a, b]

integer, intent(in) :: n

Number of nodes is n+1

real(kind=rp), intent(in), dimension(0:n) :: x

Nodal coordinates in [-1, 1]

real(kind=rp), intent(in), dimension(0:n) :: f

Value of the function at the nodes

Return Value real(kind=rp)