use specialized functions

This commit is contained in:
Martin Diehl 2020-01-02 21:18:56 +01:00
parent c919237998
commit e1168c09b9
4 changed files with 51 additions and 32 deletions

View File

@ -17,7 +17,6 @@ module CPFEM2
use DAMASK_interface
use results
use discretization
use HDF5
use HDF5_utilities
use homogenization
use constitutive

View File

@ -11,7 +11,6 @@ module constitutive
use config
use material
use results
use HDF5_utilities
use lattice
use discretization
use plastic_none
@ -587,11 +586,11 @@ subroutine constitutive_results
character(len=pStringLen) :: group
do p=1,size(config_name_phase)
group = trim('current/constituent')//'/'//trim(config_name_phase(p))
call HDF5_closeGroup(results_addGroup(group))
call results_closeGroup(results_addGroup(group))
group = trim(group)//'/plastic'
call HDF5_closeGroup(results_addGroup(group))
call results_closeGroup(results_addGroup(group))
select case(phase_plasticity(p))
case(PLASTICITY_ISOTROPIC_ID)

View File

@ -10,7 +10,7 @@ subroutine quit(stop_id)
#ifdef _OPENMP
use MPI
#endif
use hdf5
use HDF5
implicit none
integer, intent(in) :: stop_id

View File

@ -68,14 +68,14 @@ subroutine results_init
write(6,'(a)') ' https://doi.org/10.1007/s40192-017-0084-5'
resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.)
call HDF5_addAttribute(resultsFile,'DADF5_version_major',0)
call HDF5_addAttribute(resultsFile,'DADF5_version_minor',5)
call HDF5_addAttribute(resultsFile,'DAMASK_version',DAMASKVERSION)
call results_addAttribute('DADF5_version_major',0)
call results_addAttribute('DADF5_version_minor',5)
call results_addAttribute('DAMASK_version',DAMASKVERSION)
call get_command(commandLine)
call HDF5_addAttribute(resultsFile,'call',trim(commandLine))
call HDF5_closeGroup(results_addGroup('mapping'))
call HDF5_closeGroup(results_addGroup('mapping/cellResults'))
call HDF5_closeFile(resultsFile)
call results_addAttribute('call',trim(commandLine))
call results_closeGroup(results_addGroup('mapping'))
call results_closeGroup(results_addGroup('mapping/cellResults'))
call results_closeJobFile
end subroutine results_init
@ -110,12 +110,11 @@ subroutine results_addIncrement(inc,time)
character(len=pStringLen) :: incChar
write(incChar,'(i10)') inc
call HDF5_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar)))))
call results_closeGroup(results_addGroup(trim('inc'//trim(adjustl(incChar)))))
call results_setLink(trim('inc'//trim(adjustl(incChar))),'current')
call HDF5_addAttribute(resultsFile,'time/s',time,trim('inc'//trim(adjustl(incChar))))
call HDF5_closeGroup(results_addGroup('current/constituent'))
call HDF5_closeGroup(results_addGroup('current/materialpoint'))
call results_addAttribute('time/s',time,trim('inc'//trim(adjustl(incChar))))
call results_closeGroup(results_addGroup('current/constituent'))
call results_closeGroup(results_addGroup('current/materialpoint'))
end subroutine results_addIncrement
@ -173,9 +172,14 @@ end subroutine results_setLink
!--------------------------------------------------------------------------------------------------
subroutine results_addAttribute_str(attrLabel,attrValue,path)
character(len=*), intent(in) :: attrLabel, attrValue, path
character(len=*), intent(in) :: attrLabel, attrValue
character(len=*), intent(in), optional :: path
if (present(path)) then
call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path)
else
call HDF5_addAttribute(resultsFile,attrLabel, attrValue)
endif
end subroutine results_addAttribute_str
@ -185,10 +189,15 @@ end subroutine results_addAttribute_str
!--------------------------------------------------------------------------------------------------
subroutine results_addAttribute_int(attrLabel,attrValue,path)
character(len=*), intent(in) :: attrLabel, path
character(len=*), intent(in) :: attrLabel
integer, intent(in) :: attrValue
character(len=*), intent(in), optional :: path
if (present(path)) then
call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path)
else
call HDF5_addAttribute(resultsFile,attrLabel, attrValue)
endif
end subroutine results_addAttribute_int
@ -198,10 +207,15 @@ end subroutine results_addAttribute_int
!--------------------------------------------------------------------------------------------------
subroutine results_addAttribute_real(attrLabel,attrValue,path)
character(len=*), intent(in) :: attrLabel, path
character(len=*), intent(in) :: attrLabel
real(pReal), intent(in) :: attrValue
character(len=*), intent(in), optional :: path
if (present(path)) then
call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path)
else
call HDF5_addAttribute(resultsFile,attrLabel, attrValue)
endif
end subroutine results_addAttribute_real
@ -211,10 +225,15 @@ end subroutine results_addAttribute_real
!--------------------------------------------------------------------------------------------------
subroutine results_addAttribute_int_array(attrLabel,attrValue,path)
character(len=*), intent(in) :: attrLabel, path
character(len=*), intent(in) :: attrLabel
integer, intent(in), dimension(:) :: attrValue
character(len=*), intent(in), optional :: path
if (present(path)) then
call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path)
else
call HDF5_addAttribute(resultsFile,attrLabel, attrValue)
endif
end subroutine results_addAttribute_int_array
@ -224,10 +243,15 @@ end subroutine results_addAttribute_int_array
!--------------------------------------------------------------------------------------------------
subroutine results_addAttribute_real_array(attrLabel,attrValue,path)
character(len=*), intent(in) :: attrLabel, path
character(len=*), intent(in) :: attrLabel
real(pReal), intent(in), dimension(:) :: attrValue
character(len=*), intent(in), optional :: path
if (present(path)) then
call HDF5_addAttribute(resultsFile,attrLabel, attrValue, path)
else
call HDF5_addAttribute(resultsFile,attrLabel, attrValue)
endif
end subroutine results_addAttribute_real_array
@ -720,7 +744,6 @@ end subroutine results_mapping_materialpoint
!!> @brief adds the backward mapping from spatial position and constituent ID to results
!!--------------------------------------------------------------------------------------------------
!subroutine HDF5_backwardMappingPhase(material_phase,phasememberat,phase_name,dataspace_size,mpiOffset,mpiOffset_phase)
! use hdf5
! integer(pInt), intent(in), dimension(:,:,:) :: material_phase, phasememberat
! character(len=*), intent(in), dimension(:) :: phase_name
@ -834,7 +857,6 @@ end subroutine results_mapping_materialpoint
!!> @brief adds the backward mapping from spatial position and constituent ID to results
!!--------------------------------------------------------------------------------------------------
!subroutine HDF5_backwardMappingHomog(material_homog,homogmemberat,homogenization_name,dataspace_size,mpiOffset,mpiOffset_homog)
! use hdf5
! integer(pInt), intent(in), dimension(:,:) :: material_homog, homogmemberat
! character(len=*), intent(in), dimension(:) :: homogenization_name
@ -941,7 +963,6 @@ end subroutine results_mapping_materialpoint
!!> @brief adds the unique cell to node mapping
!!--------------------------------------------------------------------------------------------------
!subroutine HDF5_mappingCells(mapping)
! use hdf5
! integer(pInt), intent(in), dimension(:) :: mapping