GRIDMAN
grid managment library
Functions/Subroutines
vtk.f File Reference

Converting grid into format which can be used for VTK. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gridman_2dgrid2vtk (GRID, NPOINTS, NCELLS, NVERTEX, X, IFIRST, LVERTEX, IVERTEX, CTYPE, IERR, NTHETA, THETA)
 Convert 2D grid into VTK format. More...
 
subroutine gridman_2dgrid2vtk_index (GRID, N, M, RINDEXES, SINDEXES, IERR)
 Translate cell and edge indices in VTK input in the sense of GRIDMAN_2DGRID2VTK. More...
 
subroutine gridman_vtk_grid2d_write (FNAME, HEADER, GRID, NELEMENTS, NCS, NCV, NPS, NPV, IERR, CELL_SCALAR, CSNAME, CELL_VECTOR, CVNAME, POINT_SCALAR, PSNAME, POINT_VECTOR, PVNAME)
 Write 2D grid and data in VTK ASCII legacy format. More...
 
subroutine gridman_3dgrid2vtk (GRID, NPOINTS, NCELLS, NVERTEX, X, IFIRST, LVERTEX, IVERTEX, CTYPE, IERR)
 Convert 3D grid into VTK format. Only grid w/o cells is implemented at the moment !!! More...
 
subroutine gridman_3dgrid2vtk_index (GRID, N, M, RINDEXES, SINDEXES, IERR)
 Translate edge indices in VTK input in the sense of GRIDMAN_3DGRID2VTK (in the current implementation of GRIDMAN_3DGRID2VTK only grid edges are treated) More...
 
subroutine gridman_vtk_grid3d_write (FNAME, HEADER, GRID, NELEMENTS, NCS, NCV, NPS, NPV, IERR, CELL_SCALAR, CSNAME, CELL_VECTOR, CVNAME, POINT_SCALAR, PSNAME, POINT_VECTOR, PVNAME)
 Write 3D grid and data in VTK ASCII legacy format. Only grid w/o cells is implemented at the moment !!! More...
 

Detailed Description

Converting grid into format which can be used for VTK.

Definition in file vtk.f.

Function/Subroutine Documentation

subroutine gridman_2dgrid2vtk ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(out)  NPOINTS,
integer(gridman_sp), intent(out)  NCELLS,
integer(gridman_sp), intent(out)  NVERTEX,
real(gridman_dp), dimension(:,:), intent(out), allocatable  X,
integer(gridman_sp), dimension(:), intent(out), allocatable  IFIRST,
integer(gridman_sp), dimension(:), intent(out), allocatable  LVERTEX,
integer(gridman_sp), dimension(:), intent(out), allocatable  IVERTEX,
integer, dimension(:), intent(out), allocatable  CTYPE,
integer, intent(out)  IERR,
integer, intent(in)  NTHETA,
real(gridman_dp), dimension(ntheta), intent(in), optional  THETA 
)

Convert 2D grid into VTK format.

Todo:
VTK output of edges

VTK representation includes cells and edges which do not belong to any cell

Parameters
gridOriginal grid
[out]npointsNumber of points
[out]ncellsNumber of cells
[out]nvertexTotal number of vertices
[out]xArray of coordinates, X(ND,NPOINTS)
[out]ifirstFirst index which corresponds to each cell in array IVERTEX, IFIRST(NCELLS)
[out]lvertexNumber of vertices of each cell, LVERTEX(NCELLS)
[out]ivertexList of points (vertices) belonging to each cell, IVERTEX(NVERTEX)
[out]ctypeVTK cell type index, CTYPE(NCELLS)
[out]ierrError code
[in]nthetaNumber of nodes in THETA grid
[in]thetaCylindrical angle, THETA(NTHETA), [radian]

If NTHETA and THETA(NTHETA) are defined, then axi-symmetric grid is generated

If resulting grid is 3D, then edges not belonging to any cell are skipped. The axi-symmetric grid is represented in X-Y-Z coordinates

Definition at line 36 of file vtk.f.

References gridman_grid2d_chains(), gridman_grid2d_check(), and gridman_indlist_deallocate().

