shorter names (w/o loss of clarity)
This commit is contained in:
parent
802957f61e
commit
f7b18981c9
|
@ -1,8 +1,8 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @author Martin Diehl, KU Leuven
|
!> @author Martin Diehl, KU Leuven
|
||||||
!> @brief Read file data from the Visualization toolkit
|
!> @brief Read data from image files of the visualization toolkit.
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module VTK
|
module VTI
|
||||||
use prec
|
use prec
|
||||||
use zlib
|
use zlib
|
||||||
use base64
|
use base64
|
||||||
|
@ -12,8 +12,8 @@ module VTK
|
||||||
private
|
private
|
||||||
|
|
||||||
public :: &
|
public :: &
|
||||||
VTK_readVTIdataset_int, &
|
VTI_readDataset_int, &
|
||||||
VTK_readVTI_cellsSizeOrigin
|
VTI_readCellsSizeOrigin
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ contains
|
||||||
!> @brief Read integer dataset from a VTK image data (*.vti) file.
|
!> @brief Read integer dataset from a VTK image data (*.vti) file.
|
||||||
!> @details https://vtk.org/Wiki/VTK_XML_Formats
|
!> @details https://vtk.org/Wiki/VTK_XML_Formats
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
function VTK_readVTIdataset_int(fileContent,label) result(dataset)
|
function VTI_readDataset_int(fileContent,label) result(dataset)
|
||||||
|
|
||||||
character(len=*), intent(in) :: &
|
character(len=*), intent(in) :: &
|
||||||
label, &
|
label, &
|
||||||
|
@ -33,20 +33,20 @@ function VTK_readVTIdataset_int(fileContent,label) result(dataset)
|
||||||
logical :: compressed
|
logical :: compressed
|
||||||
|
|
||||||
|
|
||||||
call VTK_readVTIdataset_raw(base64_str,dataType,headerType,compressed, &
|
call VTI_readDataset_raw(base64_str,dataType,headerType,compressed, &
|
||||||
fileContent,label)
|
fileContent,label)
|
||||||
dataset = as_Int(base64_str,headerType,compressed,dataType)
|
dataset = as_Int(base64_str,headerType,compressed,dataType)
|
||||||
|
|
||||||
if (.not. allocated(dataset)) call IO_error(error_ID = 844, ext_msg='dataset "'//label//'" not found')
|
if (.not. allocated(dataset)) call IO_error(error_ID = 844, ext_msg='dataset "'//label//'" not found')
|
||||||
|
|
||||||
end function VTK_readVTIdataset_int
|
end function VTI_readDataset_int
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Read dataset as raw data (base64 string) from a VTK image data (*.vti) file.
|
!> @brief Read dataset as raw data (base64 string) from a VTK image data (*.vti) file.
|
||||||
!> @details https://vtk.org/Wiki/VTK_XML_Formats
|
!> @details https://vtk.org/Wiki/VTK_XML_Formats
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine VTK_readVTIdataset_raw(base64_str,dataType,headerType,compressed, &
|
subroutine VTI_readDataset_raw(base64_str,dataType,headerType,compressed, &
|
||||||
fileContent,label)
|
fileContent,label)
|
||||||
|
|
||||||
character(len=*), intent(in) :: &
|
character(len=*), intent(in) :: &
|
||||||
|
@ -107,14 +107,14 @@ subroutine VTK_readVTIdataset_raw(base64_str,dataType,headerType,compressed, &
|
||||||
|
|
||||||
end do outer
|
end do outer
|
||||||
|
|
||||||
end subroutine VTK_readVTIdataset_raw
|
end subroutine VTI_readDataset_raw
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Read cells, size, and origin of an VTK image data (*.vti) file.
|
!> @brief Read cells, size, and origin of an VTK image data (*.vti) file.
|
||||||
!> @details https://vtk.org/Wiki/VTK_XML_Formats
|
!> @details https://vtk.org/Wiki/VTK_XML_Formats
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine VTK_readVTI_cellsSizeOrigin(cells,geomSize,origin, &
|
subroutine VTI_readCellsSizeOrigin(cells,geomSize,origin, &
|
||||||
fileContent)
|
fileContent)
|
||||||
|
|
||||||
integer, dimension(3), intent(out) :: &
|
integer, dimension(3), intent(out) :: &
|
||||||
|
@ -166,7 +166,7 @@ subroutine VTK_readVTI_cellsSizeOrigin(cells,geomSize,origin, &
|
||||||
if (any(geomSize<=0)) call IO_error(error_ID = 844, ext_msg='size')
|
if (any(geomSize<=0)) call IO_error(error_ID = 844, ext_msg='size')
|
||||||
if (any(cells<1)) call IO_error(error_ID = 844, ext_msg='cells')
|
if (any(cells<1)) call IO_error(error_ID = 844, ext_msg='cells')
|
||||||
|
|
||||||
end subroutine VTK_readVTI_cellsSizeOrigin
|
end subroutine VTI_readCellsSizeOrigin
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -417,4 +417,4 @@ pure function fileFormatOk(line)
|
||||||
|
|
||||||
end function fileFormatOk
|
end function fileFormatOk
|
||||||
|
|
||||||
end module VTK
|
end module VTI
|
|
@ -14,7 +14,7 @@ module discretization_grid
|
||||||
use prec
|
use prec
|
||||||
use parallelization
|
use parallelization
|
||||||
use system_routines
|
use system_routines
|
||||||
use VTK
|
use VTI
|
||||||
use DAMASK_interface
|
use DAMASK_interface
|
||||||
use IO
|
use IO
|
||||||
use config
|
use config
|
||||||
|
@ -76,8 +76,8 @@ subroutine discretization_grid_init(restart)
|
||||||
|
|
||||||
if (worldrank == 0) then
|
if (worldrank == 0) then
|
||||||
fileContent = IO_read(interface_geomFile)
|
fileContent = IO_read(interface_geomFile)
|
||||||
call VTK_readVTI_cellsSizeOrigin(cells,geomSize,origin,fileContent)
|
call VTI_readCellsSizeOrigin(cells,geomSize,origin,fileContent)
|
||||||
materialAt_global = VTK_readVTIdataset_int(fileContent,'material') + 1
|
materialAt_global = VTI_readDataset_int(fileContent,'material') + 1
|
||||||
if (any(materialAt_global < 1)) &
|
if (any(materialAt_global < 1)) &
|
||||||
call IO_error(180,ext_msg='material ID < 1')
|
call IO_error(180,ext_msg='material ID < 1')
|
||||||
if (size(materialAt_global) /= product(cells)) &
|
if (size(materialAt_global) /= product(cells)) &
|
||||||
|
|
Loading…
Reference in New Issue