SPEED
MAKE_INVARIANTS_AND_MAIN_STRAIN.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine make_invariants_and_main_strain (nn, duxdx, duydx, duzdx, duxdy, duydy, duzdy, duxdz, duydz, duzdz, r, yon)
 Makes invariants for the strain tensor and computes the main strain.
 

Function/Subroutine Documentation

◆ make_invariants_and_main_strain()

subroutine make_invariants_and_main_strain ( integer*4  nn,
real*8, dimension(nn,nn,nn)  duxdx,
real*8, dimension(nn,nn,nn)  duydx,
  duzdx,
real*8, dimension(nn,nn,nn)  duxdy,
real*8, dimension(nn,nn,nn)  duydy,
  duzdy,
real*8, dimension(nn,nn,nn)  duxdz,
real*8, dimension(nn,nn,nn)  duydz,
  duzdz,
real*8, dimension(nn,nn,nn)  r,
integer*4, dimension(nn,nn,nn)  yon 
)

Makes invariants for the strain tensor and computes the main strain.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]nnpolynomial degree
[in]duxdxnodal values for spatial derivatives of the displacement
[in]duydxnodal values for spatial derivatives of the displacement
[in]duzdxnodal values for spatial derivatives of the displacement
[in]duxdynodal values for spatial derivatives of the displacement
[in]duydynodal values for spatial derivatives of the displacement
[in]duzdynodal values for spatial derivatives of the displacement
[in]duxdznodal values for spatial derivatives of the displacement
[in]duydznodal values for spatial derivatives of the displacement
[in]duzdznodal values for spatial derivatives of the displacement
[in]yon1 if the point is non-linear elastic, 0 otherwise
[out]Raveraged main shear strain

Definition at line 38 of file MAKE_INVARIANTS_AND_MAIN_STRAIN.f90.

43
44 implicit none
45
46
47 integer*4 :: nn
48 integer*4 :: i,j,k
49
50 integer*4, dimension(nn,nn,nn) :: yon
51
52 real*8 :: exx,eyy,ezz,exy,eyz,ezx
53 real*8 :: r1,r2,r3
54 real*8 :: invar1,invar2,invar3
55 real*8 :: strain_i,strain_ii,strain_iii
56 real*8 :: r_average_elem
57
58 real*8, dimension(nn,nn,nn) :: duxdx,duxdy,duxdz,duydx,duydy,duydz,duzdx,duzdy,duzdz
59 real*8, dimension(nn,nn,nn) :: r
60
61
62 r_average_elem = 0.0d0
63
64 do i = 1,nn
65 do j = 1,nn
66 do k = 1,nn
67
68 if (yon(i,j,k).eq.1) then
69
70 !+-----------------------------------------
71 !! Invariants of the strain tensor sigma_ij
72
73 exx = duxdx(i,j,k)
74 eyy = duydy(i,j,k)
75 ezz = duzdz(i,j,k)
76
77 exy = .5 * (duxdy(i,j,k) + duydx(i,j,k))
78 eyz = .5 * (duydz(i,j,k) + duzdy(i,j,k))
79 ezx = .5 * (duzdx(i,j,k) + duxdz(i,j,k))
80
81 invar1 = exx + eyy + ezz
82
83 invar2 = exx * eyy + &
84 eyy * ezz + &
85 ezz* exx - &
86 exy**2 - &
87 eyz**2 - &
88 ezx**2
89
90 invar3 = exx * eyy * ezz + &
91 2 * exy * eyz * (-ezx) - &
92 exx * eyz**2 - &
93 eyy * ezx**2 - &
94 ezz * exy**2
95
96 !+-----------------------------------------
97 !! Principal strain computations
98
99 call cubic(-invar1,invar2,-invar3,&
100 strain_i,strain_ii,strain_iii)
101
102 !call ZerosPolyO3(-invar1,invar2,-invar3,&
103 ! strain_I,strain_II,strain_III)
104
105
106 !+-----------------------------------------
107 !! Max shear strain computation
108
109 r(i,j,k) = (max(strain_i,strain_ii,strain_iii) - &
110 min(strain_i,strain_ii,strain_iii) ) / 2
111
112 r_average_elem = r_average_elem + r(i,j,k)
113
114 !!
115 !+-----------------------------------------
116
117 endif !if (yon(i,j,k).eq.1) then
118
119 enddo
120 enddo
121 enddo
122
123 r_average_elem = r_average_elem / (nn*nn*nn)
124
125 do i = 1,nn
126 do j = 1,nn
127 do k = 1,nn
128
129 r(i,j,k) = r_average_elem
130
131 enddo
132 enddo
133 enddo
134
135 return
136