tem_polygon_material_movement_single Function

public function tem_polygon_material_movement_single(me, time, nPoint, coord) result(res)

Arguments

Type IntentOptional Attributes Name
type(tem_polygon_material_type), intent(in) :: me
real(kind=rk), intent(in) :: time

velocity value

integer, intent(in) :: nPoint

number of points to get value for

real(kind=rk), intent(in) :: coord(nPoint,3)

points

Return Value real(kind=rk), (nPoint*me%nComponents)

List of values of each point


Calls

proc~~tem_polygon_material_movement_single~~CallsGraph proc~tem_polygon_material_movement_single tem_polygon_material_movement_single proc~tem_abort tem_abort proc~tem_polygon_material_movement_single->proc~tem_abort proc~tem_polygon_material_value tem_polygon_material_value proc~tem_polygon_material_movement_single->proc~tem_polygon_material_value mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~angle_between angle_between proc~tem_polygon_material_value->proc~angle_between

Called by

proc~~tem_polygon_material_movement_single~~CalledByGraph proc~tem_polygon_material_movement_single tem_polygon_material_movement_single proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->proc~tem_polygon_material_movement_single proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord proc~tem_spacetime_for_stcoord->proc~tem_spacetime_for_coord interface~tem_spacetime_for tem_spacetime_for interface~tem_spacetime_for->proc~tem_spacetime_for_coord interface~tem_spacetime_for->proc~tem_spacetime_for_stcoord proc~tem_spacetime_scalar_for_index tem_spacetime_scalar_for_index interface~tem_spacetime_for->proc~tem_spacetime_scalar_for_index proc~tem_spacetime_scalar_for_index->proc~tem_spacetime_for_coord proc~evaluate_add_spacetime_vectorbycoordinate evaluate_add_spacetime_vectorByCoordinate proc~evaluate_add_spacetime_vectorbycoordinate->interface~tem_spacetime_for proc~evaluate_first_spacetime_scalarbytreeid evaluate_first_spacetime_scalarByTreeID proc~evaluate_first_spacetime_scalarbytreeid->interface~tem_spacetime_for proc~get_valofindex_foag_scalar_spacetime get_valOfIndex_FOAG_scalar_spacetime proc~get_valofindex_foag_scalar_spacetime->interface~tem_spacetime_for proc~evaluate_add_spacetime_vectorbytreeid evaluate_add_spacetime_vectorByTreeID proc~evaluate_add_spacetime_vectorbytreeid->interface~tem_spacetime_for proc~get_valofindex_first_vector_spacetime get_valOfIndex_first_vector_spacetime proc~get_valofindex_first_vector_spacetime->interface~tem_spacetime_for proc~tem_update_surfpos tem_update_surfPos proc~tem_update_surfpos->interface~tem_spacetime_for proc~evaluate_foag_spacetime_scalarbycoordinate evaluate_FOAG_spacetime_scalarByCoordinate proc~evaluate_foag_spacetime_scalarbycoordinate->interface~tem_spacetime_for proc~evaluate_foag_spacetime_vectorbycoordinate evaluate_FOAG_spacetime_vectorByCoordinate proc~evaluate_foag_spacetime_vectorbycoordinate->interface~tem_spacetime_for proc~evaluate_first_spacetime_vectorbycoordinate evaluate_first_spacetime_vectorByCoordinate proc~evaluate_first_spacetime_vectorbycoordinate->interface~tem_spacetime_for proc~evaluate_first_spacetime_scalarbycoordinate evaluate_first_spacetime_scalarByCoordinate proc~evaluate_first_spacetime_scalarbycoordinate->interface~tem_spacetime_for proc~evaluate_foag_spacetime_scalarbytreeid evaluate_FOAG_spacetime_scalarByTreeID proc~evaluate_foag_spacetime_scalarbytreeid->interface~tem_spacetime_for proc~get_valofindex_add_vector_spacetime get_valOfIndex_add_vector_spacetime proc~get_valofindex_add_vector_spacetime->interface~tem_spacetime_for proc~get_valofindex_add_scalar_spacetime get_valOfIndex_add_scalar_spacetime proc~get_valofindex_add_scalar_spacetime->interface~tem_spacetime_for proc~evaluate_add_spacetime_scalarbycoordinate evaluate_add_spacetime_scalarByCoordinate proc~evaluate_add_spacetime_scalarbycoordinate->interface~tem_spacetime_for proc~evaluate_first_spacetime_vectorbytreeid evaluate_first_spacetime_vectorByTreeID proc~evaluate_first_spacetime_vectorbytreeid->interface~tem_spacetime_for proc~get_valofindex_foag_vector_spacetime get_valOfIndex_FOAG_vector_spacetime proc~get_valofindex_foag_vector_spacetime->interface~tem_spacetime_for proc~evaluate_add_spacetime_scalarbytreeid evaluate_add_spacetime_scalarByTreeID proc~evaluate_add_spacetime_scalarbytreeid->interface~tem_spacetime_for proc~evaluate_foag_spacetime_vectorbytreeid evaluate_FOAG_spacetime_vectorByTreeID proc~evaluate_foag_spacetime_vectorbytreeid->interface~tem_spacetime_for proc~get_valofindex_first_scalar_spacetime get_valOfIndex_first_scalar_spacetime proc~get_valofindex_first_scalar_spacetime->interface~tem_spacetime_for

