better have one function per task

but separating ageing and forward for the solver is not trivial due to
guessing
This commit is contained in:
Martin Diehl 2019-10-25 07:16:03 +02:00
parent eb4cad17b5
commit cf8b16c066
5 changed files with 52 additions and 14 deletions

View File

@ -163,7 +163,7 @@ subroutine CPFEM_restartWrite
integer(HID_T) :: fileHandle, groupPlastic, groupHomog
write(6,'(a)') 'Writing current constitutive variables for restart to file';flush(6)
write(6,'(a)') ' writing constitutive data required for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','a')

View File

@ -302,9 +302,7 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
if (cutBack) then
C_volAvg = C_volAvgLastInc
else
call CPFEM_age ! age state and kinematics
call utilities_updateCoords(F)
call grid_mech_FEM_age
C_volAvgLastInc = C_volAvg
F_aimDot = merge(stress_BC%maskFloat*(F_aim-F_aim_lastInc)/timeinc_old, 0.0_pReal, guess)
@ -349,6 +347,17 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
end subroutine grid_mech_FEM_forward
!--------------------------------------------------------------------------------------------------
!> @brief Age
!--------------------------------------------------------------------------------------------------
subroutine grid_mech_FEM_age()
call CPFEM_age ! age state and kinematics
call utilities_updateCoords(F)
end subroutine grid_mech_FEM_age
!--------------------------------------------------------------------------------------------------
!> @brief Write current solver and constitutive data for restart to file
!--------------------------------------------------------------------------------------------------
@ -362,7 +371,7 @@ subroutine grid_mech_FEM_restartWrite()
call DMDAVecGetArrayF90(mech_grid,solution_current,u_current,ierr); CHKERRQ(ierr)
call DMDAVecGetArrayF90(mech_grid,solution_lastInc,u_lastInc,ierr); CHKERRQ(ierr)
write(6,'(a)') 'Writing current solver data for restart to file';flush(6)
write(6,'(a)') ' writing solver data required for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')

View File

@ -274,10 +274,7 @@ subroutine grid_mech_spectral_basic_forward(guess,timeinc,timeinc_old,loadCaseTi
C_volAvg = C_volAvgLastInc
C_minMaxAvg = C_minMaxAvgLastInc
else
call CPFEM_age ! age state and kinematics
call utilities_updateCoords(F)
call grid_mech_spectral_basic_age
C_volAvgLastInc = C_volAvg
C_minMaxAvgLastInc = C_minMaxAvg
@ -315,6 +312,22 @@ subroutine grid_mech_spectral_basic_forward(guess,timeinc,timeinc_old,loadCaseTi
end subroutine grid_mech_spectral_basic_forward
!--------------------------------------------------------------------------------------------------
!> @brief Age
!--------------------------------------------------------------------------------------------------
subroutine grid_mech_spectral_basic_age()
PetscErrorCode :: ierr
PetscScalar, dimension(:,:,:,:), pointer :: F
call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr)
call CPFEM_age ! age state and kinematics
call utilities_updateCoords(F)
call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr)
end subroutine grid_mech_spectral_basic_age
!--------------------------------------------------------------------------------------------------
!> @brief Write current solver and constitutive data for restart to file
!--------------------------------------------------------------------------------------------------
@ -327,7 +340,7 @@ subroutine grid_mech_spectral_basic_restartWrite()
call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr)
write(6,'(a)') 'Writing current solver data for restart to file';flush(6)
write(6,'(a)') ' writing solver data required for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')

View File

@ -297,8 +297,7 @@ subroutine grid_mech_spectral_polarisation_forward(guess,timeinc,timeinc_old,loa
C_volAvg = C_volAvgLastInc
C_minMaxAvg = C_minMaxAvgLastInc
else
call CPFEM_age ! age state and kinematics
call utilities_updateCoords(F)
call grid_mech_spectral_polarisation_age
C_volAvgLastInc = C_volAvg
C_minMaxAvgLastInc = C_minMaxAvg
@ -358,6 +357,23 @@ subroutine grid_mech_spectral_polarisation_forward(guess,timeinc,timeinc_old,loa
end subroutine grid_mech_spectral_polarisation_forward
!--------------------------------------------------------------------------------------------------
!> @brief Age
!--------------------------------------------------------------------------------------------------
subroutine grid_mech_spectral_polarisation_age()
PetscErrorCode :: ierr
PetscScalar, dimension(:,:,:,:), pointer :: FandF_tau, F
call DMDAVecGetArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr)
F => FandF_tau(0: 8,:,:,:)
call CPFEM_age ! age state and kinematics
call utilities_updateCoords(F)
call DMDAVecRestoreArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr)
end subroutine grid_mech_spectral_polarisation_age
!--------------------------------------------------------------------------------------------------
!> @brief Write current solver and constitutive data for restart to file
!--------------------------------------------------------------------------------------------------
@ -372,7 +388,7 @@ subroutine grid_mech_spectral_polarisation_restartWrite()
F => FandF_tau(0: 8,:,:,:)
F_tau => FandF_tau(9:17,:,:,:)
write(6,'(a)') 'Writing current solver data for restart to file';flush(6)
write(6,'(a)') ' writing solver data required for restart to file';flush(6)
write(rankStr,'(a1,i0)')'_',worldrank
fileHandle = HDF5_openFile(trim(getSolverJobName())//trim(rankStr)//'.hdf5','w')

View File

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