tem_init_data Subroutine

private subroutine tem_init_data(conf, thandle, miescatter, mieexpansion)

Init the expansion coefficients for the Mie-Scattering.

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

type(tem_miescatter_type), intent(in) :: miescatter

The description of the Mie-Scattering setup.

type(tem_mieexpansion_type), intent(out) :: mieexpansion

The expansion coefficients to be filled


Calls

proc~~tem_init_data~~CallsGraph proc~tem_init_data tem_init_data proc~tem_get_ncoeffs_miescat tem_get_ncoeffs_miescat proc~tem_init_data->proc~tem_get_ncoeffs_miescat proc~bessel_jn_derivative bessel_jn_derivative proc~tem_init_data->proc~bessel_jn_derivative proc~hankel2_n hankel2_n proc~tem_init_data->proc~hankel2_n proc~hankel2_n_derivative hankel2_n_derivative proc~tem_init_data->proc~hankel2_n_derivative proc~aot_get_val aot_get_val proc~tem_get_ncoeffs_miescat->proc~aot_get_val proc~tem_abort tem_abort proc~tem_get_ncoeffs_miescat->proc~tem_abort proc~hankel2_n_derivative->proc~hankel2_n mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_init_data~~CalledByGraph proc~tem_init_data tem_init_data proc~tem_load_miescatter tem_load_miescatter proc~tem_load_miescatter->proc~tem_init_data interface~tem_load_miescatter_displacementfieldz tem_load_miescatter_displacementfieldz interface~tem_load_miescatter_displacementfieldz->proc~tem_load_miescatter interface~tem_load_miescatter_magneticfieldy tem_load_miescatter_magneticfieldy interface~tem_load_miescatter_magneticfieldy->proc~tem_load_miescatter interface~tem_load_miescatter_magneticfieldx tem_load_miescatter_magneticfieldx interface~tem_load_miescatter_magneticfieldx->proc~tem_load_miescatter proc~load_spatial_predefined load_spatial_predefined proc~load_spatial_predefined->interface~tem_load_miescatter_displacementfieldz proc~load_spatial_predefined->interface~tem_load_miescatter_magneticfieldy proc~load_spatial_predefined->interface~tem_load_miescatter_magneticfieldx proc~load_spacetime_predefined load_spacetime_predefined proc~load_spacetime_predefined->interface~tem_load_miescatter_displacementfieldz proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldy proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldx proc~tem_load_spatial tem_load_spatial proc~tem_load_spatial->proc~load_spatial_predefined proc~tem_load_spacetime_single tem_load_spacetime_single proc~tem_load_spacetime_single->proc~load_spacetime_predefined

Contents

Source Code


Source Code

  subroutine tem_init_data( conf, thandle, miescatter, mieexpansion )
    ! --------------------------------------------------------------------------
    !> lua state type
    type(flu_State) :: conf
    !> aotus parent handle
    integer, intent(in) :: thandle
    !> The description of the Mie-Scattering setup.
    type(tem_miescatter_type), intent(in) :: miescatter
    !> The expansion coefficients to be filled
    type(tem_mieexpansion_type), intent(out) :: mieexpansion
    ! --------------------------------------------------------------------------
    integer :: nCoeffs, n
    ! --------------------------------------------------------------------------

    ! Get the number of expansion coefficients to be used ....
    nCoeffs = tem_get_ncoeffs_miescat(conf,thandle)
    mieexpansion%nCoeffs = nCoeffs

    ! Calculate the expansion coefficients inside the cylinder
    allocate(mieexpansion%c_tot(-nCoeffs:nCoeffs))
    innerLoop: do n = -nCoeffs, nCoeffs

      ! C_n^{tot}
      mieexpansion%c_tot(n)                                                    &
        & = (0.0_rk,1.0_rk)**(-n) *                                            &
        & ( (miescatter%wavenumber_background /                                &
        &               miescatter%permeability_background)                    &
        & * bessel_jn_derivative(n,                                            &
        &               miescatter%wavenumber_background * miescatter%radius)  &
        & * hankel2_n(n,miescatter%wavenumber_background * miescatter%radius)  &
        & - (miescatter%wavenumber_background /                                &
        &               miescatter%permeability_background)                    &
        & * hankel2_n_derivative(n,                                            &
        &               miescatter%wavenumber_background * miescatter%radius)  &
        & * bessel_jn(n,miescatter%wavenumber_background * miescatter%radius)  &
        & )                                                                    &
        & /                                                                    &
        & (                                                                    &
        &   (miescatter%wavenumber_cylinder /                                  &
        &               miescatter%permeability_cylinder)                      &
        & * bessel_jn_derivative(n,                                            &
        &               miescatter%wavenumber_cylinder * miescatter%radius)    &
        & * hankel2_n(n,miescatter%wavenumber_background * miescatter%radius)  &
        & - (miescatter%wavenumber_background /                                &
        &               miescatter%permeability_background)&
        & * hankel2_n_derivative(n,                                            &
        &               miescatter%wavenumber_background * miescatter%radius)  &
        & * bessel_jn(n,miescatter%wavenumber_cylinder * miescatter%radius)    &
        & )

    end do innerLoop

    ! Calculate the expansion coefficients outside of the cylinder, for the
    ! scattered field
    allocate(mieexpansion%c_scat(-nCoeffs:nCoeffs))
    outerLoop: do n = -nCoeffs, nCoeffs

      ! C_n^{scat}
      mieexpansion%c_scat(n) &
      & = (0.0_rk,1.0_rk)**(-n) *                                              &
      & ( (miescatter%wavenumber_background /                                  &
      &               miescatter%permeability_background)                      &
      & * bessel_jn_derivative(n,                                              &
      &               miescatter%wavenumber_background*miescatter%radius)      &
      & * bessel_jn(n,miescatter%wavenumber_cylinder*miescatter%radius)        &
      & - (miescatter%wavenumber_cylinder/miescatter%permeability_cylinder)    &
      & * bessel_jn_derivative(n,                                              &
      &               miescatter%wavenumber_cylinder*miescatter%radius)        &
      & * bessel_jn(n,miescatter%wavenumber_background*miescatter%radius)      &
      & )                                                                      &
      & /                                                                      &
      & (                                                                      &
      &   (miescatter%wavenumber_cylinder/miescatter%permeability_cylinder)    &
      & * bessel_jn_derivative(n,                                              &
      &               miescatter%wavenumber_cylinder*miescatter%radius)        &
      & * hankel2_n(n,miescatter%wavenumber_background*miescatter%radius)      &
      & - (miescatter%wavenumber_background /                                  &
      &               miescatter%permeability_background)                      &
      & * hankel2_n_derivative(n,                                              &
      &               miescatter%wavenumber_background*miescatter%radius)      &
      & * bessel_jn(n,miescatter%wavenumber_cylinder*miescatter%radius)        &
      & )

    end do outerLoop

  end subroutine tem_init_data