load_spatial_predefined Subroutine

private subroutine load_spatial_predefined(me, conf, thandle, nComp)

Load predefined spatial function

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(inout) :: me

spatial fun information

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

spatial function handle

integer, intent(in) :: nComp

Number of components


Calls

proc~~load_spatial_predefined~~CallsGraph proc~load_spatial_predefined load_spatial_predefined proc~upper_to_lower upper_to_lower proc~load_spatial_predefined->proc~upper_to_lower interface~tem_load_miescatter_magneticfieldy tem_load_miescatter_magneticfieldy proc~load_spatial_predefined->interface~tem_load_miescatter_magneticfieldy proc~tem_load_cylindricalwave tem_load_cylindricalWave proc~load_spatial_predefined->proc~tem_load_cylindricalwave proc~load_ic_2dcrvp load_ic_2dcrvp proc~load_spatial_predefined->proc~load_ic_2dcrvp proc~load_spatial_random load_spatial_random proc~load_spatial_predefined->proc~load_spatial_random proc~tem_load_heaviside_gibbs tem_load_heaviside_gibbs proc~load_spatial_predefined->proc~tem_load_heaviside_gibbs proc~tem_load_spongelayer_box tem_load_spongeLayer_box proc~load_spatial_predefined->proc~tem_load_spongelayer_box interface~tem_load_miescatter_magneticfieldx tem_load_miescatter_magneticfieldx proc~load_spatial_predefined->interface~tem_load_miescatter_magneticfieldx proc~aot_get_val~2 aot_get_val proc~load_spatial_predefined->proc~aot_get_val~2 proc~tem_abort tem_abort proc~load_spatial_predefined->proc~tem_abort proc~load_spatial_parabol load_spatial_parabol proc~load_spatial_predefined->proc~load_spatial_parabol interface~tem_tostr tem_toStr proc~load_spatial_predefined->interface~tem_tostr proc~load_ic_tgv load_ic_tgv proc~load_spatial_predefined->proc~load_ic_tgv interface~tem_load_miescatter_displacementfieldz tem_load_miescatter_displacementfieldz proc~load_spatial_predefined->interface~tem_load_miescatter_displacementfieldz proc~tem_load_spongelayer_radial tem_load_spongeLayer_radial proc~load_spatial_predefined->proc~tem_load_spongelayer_radial proc~tem_load_pmllayer tem_load_pmlLayer proc~load_spatial_predefined->proc~tem_load_pmllayer proc~load_ic_gausspulse load_ic_gausspulse proc~load_spatial_predefined->proc~load_ic_gausspulse proc~tem_load_spongelayer_plane tem_load_spongeLayer_plane proc~load_spatial_predefined->proc~tem_load_spongelayer_plane proc~tem_polygon_material_load tem_polygon_material_load proc~load_spatial_predefined->proc~tem_polygon_material_load

Called by

proc~~load_spatial_predefined~~CalledByGraph proc~load_spatial_predefined load_spatial_predefined proc~tem_load_spatial tem_load_spatial proc~tem_load_spatial->proc~load_spatial_predefined proc~load_spacetime_predefined load_spacetime_predefined proc~load_spacetime_predefined->proc~tem_load_spatial proc~tem_load_ic tem_load_ic proc~tem_load_ic->proc~tem_load_spatial proc~tem_load_spacetime_single tem_load_spacetime_single proc~tem_load_spacetime_single->proc~load_spacetime_predefined proc~tem_load_spacetime_single->proc~tem_load_spacetime_single proc~tem_load_spacetime_table tem_load_spacetime_table proc~tem_load_spacetime_table->proc~tem_load_spacetime_single interface~tem_load_spacetime tem_load_spacetime interface~tem_load_spacetime->proc~tem_load_spacetime_single

Contents


