bsplProfile_eval_at_rho2 Function

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

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

Type Bound

t_rProfile_bspl

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)


Calls

proc~~bsplprofile_eval_at_rho2~~CallsGraph proc~bsplprofile_eval_at_rho2 t_rProfile_bspl%bsplProfile_eval_at_rho2 eval_basis_and_n_derivs eval_basis_and_n_derivs proc~bsplprofile_eval_at_rho2->eval_basis_and_n_derivs

Source Code

  FUNCTION bsplProfile_eval_at_rho2( sf, rho2, deriv ) RESULT(profile_prime_value)
  ! MODULES
  !-----------------------------------------------------------------------------------------------------------------------------------
  ! INPUT VARIABLES
    CLASS(t_rProfile_bspl), INTENT(IN)  :: sf !! self
    REAL(wp)              , INTENT(IN)  :: rho2 !! evaluation point in the toroidal flux coordinate (rho2=phi/phi_edge= rhopos^2)
    INTEGER , OPTIONAL    , INTENT(IN)  :: deriv !! derivative of bspline(rho^2) in rho^2
  !-----------------------------------------------------------------------------------------------------------------------------------
  ! OUTPUT VARIABLES
    REAL(wp)                         :: profile_prime_value
  !-----------------------------------------------------------------------------------------------------------------------------------
  ! LOCAL VARIABLES
    REAL(wp)           :: base_eval(0:sf%deg,0:sf%deg) !! value and derivatives of the (deg+1) B-splines that contribute at s_pos
    INTEGER            :: first_non_zero_bspl !! index offset for the coefficients
    INTEGER             :: deriv_case
  !===================================================================================================================================
    IF (PRESENT(deriv)) THEN
      deriv_case = deriv
    ELSE
      deriv_case = 0
    END IF
    IF(deriv_case.LE.sf%deg)THEN
      CALL sf%bspl%eval_basis_and_n_derivs(rho2,deriv_case,base_eval(0:deriv_case,:),first_non_zero_bspl)
      profile_prime_value =  SUM(sf%coefs(first_non_zero_bspl:first_non_zero_bspl+sf%deg)*base_eval(deriv_case,:))
    ELSE
      profile_prime_value = 0.0_wp
    END IF
  END FUNCTION bsplProfile_eval_at_rho2