Checks if the value is withing the range of the knot vectors.
This is called by the various db*val
routines.
Type | Intent | Optional | 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) |
returns 0 if value is OK, otherwise returns 600+i
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 else allow_extrapolation = .false. end if if (allow_extrapolation) then ! in this case all values are OK iflag = 0_ip else if (x<t(1_ip) .or. x>t(size(t,kind=ip))) then iflag = 600_ip + i ! value out of bounds (601, 602, etc.) else iflag = 0_ip end if end if end function check_value