vtk_fortran_write_vtu Program

Uses

  • program~~vtk_fortran_write_vtu~2~~UsesGraph program~vtk_fortran_write_vtu~2 vtk_fortran_write_vtu module~penf~2 penf program~vtk_fortran_write_vtu~2->module~penf~2 module~vtk_fortran vtk_fortran program~vtk_fortran_write_vtu~2->module~vtk_fortran module~penf_b_size penf_b_size module~penf~2->module~penf_b_size module~penf_stringify~3 penf_stringify module~penf~2->module~penf_stringify~3 module~penf_global_parameters_variables~2 penf_global_parameters_variables module~penf~2->module~penf_global_parameters_variables~2 module~vtk_fortran->module~penf~2 module~vtk_fortran_vtk_file vtk_fortran_vtk_file module~vtk_fortran->module~vtk_fortran_vtk_file module~vtk_fortran_vtm_file vtk_fortran_vtm_file module~vtk_fortran->module~vtk_fortran_vtm_file module~vtk_fortran_pvtk_file vtk_fortran_pvtk_file module~vtk_fortran->module~vtk_fortran_pvtk_file module~penf_b_size->module~penf_global_parameters_variables~2 module~vtk_fortran_vtk_file->module~penf~2 module~vtk_fortran_vtk_file_xml_writer_abstract vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_vtk_file->module~vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_vtk_file_xml_writer_ascii_local vtk_fortran_vtk_file_xml_writer_ascii_local module~vtk_fortran_vtk_file->module~vtk_fortran_vtk_file_xml_writer_ascii_local module~befor64~4 befor64 module~vtk_fortran_vtk_file->module~befor64~4 module~vtk_fortran_vtk_file_xml_writer_appended vtk_fortran_vtk_file_xml_writer_appended module~vtk_fortran_vtk_file->module~vtk_fortran_vtk_file_xml_writer_appended module~stringifor~2 stringifor module~vtk_fortran_vtk_file->module~stringifor~2 module~vtk_fortran_vtk_file_xml_writer_binary_local vtk_fortran_vtk_file_xml_writer_binary_local module~vtk_fortran_vtk_file->module~vtk_fortran_vtk_file_xml_writer_binary_local module~penf_stringify~3->module~penf_b_size module~penf_stringify~3->module~penf_global_parameters_variables~2 iso_fortran_env iso_fortran_env module~penf_stringify~3->iso_fortran_env module~vtk_fortran_vtm_file->module~penf~2 module~vtk_fortran_vtm_file->module~vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_vtm_file->module~vtk_fortran_vtk_file_xml_writer_ascii_local module~vtk_fortran_vtm_file->module~befor64~4 module~vtk_fortran_vtm_file->module~stringifor~2 module~vtk_fortran_pvtk_file->module~penf~2 module~vtk_fortran_pvtk_file->module~vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_pvtk_file->module~vtk_fortran_vtk_file_xml_writer_ascii_local module~vtk_fortran_pvtk_file->module~befor64~4 module~vtk_fortran_vtk_file_xml_writer_abstract->module~penf~2 module~vtk_fortran_vtk_file_xml_writer_abstract->module~stringifor~2 module~foxy foxy module~vtk_fortran_vtk_file_xml_writer_abstract->module~foxy module~vtk_fortran_parameters vtk_fortran_parameters module~vtk_fortran_vtk_file_xml_writer_abstract->module~vtk_fortran_parameters module~vtk_fortran_vtk_file_xml_writer_ascii_local->module~penf~2 module~vtk_fortran_vtk_file_xml_writer_ascii_local->module~vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_vtk_file_xml_writer_ascii_local->module~stringifor~2 module~vtk_fortran_dataarray_encoder vtk_fortran_dataarray_encoder module~vtk_fortran_vtk_file_xml_writer_ascii_local->module~vtk_fortran_dataarray_encoder module~befor64~4->module~penf~2 module~befor64_pack_data_m~4 befor64_pack_data_m module~befor64~4->module~befor64_pack_data_m~4 module~vtk_fortran_vtk_file_xml_writer_appended->module~penf~2 module~vtk_fortran_vtk_file_xml_writer_appended->module~vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_vtk_file_xml_writer_appended->module~stringifor~2 module~vtk_fortran_vtk_file_xml_writer_appended->module~vtk_fortran_dataarray_encoder module~vtk_fortran_vtk_file_xml_writer_appended->module~vtk_fortran_parameters module~stringifor~2->module~penf~2 module~stringifor_string_t stringifor_string_t module~stringifor~2->module~stringifor_string_t module~vtk_fortran_vtk_file_xml_writer_binary_local->module~penf~2 module~vtk_fortran_vtk_file_xml_writer_binary_local->module~vtk_fortran_vtk_file_xml_writer_abstract module~vtk_fortran_vtk_file_xml_writer_binary_local->module~stringifor~2 module~vtk_fortran_vtk_file_xml_writer_binary_local->module~vtk_fortran_dataarray_encoder module~vtk_fortran_dataarray_encoder->module~penf~2 module~vtk_fortran_dataarray_encoder->module~befor64~4 module~stringifor_string_t->module~penf~2 module~stringifor_string_t->module~befor64~4 module~stringifor_string_t->iso_fortran_env module~face face module~stringifor_string_t->module~face module~foxy->module~penf~2 module~foxy_xml_tag foxy_xml_tag module~foxy->module~foxy_xml_tag module~foxy_xml_file foxy_xml_file module~foxy->module~foxy_xml_file module~vtk_fortran_parameters->module~penf~2 module~vtk_fortran_parameters->iso_fortran_env module~befor64_pack_data_m~4->module~penf~2 module~face->iso_fortran_env module~foxy_xml_tag->module~penf~2 module~foxy_xml_tag->module~stringifor~2 module~foxy_xml_file->module~penf~2 module~foxy_xml_file->module~foxy_xml_tag

