From 52a0f0aaa9a5197a3641985ad304f8ac49fb71bb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 18 Mar 2021 08:02:12 +0100 Subject: [PATCH 1/3] hickup --- src/phase_mechanical.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index e642b22ef..9da8c49ab 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -561,7 +561,7 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken) cycle LpLoop endif - calculateJacobiLi: if (mod(jacoCounterLp, num%iJacoLpresiduum) == 0) then + calculateJacobiLp: if (mod(jacoCounterLp, num%iJacoLpresiduum) == 0) then jacoCounterLp = jacoCounterLp + 1 do o=1,3; do p=1,3 @@ -573,7 +573,7 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken) call dgesv(9,1,dRLp_dLp,9,devNull_9,temp_9,9,ierr) ! solve dRLp/dLp * delta Lp = -res for delta Lp if (ierr /= 0) return ! error deltaLp = - math_9to33(temp_9) - endif calculateJacobiLi + endif calculateJacobiLp Lpguess = Lpguess & + deltaLp * steplengthLp @@ -601,7 +601,7 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken) cycle LiLoop endif - calculateJacobiLp: if (mod(jacoCounterLi, num%iJacoLpresiduum) == 0) then + calculateJacobiLi: if (mod(jacoCounterLi, num%iJacoLpresiduum) == 0) then jacoCounterLi = jacoCounterLi + 1 temp_33 = matmul(matmul(A,B),invFi_current) @@ -620,7 +620,7 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken) call dgesv(9,1,dRLi_dLi,9,devNull_9,temp_9,9,ierr) ! solve dRLi/dLp * delta Li = -res for delta Li if (ierr /= 0) return ! error deltaLi = - math_9to33(temp_9) - endif calculateJacobiLp + endif calculateJacobiLi Liguess = Liguess & + deltaLi * steplengthLi From b174473373b349ba3863d8549f403fac2cbea63a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 18 Mar 2021 08:03:56 +0100 Subject: [PATCH 2/3] no need to duplicated check --- src/homogenization.f90 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index f6ca104ae..6e9d492c8 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -288,19 +288,17 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE NiterationMPstate = NiterationMPstate + 1 - if (.not. doneAndHappy(1)) then - call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) - converged = .true. - do co = 1, myNgrains - converged = converged .and. crystallite_stress(dt,co,ip,el) - enddo + call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) + converged = .true. + do co = 1, myNgrains + converged = converged .and. crystallite_stress(dt,co,ip,el) + enddo - if (.not. converged) then - doneAndHappy = [.true.,.false.] - else - doneAndHappy = mechanical_updateState(dt,homogenization_F(1:3,1:3,ce),ce) - converged = all(doneAndHappy) - endif + if (.not. converged) then + doneAndHappy = [.true.,.false.] + else + doneAndHappy = mechanical_updateState(dt,homogenization_F(1:3,1:3,ce),ce) + converged = all(doneAndHappy) endif enddo convergenceLooping From 9896a01ea4f7030fc11e29518887755e3e8b8de1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 18 Mar 2021 08:07:10 +0100 Subject: [PATCH 3/3] easier to read --- src/homogenization.f90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 6e9d492c8..0cd514c08 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -287,18 +287,17 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE .and. NiterationMPstate < num%nMPstate) NiterationMPstate = NiterationMPstate + 1 - call mechanical_partition(homogenization_F(1:3,1:3,ce),ce) converged = .true. do co = 1, myNgrains converged = converged .and. crystallite_stress(dt,co,ip,el) enddo - if (.not. converged) then - doneAndHappy = [.true.,.false.] - else + if (converged) then doneAndHappy = mechanical_updateState(dt,homogenization_F(1:3,1:3,ce),ce) converged = all(doneAndHappy) + else + doneAndHappy = [.true.,.false.] endif enddo convergenceLooping