tem_spatial_vector_for_index Function

private function tem_spatial_vector_for_index(me, grwPnt, idx, nVals, iLevel, nComps) result(res)

This function returns pre-stored value at given idx or evaluate a spatial function for a point at given idx. Return value is a vector.

Arguments

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

spatial type

type(tem_grwPoints_type), intent(in) :: grwPnt

growing array of all spatial point of a variable

integer, intent(in) :: idx(nVals)

Index position to return a pre-store value or to compute

integer, intent(in) :: nVals

number of return values

integer, intent(in) :: iLevel

Level to which the evaluated values to be returned

integer, intent(in) :: nComps

number of components per returned value

Return Value real(kind=rk), (nVals,nComps)

return value of a function


Calls

proc~~tem_spatial_vector_for_index~~CallsGraph proc~tem_spatial_vector_for_index tem_spatial_vector_for_index interface~tem_spatial_lua_for tem_spatial_lua_for proc~tem_spatial_vector_for_index->interface~tem_spatial_lua_for proc~tem_spatial_vector_for_coord tem_spatial_vector_for_coord proc~tem_spatial_vector_for_index->proc~tem_spatial_vector_for_coord proc~tem_spatial_lua_for_treeids tem_spatial_lua_for_treeIds interface~tem_spatial_lua_for->proc~tem_spatial_lua_for_treeids proc~tem_spatial_lua_for_coord tem_spatial_lua_for_coord interface~tem_spatial_lua_for->proc~tem_spatial_lua_for_coord proc~tem_spatial_lua_for_index tem_spatial_lua_for_index interface~tem_spatial_lua_for->proc~tem_spatial_lua_for_index proc~tem_spatial_lua_vector_for_treeids tem_spatial_lua_vector_for_treeIds interface~tem_spatial_lua_for->proc~tem_spatial_lua_vector_for_treeids proc~tem_spatial_lua_vector_for_coord tem_spatial_lua_vector_for_coord interface~tem_spatial_lua_for->proc~tem_spatial_lua_vector_for_coord proc~tem_spatial_lua_vector_for_index tem_spatial_lua_vector_for_index interface~tem_spatial_lua_for->proc~tem_spatial_lua_vector_for_index proc~tem_spatial_vector_for_coord->interface~tem_spatial_lua_for interface~tem_spongelayer_radial_for tem_spongeLayer_radial_for proc~tem_spatial_vector_for_coord->interface~tem_spongelayer_radial_for interface~tem_spongelayer_box2d_for tem_spongeLayer_box2d_for proc~tem_spatial_vector_for_coord->interface~tem_spongelayer_box2d_for interface~tem_spatial_parabol2d_for tem_spatial_parabol2d_for proc~tem_spatial_vector_for_coord->interface~tem_spatial_parabol2d_for interface~tem_spatial_parabol3d_for tem_spatial_parabol3d_for proc~tem_spatial_vector_for_coord->interface~tem_spatial_parabol3d_for interface~tem_spongelayer_box_for tem_spongeLayer_box_for proc~tem_spatial_vector_for_coord->interface~tem_spongelayer_box_for interface~tem_spongelayer_plane_for tem_spongeLayer_plane_for proc~tem_spatial_vector_for_coord->interface~tem_spongelayer_plane_for proc~tem_evaluate_pml tem_evaluate_pml proc~tem_spatial_vector_for_coord->proc~tem_evaluate_pml proc~tem_eval_polygon_material tem_eval_polygon_material proc~tem_spatial_vector_for_coord->proc~tem_eval_polygon_material proc~tem_eval_polygon_material_3d tem_eval_polygon_material_3d proc~tem_spatial_vector_for_coord->proc~tem_eval_polygon_material_3d proc~tem_abort tem_abort proc~tem_spatial_vector_for_coord->proc~tem_abort

Called by

