load_spacetime_predefined Subroutine

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

Load predefined space time function

Todo

Provide an error code to return instead of aborting.

Arguments

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

spacetime fun information

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

spacetime function handle

integer, intent(in), optional :: nComp

number of components of the variable


Calls

proc~~load_spacetime_predefined~~CallsGraph proc~load_spacetime_predefined load_spacetime_predefined interface~tem_load_miescatter_displacementfieldz tem_load_miescatter_displacementfieldz proc~load_spacetime_predefined->interface~tem_load_miescatter_displacementfieldz interface~tem_load_miescatter_magneticfieldx tem_load_miescatter_magneticfieldx proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldx interface~tem_load_miescatter_magneticfieldy tem_load_miescatter_magneticfieldy proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldy proc~tem_abort tem_abort proc~load_spacetime_predefined->proc~tem_abort proc~tem_aps_load_coupling tem_aps_load_coupling proc~load_spacetime_predefined->proc~tem_aps_load_coupling proc~tem_load_acoustic_pulse tem_load_acoustic_pulse proc~load_spacetime_predefined->proc~tem_load_acoustic_pulse proc~tem_load_cylindricalwave tem_load_cylindricalWave proc~load_spacetime_predefined->proc~tem_load_cylindricalwave proc~tem_load_spatial tem_load_spatial proc~load_spacetime_predefined->proc~tem_load_spatial proc~tem_load_temporal tem_load_temporal proc~load_spacetime_predefined->proc~tem_load_temporal proc~tem_polygon_material_multi_load tem_polygon_material_multi_load proc~load_spacetime_predefined->proc~tem_polygon_material_multi_load proc~tem_polygon_material_single_load tem_polygon_material_single_load proc~load_spacetime_predefined->proc~tem_polygon_material_single_load proc~upper_to_lower upper_to_lower proc~load_spacetime_predefined->proc~upper_to_lower tem_precice_load_coupling tem_precice_load_coupling proc~load_spacetime_predefined->tem_precice_load_coupling proc~tem_load_miescatter tem_load_miescatter interface~tem_load_miescatter_displacementfieldz->proc~tem_load_miescatter interface~tem_load_miescatter_magneticfieldx->proc~tem_load_miescatter interface~tem_load_miescatter_magneticfieldy->proc~tem_load_miescatter mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_aps_load_coupling->proc~tem_abort aot_get_val aot_get_val proc~tem_aps_load_coupling->aot_get_val proc~tem_load_acoustic_pulse->proc~tem_abort proc~tem_load_acoustic_pulse->aot_get_val proc~tem_load_cylindricalwave->proc~tem_abort proc~tem_load_cylindricalwave->aot_get_val proc~tem_load_spatial->proc~tem_abort aot_fun_close aot_fun_close proc~tem_load_spatial->aot_fun_close aot_fun_open aot_fun_open proc~tem_load_spatial->aot_fun_open proc~tem_load_spatial->aot_get_val aot_reference_for aot_reference_for proc~tem_load_spatial->aot_reference_for aot_table_close aot_table_close proc~tem_load_spatial->aot_table_close aot_table_open aot_table_open proc~tem_load_spatial->aot_table_open interface~tem_tostr tem_toStr proc~tem_load_spatial->interface~tem_tostr proc~load_spatial_asconst load_spatial_asConst proc~tem_load_spatial->proc~load_spatial_asconst proc~load_spatial_predefined load_spatial_predefined proc~tem_load_spatial->proc~load_spatial_predefined proc~tem_load_temporal->proc~tem_abort proc~tem_load_temporal->aot_fun_close proc~tem_load_temporal->aot_fun_open proc~tem_load_temporal->aot_get_val proc~tem_load_temporal->aot_reference_for proc~tem_load_temporal->aot_table_open proc~load_temporal_cos load_temporal_cos proc~tem_load_temporal->proc~load_temporal_cos proc~load_temporal_from_file load_temporal_from_file proc~tem_load_temporal->proc~load_temporal_from_file proc~load_temporal_linear load_temporal_linear proc~tem_load_temporal->proc~load_temporal_linear proc~tem_polygon_material_multi_load->proc~tem_abort proc~tem_polygon_material_multi_load->aot_get_val proc~tem_polygon_material_multi_load->aot_table_close aot_table_length aot_table_length proc~tem_polygon_material_multi_load->aot_table_length proc~tem_polygon_material_multi_load->aot_table_open proc~tem_polygon_material_single_load->proc~tem_abort proc~tem_polygon_material_single_load->aot_get_val proc~tem_polygon_material_single_load->aot_table_close proc~tem_polygon_material_single_load->aot_table_length proc~tem_polygon_material_single_load->aot_table_open

