Calculate the function values for the cylindrical wave.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_cylindricalWave_type) | :: | me |
Spacetime function to evaluate |
|||
real(kind=rk), | intent(in) | :: | coord(n,3) |
barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates |
||
real(kind=rk), | intent(in) | :: | time |
The current physical time |
||
integer, | intent(in) | :: | n |
Number of arrays to return |
return value
function tem_eval_cylindricalWave(me, coord, time, n) result(res)
!> Spacetime function to evaluate
type(tem_cylindricalWave_type) :: me
!> Number of arrays to return
integer, intent(in) :: n
!> barycentric Ids of an elements.
!! 1st index goes over number of elements and
!! 2nd index goes over x,y,z coordinates
real(kind=rk), intent( in ) :: coord(n,3)
!> The current physical time
real(kind=rk), intent( in ) :: time
!> return value
real(kind=rk) :: res(n)
! ---------------------------------------------------------------------------
real(kind=rk) :: polar(n,2)
integer :: i
! ---------------------------------------------------------------------------
polar = cart2polar(coord, n)
do i = 1,n
if(polar(i,1) <= me%radius) then
res(i) = bessel_jn(me%order, me%radialConstant * polar(i,1) ) &
& * cos(real(me%order,rk)*polar(i,2) + me%radialConstant*time)
else
res(i) = 0.0_rk
end if
end do
end function tem_eval_cylindricalWave