not needed anymore

This commit is contained in:
Martin Diehl 2020-12-07 17:26:50 +01:00
parent 429b84004d
commit 97ee7e6ee5
6 changed files with 4 additions and 121 deletions

View File

@ -12,7 +12,6 @@ module HDF5_utilities
use prec use prec
use parallelization use parallelization
use rotations
implicit none implicit none
public public
@ -37,7 +36,6 @@ module HDF5_utilities
module procedure HDF5_read_int5 module procedure HDF5_read_int5
module procedure HDF5_read_int6 module procedure HDF5_read_int6
module procedure HDF5_read_int7 module procedure HDF5_read_int7
end interface HDF5_read end interface HDF5_read
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -60,9 +58,6 @@ module HDF5_utilities
module procedure HDF5_write_int5 module procedure HDF5_write_int5
module procedure HDF5_write_int6 module procedure HDF5_write_int6
module procedure HDF5_write_int7 module procedure HDF5_write_int7
module procedure HDF5_write_rotation
end interface HDF5_write end interface HDF5_write
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -1663,82 +1658,6 @@ subroutine HDF5_write_int7(loc_id,dataset,datasetName,parallel)
end subroutine HDF5_write_int7 end subroutine HDF5_write_int7
!--------------------------------------------------------------------------------------------------
!> @brief writes a scalar orientation dataset
! ToDo: It might be possible to write the dataset as a whole
! ToDo: We could optionally write out other representations (axis angle, euler, ...)
!--------------------------------------------------------------------------------------------------
subroutine HDF5_write_rotation(loc_id,dataset,datasetName,parallel)
type(rotation), intent(in), dimension(:) :: dataset !< data written to file
integer(HID_T), intent(in) :: loc_id !< file or group handle
character(len=*), intent(in) :: datasetName !< name of the dataset in the file
logical, intent(in), optional :: parallel
integer :: hdferr
real(pReal), dimension(4,size(dataset)) :: dataset_asArray
integer(HID_T) :: dset_id, filespace_id, memspace_id, plist_id,dtype_id,w_id,x_id,y_id,z_id
integer(HSIZE_T), dimension(size(shape(dataset))) :: &
myStart, &
myShape, & !< shape of the dataset (this process)
totalShape !< shape of the dataset (all processes)
integer(SIZE_T) :: type_size_real
integer :: i
do i = 1, size(dataset)
dataset_asArray(1:4,i) = dataset(i)%asQuaternion()
enddo
!---------------------------------------------------------------------------------------------------
! determine shape of dataset
myShape = int(shape(dataset),HSIZE_T)
!---------------------------------------------------------------------------------------------------
! compound type: name of each quaternion component
call h5tget_size_f(H5T_NATIVE_DOUBLE, type_size_real, hdferr)
call h5tcreate_f(H5T_COMPOUND_F, type_size_real*4_SIZE_T, dtype_id, hdferr)
call h5tinsert_f(dtype_id, "w", type_size_real*0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5tinsert_f(dtype_id, "x", type_size_real*1_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5tinsert_f(dtype_id, "y", type_size_real*2_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5tinsert_f(dtype_id, "z", type_size_real*3_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
if (present(parallel)) then
call initialize_write(dset_id, filespace_id, memspace_id, plist_id, &
myStart, totalShape, loc_id,myShape,datasetName,dtype_id,parallel)
else
call initialize_write(dset_id, filespace_id, memspace_id, plist_id, &
myStart, totalShape, loc_id,myShape,datasetName,dtype_id,.false.)
endif
call h5pset_preserve_f(plist_id, .TRUE., hdferr)
if (product(totalShape) /= 0) then
call h5tcreate_f(H5T_COMPOUND_F, type_size_real, x_id, hdferr)
call h5tinsert_f(x_id, "x", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5tcreate_f(H5T_COMPOUND_F, type_size_real, w_id, hdferr)
call h5tinsert_f(w_id, "w", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5tcreate_f(H5T_COMPOUND_F, type_size_real, y_id, hdferr)
call h5tinsert_f(y_id, "y", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5tcreate_f(H5T_COMPOUND_F, type_size_real, z_id, hdferr)
call h5tinsert_f(z_id, "z", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdferr)
call h5dwrite_f(dset_id, w_id,dataset_asArray(1,:),int(totalShape,HSIZE_T), hdferr,&
file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
call h5dwrite_f(dset_id, x_id,dataset_asArray(2,:),int(totalShape,HSIZE_T), hdferr,&
file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
call h5dwrite_f(dset_id, y_id,dataset_asArray(3,:),int(totalShape,HSIZE_T), hdferr,&
file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
call h5dwrite_f(dset_id, z_id,dataset_asArray(4,:),int(totalShape,HSIZE_T), hdferr,&
file_space_id = filespace_id, mem_space_id = memspace_id, xfer_prp = plist_id)
if(hdferr < 0) error stop 'HDF5 error'
endif
call finalize_write(plist_id, dset_id, filespace_id, memspace_id)
end subroutine HDF5_write_rotation
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief initialize HDF5 handles, determines global shape and start for parallel read !> @brief initialize HDF5 handles, determines global shape and start for parallel read
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------

View File

@ -794,7 +794,7 @@ subroutine crystallite_results
end select end select
selected_rotations = select_rotations(crystallite_orientation,p) selected_rotations = select_rotations(crystallite_orientation,p)
call results_writeDataset(group,selected_rotations,output_constituent(p)%label(o),& call results_writeDataset(group,selected_rotations,output_constituent(p)%label(o),&
'crystal orientation as quaternion') 'crystal orientation as quaternion','q_0 <q_1 q_2 q_3>')
call results_addAttribute('Lattice',structureLabel,group//'/'//output_constituent(p)%label(o)) call results_addAttribute('Lattice',structureLabel,group//'/'//output_constituent(p)%label(o))
end select end select
enddo enddo

View File

@ -16,6 +16,7 @@ module grid_mech_FEM
use IO use IO
use HDF5_utilities use HDF5_utilities
use math use math
use rotations
use spectral_utilities use spectral_utilities
use FEsolving use FEsolving
use config use config

View File

@ -16,6 +16,7 @@ module grid_mech_spectral_basic
use IO use IO
use HDF5_utilities use HDF5_utilities
use math use math
use rotations
use spectral_utilities use spectral_utilities
use FEsolving use FEsolving
use config use config

View File

@ -16,6 +16,7 @@ module grid_mech_spectral_polarisation
use IO use IO
use HDF5_utilities use HDF5_utilities
use math use math
use rotations
use spectral_utilities use spectral_utilities
use FEsolving use FEsolving
use config use config

View File

@ -8,7 +8,6 @@ module results
use DAMASK_interface use DAMASK_interface
use parallelization use parallelization
use IO use IO
use rotations
use HDF5_utilities use HDF5_utilities
#ifdef PETSc #ifdef PETSc
use PETSC use PETSC
@ -20,27 +19,21 @@ module results
integer(HID_T) :: resultsFile integer(HID_T) :: resultsFile
interface results_writeDataset interface results_writeDataset
module procedure results_writeTensorDataset_real module procedure results_writeTensorDataset_real
module procedure results_writeVectorDataset_real module procedure results_writeVectorDataset_real
module procedure results_writeScalarDataset_real module procedure results_writeScalarDataset_real
module procedure results_writeTensorDataset_int module procedure results_writeTensorDataset_int
module procedure results_writeVectorDataset_int module procedure results_writeVectorDataset_int
module procedure results_writeScalarDataset_rotation
end interface results_writeDataset end interface results_writeDataset
interface results_addAttribute interface results_addAttribute
module procedure results_addAttribute_real module procedure results_addAttribute_real
module procedure results_addAttribute_int module procedure results_addAttribute_int
module procedure results_addAttribute_str module procedure results_addAttribute_str
module procedure results_addAttribute_int_array module procedure results_addAttribute_int_array
module procedure results_addAttribute_real_array module procedure results_addAttribute_real_array
end interface results_addAttribute end interface results_addAttribute
public :: & public :: &
@ -465,38 +458,6 @@ subroutine results_writeTensorDataset_int(group,dataset,label,description,SIunit
end subroutine results_writeTensorDataset_int end subroutine results_writeTensorDataset_int
!--------------------------------------------------------------------------------------------------
!> @brief stores a scalar dataset in a group
!--------------------------------------------------------------------------------------------------
subroutine results_writeScalarDataset_rotation(group,dataset,label,description,lattice_structure)
character(len=*), intent(in) :: label,group,description
character(len=*), intent(in), optional :: lattice_structure
type(rotation), intent(inout), dimension(:) :: dataset
integer(HID_T) :: groupHandle
groupHandle = results_openGroup(group)
#ifdef PETSc
call HDF5_write(groupHandle,dataset,label,.true.)
#else
call HDF5_write(groupHandle,dataset,label,.false.)
#endif
if (HDF5_objectExists(groupHandle,label)) &
call HDF5_addAttribute(groupHandle,'Description',description,label)
if (HDF5_objectExists(groupHandle,label) .and. present(lattice_structure)) &
call HDF5_addAttribute(groupHandle,'Lattice',lattice_structure,label)
if (HDF5_objectExists(groupHandle,label)) &
call HDF5_addAttribute(groupHandle,'Creator','DAMASK '//DAMASKVERSION,label)
if (HDF5_objectExists(groupHandle,label)) &
call HDF5_addAttribute(groupHandle,'Created',now(),label)
call HDF5_closeGroup(groupHandle)
end subroutine results_writeScalarDataset_rotation
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief adds the unique mapping from spatial position and constituent ID to results !> @brief adds the unique mapping from spatial position and constituent ID to results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------