check_value Function

private pure function check_value(x, t, i, extrap) result(iflag)

Checks if the value is withing the range of the knot vectors. This is called by the various db*val routines.


Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

the value to check

real(kind=wp), intent(in), dimension(:) :: t

the knot vector

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

1=x, 2=y, 3=z, 4=q, 5=r, 6=s

logical, intent(in), optional :: extrap

if extrapolation is allowed (if not present, default is False)

Return Value integer(kind=ip)

returns 0 if value is OK, otherwise returns 600+i

Called by

proc~~check_value~~CalledByGraph proc~check_value bspline_sub_module::check_value proc~db1val_alt bspline_sub_module::db1val_alt proc~db1val_alt->proc~check_value proc~db1val_default bspline_sub_module::db1val_default proc~db1val_default->proc~check_value proc~db2val bspline_sub_module::db2val proc~db2val->proc~check_value proc~db3val bspline_sub_module::db3val proc~db3val->proc~check_value proc~db4val bspline_sub_module::db4val proc~db4val->proc~check_value proc~db5val bspline_sub_module::db5val proc~db5val->proc~check_value proc~db6val bspline_sub_module::db6val proc~db6val->proc~check_value interface~db1val bspline_sub_module::db1val interface~db1val->proc~db1val_alt interface~db1val->proc~db1val_default proc~evaluate_2d bspline_oo_module::bspline_2d%evaluate_2d proc~evaluate_2d->proc~db2val proc~evaluate_3d bspline_oo_module::bspline_3d%evaluate_3d proc~evaluate_3d->proc~db3val proc~evaluate_4d bspline_oo_module::bspline_4d%evaluate_4d proc~evaluate_4d->proc~db4val proc~evaluate_5d bspline_oo_module::bspline_5d%evaluate_5d proc~evaluate_5d->proc~db5val proc~evaluate_6d bspline_oo_module::bspline_6d%evaluate_6d proc~evaluate_6d->proc~db6val proc~evaluate_1d bspline_oo_module::bspline_1d%evaluate_1d proc~evaluate_1d->interface~db1val

Source Code

    pure function check_value(x,t,i,extrap) result(iflag)

    implicit none

    integer(ip)                      :: iflag   !! returns 0 if value is OK, otherwise returns `600+i`
    real(wp),intent(in)              :: x       !! the value to check
    integer(ip),intent(in)           :: i       !! 1=x, 2=y, 3=z, 4=q, 5=r, 6=s
    real(wp),dimension(:),intent(in) :: t       !! the knot vector
    logical,intent(in),optional      :: extrap  !! if extrapolation is allowed
                                                !! (if not present, default is False)

    logical :: allow_extrapolation  !! if extrapolation is allowed

    if (present(extrap)) then
        allow_extrapolation = extrap
        allow_extrapolation = .false.
    end if

    if (allow_extrapolation) then
        ! in this case all values are OK
        iflag = 0_ip
        if (x<t(1_ip) .or. x>t(size(t,kind=ip))) then
            iflag = 600_ip + i  ! value out of bounds (601, 602, etc.)
            iflag = 0_ip
        end if
    end if

    end function check_value