Called by

proc~~load_spacetime_predefined~~CalledByGraph proc~load_spacetime_predefined load_spacetime_predefined 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 interface~tem_load_spacetime tem_load_spacetime interface~tem_load_spacetime->proc~tem_load_spacetime_single proc~tem_load_spacetime_table tem_load_spacetime_table interface~tem_load_spacetime->proc~tem_load_spacetime_table proc~tem_load_spacetime_table->proc~tem_load_spacetime_single proc~tem_variable_load_single tem_variable_load_single proc~tem_variable_load_single->interface~tem_load_spacetime proc~tem_variable_loadmapping_single tem_variable_loadMapping_single proc~tem_variable_loadmapping_single->interface~tem_load_spacetime interface~tem_variable_load tem_variable_load interface~tem_variable_load->proc~tem_variable_load_single interface~tem_variable_loadmapping tem_variable_loadMapping interface~tem_variable_loadmapping->proc~tem_variable_loadmapping_single proc~tem_variable_load_vector tem_variable_load_vector proc~tem_variable_load_vector->proc~tem_variable_load_single proc~tem_variable_loadmapping_vector tem_variable_loadMapping_vector proc~tem_variable_loadmapping_vector->proc~tem_variable_loadmapping_single

Source Code

  subroutine load_spacetime_predefined( me, conf, thandle, nComp )
    ! --------------------------------------------------------------------------
    !> spacetime fun information
    type(tem_spacetime_fun_type), intent(inout) :: me
    !> lua state type
    type(flu_State) :: conf
    !> spacetime function handle
    integer, intent(in) :: thandle
    !> number of components of the variable
    integer, optional, intent(in) :: nComp
    ! --------------------------------------------------------------------------
    character(len=labelLen) :: funkind
    integer :: iError
    ! --------------------------------------------------------------------------

    funkind = adjustl(me%fun_kind)
    funkind = upper_to_lower(funkind)
    select case(trim(funkind))
    case('combined')
      ! A typical case of a space-time function that can be represented
      ! a multiplicative combination of a temporal and a spatial part.
      call tem_load_spatial( me     = me%spatial, &
        &                    conf   = conf,       &
        &                    parent = thandle,    &
        &                    errCode= iError,     &
        &                    nComp  = nComp       )
      if (me%spatial%kind == 'none') then
        call tem_abort('Error in loading combined space-time function:' &
          &            //' no spatial function defined!'                )
      end if
      call tem_load_temporal( me     = me%temporal, &
        &                     conf   = conf,        &
        &                     parent = thandle      )
      if (me%temporal%kind == 'none') then
        call tem_abort('Error in loading combined space-time function:' &
          &            //' no temporal function defined!'               )
      end if

    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('cylindricalwave')
      call tem_load_cylindricalWave( conf    = conf,              &
        &                            thandle = thandle,           &
        &                            me      = me%cylindricalWave )

    case('acoustic_pulse')
      call tem_load_acoustic_pulse( conf    = conf,             &
        &                           thandle = thandle,          &
        &                           me      = me%acoustic_pulse )

    case('polygon_body_2d','polygon_body_3d')
      call tem_polygon_material_single_load( &
        & conf    = conf,                    &
        & thandle = thandle,                 &
        & me      = me%polygon_material      )

    case('polygon_multi_body_2d', 'polygon_multi_body_3d')
      call tem_polygon_material_multi_load( &
        & conf    = conf,                   &
        & thandle = thandle,                &
        & me      = me%polygon_material     )
    case('apesmate')
      call tem_aps_load_coupling( me      = me%aps_coupling, &
        &                         thandle = thandle,         &
        &                         conf    = conf             )

    case('precice')
      if (.not. precice_available) then
        call tem_abort(' Error: Spacetime function predefinded = precice not &
          &  available if not compiled with preCICE support, stopping... '  )
      end if
      call tem_precice_load_coupling( me      = me%precice_coupling, &
        &                             conf    = conf,                &
        &                             thandle = thandle              )

    case default
      ! If you introduce new predefined functions, add their loading
      ! routine in a seperate case branch here.
      write(logUnit(1),*) 'ERROR in definition of a space-time function:'
      write(logUnit(1),*) 'Unknown "predefined" space-time function: '// &
        &                 trim( me%fun_kind )
      call tem_abort()
    end select

  end subroutine load_spacetime_predefined