Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_heaviside_gibbs_type) | :: | me |
Description of the Heaviside function |
|||
real(kind=rk), | intent(in) | :: | coord(n,3) |
Coordinates to evaluate the function for 1st index goes over number of elements and 2nd index goes over x,y,z coordinates |
||
integer, | intent(in) | :: | n |
number of return values |
return value of the function
function tem_eval_heaviside_gibbs( me, coord, n) result(res)
! ---------------------------------------------------------------------------
!> Description of the Heaviside function
type(tem_heaviside_gibbs_type) :: me
!> number of return values
integer, intent( in ) :: n
!> Coordinates to evaluate the function for
!! 1st index goes over number of elements and
!! 2nd index goes over x,y,z coordinates
real(kind=rk), intent( in ) :: coord(n,3)
!> return value of the function
real( kind=rk ) :: res(n)
! ---------------------------------------------------------------------------
integer :: iPoint
real(kind=rk) :: dist, z
! ---------------------------------------------------------------------------
! Loop over all the points
do iPoint = 1, n
! Distance from the center
dist = me%center - coord(iPoint,1)
z = 0.5_rk * dist * sqrt(1.0_rk-me%center**2) * (2.0_rk * real(me%order,rk) + 1.0_rk)
! Calculate the point value
res(iPoint) = 0.5 * (me%left + me%right) + ( dsinint(z)/PI ) * ( me%left - me%right )
end do
end function tem_eval_heaviside_gibbs