44
45
46
49
50
51
52#include "implicit_f.inc"
53
54
55
56#include "tabsiz_c.inc"
57
58
59
60 INTEGER, INTENT(IN) :: NEL,NUPARAM,NUVAR,NFUNC,NUMTABL,INLOC
61 INTEGER, INTENT(IN) :: NVARTMP
62 INTEGER,DIMENSION(NFUNC),INTENT(IN) :: IFUNC
63 my_real,
INTENT(IN) :: time,timestep
64 my_real,
DIMENSION(NUPARAM),
INTENT(IN) :: uparam
65 my_real,
DIMENSION(NEL),
INTENT(IN) :: gs,rho,dplanl,
66 . depsxx,depsyy,depsxy,depsyz,depszx,
67 . sigoxx,sigoyy,sigoxy,sigoyz,sigozx
68 TYPE(TABLE_4D_), DIMENSION(NUMTABL) ,INTENT(IN) :: TABLE
69 my_real,
DIMENSION(NEL),
INTENT(IN) :: loff
70
71
72
73 my_real,
DIMENSION(NEL),
INTENT(OUT) ::
74 . signxx,signyy,signxy,signyz,signzx,dezz,dpla
75
76
77
78 INTEGER, DIMENSION(NEL,NVARTMP), INTENT(INOUT) :: VARTMP
79 my_real,
DIMENSION(NEL,NUVAR),
INTENT(INOUT) :: uvar
80 my_real,
DIMENSION(NEL),
INTENT(INOUT) :: off,yld,pla,epsd,soundsp
81
82
83
84 INTEGER NPF(SNPC)
86
87
88
89 INTEGER I,II,ITER,NITER,ICONV,ICAS,NINDX
90 INTEGER ,PARAMETER :: FUNC_TRAC = 1
91 INTEGER ,PARAMETER :: FUNC_COMP = 2
92 INTEGER ,PARAMETER :: FUNC_SHEAR = 3
93 INTEGER, DIMENSION(NEL) :: INDX,IAD,ILEN
94 my_real :: lam,dlam,df1,da0,da1,da2,
95 . ca,cb,aa,bb,cc,a1s,a1c,a1t,a2s,a2c,a2t,e,nu,nu1,nupc,xfac,
96 . yy,dx2,
norm,dfdsigdlam,yld_norm,epd_min,epd_max,dpt,dps,
97 . normxx,normyy,normxy,normzz,normyz,normzx,
alpha,alphi,dtinv,
98 . epdt_min,epdt_max,epdc_min,epdc_max,epds_min,epds_max,sig_dfdsig
99 my_real,
DIMENSION(NEL) :: ff,p,svm,svm2,ylds,sxx,syy,sxy,szz,
100 . dpxx,dpyy,dpxy,dpzz,sigt,sigc,sigs,dft,dfc,dfs,a11_2d,a12_2d,g,
101 . a0,a1,a2,nup,epspt,epspc,epsps,epdt,epdc,epds,dydx,
102 . epdt_f,epdc_f,epds_f,dplat,dplac,dplas,dlam_nl
103 my_real,
DIMENSION(NEL,2) :: xvec
104 my_real,
DIMENSION(NUMTABL) :: tfac
105 my_real,
DIMENSION(NFUNC) :: yfac
106 LOGICAL :: CONV(NEL)
107 my_real,
PARAMETER :: sfac = 1.05d0
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131 e = uparam(1)
132 nu = uparam(5)
133
134 nupc = uparam(9)
135
136 iconv = nint(uparam(15))
137 icas = uparam(17)
138 xfac = uparam(18)
139 alpha =
min(one, uparam(16)*timestep)
140 epdt_min = uparam(19)
141 epdt_max = uparam(20)
142 epdc_min = uparam(21)
143 epdc_max = uparam(22)
144 epds_min = uparam(23)
145 epds_max = uparam(24)
146 tfac(1) = uparam(25)
147 tfac(2) = uparam(26)
148 tfac(3) = uparam(27)
149 yfac(1) = uparam(28)
150 yfac(2) = uparam(29)
151 a11_2d(1:nel) = uparam(2)
152 a12_2d(1:nel) = uparam(3)
153 g(1:nel) = uparam(4)
154 nu1 = nu/(one - nu)
156 dtinv = one /
max(em20, timestep)
157
158
159 IF (time == zero) THEN
160 nup(1:nel) = nupc
161 uvar(1:nel,7) = nupc
162 ELSE
163 nup(1:nel) = uvar(1:nel,7)
164 END IF
165
166
167 epspt(1:nel) = uvar(1:nel,1)
168 epspc(1:nel) = uvar(1:nel,2)
169 epsps(1:nel) = uvar(1:nel,3)
170 epdt_f(1:nel) = uvar(1:nel,4)
171 epdc_f(1:nel) = uvar(1:nel,5)
172 epds_f(1:nel) = uvar(1:nel,6)
173 dplat(1:nel) = zero
174 dplac(1:nel) = zero
175 dplas(1:nel) = zero
176 DO i=1,nel
177 epdt(i) =
min(epdt_max,
max(epdt_f(i),epdt_min)) * xfac
178 epdc(i) =
min(epdc_max,
max(epdc_f(i),epdc_min)) * xfac
179 epds(i) =
min(epds_max,
max(epds_f(i),epds_min)) * xfac
180 ENDDO
181
182
183 xvec(1:nel,1) = epspt(1:nel)
184 xvec(1:nel,2) = epdt(1:nel)
186 sigt(1:nel) = sigt(1:nel) * tfac(1)
187 dft(1:nel) = dft(1:nel) * tfac(1)
189 xvec(1:nel,1) = epspc(1:nel)
190 xvec(1:nel,2) = epdc(1:nel)
192 sigc(1:nel) = sigc(1:nel) * tfac(2)
193 dfc(1:nel) = dfc(1:nel) * tfac(2)
194 END IF
195 IF (table(func_shear)%NOTABLE > 0) THEN
196 xvec(1:nel,1) = epsps(1:nel)
197 xvec(1:nel,2) = epds(1:nel)
199 sigs(1:nel) = sigs(1:nel) * tfac(3)
200 dfs(1:nel) = dfs(1:nel) * tfac(3)
201 END IF
202 IF (icas == 0) THEN
203 sigc(1:nel) = sigt(1:nel)
204 sigs(1:nel) = sigt(1:nel)/sqr3
205 ELSEIF (icas == 1) THEN
206 DO i=1,nel
207 sigs(i) = sqrt(sigt(i)*sigc(i)/three)
208 ENDDO
209 ENDIF
210
211 IF (iconv == 1) THEN
212 DO i = 1,nel
213 conv(i) = .false.
214 IF (sigs(i) < sfac*sqrt(sigc(i)*sigt(i)/three)) THEN
215 sigs(i) = sfac*sqrt(sigc(i)*sigt(i)/three)
216 conv(i) = .true.
217 ENDIF
218 ENDDO
219 ENDIF
220 DO i=1,nel
221 aa = one/sigc(i)/sigt(i)
222 a0(i) = three*sigs(i)**2
223 a1(i) = nine*sigs(i)**2*(sigc(i) - sigt(i))*aa
224 a2(i) = nine*(sigc(i)*sigt(i) - three*sigs(i)**2)*aa
225 END DO
226
227
228
229
230 DO i=1,nel
231
232 signxx(i) = sigoxx(i) + a11_2d(i)*depsxx(i) + a12_2d(i)*depsyy(i)
233 signyy(i) = sigoyy(i) + a11_2d(i)*depsyy(i) + a12_2d(i)*depsxx(i)
234 signxy(i) = sigoxy(i) + depsxy(i)*g(i)
235 signyz(i) = sigoyz(i) + depsyz(i)*gs(i)
236 signzx(i) = sigozx(i) + depszx(i)*gs(i)
237 p(i) = -(signxx(i) + signyy(i)) * third
238
239 sxx(i) = signxx(i) + p(i)
240 syy(i) = signyy(i) + p(i)
241 szz(i) = p(i)
242 dezz(i) = -nu1 * (depsxx(i) + depsyy(i))
243 soundsp(i) = sqrt(a11_2d(i)/rho(i))
244 ENDDO
245
246
247
248
249
250 niter = 4
251 nindx = 0
252 DO i=1,nel
253 svm2(i) = three_half*(sxx(i)**2 + syy(i)**2 + szz(i)**2) + three*signxy
254 svm(i) = sqrt(svm2(i))
255 ylds(i) = svm2(i) - a0(i) - a1(i)*p(i) - a2(i)*p(i)*p(i)
256 IF (ylds(i) > 0 .AND. off(i) == one) THEN
257 nindx = nindx + 1
258 indx(nindx) = i
259 ENDIF
260 ENDDO
261
262
263
264
265 IF (nindx > 0) THEN
266
267
268 DO iter = 1,niter
269
270
271 DO ii = 1,nindx
272 i = indx(ii)
273
274
275
276
277
278
279
280
281
282
283
284 cb = a1(i) + two*a2(i)*p(i)
285 norm = one/
max(em20, sqrt(six*svm(i)**2 + third*cb**2))
286 normxx = three * sxx(i) + cb /three
287 normyy = three * syy(i) + cb /three
288 normzz = three * szz(i) + cb /three
289 normxy = two *three * signxy(i)
290
291
292 dfdsigdlam = normxx * (a11_2d(i)*normxx + a12_2d(i)*normyy)*
norm
293 . + normyy * (a11_2d(i)*normyy + a12_2d(i)*normxx)*
norm
294 . + normxy * normxy * g(i)*
norm
295
296 yld_norm = svm(i)*
norm
297 bb = three/(one + nup(i))
298 dft(i) = dft(i) * yld_norm * bb
299 IF (table(
func_comp)%NOTABLE > 0) dfc(i) = dfc(i) * yld_norm * bb
300 IF (table(func_shear)%NOTABLE > 0) dfs(i) = dfs(i) * yld_norm * sqr3/two
301 IF (icas == 0) THEN
302 dfc(i) = dft(i)
303 dfs(i) = (one/sqr3)*dft(i)
304 ELSEIF (icas == 1) THEN
305 dfs(i) = (one/sqr3)*(one/(two*sqrt(sigt(i)*sigc(i))))*
306 . (dfc(i)*sigt(i) + sigc(i)*dft(i))
307 ENDIF
308 IF (iconv == 1) THEN
309 IF (conv(i)) THEN
310 dfs(i) = sfac*(one/sqr3)*(one/(two*sqrt(sigt(i)*sigc(i))))*
311 . (dfc(i)*sigt(i) + sigc(i)*dft(i))
312 ENDIF
313 ENDIF
314
315
316 cc = sigs(i)/sigc(i)/sigt(i)
317
318 a1s = eighteen*(sigc(i) - sigt(i))*cc
319 a1c = +nine*(sigs(i)/sigc(i))**2
320 a1t = -nine*(sigs(i)/sigt(i))**2
321
322 a2s = -cinquante4*cc
323 a2c = twenty7*cc*sigs(i)/sigc(i)
324 a2t = twenty7*cc*sigs(i)/sigt(i)
325
326 da0 = six*sigs(i)*dfs(i)
327 da1 = a1s*dfs(i) + a1t*dft(i) + a1c*dfc(i)
328 da2 = a2s*dfs(i) + a2t*dft(i) + a2c*dfc(i)
329
330 ff(i) = dfdsigdlam + da0 + p(i)*da1 + p(i)**2 * da2
331 ff(i) = sign(
max(abs(ff(i)),em20) ,ff(i))
332
333 dlam = ylds(i)/ff(i)
334 dpla(i) =
max(zero, dpla(i) + two*dlam*yld_norm )
335 pla(i) = pla(i) + two*dlam*yld_norm
336 dpt = dlam * yld_norm*bb
337 dps = dlam * yld_norm*sqr3
338 dplat(i) = dplat(i) + dpt
339 dplac(i) = dplat(i)
340 dplas(i) = dplas(i) + dps
341
342
343 dpxx(i) = dlam * normxx *
norm
344 dpyy(i) = dlam * normyy *
norm
345 dpzz(i) = dlam * normzz *
norm
346 dpxy(i) = dlam * normxy *
norm
347
348
349 signxx(i) = signxx(i) - (a11_2d(i)*dpxx(i) + a12_2d(i)*dpyy(i))
350 signyy(i) = signyy(i) - (a11_2d(i)*dpyy(i) + a12_2d(i)*dpxx(i))
351 signxy(i) = signxy(i) - dpxy(i)*g(i)
352
353
354 epspt(i) = epspt(i) + dpt
355 epspc(i) = epspc(i) + dpt
356 epsps(i) = epsps(i) + dps
357 ENDDO
358
359
360 xvec(1:nel,1) = epspt(1:nel)
361 xvec(1:nel,2) = epdt(1:nel)
363 sigt(1:nel) = sigt(1:nel) * tfac(1)
364 dft(1:nel) = dft(1:nel) * tfac(1)
366 xvec(1:nel,1) = epspc(1:nel)
367 xvec(1:nel,2) = epdc(1:nel)
369 sigc(1:nel) = sigc(1:nel) * tfac(2)
370 dfc(1:nel) = dfc(1:nel) * tfac(2)
371 END IF
372 IF (table(func_shear)%NOTABLE > 0) THEN
373 xvec(1:nel,1) = epsps(1:nel)
374 xvec(1:nel,2) = epds(1:nel)
376 sigs(1:nel) = sigs(1:nel) * tfac(3)
377 dfs(1:nel) = dfs(1:nel) * tfac(3)
378 END IF
379 IF (icas == 0) THEN
380 DO ii = 1,nindx
381 i = indx(ii)
382 sigc(i) = sigt(i)
383 sigs(i) = sigt(i)/sqr3
384 ENDDO
385 ELSEIF (icas == 1) THEN
386 DO ii = 1,nindx
387 i = indx(ii)
388 sigs(i) = sqrt(sigt(i)*sigc(i)/three)
389 ENDDO
390 ENDIF
391 IF (iconv == 1) THEN
392 DO ii = 1,nindx
393 i = indx(ii)
394 conv(i) = .false.
395 IF (sigs(i) < sfac*sqrt(sigc(i)*sigt(i)/three)) THEN
396 sigs(i) = sfac*sqrt(sigc(i)*sigt(i)/three)
397 conv(i) = .true.
398 ENDIF
399 END DO
400 ENDIF
401 DO ii = 1,nindx
402 i = indx(ii)
403 aa = one/sigc(i)/sigt(i)
404 a0(i) = three*sigs(i)**2
405 a1(i) = nine*sigs(i)**2*(sigc(i) - sigt(i))*aa
406 a2(i) = nine*(sigc(i)*sigt(i) - three*sigs(i)**2)*aa
407 END DO
408
409
410 DO ii = 1,nindx
411 i = indx(ii)
412 p(i) = -third*(signxx(i) + signyy(i) )
413 sxx(i) = signxx(i) + p(i)
414 syy(i) = signyy(i) + p(i)
415 szz(i) = p(i)
416 svm2(i)= three_half*(sxx(i)**2 + syy(i)**2 + szz(i)**2) + three*signxy(i)**2
417 svm(i) = sqrt(svm2(i))
418 ylds(i) = svm2(i) - a0(i) - a1(i)*p(i) - a2(i)*p(i)*p(i)
419 IF (inloc == 0) THEN
420 dezz(i) = dezz(i) + nu1*(dpxx(i) + dpyy(i)) + dpzz(i)
421 ENDIF
422 ENDDO
423 ENDDO
424 END IF
425
426
427
428
429 IF (ifunc(1) > 0) THEN
430 iad(1:nel) = npf(ifunc(1)) / 2 + 1
431 ilen(1:nel) = npf(ifunc(1)+1) / 2 - iad(1:nel) - vartmp(1:nel,8)
432
433 CALL vinter(tf,iad,vartmp(1:nel,8),ilen,nel,pla,dydx,nup)
434
435 uvar(1:nel,7) = yfac(1) * nup(1:nel)
436 uvar(1:nel,7) =
max(zero,
min(nup(1:nel), half))
437 END IF
438
439
440
441
442 IF (inloc > 0) THEN
443 DO i = 1,nel
444 IF (loff(i) == one) THEN
445 cb = a1(i) + two*a2(i)*p(i)
446 norm = one/
max(em20, sqrt(six*svm(i)**2 + third*cb**2))
447 normxx = three*sxx(i) + cb/three
448 normyy = three*syy(i) + cb/three
449 normzz = three*szz(i) + cb/three
450 yld_norm = svm(i)*
norm
451 IF (yld_norm /= zero) THEN
452 dlam_nl(i) = (one/(two*yld_norm))*
max(dplanl(i),zero)
453 dezz(i) = dezz(i) + nu1*(dlam_nl(i)*normxx)*
norm
454 . + nu1*(dlam_nl(i)*normyy)*
norm
455 . + dlam_nl(i)*normzz*
norm
456 ENDIF
457 ENDIF
458 ENDDO
459 ENDIF
460
461
462
463
464 uvar(1:nel,1) = epspt(1:nel)
465 uvar(1:nel,2) = epspc(1:nel)
466 uvar(1:nel,3) = epsps(1:nel)
467 uvar(1:nel,4) =
alpha*dplat(1:nel)*dtinv + alphi*epdt_f(1:nel)
468 uvar(1:nel,5) =
alpha*dplac(1:nel)*dtinv + alphi*epdc_f(1:nel)
469 uvar(1:nel,6) =
alpha*dplas(1:nel)*dtinv + alphi*epds_f(1:nel)
470 epsd(1:nel) =
alpha*dpla(1:nel)*dtinv +
471
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
subroutine func_comp(table, ntable, nptmax, npt_trac, npt_shear, npt_comp, x_comp, y_comp, nup)
subroutine table_mat_vinterp(table, dimx, nel, ipos, xx, yy, dydx)
subroutine vinter(tf, iad, ipos, ilen, nel, x, dydx, y)