fileio_vtk_mod Module Reference

I/O for VTK files in XML format (vtkStructuredGrid) More...

Data Types

type  fileio_vtk
 names of fluxes More...
 

Functions/Subroutines

subroutine initfileio_vtk (this, Mesh, Physics, Timedisc, Sources, config, IO)
 Constructor for the VTK file I/O. More...
 
subroutine writeparaviewfile (this)
 
subroutine getprecision (this, realsize)
 Determines precision of real numbers in bytes. More...
 
subroutine getendianness (this, res, littlestr, bigstr)
 Determines the endianness of the system. More...
 
recursive subroutine getoutputlist (this, Mesh, node, k, l, prefix)
 Creates a list of all data arrays which will be written to file. More...
 
subroutine openfile (this, action, ftype)
 Specific routine to open a file for vtk I/O. More...
 
subroutine closefile (this, ftype)
 Specific routine to close a file for vtk I/O. More...
 
subroutine writeheader (this, Mesh, Physics, Header, IO)
 Writes XML header to file. More...
 
subroutine readheader (this, success)
 Reads the header (not yet implemented) More...
 
subroutine writetimestamp (this, time)
 Writes the timestep. More...
 
subroutine readtimestamp (this, time)
 Reads the timestep (not yet implemented) More...
 
subroutine writedataset (this, Mesh, Physics, Fluxes, Timedisc, Header, IO)
 Writes all desired data arrays to a file. More...
 
subroutine finalize (this)
 Closes the file I/O. More...
 

Variables

integer, parameter maxcomp = 9
 max. of allowed components 9 is a tensor (rank 2, dim 3) More...
 
integer, parameter maxcols = 40
 max of different output arrays More...
 
integer, parameter maxkey = 64
 max length of keyname More...
 
character, parameter lf = ACHAR(10)
 line feed More...
 

Detailed Description

I/O for VTK files in XML format (vtkStructuredGrid)

Author
Björn Sperling
Tobias Illenseer
Jannes Klee

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:

Function/Subroutine Documentation

◆ closefile()

subroutine fileio_vtk_mod::closefile ( class(fileio_vtk), intent(inout)  this,
character(len=*), intent(in), optional  ftype 
)

Specific routine to close a file for vtk I/O.

Parameters
[in,out]this[in,out] this fileio type
ftype[in] file type

Definition at line 606 of file fileio_vtk.f90.

◆ finalize()

subroutine fileio_vtk_mod::finalize ( class(fileio_vtk), intent(inout)  this)

Closes the file I/O.

Parameters
[in,out]this[in,out] this fileio type

Definition at line 1047 of file fileio_vtk.f90.

◆ getendianness()

subroutine fileio_vtk_mod::getendianness ( class(fileio_vtk), intent(inout)  this,
character(len=*), intent(out)  res,
character(len=*), intent(in)  littlestr,
character(len=*), intent(in)  bigstr 
)

Determines the endianness of the system.

Determines the the endianess of the system (big or little endian)

Parameters
[in,out]this[in,out] this fileio type
res[out] res result string
littlestr[in] littlestr little endian str
bigstr[in] bigstr big endian str

Definition at line 403 of file fileio_vtk.f90.

◆ getoutputlist()

recursive subroutine fileio_vtk_mod::getoutputlist ( class(fileio_vtk), intent(inout)  this,
class(mesh_base), intent(in)  Mesh,
type(dict_typ), pointer  node,
integer, intent(inout)  k,
integer, intent(inout)  l,
character(len=*), intent(inout), optional  prefix 
)
private

Creates a list of all data arrays which will be written to file.

Therefore it ignores all arrays with coordinates and checks if the data arrays are of the dimension of the mesh.

Parameters
[in,out]this[in,out] this fileio type
[in]mesh[in] mesh mesh type
node[in,out] node pointer to (sub-)dict
[in,out]k[in,out] k number of data arrays
[in,out]l[in,out] l number of data output scalars
[in,out]prefix[in,out] prefix namespace (path) to sub-dict

Definition at line 442 of file fileio_vtk.f90.

◆ getprecision()

subroutine fileio_vtk_mod::getprecision ( class(fileio_vtk), intent(inout)  this,
integer, intent(out)  realsize 
)

Determines precision of real numbers in bytes.

Determines the precision (aka size) of a real number. Single precision (4 bytes), double precision (8 bytes) and quad precision (16 bytes) are possible results.

Parameters
[in,out]this[in,out] this fileio type
realsize[out] realsize size of real (byte)

Definition at line 359 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_base), intent(in), pointer  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] Physics Physics 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 119 of file fileio_vtk.f90.

◆ openfile()

subroutine fileio_vtk_mod::openfile ( class(fileio_vtk), intent(inout)  this,
integer, intent(in)  action,
character(len=*), intent(in), optional  ftype 
)

Specific routine to open a file for vtk I/O.

Parameters
[in,out]this[in,out] this fileio type
[in]action[in] action mode of file access
[in]ftype[in] file type

Definition at line 538 of file fileio_vtk.f90.

◆ readheader()

subroutine fileio_vtk_mod::readheader ( class(fileio_vtk), intent(inout)  this,
logical, intent(out)  success 
)

Reads the header (not yet implemented)

Definition at line 713 of file fileio_vtk.f90.

◆ readtimestamp()

subroutine fileio_vtk_mod::readtimestamp ( class(fileio_vtk), intent(inout)  this,
real, intent(out)  time 
)

Reads the timestep (not yet implemented)

Definition at line 758 of file fileio_vtk.f90.

◆ writedataset()

subroutine fileio_vtk_mod::writedataset ( 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 
)

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 773 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 664 of file fileio_vtk.f90.

◆ writeparaviewfile()

subroutine fileio_vtk_mod::writeparaviewfile ( class(fileio_vtk), intent(inout)  this)
private

Definition at line 301 of file fileio_vtk.f90.

◆ writetimestamp()

subroutine fileio_vtk_mod::writetimestamp ( class(fileio_vtk this,
real, intent(in)  time 
)

Writes the timestep.

Definition at line 728 of file fileio_vtk.f90.

Variable Documentation

◆ lf

character, parameter fileio_vtk_mod::lf = ACHAR(10)
private

line feed

Definition at line 79 of file fileio_vtk.f90.

◆ maxcols

integer, parameter fileio_vtk_mod::maxcols = 40
private

max of different output arrays

Definition at line 77 of file fileio_vtk.f90.

◆ maxcomp

integer, parameter fileio_vtk_mod::maxcomp = 9
private

max. of allowed components 9 is a tensor (rank 2, dim 3)

Definition at line 75 of file fileio_vtk.f90.

◆ maxkey

integer, parameter fileio_vtk_mod::maxkey = 64
private

max length of keyname

Definition at line 78 of file fileio_vtk.f90.