evaluate special 1D base in zeta 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, nTotal1d is always 2*n_max+1
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_fBase), | intent(in) | :: | sf |
self |
||
| integer, | intent(in) | :: | deriv |
=0: base, =1: dzeta , =2: dzeta^2 |
||
| integer, | intent(in) | :: | nzeta |
number of points in zeta |
||
| real(kind=wp), | intent(in) | :: | zeta(1:nzeta) |
zeta 1D point positions |
FUNCTION fBase_eval1d_zeta(sf,deriv,nzeta,zeta) RESULT(base1d_zeta) ! MODULES IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES CLASS(t_fBase), INTENT(IN ) :: sf !! self INTEGER , INTENT(IN ) :: deriv !! =0: base, =1: dzeta , =2: dzeta^2 INTEGER , INTENT(IN ) :: nzeta !! number of points in zeta REAL(wp) , INTENT(IN ) :: zeta(1:nzeta) !! zeta 1D point positions !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES REAL(wp) :: base1d_zeta(1:2,-sf%mn_max(2):sf%mn_max(2),1:nzeta) !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES INTEGER :: n,n_max,nfp REAL(wp):: nn !=================================================================================================================================== n_max=sf%mn_max(2) nfp=sf%nfp SELECT CASE(deriv) CASE(0) DO n=-n_max,n_max nn=REAL(n*nfp,wp) base1D_zeta( 1,n,:) = COS(nn*zeta(:)) base1D_zeta( 2,n,:) = SIN(nn*zeta(:)) END DO CASE(1) ! DO n=-n_max,n_max nn=REAL(n*nfp,wp) base1D_zeta( 1,n,:) = -nn*SIN(nn*zeta(:)) base1D_zeta( 2,n,:) = nn*COS(nn*zeta(:)) END DO CASE(2) DO n=-n_max,n_max nn=REAL(n*nfp,wp) base1D_zeta( 1,n,:) = -nn*nn*COS(nn*zeta(:)) base1D_zeta( 2,n,:) = -nn*nn*SIN(nn*zeta(:)) END DO CASE DEFAULT CALL abort(__STAMP__, & "fBase_eval1d_zeta: derivative must be 0,1,2 !") END SELECT END FUNCTION fBase_eval1d_zeta