Function for saving mesh; topology = UNSTRUCTURED_GRID (R4P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4P), | intent(in) | :: | NN | |||
real(kind=R4P), | intent(in) | :: | X(1:NN) | |||
real(kind=R4P), | intent(in) | :: | Y(1:NN) | |||
real(kind=R4P), | intent(in) | :: | Z(1:NN) |
function VTK_GEO_UNST_R4(NN,X,Y,Z) result(E_IO)
!---------------------------------------------------------------------------------------------------------------------------------
!! Function for saving mesh; topology = UNSTRUCTURED\_GRID (R4P).
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
implicit none
integer(I4P), intent(IN):: NN ! number of nodes
real(R4P), intent(IN):: X(1:NN) ! x coordinates of all nodes
real(R4P), intent(IN):: Y(1:NN) ! y coordinates of all nodes
real(R4P), intent(IN):: Z(1:NN) ! z coordinates of all nodes
integer(I4P):: E_IO ! Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done
character(len=maxlen):: s_buffer ! buffer string
integer(I4P):: n1 ! counter
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
select case(f_out)
case(f_out_ascii)
write(unit=Unit_VTK,fmt='(A,'//FI4P//',A)',iostat=E_IO)'POINTS ',NN,' float'
write(unit=Unit_VTK,fmt='(3'//FR4P//')', iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN)
case(f_out_binary)
write(s_buffer, fmt='(A,'//FI4P//',A)',iostat=E_IO)'POINTS ',NN,' float'
write(unit=Unit_VTK, iostat=E_IO)trim(s_buffer)//end_rec
write(unit=Unit_VTK, iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN)
write(unit=Unit_VTK, iostat=E_IO)end_rec
endselect
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction VTK_GEO_UNST_R4