39
40
41
44 USE matparam_def_mod
45 use element_mod , only : nixs
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
61 . NUMELS,
62 . NUMMAT,NUMGEO,
63 . IXS(NIXS,*),IGEO(NPROPGI,NUMGEO),ISOLNOD(*),
64 . IPM(NPROPMI,*),TABMP_L,NPART
65 INTEGER, INTENT(IN) :: SIZE_IRUP
66
68 . pm(npropm,*), geo(npropg,*),bufmat(*)
69 REAL WD(*)
70 INTEGER MID_OLD,PID_OLD,MLN_OLD,RECHERCHE,ISOL_OLD
72
73 INTEGER, DIMENSION(2,NPART,*), INTENT(IN) :: POIN_PART_SOL
74 INTEGER, DIMENSION(*), INTENT(IN) :: IPARTS
75 TYPE(MID_PID_TYPE), DIMENSION(NUMMAT,*), INTENT(INOUT) :: MID_PID_SOL
76 TYPE(MATPARAM_STRUCT_) ,DIMENSION(NUMMAT), INTENT(IN) :: MAT_PARAM
77
78 INTEGER OFF, NPN, MID, PID, JHBE, IGT, MLN,
79 . ISTRAIN, ITHK, IHBE, IPLA, ISSN, MTN, I, J, K,L,
80 . NFUNC,MPT,NPTS,NPTT,NPTR,NPTOT,IFLAG,JSROT,IVISC,
81 . I_MID,I_PID,I_MID_OLD,I_PID_OLD,PUID,MUID,
82 . ELM_TYP,ELM_TYP_OLD,ILAW,ILAW_OLD,TEST_MAT,
83 . I_PRO,ISOL2,MUID_OLD,PUID_OLD,
84 . TEST,NFUNC1,NFUNC2,NFAIL,IRUP2,
85 . ISOL,INDI,IAD,INDI2,MULT
86 INTEGER :: INDI3,ADD_OPTION,INDI_OPT_1,INDI_OPT_2
87 INTEGER :: IRUP_TAB(SIZE_IRUP)
89
90 real
91 . wtype(9),fwihbe,fac8,
92 . tabmat(3),tabx(3),timmat,npt,telt,poids,w,
93 . batozmult,tmat,trup,tmatadd,wd_local
94 INTEGER :: FLAG_NICE_NEWTON,FLAG_GURSON,FLAG_NON_LOCAL
95 INTEGER :: SPECIAL_OPTION,SPE_I_1,SPE_I_2,SPE_I_3
97 INTEGER :: INDI4,POIN_PID,POIN_MID,POIN_PART,COST_CHECK,POIN_ELM_TYP
100
101 INTEGER :: OVERCOST_ELM ,ICPR,NUMBER_LAYER
102 INTEGER :: NLAY,COMPOSITE_MID,COMPOSITE_MLN
103 LOGICAL :: COMPOSITE_OPTION
104
105 LOGICAL :: ISMSTR_COST
106 INTEGER :: ISMSTR,ISMSTR_L,ISM0,ICP0
108
109 DATA wtype /1.6 ,1. ,1. ,.9 ,1.1 ,1.4 ,0.65 ,.9 ,2.0/
110
111 overcost_elm = 0
112 telt = 0
113 jsrot = 0
114 nfunc = 0
116
117
118
119
120 IF(dd_optimization==1) THEN
121
122#include "weights_p4linux964_spmd_avx512.inc"
123 ELSEIF(dd_optimization==2) THEN
124
125#include "weights_p4linux964_spmd_sse3.inc"
126 ELSEIF(dd_optimization==3) THEN
127
128#include "weights_p4linuxa964_spmd.inc"
129 ELSE
130
131#if ARCH_CPU
132
133#include "weights_p4linuxa964_spmd.inc"
134#elif 1
135
136#include "weights_p4linux964_spmd.inc"
137#endif
138 ENDIF
139 invtref = one/tpsref
140 DO i = 1, numels
141
142
143
144 npn = 1
145
146 jhbe = 1
147 mid= ixs(1,i)
148 pid= ixs(10,i)
149
150 mln = nint(pm(19,abs(mid)))
151 isol = isolnod(i)
152 wd_local = wd(i)
153
154 IF(recherche==1) THEN
155 mid = mid_old
156 pid = pid_old
157 mln = mln_old
158 isol = isol_old
159 wd_local = zero
160 ENDIF
161
162 IF(isol==8) THEN
163 indi3 = 3
164 ELSEIF(isol==10) THEN
165 indi3 = 4
166 ELSEIF(isol==16) THEN
167 indi3 = 5
168 ELSEIF(isol==20) THEN
169 indi3 = 6
170 ELSEIF(isol==6) THEN
171 indi3 = 7
172 ELSEIF(isol==4) THEN
173 indi3 = 8
174 ELSE
175 indi3 = 9
176 ENDIF
177
178 IF (pid/=0) THEN
179 jhbe = igeo(10,pid)
180 igt = igeo(11,pid)
181 npn = igeo(4,pid)
182 jsrot = igeo(20,pid)
183 ENDIF
184 nfail = mat_param(abs(mid))%NFAIL
185 irup_tab(1:nfail) = 0
186 IF(nfail/=0) THEN
187 DO j=1,nfail
188 irup_tab(j) = mat_param(abs(mid))%FAIL(j)%IRUPT
189 ENDDO
190 ENDIF
191 tmat = 0.
192 trup = 0.
193 tmatadd = 0.
195 opt_1 = zero
196 opt_2 = zero
197 add_option = 0
198 mult = 0
199 flag_non_local = 0
200 special_option = 0
201 spe_i_1 = 1
202 spe_i_2 = 1
203
204
205 composite_option = .false.
206 IF (igeo(30,pid)>0 .AND. igeo(11,pid)==22) THEN
207 composite_option = .true.
208 ENDIF
209
210
211 ismstr = igeo(5,pid)
212
213 ismstr_cost = .false.
214 add_over_cost = zero
215 IF((mln<28).OR.(mln==49).OR.(mln==59)) THEN
216 irup2 = 1
217 ELSE
218 irup2 = 2
219 ENDIF
220
221 ismstr_l = ismstr
222 IF(ismstr<1) THEN
223 ism0 = mat_param(abs(mid))%SMSTR
224 icp0 = mat_param(abs(mid))%STRAIN_FORMULATION
225 IF (icp0 ==2.AND.jhbe/=16) THEN
226 IF (ism0==1) THEN
227 ismstr_l = 11
228 ELSE
229 ismstr_l = 10
230 END IF
231 ELSE
232 IF (ism0==1) THEN
233 ismstr_l = 1
234 ELSE
235 ismstr_l = 2
236 END IF
237 END IF
238 IF (mln == 1.AND.jhbe/=16) ismstr_l = 12
239 ENDIF
240
241
242 IF ( mln==1.OR.mln==38.OR.
243 . mln==90.OR.mln==92.OR.mln==94 ) THEN
244 IF (ismstr_l==10.OR.ismstr_l==12) THEN
245 ismstr_cost = .true.
246 indi = 2
247 ELSE
248 indi = 1
249 ENDIF
250 IF (mat_param(abs(mid))%IVISC > 0) THEN
251 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
252 ENDIF
253 ELSEIF (mln==2) THEN
254 cc = pm(43,mid)
255 IF (cc/=0) THEN
256 indi = 2
257 ELSE
258 indi = 1
259 ENDIF
260 IF (mat_param(abs(mid))%IVISC > 0) THEN
261 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
262 ENDIF
263
264
265 ELSEIF(mln==25) THEN
266 IF (mat_param(abs(mid))%iparam(1)==1) THEN
267 indi = 2
268 ELSE
269 indi = 1
270 ENDIF
271 IF (mat_param(abs(mid))%IVISC > 0) THEN
272 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
273 ENDIF
274
275 ELSEIF (mln == 36)THEN
276 nfunc =
max(ipm(10,mid) - 3,1)
277 IF (nfunc<=2) THEN
278 indi = 1
279 ELSEIF (nfunc>2.AND.nfunc<=7) THEN
280 indi = 2
281 ELSEIF (nfunc>7) THEN
282 indi = 3
283 ENDIF
284 IF (mat_param(abs(mid))%IVISC > 0) THEN
285 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
286 ENDIF
287 ELSEIF (mln==33) THEN
288 nfunc1 = ipm(11,mid)
289 nfunc2 = ipm(12,mid)
290 IF((nfunc1/=0).OR.(nfunc2/=0)) THEN
291 indi = 2
292 ELSE
293 indi = 1
294 ENDIF
295 IF (mat_param(abs(mid))%IVISC > 0) THEN
296 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
297 ENDIF
298 ELSEIF((mln==42).OR.(mln==62).OR.(mln==69)) THEN
299
300 nfunc = 0
301 IF (mln==42) nfunc = mat_param(abs(mid))%IPARAM(2)
302 IF (mln==62) THEN
303 iad = ipm(7,abs(mid))-1
304 nfunc = nint(bufmat(iad+3))
305 END IF
306 IF (nfunc==0) THEN
307 indi = 1
308 ivisc = mat_param(abs(mid))%IVISC
309 IF (ivisc == 1 .or. ivisc == 2) THEN
310 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
311 ENDIF
312 ELSEIF(nfunc==1) THEN
313 indi = 2
314 ELSEIF(nfunc==2) THEN
315 indi = 3
316 ELSEIF(nfunc>2) THEN
317 indi = 3
318 mult = nfunc - 2
319 indi2 = 2
320 ENDIF
321 ELSEIF((mln==82)) THEN
322 iad=ipm(7,abs(mid))-1
323 nfunc=nint(bufmat(iad+1))
324 IF(nfunc<=1) THEN
325 indi = 1
326 IF (mat_param(abs(mid))%IVISC > 0) THEN
327 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
328 ENDIF
329 ELSEIF(nfunc==2) THEN
330 indi = 2
331 ELSEIF(nfunc==3) THEN
332 indi = 3
333 ELSEIF(nfunc>3) THEN
334 indi = 3
335 mult = nfunc - 3
336 indi2 = 2
337 ENDIF
338 ELSEIF(mln==100) THEN
339
340
341
342
343 indi=1
344 iad=ipm(7,abs(mid))-1
345
346 add_option = 0
347 opt_1 = zero
348 indi_opt_1 = 2
349 opt_2 = zero
350 indi_opt_2 = 2
351
352
353 IF(nint(bufmat(iad+5))>0) THEN
354 opt_1 = one
355 indi_opt_1 = 2
356 add_option = 1
357 ENDIF
358
359 IF(nint(bufmat(iad+1))>0) THEN
360 opt_2 = nint(bufmat(iad+1))
361 indi_opt_2 = 3
362 add_option = 1
363
364 opt_1 = one
365 indi_opt_1 = 2
366 add_option = 1
367 ENDIF
368 ELSEIF(mln==104) THEN
369 iad=ipm(7,abs(mid))-1
370 flag_nice_newton=nint(bufmat(iad+11))
371 IF(flag_nice_newton==2) THEN
372 indi = 2
373 ELSE
374 indi = 1
375 ENDIF
376 flag_gurson=nint(bufmat(iad+30))
377 IF(flag_gurson/=0) THEN
378 special_option=1
379 spe_i_1 = 1
380 spe_i_2 = 1
381 ENDIF
382 IF(flag_gurson==1) THEN
383 spe_i_2 = 1
384 ELSEIF(flag_gurson==2) THEN
385 spe_i_2 = 2
386 ELSEIF(flag_gurson==3) THEN
387 spe_i_2 = 3
388 ENDIF
389 flag_non_local = mat_param(abs(mid))%NLOC
390 IF (mat_param(abs(mid))%IVISC > 0) THEN
391 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
392 ENDIF
393 ELSE
394 indi = 1
395 IF (mat_param(abs(mid))%IVISC > 0) THEN
396 visc_prony = visc_prony_cost * mat_param(abs(mid))%VISC%IPARAM(1)
397 ENDIF
398 ENDIF
399 IF(ismstr_cost) add_over_cost = elm_over_cost(1)
400
401 mult_spe = 0.
402 spe_i_3 = 1
403 IF(flag_non_local/=0) THEN
404 spe_i_3 = 1
405 mult_spe = 1.
406 ENDIF
407 cost_check = 0
408
409
410
411
412 IF (isol==4.AND. (jsrot /= 1)) THEN
413
414 IF(recherche==0.AND.test_poids/=0) THEN
415 poin_part = iparts(i)
416 poin_mid = poin_part_sol(1,poin_part,6)
417 poin_pid = poin_part_sol(2,poin_part,6)
418 IF(poin_mid/=0.AND.poin_pid/=0) THEN
419 IF(mid_pid_sol(poin_mid,6)%COST1D(poin_pid)/=zero) THEN
420 cost_check = 1
421 poin_elm_typ = 6
422 telt = mid_pid_sol(poin_mid,poin_elm_typ)%COST1D(poin_pid)
423 ENDIF
424 ENDIF
425 ENDIF
426
427 IF(cost_check==0) THEN
428 IF( ddweights(1,1,iabs(mid))/=0)THEN
429 tmat = ddweights(1,1,iabs(mid)) * tpsref
430 ELSE
431 IF(mult/=0) tmatadd = mult * (tet4tnl(mln,indi)-tet4tnl(mln,indi2))
432 IF(add_option/=0) tmatadd = opt_1 * tet4tnl(mln,indi_opt_1) + opt_2 * tet4tnl(mln,indi_opt_2
433 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
434 tmat = tet4tnl(mln,indi) + tmatadd
435 ENDIF
436
437
438 IF(nfail/=0) THEN
439 DO j=1,nfail
440 trup = trup + rupture_tet4(irup_tab(j),irup2)
441 ENDDO
442 ENDIF
443
444 telt = tmat + tet4telt(1) + trup + mult_spe*nlocal_option(spe_i_3) + add_over_cost +
visc_prony
445 ENDIF
446
447
448
449
450 ELSEIF ((isol==10).OR.(isol==4.AND. jsrot==1)) THEN
451
452 IF(recherche==0.AND.test_poids/=0) THEN
453 IF(isol==10) THEN
454 poin_part = iparts(i)
455 poin_mid = poin_part_sol(1,poin_part,2)
456 poin_pid = poin_part_sol(2,poin_part,2)
457
458
459 IF(poin_mid/=0.AND.poin_pid/=0) THEN
460 IF(mid_pid_sol(poin_mid,2)%COST1D(poin_pid)/=zero) THEN
461 cost_check = 1
462 poin_elm_typ = 2
463 telt = mid_pid_sol(poin_mid,poin_elm_typ)%COST1D(poin_pid
464 ENDIF
465 ENDIF
466 ELSEIF(isol==4.AND. jsrot==1) THEN
467 poin_part = iparts(i)
468 poin_mid = poin_part_sol(1,poin_part,6)
469 poin_pid = poin_part_sol(2,poin_part,6)
470
471
472 IF(poin_mid/=0.AND.poin_pid/=0) THEN
473 IF(mid_pid_sol(poin_mid,6)%COST1D(poin_pid)/=zero) THEN
474 cost_check = 1
475 poin_elm_typ = 6
476 telt = mid_pid_sol(poin_mid,poin_elm_typ)%COST1D(poin_pid)
477 ENDIF
478 ENDIF
479 ENDIF
480 ENDIF
481
482 IF(cost_check==0) THEN
483 IF( ddweights(1,1,iabs(mid))/=0)THEN
484 tmat = ddweights(1,1,iabs(mid)) * tpsref
485 ELSE
486 IF(mult/=0) tmatadd = mult * (tet10tnl(mln,indi)-tet10tnl(mln,indi2))
487 IF(add_option/=0) tmatadd = opt_1 * tet10tnl(mln,indi_opt_1) + opt_2 * tet10tnl(mln,indi_opt_2)
488 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
489 tmat = tet10tnl(mln,indi) + tmatadd
490 ENDIF
491
492
493 IF(nfail/=0) THEN
494 DO j=1,nfail
495 trup = trup + rupture_tet10(irup_tab(j),irup2)
496 ENDDO
497 ENDIF
498
499 IF(isol==10) telt = tet10telt(1)
500 IF(isol==4.AND. jsrot==1) telt = tet4telt(2)
501 telt = tmat + telt + trup + mult_spe*nlocal_option(spe_i_3) + 4.*(add_over_cost +
visc_prony)
502 ENDIF
503 ELSE
504
505
506
507
508
509 IF(recherche==0.AND.test_poids/=0) THEN
510 IF(isol==6) THEN
511 poin_elm_typ = 5
512 ELSEIF(isol==8) THEN
513 poin_elm_typ = 7
514 ELSEIF(isol==16) THEN
515 poin_elm_typ = 3
516 ELSEIF(isol==20) THEN
517 poin_elm_typ = 4
518 ELSE
519 poin_elm_typ = 1
520 ENDIF
521 poin_part = iparts(i)
522 poin_mid = poin_part_sol(1,poin_part,poin_elm_typ)
523 poin_pid = poin_part_sol(2,poin_part,poin_elm_typ)
524
525
526 IF(poin_mid/=0.AND.poin_pid/=0) THEN
527 IF(mid_pid_sol(poin_mid,poin_elm_typ)%COST1D(poin_pid)/=zero) THEN
528 cost_check = 1
529 telt = mid_pid_sol(poin_mid,poin_elm_typ)%COST1D(poin_pid)
530 ENDIF
531 ENDIF
532 ENDIF
533
534 IF(cost_check==0) THEN
535 IF (jhbe==1) THEN
536
537 IF( ddweights(1,1,iabs(mid))/=0)THEN
538 tmat = ddweights(1,1,iabs(mid)) * tpsref
539 ELSE
540 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
541 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
542 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
543 tmat = sol1tnl(mln,indi) + tmatadd
544 ENDIF
545
546
547 IF(nfail/=0) THEN
548 DO j=1,nfail
549 trup = trup + rupture_sol(irup_tab(j),irup2)
550 ENDDO
551 ENDIF
552
553 telt = tmat + soltelt(1) + trup + mult_spe*nlocal_option(spe_i_3) + add_over_cost +
visc_prony
554 ELSEIF (jhbe==2) THEN
555
556 IF( ddweights(1,1,iabs(mid))/=0)THEN
557 tmat = ddweights(1,1,iabs(mid)) * tpsref
558 ELSE
559 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
560 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1
561 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
562 tmat = sol1tnl(mln,indi) + tmatadd
563 ENDIF
564
565
566 IF(nfail/=0) THEN
567 DO j=1,nfail
568 trup = trup + rupture_sol(irup_tab(j),irup2)
569 ENDDO
570 ENDIF
571
572 telt = tmat + soltelt(2) + trup + mult_spe*nlocal_option(spe_i_3) + add_over_cost +
visc_prony
573 ELSEIF (jhbe==24.OR.jhbe==104) THEN
574
575 IF( ddweights(1,1,iabs(mid))/=0)THEN
576 tmat = ddweights(1,1,iabs(mid)) * tpsref
577 ELSE
578 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
579 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
580 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
581 tmat = sol1tnl(mln,indi) + tmatadd
582 ENDIF
583
584
585 IF(nfail/=0) THEN
586 DO j=1,nfail
587 trup = trup + rupture_sol(irup_tab(j),irup2)
588 ENDDO
589 ENDIF
590
591 telt = tmat + soltelt(3) + trup + mult_spe*nlocal_option(spe_i_3) + add_over_cost +
visc_prony
592
593 ELSEIF (jhbe==12) THEN
594
595 IF( ddweights(1,1,iabs(mid))/=0)THEN
596 tmat = ddweights(1,1,iabs(mid)) * tpsref
597 ELSE
598 IF(mult/=0) tmatadd = mult * (sol8tnl(mln,indi)-sol8tnl(mln,indi2))
599 IF(add_option/=0) tmatadd = opt_1 * sol8tnl(mln,indi_opt_1) + opt_2 * sol8tnl(mln,indi_opt_2)
600 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
601 tmat = sol8tnl(mln,indi) + tmatadd
602 ENDIF
603
604
605 IF(nfail/=0) THEN
606 DO j=1,nfail
607 trup = trup + rupture_sol12(irup_tab(j),irup2)
608 ENDDO
609 ENDIF
610
611 telt = tmat + soltelt(4) + trup + mult_spe*nlocal_option(spe_i_3) + 8.*(add_over_cost +
visc_prony)
612 ELSEIF ( (jhbe==14.OR.(jhbe>=222.AND.jhbe<=999)).AND.(igt/=20.AND.igt/=21.AND.igt/=22)) THEN
613
614 mpt = abs(npn)
615 nptr =
max(mpt/100,1)
616 npts =
max(mod(mpt/10,10),1)
617 nptt =
max(mod(mpt,10),1)
618 nptot = npts*nptt*nptr
619
620 IF( ddweights(1,1,iabs(mid))/=0)THEN
621 tmat = ddweights(1,1,iabs(mid)) * tpsref
622 ELSE
623 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
624 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
625 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
626 tmat = sol1tnl(mln,indi) + tmatadd
627 ENDIF
628
629
630 IF(nfail/=0) THEN
631 DO j=1,nfail
632 trup = trup + rupture_sol(irup_tab(j),irup2)
633 ENDDO
634 ENDIF
635
636
637
638 overcost_elm = 0
639 IF(nptot>8) overcost_elm = nptot-8
640 telt = nptot*(tmat+trup+add_over_cost+
visc_prony)+soltelt(5) +overcost_elm *soltelt(6) +
641 . mult_spe*nlocal_option(spe_i_3)
642 ELSEIF(jhbe==14.AND.(igt==20.OR.igt==21.OR.igt==22)) THEN
643
644 mpt = abs(npn)
645 nptr =
max(mpt/100,1)
646 npts =
max(mod(mpt/10,10),1)
647 nptt =
max(mod(mpt,10),1)
648 nptot = npts*nptt*nptr
649
650 IF( ddweights(1,1,iabs(mid))/=0)THEN
651 tmat = ddweights(1,1,iabs(mid)) * tpsref
652 ELSE
653 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
654 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
655 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
656
657 number_layer = 0
658
659
660 IF(igeo(30,pid)>9) THEN
661 number_layer = igeo(30,pid)
662 icpr = igeo(14,pid)
663
664 IF(icpr==100) THEN
665 overcost_elm = npts*nptt
666 ELSEIF(icpr==10) THEN
667 overcost_elm = nptt*nptr
668 ELSE
669 overcost_elm = npts*nptr
670 ENDIF
671 ELSE
672 ! number of layer <= 9 --> number of layer = icpr direction
673 icpr = igeo(14,pid)
674 number_layer = igeo(30,pid)
675
676 IF(icpr==100) THEN
677 number_layer = nptr
678 overcost_elm = npts*nptt
679 ELSEIF(icpr==10) THEN
680 number_layer = npts
681 overcost_elm = nptt*nptr
682 ELSE
683 number_layer = nptt
684 overcost_elm = npts*nptr
685 ENDIF
686 ENDIF
687
688
689
690 IF(composite_option) THEN
691 DO nlay=1,number_layer
692 composite_mid = igeo(100+nlay,pid)
693 composite_mln = nint(pm(19,abs(composite_mid)))
694 tmatadd = tmatadd + sol1tnl(composite_mln,indi)
695 ENDDO
696 tmatadd = tmatadd - sol1tnl(mln,indi)
697 ENDIF
698 tmat = sol1tnl(mln,indi) + tmatadd
699 ENDIF
700
701
702 IF(nfail/=0) THEN
703 DO j=1,nfail
704 trup = trup + rupture_sol(irup_tab(j),irup2)
705 ENDDO
706 ENDIF
707
708
709
710 telt = overcost_elm*(tmat+
visc_prony)+nptot*trup +
711 . overcost_elm*number_layer*soltelt(10) + mult_spe*nlocal_option(spe_i_3) +
712 . overcost_elm * add_over_cost
713 ELSEIF(jhbe==15) THEN
714
715
716
717 IF( ddweights(1,1,iabs(mid))/=0)THEN
718 tmat = ddweights(1,1,iabs(mid)) * tpsref
719 ELSE
720 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
721 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
722 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
723 tmat = sol1tnl(mln,indi) + tmatadd
724 ENDIF
725
726
727 IF(nfail/=0) THEN
728 DO j=1,nfail
729 trup = trup + rupture_sol(irup_tab(j),irup2)
730 ENDDO
731 ENDIF
732
733 nptot = abs(npn)
734
735
736 telt = nptot*(tmat+trup+
visc_prony) + soltelt(11) + nptot*soltelt(12) +
737 . mult_spe*nlocal_option(spe_i_3) + add_over_cost
738
739 ELSEIF (jhbe==17) THEN
740
741
742 IF( ddweights(1,1,iabs(mid))/=0)THEN
743 tmat = ddweights(1,1,iabs(mid)) * tpsref
744 ELSE
745 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
746 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
747 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
748 tmat = sol1tnl(mln,indi) + tmatadd
749 ENDIF
750
751
752 IF(nfail/=0) THEN
753 DO j=1,nfail
754 trup = trup + rupture_sol(irup_tab(j),irup2)
755 ENDDO
756 ENDIF
757
758 telt = (tmat+trup+add_over_cost+
visc_prony)*8 + soltelt(7) + mult_spe*nlocal_option(spe_i_3)
759 ELSEIF (jhbe==18) THEN
760
761 IF( ddweights(1,1,iabs(mid))/=0)THEN
762 tmat = ddweights(1,1,iabs(mid)) * tpsref
763 ELSE
764 IF(mult/=0) tmatadd = mult * (sol1tnl(mln,indi)-sol1tnl(mln,indi2))
765 IF(add_option/=0) tmatadd = opt_1 * sol1tnl(mln,indi_opt_1) + opt_2 * sol1tnl(mln,indi_opt_2)
766 IF(special_option/=0) tmatadd = tmatadd + sol_option(spe_i_1,spe_i_2)
767 tmat = sol1tnl(mln,indi) + tmatadd
768 ENDIF
769
770
771 IF(nfail/=0) THEN
772 DO j=1,nfail
773 trup = trup + rupture_sol(irup_tab(j),irup2)
774 ENDDO
775 ENDIF
776
777 telt = (tmat+trup+add_over_cost+
visc_prony)*8 + soltelt(9) + mult_spe*nlocal_option(spe_i_3)
778 ELSE
779
780
781 IF(nfail/=0) THEN
782 DO j=1,nfail
783 trup = trup + rupture_sol(irup_tab(j),irup2)
784 ENDDO
785 ENDIF
786
787 telt = sol1tnl(mln,1) + soltelt(1) + trup
788 . + mult_spe*nlocal_option(spe_i_3) + add_over_cost +
visc_prony
789 ENDIF
790 ENDIF
791 ENDIF
792
793 poids = telt * invtref
794
795 IF(recherche==0) THEN
796 IF (wd_local==0..AND.mln/=0)THEN
797 wd(i) = poids
798 poin_part = iparts(i)
799 IF (isol==4.AND. (jsrot /= 1)) THEN
800 poin_elm_typ = 6
801 ELSEIF( (isol==10).OR.(isol==4.AND. jsrot==1) ) THEN
802 IF(isol==10) THEN
803 poin_elm_typ = 2
804 ELSE
805 poin_elm_typ = 6
806 ENDIF
807 ELSE
808 IF(isol==6) THEN
809 poin_elm_typ = 5
810 ELSEIF(isol==8) THEN
811 poin_elm_typ = 7
812 ELSEIF(isol==16) THEN
813 poin_elm_typ = 3
814 ELSEIF(isol==20) THEN
815 poin_elm_typ = 4
816 ELSE
817 poin_elm_typ = 1
818 ENDIF
819 ENDIF
820 poin_part = iparts(i)
821 poin_mid = poin_part_sol(1,poin_part,poin_elm_typ)
822 poin_pid = poin_part_sol(2,poin_part,poin_elm_typ)
823 IF(poin_mid/=0.AND.poin_pid/=0) mid_pid_sol(poin_mid,poin_elm_typ)%COST1D(poin_pid) = telt
824 ELSEIF(mln==0)THEN
825 wd(i) = 0.0001
826 END IF
827 ELSE
828 telt_pro = telt
829 ENDIF
830
831 ENDDO
832 RETURN
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)