hmap_frenet_eval Function

public function hmap_frenet_eval(sf, q_in) result(x_out)

evaluate the mapping h (q1,q2,zeta) -> (x,y,z)

Type Bound

t_hmap_frenet

Arguments

Type IntentOptional Attributes Name
class(t_hmap_frenet), intent(in) :: sf
real(kind=wp), intent(in) :: q_in(3)

Return Value real(kind=wp), (3)


Calls

proc~~hmap_frenet_eval~~CallsGraph proc~hmap_frenet_eval t_hmap_frenet%hmap_frenet_eval interface~cross CROSS proc~hmap_frenet_eval->interface~cross proc~hmap_frenet_eval_x0_fromrz t_hmap_frenet%hmap_frenet_eval_X0_fromRZ proc~hmap_frenet_eval->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_sigma t_hmap_frenet%hmap_frenet_sigma proc~hmap_frenet_eval->proc~hmap_frenet_sigma interface~cross->interface~cross proc~eval_fourier1d eval_fourier1d proc~hmap_frenet_eval_x0_fromrz->proc~eval_fourier1d

Called by

proc~~hmap_frenet_eval~~CalledByGraph proc~hmap_frenet_eval t_hmap_frenet%hmap_frenet_eval proc~hmap_frenet_test hmap_frenet_test proc~hmap_frenet_test->proc~hmap_frenet_eval proc~hmap_frenet_init_params hmap_frenet_init_params proc~hmap_frenet_init_params->proc~hmap_frenet_test interface~t_hmap_frenet t_hmap_frenet interface~t_hmap_frenet->proc~hmap_frenet_init_params proc~hmap_frenet_init hmap_frenet_init interface~t_hmap_frenet->proc~hmap_frenet_init proc~hmap_frenet_init->proc~hmap_frenet_init_params

Source Code

FUNCTION hmap_frenet_eval( sf ,q_in) RESULT(x_out)
! MODULES
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT VARIABLES
  CLASS(t_hmap_frenet), INTENT(IN) :: sf
  REAL(wp)            , INTENT(IN) :: q_in(3)
!-----------------------------------------------------------------------------------------------------------------------------------
! OUTPUT VARIABLES
  REAL(wp)                         :: x_out(3)
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
  REAL(wp),DIMENSION(3) :: X0,X0p,X0pp,X0ppp,T,N,B
  REAL(wp)          :: lp,absB,kappa,sigma,Jh
!===================================================================================================================================
  ! q(:) = (q1,q2,zeta) are the variables in the domain of the map
  ! X(:) = (x,y,z) are the variables in the range of the map
  !
  !  |x |
  !  |y |=  X0(zeta) + sigma*(N(zeta)*q1 + B(zeta)*q2)
  !  |z |

  ASSOCIATE(q1=>q_in(1),q2=>q_in(2),zeta=>q_in(3))
  CALL sf%eval_X0(zeta,X0,X0p,X0pp,X0ppp)
  lp=SQRT(SUM(X0p*X0p))
  T=X0p/lp
  B=CROSS(X0p,X0pp)
  absB=SQRT(SUM(B*B))
  kappa=absB/(lp**3)
  IF(kappa.LT.1.0e-8) &
      CALL abort(__STAMP__, &
           "hmap_frenet cannot evaluate frame at curvature < 1e-8 !",RealInfo=zeta*sf%nfp/TWOPI)
  sigma=sf%sigma(zeta)
  Jh=lp*(1.0_wp-sigma*kappa*q1)
  IF(Jh.LT.1.0e-12) &
      CALL abort(__STAMP__, &
           "hmap_frenet, evaluation outside curvature radius (sigma*q1 >= 1./(kappa))",RealInfo=zeta*sf%nfp/TWOPI)
  B=B/absB
  N=CROSS(B,T)
  x_out=X0 +sigma*(q1*N + q2*B)
  END ASSOCIATE
END FUNCTION hmap_frenet_eval