Contents


Source Code

  function tem_polygon_material_movement_single(me, time, nPoint, coord) &
    & result(res)
    ! ----------------------------------------------------------------------
    type(tem_polygon_material_type), intent(in) :: me
    !>velocity value
    real(kind=rk), intent(in) :: time
    !> number of points to get value for
    integer, intent(in) :: nPoint
    !> points
    real(kind=rk), intent(in) :: coord(nPoint,3)
    !> List of values of each point
    real(kind=rk) :: res(nPoint*me%nComponents)
    ! ----------------------------------------------------------------------
    real(kind=rk) :: alpha
    integer :: iPoint
    type(tem_polygon_material_type) :: loc_polygon
    ! ----------------------------------------------------------------------
    loc_polygon = me
    select case(me%moving%movement_kind)
    case ('lin_movement_2d','lin_movement_3d')
      loc_polygon%poly_list(1)%vertex(:,1) = me%poly_list(1)%vertex(:,1) &
        & + me%moving%lin_parameter(1) * time
      loc_polygon%poly_list(1)%vertex(:,2) = me%poly_list(1)%vertex(:,2) &
        & + me%moving%lin_parameter(2) * time

    case('sin_movement_2d','sin_movement_3d')
      loc_polygon%poly_list(1)%vertex(:,1) = me%poly_list(1)%vertex(:,1) &
        & + me%moving%sin_parameter(1)                                   &
        & *sin(2*PI*me%moving%sin_parameter(2)*time)
      loc_polygon%poly_list(1)%vertex(:,2) = me%poly_list(1)%vertex(:,2) &
        & + me%moving%sin_parameter(3)                                   &
        & *sin(2*PI*me%moving%sin_parameter(4)*time)

    case('angleofAttack_2d','angleofAttack_3d' )
     ! rotation around y-axis
      alpha = me%moving%angle_parameter(1) + me%moving%angle_parameter(2) &
        & * sin( me%moving%angle_parameter(3) * time)

      loc_polygon%poly_list(1)%vertex(:,1) = me%poly_list(1)%vertex(:,1)  &
        & * cos(alpha) + me%poly_list(1)%vertex(:,2) * sin(alpha)
      loc_polygon%poly_list(1)%vertex(:,2) = me%poly_list(1)%vertex(:,2)  &
        & * cos(alpha) - me%poly_list(1)%vertex(:,1) * sin(alpha)

    case('rot_movement_2d','rot_movement_3d')
      loc_polygon%poly_list(1)%vertex(:,1) =                                  &
        & cos(me%moving%rot_parameter(3)*time)*(me%poly_list(1)%vertex(:,1)   &
        & - me%moving%rot_parameter(1))                                       &
        & - sin(me%moving%rot_parameter(3)*time)*(me%poly_list(1)%vertex(:,2) &
        & - me%moving%rot_parameter(2)) + me%moving%rot_parameter(1)

      loc_polygon%poly_list(1)%vertex(:,2) =                                  &
        & sin(me%moving%rot_parameter(3)*time)*(me%poly_list(1)%vertex(:,1)   &
        & - me%moving%rot_parameter(1))                                       &
        & + cos(me%moving%rot_parameter(3)*time)*(me%poly_list(1)%vertex(:,2) &
        & - me%moving%rot_parameter(2)) + me%moving%rot_parameter(2)
    case default
      call tem_abort( 'ERROR in tem_polygon_material_module: UNKNOWN movement' &
        & // ' for the polygon in 2D' )
    end select

    select case(me%moving%movement_kind)
    case('lin_movement_2d', 'sin_movement_2d', 'rot_movement_2d', &
        & 'angleofAttack_2d'                                      )
      do iPoint=1, nPoint
        res((iPoint-1)*me%nComponents+1:iPoint*me%nComponents) &
          & = tem_polygon_material_value(                      &
          &   me          = loc_polygon%poly_list(1),          &
          &   nComponents = loc_polygon%nComponents,           &
          &   inVal       = loc_polygon%inVal,                 &
          &   outVal      = loc_polygon%outVal,                &
          &   point       = coord(iPoint,:2)                   )
      end do
    case('lin_movement_3d', 'sin_movement_3d', 'rot_movement_3d', &
        & 'angleofAttack_3d'                                      )

      do iPoint=1, nPoint
        if (coord(iPoint,3) >= me%zmin .and. coord(iPoint,3) <= me%zmax ) then
          res((iPoint-1)*me%nComponents+1:iPoint*me%nComponents) &
            & = tem_polygon_material_value(                      &
            &   me          = loc_polygon%poly_list(1),          &
            &   nComponents = loc_polygon%nComponents,           &
            &   inVal       = loc_polygon%inVal,                 &
            &   outVal      = loc_polygon%outVal,                &
            &   point       = coord(iPoint,:2)                   )
        else
          res((iPoint-1)*me%nComponents+1:iPoint*me%nComponents) = me%outval
        end if
      end do
    case default
      call tem_abort( 'ERROR in tem_polygon_material_module: UNKNOWN movement' &
        & // 'for the polygon in 3D' )
    end select
  end function tem_polygon_material_movement_single