tem_spacetime_for_treeIDs Function

private function tem_spacetime_for_treeIDs(me, treeIDs, time, tree, n) result(res)

This function compute space time function for given list of treeIDs

Todo

pass subtree with treeIDs lists instead of treeIds and tree

Arguments

Type IntentOptional Attributes Name
type(tem_spacetime_fun_type) :: me

Spacetime function to evaluate

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

TreeIDs where to evaluate the function

type(tem_time_type), intent(in) :: time

timer object incl. the current time information

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

Global treelmesh to look for positions in

integer, intent(in) :: n

Number of values to return

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

return value of the function


Source Code

  function tem_spacetime_for_treeIDs( me, treeIDs, time, tree, n ) result(res)
    ! -------------------------------------------------------------------- !
    !> Spacetime function to evaluate
    type(tem_spacetime_fun_type) :: me
    !> Global treelmesh to look for positions in
    type(treelmesh_type), intent(in) ::tree
    !> Number of values to return
    integer, intent(in) :: n
    !> TreeIDs where to evaluate the function
    integer(kind=long_k), intent( in ) :: treeIDs(n)
    !> timer object incl. the current time information
    type(tem_time_type), intent( in )  :: time
    !> return value of the function
    real(kind=rk) :: res(n)
    ! -------------------------------------------------------------------- !

    select case(trim(adjustl(me%fun_kind)))
    case('none')
      res = 0.0_rk
    case('const')
      res = me%const(1)
    case('lua_fun')
      res = tem_spacetime_lua_for( me%lua_fun_ref, treeIDs, time, tree, n, &
        &                          me%conf)
    case('combined')
      res = tem_spatial_for( me      = me%spatial,    &
        &                    treeIDs = treeIDs,       &
        &                    tree    = tree,          &
        &                    n       = n           )  &
        & * tem_temporal_for( temporal = me%temporal, &
        &                     time     = time         )
    case default
      write(logUnit(1),*)'ERROR: Unknown spatial function in '//               &
        &                'tem_spacetime_for_treeIDs.'
      write(logUnit(1),*) 'tem_spacetime_fun_type%fun_kind = ', &
        &                 trim(me%fun_kind)
      call tem_abort()
    end select
  end function tem_spacetime_for_treeIDs