store grid/size at geometry group

as outlined in the DAMASK results paper
This commit is contained in:
Martin Diehl 2019-05-03 06:46:22 +02:00
parent a881205561
commit ebf01dee4f
3 changed files with 14 additions and 14 deletions

View File

@ -20,14 +20,14 @@ class DADF5():
with h5py.File(filename,'r') as f:
if f.attrs['DADF5-major'] != 0 or f.attrs['DADF5-minor'] != 1:
if f.attrs['DADF5-major'] != 0 or f.attrs['DADF5-minor'] != 2:
raise TypeError('Unsupported DADF5 version {} '.format(f.attrs['DADF5-version']))
self.structured = 'grid' in f['mapping'].attrs.keys()
self.structured = 'grid' in f['geometry'].attrs.keys()
if self.structured:
self.grid = f['mapping'].attrs['grid']
self.size = f['mapping'].attrs['size']
self.grid = f['geometry'].attrs['grid']
self.size = f['geometry'].attrs['size']
r=re.compile('inc[0-9]+')
self.increments = [{'inc': int(u[3:]),

View File

@ -77,6 +77,7 @@ program DAMASK_spectral
use grid_mech_FEM
use grid_damage_spectral
use grid_thermal_spectral
use HDF5_utilities
use results
implicit none
@ -155,8 +156,6 @@ program DAMASK_spectral
write(6,'(/,a)') ' Shanthraj et al., Handbook of Mechanics of Materials, 2019'
write(6,'(a)') ' https://doi.org/10.1007/978-981-10-6855-3_80'
call results_openJobFile()
call results_closeJobFile()
!--------------------------------------------------------------------------------------------------
! initialize field solver information
nActiveFields = 1
@ -301,7 +300,7 @@ program DAMASK_spectral
reportAndCheck: if (worldrank == 0) then
write (loadcase_string, '(i6)' ) currentLoadCase
write(6,'(1x,a,i6)') 'load case: ', currentLoadCase
write(6,'(/,1x,a,i6)') 'load case: ', currentLoadCase
if (.not. newLoadCase%followFormerTrajectory) write(6,'(2x,a)') 'drop guessing along trajectory'
if (newLoadCase%deformation%myType == 'l') then
do j = 1_pInt, 3_pInt
@ -348,10 +347,10 @@ program DAMASK_spectral
if (newLoadCase%time < 0.0_pReal) errorID = 834_pInt ! negative time increment
write(6,'(2x,a,f12.6)') 'time: ', newLoadCase%time
if (newLoadCase%incs < 1_pInt) errorID = 835_pInt ! non-positive incs count
write(6,'(2x,a,i5)') 'increments: ', newLoadCase%incs
write(6,'(2x,a,i5)') 'increments: ', newLoadCase%incs
if (newLoadCase%outputfrequency < 1_pInt) errorID = 836_pInt ! non-positive result frequency
write(6,'(2x,a,i5)') 'output frequency: ', newLoadCase%outputfrequency
write(6,'(2x,a,i5,/)') 'restart frequency: ', newLoadCase%restartfrequency
write(6,'(2x,a,i5)') 'output frequency: ', newLoadCase%outputfrequency
write(6,'(2x,a,i5)') 'restart frequency: ', newLoadCase%restartfrequency
if (errorID > 0_pInt) call IO_error(error_ID = errorID, ext_msg = loadcase_string) ! exit with error message
endif reportAndCheck
loadCases = [loadCases,newLoadCase] ! load case is ok, append it
@ -359,8 +358,9 @@ program DAMASK_spectral
close(fileUnit)
call results_openJobFile
call results_addAttribute('grid',grid,'mapping')
call results_addAttribute('size',geomSize,'mapping')
call HDF5_closeGroup(results_addGroup('geometry'))
call results_addAttribute('grid',grid,'geometry')
call results_addAttribute('size',geomSize,'geometry')
call results_closeJobFile
!--------------------------------------------------------------------------------------------------

View File

@ -66,9 +66,9 @@ subroutine results_init
write(6,'(a)') ' https://doi.org/10.1007/s40192-018-0118-7'
resultsFile = HDF5_openFile(trim(getSolverJobName())//'.hdf5','w',.true.)
call HDF5_addAttribute(resultsFile,'DADF5-version',0.1)
call HDF5_addAttribute(resultsFile,'DADF5-version',0.2)
call HDF5_addAttribute(resultsFile,'DADF5-major',0)
call HDF5_addAttribute(resultsFile,'DADF5-minor',1)
call HDF5_addAttribute(resultsFile,'DADF5-minor',2)
call HDF5_addAttribute(resultsFile,'DAMASK',DAMASKVERSION)
call get_command(commandLine)
call HDF5_addAttribute(resultsFile,'call',trim(commandLine))