tem_load_triangle_single Subroutine

private subroutine tem_load_triangle_single(me, transform, conf, thandle)

Load single triangle from config file

Arguments

Type IntentOptional Attributes Name
type(tem_triangle_type), intent(out) :: me

single triangle

type(tem_transformation_type), intent(in) :: transform

transformation for spatial object

type(flu_State) :: conf

lua state

integer, intent(in) :: thandle

Calls

proc~~tem_load_triangle_single~2~~CallsGraph proc~tem_load_triangle_single~2 tem_load_triangle_single proc~aot_table_open aot_table_open proc~tem_load_triangle_single~2->proc~aot_table_open proc~aot_table_close aot_table_close proc~tem_load_triangle_single~2->proc~aot_table_close proc~tem_abort tem_abort proc~tem_load_triangle_single~2->proc~tem_abort proc~aot_get_val~2 aot_get_val proc~tem_load_triangle_single~2->proc~aot_get_val~2 mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_load_triangle_single~2~~CalledByGraph proc~tem_load_triangle_single~2 tem_load_triangle_single proc~tem_load_triangle~2 tem_load_triangle proc~tem_load_triangle~2->proc~tem_load_triangle_single~2 interface~tem_load_triangle~2 tem_load_triangle interface~tem_load_triangle~2->proc~tem_load_triangle_single~2 interface~tem_load_triangle~2->proc~tem_load_triangle_single~2 interface~tem_load_triangle~2->interface~tem_load_triangle~2 interface~tem_load_triangle~2->interface~tem_load_triangle~2

Contents


Source Code

  subroutine tem_load_triangle_single(me, transform, conf, thandle )
    !--------------------------------------------------------------------------!
    !inferface variables
    !> single triangle
    type(tem_triangle_type), intent(out) :: me
    !> transformation for spatial object
    type(tem_transformation_type), intent(in) :: transform
    !> lua state
    type(flu_state) :: conf
    integer, intent(in) :: thandle !< handle for canonical objects
    !--------------------------------------------------------------------------!
    ! local varaibles
    integer :: vError(3), errFatal(3)
    integer :: iNode
    integer :: sub_handle
    !--------------------------------------------------------------------------!
    errFatal = aoterr_fatal

    call aot_table_open(L=conf, parent=thandle, thandle=sub_handle, &
      &                 key='nodes')
    do iNode=1,3
      call aot_get_val(L=conf, thandle=sub_handle, &
        &              val=me%nodes(:,iNode), &
        &              pos=iNode, ErrCode=vError)

      if (any(btest(vError, errFatal))) then
        write(logunit(0),*) ' Error in configuration: triangle node nr ', iNode
        write(logunit(0),*) ' is not defined'
        call tem_abort()
      end if
    end do
    call aot_table_close(L=conf, thandle=sub_handle)

    write(logunit(2),*) '   node 1: ', me%nodes(:,1)
    write(logunit(2),*) '   node 2: ', me%nodes(:,2)
    write(logunit(2),*) '   node 3: ', me%nodes(:,3)

    !apply transformation
    if(transform%active) then
      if(transform%deform%active) then
        do iNode=1,3
          me%nodes(:,iNode) = matmul( transform%deform%matrix, &
            &                                  me%nodes(:,iNode) )
        enddo
      endif
      if(transform%translate%active) then
        do iNode=1,3
          me%nodes(:,iNode) = transform%translate%vec &
            &                         + me%nodes(:,iNode)
        enddo
      endif
    endif

  end subroutine tem_load_triangle_single