int_g1_triweight Function

public pure function int_g1_triweight(r) result(val)

Integral of triweight filter from 0 to r.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: r

Distance from filter center

Return Value real(kind=wp)

Result


Source Code

    pure function int_g1_triweight(r) result(val)
      !> Integral of triweight filter from 0 to r.
      implicit none
      real(wp), intent(in) :: r                                                !! Distance from filter center
      real(wp)             :: val                                              !! Result
      ! Work variable
      real(wp) :: new_r

      new_r = min(max(r,-1.0_wp),1.0_wp)
      val = (35.0_wp/32.0_wp)*(new_r-(new_r**3)+3.0_wp/5.0_wp*(new_r**5)-(new_r**7)/7.0_wp)

      return
    end function int_g1_triweight