evaluate the n-th derivative of the bsplProfile at position s
| Type | Intent | Optional | 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 |
FUNCTION bsplProfile_eval_at_rho2( sf, rho2, deriv ) RESULT(profile_prime_value) ! 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 ! CODE --------------------------------------------------------------------------------------------------------------------------! 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