fBase_eval1d_thet Function

private function fBase_eval1d_thet(sf, deriv, nthet, thet) result(base1d_thet)

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.

Arguments

Type IntentOptional 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

Return Value real(kind=wp), (1:nthet,1:2,1:sf%mTotal1D)


Called by

proc~~fbase_eval1d_thet~~CalledByGraph proc~fbase_eval1d_thet fBase_eval1d_thet proc~fbase_evaldof_xn_tens t_fBase%fBase_evalDOF_xn_tens proc~fbase_evaldof_xn_tens->proc~fbase_eval1d_thet proc~evaluate_base_tens evaluate_base_tens proc~evaluate_base_tens->proc~fbase_evaldof_xn_tens proc~evaluate_base_tens_all evaluate_base_tens_all proc~evaluate_base_tens_all->proc~fbase_evaldof_xn_tens proc~fbase_test fBase_test proc~fbase_test->proc~fbase_evaldof_xn_tens proc~fbase_init t_fBase%fBase_init proc~fbase_init->proc~fbase_test proc~fbase_copy t_fBase%fBase_copy proc~fbase_copy->proc~fbase_init proc~fbase_new fBase_new proc~fbase_new->proc~fbase_init interface~t_fbase t_fBase interface~t_fbase->proc~fbase_new

Source Code

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
  ! CODE --------------------------------------------------------------------------------------------------------------------------!
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