# inamuroDelta1D Function

## private function inamuroDelta1D(r) result(res)

This function calculates the delta function used in the paper of Ota et al. [7] (bibliography of treelm) for a single value.

### Arguments

Type IntentOptional AttributesName
real(kind=rk), intent(in) :: r

input point coordinate

### Return Value real(kind=rk)

resulting value of the 1D delta function

## Source Code

  function inamuroDelta1D(r) result( res )
! ---------------------------------------------------------------------------
!> input point coordinate
real(kind=rk), intent(in) :: r
!> resulting value of the 1D delta function
real(kind=rk) :: res
! ---------------------------------------------------------------------------
real(kind=rk) :: r_abs
! ---------------------------------------------------------------------------
r_abs = abs(r)
if( floor(r_abs) .eq. 0) then
res = (3._rk-2._rk*r_abs+sqrt(1._rk+4._rk*r_abs-4._rk*r_abs**2))/8._rk
else if ( floor(r_abs) .eq. 1 ) then
res = (5._rk-2._rk*r_abs-sqrt(-7._rk+12._rk*r_abs-4._rk*r_abs**2))/8._rk
else
res = 0._rk
end if

end function inamuroDelta1D