tem_polygon_material_movement_multi Function

public function tem_polygon_material_movement_multi(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_multi~~CallsGraph proc~tem_polygon_material_movement_multi tem_polygon_material_movement_multi proc~tem_abort tem_abort proc~tem_polygon_material_movement_multi->proc~tem_abort proc~tem_polygon_material_value tem_polygon_material_value proc~tem_polygon_material_movement_multi->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_multi~~CalledByGraph proc~tem_polygon_material_movement_multi tem_polygon_material_movement_multi proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->proc~tem_polygon_material_movement_multi interface~tem_spacetime_for tem_spacetime_for interface~tem_spacetime_for->proc~tem_spacetime_for_coord proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord 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_for_stcoord->proc~tem_spacetime_for_coord proc~tem_spacetime_scalar_for_index->proc~tem_spacetime_for_coord proc~evaluate_add_spacetime_scalarbycoordinate evaluate_add_spacetime_scalarByCoordinate proc~evaluate_add_spacetime_scalarbycoordinate->interface~tem_spacetime_for proc~evaluate_add_spacetime_scalarbytreeid evaluate_add_spacetime_scalarByTreeID proc~evaluate_add_spacetime_scalarbytreeid->interface~tem_spacetime_for proc~evaluate_add_spacetime_vectorbycoordinate evaluate_add_spacetime_vectorByCoordinate proc~evaluate_add_spacetime_vectorbycoordinate->interface~tem_spacetime_for proc~evaluate_add_spacetime_vectorbytreeid evaluate_add_spacetime_vectorByTreeID proc~evaluate_add_spacetime_vectorbytreeid->interface~tem_spacetime_for proc~evaluate_first_spacetime_scalarbycoordinate evaluate_first_spacetime_scalarByCoordinate proc~evaluate_first_spacetime_scalarbycoordinate->interface~tem_spacetime_for proc~evaluate_first_spacetime_scalarbytreeid evaluate_first_spacetime_scalarByTreeID proc~evaluate_first_spacetime_scalarbytreeid->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_vectorbytreeid evaluate_first_spacetime_vectorByTreeID proc~evaluate_first_spacetime_vectorbytreeid->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_scalarbytreeid evaluate_FOAG_spacetime_scalarByTreeID proc~evaluate_foag_spacetime_scalarbytreeid->interface~tem_spacetime_for proc~evaluate_foag_spacetime_vectorbycoordinate evaluate_FOAG_spacetime_vectorByCoordinate proc~evaluate_foag_spacetime_vectorbycoordinate->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_add_scalar_spacetime get_valOfIndex_add_scalar_spacetime proc~get_valofindex_add_scalar_spacetime->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_first_scalar_spacetime get_valOfIndex_first_scalar_spacetime proc~get_valofindex_first_scalar_spacetime->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~get_valofindex_foag_scalar_spacetime get_valOfIndex_FOAG_scalar_spacetime proc~get_valofindex_foag_scalar_spacetime->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~tem_update_surfpos tem_update_surfPos proc~tem_update_surfpos->interface~tem_spacetime_for

Source Code

  function tem_polygon_material_movement_multi(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)
    ! ----------------------------------------------------------------------
    integer :: iPoint, iPoly
    integer :: iComp
    type(tem_polygon_material_type) :: loc_polygon
    ! ----------------------------------------------------------------------

    loc_polygon = me
    select case(me%moving%movement_kind)
    case ('lin_multi_body_2d','lin_multi_body_3d')
      do iPoly = 1, me%nPoly
        loc_polygon%poly_list(iPoly)%vertex(:,1) =                            &
          & me%poly_list(iPoly)%vertex(:,1) + me%moving%lin_parameter(1) * time
        loc_polygon%poly_list(iPoly)%vertex(:,2) =                            &
          & me%poly_list(iPoly)%vertex(:,2) + me%moving%lin_parameter(2) * time
      end do
    case('sin_multi_body_2d', 'sin_multi_body_3d')
      do ipoly = 1, me%nPoly
        loc_polygon%poly_list(ipoly)%vertex(:,1) =                       &
          & me%poly_list(ipoly)%vertex(:,1) + me%moving%sin_parameter(1) &
          & *sin(2*PI*me%moving%sin_parameter(2)*time)
        loc_polygon%poly_list(ipoly)%vertex(:,2) =                       &
          & me%poly_list(ipoly)%vertex(:,2) + me%moving%sin_parameter(3) &
          & *sin(2*PI*me%moving%sin_parameter(4)*time)
      end do
    case('rot_multi_body_2d', 'rot_multi_body_3d')
      do ipoly = 1, me%nPoly
        loc_polygon%poly_list(ipoly)%vertex(:,1) =                   &
          & cos(me%moving%rot_parameter(3)*time)                     &
          & *(me%poly_list(ipoly)%vertex(:,1)                        &
          & - me%moving%rot_parameter(1))                            &
          & - sin(me%moving%rot_parameter(3)*time)                   &
          & *(me%poly_list(ipoly)%vertex(:,2)                        &
          & - me%moving%rot_parameter(2)) + me%moving%rot_parameter(1)

        loc_polygon%poly_list(ipoly)%vertex(:,2) =                   &
          & sin(me%moving%rot_parameter(3)*time)                     &
          & *(me%poly_list(ipoly)%vertex(:,1)                        &
          & - me%moving%rot_parameter(1))                            &
          & + cos(me%moving%rot_parameter(3)*time)                   &
          & *(me%poly_list(ipoly)%vertex(:,2)                        &
          & - me%moving%rot_parameter(2)) + me%moving%rot_parameter(2)
      end do
    case default
      call tem_abort( 'ERROR in tem_polygon_material_module: UNKNOWN movement' &
        & // 'for the polygon' )
    end select
    do icomp = 1, me%nComponents
      res(iComp::me%nComponents) = me%outval(iComp)
    end do
    select case(me%moving%movement_kind)
    case('lin_multi_body_2d', 'sin_multi_body_2d', 'rot_multi_body_2d')
      do ipoly = 1, me%nPoly
        do iPoint=1, nPoint
          if (res((iPoint-1)*me%nComponents+1) .feq. me%outval(1) ) then
            res((iPoint-1)*me%nComponents+1:iPoint*me%nComponents)   &
              & = tem_polygon_material_value(                        &
              &     me          = loc_polygon%poly_list(iPoly),      &
              &     nComponents = loc_polygon%nComponents,           &
              &     inVal       = loc_polygon%inVal,                 &
              &     outVal      = loc_polygon%outVal,                &
              &     point       = coord(iPoint,:2)                   )
          !else
          ! res = res((iPoint-1)*me%nComponents+1:iPoint*me%nComponents)=me%inval
          end if
        end do
      end do
    case('lin_multi_body_3d', 'sin_multi_body_3d', 'rot_multi_body_3d')
      do ipoly = 1, me%nPoly
        do iPoint=1, nPoint
          if (res((iPoint-1)*me%nComponents+1) .feq. me%outval(1) ) then
            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(iPoly),      &
                &     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 if
        end do
      end do
    case default
      call tem_abort( 'ERROR in tem_polygon_material_module: UNKNOWN movement' &
        & // 'for the multi body polygon' )
    end select
  end function tem_polygon_material_movement_multi