SPEED
MAKE_INVARIANTS_AND_MAIN_STRAIN.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
19
36
37
39 duxdx,duydx,duzdx,&
40 duxdy,duydy,duzdy,&
41 duxdz,duydz,duzdz,&
42 R,yon)
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
138
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.