39 1 X ,II_STOK, CAND_B ,CAND_E ,ITASK,
40 2 NBRIC ,ITAB , BUFBRIC ,NCAND,
57 use element_mod ,
only : nixs
61#include "implicit_f.inc"
78 INTEGER CAND_B(NCAND),CAND_E(NCAND), NCAND, NIN,
79 . ITASK, NBRIC, ITAB(*),
80 . BUFBRIC(NBRIC), IXS(NIXS,*), II_STOK
85 INTEGER NB_NCN,NB_NCN1,NB_ECN,I,J,K,L,DIR,NB_NC,NB_EC,
86 . N1,N2,N3,N4,NN,NE,NCAND_PROV,J_STOK,II,JJ,TT,
87 . NSNF, NSNL, TANGENT(12),
88 . prov_b(2*mvsiz), prov_e(2*mvsiz), last_ne,
89 . voxbnd(2*mvsiz,0:1,1:3)
92 . dx,dy,dz,xs,ys,zs,xx,sx,sy,sz,s2,
93 . xmin, xmax,ymin,
ymax,zmin, zmax, tz, gapsmx, gapl,
94 . d1x,d1y,d1z,d2x,d2y,d2z,dd1,dd2,d2,a2,gs, point(3),point2(3),d_1,d_2
97 INTEGER IX,IY,IZ,NEXT,M(8),
98 . IX1,IY1,IZ1,IX2,IY2,IZ2,IBUG,IBUG2,I_LOC,
99 . BIX1(NBRIC),BIY1(NBRIC),BIZ1(NBRIC),
100 . bix2(nbric),biy2(nbric),biz2(nbric),
101 . first_add, prev_add, lchain_add, i_stok , idb_id
103 INTEGER,
DIMENSION(1) :: SHELL_ADD
105 INTEGER :: NC, I_STOK_BAK, IPA,IPB
107 . xminb,yminb,zminb,xmaxb,ymaxb,zmaxb,
109 . aaa, basisconst2,ns,
110 . power(8), cutcoor,cutcoor2,cut(2),
111 . pow(2), old_cutcoor, old_cutshell, cutnode(2)
115 LOGICAL,
DIMENSION(NBRIC) :: COUNT
117 LOGICAL :: BOOL(NIRECT_L)
118 INTEGER NBCUT, NBCUT2,DEJA, ISONSHELL, ISONSH3N
119 INTEGER :: COUNTER, NEDGE, NFACE, NODES8(8), COUNTER_BRICK(NBRIC)
121 INTEGER :: iN(2), iN1a, iN2a, iN1b, iN2b , iN3, iN4
122 INTEGER :: POS, IAD, IADE, IB ,IBG , NBF, NBL
123 INTEGER :: I_12bits, nbits, npqts, pqts(4), SOM, SECTION
124 INTEGER :: I_bits(12), MAX_ADD, IMIN_LOC, IMAX_LOC
126 my_real :: aeradiag, debugtab(24*ncand,3)
127 LOGICAL db_FLAG, TAGnode(8), debug_outp
129 CHARACTER*12 :: sectype
130 CHARACTER*12 ::filename
131 LOGICAL :: IsSecDouble
133 CHARACTER(LEN=1) filenum
136 . min_ix_loc, min_iy_loc, min_iz_loc,
137 . max_ix_loc, max_iy_loc, max_iz_loc
139 INTEGER :: ISHIFT, IDX
141 my_real,
dimension(:),
allocatable :: POWB
143 INTEGER :: A(5), IE, N_CUT_EDGE
145 INTEGER :: TAG_INDEX(NBRIC), I8(8,NBRIC),IFLG_DB
146 my_real :: r8(8,nbric), denom,
norm, tolcrit,tol
151 a(1:5)=((/1,2,3,4,1/))
181 nbf = 1+itask*
nb/nthread
182 nbl = (itask+1)*
nb/nthread
209 if(itask==0.AND.debug_outp)
then
211 print *,
"================================="
212 print *,
"==== BRICK INTERSECTIONS ====="
213 print *,
"================================="
218 nbl = (itask+1)*
nb/nthread
223 ALLOCATE(basisconst(
ncande,4))
258 if(itask==0 .AND. debug_outp)print *,
""
272 nbf = 1+itask*
ncande/nthread
273 nbl = (itask+1)*
ncande/nthread
277 m(3:4)=irect_l(3:4,ne)
287 ptz(i,1)=fourth*sum( irect_l( 05:08,ne) )
288 ptz(i,2)=fourth*sum( irect_l( 09:12,ne) )
289 ptz(i,3)=fourth*sum( irect_l( 13:16,ne) )
292 ptz(i,1)=irect_l(08,ne)
293 ptz(i,2)=irect_l(12,ne)
301 pta(i,1:3,tt) = irect_l((/4,8,12/)+ipa,ne)
302 vza(i,1:3,tt) = irect_l((/4,8,12/)+ipa,ne)-ptz(i,1:3)
303 vzb(i,1:3,tt) = irect_l((/4,8,12/)+ipb,ne
304 vne(i,1:3,tt) = vza(i,(/2,3,1/),tt)*vzb(i,(/3,1,2/),tt) -
305 . vza(i,(/3,1,2/),tt)*vzb(i,(/2,3,1/),tt)
307 norm = vne(i,1,tt)*vne(i,1,tt)+vne(i,2,tt)*vne
310 vne(i,1,tt) = vne(i,1,tt) /
norm
311 vne(i,2,tt) = vne(i,2,tt) /
norm
314 basisconst(i,tt) = sum(ptz(i,1:3)*vne(i,1:3,tt))
327 if(itask==0 .AND. debug_outp)
then
328 print *,
" Calcul des Intersections sur Proc=", itask+1
332 nbf = 1+itask*
ncandb/nthread
333 nbl = (itask+1)*
ncandb/nthread
349 print *,
"idb_ID====="
350 print *,
"CAND_E =", cand_e(
iadf(i):
iadl(i))
372 power(1:8)=(/(sum(vne(iade,1:3,tt) * x(1:3,ixs(ii,ibg)))- basisconst(iade,tt),ii=2,9)/)
383 print *,
"J=", j, itab(in(1:2))
384 write(*,fmt=
'(A,4I20)')
"shell N1-N2-N3 :",int(irect_l(01:04,ie))
385 write(*,fmt=
'(A,3F20.12)')
" shell N1 :",irect_l( (/05,09,13/),ie)
386 write(*,fmt=
'(A,3F20.12)')
" shell N2 :",irect_l( (/06,10,14/),ie)
387 write(*,fmt=
'(A,3F20.12)')
" shell N3 :",irect_l( (/07,11,15/),ie)
388 write(*,fmt=
'(A,2F40.20)')
" POW(1:2)=", pow(1:2)
393 print *,
"idb_ID====="
394 write(*,fmt=
'(A,4I20)')
"shell N1-N2-N3-N4 :",int(irect_l(01:04,ie))
398 print *,
"POW1,POW2", pow(1:2)
410 tol = (one+em04)*tolcrit*
diag22(i)
412 IF((abs(pow(1))<=tol).AND.(abs(pow(2))<=tol))
THEN
418 IF( ((pow(1)<-tol).AND.(pow(2)>tol)) .OR.((pow(1)>tol).AND.(pow(2)<-tol)) )
THEN
419 on1(1:3) = x(1:3,in(1))
421 denom = sum( vne(iade,1:3,tt) * n1n2(1:3) )
422 IF(abs(denom)>em12)
THEN
423 cutcoor = ( basisconst(iade,tt) - sum( vne(iade,1:3,tt) * on1(1:3) ) ) / denom
430 IF((cutcoor<=one+tol).AND.(cutcoor>=-tol))
THEN
431 cutcoor =
min(one-em06,cutcoor)
432 cutcoor =
max(em06 ,cutcoor)
433 point(1:3)=on1(1:3) + cutcoor * n1n2(1:3)
435 print *,
" CUTCOOR =", cutcoor
440 ELSEIF((abs(pow(1))<=tol).AND.(abs(pow(2))<=tol))
THEN
458 ELSEIF (abs(pow(1))<=tol)
THEN
461 on1(1:3) = x(1:3,in(1))
478 ELSEIF (abs(pow(2))<=tol)
THEN
481 on1(1:3) = x(1:3,in(1))
484 point(1:3) = on1(1:3) + one * n1n2(1:3)
503 if (ixs(11,
brick_list(nin,i)%id)==idb_id )
then
504 print *,
"cutcoor=", cutcoor
510 IF(nbcut==-1) nbcut =isonsh3n( ptz(iade,1:3),pta(iade,1:3,tt),vza(iade,1:3,tt),vzb(iade,1:3,tt),point
511 IF(nbcut2==-1)nbcut2=isonsh3n( ptz(iade,1:3),pta(iade,1:3,tt),vza
514 print *,
"NBCUT, NBCUT2=", nbcut,nbcut2
527 old_cutcoor =
edge_list(nin,k)%CUTCOOR(1)
528 old_cutshell =
edge_list(nin,k)%CUTSHELL(1)
529 IF (abs(cutcoor-old_cutcoor)>em6)
THEN
531 IF(cutcoor>old_cutcoor)
THEN
532 edge_list(nin,k)%CUTCOOR(1) = old_cutcoor
534 edge_list(nin,k)%CUTSHELL(1) = old_cutshell
537 ELSEIF(cutcoor<old_cutcoor)
THEN
539 edge_list(nin,k)%CUTCOOR(2) = old_cutcoor
541 edge_list(nin,k)%CUTSHELL(2) = old_cutshell
549 if(itask==0 .AND. debug_outp)
then
551 print *,
"THREE INTERSECTION SUR UNE ARRETE - STOP"
557 edge_list(nin,k)%LEN = sqrt(n1n2(1)*n1n2(1)+n1n2(2)*n1n2(2)+n1n2(3)*n1n2(3))
560 IF(nbcut2>0 .AND. deja==0)
THEN
566 print *,
"edge fully on intersection plane",j
578 if (ixs(11,
brick_list(nin,i)%id)==idb_id )print *,
"TANGENT 1-12=", tangent
581 IF(tangent(j)==1)
THEN
606 IF(cutcoor==em06 .OR. cutcoor==one
THEN
620 IF(nbcut==1 .AND. cutcoor>em06 .AND. cutcoor<one-em06)
THEN
642 print *,
" ===== intersection_nodes.txt ======="
645 filename(1:12) =
"cut_nod0.txt"
646 write(filename(8:8),
'(i1.1)')ispmd+1
648 open( unit=ipa, file = filename(1:12) )
655 write (unit=ipa,fmt=
'(A,I10)')
"cell ID = ", ixs(11,
brick_list(nin,i)%id)
656 write (* ,fmt=
'(A,I10)')
"cell ID = ", ixs(11,
brick_list(nin,i)%id)
661 cut(1:2) =
edge_list(nin,iad)%CUTCOOR(1:2)
663 n1n2(1:3) =
edge_list(nin,iad)%VECTOR(1:3)
664 on1(1:3) = x(1:3,in(1))
667 point(1:3)= on1(1:3) + cut(k) * n1n2(1:3)
672 . fmt=
'(A12,F20.14,A1,F20.14,A1,F20.14,A13)')
"*createnode ",point(1) ,
" ", point(2),
" ",point
" 0 0 0 "
674 . fmt=
'(A12,F20.14,A1,F20.14,A1,F20.14,A13)')
"*createnode ",point(1) ,
" ", point(2),
" ",point(3),
" 0 0 0 "
681 if(sum(abs(point(1:3)-debugtab(l,1:3)))<em06)
687 debugtab(som,1:3) =point(1:3)
717 print *,
" |--------i22intersect.F---------|"
718 print *,
" | EDGES |"
719 print *,
" |-------------------------------|"
720 print *, 12*nb ,
" edges (12*NBRIC)"
722 if(ibug22_intersect/=-1 .and. ibug22_intersect/=ixs(11,brick_list(nin,i)%id))cycle
723 print *,
" ** CELL **", ixs(11,brick_list(nin
726 IF( edge_list(nin,k)%NBCUT==0)
THEN
727 WRITE(*,fmt=
'(A10,I10,A1,I12,I12,A8)')
" edge ",k,
":",
728 . itab(edge_list(nin,k)%NODE(1)),
729 . itab(edge_list(nin,k)%NODE(2)),
" "
730 ELSEIF( edge_list(nin,k)%NBCUT==1)
THEN
731 WRITE(*,fmt=
'(A10,I10,A1,I12,I12,A8,1F30.16)')
" edge ",k,
":",
732 . itab(edge_list(nin,k)%NODE(1)),
733 . itab(edge_list(nin,k)%NODE(2)),
" CUTTED :" ,edge_list(nin,k)%CUTCOOR(1)
735 WRITE(*,fmt=
'(A10,I10,A1,I12,I12,A8,2F30.16)')
" edge ",k,
":",
736 . itab(edge_list(nin,k)%NODE(1)),
737 . itab(edge_list(nin,k)%NODE(2)),
" 2CUTTED :" ,edge_list(nin,k)%CUTCOOR(1:2)
751 DEALLOCATE(basisconst)
752 DEALLOCATE(nbsubtriangles)