-
Notifications
You must be signed in to change notification settings - Fork 53
VTK XML files
Presently, the available functions for VTK-XML standard files are:
- VTK_INI_XML: function for initializing the VTK file;
- VTK_FLD_XML: function for saving global auxiliary data associate to the VTK file;
- VTK_GEO_XML: function for saving the geometry of the current piece;
- VTK_CON_XML: function for saving the mesh connectivity in case the geometry topology is unstructured;
- VTK_DAT_XML: function for start/finish the saving of data associated to the current piece mesh;
- VTK_VAR_XML: function for actually saving the data associated to the current piece mesh;
- VTK_END_XML: function for finalizing the VTK file;
The complete signature of each functions can be found on the API documentation. These functions are listed with their hierarchy: VTK_INI_XML
must be the first function called and VTK_END_XML
the last one. The VTK_FLD_XML
must be called after the initialization and before VTK_GEO_XML
and it must be called at least 3 times, for opening/closing field tag and for actually saving the field data. VTK_GEO_XML
must be called at least 2 times: one for initializing the current piece and one for finalizing it. If there are more than one piece VTK_GEO_XML
must be called 2*#pieces_number
. The functions for the connectivity and mesh-associated data must be called inside two VTK_GEO_XML
callings.
For a more complete examples of usage of these functions refer to the Testing-Program documentation. In the following a pseudo callings sequences are reported for different scenario.
Let us consider the saving of a structured mesh having a single piece. A possible pseudo callings sequence could be:
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_GEO_XML(nx1=nx1,nx2=nx2,ny1=ny1,ny2=ny2,nz1=nz1,nz2=nz2,NN=nn,X=x,Y=y,Z=z)
E_IO = VTK_DAT_XML(var_location='node',var_block_action='open')
E_IO = VTK_VAR_XML(NC_NN=nn,varname='scal_R8',var=v_R)
E_IO = VTK_DAT_XML(var_location='node',var_block_action='close')
E_IO = VTK_GEO_XML()
E_IO = VTK_END_XML()
Let us consider the saving of an unstructured mesh having a single piece. A possible pseudo callings sequence could be:
E_IO = VTK_INI_XML(output_format = 'ascii', filename = 'XML_UNST-ascii.vtu', mesh_topology = 'UnstructuredGrid')
E_IO = VTK_GEO_XML(NN = Nn, NC = Ne, X = x, Y = y, Z = z)
E_IO = VTK_CON_XML(NC = Ne, connect = connect, offset = offset, cell_type = cell_type )
E_IO = VTK_DAT_XML(var_location = 'node', var_block_action = 'opeN')
E_IO = VTK_VAR_XML(NC_NN = Nn, varname = 'scalars', var = v)
E_IO = VTK_VAR_XML(NC_NN = Nn, varname = 'vector', varX=v_X,varY=v_Y,varZ=v_Z)
E_IO = VTK_DAT_XML(var_location = 'node', var_block_action = 'CLOSE')
E_IO = VTK_GEO_XML()
E_IO = VTK_END_XML()
Let us consider the saving of a rectilinear mesh having a single piece. A possible pseudo callings sequence could be:
E_IO = VTK_INI_XML(output_format='raw', filename='XML_RECT-raw.vtr', mesh_topology='RectilinearGrid', 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, X=x, Y=y, Z=z)
E_IO = VTK_DAT_XML(var_location = 'cell', var_block_action = 'open')
E_IO = VTK_VAR_XML(NC_NN = nn, varname = 'cell_value', var = v)
E_IO = VTK_DAT_XML(var_location = 'cell', var_block_action = 'close')
E_IO = VTK_GEO_XML()
E_IO = VTK_END_XML()