38 1 IXS, X, ITASK, NIN, BUFBRIC)
93 use element_mod ,
only : nixs
97#include "implicit_f.inc"
103#include "subvolumes.inc"
107 1 SECtype, Nbits, Npqts)
108 INTEGER :: Nbits, Npqts
109 CHARACTER*(*) :: SECtype
116 INTEGER :: IXS(,*), ITASK, NIN, BUFBRIC(*)
117 my_real,
intent(in) ::
122 INTEGER I, J, JJ, K, L,S, NE, POS, ,NBCUT, Icode, Idble, IB
123 INTEGER I_12BITS, PQTS(4), NPQTS, NBITS, SOM, I_bits(12)
124 INTEGER NBF, NBL, ID, N, id1, id2
128 INTEGER,
POINTER,
DIMENSION(:) :: pCODE, pTAG, pGnod
129 CHARACTER*14,
DIMENSION(:),
POINTER ::pSEC
131 CHARACTER*14 :: dbKEY1, dbKEY2
132 integer idb1(0:ncandb), idb2(0:ncandb)
133 INTEGER :: tagTETRA(S_TETRA),tagPENTA(S_PENTA),tagPOLY3(S_POLY3),
134 . taghexae(s_hexae),tagpoly4(s_poly4)
135 INTEGER :: MultICODE(S22_MAX), MultIDBLE(S22_MAX)
136 CHARACTER*14 :: MultiSECtype(S22_MAX)
138 LOGICAL :: bool1, bool2
139 INTEGER :: BasedOnUsedNodes
140 INTEGER :: UsedNodes, Gnod
141 INTEGER :: SecTypeList(0:106)
143INTEGER :: SizeL , SizeLFIX ,SizeLVAR
144 INTEGER :: NINTP , TAB(12)
146 LOGICAL :: bFOUND, debug_outp
147 INTEGER :: CODE, brickID, bAND, IE, Iremoved
148 my_real :: point(3),cutcoor
163 nbf = 1+itask*
nb/nthread
164 nbl = (itask+1)*
nb/nthread
172 1 i , icode , idble, nbits, npqts,
173 2 idb1(i), idb2(i), nin )
202 if(itask==0.AND.debug_outp)
then
204 print *, " |----------
i22ident.f-----------|
"
205 print *, " | identification intersection |
"
206 print *, " |-------------------------------|
"
211 !===================================================================
212 ! 3 Potential Polyhedron Detection : stored in SecTypeList in [1,106]
213 !===================================================================
218 K = 1 !numero plan intersection pour %SECtype
219 ICODE=BRICK_LIST(NIN,I)%ICODE
220 IDBLE=BRICK_LIST(NIN,I)%IDBLE
221 NBITS=BRICK_LIST(NIN,I)%Nbits
222 NPQTS=BRICK_LIST(NIN,I)%Npqts
223 BRICK_LIST(NIN,I)%Sectype(1:8) = '--------------'
226 !-----------------------------------------------------------------------!
227 ! Listing all potential polyhedron !
228 !-----------------------------------------------------------------------!
230 IF(NBITS<3)GOTO 50 !sous-variete de dim 1
231 !------------------------!
233 !------------------------!
238 pCODE => bCODE(D:D+S-1) !bincode
239 pSEC => StrCODE(D:D+S-1) !sectype
241 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
242 SecTypeList(K) = D+J-1
246.AND..OR.
IF(NBITS==3(NPQTS==1NPQTS==3))GOTO 50 !no other intersection
247 !------------------------!
249 !------------------------!
250.AND.
IF(NBITS>=4NPQTS>=3)THEN
255 pCODE => bCODE(D:D+S-1) !bincode
256 pSEC => StrCODE(D:D+S-1) !sectype
258 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
259 SecTypeList(K) = D+J-1 !code_id in [1,106]
263 !------------------------!
265 !------------------------!
266 IF(NBITS>=5)THEN !NPQTS>=3 deja verifie
271 pCODE => bCODE(D:D+S-1) !bincode
272 pSEC => StrCODE(D:D+S-1) !sectype
274 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
275 SecTypeList(K) = D+J-1 !code_id in [1,106]
280 !------------------------!
282 !------------------------!
283 IF(NPQTS==4)THEN !NBIT>=4 deja verifie
288 pCODE => bCODE(D:D+S-1) !bincode
289 pSEC => StrCODE(D:D+S-1) !sectype
291 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
292 SecTypeList(K) = D+J-1 !code_id in [1,106]
297 !------------------------!
299 !------------------------!
300 IF(NBITS>=6)THEN !NPQTS>=3 deja verifie
305 pCODE => bCODE(D:D+S-1)
306 pSEC => StrCODE(D:D+S-1)
308 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
309 SecTypeList(K) = D+J-1 !code_id in [1,106]
314 !------------------------!
316 !------------------------!
317 IF(NBITS>=6)THEN !NPQTS>=3 deja verifie
322 pCODE => bCODE(D:D+S-1)
323 pSEC => StrCODE(D:D+S-1)
325 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
326 SecTypeList(K) = D+J-1 !code_id in [1,106]
331 !------------------------!
333 !------------------------!
334 IF(NBITS>=6)THEN !NPQTS>=3 deja verifie
339 pCODE => bCODE(D:D+S-1)
340 pSEC => StrCODE(D:D+S-1)
342 IF( IAND(ICODE,pCODE(J))==pCODE(J) )THEN
343 SecTypeList(K) = D+J-1 !code_id in [1,106]
348 !------------------------!
350 !------------------------!
351.AND.
! IF(NBITS>=5 IDBLE>0)THEN !NPQTS>=3 deja verifie
356 ! pCODE => bCODE(D:D+S-1)
357 ! pSEC => StrCODE(D:D+S-1)
359 ! bAND = IAND(ICODE,pCODE(J))
360 ! bool1 = bAND==pCODE(J)
362 ! IF(BTEST(IDBLE,12-IABS(Gcorner(5,D+J-1))))THEN
363 ! SecTypeList(K) = D+J-1 !code_id in [1,106]
369.AND.
END IF !(NBITS>=4NPQTS>=3)
372 SecTypeList(0) = K - 1 !number of potential combination
373 SizeL = SecTypeList(0)
380 DO K=1,SecTypeList(0)
386.AND.
! if(itask==0debug_outp)then
387.or.
! if(ibug22_ident==-1 ibug22_ident==ixs(11,brick_list(nin,ib)%id))then
388! print *, " cell id * :
",IXS(11,BRICK_LIST(NIN,I)%ID)
389! write (*,FMT='(A,I12,A,12L1,A,I12,A,12L1)') , "icode =
",ICODE," ", (BTEST(ICODE,12-K),K=1,12),
390! . " idble=
", IDBLE, " ",(BTEST(IDBLE,12-K),K=1,12)
391! do K=1,SecTypeList(0)
393! print *, J, StrCODE(J)
399 IF(SecTypeList(0)==0)CYCLE !next IB
400 IF(ICODE==0)CYCLE !next IB
407! TAB(1:12) = (/(BTEST(IDBLE,12-J),J=1,12)/)
408! NINTP = NBITS + (SUM(IABS(TAB)))
409 NINTP = NBITS + POPCNT(IDBLE)
411 LIST_VAR(1:SizeL) = LIST(1:SizeL)
419 brickID = IXS(11,BRICK_LIST(NIN,I)%ID)
429 print *, "**warning inter22 : unused intersection points
for this element
",brickID
441.AND..AND..OR..AND.
ELSEIF(SIZEL==2 ((LIST(1)>=45LIST(1)<=49) (LIST(1)>=51LIST(1)<=57)))THEN !sigle hexae or poly4
442 IF(LIST(2) == LIST(1)+1)THEN
443 IF( ICODE==IDBLE )THEN
445 RESULT(1:2) = LIST(1:2)
452 print *, "**warning inter22 : unused intersection points
for this element
",brickID
456 ELSE!IF(ICODE/=IDBLE)THEN !including twice the same polyhedron (now it takes automatically the complmentary since previous ChangeList)
457 CALL INT22LISTCOMBI(ITASK,LIST_FIX,SizeLFIX,LIST_VAR,SizeLVAR,NINTP,ICODE,IDBLE,0,RESULT,bFOUND)
458.NOT..AND.
if((bFOUND)SIZEL==1)then
462.NOT..AND.
elseif((bFOUND)SIZEL>1)then
463 ! if( GetPolyhedraType(LIST(1)) /= GetPolyhedraType(LIST(2)) )then
464 !!!!!!!print *, " *** warning inter22 : simplifying intersection
for cell id=
",brickID
466 RESULT(1) = LIST( MAXLOC(LIST(1:SIZEL),1) )
470 ! CALL REMOVE_DOUBLE_INTP(
471 ! 1 IXS, X, ITASK, NIN, BUFBRIC,
473 ! print *, " cell id exiting removing double
interp:
",IXS(11,BRICK_LIST(NIN,I)%ID)
474 ! Iremoved = Iremoved +1
475 ! IF(Iremoved<=1)GOTO 10
480.EQV.
IF(db_WRITE .TRUE.)THEN
481 !!------output intersection points!!
482 !print *, " ",IXS(11,brick_list(nin,i)%id)
485 NBCUT = EDGE_LIST(NIN,IAD)%NBCUT
487 !write intersection coordinates at the edges
488 CUTCOOR = EDGE_LIST(NIN,IAD)%CUTCOOR(K)
489 POINT(1:3) = X(1:3, EDGE_LIST(NIN,IAD)%NODE(1) ) + CUTCOOR * (EDGE_LIST(NIN,IAD)%VECTOR(1:3))
490 END DO ! (DO K=1,NBCUT <=> NBCUT>0)
497.AND.
!if(itask==0debug_outp)then
498.or.
! if(ibug22_ident==-1 ibug22_ident==ixs(11,brick_list(nin,ib)%id))print *, " final result =
"
499.or.
! if(ibug22_ident==-1 ibug22_ident==ixs(11,brick_list(nin,ib)%id))print *, "result(1:8)=
",RESULT(1:8)
504 BRICK_LIST(NIN,I)%SecID_Cell(J) = CODE
505 BRICK_LIST(NIN,I)%SECTYPE(J) = StrCODE(IABS(CODE))
510 BRICK_LIST(NIN,I)%NBCUT = J-1
512.AND.
! if(itask==0debug_outp)then
513.or..and.
! if(ibug22_ident==-1 ibug22_ident==ixs(11,brick_list(nin,ib)%id) icode/=0)print *,
514 ! . " no intersection detected
"
517.AND.
! if(itask==0debug_outp) then
518.or.
! if(ibug22_ident==-1 ibug22_ident==ixs(11,brick_list(nin,ib)%id)) then
537 call my_barrier !for complete display in order by itask 0
540.or.
if(ibug22_ident==-1 ibug22_ident==ixs(11,brick_list(nin,ib)%id))then
542 !idb1(i) is dependent on ITASK, cannot loop on I=1,NB
547 ICODE=BRICK_LIST(NIN,I)%ICODE
548 NBITS=BRICK_LIST(NIN,I)%Nbits
549 NPQTS=BRICK_LIST(NIN,I)%Npqts
550 print *, " cell id -:
",IXS(11,BRICK_LIST(NIN,I)%ID)
551 WRITE(*,FMT='(A20,I10,A4,I10)') " edges add from
",idb1(i),"",idb2(i)
552 WRITE(*,FMT='(A11,I4,A20,I2,A1,I1,A1)') " icode=
", ICODE, " (nbits,npqts
", NBITS,"",NPQTS,""
553 WRITE(*,FMT='(A11,I4,A20,I2,A1,I1,A1)') " idble=
", IDBLE
554 WRITE(*,FMT='(A,I1)') " num planes=
" , BRICK_LIST(NIN,I)%NBCUT
555 do j=1,BRICK_LIST(NIN,I)%NBCUT
556 dbKEY1(:)=BRICK_LIST(NIN,I)%SECTYPE(j)
557 if(dbKEY1(1:1)=='-') then
558 WRITE(*,FMT='(A)') " --> none
"
560 WRITE(*,FMT='(A,A)') " -->
",dbKEY1(1:14)
568 ICODE=BRICK_LIST(NIN,I)%ICODE
569 NBITS=BRICK_LIST(NIN,I)%Nbits
570 NPQTS=BRICK_LIST(NIN,I)%Npqts
571 print *, " brique id -:
",IXS(11,BRICK_LIST(NIN,I)%ID)
572 WRITE(*,FMT='(A20,I10,A4,I10)') " edges add from
",idb1(i)," to
",idb2(i)
573 WRITE(*,FMT='(A11,I4,A20,I2,A1,I1,A1)') " icode=
", ICODE, " (nbits,npqts) = (
", NBITS,"",NPQTS,""
574 WRITE(*,FMT='(A,I1)') " num planes=
" , BRICK_LIST(NIN,I)%NBCUT
575 do j=1,BRICK_LIST(NIN,I)%NBCUT
576 dbKEY1(:)=BRICK_LIST(NIN,I)%SECTYPE(j)
577 if(dbKEY1(1:1)=='-') then
578 WRITE(*,FMT='(A)') " --> none
"
580 WRITE(*,FMT='(A,A)') " -->
",dbKEY1(1:14)
subroutine i22gbit(iad, icode, idble, nbits, npqts, idb1, idb2, nin)