10.6.2.4 SUBROUTINE SOLVECCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOSUBROUTINESOLVE!alternativedirectionlineiteration+BlockcorrectionUSESTARTLIMIPLICITNONEINTEGER*4ISTEJSTE.IT1.IT2.JT1JT2.NT.N.LJ.IL.JJREAL*8BL,BLP.BLM.BLC.DENOMTEMP***************水******水水米水水水水水水水水水水水水水水水水水水水水水水水水水水[T1,][bi.]T2.1b2.1M1(L1.M1)主对角元系数值位量Nl(i,j+1)TLa.1bri.i(L1+1)个G++DT1.2b1.2元素.:PED-atTi,Mb1.M(1)TawaanaT2.MIb2.M.主L1TiTLI-1,MbL1-1.MTL1.MILbLI.MI16/79
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC SUBROUTINE SOLVE USE START_L IMPLICIT NONE INTEGER*4 ISTF, JSTF, IT1, IT2, JT1, JT2, NT, N,I,J,II,JJ REAL*8 BL, BLP, BLM, BLC, DENOM, TEMP C*************************************************************** ! alternative direction line iteration + Block correction 10.6.2.4 SUBROUTINE SOLVE 16/79
Structure of SOLVEAD---alternativedirectionDO 999 NT=1,NTIMES (NF)N=NFTwo times of blockIF (LBLK(NF)THENcorrectionsPT(ISTF)=0.AD Block13ENDDOISTL2SCorrectionPT(JSTF)=0M2Z023ENDDO10ENDIFJSTVLFour times ofUpward lineiterationVlineiterationsEAD linedownward lineiterationIterationLeft to right line iteration(4)-Explainedin detailRight to left line iteration17/79999ENDDO
S O L V E Structure of SOLVE Two times of block corrections Four times of line iterations 17/79 AD-alternative direction (4)-Explained in detail
Review on block correction1.Equation for correction:It is required that: (dt, +,) satisfy following eq.ZAP(g., +.) =ZAIP(g+1, +l)+Z AIM(g-1/ +)+Z(AJM)(.,-1 + )+Z(AJP)(d. + + )+ZCON11=L2L1(i =IST,...L2)IST-solution starting subscript in X-direction; L2-last but one.HereAP.AlPAlM,etc.arethesymblesadoptedinteachingcode18/79
18/79 Review on block correction ' ' ' '
(5)-ExplainedReview on block correctionin detail(BL)@, =(BLP)Φ +(BLM)Φ- + BLC,i= IST,...L2M2BLP= Z (AIP)BL= Z (AP)- Z(AJP)- Z (AJM)j=JSTj+M2j+JSTj=JSTM2BLC= CON + (AJP)+ Z(AJM)"-Z (AIM)BLM =j=JSTj=JSTj=JSTj=JST艺(AIP)+(AIM-(APi)BL=A.,BLP = B,BLM = Cj=JSTj=JSTi=JSTdi- = P-d, +Q-1A@. =Bo+ +C,@., + D, i=1,2,M1BBD, +CQDOPAA -C,PA-CPDENOM-BL-PT(I-1)*BLMDENOM19/79
' ' ' 1 1 ( ) ( ) ( ) , ,. 2 BL BLP BLM BLC i IST L i i i = + + = + − 2 2 ( ) ( ) ( ) M j JST j M j JST BL AP AJP AJM = = − − 2 ( ) M j JST BLP AIP = = 2 ( ) M j JST BLM AIM = = 2 2 2 * * , 1 , 1 2 2 2 * * * 1, 1, , ( ) ( ) ( ) ( ) ( ) M i j i j j JST M M M i j i j i j j JST j JST j M M j JST j J JST ST BLC CON AJP AJM AIP AIM AP + − = + − = = = = = = + + + + − ' ' ' i i+1 i-1 A B C D i M i i i = + + = , 1,2,. 1 ' ' i i −1 = + P Q i i − − 1 1 1 ; i i i i i B P A C P− = − 1 1 ; i i i i i i i D C Q Q A C P − − + = − 1 1 1 ; B P A = 1 1 1 D Q A = DENOM=BL-PT(I-1)*BLM DENOM Review on block correction 19/79 (5)-Explained in detail
TDMAAT =BT+ +CT-+D,, i=1,2,...M1 (a)(1)Elimination(消元)-Reducingtheunknownsateachlinefrom3to2(b)T- = P-T +Q-B,LDD.+COP0ABA-C,IA-C,P-1i_(2)Backsubstitution(回代)一StartingfromM1via Eq.(b)to get T,sequentiallyTMI = QMlT-1 = P-,T, + Qi-120/79
⚫ TDMA (1) Elimination (消元)-Reducing the unknowns at each line from 3 to 2 (2) Back substitution (回代)-Starting from M1 via Eq.(b) to get Ti sequentially T P T Q i i i i − − − 1 1 1 = + 1 ; i i i i i B P A C P− = − 1 1 ; i i i i i i i D C Q Q A C P − − + = − 1 1 1 ; B P A = 1 1 1 D Q A = T Q M M 1 1 = T P T Q i i i i − − − 1 1 1 = + (b) 20/79