-
Notifications
You must be signed in to change notification settings - Fork 53
Taste
Stefano Zaghi edited this page Dec 23, 2014
·
1 revision
This example demonstrate the creation of StructuredGrid file (.vts). The mesh is a simple prism.
Let us assume that all the necessary StructuredGrid variables have been defined and initialized, the following is a pseudo code showing how to create XML file:
E_IO = VTK_INI_XML(output_format='binary', filename='XML_STRG.vts', &
mesh_topology='StructuredGrid', nx1=nx1, nx2=nx2, ny1=ny1, ny2=ny2, nz1=nz1, nz2=nz2)
E_IO = VTK_FLD_XML(fld_action='open')
E_IO = VTK_FLD_XML(fld=0._R8P,fname='TIME')
E_IO = VTK_FLD_XML(fld=1_I8P,fname='CYCLE')
E_IO = VTK_FLD_XML(fld_action='close')
E_IO = VTK_GEO_XML(nx1=nx1, nx2=nx2, ny1=ny1, ny2=ny2, nz1=nz1, nz2=nz2, NN=nn, &
X=reshape(x(nx1:nx2,:,:),(/nn/)), &
Y=reshape(y(nx1:nx2,:,:),(/nn/)), &
Z=reshape(z(nx1:nx2,:,:),(/nn/)))
E_IO = VTK_DAT_XML(var_location = 'node', var_block_action = 'open')
E_IO = VTK_VAR_XML(NC_NN = nn, varname = 'node_value', var = reshape(v(nx1:nx2,:,:),(/nn/)))
E_IO = VTK_DAT_XML(var_location = 'node', var_block_action = 'close')
E_IO = VTK_GEO_XML()
E_IO = VTK_END_XML()
This example is contained into Test_Driver.f90, in particular the subroutine test_strg
contains all the data and code to run this example.