Referenced by gridman_vtk_grid2d_write().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_2dgrid2vtk_index ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(out)  N,
integer, intent(out)  M,
real(gridman_dp), dimension(:,:), intent(out), allocatable  RINDEXES,
character(gridman_length), dimension(:), intent(out), allocatable  SINDEXES,
integer, intent(out)  IERR 
)

Translate cell and edge indices in VTK input in the sense of GRIDMAN_2DGRID2VTK.

Parameters
gridOriginal grid
[out]nNumber of elements in cell scalars array
[out]mNumber of cell scalars arrays
[out]rindexesCells scalars array, RINDEXES(N,M)

This array contains indices of cells and of edge not belonging to any cell. Zero is used for elements for which indices are not defined.

Parameters
[out]sindexesName of each RINDEXES(:,I), SINDEXES(M)

I<number of index>_<number of column>_<INDEXCOLUMNS> Designation of edge indices has same format but starts from E instead of I

Parameters
[out]ierrError code

Definition at line 438 of file vtk.f.

References gridman::gridman_dp, gridman_grid2d_check(), gridman_grid_count(), and gridman::gridman_sp.

Referenced by gridman_vtk_grid2d_write().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_vtk_grid2d_write ( character(*), intent(in)  FNAME,
character(*), intent(in)  HEADER,
type(gridman_grid)  GRID,
integer, intent(in)  NELEMENTS,
integer, intent(in)  NCS,
integer, intent(in)  NCV,
integer, intent(in)  NPS,
integer, intent(in)  NPV,
integer, intent(out)  IERR,
real(gridman_dp), dimension(nelements,ncs), intent(in), optional  CELL_SCALAR,
character(*), dimension(ncs), intent(in), optional  CSNAME,
real(gridman_dp), dimension(2,nelements,ncv), intent(in), optional  CELL_VECTOR,
character(*), dimension(ncv), intent(in), optional  CVNAME,
real(gridman_dp), dimension(grid%npoints,nps), intent(in), optional  POINT_SCALAR,
character(*), dimension(nps), intent(in), optional  PSNAME,
real(gridman_dp), dimension(2,grid%npoints,npv), intent(in), optional  POINT_VECTOR,
character(*), dimension(npv), intent(in), optional  PVNAME 
)

Write 2D grid and data in VTK ASCII legacy format.

Interface to GRIDMAN_VTK_WRITE which calls GRIDMAN_2DGRID2VTK.

Parameters
[in]fnameName of the output file
[in]headerString with short description of the data set
grid2D grid object
[in]nelementsFirst dimension of arrays CELL_SCALAR, CELL_VECTOR

This quantity must be equal to GRIDNCELLS plus the number of "free" edges which do not belong to any cell. Calculated by GRIDMAN_GRID_COUNT.

Parameters
[in]ncsNumber of scalar cell data sets
[in]ncvNumber of vector cell data sets
[in]npsNumber of scalar point data sets
[in]npvNumber of vector point data sets
[out]ierrError code
[in]cell_scalarScalar cell data
[in]csnameNames of the scalar cell data sets
[in]cell_vectorVector cell data
[in]cvnameNames of the vector cell data sets
[in]point_scalarScalar point data
[in]psnameNames of the scalar point data sets
[in]point_vectorVector cell data
[in]pvnameNames of the vector point data sets

Definition at line 611 of file vtk.f.

References gridman_2dgrid2vtk(), gridman_2dgrid2vtk_index(), gridman::gridman_dp, gridman_grid_count(), gridman::gridman_sp, and gridman_vtk_write().

Here is the call graph for this function:

subroutine gridman_3dgrid2vtk ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(out)  NPOINTS,
integer(gridman_sp), intent(out)  NCELLS,
integer(gridman_sp), intent(out)  NVERTEX,
real(gridman_dp), dimension(:,:), intent(out), allocatable  X,
integer(gridman_sp), dimension(:), intent(out), allocatable  IFIRST,
integer(gridman_sp), dimension(:), intent(out), allocatable  LVERTEX,
integer(gridman_sp), dimension(:), intent(out), allocatable  IVERTEX,
integer, dimension(:), intent(out), allocatable  CTYPE,
integer, intent(out)  IERR 
)

Convert 3D grid into VTK format. Only grid w/o cells is implemented at the moment !!!

