This commit is contained in:
Martin Diehl 2021-04-11 09:46:11 +02:00
parent b55e721ec4
commit 547f2ffa69
4 changed files with 13 additions and 16 deletions

View File

@ -218,7 +218,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
logical :: cutBack
real(pReal), dimension(6) :: stress
real(pReal), dimension(6,6) :: ddsdde
integer :: computationMode, i, cp_en, node, CPnodeID
integer :: computationMode, i, node, CPnodeID
integer(pI32) :: defaultNumThreadsInt !< default value set by Marc
integer(pInt), save :: &
@ -266,7 +266,6 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
computationMode = CPFEM_RESTOREJACOBIAN
elseif (lovl == 6) then ! stress requested by marc
computationMode = CPFEM_CALCRESULTS
cp_en = discretization_Marc_FEM2DAMASK_elem(m(1))
if (cptim > theTime .or. inc /= theInc) then ! reached "convergence"
terminallyIll = .false.
cycleCounter = -1 ! first calc step increments this to cycle = 0

View File

@ -74,7 +74,7 @@ subroutine discretization_grid_init(restart)
allocate(materialAt_global(0)) ! needed for IntelMPI
endif
if (grid(1) < 2) call IO_error(844, ext_msg='cells(1) must be larger than 1')
if (grid(1) < 2) call IO_error(844, ext_msg='cells(1) must be larger than 1')
call MPI_Bcast(grid,3,MPI_INTEGER,0,PETSC_COMM_WORLD, ierr)
if (ierr /= 0) error stop 'MPI error'

View File

@ -259,7 +259,6 @@ subroutine formResidual(in,x_scal,f_scal,dummy,ierr)
PetscObject :: dummy
PetscErrorCode :: ierr
integer :: i, j, k, ce
real(pReal) :: mobility
phi_current = x_scal
!--------------------------------------------------------------------------------------------------
@ -281,9 +280,8 @@ subroutine formResidual(in,x_scal,f_scal,dummy,ierr)
ce = 0
do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
ce = ce + 1
mobility = homogenization_mu_phi(ce)
scalarField_real(i,j,k) = params%timeinc*(scalarField_real(i,j,k) + homogenization_f_phi(phi_current(i,j,k),ce)) &
+ mobility*(phi_lastInc(i,j,k) - phi_current(i,j,k)) &
+ homogenization_mu_phi(ce)*(phi_lastInc(i,j,k) - phi_current(i,j,k)) &
+ mu_ref*phi_current(i,j,k)
enddo; enddo; enddo
@ -309,16 +307,16 @@ end subroutine formResidual
!--------------------------------------------------------------------------------------------------
subroutine updateReference
integer :: i,j,k,ce,ierr
integer :: ce,ierr
ce = 0
K_ref = 0.0_pReal
mu_ref = 0.0_pReal
do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
ce = ce + 1
do ce = 1, product(grid(1:2))*grid3
K_ref = K_ref + homogenization_K_phi(ce)
mu_ref = mu_ref + homogenization_mu_phi(ce)
enddo; enddo; enddo
enddo
K_ref = K_ref*wgt
call MPI_Allreduce(MPI_IN_PLACE,K_ref,9,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr)
mu_ref = mu_ref*wgt

View File

@ -302,16 +302,16 @@ end subroutine formResidual
!--------------------------------------------------------------------------------------------------
subroutine updateReference
integer :: i,j,k,ce,ierr
integer :: ce,ierr
ce = 0
K_ref = 0.0_pReal
mu_ref = 0.0_pReal
do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1)
ce = ce + 1
do ce = 1, product(grid(1:2))*grid3
K_ref = K_ref + homogenization_K_T(ce)
mu_ref = mu_ref + homogenization_mu_T(ce)
enddo; enddo; enddo
enddo
K_ref = K_ref*wgt
call MPI_Allreduce(MPI_IN_PLACE,K_ref,9,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr)
mu_ref = mu_ref*wgt