Load triangle information from config file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_triangle_type), | intent(out), | allocatable | :: | me(:) |
array of triangles |
|
type(tem_transformation_type), | intent(in) | :: | transform |
transformation for spatial object |
||
type(flu_State) | :: | conf |
lua state |
|||
integer, | intent(in) | :: | thandle |
subroutine tem_load_triangle(me, transform, conf, thandle )
!--------------------------------------------------------------------------!
!inferface variables
!> array of triangles
type(tem_triangle_type), allocatable, 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 :: tri_handle, tri_subHandle
integer :: iObj, nObjects
!--------------------------------------------------------------------------!
write(logunit(1),*) 'Loading triangle: '
call aot_table_open(L = conf, parent = thandle, thandle = tri_handle, &
& key = 'object')
call aot_table_open(L=conf, parent = tri_handle, thandle = tri_subHandle, &
& pos = 1 )
if ( tri_subHandle .eq. 0) then
!object is a single table
allocate(me(1))
call aot_table_close(L=conf, thandle=tri_subHandle)
call tem_load_triangle_single(me(1), transform, conf, tri_handle)
else
!object is a multiple table
call aot_table_close(L=conf, thandle=tri_subHandle)
nObjects = aot_table_length(L=conf, thandle=tri_handle)
allocate(me(nObjects))
do iObj=1,nObjects
write(logunit(2),*) ' triangle ', iObj
call aot_table_open(L=conf, parent=tri_handle, thandle=tri_suBHandle,&
& pos=iObj)
call tem_load_triangle_single(me(iObj), transform, conf, tri_Subhandle)
call aot_table_close(L=conf, thandle=tri_subHandle)
write(logunit(2),*) ''
end do
end if
call aot_table_close(L=conf, thandle=tri_Handle)
end subroutine tem_load_triangle