| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_c_bsplines), | intent(inout), | allocatable | :: | bsplines |
allocatable polymorphic object |
|
| integer, | intent(in) | :: | degree |
spline degree |
||
| logical, | intent(in) | :: | periodic |
.true. if domain is periodic |
||
| real(kind=wp), | intent(in) | :: | xmin |
x coordinate of left boundary of domain |
||
| real(kind=wp), | intent(in) | :: | xmax |
x coordinate of right boundary of domain |
||
| integer, | intent(in) | :: | ncells |
number of cells in domain (one polynomial per cell) |
||
| real(kind=wp), | intent(in), | optional | :: | breaks(:) |
subroutine sll_s_bsplines_new( & bsplines, & degree , & periodic, & xmin , & xmax , & ncells , & breaks ) class(sll_c_bsplines), allocatable, intent(inout) :: bsplines integer , intent(in ) :: degree logical , intent(in ) :: periodic real(wp) , intent(in ) :: xmin real(wp) , intent(in ) :: xmax integer , intent(in ) :: ncells real(wp), optional, intent(in ) :: breaks(:) logical :: uniform ! Sanity checks SLL_ASSERT( .not. allocated( bsplines ) ) SLL_ASSERT( degree > 0 ) SLL_ASSERT( ncells > 0 ) SLL_ASSERT( xmin < xmax ) ! Determine if B-splines are uniform based on 'breaks' optional argument uniform = .not. present( breaks ) ! Non-uniform case: perform sanity checks on breakpoints if (.not. uniform) then SLL_ASSERT( size( breaks ) == ncells+1 ) SLL_ASSERT( xmin == breaks(1) ) SLL_ASSERT( xmax == breaks(size( breaks )) ) end if ! Allocate B-splines object to correct type if (uniform) then allocate( sll_t_bsplines_uniform :: bsplines ) else allocate( sll_t_bsplines_non_uniform :: bsplines ) end if ! Initialize B-splines object with type-specific constructor select type( bsplines ) type is( sll_t_bsplines_uniform ) call bsplines % init( degree, periodic, xmin, xmax, ncells ) type is( sll_t_bsplines_non_uniform ) call bsplines % init( degree, periodic, breaks ) end select end subroutine sll_s_bsplines_new