eval_fourier1d Subroutine

public pure subroutine eval_fourier1d(n_max, xn, xc, xs, zeta, x, xp, xpp, xppp, xp4)

evaluate 1d fourier series from given cos/sin coefficients and mode numbers xn SUM(xc(0:n_max)COS(xn(0:n_max)zeta)+xs(0:n_max)SIN(xn(0:n_max)zeta) evaluate all derivatives 1,2,3 alongside

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_max

number of modes is n_max+1 (0...n_max)

integer, intent(in) :: xn(0:n_max)

array of mode numbers

real(kind=wp), intent(in) :: xc(0:n_max)

cosine coefficients

real(kind=wp), intent(in) :: xs(0:n_max)

sine coefficients

real(kind=wp), intent(in) :: zeta

angular position [0,2pi]

real(kind=wp), intent(out) :: x

value at zeta

real(kind=wp), intent(out) :: xp

1st derivative in zeta

real(kind=wp), intent(out) :: xpp

2nd derivative in zeta

real(kind=wp), intent(out) :: xppp

3rd derivative in zeta

real(kind=wp), intent(out) :: xp4

4th derivative in zeta


Called by

proc~~eval_fourier1d~~CalledByGraph proc~eval_fourier1d eval_fourier1d proc~hmap_frenet_eval_x0_fromrz t_hmap_frenet%hmap_frenet_eval_X0_fromRZ proc~hmap_frenet_eval_x0_fromrz->proc~eval_fourier1d proc~checkzerocurvature checkZeroCurvature proc~checkzerocurvature->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_eval t_hmap_frenet%hmap_frenet_eval proc~hmap_frenet_eval->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_eval_dxdq t_hmap_frenet%hmap_frenet_eval_dxdq proc~hmap_frenet_eval_dxdq->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_eval_gij t_hmap_frenet%hmap_frenet_eval_gij proc~hmap_frenet_eval_gij->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_eval_gij_dq t_hmap_frenet%hmap_frenet_eval_gij_dq proc~hmap_frenet_eval_gij_dq->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_eval_jh t_hmap_frenet%hmap_frenet_eval_Jh proc~hmap_frenet_eval_jh->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_eval_jh_dq t_hmap_frenet%hmap_frenet_eval_Jh_dq proc~hmap_frenet_eval_jh_dq->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_get_ddx_dqij t_hmap_frenet%hmap_frenet_get_ddx_dqij proc~hmap_frenet_get_ddx_dqij->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_get_dx_dqi t_hmap_frenet%hmap_frenet_get_dx_dqi proc~hmap_frenet_get_dx_dqi->proc~hmap_frenet_eval_x0_fromrz proc~hmap_frenet_init_aux hmap_frenet_init_aux proc~hmap_frenet_init_aux->proc~hmap_frenet_eval_x0_fromrz proc~visufrenet VisuFrenet proc~visufrenet->proc~hmap_frenet_eval_x0_fromrz interface~t_hmap_frenet_auxvar t_hmap_frenet_auxvar interface~t_hmap_frenet_auxvar->proc~hmap_frenet_init_aux proc~hmap_frenet_init_params hmap_frenet_init_params proc~hmap_frenet_init_params->proc~checkzerocurvature proc~hmap_frenet_init_params->proc~visufrenet proc~hmap_frenet_test hmap_frenet_test proc~hmap_frenet_init_params->proc~hmap_frenet_test proc~hmap_frenet_test->proc~hmap_frenet_eval proc~hmap_frenet_test->proc~hmap_frenet_eval_dxdq proc~hmap_frenet_test->proc~hmap_frenet_eval_gij proc~hmap_frenet_test->proc~hmap_frenet_eval_gij_dq proc~hmap_frenet_test->proc~hmap_frenet_eval_jh proc~hmap_frenet_test->proc~hmap_frenet_eval_jh_dq proc~hmap_frenet_test->proc~hmap_frenet_get_ddx_dqij proc~hmap_frenet_test->proc~hmap_frenet_get_dx_dqi proc~hmap_frenet_test->proc~hmap_frenet_init_aux 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

PURE SUBROUTINE eval_fourier1d(n_max,xn,xc,xs,zeta,x,xp,xpp,xppp,xp4)
! MODULES
IMPLICIT NONE
!-----------------------------------------------------------------------------------------------------------------------------------
! INPUT VARIABLES
  INTEGER  , INTENT(IN ) :: n_max        !! number of modes is n_max+1  (0...n_max)
  INTEGER  , INTENT(IN ) :: xn(0:n_max)  !! array of mode numbers
  REAL(wp) , INTENT(IN ) :: xc(0:n_max)  !! cosine coefficients
  REAL(wp) , INTENT(IN ) :: xs(0:n_max)  !!   sine coefficients
  REAL(wp) , INTENT(IN ) :: zeta         !! angular position [0,2pi]
!-----------------------------------------------------------------------------------------------------------------------------------
! OUTPUT VARIABLES
  REAL(wp) , INTENT(OUT) :: x      !! value at zeta
  REAL(wp) , INTENT(OUT) :: xp     !! 1st derivative in zeta
  REAL(wp) , INTENT(OUT) :: xpp    !! 2nd derivative in zeta
  REAL(wp) , INTENT(OUT) :: xppp   !! 3rd derivative in zeta
  REAL(wp) , INTENT(OUT) :: xp4    !! 4th derivative in zeta
!-----------------------------------------------------------------------------------------------------------------------------------
! LOCAL VARIABLES
  REAL(wp),DIMENSION(0:n_max) :: cos_nzeta,sin_nzeta,xtmp,xptmp
!===================================================================================================================================
  cos_nzeta=COS(REAL(xn,wp)*zeta)
  sin_nzeta=SIN(REAL(xn,wp)*zeta)
  xtmp = xc*cos_nzeta+xs*sin_nzeta
  xptmp= REAL(xn,wp)*(-xc*sin_nzeta+xs*cos_nzeta)
  x    = SUM(xtmp)
  xp   = SUM(xptmp)
  xpp  = SUM(REAL(-xn*xn,wp)*xtmp)
  xppp = SUM(REAL(-xn*xn,wp)*xptmp)
  xp4  = SUM(REAL(xn**4,wp)*xtmp)

END SUBROUTINE eval_fourier1d