added NAssi-Schneidermann-Diagrams to the documentation for better understanding. Also reordered the declaration of variables in the corresponding function in crystallite.f90
This commit is contained in:
parent
364bacf568
commit
e5311476c0
|
@ -548,67 +548,93 @@ endsubroutine
|
||||||
i,& ! integration point number
|
i,& ! integration point number
|
||||||
e) ! element number
|
e) ! element number
|
||||||
|
|
||||||
use prec
|
!*** variables and functions from other modules ***!
|
||||||
use debug
|
use prec, only: pReal, &
|
||||||
use constitutive, only: constitutive_microstructure, &
|
pInt, &
|
||||||
constitutive_homogenizedC, &
|
nStress, &
|
||||||
constitutive_LpAndItsTangent
|
aTol_crystalliteStress, &
|
||||||
use math
|
rTol_crystalliteStress, &
|
||||||
|
relevantStrain
|
||||||
|
use debug, only: debugger, &
|
||||||
|
debug_cumLpCalls, &
|
||||||
|
debug_cumLpTicks, &
|
||||||
|
debug_StressLoopDistribution
|
||||||
|
use constitutive, only: constitutive_microstructure, &
|
||||||
|
constitutive_homogenizedC, &
|
||||||
|
constitutive_LpAndItsTangent
|
||||||
|
use math, only: math_mul33x33, &
|
||||||
|
math_mul66x6, &
|
||||||
|
math_mul99x99, &
|
||||||
|
math_inv3x3, &
|
||||||
|
math_invert3x3, &
|
||||||
|
math_i3, &
|
||||||
|
math_identity2nd, &
|
||||||
|
math_Mandel66to3333, &
|
||||||
|
math_mandel33to6
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
!*** input variables ***!
|
!*** input variables ***!
|
||||||
integer(pInt), intent(in) :: e, & ! element index
|
integer(pInt), intent(in):: e, & ! element index
|
||||||
i, & ! integration point index
|
i, & ! integration point index
|
||||||
g ! grain index
|
g ! grain index
|
||||||
|
|
||||||
!*** output variables ***!
|
!*** output variables ***!
|
||||||
logical crystallite_integrateStress ! flag indicating if integration suceeded
|
logical crystallite_integrateStress ! flag indicating if integration suceeded
|
||||||
|
|
||||||
|
!*** internal local variables ***!
|
||||||
|
real(pReal), dimension(3,3):: Fg_current, & ! deformation gradient at start of timestep
|
||||||
|
Fg_new, & ! deformation gradient at end of timestep
|
||||||
|
Fp_current, & ! plastic deformation gradient at start of timestep
|
||||||
|
Fp_new, & ! plastic deformation gradient at end of timestep
|
||||||
|
Fe_current, & ! elastic deformation gradient at start of timestep
|
||||||
|
Fe_new, & ! elastic deformation gradient at end of timestep
|
||||||
|
invFp_new, & ! inverse of Fp_new
|
||||||
|
invFp_current, & ! inverse of Fp_current
|
||||||
|
Lpguess, & ! current guess for plastic velocity gradient
|
||||||
|
Lpguess_old, & ! known last good guess for plastic velocity gradient
|
||||||
|
Lp_constitutive, & ! plastic velocity gradient resulting from constitutive law
|
||||||
|
residuum, & ! current residuum of plastic velocity gradient
|
||||||
|
residuum_old, & ! last residuum of plastic velocity gradient
|
||||||
|
A, &
|
||||||
|
B, &
|
||||||
|
BT, &
|
||||||
|
AB, &
|
||||||
|
BTA
|
||||||
|
real(pReal), dimension(6):: Tstar_v ! 2nd Piola-Kirchhoff Stress in Mandel-Notation
|
||||||
|
real(pReal), dimension(9,9):: dLp_constitutive, & ! partial derivative of plastic velocity gradient calculated by constitutive law
|
||||||
|
dTdLp, & ! partial derivative of 2nd Piola-Kirchhoff stress
|
||||||
|
dRdLp, & ! partial derivative of residuum (Jacobian for NEwton-Raphson scheme)
|
||||||
|
invdRdLp ! inverse of dRdLp
|
||||||
|
real(pReal), dimension(3,3,3,3):: C ! 4th rank elasticity tensor
|
||||||
|
real(pReal), dimension(6,6):: C_66 ! simplified 2nd rank elasticity tensor
|
||||||
|
real(pReal) p_hydro, & ! volumetric part of 2nd Piola-Kirchhoff Stress
|
||||||
|
det, & ! determinant
|
||||||
|
leapfrog, & ! acceleration factor for Newton-Raphson scheme
|
||||||
|
maxleap ! maximum acceleration factor
|
||||||
|
logical error ! flag indicating an error
|
||||||
|
integer(pInt) NiterationStress, & ! number of stress integrations
|
||||||
|
dummy, &
|
||||||
|
h, &
|
||||||
|
j, &
|
||||||
|
k, &
|
||||||
|
l, &
|
||||||
|
m, &
|
||||||
|
n
|
||||||
|
integer(pLongInt) tick, &
|
||||||
|
tock, &
|
||||||
|
tickrate, &
|
||||||
|
maxticks
|
||||||
|
|
||||||
|
!*** global variables ***!
|
||||||
|
! crystallite_subF0
|
||||||
|
! crystallite_subF
|
||||||
|
! crystallite_subFp0
|
||||||
|
! crystallite_Tstar_v
|
||||||
|
! crystallite_Lp
|
||||||
|
! crystallite_subdt
|
||||||
|
! crystallite_Temperature
|
||||||
|
|
||||||
!*** internal variables ***!
|
|
||||||
real(pReal), dimension(3,3) :: Fg_current, & ! deformation gradient at start of timestep
|
|
||||||
Fg_new, & ! deformation gradient at end of timestep
|
|
||||||
Fp_current, & ! plastic deformation gradient at start of timestep
|
|
||||||
Fp_new, & ! plastic deformation gradient at end of timestep
|
|
||||||
Fe_current, & ! elastic deformation gradient at start of timestep
|
|
||||||
Fe_new, & ! elastic deformation gradient at end of timestep
|
|
||||||
invFp_new, & ! inverse of Fp_new
|
|
||||||
invFp_current, & ! inverse of Fp_current
|
|
||||||
Lpguess, & ! current guess for plastic velocity gradient
|
|
||||||
Lpguess_old, & ! known last good guess for plastic velocity gradient
|
|
||||||
Lp_constitutive, & ! plastic velocity gradient resulting from constitutive law
|
|
||||||
residuum, & ! current residuum of plastic velocity gradient
|
|
||||||
residuum_old, & ! last residuum of plastic velocity gradient
|
|
||||||
A, &
|
|
||||||
B, &
|
|
||||||
BT, &
|
|
||||||
AB, &
|
|
||||||
BTA
|
|
||||||
real(pReal), dimension(6) :: Tstar_v ! 2nd Piola-Kirchhoff Stress in Mandel-Notation
|
|
||||||
real(pReal), dimension(9,9) :: dLp_constitutive, & ! partial derivative of plastic velocity gradient calculated by constitutive law
|
|
||||||
dTdLp, & ! partial derivative of 2nd Piola-Kirchhoff stress
|
|
||||||
dRdLp, & ! partial derivative of residuum (Jacobian for NEwton-Raphson scheme)
|
|
||||||
invdRdLp ! inverse of dRdLp
|
|
||||||
real(pReal), dimension(3,3,3,3) :: C ! 4th rank elasticity tensor
|
|
||||||
real(pReal), dimension(6,6) :: C_66 ! simplified 2nd rank elasticity tensor
|
|
||||||
real(pReal) p_hydro, & ! volumetric part of 2nd Piola-Kirchhoff Stress
|
|
||||||
det, & ! determinant
|
|
||||||
leapfrog, & ! acceleration factor for Newton-Raphson scheme
|
|
||||||
maxleap ! maximum acceleration factor
|
|
||||||
logical error ! flag indicating an error
|
|
||||||
integer(pInt) NiterationStress, & ! number of stress integrations
|
|
||||||
dummy, &
|
|
||||||
h, &
|
|
||||||
j, &
|
|
||||||
k, &
|
|
||||||
l, &
|
|
||||||
m, &
|
|
||||||
n
|
|
||||||
integer(pLongInt) tick, &
|
|
||||||
tock, &
|
|
||||||
tickrate, &
|
|
||||||
maxticks
|
|
||||||
|
|
||||||
|
|
||||||
! be pessimistic
|
! be pessimistic
|
||||||
crystallite_integrateStress = .false.
|
crystallite_integrateStress = .false.
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<root text=""crystallite_integrateStress"" comment="" color="ffffff" type="sub" style="nice">
|
||||||
|
<children>
|
||||||
|
<instruction text=""Fg_current = crystallite_subF0","Fg_new = crystallite_subF","Fp_current = crystallite_subFp0","Fe_current = Fg_current * Fp_current ^ -1","Tstar_v = crystallite_Tstar_v","Lpguess_old = crystallite_Lp","Lpguess = crystallite_Lp","crystallite_integrateStress = .false. "" comment="""" color="ffffff" rotated="0"></instruction>
|
||||||
|
<call text=""invFp_current = math_inv3x3(Fp_current)"" comment="" color="ffffff"></call>
|
||||||
|
<alternative text=""invFp_current == 0.0"" comment="" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""return"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
<instruction text=""A = invFp_current ^T * Fg_new ^T * Fg_new * invFp_current"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<call text=""constitutive_microstructure"" comment="" color="ffffff"></call>
|
||||||
|
<call text=""C = math_Mandel66to3333( constitutive_homogenizedC ( ) )"" comment="" color="ffffff"></call>
|
||||||
|
<instruction text=""NiterationStress = 0","leapfrog = 1.0","maxleap = 1024.0"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<forever text="" comment="" color="ffffff">
|
||||||
|
<qForever>
|
||||||
|
<instruction text=""LP LOOP (see crystallite_integrateStress_LpLoop)"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qForever>
|
||||||
|
</forever>
|
||||||
|
<instruction text=""invFp_new = invFp_current * B","invFp_new = invFp_new / math_det3x3(invFp_new)^(1.0/3.0)"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<call text=""[Fp_new,det,error] = math_invert3x3(invFp_new)"" comment="" color="ffffff"></call>
|
||||||
|
<alternative text=""error"" comment="" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""INVERSION FAILED: return"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
<instruction text=""Fe_new = Fg_new * invFp_new","Tstar_v = Tstar_v + p_hydro"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<instruction text=""crystallite_P = Fe_new * Tstar_v * invFp_new^T","crystallite_Lp = Lpguess","crystallite_Tstar_v = Tstar_v","crystallite_Fp = Fp_new","crystallite_Fe = Fe_new","crystallite_integrateStress = .true."" comment="""" color="ffffff" rotated="0"></instruction>
|
||||||
|
</children>
|
||||||
|
</root>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,55 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<root text=""crystallite_integrateStress LpLoop"" comment="""" color="ffffff" type="sub" style="nice">
|
||||||
|
<children>
|
||||||
|
<instruction text=""NiterationStress = NiterationStress + 1"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<alternative text=""NiterationStress > nStress"" comment="" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""TOO MANY ITERATIONS: return"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
<instruction text=""B = math_i3 - crystallite_subdt(g,i,e)*Lpguess","Tstar_v = 0.5 * C * (B^T * A * B - math_I3)","p_hydro = sum(Tstar_v(1:3))/3.0","forall (i=1:3) Tstar_v(i) = Tstar_v(i) - p_hydro"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<call text=""[Lp_constitutive, dLp_constitutive] = constitutive_LpAndItsTangent (Tstar_v, crystallite_Temperature)"" comment="" color="ffffff"></call>
|
||||||
|
<instruction text=""residuum = Lpguess - Lp_constitutive"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<alternative text=""no NaN ocuured in residuum",".and. (residuum below absolute tolerance .or. (above relevant strain .and. residuum below relative tolerance))"" comment="""" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<jump text=""LOOP CONVERGED: exit LpLoop"" comment="" color="ffffff"></jump>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
<alternative text=""NaN occured in residuum .and. leapfrog == 1.0"" comment="""" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""NO CONVERGENCE: return"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
<alternative text=""leapfrog > 1.0",".and. (worse residuum .or. residuum changed sign .or. NaN occured)"" comment="""" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""maxleap = 0.5 * leapfrog","leapfrog = 1.0","Lpguess = Lpguess_old","residuum = residuum_old"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
<instruction text=""dTdLp = - 0.5 * crystallite_subdt * C * (A*B + B^T*A)","dRdLp = math_identity2nd(9) - dLp_constitutive * dTdLp"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<call text=""[invdRdLp,dummy,error] = math_invert(9,dRdLp)"" comment="" color="ffffff"></call>
|
||||||
|
<alternative text=""error"" comment="" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""INVERSION FAILED: return"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
<instruction text=""residuum_old = residuum","Lpguess_old = Lpguess"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
<alternative text=""NiterationStress > 1 .and. leapfrog < maxleap"" comment="" color="ffffff">
|
||||||
|
<qTrue>
|
||||||
|
<instruction text=""leapfrog = 2.0 * leapfrog"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</qTrue>
|
||||||
|
<qFalse>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
</qFalse>
|
||||||
|
</alternative>
|
||||||
|
<instruction text=""Lpguess = Lpguess - leapfrog * invdRdLp * residuum"" comment="" color="ffffff" rotated="0"></instruction>
|
||||||
|
</children>
|
||||||
|
</root>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,3 @@
|
||||||
|
Nassi-Schneidermann-Diagrams for selected functions and subroutines:
|
||||||
|
|
||||||
|
- *.nsd and *.pdf files created with the software "Structorizer" Version 3.12
|
Loading…
Reference in New Issue