資源描述:
《有限元編程算例(fortran).docx》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、有限元編程算例(Fortran)本程序通過(guò)Fortran語(yǔ)言編寫(xiě),程序在IntelParallelStudioXE2013withVS2013中成功運(yùn)行,程序?yàn)椤队?jì)算力學(xué)》(龍述堯等編)一書(shū)中的源程序,僅作研究學(xué)習(xí)使用,省去了敲寫(xiě)的麻煩。源程序?yàn)椋?Page149COMMON/X1/NJ,NE,NZ,NDD,NPJ,IND,NJ2,EO,UN,GAMA,TE,AECOMMON/X2/JM(100,3),NZC(50),CJZ(100,2),PJ(100,2),B(3,6),D(3,3),S(3,6),TKZ(200,20),EKE(
2、6,6),P(200)OPEN(5,FILE='DATAIN')!OPEN(6,FILE='DATAOUT',STATUS='NEW')CALLDATAIF(IND.EQ.0)GOTO10EO=EO/(1.0-UN*UN)UN=UN/(1.0-UN)10CALLTOTSTICALLLOADCALLSUPPORCALLSOLVEQCALLSTRESSPAUSE!STOPENDSUBROUTINEDATACOMMON/X1/NJ,NE,NZ,NDD,NPJ,IND,NJ2,EO,UN,GAMA,TE,AECOMMON/X2/JM(100
3、,3),NZC(50),CJZ(100,2),PJ(100,2),B(3,6),D(3,3),S(3,6),TKZ(200,20),EKE(6,6),P(200)READ(5,*)NJ,NE,NZ,NDD,NPJ,INDNJ2=NJ*2NPJ1=NPJ+1READ(5,*)EO,UN,GAMA,TEREAD(5,*)((JM(I,J),J=1,3),I=1,NE)READ(5,*)((CJZ(I,J),J=1,2),I=1,NJ)!Page150READ(5,*)(NZC(I),I=1,NZ)READ(5,*)((PJ(I,J),J
4、=1,2),I=1,NPJ1)WRITE(6,10)(I,(CJZ(I,J),J=1,2),I=1,NJ)10FORMAT(4X,2HNO,6X,1HX,6X,1HY/(I6,2X,F7.2,F7.2))RETURNENDSUBROUTINEELEST(MEO,IASK)COMMON/X1/NJ,NE,NZ,NDD,NPJ,IND,NJ2,EO,UN,GAMA,TE,AECOMMON/X2/JM(100,3),NZC(50),CJZ(100,2),PJ(100,2),B(3,6),D(3,3),S(3,6),TKZ(200,20),
5、EKE(6,6),P(200)IE=JM(MEO,1)JE=JM(MEO,2)ME=JM(MEO,3)CM=CJZ(JE,1)-CJZ(IE,1)BM=CJZ(IE,2)-CJZ(JE,2)CJ=CJZ(IE,1)-CJZ(ME,1)BJ=CJZ(ME,2)-CJZ(IE,2)AE=(BJ*CM-BM*CJ)/2.0IF(IASK.LE.1)GOTO50DO10I=1,3DO10J=1,6B(I,J)=0.010CONTINUEB(1,1)=-BJ-BMB(1,3)=BJB(1,5)=BMB(2,2)=-CJ-CMB(2,4)=CJ
6、B(2,6)=CMB(3,1)=B(2,2)B(3,2)=B(1,1)B(3,3)=B(2,4)B(3,4)=B(1,3)B(3,5)=B(2,6)!Page151B(3,6)=B(1,5)DO20I=1,3DO20J=1,6B(I,J)=B(I,J)/(2.0*AE)20CONTINUED(1,1)=EO/(1.0-UN*UN)D(1,2)=EO*UN/(1.0-UN*UN)D(2,1)=D(1,2)D(2,2)=D(1,1)D(1,3)=0.0D(2,3)=0.0D(3,1)=0.0D(3,2)=0.0D(3,3)=EO/(2.
7、0*(1.0+UN))DO30I=1,3DO30J=1,6S(I,J)=0.0DO30K=1,3S(I,J)=S(I,J)+D(I,K)*B(K,J)30CONTINUEIF(IASK.LE.2)GOTO50DO40I=1,6DO40J=1,6EKE(I,J)=0.0DO40K=1,3!**********************************ExchangeBAndS***********************************************EKE(I,J)=EKE(I,J)+B(K,I)*S(K,J)
8、*AE*TE40CONTINUE50CONTINUERETURNENDSUBROUTINETOTSTICOMMON/X1/NJ,NE,NZ,NDD,NPJ,IND,NJ2,EO,UN,GAMA,TE,AECOMMON/X2/JM(10