tem_spacetime_for_stcoord Function

private function tem_spacetime_for_stcoord(me, stCoord, n) result(res)

This function computes the space time function for given list of space-time coordinates.

Todo

JZ: i added the subroutine for the space-time formulation. Below you see, that we create a tem_time_type variable in each loop. The code can be faster if we implement this routine in a nicer way.

Arguments

Type IntentOptional Attributes Name
type(tem_spacetime_fun_type) :: me

Spacetime function to evaluate

real(kind=rk), intent(in) :: stCoord(n,4)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z,t coordinates

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_stcoord( me, stCoord, n  ) result(res)
    ! -------------------------------------------------------------------- !
    !> Spacetime function to evaluate
    type(tem_spacetime_fun_type) :: me
    !> Number of values to return
    integer, intent(in) :: n
    !> barycentric Ids of an elements.
    !! 1st index goes over number of elements and
    !! 2nd index goes over x,y,z,t coordinates
    real(kind=rk), intent(in) :: stCoord(n,4)
    !> return value of the function
    real(kind=rk) :: res(n)
    ! -------------------------------------------------------------------- !
    real(kind=rk) :: spaceCoord(1,3)
    integer :: iPoint
    type(tem_time_type) :: time
    ! -------------------------------------------------------------------- !

    !> @todo JZ: i added the subroutine for the space-time formulation.
    !! Below you see, that we create a tem_time_type variable in each loop.
    !! The code can be faster if we implement this routine in a nicer way.


    do iPoint = 1, n
      time%sim = stcoord(iPoint, 4)
      spaceCoord(1,1:3) = stcoord(iPoint, 1:3)
      res(iPoint:iPoint)                                                       &
        & = tem_spacetime_for_coord( me    = me,         &
        &                            coord = spaceCoord, &
        &                            time  = time,       &
        &                            n     = 1           )
    end do

  end function tem_spacetime_for_stcoord