s_bsplines_uniform__init Subroutine

private subroutine s_bsplines_uniform__init(self, degree, periodic, xmin, xmax, ncells)

Type Bound

sll_t_bsplines_uniform

Arguments

Type IntentOptional Attributes Name
class(sll_t_bsplines_uniform), intent(out) :: self

uniform B-splines

integer, intent(in) :: degree

spline degree

logical, intent(in) :: periodic

.true. if domain is periodic, .false. otherwise

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

left boundary of x domain

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

right boundary of x domain

integer, intent(in) :: ncells

number of grid cells in domain


Source Code

  subroutine s_bsplines_uniform__init( self, degree, periodic, xmin, xmax, ncells )
    class(sll_t_bsplines_uniform), intent(  out) :: self
    integer                      , intent(in   ) :: degree
    logical                      , intent(in   ) :: periodic
    real(wp)                     , intent(in   ) :: xmin
    real(wp)                     , intent(in   ) :: xmax
    integer                      , intent(in   ) :: ncells

    ! Public attributes
    self % degree   = degree
    self % periodic = periodic
    self % uniform  = .true.
    self % ncells   = ncells
    self % nbasis   = merge( ncells  , ncells+degree, periodic )
    self % offset   = merge( degree/2, 0            , periodic )
    self % xmin     = xmin
    self % xmax     = xmax

    ! Private attributes
    self % inv_dx   = real(ncells,wp) / (xmax-xmin)

  end subroutine s_bsplines_uniform__init