Source Code

  subroutine load_spatial_predefined( me, conf, thandle, nComp )
    ! -------------------------------------------------------------------- !
    !> spatial fun information
    type(tem_spatial_type), intent(inout) :: me
    !> lua state type
    type(flu_State) :: conf
    !> spatial function handle
    integer, intent(in) :: thandle
    !> Number of components
    integer, intent(in) :: nComp
    ! -------------------------------------------------------------------- !
    integer :: nDim, iError
    character(len=labelLen) :: funkind
    ! -------------------------------------------------------------------- !

    write(logUnit(1),*) 'Spatial is defined as predefined:'

    funkind = adjustl(me%kind)
    funkind = upper_to_lower(funkind)

    select case(trim(funkind))
    case('parabol')
      write(logUnit(3),*) '  is a parabolic profile'
      call load_spatial_parabol( me      = me%parabol, &
        &                        conf    = conf,       &
        &                        thandle = thandle,    &
        &                        nComp   = nComp       )
    case('random')
      write(logUnit(3),*) '  is a random distribution'
      call load_spatial_random( me      = me%random, &
        &                       conf    = conf,      &
        &                       thandle = thandle    )
    case('gausspulse')
      write(logUnit(3),*) '  is a gaussian pulse'
      call load_ic_gausspulse( conf    = conf,         &
        &                      thandle = thandle,      &
        &                      me      = me%gausspulse )
    case('tgv_p')
      write(logUnit(5),*) '  is a Taylor-Green vortex pressure'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
    case('tgv_ux')
      write(logUnit(5),*) '  is a Taylor-Green vortex Ux'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
    case('tgv_uy')
      write(logUnit(5),*) '  is a Taylor-Green vortex Uy'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
    case('tgv_sxx')
      write(logUnit(5),*) '  is a Taylor-Green vortex Sxx'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
    case('tgv_syy')
      write(logUnit(5),*) '  is a Taylor-Green vortex Syy'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
    case('tgv_syz')
      write(logUnit(5),*) '  is a Taylor-Green vortex Syz'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
    case('tgv_sxz')
      write(logUnit(5),*) '  is a Taylor-Green vortex Sxz'
      call load_ic_tgv( conf    = conf,         &
        &               thandle = thandle,      &
        &               me      = me%tgv        )
