db1fqad Subroutine

public subroutine db1fqad(fun, tx, bcoef, nx, kx, idx, x1, x2, tol, f, iflag, w0)

Computes the integral on (x1,x2) of a product of a function fun and the idx-th derivative of a kx-th order b-spline, using the b-representation (tx,bcoef,nx,kx), with an adaptive 8-point Legendre-Gauss algorithm. (x1,x2) must be a subinterval of t(kx) <= x <= t(nx+1).

See also

Note

This one is not pure, because we are not enforcing that the user function fun be pure.

Arguments

Type IntentOptional Attributes Name
procedure(b1fqad_func) :: fun

external function of one argument for the integrand bf(x)=fun(x)*dbvalu(tx,bcoef,nx,kx,id,x,inbv,work)

real(kind=wp), intent(in), dimension(nx+kx) :: tx

knot array

real(kind=wp), intent(in), dimension(nx) :: bcoef

b-spline coefficient array

integer(kind=ip), intent(in) :: nx

length of coefficient array

integer(kind=ip), intent(in) :: kx

order of b-spline, kx >= 1

integer(kind=ip), intent(in) :: idx

order of the spline derivative, 0 <= idx <= k-1 idx=0 gives the spline function

real(kind=wp), intent(in) :: x1

left point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: x2

right point of quadrature interval in t(k) <= x <= t(n+1)

real(kind=wp), intent(in) :: tol

desired accuracy for the quadrature, suggest 10*dtol < tol <= 0.1 where dtol is the maximum of 1.0e-300 and real(wp) unit roundoff for the machine

real(kind=wp), intent(out) :: f

integral of bf(x) on (x1,x2)

integer(kind=ip), intent(out) :: iflag

status flag:

  • : no errors
  • : error
real(kind=wp), intent(inout), dimension(3_ip*kx) :: w0

work array for dbfqad


Calls

proc~~db1fqad~~CallsGraph proc~db1fqad bspline_sub_module::db1fqad proc~dbfqad bspline_sub_module::dbfqad proc~db1fqad->proc~dbfqad proc~dbsgq8 bspline_sub_module::dbsgq8 proc~dbfqad->proc~dbsgq8 proc~dintrv bspline_sub_module::dintrv proc~dbfqad->proc~dintrv proc~dbvalu bspline_sub_module::dbvalu proc~dbsgq8->proc~dbvalu proc~get_temp_x_for_extrap bspline_sub_module::get_temp_x_for_extrap proc~dintrv->proc~get_temp_x_for_extrap proc~dbvalu->proc~dintrv

Called by

proc~~db1fqad~~CalledByGraph proc~db1fqad bspline_sub_module::db1fqad proc~fintegral_1d bspline_oo_module::bspline_1d%fintegral_1d proc~fintegral_1d->proc~db1fqad

Source Code

    subroutine db1fqad(fun,tx,bcoef,nx,kx,idx,x1,x2,tol,f,iflag,w0)

    implicit none

    procedure(b1fqad_func)              :: fun    !! external function of one argument for the
                                                  !! integrand `bf(x)=fun(x)*dbvalu(tx,bcoef,nx,kx,id,x,inbv,work)`
    integer(ip),intent(in)              :: nx     !! length of coefficient array
    integer(ip),intent(in)              :: kx     !! order of b-spline, `kx >= 1`
    real(wp),dimension(nx+kx),intent(in):: tx     !! knot array
    real(wp),dimension(nx),intent(in)   :: bcoef  !! b-spline coefficient array
    integer(ip),intent(in)              :: idx    !! order of the spline derivative, `0 <= idx <= k-1`
                                                  !! `idx=0` gives the spline function
    real(wp),intent(in)                 :: x1     !! left point of quadrature interval in `t(k) <= x <= t(n+1)`
    real(wp),intent(in)                 :: x2     !! right point of quadrature interval in `t(k) <= x <= t(n+1)`
    real(wp),intent(in)                 :: tol    !! desired accuracy for the quadrature, suggest
                                                  !! `10*dtol < tol <= 0.1` where `dtol` is the maximum
                                                  !! of `1.0e-300` and real(wp) unit roundoff for
                                                  !! the machine
    real(wp),intent(out)                :: f      !! integral of `bf(x)` on `(x1,x2)`
    integer(ip),intent(out)             :: iflag  !! status flag:
                                                  !!
                                                  !! * \( = 0 \)   : no errors
                                                  !! * \( \ne 0 \) : error
    real(wp),dimension(3_ip*kx),intent(inout) :: w0  !! work array for [[dbfqad]]

    call dbfqad(fun,tx,bcoef,nx,kx,idx,x1,x2,tol,f,iflag,w0)

    end subroutine db1fqad