tem_spatial_vector_for_treeIDs Function

private function tem_spatial_vector_for_treeIDs(me, treeIds, tree, n, ncomp) result(res)

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type) :: me

spatial type for given boundary state

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

type(treelmesh_type), intent(in) :: tree

global treelm mesh

integer, intent(in) :: n

number of return values

integer, intent(in) :: ncomp

number of components in the resulting vector

Return Value real(kind=rk), (n,ncomp)

return value of a function


Calls

proc~~tem_spatial_vector_for_treeids~~CallsGraph proc~tem_spatial_vector_for_treeids tem_spatial_vector_for_treeIDs interface~tem_spatial_lua_for tem_spatial_lua_for proc~tem_spatial_vector_for_treeids->interface~tem_spatial_lua_for interface~tem_spatial_parabol2d_for tem_spatial_parabol2d_for proc~tem_spatial_vector_for_treeids->interface~tem_spatial_parabol2d_for interface~tem_spatial_parabol3d_for tem_spatial_parabol3d_for proc~tem_spatial_vector_for_treeids->interface~tem_spatial_parabol3d_for interface~tem_spongelayer_box2d_for tem_spongeLayer_box2d_for proc~tem_spatial_vector_for_treeids->interface~tem_spongelayer_box2d_for interface~tem_spongelayer_box_for tem_spongeLayer_box_for proc~tem_spatial_vector_for_treeids->interface~tem_spongelayer_box_for interface~tem_spongelayer_plane_for tem_spongeLayer_plane_for proc~tem_spatial_vector_for_treeids->interface~tem_spongelayer_plane_for interface~tem_spongelayer_radial_for tem_spongeLayer_radial_for proc~tem_spatial_vector_for_treeids->interface~tem_spongelayer_radial_for proc~tem_abort tem_abort proc~tem_spatial_vector_for_treeids->proc~tem_abort

Called by

proc~~tem_spatial_vector_for_treeids~~CalledByGraph proc~tem_spatial_vector_for_treeids tem_spatial_vector_for_treeIDs interface~tem_spatial_for tem_spatial_for interface~tem_spatial_for->proc~tem_spatial_vector_for_treeids proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->interface~tem_spatial_for proc~tem_spacetime_for_treeids tem_spacetime_for_treeIDs proc~tem_spacetime_for_treeids->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_coord tem_spacetime_vector_for_coord proc~tem_spacetime_vector_for_coord->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_index->proc~tem_spacetime_vector_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_spatial_scalar_storeval tem_spatial_scalar_storeVal proc~tem_spatial_scalar_storeval->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_coord interface~tem_spacetime_for->proc~tem_spacetime_for_treeids interface~tem_spacetime_for->proc~tem_spacetime_scalar_for_index interface~tem_spacetime_for->proc~tem_spacetime_vector_for_coord interface~tem_spacetime_for->proc~tem_spacetime_vector_for_index interface~tem_spacetime_for->proc~tem_spacetime_vector_for_treeids 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 proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord proc~tem_spacetime_for_stcoord->proc~tem_spacetime_for_coord

Source Code

  function tem_spatial_vector_for_treeIDs( me, treeIds, tree, n, ncomp) &
    &      result(res)
    ! -------------------------------------------------------------------- !
    !> spatial type for given boundary state
    type(tem_spatial_type) :: me
    !> global treelm mesh
    type(treelmesh_type), intent(in) ::tree
    !> number of return values
    integer, intent(in) :: n
    !> number of components in the resulting vector
    integer, intent(in) :: ncomp
    !> treeIds of elements in given level
    integer(kind=long_k), intent(in) :: treeIds(n)
    !> return value of a function
    real(kind=rk) :: res(n,ncomp)
    ! -------------------------------------------------------------------- !
    integer :: i
    ! -------------------------------------------------------------------- !

    select case( trim(adjustl(me%kind)) )
    case( 'none', 'const' )
      do i = 1, nComp
        res(:,i) = me%const(i)
      end do

    case( 'lua_fun' )
      res = tem_spatial_lua_for( fun_ref = me%lua_fun_ref, &
        &                        conf    = me%conf,        &
        &                        treeIds = treeIds,        &
        &                        tree    = tree,           &
        &                        n       = n,              &
        &                        ncomp   = ncomp           )

    case( 'spongelayer_plane', 'spongelayer_plane_2d', 'spongelayer_plane_1d' )
      res = tem_spongeLayer_plane_for(me%spongePlane, nComp, treeids, tree, n)

    case( 'spongelayer_box' )
      res = tem_spongeLayer_box_for(me%spongeBox, nComp, treeids, tree, n)

    case( 'spongelayer_box_2d' )
      res = tem_spongeLayer_box2d_for(me%spongeBox, nComp, treeids, tree, n)

    case( 'spongelayer_radial_2d')
      res = tem_spongeLayer_radial_for( &
        & me      = me%spongeRadial,    &
        & nComp   = nComp,              &
        & treeids = treeids,            &
        & tree    = tree,               &
        & n       = n,                  &
        & nDim    = 2                   )

    case( 'spongelayer_radial')
      res = tem_spongeLayer_radial_for( &
        & me      = me%spongeRadial,    &
        & nComp   = nComp,              &
        & treeids = treeids,            &
        & tree    = tree,               &
        & n       = n,                  &
        & nDim    = 3                   )

    case( 'parabol' )
      select case( trim(adjustl(me%parabol%geometry%canoND(1)%kind)) )
      case('line')
        res(:,1) = tem_spatial_parabol2d_for(        &
          & me      = me%parabol%geometry%canoND(1), &
          & treeIds = treeIds,                       &
          & tree    = tree,                          &
          & n       = n                              )

      case('plane')
        res(:,1) = tem_spatial_parabol3d_for(        &
          & me      = me%parabol%geometry%canoND(1), &
          & treeIds = treeIds,                       &
          & tree    = tree,                          &
          & n       = n                              )
      end select

      do i = 2, nComp
        res(:,i) = res(:,1)*me%parabol%amplitude(i)
      end do

      res(:,1) = res(:,1)*me%parabol%amplitude(1)

    case default
      write(logUnit(1),*)'ERROR: No vectorial routine for spatial functions of'
      write(logUnit(1),*)'       kind "' // trim(adjustl(me%kind)) // '"'
      write(logUnit(1),*)'       available! Have a look in the ' &
        & // 'tem_spatial_module'
      write(logUnit(1),*)'       for implemented vectorial functions.'
      call tem_abort()
    end select

   end function tem_spatial_vector_for_treeIDs