!HK: Not implemented yet.
!HK!        case('hopf')
!HK!          write(logUnit(1),*) '  is a Hopf fibration solution'
!HK!          call load_spatial_hopf( me = me%hopf, conf = conf, &
!HK!            &                     thandle = thandle )
    case('crvpx')
      write(logUnit(3),*) '  is a Spinning vortex pair X component'
      call load_ic_2dcrvp( conf    = conf,    &
        &                  thandle = thandle, &
        &                  me      = me%crvp  )
    case('crvpy')
      write(logUnit(3),*) '  is a Spinning vortex pair Y component'
      call load_ic_2dcrvp( conf    = conf,    &
        &                  thandle = thandle, &
        &                  me      = me%crvp  )
    case('crvppressure')
      write(logUnit(3),*) '  is a Spinning vortex pair density'
      call load_ic_2dcrvp( conf    = conf,    &
        &                  thandle = thandle, &
        &                  me      = me%crvp  )
    case('miescatter_displacementfieldz')
      call tem_load_miescatter_displacementfieldz( conf    = conf,      &
        &                                          thandle = thandle,   &
        &                                          me      = me%mie_fun )
    case('miescatter_magneticfieldx')
      call tem_load_miescatter_magneticfieldx( conf    = conf,      &
        &                                      thandle = thandle,   &
        &                                      me      = me%mie_fun )
    case('miescatter_magneticfieldy')
      call tem_load_miescatter_magneticfieldy( conf    = conf,      &
        &                                      thandle = thandle,   &
        &                                      me      = me%mie_fun )
    case('heaviside_gibbs')
      call tem_load_heaviside_gibbs( conf    = conf,                  &
        &                            thandle = thandle,               &
        &                            me      = me%heaviside_gibbs_fun )
    case('spongelayer_plane')
      ndim = 3
      call tem_load_spongeLayer_plane( conf    = conf,           &
        &                              thandle = thandle,        &
        &                              me      = me%spongePlane, &
        &                              ndim    = ndim,           &
        &                              nComp   = nComp           )
    case('spongelayer_plane_2d')
      ndim = 2
      call tem_load_spongeLayer_plane( conf    = conf,           &
        &                              thandle = thandle,        &
        &                              me      = me%spongePlane, &
        &                              ndim    = ndim,           &
        &                              nComp   = nComp           )
    case('spongelayer_plane_1d')
      ndim = 1
      call tem_load_spongeLayer_plane( conf    = conf,           &
        &                              thandle = thandle,        &
        &                              me      = me%spongePlane, &
        &                              ndim    = ndim,           &
        &                              nComp   = nComp           )
    case('spongelayer_radial')
      write(logUnit(3),*) '  is a radial sponge layer'
      ndim = 3
      call tem_load_spongelayer_radial( me       = me%spongeRadial, &
        &                               conf     = conf,            &
        &                               thandle  = thandle,         &
        &                               nDim     = nDim,            &
        &                               nComp    = nComp            )
    case('spongelayer_radial_2d')
      write(logUnit(3),*) '  is a 2d radial sponge layer'
      ndim = 2
      call tem_load_spongelayer_radial( me       = me%spongeRadial, &
        &                               conf     = conf,            &
        &                               thandle  = thandle,         &
        &                               nDim     = nDim,            &
        &                               nComp    = nComp            )
    case('spongelayer_box')
      call tem_load_spongeLayer_box( conf    = conf,         &
        &                            thandle = thandle,      &
        &                            me      = me%spongeBox, &
        &                            ndim    = 3,            &
        &                            nComp   = nComp         )
    case('spongelayer_box_2d')
      call tem_load_spongeLayer_box( conf    = conf,         &
        &                            thandle = thandle,      &
        &                            me      = me%spongeBox, &
        &                            ndim    = 2,            &
        &                            nComp   = nComp         )
    case('viscous_spongelayer_plane')
      ndim = 3
      call tem_load_spongeLayer_plane( conf      = conf,           &
        &                              thandle   = thandle,        &
        &                              me        = me%spongePlane, &
        &                              ndim      = nDim,           &
        &                              nComp     = nComp,          &
        &                              stateName = 'viscosity'     )
    case('viscous_spongelayer_box')
      ndim = 3
      call tem_load_spongeLayer_box( conf      = conf,         &
        &                            thandle   = thandle,      &
        &                            me        = me%spongeBox, &
        &                            ndim      = nDim,         &
        &                            nComp     = nComp,        &
        &                            stateName = 'viscosity'   )
    case('viscous_spongelayer_box_2d')
      ndim = 2
      call tem_load_spongeLayer_box( conf      = conf,         &
        &                            thandle   = thandle,      &
        &                            me        = me%spongeBox, &
        &                            ndim      = nDim,         &
        &                            nComp     = nComp,        &
        &                            stateName = 'viscosity'   )
    case('viscous_spongelayer_radial')
      write(logUnit(3),*) '  is a radial viscous sponge layer'
      nDim = 3
      call tem_load_spongelayer_radial( me        = me%spongeRadial, &
        &                               conf      = conf,            &
        &                               thandle   = thandle,         &
        &                               nDim      = nDim,            &
        &                               nComp     = nComp,           &
        &                               stateName = 'viscosity'      )
    case('viscous_spongelayer_radial_2d')
      write(logUnit(3),*) '  is a 2d radial viscous sponge layer'
      nDim = 2
      call tem_load_spongelayer_radial( me        = me%spongeRadial, &
        &                               conf      = conf,            &
        &                               thandle   = thandle,         &
        &                               nDim      = nDim,            &
        &                               nComp     = nComp,           &
        &                               stateName = 'viscosity'      )
    case('pml')
      call tem_load_pmlLayer( conf    = conf,    &
        &                     thandle = thandle, &
        &                     me      = me%pml   )
    case('cylindricalwave')
      call tem_load_cylindricalWave( conf    = conf,              &
        &                            thandle = thandle,           &
        &                            me      = me%cylindricalWave )
    case('polygon_material','polygon_material_3d')
      call tem_polygon_material_load( conf    = conf,               &
        &                             thandle = thandle,            &
        &                             me      = me%polygon_material )
    case('rectangular', 'gate')
      call aot_get_val( L       = conf,       &
        &               thandle = thandle,    &
        &               key     = 'ly',       &
        &               val     = me%rect_ly, &
        &               ErrCode = iError,     &
        &               default = 0.5_rk      )
      call aot_get_val( L       = conf,       &
        &               thandle = thandle,    &
        &               key     = 'lz',       &
        &               val     = me%rect_lz, &
        &               ErrCode = iError,     &
        &               default = 0.5_rk      )
      write(logUnit(3),"(A)") '   this is a predefined rectangular shape'
      write(logUnit(3),"(A)") '     ly: '//trim(tem_toStr(me%rect_ly))
      write(logUnit(3),"(A)") '     lz: '//trim(tem_toStr(me%rect_lz))
    case default
      write(logUnit(1),*)'ERROR in definition of the spatial'//&
        &            ' boundary Conditions:'
      write(logUnit(1),*)'Selected an unknown spatial function: '//&
        &            trim(me%kind)
      call tem_abort()
    end select

  end subroutine load_spatial_predefined