Initialize a bspline_3d type (with automatically-computed knots). This is a wrapper for db3ink.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bspline_3d), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in), | dimension(:) | :: | x |
|
|
real(kind=wp), | intent(in), | dimension(:) | :: | y |
|
|
real(kind=wp), | intent(in), | dimension(:) | :: | z |
|
|
real(kind=wp), | intent(in), | dimension(:,:,:) | :: | fcn |
|
|
integer(kind=ip), | intent(in) | :: | kx |
The order of spline pieces in ( ) (order = polynomial degree + 1) |
||
integer(kind=ip), | intent(in) | :: | ky |
The order of spline pieces in ( ) (order = polynomial degree + 1) |
||
integer(kind=ip), | intent(in) | :: | kz |
The order of spline pieces in ( ) (order = polynomial degree + 1) |
||
integer(kind=ip), | intent(out) | :: | iflag |
status flag (see db3ink) |
||
logical, | intent(in), | optional | :: | extrap |
if true, then extrapolation is allowed (default is false) |
pure subroutine initialize_3d_auto_knots(me,x,y,z,fcn,kx,ky,kz,iflag,extrap) implicit none class(bspline_3d),intent(inout) :: me real(wp),dimension(:),intent(in) :: x !! `(nx)` array of \(x\) abcissae. Must be strictly increasing. real(wp),dimension(:),intent(in) :: y !! `(ny)` array of \(y\) abcissae. Must be strictly increasing. real(wp),dimension(:),intent(in) :: z !! `(nz)` array of \(z\) abcissae. Must be strictly increasing. real(wp),dimension(:,:,:),intent(in) :: fcn !! `(nx,ny,nz)` matrix of function values to interpolate. !! `fcn(i,j,k)` should contain the function value at the !! point (`x(i)`,`y(j)`,`z(k)`) integer(ip),intent(in) :: kx !! The order of spline pieces in \(x\) !! ( \( 2 \le k_x < n_x \) ) !! (order = polynomial degree + 1) integer(ip),intent(in) :: ky !! The order of spline pieces in \(y\) !! ( \( 2 \le k_y < n_y \) ) !! (order = polynomial degree + 1) integer(ip),intent(in) :: kz !! The order of spline pieces in \(z\) !! ( \( 2 \le k_z < n_z \) ) !! (order = polynomial degree + 1) integer(ip),intent(out) :: iflag !! status flag (see [[db3ink]]) logical,intent(in),optional :: extrap !! if true, then extrapolation is allowed !! (default is false) integer(ip) :: iknot integer(ip) :: nx,ny,nz call me%destroy() nx = size(x,kind=ip) ny = size(y,kind=ip) nz = size(z,kind=ip) me%nx = nx me%ny = ny me%nz = nz me%kx = kx me%ky = ky me%kz = kz allocate(me%tx(nx+kx)) allocate(me%ty(ny+ky)) allocate(me%tz(nz+kz)) allocate(me%bcoef(nx,ny,nz)) allocate(me%work_val_1(ky,kz)) allocate(me%work_val_2(kz)) allocate(me%work_val_3(3_ip*max(kx,ky,kz))) iknot = 0_ip !knot sequence chosen by db3ink call db3ink(x,nx,y,ny,z,nz,& fcn,& kx,ky,kz,& iknot,& me%tx,me%ty,me%tz,& me%bcoef,iflag) if (iflag==0_ip) then call me%set_extrap_flag(extrap) end if me%initialized = iflag==0_ip me%iflag = iflag end subroutine initialize_3d_auto_knots