evaluate the mapping h (q1,q2,zeta) -> (x,y,z)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_hmap_frenet), | intent(in) | :: | sf | |||
| real(kind=wp), | intent(in) | :: | q_in(3) |
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