MODgvec_rProfile_bspl Module

Module ** rProfile **

Defines a 1-D profile in rho^2 via B-Spline knots and coefficients


Uses

  • module~~modgvec_rprofile_bspl~~UsesGraph module~modgvec_rprofile_bspl MODgvec_rProfile_bspl module~modgvec_globals MODgvec_Globals module~modgvec_rprofile_bspl->module~modgvec_globals module~modgvec_rprofile_base MODgvec_rProfile_base module~modgvec_rprofile_bspl->module~modgvec_rprofile_base module~sll_m_bsplines sll_m_bsplines module~modgvec_rprofile_bspl->module~sll_m_bsplines iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env module~modgvec_rprofile_base->module~modgvec_globals module~sll_m_assert sll_m_assert module~sll_m_bsplines->module~sll_m_assert module~sll_m_bsplines_base sll_m_bsplines_base module~sll_m_bsplines->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform sll_m_bsplines_non_uniform module~sll_m_bsplines->module~sll_m_bsplines_non_uniform module~sll_m_bsplines_uniform sll_m_bsplines_uniform module~sll_m_bsplines->module~sll_m_bsplines_uniform module~sll_m_errors sll_m_errors module~sll_m_bsplines->module~sll_m_errors module~sll_m_working_precision sll_m_working_precision module~sll_m_bsplines->module~sll_m_working_precision module~sll_m_bsplines_base->module~sll_m_assert module~sll_m_bsplines_base->module~sll_m_working_precision module~sll_m_bsplines_non_uniform->module~sll_m_assert module~sll_m_bsplines_non_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform->module~sll_m_working_precision module~sll_m_bsplines_uniform->module~sll_m_assert module~sll_m_bsplines_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_uniform->module~sll_m_errors module~sll_m_bsplines_uniform->module~sll_m_working_precision module~sll_m_errors->iso_fortran_env

Used by

  • module~~modgvec_rprofile_bspl~~UsedByGraph module~modgvec_rprofile_bspl MODgvec_rProfile_bspl proc~initprofile InitProfile proc~initprofile->module~modgvec_rprofile_bspl proc~initvmec InitVMEC proc~initvmec->module~modgvec_rprofile_bspl

Interfaces

public interface t_rProfile_bspl

  • public function bsplProfile_new(knots, coefs) result(sf)

    initialize the rProfile of type bspline

    Arguments

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

    knots of the B-Spline with repeated start and end points

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

    B-Spline coefficients

    Return Value type(t_rProfile_bspl)

    self


Derived Types

type, public, extends(c_rProfile) ::  t_rProfile_bspl

Components

Type Visibility Attributes Name Initial
integer, public :: n_coefs
real(kind=wp), public, ALLOCATABLE :: coefs(:)
integer, public :: n_knots

number of knots, including repeated edge knots

integer, public :: deg = 0
real(kind=wp), public, ALLOCATABLE :: knots(:)

knot values, includinng edge knots

class(sll_c_bsplines), public, ALLOCATABLE :: bspl

b-spline class

Constructor

public function bsplProfile_new (knots, coefs)

initialize the rProfile of type bspline

Finalizations Procedures

final :: bsplProfile_free

Type-Bound Procedures

procedure, public :: eval_at_rho => rProfile_eval_at_rho
procedure, public :: rProfile_drho2
procedure, public :: rProfile_drho3
procedure, public :: rProfile_drho4
procedure, public :: eval_at_rho2 => bsplProfile_eval_at_rho2
procedure, public :: antiderivative => bsplProfile_antiderivative

Functions

public function bsplProfile_new(knots, coefs) result(sf)

initialize the rProfile of type bspline

Arguments

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

knots of the B-Spline with repeated start and end points

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

B-Spline coefficients

Return Value type(t_rProfile_bspl)

self

public function bsplProfile_eval_at_rho2(sf, rho2, deriv) result(profile_prime_value)

evaluate the n-th derivative of the bsplProfile at position s

Arguments

Type IntentOptional Attributes Name
class(t_rProfile_bspl), intent(in) :: sf

self

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

evaluation point in the toroidal flux coordinate (rho2=phi/phi_edge= rhopos^2)

integer, intent(in), optional :: deriv

derivative of bspline(rho^2) in rho^2

Return Value real(kind=wp)

public function bsplProfile_antiderivative(sf) result(antideriv)

get the exact spline antiderivative, with respect to rho2 the knotspan is increased by an extra multiplicity on both ends, and the new coefficients are computed as beta(i) = beta(i-1) + alpha(i)*(t(i+degree+1)-t(i))/(degree+1) From deBoor, "A practical guide to Splines", p.128

Arguments

Type IntentOptional Attributes Name
class(t_rProfile_bspl), intent(in) :: sf

self

Return Value class(c_rProfile), ALLOCATABLE


Subroutines

public subroutine bsplProfile_free(sf)

finalize the type rProfile

Arguments

Type IntentOptional Attributes Name
type(t_rProfile_bspl), intent(inout) :: sf

self