39
40
41
44 USE matparam_def_mod
45 use element_mod , only : nixc
46
47
48
49#include "implicit_f.inc"
50
51
52
53#include "param_c.inc"
54#include "com01_c.inc"
55#include "tablen_c.inc"
56#include "ddspmd_c.inc"
57
58
59
60 INTEGER NUMELC,OFF,
61 . NUMMAT,NUMGEO,IXC(NIXC,*),
62 . IGEO(NPROPGI,NUMGEO),IPM(NPROPMI,NUMMAT),TABMP_L
63 INTEGER, INTENT(IN) :: SIZE_IRUP
64
65
67 . pm(npropm,nummat), geo(npropg,numgeo),bufmat(*)
68 REAL WD(*)
69 INTEGER MID_OLD,PID_OLD,MLN_OLD,RECHERCHE
71
72 INTEGER, DIMENSION(*), INTENT(IN) :: IPARTC
73 INTEGER, DIMENSION(2,*), INTENT(IN) :: POIN_PART_SHELL
74 TYPE(MID_PID_TYPE), DIMENSION(*), INTENT(INOUT) :: MID_PID_SHELL
75 TYPE(MATPARAM_STRUCT_) ,DIMENSION(NUMMAT), INTENT(IN) :: MAT_PARAM
76
77 INTEGER NPN, MID, PID, MLN,
78 . ISTRAIN, ITHK, IHBE, IPLA, ISSN, I, J,
79 . NFUNC,
80 .
81 .
82 .
83 . NFAIL,IRUP2,II,IRUP_TAB(SIZE_IRUP),
84 . INDI,IAD,INDI2,MULT,IDRIL
85 INTEGER :: INDI3,IGTYP,INDI4,INDI5
86
87 INTEGER :: POIN_PID,POIN_MID,POIN_PART,COST_CHECK
88 INTEGER :: FLAG_NICE_NEWTON,FLAG_GURSON,FLAG_NON_LOCAL
89 INTEGER :: SPECIAL_OPTION,SPE_I_1,SPE_I_2,SPE_I_3
90
91 real
92 . wtype(9),
93 . tabmat(3),tabx(3),timmat,npt,telt,poids,
94 . batozmult,trup,tabrup(3),trup_local,tmatadd,
96
98 . cc,a,b,a1,a2
100 . invtref
101 DATA wtype /1.6 ,1. ,1. ,.9 ,1.1 ,1.4 ,0.65 ,.9 ,2.0/
102
103 nfunc = zero
105
106
107
108
109 IF(dd_optimization==1) THEN
110
111#include "weights_p4linux964_spmd_avx512.inc"
112 ELSEIF(dd_optimization==2) THEN
113
114#include "weights_p4linux964_spmd_sse3.inc"
115 ELSEIF(dd_optimization==3) THEN
116
117#include "weights_p4linuxa964_spmd.inc"
118 ELSE
119
120#if ARCH_CPU
121
122#include "weights_p4linuxa964_spmd.inc"
123#elif 1
124
125#include "weights_p4linux964_spmd.inc"
126#endif
127 ENDIF
128 invtref = one/tpsref
129 indi3 = 1
130 DO i = 1, numelc
131 mid= ixc(1,i)
132 pid= ixc(6,i)
133 mln = nint(pm(19,abs(mid)))
134 wd_local = wd(i+off)
135
136 IF(recherche==1) THEN
137 mid = mid_old
138 pid = pid_old
139 mln = mln_old
140 wd_local = zero
141 ENDIF
142
143 npn = nint(geo(6,pid))
144 npt = abs(npn)
145 ihbe = nint(geo(171,pid))
146 ithk = nint(geo(35,pid))
147 ipla = nint(geo(39,pid))
148 igtyp = igeo(11,pid)
149 nfail = mat_param(mid)%NFAIL
150 idril = igeo(20,pid)
151 flag_non_local = 0
152 special_option = 0
153 spe_i_1 = 1
154 spe_i_2 = 1
155 irup_tab = 0
156 IF (nfail > 0) THEN
157 DO j=1,nfail
158 irup_tab(j) = mat_param(mid)%FAIL(j)%IRUPT
159 ENDDO
160 ENDIF
161 timmat = 0.
162 trup = 0.
163 tmatadd = 0.
165 mult = 0
166 IF((mln<28).OR.(mln==32)) THEN
167 irup2 = 0
168 ELSE
169 irup2 = 3
170 ENDIF
171
172
173 IF (mln==2) THEN
174 cc = pm(43,mid)
175 IF (cc/=0) THEN
176 indi = 2
177 ELSE
178 indi = 1
179 ENDIF
180 IF (mat_param(abs(mid))%IVISC > 0) THEN
181 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
182 ENDIF
183
184
185 ELSEIF(mln==25) THEN
186 IF (igtyp/=9) THEN
187 indi = 2
188 ELSE
189 indi = 1
190 ENDIF
191 IF (mat_param(abs(mid))%IVISC > 0) THEN
192 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
193 ENDIF
194
195
196 ELSEIF ((mln==36)) THEN
197 IF(abs(npn)>0) THEN
198 nfunc = ipm(10,mid)
199 ELSE
200 nfunc = nint(pm(40,mid))
201 ENDIF
202 IF (nfunc<=2) THEN
203 indi = 1
204 ELSEIF (nfunc>2.AND.nfunc<=7) THEN
205 indi = 2
206 ELSEIF (nfunc>7) THEN
207 indi = 3
208 ENDIF
209 IF (mat_param(abs(mid))%IVISC > 0) THEN
210 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
211 ENDIF
212
213
214 ELSEIF((mln==86).AND.(abs(npn)==0)) THEN
215 nfunc = nint(pm(40,mid))
216 IF (nfunc<=2) THEN
217 indi = 1
218 ELSEIF (nfunc>2.AND.nfunc<=7) THEN
219 indi = 2
220 ELSEIF (nfunc>7) THEN
221 indi = 3
222 ENDIF
223
224 IF (nfunc == 0) THEN
225 IF (mat_param(abs(mid))%IVISC > 0) THEN
226 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
227 ENDIF
228 ENDIF
229
230
231 ELSEIF((mln==42).OR.(mln==62).OR.(mln==69)) THEN
232
233 nfunc = 0
234 IF (mln==42) nfunc = mat_param(abs(mid))%IPARAM(2)
235 IF (mln==62) THEN
236 iad=ipm(7,abs(mid))-1
237 nfunc = nint(bufmat(iad+3))
238 END IF
239
240 IF(nfunc==0) THEN
241 indi = 1
242 IF (mat_param(abs(mid))%IVISC > 0) THEN
243 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
244 ENDIF
245 ELSEIF(nfunc==1) THEN
246 indi = 2
247 ELSEIF(nfunc==2) THEN
248 indi = 3
249 ELSEIF(nfunc>2) THEN
250 indi = 3
251 mult = nfunc - 2
252 indi2 = 2
253 ENDIF
254
255
256 ELSEIF((mln==82)) THEN
257 iad=ipm(7,abs(mid))-1
258 nfunc=nint(bufmat(iad+1))
259 IF(nfunc<=1) THEN
260 indi = 1
261 IF (mat_param(abs(mid))%IVISC > 0) THEN
262 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
263 ENDIF
264 ELSEIF(nfunc==2) THEN
265 indi = 2
266 ELSEIF(nfunc==3) THEN
267 indi = 3
268 ELSEIF(nfunc>3) THEN
269 indi = 3
270 mult = nfunc - 3
271 indi2 = 2
272 ENDIF
273
274
275 ELSEIF(mln==104) THEN
276 iad=ipm(7,abs(mid))-1
277 flag_nice_newton=nint(bufmat(iad+11))
278 IF(flag_nice_newton==2) THEN
279 indi = 2
280 ELSE
281 indi = 1
282 ENDIF
283 flag_gurson=nint(bufmat(iad+30))
284 IF(flag_gurson/=0) THEN
285 special_option=1
286 spe_i_1 = 1
287 spe_i_2 = 1
288 ENDIF
289 IF(flag_gurson==1) THEN
290 spe_i_2 = 1
291 ELSEIF(flag_gurson==2) THEN
292 spe_i_2 = 2
293 ELSEIF(flag_gurson==3) THEN
294 spe_i_2 = 3
295 ENDIF
296 flag_non_local = mat_param(abs(mid))%NLOC
297
298
299 ELSE
300 indi = 1
301 IF (mat_param(abs(mid))%IVISC > 0) THEN
302 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM
303 ENDIF
304 ENDIF
305
306 mult_spe = 0.
307 spe_i_3 = 1
308 IF(flag_non_local/=0) THEN
309 spe_i_3 = 2
310 mult_spe = npt
311 ENDIF
312 cost_check = 0
313
314
315
316
317
318 IF(recherche==0.AND.test_poids/=0) THEN
319 poin_part = ipartc(i)
320 poin_mid = poin_part_shell(1,poin_part)
321 poin_pid = poin_part_shell(2,poin_part)
322
323
324 IF(poin_mid/=0.AND.poin_pid/=0) THEN
325 IF(mid_pid_shell(poin_mid)%COST1D(poin_pid)/=zero) THEN
326 cost_check = 1
327 telt = mid_pid_shell(poin_mid)%COST1D(poin_pid)
328 ENDIF
329 ENDIF
330 ENDIF
331
332 IF(cost_check==0) THEN
333
334
335
336 IF(ddweights(1,2,mid)/=zero)THEN
337
338 a1 = ddweights(1,2,mid) * tpsref
339 a2 = ddweights(2,2,mid) * tpsref
340
341 IF (a2 /=zero)THEN
342
343 a = (a2-a1)/4
344 b = a1-a
345 timmat = a*npt + b
346 ELSE
347 timmat = a1*npt
348 ENDIF
349
350
351 IF(nfail/=0) THEN
352 DO j=1,nfail
353 a1 = rupture_shell(irup_tab(j),irup2+1)
354 a2 = rupture_shell(irup_tab(j),irup2+3)
355 IF (a2 /=zero)THEN
356 a = (a2-a1)/4
357 b = a1-a
358 trup = trup + a*npt + b
359 ELSE
360 trup = trup + a1*npt
361 ENDIF
362 ENDDO
363 ENDIF
364
365 ELSE
366
367
368
369 IF(ithk==2)THEN
370 ithk = 0
371 ELSEIF(mln==32)THEN
372 ithk = 1
373 ENDIF
374 istrain = nint(geo(11,pid))
375 IF(mln==19.OR.mln>=25)istrain = 1
376 issn = nint(geo(3,pid))
377
378 IF (wd_local==0.) THEN
379 IF(abs(npn)>0) THEN
380 tabx(1) = 1.
381 tabx(2) = 3.
382 tabx(3) = 5.
383
384 DO j = 1,3
385 IF(mult/=0) tmatadd = mult *
386 . (shtnl(
min(mln,maxlaw),j,indi) - shtnl(
min(mln,maxlaw),j,indi2) )
387 IF(special_option/=0) tmatadd = tmatadd + shtnl_option(spe_i_1,spe_i_2)
388 tabmat(j) = shtnl(
min(mln,maxlaw),j,indi) + tmatadd
389 ENDDO
390
391 npt = abs(npn)
393
394
395 IF(nfail/=0) THEN
396 DO j=1,nfail
397 DO ii=1,3
398 tabrup(ii) = rupture_shell(irup_tab(j),irup2+ii)
399 ENDDO
400 trup_local = 0.
402 trup = trup + trup_local
403 ENDDO
404 ENDIF
405
406 ELSE
407
408
409 IF(mult/=0) tmatadd = mult *
410 . (shtnl(
min(mln,maxlaw),0,indi) - shtnl(
min(mln,maxlaw),0,indi2) )
411 timmat = shtnl(
min(mln,maxlaw),0,indi) + tmatadd
412
413
414
415 IF(nfail/=0) THEN
416 trup = 0.
417 ENDIF
418
419 ENDIF
420 ENDIF
421 ENDIF
422
423 IF(igtyp==10) THEN
424 indi4 = 1
425 ELSEIF(igtyp==11) THEN
426 indi4 = 2
427 ELSEIF(igtyp==9) THEN
428 indi4 = 3
429 ELSEIF(igtyp==16) THEN
430 indi4 = 4
431 ELSEIF(igtyp==51) THEN
432 indi4 = 5
433 ELSE
434 indi4 = 0
435 ENDIF
436
437 indi5 = 0
438 IF(idril==1) indi5=2
439
440 IF(mln/=0)THEN
441 IF (ihbe>=11.AND.ihbe<=19) THEN
442
443 telt = shtelt(indi4*5+3+indi5)+batozmult*(timmat + trup) + mult_spe*nlocal_option(spe_i_3) +
visc_prony
444 ELSEIF (ihbe>=21.AND.ihbe<=29) THEN
445
446 telt = shtelt(indi4*5+2+indi5) + timmat + trup + mult_spe*nlocal_option(spe_i_3) +
visc_prony
447 ELSE
448
449 telt = shtelt(indi4*5+1) + timmat + trup + mult_spe*nlocal_option(spe_i_3) +
visc_prony
450 ENDIF
451 ENDIF
452 ENDIF
453
454
455
456 IF(recherche==0) THEN
457 IF((wd_local==0.).AND.(mln/=0)) THEN
458 poids = telt * invtref
459 wd(i+off) = poids
460 poin_part = ipartc(i)
461 poin_mid = poin_part_shell(1,poin_part)
462 poin_pid = poin_part_shell(2,poin_part)
463 IF(poin_mid/=0.AND.poin_pid/=0) mid_pid_shell(poin_mid)%COST1D(poin_pid) = telt
464 ELSEIF((wd_local==0.).AND.(mln==0)) THEN
465 wd(i+off) = 0.0001
466 ENDIF
467 ELSE
468 telt_pro = telt
469 ENDIF
470
471 ENDDO
472
473 RETURN
subroutine interlagran(tab, lx, ltab, x, y)
subroutine visc_prony(visc, nprony, nel, nvarvis, uvarvis, epspxx, epspyy, epspzz, epspxy, epspyz, epspzx, sv1, sv2, sv3, sv4, sv5, sv6, timestep, rho, viscmax, soundsp, nvar_damp)