evaluate curve X0(zeta), position and first three derivatives, from given R0,Z0 Fourier
angle zeta=geometric toroidal angle phi=atan(y/x)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_hmap_frenet), | intent(in) | :: | sf | |||
| real(kind=wp), | intent(in) | :: | zeta |
position along closed curve parametrized in [0,2pi] |
||
| real(kind=wp), | intent(out) | :: | X0(1:3) |
curve position in cartesian coordinates |
||
| real(kind=wp), | intent(out) | :: | X0p(1:3) |
1st derivative in zeta |
||
| real(kind=wp), | intent(out) | :: | X0pp(1:3) |
2nd derivative in zeta |
||
| real(kind=wp), | intent(out) | :: | X0ppp(1:3) |
3rd derivative in zeta |
||
| real(kind=wp), | intent(out), | optional | :: | X0p4(1:3) |
4th derivative in zeta |
PURE SUBROUTINE hmap_frenet_eval_X0_fromRZ( sf,zeta,X0,X0p,X0pp,X0ppp,X0p4) ! MODULES IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES CLASS(t_hmap_frenet), INTENT(IN ) :: sf REAL(wp) , INTENT(IN ) :: zeta !! position along closed curve parametrized in [0,2pi] !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES REAL(wp) , INTENT(OUT) :: X0(1:3) !! curve position in cartesian coordinates REAL(wp) , INTENT(OUT) :: X0p(1:3) !! 1st derivative in zeta REAL(wp) , INTENT(OUT) :: X0pp(1:3) !! 2nd derivative in zeta REAL(wp) , INTENT(OUT) :: X0ppp(1:3) !! 3rd derivative in zeta REAL(wp) , INTENT(OUT),OPTIONAL :: X0p4(1:3) !! 4th derivative in zeta !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES REAL(wp) :: R0,R0p,R0pp,R0ppp,R0p4,Z0p4 REAL(wp) :: coszeta,sinzeta !=================================================================================================================================== CALL eval_fourier1d(sf%n_max,sf%Xn,sf%rc,sf%rs,zeta,R0,R0p,R0pp,R0ppp,R0p4) CALL eval_fourier1d(sf%n_max,sf%Xn,sf%zc,sf%zs,zeta,X0(3),X0p(3),X0pp(3),X0ppp(3),Z0p4) !=Z0,Z0p,Z0pp,Z0ppp coszeta=COS(zeta) sinzeta=SIN(zeta) ASSOCIATE(x =>X0(1) ,y =>X0(2) , & xp =>X0p(1) ,yp =>X0p(2) , & xpp =>X0pp(1) ,ypp =>X0pp(2) , & xppp=>X0ppp(1),yppp=>X0ppp(2)) !! angle zeta=geometric toroidal angle phi=atan(y/x) x=R0*coszeta y=R0*sinzeta xp = R0p*coszeta - R0*sinzeta yp = R0p*sinzeta + R0*coszeta !xp = R0p*coszeta -y !yp = R0p*sinzeta +x xpp = R0pp*coszeta - 2*R0p*sinzeta - R0*coszeta ypp = R0pp*sinzeta + 2*R0p*coszeta - R0*sinzeta !xpp = R0pp*coszeta -2.0_wp*yp + x !ypp = R0pp*sinzeta +2.0_wp*xp + y xppp = R0ppp*coszeta - 3*R0pp*sinzeta - 3*R0p*coszeta + R0*sinzeta yppp = R0ppp*sinzeta + 3*R0pp*coszeta - 3*R0p*sinzeta - R0*coszeta !xppp = R0ppp*coszeta +3.0_wp*(xp-ypp) + y !yppp = R0ppp*sinzeta +3.0_wp*(yp+xpp) + x IF(PRESENT(X0p4))THEN X0p4(1) = R0p4*coszeta - 4*R0ppp*sinzeta - 6*R0pp*coszeta + 4*R0p*sinzeta + R0*coszeta X0p4(2) = R0p4*sinzeta + 4*R0ppp*coszeta - 6*R0pp*sinzeta - 4*R0p*coszeta + R0*sinzeta X0p4(3) = Z0p4 END IF END ASSOCIATE !x,y,xp,yp,... END SUBROUTINE hmap_frenet_eval_X0_fromRZ