Parameters
gridOriginal grid
[out]npointsNumber of points
[out]ncellsNumber of cells
[out]nvertexTotal number of vertices
[out]xArray of coordinates, X(3,NPOINTS)
[out]ifirstFirst index which corresponds to each cell in array IVERTEX, IFIRST(NCELLS)
[out]lvertexNumber of vertices of each cell, LVERTEX(NCELLS)
[out]ivertexList of points (vertices) belonging to each cell, IVERTEX(NVERTEX)
[out]ctypeVTK cell type index, CTYPE(NCELLS)
[out]ierrError code

Definition at line 850 of file vtk.f.

References gridman::gridman_dp, and gridman::gridman_sp.

Referenced by gridman_vtk_grid3d_write().

Here is the caller graph for this function:

subroutine gridman_3dgrid2vtk_index ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(out)  N,
integer, intent(out)  M,
real(gridman_dp), dimension(:,:), intent(out), allocatable  RINDEXES,
character(gridman_length), dimension(:), intent(out), allocatable  SINDEXES,
integer, intent(out)  IERR 
)

Translate edge indices in VTK input in the sense of GRIDMAN_3DGRID2VTK (in the current implementation of GRIDMAN_3DGRID2VTK only grid edges are treated)

Parameters
gridOriginal grid
[out]nNumber of elements in cell scalars array
[out]mNumber of cell scalars arrays
[out]rindexesCells scalars array, RINDEXES(N,M)

This array contains indexes of edges (in current implementation). Zero is used for the elements for which no index is defined.

Parameters
[out]sindexesName of each RINDEXES(:,I), SINDEXES(M)

E<number of index>_<number of column>_<INDEXCOLUMNS>

Parameters
[out]ierrError code

Definition at line 940 of file vtk.f.

References gridman::gridman_dp, gridman_grid_check(), and gridman::gridman_sp.

Referenced by gridman_vtk_grid3d_write().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_vtk_grid3d_write ( character(*), intent(in)  FNAME,
character(*), intent(in)  HEADER,
type(gridman_grid)  GRID,
integer(gridman_sp), intent(in)  NELEMENTS,
integer, intent(in)  NCS,
integer, intent(in)  NCV,
integer, intent(in)  NPS,
integer, intent(in)  NPV,
integer, intent(out)  IERR,
real(gridman_dp), dimension(nelements,ncs), intent(in), optional  CELL_SCALAR,
character(*), dimension(ncs), intent(in), optional  CSNAME,
real(gridman_dp), dimension(3,nelements,ncv), intent(in), optional  CELL_VECTOR,
character(*), dimension(ncv), intent(in), optional  CVNAME,
real(gridman_dp), dimension(grid%npoints,nps), intent(in), optional  POINT_SCALAR,
character(*), dimension(nps), intent(in), optional  PSNAME,
real(gridman_dp), dimension(3,grid%npoints,npv), intent(in), optional  POINT_VECTOR,
character(*), dimension(npv), intent(in), optional  PVNAME 
)

Write 3D grid and data in VTK ASCII legacy format. Only grid w/o cells is implemented at the moment !!!

Interface to GRIDMAN_VTK_WRITE which calls GRIDMAN_3DGRID2VTK

Parameters
[in]fnameName of the output file
[in]headerString with short description of the data set
gridFuller grid object
[in]nelementsFirst dimension of arrays CELL_SCALAR, CELL_VECTOR In current implementation must be equal to GRIDNEDGES
[in]ncsNumber of scalar cell data sets
[in]ncvNumber of vector cell data sets
[in]npsNumber of scalar point data sets
[in]npvNumber of vector point data sets
[out]ierrError code
[in]cell_scalarScalar cell data
[in]csnameNames of the scalar cell data sets
[in]cell_vectorVector cell data
[in]cvnameNames of the vector cell data sets
[in]point_scalarScalar point data
[in]psnameNames of the scalar point data sets
[in]point_vectorVector cell data
[in]pvnameNames of the vector point data sets

Definition at line 1048 of file vtk.f.

References gridman_3dgrid2vtk(), gridman_3dgrid2vtk_index(), gridman::gridman_dp, gridman::gridman_sp, and gridman_vtk_write().

Here is the call graph for this function: