tem_eval_heaviside_gibbs Function

public function tem_eval_heaviside_gibbs(me, coord, n) result(res)

Arguments

Type IntentOptional 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 real(kind=rk), (n)

return value of the function


Calls

proc~~tem_eval_heaviside_gibbs~~CallsGraph proc~tem_eval_heaviside_gibbs tem_eval_heaviside_gibbs proc~dsinint dsinint proc~tem_eval_heaviside_gibbs->proc~dsinint

Called by

proc~~tem_eval_heaviside_gibbs~~CalledByGraph proc~tem_eval_heaviside_gibbs tem_eval_heaviside_gibbs proc~tem_spatial_for_coord tem_spatial_for_coord proc~tem_spatial_for_coord->proc~tem_eval_heaviside_gibbs interface~tem_spatial_for tem_spatial_for interface~tem_spatial_for->proc~tem_spatial_for_coord proc~tem_spatial_scalar_for_index tem_spatial_scalar_for_index interface~tem_spatial_for->proc~tem_spatial_scalar_for_index proc~tem_spatial_scalar_for_index->proc~tem_spatial_for_coord proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->interface~tem_spatial_for proc~tem_spacetime_for_treeids tem_spacetime_for_treeIDs proc~tem_spacetime_for_treeids->interface~tem_spatial_for proc~tem_spacetime_scalar_for_index tem_spacetime_scalar_for_index proc~tem_spacetime_scalar_for_index->interface~tem_spatial_for proc~tem_spacetime_scalar_for_index->proc~tem_spacetime_for_coord proc~tem_spacetime_vector_for_coord tem_spacetime_vector_for_coord proc~tem_spacetime_vector_for_coord->interface~tem_spatial_for proc~tem_spacetime_vector_for_index tem_spacetime_vector_for_index proc~tem_spacetime_vector_for_index->interface~tem_spatial_for proc~tem_spacetime_vector_for_index->proc~tem_spacetime_vector_for_coord proc~tem_spacetime_vector_for_treeids tem_spacetime_vector_for_treeIDs proc~tem_spacetime_vector_for_treeids->interface~tem_spatial_for proc~tem_spatial_scalar_storeval tem_spatial_scalar_storeVal proc~tem_spatial_scalar_storeval->interface~tem_spatial_for proc~tem_spatial_vector_storeval tem_spatial_vector_storeVal proc~tem_spatial_vector_storeval->interface~tem_spatial_for interface~tem_spacetime_for tem_spacetime_for interface~tem_spacetime_for->proc~tem_spacetime_for_coord interface~tem_spacetime_for->proc~tem_spacetime_for_treeids interface~tem_spacetime_for->proc~tem_spacetime_scalar_for_index interface~tem_spacetime_for->proc~tem_spacetime_vector_for_coord interface~tem_spacetime_for->proc~tem_spacetime_vector_for_index interface~tem_spacetime_for->proc~tem_spacetime_vector_for_treeids interface~tem_spatial_storeval tem_spatial_storeVal interface~tem_spatial_storeval->proc~tem_spatial_scalar_storeval interface~tem_spatial_storeval->proc~tem_spatial_vector_storeval proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord proc~tem_spacetime_for_stcoord->proc~tem_spacetime_for_coord

Source Code

  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