CPFE2 writes current variables (like grid solvers)

This commit is contained in:
Martin Diehl 2019-10-24 13:06:42 +02:00
parent c1cf64bf00
commit 176f6028cd
6 changed files with 17 additions and 19 deletions

View File

@ -162,30 +162,30 @@ subroutine CPFEM_restartWrite
character(len=32) :: rankStr, PlasticItem, HomogItem character(len=32) :: rankStr, PlasticItem, HomogItem
integer(HID_T) :: fileHandle, groupPlastic, groupHomog integer(HID_T) :: fileHandle, groupPlastic, groupHomog
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) &
write(6,'(a)') '<< CPFEM >> writing restart variables of last converged step to hdf5 file' write(6,'(a)') 'Writing current constitutive variables for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a')
call HDF5_write(fileHandle,crystallite_F0, 'convergedF') call HDF5_write(fileHandle,crystallite_partionedF, 'convergedF')
call HDF5_write(fileHandle,crystallite_Fp0, 'convergedFp') call HDF5_write(fileHandle,crystallite_Fp, 'convergedFp')
call HDF5_write(fileHandle,crystallite_Fi0, 'convergedFi') call HDF5_write(fileHandle,crystallite_Fi, 'convergedFi')
call HDF5_write(fileHandle,crystallite_Lp0, 'convergedLp') call HDF5_write(fileHandle,crystallite_Lp, 'convergedLp')
call HDF5_write(fileHandle,crystallite_Li0, 'convergedLi') call HDF5_write(fileHandle,crystallite_Li, 'convergedLi')
call HDF5_write(fileHandle,crystallite_S0, 'convergedS') call HDF5_write(fileHandle,crystallite_S, 'convergedS')
groupPlastic = HDF5_addGroup(fileHandle,'PlasticPhases') groupPlastic = HDF5_addGroup(fileHandle,'PlasticPhases')
do ph = 1,size(phase_plasticity) do ph = 1,size(phase_plasticity)
write(PlasticItem,*) ph,'_' write(PlasticItem,*) ph,'_'
call HDF5_write(groupPlastic,plasticState(ph)%state0,trim(PlasticItem)//'convergedStateConst') call HDF5_write(groupPlastic,plasticState(ph)%state,trim(PlasticItem)//'convergedStateConst')
enddo enddo
call HDF5_closeGroup(groupPlastic) call HDF5_closeGroup(groupPlastic)
groupHomog = HDF5_addGroup(fileHandle,'HomogStates') groupHomog = HDF5_addGroup(fileHandle,'HomogStates')
do homog = 1, material_Nhomogenization do homog = 1, material_Nhomogenization
write(HomogItem,*) homog,'_' write(HomogItem,*) homog,'_'
call HDF5_write(groupHomog,homogState(homog)%state0,trim(HomogItem)//'convergedStateHomog') call HDF5_write(groupHomog,homogState(homog)%state,trim(HomogItem)//'convergedStateHomog')
enddo enddo
call HDF5_closeGroup(groupHomog) call HDF5_closeGroup(groupHomog)

View File

@ -472,6 +472,7 @@ program DAMASK_spectral
case(FIELD_DAMAGE_ID); call grid_damage_spectral_forward case(FIELD_DAMAGE_ID); call grid_damage_spectral_forward
end select end select
enddo enddo
restartWrite = .false.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! solve fields ! solve fields

View File

@ -307,7 +307,7 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
call utilities_updateCoords(F) call utilities_updateCoords(F)
if (restartWrite) then if (restartWrite) then
write(6,'(/,a)') ' writing converged results for restart';flush(6) write(6,'(a)') 'Writing current solver data for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')
@ -326,7 +326,6 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
call CPFEM_restartWrite call CPFEM_restartWrite
restartWrite = .false.
endif endif
C_volAvgLastInc = C_volAvg C_volAvgLastInc = C_volAvg

View File

@ -286,7 +286,7 @@ subroutine grid_mech_spectral_basic_forward(guess,timeinc,timeinc_old,loadCaseTi
call utilities_updateCoords(F) call utilities_updateCoords(F)
if (restartWrite) then if (restartWrite) then
write(6,'(/,a)') ' writing converged results for restart';flush(6) write(6,'(a)') 'Writing current solver data for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')
@ -304,7 +304,6 @@ subroutine grid_mech_spectral_basic_forward(guess,timeinc,timeinc_old,loadCaseTi
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
call CPFEM_restartWrite call CPFEM_restartWrite
restartWrite = .false.
endif endif
C_volAvgLastInc = C_volAvg C_volAvgLastInc = C_volAvg

View File

@ -307,7 +307,7 @@ subroutine grid_mech_spectral_polarisation_forward(guess,timeinc,timeinc_old,loa
call utilities_updateCoords(F) call utilities_updateCoords(F)
if (restartWrite) then if (restartWrite) then
write(6,'(/,a)') ' writing converged results for restart';flush(6) write(6,'(a)') 'Writing current solver data for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w') fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')
@ -326,7 +326,6 @@ subroutine grid_mech_spectral_polarisation_forward(guess,timeinc,timeinc_old,loa
call HDF5_closeFile(fileHandle) call HDF5_closeFile(fileHandle)
call CPFEM_restartWrite call CPFEM_restartWrite
restartWrite = .false.
endif endif
C_volAvgLastInc = C_volAvg C_volAvgLastInc = C_volAvg

View File

@ -1130,10 +1130,10 @@ subroutine utilities_saveReferenceStiffness
fileUnit fileUnit
if (worldrank == 0) then if (worldrank == 0) then
write(6,'(/,a)') ' writing reference stiffness to file' write(6,'(a)') 'Writing current reference stiffness for restart to file';flush(6)
flush(6)
fileUnit = IO_open_jobFile_binary('C_ref','w') fileUnit = IO_open_jobFile_binary('C_ref','w')
write(fileUnit) C_ref; close(fileUnit) write(fileUnit) C_ref
close(fileUnit)
endif endif
end subroutine utilities_saveReferenceStiffness end subroutine utilities_saveReferenceStiffness