Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
Private Member Functions | List of all members
sll_o_gauss_legendre_integrate_1d Interface Reference

Compute numerical integration with Gauss-Legendre formula. More...

Private Member Functions

real(kind=f64) function gauss_legendre_integral_1d (f, a, b, n)
 Gauss-Legendre Quadrature. More...
 

Detailed Description

Compute numerical integration with Gauss-Legendre formula.

Definition at line 61 of file sll_m_gauss_legendre_integration.F90.

Member Function/Subroutine Documentation

◆ gauss_legendre_integral_1d()

real(kind=f64) function gauss_legendre_integral_1d ( procedure(function_1d_legendre)  f,
real(kind=f64), intent(in)  a,
real(kind=f64), intent(in)  b,
integer(kind=i32), intent(in)  n 
)
private

Gauss-Legendre Quadrature.

To integrate the function f(x) (real-valued and of a single, real-valued argument x) over the interval [a,b], we use the Gauss-Legendre formula

\[ \int_{-1}^1 f(x)dx \approx \sum_{k=1}^{n} w_k f(x_k) \]

where n represents the desired number of Gauss points.

the function maps the interval [-1,1] into the arbitrary interval [a,b].

To be considered is to split this function into degree-specific functions to avoid the select statement.

Parameters
fthe function to be integrated
[in]aleft-bound of the definition interval of f
[in]bright-bound of the definition interval of f
[in]nthe desired number of Gauss points
Returns
The value of the integral

Definition at line 164 of file sll_m_gauss_legendre_integration.F90.

Here is the call graph for this function:
    Report Typos and Errors