This routine single cylinder from object table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_cylinder_type), | intent(out) | :: | me | |||
type(tem_transformation_type), | intent(in) | :: | transform |
transformation for spatial object |
||
type(flu_State) | :: | conf | ||||
integer, | intent(in) | :: | thandle |
subroutine tem_load_cylinder_single(me, transform, conf, thandle)
! --------------------------------------------------------------------------!
!inferface variables
type(tem_cylinder_type), intent(out) :: me !< cylinder data type
type(flu_state) :: conf !< flu state
integer, intent(in) :: thandle !< parent handle
!> transformation for spatial object
type(tem_transformation_type), intent(in) :: transform
! --------------------------------------------------------------------------!
!local variable
integer :: iError, vError(3), errFatal(3)
! --------------------------------------------------------------------------!
errFatal = aoterr_fatal
!read startPos distance of length from bounding box
call aot_get_val(L=conf, thandle=thandle, &
& val=me%origin, ErrCode=vError, &
& key='origin', default=[0.0_rk,0.0_rk,0.0_rk] )
if (any(btest(vError, errFatal))) then
write(logunit(0),*) &
& 'FATAL Error occured, while retrieving cylinder origin :'
call tem_abort()
end if
!read radius of cylinder filament in length
call aot_get_val(L=conf, thandle=thandle, &
& val=me%radius, ErrCode=iError, key='radius')
if (btest(iError, aoterr_Fatal)) then
write(logunit(0),*) &
& 'FATAL Error occured, while retrieving cylinder radius'
if (btest(iError, aoterr_NonExistent)) &
& write(logunit(0),*) 'Variable not existent!'
if (btest(iError, aoterr_WrongType)) &
& write(logunit(0),*) 'Variable has wrong type!'
call tem_abort()
end if
!read cylinder normal which defines the direction of the filament
call aot_get_val(L=conf, thandle=thandle, &
& val=me%vec, ErrCode=vError, key='vec')
if (any(btest(vError, errFatal))) then
write(logunit(0),*) 'FATAL Error occured, while retrieving cylinder vec'
call tem_abort()
end if
!cylinder type
call aot_get_val(L=conf, thandle=thandle, val=me%only_surface, &
& ErrCode=iError, key='only_surface', &
& pos=4, default=.false.)
if (btest(iError, aoterr_WrongType)) then
write(logunit(0),*) &
& 'Error occured, while retrieving cylinder only_surface'
write(logunit(0),*) 'Variable has wrong type!'
write(logunit(0),*) 'Should be a LOGICAL!'
call tem_abort()
endif
write(logunit(1),*) ' origin:', me%origin
write(logunit(1),*) ' vec:', me%vec
write(logunit(1),*) ' radius:', me%radius
write(logunit(1),*) ' only_surface:', me%only_surface
!apply transformation
if(transform%active) then
if(transform%deform%active) then
me%vec = matmul(transform%deform%matrix, me%vec)
me%origin = matmul(transform%deform%matrix, me%origin)
endif
if(transform%translate%active) then
me%origin = transform%translate%vec + me%origin
endif
endif
end subroutine tem_load_cylinder_single