evaluate special 1D base in theta direction (cos(mt_i),sin(mt_i)) or its derivative(s) on a given set of points for tensor-product evaluation of 2D sin and cos base: sin(mthet-nzeta) = sin(mthet)cos(nzeta)-cos(mthet)sin(nzeta) == dot_product( (sin(mthet),-cos(mthet)) , (cos(nzeta),sin(nzeta))) cos(mthet-nzeta) = cos(mthet)cos(nzeta)+sin(mthet)sin(nzeta) == dot_product( (cos(mthet), sin(mthet)) , (cos(nzeta),sin(nzeta))) so for the 1D base, mTotal1d depends on using sin/cos/sin+cos base.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_fBase), | intent(in) | :: | sf |
self |
||
| integer, | intent(in) | :: | deriv |
=0: base, =1: dthet , =2: dthet^2 |
||
| integer, | intent(in) | :: | nthet |
number of points in theta |
||
| real(kind=wp), | intent(in) | :: | thet(1:nthet) |
theta 1D point positions |
FUNCTION fBase_eval1d_thet(sf,deriv,nthet,thet) RESULT(base1d_thet) ! MODULES IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES CLASS(t_fBase), INTENT(IN ) :: sf !! self INTEGER , INTENT(IN ) :: deriv !! =0: base, =1: dthet , =2: dthet^2 INTEGER , INTENT(IN ) :: nthet !! number of points in theta REAL(wp) , INTENT(IN ) :: thet(1:nthet) !! theta 1D point positions !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES REAL(wp) :: base1d_thet(1:nthet,1:2,1:sf%mTotal1D) !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES INTEGER :: m,m_max,i REAL(wp):: mm !=================================================================================================================================== m_max=sf%mn_max(1) SELECT CASE(deriv) CASE(0) IF((sf%sin_cos.EQ._SIN_).OR.(sf%sin_cos.EQ._SINCOS_))THEN !2D SINE DO m=0,m_max mm=REAL(m,wp) base1d_thet(:,1,1+m) = SIN(mm*thet(:)) base1d_thet(:,2,1+m) =-COS(mm*thet(:)) END DO END IF IF((sf%sin_cos.EQ._COS_).OR.(sf%sin_cos.EQ._SINCOS_))THEN !2D cosine i=sf%mTotal1D-(sf%mn_max(1)+1) !=offset, =0 if cos, =m_max+1 if sincos DO m=0,m_max mm=REAL(m,wp) base1d_thet(:,1,i+1+m) =COS(mm*thet(:)) base1d_thet(:,2,i+1+m) =SIN(mm*thet(:)) END DO END IF CASE(1) IF((sf%sin_cos.EQ._SIN_).OR.(sf%sin_cos.EQ._SINCOS_))THEN !2D SINE DO m=0,m_max mm=REAL(m,wp) base1d_thet(:,1,1+m) = mm*COS(mm*thet(:)) base1d_thet(:,2,1+m) = mm*SIN(mm*thet(:)) END DO END IF IF((sf%sin_cos.EQ._COS_).OR.(sf%sin_cos.EQ._SINCOS_))THEN !2D cosine i=sf%mTotal1D-(sf%mn_max(1)+1) !=offset, =0 if cos, =m_max+1 if sincos DO m=0,m_max mm=REAL(m,wp) base1d_thet(:,1,i+1+m) =-mm*SIN(mm*thet(:)) base1d_thet(:,2,i+1+m) = mm*COS(mm*thet(:)) END DO END IF CASE(2) IF((sf%sin_cos.EQ._SIN_).OR.(sf%sin_cos.EQ._SINCOS_))THEN !2D SINE DO m=0,m_max mm=REAL(m,wp) base1d_thet(:,1,1+m) =-mm*mm*SIN(mm*thet(:)) base1d_thet(:,2,1+m) = mm*mm*COS(mm*thet(:)) END DO END IF IF((sf%sin_cos.EQ._COS_).OR.(sf%sin_cos.EQ._SINCOS_))THEN !2D cosine i=sf%mTotal1D-(sf%mn_max(1)+1) !=offset, =0 if cos, =m_max+1 if sincos DO m=0,m_max mm=REAL(m,wp) base1d_thet(:,1,i+1+m) =-mm*mm*COS(mm*thet(:)) base1d_thet(:,2,i+1+m) =-mm*mm*SIN(mm*thet(:)) END DO END IF CASE DEFAULT CALL abort(__STAMP__, & "fBase_eval1d_thet: derivative must be 0,1,2 !") END SELECT END FUNCTION fBase_eval1d_thet