I/O for VTK files in XML format (vtkStructuredGrid) More...
Data Types | |
type | filehandle_vts |
names of fluxes More... | |
type | fileio_vtk |
FileIO class for VTK output. More... | |
Private Attributes | |
some restrictions to shape & amount of output data | |
integer, parameter | maxcomp = 9 |
max. of allowed components 9 is a tensor (rank 2, dim 3) More... | |
integer, parameter | maxcols = 64 |
max of different output arrays More... | |
character, parameter | lf = ACHAR(10) |
line feed More... | |
handling multiple data files with process rank in their names | |
integer, parameter | rank_str_len = 5 |
length of multi process rank string More... | |
Methods | |
subroutine | initfileio_vtk (this, Mesh, Physics, Timedisc, Sources, config, IO) |
Constructor for the VTK file I/O. More... | |
subroutine | writeparaviewfile (this) |
Write the Paraview global description file. More... | |
subroutine | writeheader (this, Mesh, Physics, Header, IO) |
Writes XML header to file. More... | |
subroutine | writedataset_vtk (this, Mesh, Physics, Fluxes, Timedisc, Header, IO) |
Reads the header (not yet implemented) More... | |
subroutine | finalize (this) |
Destructor of VTK file I/O class. More... | |
subroutine | initfilehandle (this, filename, path, extension, textfile, onefile, cycles, unit) |
basic initialization of Fortran file handle with extension for parallel vts files More... | |
character(len=256) function | getbasename (this, step) |
get file name of Fortran stream including rank and time step More... | |
character(len=rank_str_len) function | getrankstring (this, rank) |
convert process rank to string More... | |
Detailed Description
I/O for VTK files in XML format (vtkStructuredGrid)
This module implements VTK file I/O to write vts files (vtkStructuredGrid) in XML syntax. Each output file contains a single timestep. In case of parallel computation there is one file per job (and timestep) and only one global container file (pvts) which groups all vts files. Additionally a PVD file is generated, which can be used to load the data in Paraview.
References:
- Visualization Toolkit (VTK)
- Wiki: http://www.vtk.org/Wiki/VTK_XML_Formats
- file format specifications: http://www.vtk.org/VTK/img/file-formats.pdf
- VTK XML Reader/Writer: http://www.vtk.org/doc/nightly/html/IOXMLInformationFormat.html
- Paraview, http://www.paraview.org/Wiki/ParaView/Data_formats
- Visit, https://www.visitusers.org/index.php?title=Time_and_Cycle_in_VTK_files
Function/Subroutine Documentation
◆ finalize()
subroutine fileio_vtk_mod::finalize | ( | type(fileio_vtk), intent(inout) | this | ) |
Destructor of VTK file I/O class.
- Parameters
-
[in,out] this [in,out] this fileio type
Definition at line 920 of file fileio_vtk.f90.
◆ getbasename()
character(len=256) function fileio_vtk_mod::getbasename | ( | class(filehandle_vts), intent(in) | this, |
integer, intent(in) | step | ||
) |
get file name of Fortran stream including rank and time step
- Parameters
-
[in] this [in] this file handle [in] step [in] step time step
Definition at line 958 of file fileio_vtk.f90.
◆ getrankstring()
character(len=rank_str_len) function fileio_vtk_mod::getrankstring | ( | class(filehandle_vts), intent(in) | this, |
integer, intent(in), optional | rank | ||
) |
convert process rank to string
- Parameters
-
[in] this [in] this file handle [in] rank [in] rank process rank
Definition at line 970 of file fileio_vtk.f90.


◆ initfilehandle()
|
private |
basic initialization of Fortran file handle with extension for parallel vts files
- Parameters
-
[in,out] this [inout] this file handle class [in] filename [in] filename file name without extension [in] path [in] path file path without filename [in] extension [in] extension file name extension [in] textfile [in] textfile true for text data [in] onefile [in] onefile true if all data goes into one file [in] cycles \parma [in] cycles max number of files [in] unit \parma [in] unit force fortran i/o unit number
Definition at line 935 of file fileio_vtk.f90.
◆ initfileio_vtk()
subroutine fileio_vtk_mod::initfileio_vtk | ( | class(fileio_vtk), intent(inout) | this, |
class(mesh_base), intent(in) | Mesh, | ||
class(physics_base), intent(in) | Physics, | ||
class(timedisc_base), intent(in) | Timedisc, | ||
class(sources_list), intent(in), allocatable | Sources, | ||
type(dict_typ), intent(in), pointer | config, | ||
type(dict_typ), intent(in), pointer | IO | ||
) |
Constructor for the VTK file I/O.
Initilizes the file I/O type, filename, stoptime, number of outputs, number of files, unit number, config as a dict
- Parameters
-
[in,out] this [in,out] this fileio type [in] mesh [in] Mesh mesh type [in] physics [in] Physics Physics type [in] timedisc [in] Physics Physics type [in] sources [in] Sources sources type [in] config [in] IO Dictionary for I/O [in] io [in] IO Dictionary for I/O
- Bug:
- This is most probably broken !
Definition at line 149 of file fileio_vtk.f90.
◆ writedataset_vtk()
subroutine fileio_vtk_mod::writedataset_vtk | ( | class(fileio_vtk), intent(inout) | this, |
class(mesh_base), intent(in) | Mesh, | ||
class(physics_base), intent(inout) | Physics, | ||
class(fluxes_base), intent(in) | Fluxes, | ||
class(timedisc_base), intent(in) | Timedisc, | ||
type(dict_typ), pointer | Header, | ||
type(dict_typ), pointer | IO | ||
) |
Reads the header (not yet implemented)
Writes all desired data arrays to a file
- Parameters
-
[in,out] this [in,out] this fileio type [in] mesh [in] mesh mesh type [in,out] physics [in] physics physics type [in] fluxes [in] fluxes fluxes type [in] timedisc [in] timedisc timedisc type header [in,out] IO I/O dictionary io [in,out] IO I/O dictionary
- Todo:
- : implement generic output routine for non-field/non-scalar data
Definition at line 651 of file fileio_vtk.f90.
◆ writeheader()
subroutine fileio_vtk_mod::writeheader | ( | class(fileio_vtk), intent(inout) | this, |
class(mesh_base), intent(in) | Mesh, | ||
class(physics_base), intent(in) | Physics, | ||
type(dict_typ), pointer | Header, | ||
type(dict_typ), pointer | IO | ||
) |
Writes XML header to file.
- Parameters
-
[in,out] this [in,out] this fileio type [in] mesh [in] mesh mesh type [in] physics [in] physics physics type io [in,out] IO I/O dictionary header [in,out] config config dictionary
Definition at line 568 of file fileio_vtk.f90.
◆ writeparaviewfile()
subroutine fileio_vtk_mod::writeparaviewfile | ( | class(fileio_vtk), intent(inout) | this | ) |
Write the Paraview global description file.
Definition at line 378 of file fileio_vtk.f90.
Variable Documentation
◆ lf
|
private |
line feed
Definition at line 81 of file fileio_vtk.f90.
◆ maxcols
|
private |
max of different output arrays
Definition at line 80 of file fileio_vtk.f90.
◆ maxcomp
|
private |
max. of allowed components 9 is a tensor (rank 2, dim 3)
Definition at line 78 of file fileio_vtk.f90.
◆ rank_str_len
|
private |
length of multi process rank string
Definition at line 85 of file fileio_vtk.f90.