trying to get rid of a global "restartWrite" variable
This commit is contained in:
parent
aace0d3fae
commit
9db5cbb667
|
@ -302,7 +302,7 @@ subroutine grid_mech_FEM_forward(guess,timeinc,timeinc_old,loadCaseTime,deformat
|
||||||
if (cutBack) then
|
if (cutBack) then
|
||||||
C_volAvg = C_volAvgLastInc
|
C_volAvg = C_volAvgLastInc
|
||||||
else
|
else
|
||||||
if (restartWrite) call grid_mech_FEM_restartWrite
|
call grid_mech_FEM_restartWrite
|
||||||
call CPFEM_age ! age state and kinematics
|
call CPFEM_age ! age state and kinematics
|
||||||
call utilities_updateCoords(F)
|
call utilities_updateCoords(F)
|
||||||
|
|
||||||
|
@ -360,6 +360,8 @@ subroutine grid_mech_FEM_restartWrite()
|
||||||
integer(HID_T) :: fileHandle
|
integer(HID_T) :: fileHandle
|
||||||
character(len=32) :: rankStr
|
character(len=32) :: rankStr
|
||||||
|
|
||||||
|
if(.not. restartWrite) return
|
||||||
|
|
||||||
call DMDAVecGetArrayF90(mech_grid,solution_current,u_current,ierr); CHKERRQ(ierr)
|
call DMDAVecGetArrayF90(mech_grid,solution_current,u_current,ierr); CHKERRQ(ierr)
|
||||||
call DMDAVecGetArrayF90(mech_grid,solution_lastInc,u_lastInc,ierr); CHKERRQ(ierr)
|
call DMDAVecGetArrayF90(mech_grid,solution_lastInc,u_lastInc,ierr); CHKERRQ(ierr)
|
||||||
|
|
||||||
|
@ -564,7 +566,7 @@ subroutine formJacobian(da_local,x_local,Jac_pre,Jac,dummy,ierr)
|
||||||
PetscScalar,dimension(24,24) :: K_ele
|
PetscScalar,dimension(24,24) :: K_ele
|
||||||
PetscScalar,dimension(9,24) :: BMatFull
|
PetscScalar,dimension(9,24) :: BMatFull
|
||||||
PetscInt :: i, ii, j, jj, k, kk, ctr, ele
|
PetscInt :: i, ii, j, jj, k, kk, ctr, ele
|
||||||
PetscInt,dimension(3) :: rows
|
PetscInt,dimension(3),parameter :: rows = [0, 1, 2]
|
||||||
PetscScalar :: diag
|
PetscScalar :: diag
|
||||||
PetscObject :: dummy
|
PetscObject :: dummy
|
||||||
MatNullSpace :: matnull
|
MatNullSpace :: matnull
|
||||||
|
@ -621,7 +623,6 @@ subroutine formJacobian(da_local,x_local,Jac_pre,Jac,dummy,ierr)
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! applying boundary conditions
|
! applying boundary conditions
|
||||||
rows = [0, 1, 2]
|
|
||||||
diag = (C_volAvg(1,1,1,1)/delta(1)**2.0_pReal + &
|
diag = (C_volAvg(1,1,1,1)/delta(1)**2.0_pReal + &
|
||||||
C_volAvg(2,2,2,2)/delta(2)**2.0_pReal + &
|
C_volAvg(2,2,2,2)/delta(2)**2.0_pReal + &
|
||||||
C_volAvg(3,3,3,3)/delta(3)**2.0_pReal)*detJ
|
C_volAvg(3,3,3,3)/delta(3)**2.0_pReal)*detJ
|
||||||
|
|
|
@ -78,7 +78,6 @@ module grid_mech_spectral_basic
|
||||||
grid_mech_spectral_basic_forward, &
|
grid_mech_spectral_basic_forward, &
|
||||||
grid_mech_spectral_basic_restartWrite
|
grid_mech_spectral_basic_restartWrite
|
||||||
|
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -222,10 +221,7 @@ function grid_mech_spectral_basic_solution(incInfoIn,timeinc,timeinc_old,stress_
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! update stiffness (and gamma operator)
|
! update stiffness (and gamma operator)
|
||||||
S = utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg)
|
S = utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg)
|
||||||
if (num%update_gamma) then
|
if (num%update_gamma) call utilities_updateGamma(C_minMaxAvg)
|
||||||
call utilities_updateGamma(C_minMaxAvg)
|
|
||||||
if(restartWrite) call utilities_saveReferenceStiffness
|
|
||||||
endif
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! set module wide available data
|
! set module wide available data
|
||||||
|
@ -328,6 +324,8 @@ subroutine grid_mech_spectral_basic_restartWrite()
|
||||||
PetscScalar, dimension(:,:,:,:), pointer :: F
|
PetscScalar, dimension(:,:,:,:), pointer :: F
|
||||||
integer(HID_T) :: fileHandle
|
integer(HID_T) :: fileHandle
|
||||||
character(len=32) :: rankStr
|
character(len=32) :: rankStr
|
||||||
|
|
||||||
|
if(.not. restartWrite) return
|
||||||
|
|
||||||
call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr)
|
call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr)
|
||||||
|
|
||||||
|
@ -347,6 +345,8 @@ subroutine grid_mech_spectral_basic_restartWrite()
|
||||||
call HDF5_write(fileHandle,C_minMaxAvg, 'C_minMaxAvg')
|
call HDF5_write(fileHandle,C_minMaxAvg, 'C_minMaxAvg')
|
||||||
|
|
||||||
call HDF5_closeFile(fileHandle)
|
call HDF5_closeFile(fileHandle)
|
||||||
|
|
||||||
|
if (num%update_gamma) call utilities_saveReferenceStiffness
|
||||||
|
|
||||||
call CPFEM_restartWrite
|
call CPFEM_restartWrite
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,6 @@ function grid_mech_spectral_polarisation_solution(incInfoIn,timeinc,timeinc_old,
|
||||||
S = utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg)
|
S = utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg)
|
||||||
if (num%update_gamma) then
|
if (num%update_gamma) then
|
||||||
call utilities_updateGamma(C_minMaxAvg)
|
call utilities_updateGamma(C_minMaxAvg)
|
||||||
if(restartWrite) call utilities_saveReferenceStiffness
|
|
||||||
C_scale = C_minMaxAvg
|
C_scale = C_minMaxAvg
|
||||||
S_scale = math_invSym3333(C_minMaxAvg)
|
S_scale = math_invSym3333(C_minMaxAvg)
|
||||||
endif
|
endif
|
||||||
|
@ -369,6 +368,8 @@ subroutine grid_mech_spectral_polarisation_restartWrite()
|
||||||
PetscScalar, dimension(:,:,:,:), pointer :: FandF_tau, F, F_tau
|
PetscScalar, dimension(:,:,:,:), pointer :: FandF_tau, F, F_tau
|
||||||
integer(HID_T) :: fileHandle
|
integer(HID_T) :: fileHandle
|
||||||
character(len=32) :: rankStr
|
character(len=32) :: rankStr
|
||||||
|
|
||||||
|
if(.not. restartWrite) return
|
||||||
|
|
||||||
call DMDAVecGetArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr)
|
call DMDAVecGetArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr)
|
||||||
F => FandF_tau(0: 8,:,:,:)
|
F => FandF_tau(0: 8,:,:,:)
|
||||||
|
@ -392,6 +393,8 @@ subroutine grid_mech_spectral_polarisation_restartWrite()
|
||||||
|
|
||||||
call HDF5_closeFile(fileHandle)
|
call HDF5_closeFile(fileHandle)
|
||||||
|
|
||||||
|
if (num%update_gamma) call utilities_saveReferenceStiffness
|
||||||
|
|
||||||
call CPFEM_restartWrite
|
call CPFEM_restartWrite
|
||||||
|
|
||||||
call DMDAVecRestoreArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr)
|
call DMDAVecRestoreArrayF90(da,solution_vec,FandF_tau,ierr); CHKERRQ(ierr)
|
||||||
|
|
Loading…
Reference in New Issue