马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
C ***************************************
C * STATIC ANALYSIS FOR PLANE FRAME *
C * (METHOD OF FORMER TREATMENT) *
C ***************************************
C Main program reads the control parameters, organizes
C the whole calculation by calling subroutines and
C prints calculation results.
PROGRAM PFF2
DIMENSION X(50),Y(50),IJ(50,2),MT(30),AI(10,2),
& JS(20,4),SE(30,2),PJ(50,3),PF(50,4),JN(50,3),
& KD(150),TK(1000),P(150),F(6)
CHARACTER*12 INDAT,OUTDAT
WRITE(*,*) 'Please input primary data file name!'
READ(*,'(A12)') INDAT
WRITE(*,*) 'Please input calculation result file name!'
READ(*,'(A12)') OUTDAT
OPEN(1,FILE=INDAT,STATUS='OLD')
OPEN(2,FILE=OUTDAT,STATUS='NEW')
READ(1,*) NE,NJ,NS,NAI,NK,NL,E
WRITE(2,10) NE,NJ,NS,NAI,NK,NL,E
10 FORMAT(5X,'PLANE FRAME STRUCTURE ANALYSIS'
& /5X,'******************************'
& //2X,'CONTROL PARAMETERS OF STRUCTURE'
& /5X,'NE=',I2,8X,'NJ=',I2,8X,'NS=',I2,8X,'NAI=',
& I2,/5X,'NK=',I2,8X,'NL=',I2,8X,'E=',E12.4)
CALL INPUT(NE,NJ,NS,NAI,NK,X,Y,IJ,MT,AI,JS,SE)
CALL DJN(NJ,NS,JS,JN,N)
CALL ADE(NE,NJ,N,IJ,JN,KD,NN)
CALL TSM(NE,NJ,NAI,E,N,NN,X,Y,IJ,MT,AI,JN,KD,TK)
CALL UTDU3(TK,NN,KD,N)
DO 20 LC=1,NL
READ(1,*) NP,NF
WRITE(2,30) LC,NP,NF
30 FORMAT(/2X,'LOAD DATA'/10X,'LOAD CASE=',I3/10X,
& 'NP=',I3,8X,'NF=',I3)
CALL JLP(NE,NJ,NAI,E,N,NP,NF,X,Y,IJ,JN,PJ,PF,MT,AI,P)
CALL BACK3(TK,NN,P,N,KD,JN,NJ)
WRITE(2,40)
40 FORMAT(//4X,'MEMBER-END FORCES OF ELEMENTS'/4X,
& 'ELEMENT',13X,'N',17X,'V',17X,'M')
DO 60 M=1,NE
CALL MVN(M,NE,NJ,NAI,N,NF,E,X,Y,IJ,MT,AI,JN,PF,P,F)
WRITE(2,50) M,(F(I),I=1,6)
50 FORMAT(/1X,I10,3X,'N1=',F12.4,3X,'V1=',F12.4,3X,'M1=',
& F12.4/14X,'N2=',F12.4,3X,'V2=',F12.4,3X,'M2=',F12.4)
60 CONTINUE
IF(NK.GT.0) THEN
CALL NVMK(NE,NJ,NAI,NK,E,N,NF,X,Y,IJ,JN,MT,AI,PF,P,SE)
END IF
20 CONTINUE
CLOSE(1)
CLOSE(2)
END
C Read and print structural data.
SUBROUTINE INPUT(NE,NJ,NS,NAI,NK,X,Y,IJ,MT,AI,JS,SE)
DIMENSION X(NJ),Y(NJ),IJ(NE,2),MT(NE),AI(NAI,2),
& JS(NS,4),SE(NK,2)
READ(1,*) (X(I),Y(I),I=1,NJ)
READ(1,*) (IJ(I,1),IJ(I,2),MT(I),I=1,NE)
READ(1,*) ((AI(I,J),J=1,2),I=1,NAI)
READ(1,*) ((JS(I,J),J=1,4),I=1,NS)
IF(NK.GT.0) READ(1,*) ((SE(I,J),J=1,2),I=1,NK)
WRITE(2,10) (I,X(I),Y(I),I=1,NJ)
WRITE(2,20) (I,IJ(I,1),IJ(I,2),MT(I),I=1,NE)
WRITE(2,30) (I,(AI(I,J),J=1,2),I=1,NAI)
WRITE(2,40) ((JS(I,J),J=1,4),I=1,NS)
IF(NK.GT.0) WRITE(2,50) ((SE(I,J),J=1,2),I=1,NK)
10 FORMAT(//2X,'COORDINATES OF JOINTS'/6X,'JOINT',11X,'X',
& 11X,'Y'/(6X,I4,5X,2F12.4))
20 FORMAT(//2X,'INFORMATION OF ELEMENTS'/6X,'ELEMENT',
& 4X,'JOINT-I',4X,'JOINT-J',5X,'TYPE'/(2X,4I10))
30 FORMAT(/7X,'TYPE',10X,'A',12X,'I'/(8X,I2,5X,2F12.6))
40 FORMAT(//2X,'INFORMATION OF SPECIAL JOINTS'/6X,
& 'JOINT',4X,'u',4x,'v',4x,'ceta'/(6X,4I5))
50 FORMAT(//2X,'ASSIGNMENT SECTION'/7X,'ELEMENT',4X,
& 'SECTION PLACE'/(3X,F10.0,F12.2))
END
C Determine number of joint displacements.
SUBROUTINE DJN(NJ,NS,JS,JN,N)
DIMENSION JS(NS,4),JN(NJ,3)
DO 10 I=1,NJ
DO 10 J=1,3
10 JN(I,J)=0
DO 20 I=1,NS
L=JS(I,1)
DO 20 J=1,3
20 JN(L,J)=JS(I,J+1)
N=0
ID=0
DO 30 I=1,NJ
DO 30 J=1,3
IF(JN(I,J)-1) 40,50,60
40 N=N+1
JN(I,J)=N
GO TO 30
50 JN(I,J)=0
GO TO 30
60 ID=1
30 CONTINUE
IF(ID.EQ.0) GO TO 80
DO 70 I=1,NS
L=JS(I,1)
DO 70 J=1,3
K=JS(I,J+1)
IF(K.LE.1) GO TO 70
JN(L,J)=JN(K,J)
70 CONTINUE
80 RETURN
END
C Determine address of diagonal elements of
C total stiffness matrix.
SUBROUTINE ADE(NE,NJ,N,IJ,JN,KD,NN)
DIMENSION IJ(NE,2),JN(NJ,3),KD(N),LV(6)
DO 10 I=1,N
10 KD(I)=0
DO 20 M=1,NE
CALL ELV(M,NE,NJ,IJ,JN,LV)
MIN=N
DO 30 I=1,6
J=LV(I)
IF(J.EQ.0) GO TO 30
IF(J.LT.MIN) MIN=J
30 CONTINUE
DO 20 I=1,6
J=LV(I)
IF(J.EQ.0) GO TO 20
NW=J-MIN+1
IF(NW.GT.KD(J)) KD(J)=NW
20 CONTINUE
NN=1
DO 40 J=2,N
NN=NN+KD(J)
KD(J)=NN
40 CONTINUE
END
C Assemble total stiffness matrix stored as a vector.
SUBROUTINE TSM(NE,NJ,NAI,E,N,NN,X,Y,IJ,MT,AI,
& JN,KD,TK)
DIMENSION X(NJ),Y(NJ),IJ(NE,2),JN(NJ,3),MT(NE),
& AI(NAI,2),KD(N),TK(NN),EK(6,6),LV(6)
DO 10 I=1,NN
10 TK(I)=0.0
DO 20 M=1,NE
CALL LSC(M,NE,NJ,X,Y,IJ,BL,SI,CO)
CALL ESM(M,NE,NAI,E,MT,AI,BL,SI,CO,EK)
CALL ELV(M,NE,NJ,IJ,JN,LV)
DO 30 L=1,6
I=LV(L)
IF(I.EQ.0) GO TO 30
DO 40 K=1,6
J=LV(K)
IF(J.LT.I) GO TO 40
JI=KD(J)-J+I
TK(JI)=TK(JI)+EK(L,K)
40 CONTINUE
30 CONTINUE
20 CONTINUE
END
C Decompose total stiffness matrix using
C Crout method.
SUBROUTINE UTDU3(A,NN,ID,N)
DIMENSION A(NN),ID(N)
DO 30 J=2,N
JJ=ID(J)
J1=J-1
MJ=J-JJ+ID(J1)+1
IF(MJ.GT.J1) GO TO 30
DO 20 I=MJ,J
II=ID(I)
I1=I-1
MIJ=MJ
IF(I.EQ.J) GO TO 5
MI=I-II+ID(I1)+1
IF(MIJ.LT.MI) MIJ=MI
5 S=0.0
IF(MIJ.GT.I1) GO TO 15
DO 10 K=MIJ,I1
KI=II-I+K
KK=ID(K)
KJ=JJ-J+K
10 S=S+A(KI)*A(KK)*A(KJ)
15 IF(I.EQ.J) THEN
A(JJ)=A(JJ)-S
ELSE
JI=JJ-J+I
A(JI)=(A(JI)-S)/A(II)
END IF
20 CONTINUE
30 CONTINUE
END
C Form total joint load vector.
SUBROUTINE JLP(NE,NJ,NAI,E,N,NP,NF,X,Y,IJ,JN,
& PJ,PF,MT,AI,P)
DIMENSION X(NJ),Y(NJ),IJ(NE,2),JN(NJ,3),PJ(NP,3),
& PF(NF,4),MT(NE),AI(NAI,2),P(N),FO(6),PE(6),LV(6)
DO 10 I=1,N
P(I)=0.0
10 CONTINUE
IF(NP.GT.0) THEN
READ(1,*) ((PJ(I,J),J=1,3),I=1,NP)
WRITE(2,20) ((PJ(I,J),J=1,3),I=1,NP)
20 FORMAT(/2X,'JOINT LOAD'/6X,'JOINT',8X,'XYM',12X,
& 'LOAD'/(6X,F5.0,6X,F5.0,6X,F12.4))
DO 30 I=1,NP
J=INT(PJ(I,1))
K=INT(PJ(I,2))
L=JN(J,K)
IF(L.NE.0) P(L)=PJ(I,3)
30 CONTINUE
END IF
IF(NF.GT.0) THEN
READ(1,*) ((PF(I,J),J=1,4),I=1,NF)
WRITE(2,40) ((PF(I,J),J=1,4),I=1,NF)
40 FORMAT(/2X,'NON-JOINT LOAD'/6X,'ELEMENT',8X,'TYPE',
& 8X,'LOAD',12X,'C'/(6X,F6.0,6X,F6.0,4X,2F12.4))
DO 50 I=1,NF
M=INT(PF(I,1))
CALL LSC(M,NE,NJ,X,Y,IJ,BL,SI,CO)
CALL EFF(I,M,NE,NAI,E,NF,PF,MT,AI,BL,FO)
CALL ELV(M,NE,NJ,IJ,JN,LV)
PE(1)=-FO(1)*CO+FO(2)*SI
PE(2)=-FO(1)*SI-FO(2)*CO
PE(3)=-FO(3)
PE(4)=-FO(4)*CO+FO(5)*SI
PE(5)=-FO(4)*SI-FO(5)*CO
PE(6)=-FO(6)
DO 60 J=1,6
L=LV(J)
IF(L.NE.0) P(L)=P(L)+PE(J)
60 CONTINUE
50 CONTINUE
END IF
END
C Solve equations and print joint displacements.
SUBROUTINE BACK3(A,NN,B,N,ID,JN,NJ)
DIMENSION A(NN),B(N),ID(N),JN(NJ,3),D(3)
DO 20 J=2,N
JJ=ID(J)
J1=J-1
MJ=J-JJ+ID(J1)+1
IF(MJ.GT.J1) GO TO 20
DO 10 I=MJ,J1
JI=JJ-J+I
10 B(J)=B(J)-A(JI)*B(I)
20 CONTINUE
DO 30 I=1,N
II=ID(I)
B(I)=B(I)/A(II)
30 CONTINUE
NW=1
DO 35 I=2,N
IW=ID(I)-ID(I-1)
IF(IW.GT.NW) NW=IW
35 CONTINUE
N1=N-1
DO 50 I=N1,1,-1
MIN=I+NW-1
IF(N.LT.MIN) MIN=N
DO 40 J=I+1,MIN
JJ=ID(J)
MJ=J-JJ+ID(J-1)+1
IF(I.LT.MJ) GO TO 40
JI=JJ-J+I
B(I)=B(I)-A(JI)*B(J)
40 CONTINUE
50 CONTINUE
WRITE(2,60)
60 FORMAT(//2x,'JOINT DISPLACEMENTS'/5x,'JOINT',12X,
& 'u',14X,'v',11X,'ceta')
DO 80 I=1,NJ
DO 70 J=1,3
D(J)=0.0
L=JN(I,J)
IF(L.NE.0) D(J)=B(L)
70 CONTINUE
WRITE(2,75) I,D(1),D(2),D(3)
75 FORMAT(2X,I6,4X,3E15.6)
80 CONTINUE
END
C Calculate member-end forces of elements.
SUBROUTINE MVN(M,NE,NJ,NAI,N,NF,E,X,Y,IJ,MT,
& AI,JN,PF,P,F)
DIMENSION X(NJ),Y(NJ),IJ(NE,2),AI(NE,2),P(N),
& JN(NJ,3),PF(NF,4),LV(6),FO(6),D(6),FD(6),F(6),
& EK(6,6)
CALL LSC(M,NE,NJ,X,Y,IJ,BL,SI,CO)
CALL ESM(M,NE,NAI,E,MT,AI,BL,SI,CO,EK)
CALL ELV(M,NE,NJ,IJ,JN,LV)
DO 10 I=1,6
L=LV(I)
D(I)=0.0
IF(L.NE.0) D(I)=P(L)
10 CONTINUE
DO 20 I=1,6
FD(I)=0.0
DO 30 J=1,6
FD(I)=FD(I)+EK(I,J)*D(J)
30 CONTINUE
20 CONTINUE
F(1)=FD(1)*CO+FD(2)*SI
F(2)=-FD(1)*SI+FD(2)*CO
F(3)=FD(3)
F(4)=FD(4)*CO+FD(5)*SI
F(5)=-FD(4)*SI+FD(5)*CO
F(6)=FD(6)
IF(NF.GT.0) THEN
DO 40 I=1,NF
L=INT(PF(I,1))
IF(M.EQ.L) THEN
CALL EFF(I,M,NE,NAI,E,NF,PF,MT,AI,BL,FO)
DO 50 J=1,6
F(J)=F(J)+FO(J)
50 CONTINUE
END IF
40 CONTINUE
END IF
END
C Calculate assignment section forces of elements.
SUBROUTINE NVMK(NE,NJ,NAI,NK,E,N,NF,X,Y,IJ,JN,
& MT,AI,PF,P,SE)
DIMENSION X(NJ),Y(NJ),IJ(NE,2),JN(NJ,3),MT(NE),
& AI(NAI,2),PF(NF,4),P(N),F(6),SK(3),S(3),SE(NK,2)
WRITE (2,5)
5 FORMAT(//4X,'ASSIGNMENT SECTION FORCES OF ELEMENTS'
& /4X,'ELEMENT',8X,'XK',13X,'NK',13X,'VK',15X,'MK')
DO 10 K=1,NK
M=INT(SE(K,1))
XK=SE(K,2)
CALL LSC(M,NE,NJ,X,Y,IJ,BL,SI,CO)
CALL MVN(M,NE,NJ,NAI,N,NF,E,X,Y,IJ,MT,AI,JN,PF,P,F)
SK(1)=F(4)
SK(2)=F(5)
SK(3)=-F(5)*(BL-XK)-F(6)
IF(NF.NE.0) THEN
DO 20 I=1,NF
I1=INT(PF(I,1))
IF(I1.NE.M) GO TO 20
IF((PF(I,1)-M).GT.0.0) GO TO 25
C=PF(I,4)
NO=INT(PF(I,2))
IF(XK.LT.C.AND.NO.LT.7) THEN
Q=PF(I,3)
CALL CANB(NO,Q,C,XK,S)
DO 30 J=1,3
30 SK(J)=SK(J)+S(J)
END IF
20 CONTINUE
END IF
25 WRITE (2,40) M,XK,SK(1),SK(2),SK(3)
40 FORMAT(5X,I5,F12.2,3F16.4)
10 CONTINUE
END
C Calculate length,sine and cosine of member.
SUBROUTINE LSC(M,NE,NJ,X,Y,IJ,BL,SI,CO)
DIMENSION X(NJ),Y(NJ),IJ(NE,2)
I=IJ(M,1)
J=IJ(M,2)
DX=X(J)-X(I)
DY=Y(J)-Y(I)
BL=SQRT(DX*DX+DY*DY)
SI=DY/BL
CO=DX/BL
END
C Set up element location vector.
SUBROUTINE ELV(M,NE,NJ,IJ,JN,LV)
DIMENSION IJ(NE,2),JN(NJ,3),LV(6)
I=IJ(M,1)
J=IJ(M,2)
DO 10 K=1,3
LV(K)=JN(I,K)
LV(K+3)=JN(J,K)
10 CONTINUE
END
C Calculate element stiffness matrix referred
C to global coordinate system.
SUBROUTINE ESM(M,NE,NAI,E,MT,AI,BL,SI,CO,EK)
DIMENSION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