ellp54
C ELLP54 SOURCE CHAT 05/01/12 23:35:51 5004 * A,B,U,R,DELTA,P,CH,CH1,EPS) C IMPLICIT INTEGER(I-N) IMPLICIT REAL*8(A-H,O-Y) IMPLICIT COMPLEX*16(Z) C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C OPERATEUR ... C C RESOLUTION D'UN SYSTEME LINEAIRE COMPLEXE ZA1 * ZX = ZV C PAR LA METHODE ITERATIVE DU GRADIANT CONJUGUE C C PARAMETRES : C C ZA(N*N) : MATRICE (N*N) REPRESENTANT LE SYSTEME LINEAIRE C ZB(N) : SECOND MEMBRE C ZU(N) : TABLEAU SOLUTION C C INTERMEDIAIRES : C C A(2N*2N) : C B(2N) :---> MATRICES REELLES DU SYSTEME REEL CORRESPONDANT C U(2N) : C C AUTRES MATRICES : MATRICES DE TRAVAIL C C SORTIE : C C ZX : SOLUTION C C AUTEUR : SAINT - DIZIER C DATE : 16 FEV 1990 C C ==================================================================== C COMPLEX*16 ZA(N,*),ZB(*),ZU(*) C COMPLEX*16 ZR(*),ZDELTA(*),ZP(*),ZH(*),ZH1(*) C REAL*8 A(N2,*) REAL*8 B(*) REAL*8 U(*) REAL*8 R(*) REAL*8 DELTA(*) REAL*8 P(*) REAL*8 CH(*) REAL*8 CH1(*) C ZI = (0.D0 , -1.D0) N2 = N*2 NP4= N/6 C DO 1 I = 1 , N B(I ) = ZB(I) B(I+N) = ZB(I)*ZI U(I ) = ZU(I) U(I+N) = ZU(I)*ZI DO 2 J = 1 , N A(I ,J ) = ZA(I,J) A(I+N,J+N) = A(I,J) A(I+N,J ) = ZA(I,J)*ZI A(I ,J+N) = -A(I+N,J) 2 CONTINUE 1 CONTINUE DO 6 I = 1 , NP4 DO 7 J = 1 , 6 U((I-1)*12+J ) = U((I-1)*12+J ) / XUR U((I-1)*12+J+6) = U((I-1)*12+J+6) / XFM 7 CONTINUE 6 CONTINUE C DO 3 J = 1 , NP4 DO 5 I = 1 , N DO 4 JJ = 1 , 6 A(I ,(J-1)*12+JJ ) = A(I,(J-1)*12+JJ )*XUR A(I ,(J-1)*12+JJ+6 ) = A(I,(J-1)*12+JJ+6)*XFM 4 CONTINUE 5 CONTINUE 3 CONTINUE C C C EPS = 1.D-8 C C C ............................... R = B - A*U C DO 10 I = 1 , N2 R(I) = B(I) DO 11 J = 1 , N2 R(I) = R(I) - A(I,J)*U(J) 11 CONTINUE 10 CONTINUE C C C ............................... ZDELTA = (ZA)T * ZR C DO 20 I = 1 , N2 DELTA (I) = 0.D0 DO 21 J = 1 , N2 DELTA (I) = DELTA(I) + A(J,I)*R(J) 21 CONTINUE 20 CONTINUE C C ............................... DELTA = (ZDELTA)T * ZDELTA C DEL = 0.D0 NIT = 0 C DO 30 I = 1 , N2 DEL = DEL + DELTA(I)**2 30 CONTINUE C ............................... ZP = ZDELTA C DO 40 I = 1 , N2 P(I) = DELTA(I) 40 CONTINUE C 100 NIT = NIT + 1 WRITE(6,*)'********************* ',NIT DO 41 I = 1 , N WRITE(6,*)I,' ',U(I),' ',U(I+N) 41 CONTINUE C C C ............................... ZH = ZA * ZP C DO 50 I = 1 , N2 CH(I) = 0.D0 DO 51 J = 1 , N2 CH(I) = CH(I) + A(I,J)*P(J) 51 CONTINUE 50 CONTINUE C C ............................... ZH1 = (ZA)T * ZH C DO 60 I = 1 , N2 CH1(I) = 0.D0 DO 61 J = 1 , N2 CH1(I) = CH1(I) + A(J,I)*CH(J) 61 CONTINUE 60 CONTINUE C C ............................... ZLANDA = DELTA / ((ZP)T * ZH1) C D = 0.D0 DO 70 I = 1 , N2 D = D + CH1(I)*P(I) 70 CONTINUE C CLANDA = DEL / D C C ............................... ZU = ZU + ZLANDA*ZP C ............................... ZDELTA = ZDELTA + ZLANDA*ZH1 C ............................... DELTA1 = (ZDELTA)T * ZDELTA C DEL1 = 0.D0 DO 80 I = 1 , N2 U(I) = U(I) + CLANDA * P(I) DELTA(I) = DELTA(I) - CLANDA * CH1(I) DEL1 = DEL1 + DELTA(I)**2 80 CONTINUE C C ************** TEST DE CONVERGENCE ***************** C XSTOP = 0.D0 XNU = 0.D0 XDU = 0.D0 XNR = 0.D0 XDR = 0.D0 XNF = 0.D0 XDF = 0.D0 XNM = 0.D0 XDM = 0.D0 C ND12 = N / 12 DO 85 I = 1 , ND12 II = (I-1) * 12 DO 86 J = 1 , 3 XNU = XNU + CLANDA*CLANDA*(P(II+J )**2+P(II+J +N)**2) XNR = XNR + CLANDA*CLANDA*(P(II+J+3)**2+P(II+J+3+N)**2) XNF = XNF + CLANDA*CLANDA*(P(II+J+6)**2+P(II+J+6+N)**2) XNM = XNM + CLANDA*CLANDA*(P(II+J+9)**2+P(II+J+9+N)**2) XDU = XDU + U(II+J )**2 + U(II+J +N)**2 XDR = XDR + U(II+J+3)**2 + U(II+J+3+N)**2 XDF = XDF + U(II+J+6)**2 + U(II+J+6+N)**2 XDM = XDM + U(II+J+9)**2 + U(II+J+9+N)**2 86 CONTINUE 85 CONTINUE C C NN = (NNPOI-1)*12+ICHAR C XNUM = (CLANDA*P(NN))**2+(CLANDA*P(NN+N))**2 C XDEN = U(NN)**2 + U(NN+N)**2 XST1 = SQRT(XNU/XDU) XST2 = SQRT(XNR/XDR) XST3 = SQRT(XNF/XDF) XST4 = SQRT(XNM/XDM) XSTOP = SQRT(XST1*XST1+XST2*XST2+XST3*XST3+XST4*XST4) C WRITE(6,*)'XST1 :',XST1 C WRITE(6,*)'XST2 :',XST2 C WRITE(6,*)'XST3 :',XST3 C WRITE(6,*)'XST4 :',XST4 C IF (XSTOP.LE.EPS) THEN WRITE(6 ,*)'SOLUTION DU SYSTEME :',NNPOI,ICHAR DO 8 I = 1 , NP4 DO 9 J = 1 , 6 U((I-1)*12+J ) = U((I-1)*12+J ) * XUR U((I-1)*12+J+6) = U((I-1)*12+J+6) * XFM 9 CONTINUE 8 CONTINUE C DO 84 I = 1 , N ZU(I) = U(I) - ZI*U(I+N) 84 CONTINUE C DO 89 I = 1 , N C WRITE(21 ,*) I,ZU(I) C9 CONTINUE C C WRITE(6,*)'--------------------------' RETURN END IF C C ************************************************************ ALFA = DEL1 / DEL DEL = DEL1 C DO 90 I = 1 , N2 P(I) = ALFA*P(I) + DELTA(I) 90 CONTINUE C GO TO 100 C END
© Cast3M 2003 - Tous droits réservés.
Mentions légales