grid_mech_FEM works
This commit is contained in:
parent
5989075009
commit
1852f580ad
|
@ -7,6 +7,8 @@
|
|||
module grid_mech_FEM
|
||||
#include <petsc/finclude/petscsnes.h>
|
||||
#include <petsc/finclude/petscdmda.h>
|
||||
use DAMASK_interface
|
||||
use HDF5_utilities
|
||||
use PETScdmda
|
||||
use PETScsnes
|
||||
use prec, only: &
|
||||
|
@ -115,6 +117,7 @@ subroutine grid_mech_FEM_init
|
|||
PetscErrorCode :: ierr
|
||||
integer(pInt) :: rank
|
||||
integer :: fileUnit
|
||||
integer(HID_T) :: fileHandle
|
||||
character(len=1024) :: rankStr
|
||||
real(pReal), dimension(3,3,3,3) :: devNull
|
||||
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
||||
|
@ -203,24 +206,16 @@ subroutine grid_mech_FEM_init
|
|||
restart: if (restartInc > 0) then
|
||||
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') 'reading values of increment ', restartInc, ' from file'
|
||||
|
||||
fileUnit = IO_open_jobFile_binary('F_aim')
|
||||
read(fileUnit) F_aim; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_aim_lastInc')
|
||||
read(fileUnit) F_aim_lastInc; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_aimDot')
|
||||
read(fileUnit) F_aimDot; close(fileUnit)
|
||||
|
||||
write(rankStr,'(a1,i0)')'_',worldrank
|
||||
|
||||
fileUnit = IO_open_jobFile_binary('F'//trim(rankStr))
|
||||
read(fileUnit) F; close (fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_lastInc'//trim(rankStr))
|
||||
read(fileUnit) F_lastInc; close (fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('u'//trim(rankStr))
|
||||
read(fileUnit) u_current; close (fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('u_lastInc'//trim(rankStr))
|
||||
read(fileUnit) u_lastInc; close (fileUnit)
|
||||
|
||||
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5')
|
||||
call HDF5_read(fileHandle,F_aim, 'F_aim')
|
||||
call HDF5_read(fileHandle,F_aim_lastInc,'F_aim_lastInc')
|
||||
call HDF5_read(fileHandle,F_aimDot, 'F_aimDot')
|
||||
call HDF5_read(fileHandle,F, 'F')
|
||||
call HDF5_read(fileHandle,F_lastInc, 'F_lastInc')
|
||||
call HDF5_read(fileHandle,u_current, 'u')
|
||||
call HDF5_read(fileHandle,u_lastInc, 'u_lastInc')
|
||||
|
||||
elseif (restartInc == 0) then restart
|
||||
F_lastInc = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3) ! initialize to identity
|
||||
F = spread(spread(spread(math_I3,3,grid(1)),4,grid(2)),5,grid3)
|
||||
|
@ -238,10 +233,9 @@ subroutine grid_mech_FEM_init
|
|||
|
||||
restartRead: if (restartInc > 0_pInt) then
|
||||
write(6,'(/,a,'//IO_intOut(restartInc)//',a)') 'reading more values of increment ', restartInc, ' from file'
|
||||
fileUnit = IO_open_jobFile_binary('C_volAvg')
|
||||
read(fileUnit) C_volAvg; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('C_volAvgLastInv')
|
||||
read(fileUnit) C_volAvgLastInc; close(fileUnit)
|
||||
call HDF5_read(fileHandle,C_volAvg, 'C_volAvg')
|
||||
call HDF5_read(fileHandle,C_volAvgLastInc,'C_volAvgLastInc')
|
||||
call HDF5_closeFile(fileHandle)
|
||||
endif restartRead
|
||||
|
||||
end subroutine grid_mech_FEM_init
|
||||
|
@ -348,6 +342,7 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
|
|||
real(pReal), dimension(3,3), intent(in) :: &
|
||||
rotation_BC
|
||||
PetscErrorCode :: ierr
|
||||
integer(HID_T) :: fileHandle
|
||||
integer :: fileUnit
|
||||
character(len=32) :: rankStr
|
||||
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
||||
|
@ -364,30 +359,23 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
|
|||
if (restartWrite) then ! QUESTION: where is this logical properly set?
|
||||
write(6,'(/,a)') ' writing converged results for restart'
|
||||
flush(6)
|
||||
|
||||
write(rankStr,'(a1,i0)')'_',worldrank
|
||||
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')
|
||||
|
||||
if (worldrank == 0) then
|
||||
fileUnit = IO_open_jobFile_binary('C_volAvg','w')
|
||||
write(fileUnit) C_volAvg; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('C_volAvgLastInv','w')
|
||||
write(fileUnit) C_volAvgLastInc; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_aim','w')
|
||||
write(fileUnit) F_aim; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_aim_lastInc','w')
|
||||
write(fileUnit) F_aim_lastInc; close(fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_aimDot','w')
|
||||
write(fileUnit) F_aimDot; close(fileUnit)
|
||||
call HDF5_write(fileHandle,C_volAvg, 'C_volAvg')
|
||||
call HDF5_write(fileHandle,C_volAvgLastInc,'C_volAvgLastInc')
|
||||
call HDF5_write(fileHandle,F_aim, 'F_aim')
|
||||
call HDF5_write(fileHandle,F_aim_lastInc, 'F_aim_lastInc')
|
||||
call HDF5_write(fileHandle,F_aimDot, 'F_aimDot')
|
||||
call HDF5_write(fileHandle,F, 'F')
|
||||
call HDF5_write(fileHandle,F_lastInc, 'F_lastInc')
|
||||
call HDF5_write(fileHandle,u_current, 'u')
|
||||
call HDF5_write(fileHandle,u_lastInc, 'u_lastInc')
|
||||
call HDF5_closeFile(fileHandle)
|
||||
endif
|
||||
|
||||
write(rankStr,'(a1,i0)')'_',worldrank
|
||||
fileUnit = IO_open_jobFile_binary('F'//trim(rankStr),'w')
|
||||
write(fileUnit) F; close (fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('F_lastInc'//trim(rankStr),'w')
|
||||
write(fileUnit) F_lastInc; close (fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('u'//trim(rankStr),'w')
|
||||
write(fileUnit) u_current; close (fileUnit)
|
||||
fileUnit = IO_open_jobFile_binary('u_lastInc'//trim(rankStr),'w')
|
||||
write(fileUnit) u_lastInc; close (fileUnit)
|
||||
|
||||
endif
|
||||
call CPFEM_age() ! age state and kinematics
|
||||
call utilities_updateIPcoords(F)
|
||||
|
|
Loading…
Reference in New Issue