Calls

program~~vtk_fortran_write_vtu~2~~CallsGraph program~vtk_fortran_write_vtu~2 vtk_fortran_write_vtu proc~write_data~4 write_data program~vtk_fortran_write_vtu~2->proc~write_data~4

Contents

Source Code


Variables

TypeAttributesNameInitial
type(vtk_file) :: a_vtk_file
integer(kind=I4P), parameter:: np =27_I4P
integer(kind=I4P), parameter:: nc =11_I4P
real(kind=R4P), dimension(1:np):: x =[0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2]
real(kind=R4P), dimension(1:np):: y =[0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
real(kind=R4P), dimension(1:np):: z =[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
integer(kind=I1P), dimension(1:nc):: cell_type =[12_I1P, 12_I1P, 10_I1P, 10_I1P, 7_I1P, 6_I1P, 9_I1P, 5_I1P, 5_I1P, 3_I1P, 1_I1P]
integer(kind=I4P), dimension(1:nc):: offset =[8_I4P, 16_I4P, 20_I4P, 24_I4P, 30_I4P, 36_I4P, 40_I4P, 43_I4P, 46_I4P, 48_I4P, 49_I4P]
integer(kind=I4P), dimension(1:49):: connect
real(kind=R8P), dimension(1:np):: v
integer(kind=I4P), dimension(1:np):: v_u
integer(kind=I4P), dimension(1:np):: v_v
integer(kind=I4P), dimension(1:np):: v_w
integer(kind=I4P), dimension(1:np):: v_x
integer(kind=I4P), dimension(1:np):: v_y
integer(kind=I4P), dimension(1:np):: v_z
integer(kind=I4P) :: error
logical :: test_passed(1)

Subroutines

subroutine write_data()

Arguments

None

Source Code

program vtk_fortran_write_vtu
!< VTK_Fortran test: write VTU file.
use penf
use vtk_fortran, only : vtk_file

implicit none
type(vtk_file)                :: a_vtk_file                                                   !< A VTK file.
integer(I4P), parameter       :: np = 27_I4P                                                  !< Number of points.
integer(I4P), parameter       :: nc = 11_I4P                                                  !< Number of cells.
real(R4P),    dimension(1:np) :: x = [0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2]  !< X coordinates of points.
real(R4P),    dimension(1:np) :: y = [0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]  !< Y coordinates of points.
real(R4P),    dimension(1:np) :: z = [0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6]  !< Z coordinates of points.
integer(I1P), dimension(1:nc) :: cell_type = [12_I1P,12_I1P,10_I1P,10_I1P,&
                                              7_I1P,6_I1P,9_I1P,5_I1P,5_I1P,3_I1P,1_I1P]      !< Cells type.
integer(I4P), dimension(1:nc) :: offset = [8_I4P,16_I4P,20_I4P,24_I4P,30_I4P,&
                                           36_I4P,40_I4P,43_I4P,46_I4P,48_I4P,49_I4P]         !< Cells offset.
integer(I4P), dimension(1:49) :: connect                                                      !< Connectivity.
real(R8P),    dimension(1:np) :: v                                                            !< One component points-variable.
integer(I4P), dimension(1:np) :: v_u                                                          !< X component points-variable.
integer(I4P), dimension(1:np) :: v_v                                                          !< Y component points-variable.
integer(I4P), dimension(1:np) :: v_w                                                          !< Z component points-variable.
integer(I4P), dimension(1:np) :: v_x                                                          !< X component points-variable.
integer(I4P), dimension(1:np) :: v_y                                                          !< Y component points-variable.
integer(I4P), dimension(1:np) :: v_z                                                          !< Z component points-variable.
integer(I4P)                  :: error                                                        !< Status error.
logical                       :: test_passed(1)                                               !< List of passed tests.

connect = [0 ,1 ,4 ,3 ,6 ,7 ,10,9 , &
           1 ,2 ,5 ,4 ,7 ,8 ,11,10, &
           6 ,10,9 ,12,             &
           5 ,11,10,14,             &
           15,16,17,14,13,12,       &
           18,15,19,16,20,17,       &
           22,23,20,19,             &
           21,22,18,                &
           22,19,18,                &
           26,25,                   &
           24]
v = [0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0, &
     18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0]
v_U = [1,1,0,1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
v_V = [0,1,2,0,1,2,0,1,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
v_W = [0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
v_X = [1,1,0,1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
v_Y = [0,1,2,0,1,2,0,1,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
v_Z = [0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
! ascii
error = a_vtk_file%initialize(format='ascii', filename='XML_UNST_T-ascii.vtu', mesh_topology='UnstructuredGrid')
call write_data
error = a_vtk_file%finalize()
! raw
error = a_vtk_file%initialize(format='raw', filename='XML_UNST_T-raw.vtu', mesh_topology='UnstructuredGrid')
call write_data
error = a_vtk_file%finalize()
! binary
error = a_vtk_file%initialize(format='binary', filename='XML_UNST_T-binary.vtu', mesh_topology='UnstructuredGrid')
call write_data
error = a_vtk_file%finalize()

test_passed = .true. ! nothing to test yet

print "(A,L1)", new_line('a')//'Are all tests passed? ', all(test_passed)
stop
contains
  subroutine write_data
  !< Write data.

  error = a_vtk_file%xml_writer%write_piece(np=np, nc=nc)
  error = a_vtk_file%xml_writer%write_geo(np=np, nc=nc, x=x, y=y, z=z)
  error = a_vtk_file%xml_writer%write_connectivity(nc=nc, connectivity=connect, offset=offset, cell_type=cell_type)
  error = a_vtk_file%xml_writer%write_dataarray(location='node', action='open')
  error = a_vtk_file%xml_writer%write_dataarray(data_name='scalars', x=v)
  error = a_vtk_file%xml_writer%write_dataarray(data_name='tensor', u=v_u, v= v_v, w=v_w, x=v_x, y=v_y, z=v_z)
  error = a_vtk_file%xml_writer%write_dataarray(location='node', action='close')
  error = a_vtk_file%xml_writer%write_piece()
  endsubroutine write_data
endprogram vtk_fortran_write_vtu