trjint
C TRJINT SOURCE CHAT 05/01/13 03:49:59 5004 * IDIM,ICONT,ITYEL,IO) C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C INTERSECTION TRAJECTOIRE-ELEMENT ( issu de TRIOEF) C C ENTREES C XDEP POSITION INITIALE C XARI POSITION FINALE C UELEM VITESSE C DTCA PAS DE TEMPS C IDIM DIMENSION DE L ESPACE C ITYEL TYPE DE L ELEMENT C C SORTIES C XINT POSITION A L INTERSECTION C DTINT TEMPS ECOULE JUSQU A LA SORTIE C ICONT NUMERO DE LA PORTE DE SORTIE C IO DIFFERENT DE 0 ON EST SORTI DE L ELEMENT MAIS ON NE SAIT C PAS PAR QUEL COTE C C TYPES D ELEMENTS CONSIDERES C TRI3 TRI6 TRI7 QUA4 QUA9 CUB8 PRI6 C 4 6 7 8 11 14 16 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C IMPLICIT INTEGER(I-N) IMPLICIT REAL*8 (A-H,O-Z) C DIMENSION IJ(2),ZI(2),IFAT3(3),IFAQ4(4),IFAC8(6) DIMENSION IJKL(3,3),IJT4(2,3),IFAT4(4) DIMENSION XARI(3),XDEP(3),XINT(3),UELEM(3),X(4) C DATA IJKL/1,2,3,2,1,3,3,2,1/ DATA IJ /2,1/ DATA IJT4 /2,3, 1,3, 1,2/ DATA IFAT3 /3,1,2/ DATA IFAQ4 /4,2,1,3/ DATA IFAC8 /6,4,3,5,1,2/ DATA IFAT4 /4,1,2,3/ DATA ZI/-1.D0,1.D0/ C ICONT=0 IO=0 DTT=DTCA DO 50 I=1,IDIM XINT(I)=XDEP(I) 50 CONTINUE C write(6,*)' inttrj ',XDEP,XARI,UELEM,DTCA,IDIM,ITYEL C C*** TRIANGLES TRI3 TRI6 TRI7 * C * * C FACES 3 * * 2 C * * C ****** C 1 IF(ITYEL.EQ.4.OR.ITYEL.EQ.6.OR.ITYEL.EQ.7)THEN IDIM=2 XARI(3)=1.D0-XARI(1)-XARI(2) ITEST=0 DO 1 I=1,3 IF(XARI(I)*(1.D0-XARI(I)).GE.0.D0)ITEST=ITEST+1 1 CONTINUE IF(ITEST.NE.3)THEN C ON SORT DU TRIANGLE C C*** COTE 1 ET 3 C DO 2 I1=1,IDIM IF(UELEM(I1).NE.0.AND.XDEP(I1).GT.0.D0)THEN DTI=-XDEP(I1)/UELEM(I1) DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN ITEST=0 I3=IJ(I1) XINT(I3)=XDEP(I3)+UELEM(I3)*DTI X3=1.D0-XINT(I3) IF(XINT(I3)*(1.D0-XINT(I3)).GE.0.D0)ITEST=ITEST+1 IF(X3*(1.D0-X3).GE.0.D0)ITEST=ITEST+1 IF(ITEST.EQ.2)THEN ICONT=IFAT3(I1) XINT(I1)=0.D0 DTINT=DTI RETURN ENDIF ENDIF ENDIF 2 CONTINUE C C*** COTE 2 C IF((UELEM(1)+UELEM(2)).NE.0.D0.AND. * (1.D0-XDEP(1)-XDEP(2)).GT.0.D0) * THEN DTI=(1.D0-XDEP(1)-XDEP(2))/(UELEM(1)+UELEM(2)) DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN XINT(1)=XDEP(1)+UELEM(1)*DTI XINT(2)=XDEP(2)+UELEM(2)*DTI ITEST=0 IF(XINT(1)*(1.D0-XINT(1)).GE.0.D0)ITEST=ITEST+1 IF(XINT(2)*(1.D0-XINT(2)).GE.0.D0)ITEST=ITEST+1 IF(ITEST.EQ.2)THEN ICONT=2 DTINT=DTI RETURN ENDIF ENDIF ENDIF C C*** ?????????? C IO=3 ENDIF C C*** QUADRANGLE QUA4 QUA9 3 C ***** C * * C FACES 4 * * 2 C ***** C 1 ELSEIF(ITYEL.EQ.8.OR.ITYEL.EQ.11)THEN IDIM=2 ITEST=0 DO 3 I=1,IDIM XY=(1.D0+XARI(I))*(1.D0-XARI(I)) IF(XY.GE.0.D0)ITEST=ITEST+1 3 CONTINUE IF(ITEST.NE.IDIM)THEN ID=IDIM-1 DO 4 I1=1,IDIM IF(UELEM(I1).NE.0.D0)THEN DO 5 I4=1,2 C IF(ZI(I4)*(ZI(I4)-XDEP(I1)).le.0.D0) C * write(6,*)' xdep i1',i1,i4,xdep(i1) IF(ZI(I4)*(ZI(I4)-XDEP(I1)).GT.0.D0)THEN DTI=(ZI(I4)-XDEP(I1))/UELEM(I1) DTINT=DTI JI=I1 C IF(DTI*(DTT-DTI).lt.0.D0) C * write(6,*)' dti dtt',dti,dtt IF(DTI*(DTT-DTI).GE.0.D0)THEN ITEST=0 DO 6 I5=2,IDIM I7=IJKL(I5,I1) XINT(I7)=XDEP(I7)+UELEM(I7)*DTI XXX=(XINT(I7)+1.D0)*(1.D0-XINT(I7)) IF(XXX.GE.0.D0)ITEST=ITEST+1 C write(6,*)' itest id ',itest,id,xxx 6 CONTINUE IF(ITEST.EQ.ID)THEN DTINT=DTI XINT(I1)=ZI(I4) ICONT=IFAQ4(2*I1+I4-2) C WRITE(6,*)' SORTIE TRJINT ',XINT,DTINT,ICONT,IO RETURN ENDIF ENDIF ENDIF 5 CONTINUE ENDIF 4 CONTINUE C C*** ?????????? C IO=4 ENDIF C C*** CUBE CUB8 C ELSEIF(ITYEL.EQ.14)THEN IDIM=3 ITEST=0 DO 13 I=1,IDIM XY=(1.D0+XARI(I))*(1.D0-XARI(I)) IF(XY.GE.0.D0)ITEST=ITEST+1 13 CONTINUE IF(ITEST.NE.IDIM)THEN ID=IDIM-1 DO 14 I1=1,IDIM IF(UELEM(I1).NE.0.D0)THEN DO 15 I4=1,2 IF(ZI(I4)*(ZI(I4)-XDEP(I1)).GT.0.D0)THEN DTI=(ZI(I4)-XDEP(I1))/UELEM(I1) DTINT=DTI JI=I1 IF(DTI*(DTT-DTI).GE.0.D0)THEN ITEST=0 DO 16 I5=2,IDIM I7=IJKL(I5,I1) XINT(I7)=XDEP(I7)+UELEM(I7)*DTI XXX=(XINT(I7)+1.D0)*(1.D0-XINT(I7)) IF(XXX.GE.0)ITEST=ITEST+1 16 CONTINUE IF(ITEST.EQ.ID)THEN DTINT=DTI XINT(I1)=ZI(I4) ICONT=IFAC8(2*I1+I4-2) RETURN ENDIF ENDIF ENDIF 15 CONTINUE ENDIF 14 CONTINUE C C*** ?????????? C IO=4 ENDIF C C*** PRISME PRI6 C ELSEIF(ITYEL.EQ.16)THEN IDIM=3 ITEST=0 X(1)=XARI(1) X(2)=XARI(2) X(3)=1.D0-X(1)-X(2) X(4)=XARI(3) DO 7 I=1,3 IF(X(I)*(1.D0-X(I)).GE.0.D0)ITEST=ITEST+1 7 CONTINUE IF((X(4)+1.D0)*(1.D0-X(4)).GE.0.D0)ITEST=ITEST+1 IF(ITEST.NE.4)THEN C C*** FACE 5 ET 3 C DO 8 I1=1,2 IF(UELEM(I1).NE.0.D0.AND.XDEP(I1).GT.0.D0)THEN DTI=-XDEP(I1)/UELEM(I1) DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN ITEST=0 I3=IJ(I1) XINT(I3)=XDEP(I3)+UELEM(I3)*DTI X3=1.D0-XINT(I3) XINT(3)=XDEP(3)+UELEM(3)*DTI IF(XINT(I3)*(1.D0-XINT(I3)).GE.0.D0)ITEST=ITEST+1 IF((XINT(3)+1.D0)*(1.D0-XINT(3)).GE.0.D0)ITEST=ITEST+1 IF(X3*(1.D0-X3).GE.0.D0)ITEST=ITEST+1 IF(ITEST.EQ.3)THEN XINT(I1)=0.D0 ICONT=IFAT3(I1)+2 DTINT=DTI RETURN ENDIF ENDIF ENDIF 8 CONTINUE C C*** FACE 4 C IF((UELEM(1)+UELEM(2)).NE.0.D0.AND. * (1.D0-XDEP(1)-XDEP(2)).GT.0.D0) * THEN DTI=(1.D0-XDEP(1)-XDEP(2))/(UELEM(1)+UELEM(2)) DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN XINT(1)=XDEP(1)+UELEM(1)*DTI XINT(2)=XDEP(2)+UELEM(2)*DTI XINT(3)=XDEP(3)+UELEM(3)*DTI ITEST=0 IF(XINT(1)*(1.D0-XINT(1)).GE.0.D0)ITEST=ITEST+1 IF(XINT(2)*(1.D0-XINT(2)).GE.0.D0)ITEST=ITEST+1 IF((1.D0-XINT(3))*(XINT(3)+1.D0).GE.0.D0)ITEST=ITEST+1 IF(ITEST.EQ.3)THEN ICONT=4 DTINT=DTI RETURN ENDIF ENDIF ENDIF C C*** FACE 1 ET 2 C * .GT.0.D0)THEN DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN ITEST=0 DO 10 I5=1,2 XINT(I5)=XDEP(I5)+UELEM(I5)*DTI IF((1.D0-XINT(I5))*(XINT(I5)+1.D0).GE.0.D0) * ITEST=ITEST+1 10 CONTINUE X3=1.D0-XINT(1)-XINT(2) IF(X3*(1.D0-X3).GE.0.D0)ITEST=ITEST+1 IF(ITEST.EQ.3)THEN ICONT=I2 DTINT=DTI RETURN ENDIF ENDIF ENDIF 9 CONTINUE C C*** ????????????? C IO=5 ENDIF C C ****************** TETRAEDRE C * FACE 1 Y=0 C * FACE 2 Z=0 C * FACE 4 X=0 C * FACE 3 1-X-Y-Z=0 ELSEIF(ITYEL.EQ.23)THEN ITEST=0 DO 20 I=1,3 IF(XARI(I)*(1.D0-XARI(I)).GE.0.D0)ITEST=ITEST+1 20 CONTINUE XXX=XARI(1)+XARI(2)+XARI(3) IF(XXX*(1.D0-XXX).GE.0.D0)ITEST=ITEST+1 C write(6,*)' trjint ', XXX,XARI(1),XARI(2),XARI(3),itest IF(ITEST.NE.4)THEN C write(6,*)' trjint ', XXX,XARI(1),XARI(2),XARI(3),itest C ON SORT DU TETRAEDRE C C*** FACES 1 2 ET 4 C DO 25 I1=1,IDIM C write(6,*)'axes',i1,uelem,xdep IF(UELEM(I1).NE.0.AND.XDEP(I1).GT.0.D0)THEN DTI=-XDEP(I1)/UELEM(I1) DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN ITEST=0 I3=IJT4(2,I1) XINT(I3)=XDEP(I3)+UELEM(I3)*DTI IF(XINT(I3)*(1.D0-XINT(I3)).GE.0.D0)ITEST=ITEST+1 IF(X3*(1.D0-X3).GE.0.D0)ITEST=ITEST+1 C write(6,*)'xint',xint,itest IF(ITEST.EQ.3)THEN ICONT=IFAT4(I1) XINT(I1)=0.D0 DTINT=DTI C write(6,*)' sorti face ',icont,xint,io RETURN ENDIF ENDIF ENDIF 25 CONTINUE C C*** FACE 3 C IF((UELEM(1)+UELEM(2)+UELEM(3)).NE.0.D0.AND. * (1.D0-XDEP(1)-XDEP(2)-XDEP(3)).GT.0.D0) * THEN DTI=(1.D0-XDEP(1)-XDEP(2)-XDEP(3))/ * (UELEM(1)+UELEM(2)+UELEM(3)) DTINT=DTI IF(DTI*(DTT-DTI).GE.0.D0)THEN XINT(1)=XDEP(1)+UELEM(1)*DTI XINT(2)=XDEP(2)+UELEM(2)*DTI XINT(3)=XDEP(3)+UELEM(3)*DTI ITEST=0 IF(XINT(1)*(1.D0-XINT(1)).GE.0.D0)ITEST=ITEST+1 IF(XINT(2)*(1.D0-XINT(2)).GE.0.D0)ITEST=ITEST+1 IF(XINT(3)*(1.D0-XINT(3)).GE.0.D0)ITEST=ITEST+1 IF(ITEST.EQ.3)THEN ICONT=3 DTINT=DTI C XINT(3)=1.D0-XINT(1)-XINT(2) C write(6,*)' sorti face ',icont,xint,io RETURN ENDIF ENDIF ENDIF C C*** ?????????? C IO=3 ENDIF ENDIF C END
© Cast3M 2003 - Tous droits réservés.
Mentions légales