proc~~tem_spatial_vector_for_index~~CalledByGraph proc~tem_spatial_vector_for_index tem_spatial_vector_for_index interface~tem_spatial_for tem_spatial_for interface~tem_spatial_for->proc~tem_spatial_vector_for_index proc~tem_spacetime_for_treeids tem_spacetime_for_treeIDs proc~tem_spacetime_for_treeids->interface~tem_spatial_for proc~tem_spacetime_vector_for_index tem_spacetime_vector_for_index proc~tem_spacetime_vector_for_index->interface~tem_spatial_for proc~tem_spacetime_vector_for_coord tem_spacetime_vector_for_coord proc~tem_spacetime_vector_for_index->proc~tem_spacetime_vector_for_coord proc~tem_spatial_scalar_storeval tem_spatial_scalar_storeVal proc~tem_spatial_scalar_storeval->interface~tem_spatial_for proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->interface~tem_spatial_for proc~tem_spacetime_scalar_for_index tem_spacetime_scalar_for_index proc~tem_spacetime_scalar_for_index->interface~tem_spatial_for proc~tem_spacetime_scalar_for_index->proc~tem_spacetime_for_coord proc~tem_spacetime_vector_for_treeids tem_spacetime_vector_for_treeIDs proc~tem_spacetime_vector_for_treeids->interface~tem_spatial_for proc~tem_spacetime_vector_for_coord->interface~tem_spatial_for proc~tem_spatial_vector_storeval tem_spatial_vector_storeVal proc~tem_spatial_vector_storeval->interface~tem_spatial_for interface~tem_spacetime_for tem_spacetime_for interface~tem_spacetime_for->proc~tem_spacetime_for_treeids interface~tem_spacetime_for->proc~tem_spacetime_vector_for_index interface~tem_spacetime_for->proc~tem_spacetime_for_coord interface~tem_spacetime_for->proc~tem_spacetime_scalar_for_index interface~tem_spacetime_for->proc~tem_spacetime_vector_for_treeids interface~tem_spacetime_for->proc~tem_spacetime_vector_for_coord proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord proc~tem_spacetime_for_stcoord->proc~tem_spacetime_for_coord interface~tem_spatial_storeval tem_spatial_storeVal interface~tem_spatial_storeval->proc~tem_spatial_scalar_storeval interface~tem_spatial_storeval->proc~tem_spatial_vector_storeval

Contents


Source Code

  function tem_spatial_vector_for_index( me, grwPnt, idx, nVals, iLevel, &
    &                                    nComps ) result (res)
    ! -------------------------------------------------------------------- !
    !> spatial type
    type(tem_spatial_type), intent(in) :: me
    !> number of return values
    integer, intent(in) :: nVals
    !> number of components per returned value
    integer, intent(in) :: nComps
    !> growing array of all spatial point of a variable
    type(tem_grwPoints_type), intent(in) :: grwPnt
    !> Index position to return a pre-store value or to compute
    integer, intent(in) :: idx(nVals)
    !> return value of a function
    real( kind=rk ) :: res(nVals, nComps)
    !> Level to which the evaluated values to be returned
    integer, intent(in) :: iLevel
    ! -------------------------------------------------------------------- !
    integer :: iVal, iComp, offset
    real(kind=rk) :: coord(1,3), res_tmp(1, nComps)
    ! -------------------------------------------------------------------- !

    if (me%isStored) then

      do iVal = 1, nVals
        offset = (idx(iVal)-1)*nComps
        res(iVal, :) = me%valOnLvl(iLevel)%evalVal%val( offset+1       &
          &                                             :offset+nComps )
      end do

    else

      select case (trim(me%kind))
      case ('none', 'const')
        do iComp = 1, nComps
          res(:, iComp) = me%const(iComp)
        end do

      case ('lua_fun')
        res = tem_spatial_lua_for( fun_ref = me%lua_fun_ref, &
          &                        conf    = me%conf,        &
          &                        grwPnt  = grwPnt,         &
          &                        idx     = idx,            &
          &                        nVals   = nVals,          &
          &                        nComps  = nComps          )

      case default
        do iVal = 1, nVals
          coord(1,:) =  (/ grwPnt%coordX%val( idx(iVal) ), &
            &              grwPnt%coordY%val( idx(iVal) ), &
            &              grwPnt%coordZ%val( idx(iVal) ) /)

          res_tmp = tem_spatial_vector_for_coord( me    = me,    &
            &                                     coord = coord, &
            &                                     n     = 1,     &
            &                                     nComp = nComps )
          res(iVal,:) = res_tmp(1,:)
        end do

      end select

    end if

  end function tem_spatial_vector_for_index