55
56
57
58 USE my_alloc_mod
59 USE intbuf_fric_mod
62 use element_mod , only : nixs,nixc,nixtg,nixt,nixp,nixr
63
64
65
66#include "implicit_f.inc"
67
68
69
70#include "com01_c.inc"
71#include "com04_c.inc"
72#include "param_c.inc"
73#include "remesh_c.inc"
74#include "scr03_c.inc"
75#include "scr17_c.inc"
76#include "units_c.inc"
77
78
79
80 INTEGER NRT, NINT, NTY, NOINT,NSN,IGAP,INTFRIC,NMN,IGSTI,
81 . INACTI,NRT_SH ,ILEV ,IGAP0,,NRTS,IGEO(NPROPGI,*)
82 INTEGER IRECT(4,*), IXS(NIXS,*), IXC(NIXC,*),
83 . NSV(*), IXTG(NIXTG,*), IXT(NIXT,*), IXP(NIXP,*),
84 . KNOD2ELS(*), KNOD2ELC(*), KNOD2ELTG(*), NOD2ELS(*), NOD2ELC(*),
85 . NOD2ELTG(*), IELES(*), INTTH, IELEC(*),
86 . SH3TREE(KSH3TREE,*), SH4TREE(KSH4TREE,*),IXR(NIXR,*) ,
87 . IPART(LIPART1,*), IPARTC(*), IPARTTG(*),
88 . ITAB(*), IXS10(6,*),MSEGTYP(*), IXS16(8,*), IXS20(12,*),MVOISN(4,*),
89 . IWORKSH(3,*),TAGPRT_FRIC(*),IPARTFRICS(*),IPARTFRICM(*),
90 . IRECTS(4,*),IELNRTS(*),ADRECTS(4,*),FACNRTS(*),MSR(*)
91
93 . stfac, gap,gapmin,gapinf, gapmax_s,bgapsmx ,gapmax_m
94
96 . x(3,*), stf(*), pm(npropm,*), geo(npropg,*), stfn(*),
97 . ms(*),wa(*),gap_s(*),gap_m(*),gap_n(12,*),
98 . areas(*),thk(*),thk_part(*),pen_old(5,nsn), fillsol(*),
99 . pm_stack(20,*)
100 INTEGER ID,IPARTNS(*),IPARTS(*)
101 INTEGER, DIMENSION(NUMELT), INTENT(IN) :: IPARTT
102 INTEGER, DIMENSION(NUMELP), INTENT(IN) :: IPARTP
103 INTEGER, DIMENSION(NUMELR), INTENT(IN) :: IPARTR
104 INTEGER, DIMENSION(NUMELS), INTENT(INOUT):: ELEM_LINKED_TO_SEGMENT
105 CHARACTER(LEN=NCHARTITLE) :: TITR
106 TYPE(INTBUF_FRIC_STRUCT_) INTBUF_FRIC_TAB(*)
107 TYPE (SURF_) :: IGRSURF
108 TYPE (SURF_) :: IGRSURF2
109 INTEGER, INTENT(IN) :: FLAG_ELEM_INTER25(NINTER25,NUMELS)
110
111
112
113 INTEGER NDX, I, J, INRT, NELS, MT, JJ, JJJ, NELC,
114 . MG, NUM, NPT, LL, L, NN, NELTG,N1,N2,N3,N4,IE,
115 . IP, NLEV, MYLEV, K, P, R, T,NRT1,NRT2,NSHIF,
116 . NS,IGTYP,NRTT,IPL,IPFMAX,
117 . IPFLMAX,NM,NEL,FC,PERM,NSHIFF,N,IPG
118
119 INTEGER JPERM(4) ,FACES(4,6),TAB1(4),TAB2(4),FACES10(3,16)
120
122 . dxm, gapmx, gapmn,
area, vol, dx,gaps1,gaps2, gapm, ddx,
123 . gaptmp, gapscale,sx1,sy1,sz1,sx2,sy2,sz2,sx3,sy3,sz3,
124 . slsfac,xl,gaps_mn
125 INTEGER, DIMENSION(:),ALLOCATABLE ::TAGNOD,TAGB
126 DATA jperm/2,3,4,1/
127 DATA faces/1,2,3,4,
128 . 1,2,6,5,
129 . 2,3,7,6,
130 . 3,4,8,7,
131 . 1,5,8,4,
132 . 5,6,7,8/
133 DATA faces10/1,11,14,
134 . 3,11,15,
135 . 5,14,15,
136 . 11,14,15,
137 . 1,13,14,
138 . 6,13,16,
139 . 5,14,16,
140 . 13,14,16,
141 . 3,11,12,
142 . 6,12,13,
143 . 1,11,13,
144 . 11,12,13,
145 . 3,12,15,
146 . 6,12,16,
147 . 5,15,16,
148 . 12,15,16/
149
150
151
152
153
154
155
156
157
158 slsfac = stfac
159 dxm=zero
160 ndx=0
161 nshif=0
162 gapmx=ep30
163 gapmn=ep30
164 gaps1=zero
165 gaps2=zero
166 gaps_mn=ep30
167 gapscale = one
168
169
170 nrtt =nrt+nrt_sh
171
172
173
174 ALLOCATE(tagb(numnod))
175 DO i=1,numnod
176 wa(i)=zero
177 ENDDO
178 DO i=1,numelc
179 mg=ixc(6,i)
180 ip = ipartc(i)
181 igtyp = igeo(11,mg)
182 IF ( thk_part(ip) /= zero .AND. iintthick == 0) THEN
183 dx=half*thk_part(ip)
184 ELSEIF ( thk(i) /= zero .AND. iintthick == 0) THEN
185 dx=half*thk(i)
186 ELSEIF(igtyp == 17 .OR. igtyp ==51 .OR. igtyp ==52) THEN
187 dx=half*thk(i)
188 ELSE
189 dx=half*geo(1,mg)
190 ENDIF
191 wa(ixc(2,i))=
max(wa(ixc(2,i)),dx)
192 wa(ixc(3,i))=
max(wa(ixc(3,i)),dx)
193 wa(ixc(4,i))=
max(wa(ixc(4,i)),dx)
194 wa(ixc(5,i))=
max(wa(ixc(5,i)),dx)
195 ENDDO
196 DO i=1,numeltg
197 mg=ixtg(5,i)
198 ip = iparttg(i)
199 igtyp = igeo(11,mg)
200 IF ( thk_part(ip) /= zero .AND. iintthick == 0) THEN
201 dx=half*thk_part(ip)
202 ELSEIF ( thk(numelc+i) /= zero .AND. iintthick == 0) THEN
203 dx=half*thk(numelc+i)
204 ELSEIF(igtyp == 17 .OR. igtyp ==51 .OR. igtyp ==52) THEN
205 dx=half*thk(numelc+i)
206 ELSE
207 dx=half*geo(1,mg)
208 ENDIF
209 wa(ixtg(2,i))=
max(wa(ixtg(2,i)),dx)
210 wa(ixtg(3,i))=
max(wa(ixtg(3,i)),dx)
211 wa(ixtg(4,i))=
max(wa(ixtg(4,i)),dx)
212 ENDDO
213
214 IF (ilev/=3) THEN
215 DO i=1,numnod
216 tagb(i) = 0
217 END DO
218 DO i=1,nrt
219 IF (msegtyp(i) /= 0) THEN
220 DO j =1,4
221 nn= irect(j,i)
222 tagb(nn) = 1
223 END DO
224 END IF
225 END DO
226 DO i=1,numnod
227 IF (tagb(i)==0) wa(i)=0
228 END DO
229 END IF
230
231 DO i=1,numelt
232 mg=ixt(4,i)
233 ip = ipartt(i)
234 IF ( thk_part(ip) > zero ) THEN
235 dx=half*thk_part(ip)
236 ELSE
237 dx=half*sqrt(geo(1,mg))
238 END IF
239 wa(ixt(2,i))=
max(wa(ixt(2,i)),dx)
240 wa(ixt(3,i))=
max(wa(ixt(3,i)),dx)
241 ENDDO
242 DO i=1,numelp
243 mg=ixp(5,i)
244 ip = ipartp(i)
245 IF ( thk_part(ip) > zero ) THEN
246 dx=half*thk_part(ip)
247 ELSE
248 dx=half*sqrt(geo(1,mg))
249 END IF
250 wa(ixp(2,i))=
max(wa(ixp(2,i)),dx)
251 wa(ixp(3,i))=
max(wa(ixp(3,i)),dx)
252 ENDDO
253 DO i=1,numelr
254 ip = ipartr(i)
255 IF ( thk_part(ip) > zero ) THEN
256 mg=ixr(1,i)
257 igtyp = igeo(11,mg)
258 dx=half*thk_part(ip)
259 wa(ixr(2,i))=
max(wa(ixr(2,i)),dx)
260 wa(ixr(3,i))=
max(wa(ixr(3,i)),dx)
261 IF (igtyp==12) wa(ixr(4,i))=
max(wa(ixr(4,i)),dx)
262 END IF
263 ENDDO
264 DO i=1,nsn
265 gap_s(i)=gapscale * wa(nsv(i))
266 gap_s(i)=
min(gap_s(i),gapmax_s)
267 ENDDO
268
269 IF(igap0 > 0)THEN
270 DO i=1,numnod
271 tagb(i)=0
272 ENDDO
273
274 IF(ilev /= 3 )THEN
275 CALL i24bord(igrsurf2%NSEG ,igrsurf2%NODES ,tagb)
276 ENDIF
277 IF(ilev == 2)THEN
278 CALL i24bord(igrsurf%NSEG ,igrsurf%NODES ,tagb)
279 ENDIF
280 DO i=1,nsn
281 ns = nsv(i)
282 IF( tagb(ns) > 0 ) gap_s(i) = em20
283 ENDDO
284 ENDIF
285
286 DO i=1,nsn
287 gaps1=
max(gaps1,gap_s(i))
288 gaps_mn=
min(gaps_mn,gap_s(i))
289 ENDDO
290
291 IF(intth > 0 ) THEN
292 IF(nadmesh==0)THEN
293 DO i = 1,nsn
294 areas(i) = zero
295 DO j= knod2elc(nsv(i))+1,knod2elc(nsv(i)+1)
296 ie = nod2elc(j)
297 sx1 = x(1,ixc(4,ie)) - x(1,ixc(2,ie))
298 sy1 = x(2,ixc(4,ie)) - x(2,ixc(2,ie))
299 sz1 = x(3,ixc(4,ie)) - x(3,ixc(2,ie))
300 sx2 = x(1,ixc(5,ie)) - x(1,ixc(3,ie))
301 sy2 = x(2,ixc(5,ie)) - x(2,ixc(3,ie))
302 sz2 = x(3,ixc(5,ie)) - x(3,ixc(3,ie))
303 sx3 = sy1*sz2 - sz1*sy2
304 sy3 = sz1*sx2 - sx1*sz2
305 sz3 = sx1*sy2 - sy1*sx2
306 areas(i) = areas(i)
307 . + one_over_8*sqrt(sx3*sx3+sy3*sy3+sz3*sz3)
308
309 ielec(i) = ixc(1,ie)
310 END DO
311
312 DO j= knod2eltg(nsv(i))+1,knod2eltg(nsv(i)+1)
313 ie = nod2eltg(j)
314 sx1 = x(1,ixtg(3,ie)) - x(1,ixtg(2,ie))
315 sy1 = x(2,ixtg(3,ie)) - x(2,ixtg(2,ie))
316 sz1 = x(3,ixtg(3,ie)) - x(3,ixtg(2,ie))
317 sx2 = x(1,ixtg(4,ie)) - x(1,ixtg(2,ie))
318 sy2 = x(2,ixtg(4,ie)) - x(2,ixtg(2,ie))
319 sz2 = x(3,ixtg(4,ie)) - x(3,ixtg(2,ie))
320 sx3 = sy1*sz2 - sz1*sy2
321 sy3 = sz1*sx2 - sx1*sz2
322 sz3 = sx1*sy2 - sy1*sx2
323 areas(i) = areas(i)
324 . + one_over_6*sqrt(sx3*sx3+sy3*sy3+sz3*sz3)
325
326 ielec(i) = ixtg(1,ie)
327 END DO
328 END DO
329 ELSE
330 DO i = 1,nsn
331 areas(i) = zero
332 DO j= knod2elc(nsv(i))+1,knod2elc(nsv(i)+1)
333 ie = nod2elc(j)
334
335 ip = ipartc(ie)
336 nlev =ipart(10,ip)
337 mylev=sh4tree(3,ie)
338 IF(mylev < 0) mylev=-(mylev+1)
339
340 IF(mylev==nlev)THEN
341 sx1 = x(1,ixc(4,ie)) - x(1,ixc(2,ie))
342 sy1 = x(2,ixc(4,ie)) - x(2,ixc(2,ie))
343 sz1 = x(3,ixc(4,ie)) - x(3,ixc(2,ie))
344 sx2 = x(1,ixc(5,ie)) - x(1,ixc(3,ie))
345 sy2 = x(2,ixc(5,ie)) - x(2,ixc(3,ie))
346 sz2 = x(3,ixc(5,ie)) - x(3,ixc(3,ie))
347 sx3 = sy1*sz2 - sz1*sy2
348 sy3 = sz1*sx2 - sx1*sz2
349 sz3 = sx1*sy2 - sy1*sx2
350 areas(i) = areas(i)
351 . + one_over_8*sqrt(sx3*sx3+sy3*sy3+sz3*sz3)
352
353 ielec(i) = ixc(1,ie)
354 END IF
355
356 END DO
357
358 DO j= knod2eltg(nsv(i))+1,knod2eltg(nsv(i)+1)
359 ie = nod2eltg(j)
360
361 ip = iparttg(ie)
362 nlev =ipart(10,ip)
363 mylev=sh3tree(3,ie)
364 IF(mylev < 0) mylev=-(mylev+1)
365
366 IF(mylev==nlev)THEN
367 sx1 = x(1,ixtg(3,ie)) - x(1,ixtg(2,ie))
368 sy1 = x(2,ixtg(3,ie)) - x(2,ixtg(2,ie))
369 sz1 = x(3,ixtg(3,ie)) - x(3,ixtg(2,ie))
370 sx2 = x(1,ixtg(4,ie)) - x(1,ixtg(2,ie))
371 sy2 = x(2,ixtg(4,ie)) - x(2,ixtg(2,ie))
372 sz2 = x(3,ixtg(4,ie)) - x(3,ixtg(2,ie))
373 sx3 = sy1*sz2 - sz1*sy2
374 sy3 = sz1*sx2 - sx1*sz2
375 sz3 = sx1*sy2 - sy1*sx2
376 areas(i) = areas(i)
377 . + one_over_6*sqrt(sx3*sx3+sy3*sy3+sz3*sz3)
378
379 ielec(i) = ixtg(1,ie)
380 END IF
381
382 END DO
383 END DO
384 END IF
385 END IF
386
387
388
389
390 IF(intfric > 0) THEN
391
392 IF(numels/=0)THEN
393 DO i = 1,nsn
394 ipfmax = 0
395 ipflmax = 0
396 DO j= knod2els(nsv(i))+1,knod2els(nsv(i)+1)
397 ie = nod2els(j)
398 ip = iparts(ie)
399 ipg = tagprt_fric(ip)
400 IF(ipg > 0.AND.ip>ipfmax) THEN
402 . ipg,intbuf_fric_tab(intfric)%S_TABPARTS_FRIC,
403 . intbuf_fric_tab(intfric)%TABPARTS_FRIC,ipl)
404 IF(ipl /=0) THEN
405 ipfmax = ip
406 ipflmax = ipl
407 ENDIF
408 ENDIF
409 ENDDO
410
411
412 IF(ipfmax/=0) THEN
413 ipartfrics(i) = ipflmax
414 ENDIF
415
416 ENDDO
417 ENDIF
418
419 IF(numelc/=0.OR.numeltg/=0) THEN
420 DO i = 1,nsn
421 ipfmax = 0
422 ipflmax = 0
423 DO j= knod2elc(nsv(i))+1,knod2elc(nsv(i)+1)
424 ie = nod2elc(j)
425 ip = ipartc(ie)
426 ipg = tagprt_fric(ip)
427 IF(ipg > 0.AND.ip>ipfmax) THEN
429 . ipg,intbuf_fric_tab(intfric)%S_TABPARTS_FRIC,
430 . intbuf_fric_tab(intfric)%TABPARTS_FRIC,ipl)
431 IF(ipl /=0) THEN
432 ipfmax = ip
433 ipflmax = ipl
434 ENDIF
435 ENDIF
436 ENDDO
437
438
439 DO j= knod2eltg(nsv(i))+1,knod2eltg(nsv(i)+1)
440 ie = nod2eltg(j)
441 ip = iparttg(ie)
442 ipg = tagprt_fric(ip)
443 IF(ipg > 0.AND.ip>ipfmax) THEN
445 . ipg,intbuf_fric_tab(intfric)%S_TABPARTS_FRIC,
446 . intbuf_fric_tab(intfric)%TABPARTS_FRIC,ipl)
447
448 IF(ipl /=0) THEN
449 ipfmax = ip
450 ipflmax = ipl
451 ENDIF
452 ENDIF
453 ENDDO
454
455 IF(ipfmax/=0) THEN
456 ipartfrics(i) = ipflmax
457 ENDIF
458
459 ENDDO
460 ENDIF
461 ENDIF
462
463
464
465 IF(intnitsche > 0 ) THEN
466
467
468
471 DO nm=1,nmn
473 END DO
474
475 DO i=1,nrts
476 DO j=1,4
478 irects(j,i) = nm
479 ENDDO
480 ENDDO
481
483
484
485 IF (ilev==2) THEN
486 nrt1=igrsurf2%NSEG
487 DO i=1,nrt1
488 nel=igrsurf2%ELEM(i)
489 IF(igrsurf2%ELTYP(i)==1 ) THEN
490 ielnrts(i) = nel
491 ENDIF
492 ENDDO
493 nshiff = nrt1
494 nrt2=igrsurf%NSEG
495 DO i=1,nrt2
496 nel=igrsurf%ELEM(i)
497 IF(igrsurf%ELTYP(i) == 1 ) THEN
498 ielnrts(nshiff+i) = nel
499 ENDIF
500 ENDDO
501 ELSE
502 DO i=1,nrt
503 nel=igrsurf%ELEM(i)
504 IF(igrsurf%ELTYP(i) == 1 ) THEN
505 ielnrts(i) = nel
506 ENDIF
507 ENDDO
508 ENDIF
509
510
511 adrects(1:4,1:nrt) = 0
512 DO i=1,nrt
513 ie = ielnrts(i)
514 n1 = irect(1,i)
515 n2 = irect(2,i)
516 n3 = irect(3,i)
517 n4 = irect(4,i)
518
519
520 IF(ie > 0) THEN
521
522 IF (ie <= numels8 ) THEN
523
524 DO k=1,4
525 DO j=1,8
526 IF(adrects(k,i)==0) THEN
527 n=ixs(j+1,ie)
528 IF(n==irect(k,i)) THEN
529 adrects(k,i) = j
530 ENDIF
531 ENDIF
532 ENDDO
533 ENDDO
534
535 IF(n3==n4) THEN
536 DO k=1,4
537 IF(adrects(k,i) == 5) THEN
538 adrects(k,i) = 6
539 ELSEIF(adrects(k,i) == 6) THEN
540 adrects(k,i) = 5
541 ENDIF
542 ENDDO
543 ENDIF
544
545 ELSEIF(ie <= numels8+numels10 ) THEN
546 DO k=1,3
547 DO j=1,6
548 n=ixs10(j,ie-numels8)
549 IF(n==irect(k,i)) THEN
550 adrects(k,i) = 10 +j
551 ENDIF
552 ENDDO
553 DO j=1,8
554 IF(adrects(k,i)==0) THEN
555
556 n=ixs(j+1,ie)
557 IF(n==irect(k,i)) THEN
558 adrects(k,i) = j
559 ENDIF
560 ENDIF
561 ENDDO
562
563 ENDDO
564 ELSEIF(ie <= numels8+numels10+numels20 ) THEN
565 DO k=1,4
566 DO j=1,12
567 n=ixs20(j,ie-numels8-numels10)
568 IF(n==irect(k,i)) THEN
569 adrects(k,i) = 20 +j
570 ENDIF
571 ENDDO
572 DO j=1,8
573 IF(adrects(k,i)==0) THEN
574 n=ixs(j+1,ie)
575 IF(n==irect(k,i)) THEN
576 adrects(k,i) = j
577 ENDIF
578 ENDIF
579 ENDDO
580 ENDDO
581 ELSEIF(ie <= numels8+numels10+numels20+numels16)THEN
582 DO k=1,4
583 DO j=1,8
584 n=ixs20(j,ie-numels8-numels10-numels20)
585 IF(n==irect(k,i)) THEN
586 adrects(k,i) = 40 +j
587 ENDIF
588 ENDDO
589 DO j=1,8
590 IF(adrects(k,i)==0) THEN
591 n=ixs(j+1,ie)
592 IF(n==irect(k,i)) THEN
593 adrects(k,i) = j
594 ENDIF
595 ENDIF
596 ENDDO
597
598 ENDDO
599 ENDIF
600
601 ENDIF
602
603 ENDDO
604
605
606 DO i=1,nrt
607 ie = ielnrts(i)
608 n1 = irect(1,i)
609 n2 = irect(2,i)
610 n3 = irect(3,i)
611 n4 = irect(4,i)
612
613 IF(ie > 0) THEN
614
615 IF(ie<= numels8 ) THEN
616 IF(n3 /= n4) THEN
617 tab1(1) = n1
618 tab1(2) = n2
619 tab1(3) = n3
620 tab1(4) = n4
621 DO k=1,4
622 DO j=1,4-k
623 IF(tab1(j+1) < tab1(j)) THEN
624 perm = tab1(j+1)
625 tab1(j+1) = tab1(j)
626 tab1(j) = perm
627 ENDIF
628 ENDDO
629 ENDDO
630
631 DO fc=1,6
632 tab2(1) = ixs(faces(1,fc)+1,ie)
633 tab2(2) = ixs(faces(2,fc)+1,ie)
634 tab2(3) = ixs(faces(3,fc)+1,ie)
635 tab2(4) = ixs(faces(4,fc)+1,ie)
636 DO k=1,4
637 DO j=1,4-k
638 IF(tab2(j+1) < tab2(j)) THEN
639 perm = tab2(j+1)
640 tab2(j+1) = tab2(j)
641 tab2(j) = perm
642 ENDIF
643 ENDDO
644 ENDDO
645 IF(tab1(1)==tab2(1).AND.tab1(2)==tab2(2).AND.tab1(3)==tab2(3)) THEN
646 facnrts(i) = fc
647 EXIT
648 ENDIF
649 ENDDO
650 ELSE
651 tab1(1) = n1
652 tab1(2) = n2
653 tab1(3) = n3
654
655 DO k=1,3
656 DO j=1,3-k
657 IF(tab1(j+1) < tab1(j)) THEN
658 perm = tab1(j+1)
659 tab1(j+1) = tab1(j)
660 tab1(j) = perm
661 ENDIF
662 ENDDO
663 ENDDO
664
665 DO fc=1,6
666 n1 = ixs(faces(1,fc)+1,ie)
667 n2 = ixs(faces(2,fc)+1,ie)
668 n3 = ixs(faces(3,fc)+1,ie)
669 n4 = ixs(faces(4,fc)+1,ie)
670 tab2(1) =n1
671 IF(n1/=n2.AND.n2/=n3) THEN
672 tab2(2) =n2
673 tab2(3) =n3
674 ELSEIF(n1/=n2) THEN
675 tab2(2) =n2
676 tab2(3) =n4
677 ELSEIF(n2/=n3) THEN
678 tab2(2) =n3
679 tab2(3) =n4
680 ELSE
681 EXIT
682 ENDIF
683 DO k=1,3
684 DO j=1,3-k
685 IF(tab2(j+1) < tab2(j)) THEN
686 perm = tab2(j+1)
687 tab2(j+1) = tab2(j)
688 tab2(j) = perm
689 ENDIF
690 ENDDO
691 ENDDO
692 IF(tab1(1)==tab2(1).AND.tab1(2)==tab2(2).AND.tab1(3)==tab2(3)) THEN
693 facnrts(i) = fc
694 EXIT
695 ENDIF
696 ENDDO
697 ENDIF
698
699 ELSEIF(ie<= numels8+numels10 ) THEN
700 tab1(1) = adrects(1,i)
701 tab1(2) = adrects(2,i)
702 tab1(3) = adrects(3,i)
703 DO k=1,3
704 DO j=1,3-k
705 IF(tab1(j+1) < tab1(j)) THEN
706 perm = tab1(j+1)
707 tab1(j+1) = tab1(j)
708 tab1(j) = perm
709 ENDIF
710 ENDDO
711 ENDDO
712 DO fc=1,16
713 IF(tab1(1)==faces10(1,fc).AND.tab1(2)==faces10(2,fc).AND.tab1(3)==faces10(3,fc)) THEN
714 facnrts(i) = fc
715 EXIT
716 ENDIF
717 ENDDO
718
719 ELSEIF(ie <= numels8+numels10+numels20 ) THEN
720
721 ENDIF
722
723 ENDIF
724
725 ENDDO
726
727 ENDIF
728
729
730
731
732
733 IF (ilev==2) THEN
734
735 nrt1=igrsurf2%NSEG
737 1 x ,irect ,stf ,ixs ,pm ,
738 2 geo ,nrt1 ,ixc ,nint ,stfac ,
739 3 nty ,gap ,noint ,stfn ,nsn ,
740 4 ms ,nsv ,ixtg ,igap ,gap_m ,
741 6 ixt ,ixp ,slsfac,dxm ,ndx ,
742 9 knod2els ,knod2elc ,knod2eltg ,nod2els ,
743 a nod2elc,nod2eltg ,igrsurf2 ,intth,
744 b ieles ,ielec ,areas ,sh4tree ,sh3tree ,
745 c ipart ,ipartc ,iparttg ,thk ,thk_part ,
746 d ixr ,itab ,bgapsmx ,ixs10 ,msegtyp ,
747 e ixs16 ,ixs20 ,gap_n ,gaps1 ,gaps2 ,
748 f gapmx , gapmn ,gapscale ,nshif ,gapmax_m,
749 g
id ,titr ,igeo ,fillsol ,nrtt ,
750 h pm_stack, iworksh,intfric ,tagprt_fric,ipartfrics,
751 i ipartfricm,iparts,intbuf_fric_tab ,elem_linked_to_segment,
752 j igsti , flag_elem_inter25)
753 nrt2=igrsurf%NSEG
754 nshif = nrt1
756 1 x ,irect ,stf ,ixs ,pm ,
757 2 geo ,nrt2 ,ixc ,nint ,stfac ,
758 3 nty ,gap ,noint ,stfn ,nsn ,
759 4 ms ,nsv ,ixtg ,igap ,gap_m ,
760 6 ixt ,ixp ,
761 8 slsfac,dxm ,ndx ,
762 9 knod2els ,knod2elc ,knod2eltg ,nod2els ,
763 a nod2elc,nod2eltg ,igrsurf ,intth,
764 b ieles ,ielec ,areas ,sh4tree ,sh3tree ,
765 c ipart ,ipartc ,iparttg ,thk ,thk_part ,
766 d ixr ,itab ,bgapsmx ,ixs10 ,msegtyp ,
767 e ixs16 ,ixs20 ,gap_n ,gaps1 ,gaps2 ,
768 f gapmx , gapmn ,gapscale ,nshif ,gapmax_m,
769 g
id ,titr ,igeo ,fillsol ,nrtt ,
770 h pm_stack , iworksh,intfric,tagprt_fric,ipartfrics,
771 i ipartfricm,iparts,intbuf_fric_tab ,elem_linked_to_segment,
772 j igsti , flag_elem_inter25)
773 ELSE
775 1 x ,irect ,stf ,ixs ,pm ,
776 2 geo ,nrt ,ixc ,nint ,stfac ,
777 3 nty ,gap ,noint ,stfn ,nsn ,
778 4 ms ,nsv ,ixtg ,igap ,gap_m ,
779 6 ixt ,ixp ,slsfac,dxm ,ndx ,
780 9 knod2els ,knod2elc ,knod2eltg ,nod2els ,
781 a nod2elc,nod2eltg ,igrsurf ,intth,
782 b ieles ,ielec ,areas ,sh4tree ,sh3tree ,
783 c ipart ,ipartc ,iparttg ,thk ,thk_part ,
784 d ixr ,itab ,bgapsmx ,ixs10 ,msegtyp ,
785 e ixs16 ,ixs20 ,gap_n ,gaps1 ,gaps2 ,
786 f gapmx , gapmn ,gapscale ,nshif ,gapmax_m,
787 g
id ,titr ,igeo ,fillsol ,nrtt ,
788 h pm_stack , iworksh,intfric,tagprt_fric,ipartfrics,
789 i ipartfricm,iparts,intbuf_fric_tab
790 j igsti , flag_elem_inter25)
791 END IF
792
793
794
795
796
797 gapmx=sqrt(gapmx)
798 gapmx=
min(gapmx,gapmax_m)
799
800
801
802 IF(gap<=zero)THEN
803 IF(ndx/=0)THEN
804 gapmin = gapmn
805 gapmin =
min(half*gapmx,gapmin)
806 ELSE
807
808 gapmin = zero
809 ENDIF
810
811 ELSE
812 gapmin = gap
813 ENDIF
814
815 gapmx=zero
816 gapmn=ep30
817 DO i=1,nrt
818 gapmx=
max(gapmx,gap_m(i))
819 gapmn=
min(gapmn,gap_m(i))
820 END DO
821 IF(ipri>=1) THEN
822 IF(gap<=zero)THEN
823 WRITE(iout,1400)gaps_mn,gaps1
824 WRITE(iout,1500)gapmn,gapmx
825 END IF
827
828 gap = gaps1+gaps2
829
830
831
832 DO 610 l=1,nsn
833 stfn(l) = one
834 610 CONTINUE
835
836
837
838 bgapsmx = zero
839 gapinf=ep30
840 DO i = 1, nsn
841 gapinf =
min(gapinf,gap_s(i))
842 bgapsmx =
max(bgapsmx,gap_s(i))
843 ENDDO
844 DO i = 1, nrt
845 gapinf =
min(gapinf,gap_m(i))
846 ENDDO
847 gapinf=
max(gapinf,gapmin)
848
849 DO i=1,nrt
850 CALL insol3et(x ,irect ,ixs ,nint ,mvoisn(2,i),i ,
851 .
area ,noint ,knod2els,nod2els,ixs10 ,
852 . ixs16,ixs20 ,mvoisn(1,i))
853
854 IF (mvoisn(1,i)==10) THEN
855
856 gap_n(1,i) = three*one_over_8*gap_n(1,i)
857 stf(i) = sixteen*stf(i)
858 ELSEIF (mvoisn(1,i)==16) THEN
859 gap_n(1,i) = gap_n(1,i)/4
860 END IF
861 END DO
862
863
864
865
866
867
868
869
870 IF (nrt_sh>0) THEN
871 j=nrt
872 DO i=1,nrt
873 IF (msegtyp(i) > 0 .AND.msegtyp(i)<=nrtt ) THEN
874 j = j + 1
875 stf(j) = stf(i)
876 gap_m(j)=gap_m(i)
877 IF(intth > 0 ) ieles(j) = ieles(i)
878 IF(intfric > 0) ipartfricm(j)=ipartfricm(i)
879 END IF
880 END DO
881 END IF
882
883
884
885
886 IF (inacti/=0) THEN
888 1 x ,irect ,nrt ,nsn ,nsv ,pen_old, stf)
889
890 DO i=1,numnod
891 tagb(i)=0
892 ENDDO
893
894 DO i=1,numelc
895 ip = ipartc(i)
896 DO j=1,4
897 tagb(ixc(1+j,i))=ip
898 ENDDO
899 ENDDO
900 DO i=1,numeltg
901 ip = iparttg(i)
902 DO j=1,3
903 tagb(ixtg(1+j,i))=ip
904 ENDDO
905 ENDDO
906
907
908
909
910
911
912
913
914
915
916
917
918 DO i=1,nrt
919 IF (mvoisn(2,i)>0) THEN
920 ip = iparts(mvoisn(2,i))
921 mvoisn(3,i) =ip
922 DO j=1,4
923 tagb(irect(j,i))=ip
924 ENDDO
925 END IF
926 END DO
927 DO i=1,nsn
928 ns = nsv(i)
929 ipartns(i) = tagb(ns)
930
931 IF (ipartns(i)==0) ipartns(i) =-1
932 ENDDO
933
934 j=nrt
935 DO i=1,nrt
936 IF (msegtyp(i) > 0 .AND.msegtyp(i)<=nrtt) THEN
937 j = j + 1
938 ip = tagb(irect(1,i))
939 mvoisn(3,i) =ip
940 mvoisn(3,j) =ip
941 END IF
942 END DO
943 END IF
944
945 DEALLOCATE(tagb)
946 RETURN
947
948 1400 FORMAT(2x,'MIN,MAX OF SECONDARY GAP: ',2(1pg20.13))
949 1500 FORMAT(2x,'MIN,MAX OF MAIN GAP: ',2(1pg20.13)/)
subroutine i24normns(x, irect, nrt, nsn, nsv, pen_old, stf)
subroutine i24bord(nseg, surf_nodes, tagb)
subroutine i24gapm(x, irect, stf, ixs, pm, geo, nrt, ixc, nint, stfac, nty, gap, noint, stfn, nsn, ms, nsv, ixtg, igap, gap_m, ixt, ixp, slsfac, dxm, ndx, knod2els, knod2elc, knod2eltg, nod2els, nod2elc, nod2eltg, igrsurf, intth, ieles, ielec, areas, sh4tree, sh3tree, ipart, ipartc, iparttg, thk, thk_part, ixr, itab, bgapsmx, ixs10, msegtyp, ixs16, ixs20, gap_n, gaps1, gaps2, gapmx, gapmn, gapscale, nshift, gapmax_m, id, titr, igeo, fillsol, nrtt, pm_stack, iworksh, intfric, tagprt_fric, ipartfrics, ipartfricm, iparts, intbuf_fric_tab, elem_linked_to_segment, igsti, flag_elem_inter25)
subroutine insol3et(x, irect, ixs, nint, nel, i, area, noint, knod2els, nod2els, ixs10, ixs16, ixs20, nnod)
integer, parameter nchartitle
subroutine tagnod(ix, nix, nix1, nix2, numel, iparte, tagbuf, npart)