tem_eval_miescatter_magny Function

public function tem_eval_miescatter_magny(me, coord, time, n) result(res)

Evaluate magnetic field (y-component) for Mie-Scattering of electromagnetic wave at dielectric cylinder.

Arguments

Type IntentOptional Attributes Name
type(tem_miescatter_field_type), intent(in) :: me

The 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 time to evaluate the function at.

integer, intent(in) :: n

Number of points to evaluate the function for.

Return Value real(kind=rk), (n)

return value of the function


Calls

proc~~tem_eval_miescatter_magny~~CallsGraph proc~tem_eval_miescatter_magny tem_eval_miescatter_magny proc~cart2polar cart2polar proc~tem_eval_miescatter_magny->proc~cart2polar proc~tem_eval_miescatter_magnangular tem_eval_miescatter_magnangular proc~tem_eval_miescatter_magny->proc~tem_eval_miescatter_magnangular proc~tem_eval_miescatter_magnradial tem_eval_miescatter_magnradial proc~tem_eval_miescatter_magny->proc~tem_eval_miescatter_magnradial proc~tem_eval_miescatter_magnangular->proc~cart2polar proc~bessel_jn_derivative bessel_jn_derivative proc~tem_eval_miescatter_magnangular->proc~bessel_jn_derivative proc~hankel2_n_derivative hankel2_n_derivative proc~tem_eval_miescatter_magnangular->proc~hankel2_n_derivative proc~tem_eval_miescatter_magnradial->proc~cart2polar proc~hankel2_n hankel2_n proc~tem_eval_miescatter_magnradial->proc~hankel2_n proc~hankel2_n_derivative->proc~hankel2_n

Called by

proc~~tem_eval_miescatter_magny~~CalledByGraph proc~tem_eval_miescatter_magny tem_eval_miescatter_magny proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->proc~tem_eval_miescatter_magny proc~tem_spatial_for_coord tem_spatial_for_coord proc~tem_spatial_for_coord->proc~tem_eval_miescatter_magny interface~tem_spacetime_for tem_spacetime_for interface~tem_spacetime_for->proc~tem_spacetime_for_coord interface~tem_spatial_for tem_spatial_for interface~tem_spatial_for->proc~tem_spatial_for_coord proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord proc~tem_spacetime_for_stcoord->proc~tem_spacetime_for_coord proc~tem_spacetime_scalar_for_index tem_spacetime_scalar_for_index proc~tem_spacetime_scalar_for_index->proc~tem_spacetime_for_coord proc~tem_spatial_scalar_for_index tem_spatial_scalar_for_index proc~tem_spatial_scalar_for_index->proc~tem_spatial_for_coord

Source Code

  function tem_eval_miescatter_magny(me, coord, time, n) result(res)
    ! ---------------------------------------------------------------------------
    !> The function to evaluate
    type(tem_miescatter_field_type), intent(in) :: me
    !> Number of points to evaluate the function for.
    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 time to evaluate the function at.
    real(kind=rk), intent( in )  :: time
    !> return value of the function
    real(kind=rk) :: res(n)
    ! ---------------------------------------------------------------------------
    real(kind=rk) :: H_r(n), H_theta(n), H_y, polar(2)
    integer :: iPoint
    ! ---------------------------------------------------------------------------

    ! Calculate magnetizing field in polar coordinate system
    ! ... radial component
    H_r = tem_eval_miescatter_magnradial(me, coord, time, n)
    !... angular component
    H_theta = tem_eval_miescatter_magnangular(me, coord, time, n)

    ! Convert from polar vector field to cartesian vector field
    ! and convert from magnetizing field (i.e. H) to magnetic field (i.e. B)
    do iPoint = 1, n

      ! Convert to polar coordinates (relative to the center of the
      ! cylinder.
      polar = cart2polar( coord(iPoint,1)-me%miescatter%center(1), &
                        & coord(iPoint,2)-me%miescatter%center(2)  )

      ! Vector field in cartesian coordinates
      H_y = H_r(iPoint) * sin(polar(2)) + H_theta(iPoint) * cos(polar(2))

      ! Inside the cylinder
      if(polar(1) .le. me%miescatter%radius) then
        res(iPoint) = me%miescatter%permeability_cylinder * H_y
      ! Outside the cylinder
      else
        res(iPoint) = me%miescatter%permeability_background * H_y
      end if

    end do

  end function tem_eval_miescatter_magny