Evaluate magnetic field (y-component) for Mie-Scattering of electromagnetic wave at dielectric cylinder.
Type | Intent | Optional | 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 of the function
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