構造力学 構造工学特論

FORTRANプログラム

単純ねじり格子桁(剛性マトリックス法)

C
C     FILE NAME **** "GRIT.FOR"
C     格子桁 単純ねじり ある荷重状態の変位と応力の解析
C     倍精度 ガウスの消去法
C     逆行列など途中の出力あり
C     58年度川村亨君の卒業研究のプログラム
C     データは GRITD.DAT
      IMPLICIT REAL*8(A-H,O-Z)
      COMMON /BL1/X(100),Z(100),QI(120),QJ(120)
      COMMON /BL2/KAKOM(120,2)/BL3/SM(6,6)/BL4/TSM(255,255)
      COMMON /BL6/STR(6,6)
      DIMENSION F(255),NOKXX(18),NOKZZ(18),INDEX(255),REAC(255),
     &DIS(255),STRE(120,6),NOKY(18),WD(255)
1000 READ(5,10,END=2000) NODT,NELT,KOY,KOZZ,KOXX,E,G
   10 FORMAT(5I5,2F10.0)
      WRITE(6,110)
  110 FORMAT(1H1,'*** INPUT DATA ***')
      WRITE(6,120) NODT,NELT,KOY,KOZZ,KOXX,E,G
  120 FORMAT(1H ,10X,5H NODT,5H NELT,5H  KOY,5H KOZZ,5H KOXX
     &,11X,1HE,14X,1HG/11X,5I5,2F15.3)
      WRITE(6,130)
  130 FORMAT(1H0,6HMENBER,4X,10HKAKOM(I,J),6X,2HQI,15X,2HQJ)
      DO 20 I=1,NELT
      READ(5,15) (KAKOM(I,J),J=1,2),QI(I),QJ(I)
   15 FORMAT(2I5,2F10.0)
   20 WRITE(6,140) I,(KAKOM(I,J),J=1,2),QI(I),QJ(I)
  140 FORMAT(1H ,1X,3I5,2F15.5)
      WRITE(6,150)
  150 FORMAT(1H0,5HJOINT,2X,12HX-COORDINATE,2X,12HZ-COORDINATE,
     &7X,7HY-FORCE,6X,8HZ-NEJIRI,6X,8HX-NEJIRI)
      DO 30 I=1,NODT
      I1=3*I-2
      I2=3*I-1
      I3=3*I
      READ(5,25) X(I),Z(I),F(I1),F(I2),F(I3)
   25 FORMAT(5F10.0)
   30 WRITE(6,160) I,X(I),Z(I),F(I1),F(I2),F(I3)
  160 FORMAT(1H ,I5,5F14.2)
      WRITE(6,180)
  180 FORMAT(1H0,'KOUSOKU-JOINT')
      IF(KOY.EQ.0) GO TO 3
      READ(5,11) (NOKY(I),I=1,KOY)
      WRITE(6,190) (NOKY(I),I=1,KOY)
    3 CONTINUE
      IF(KOZZ.EQ.0) GO TO 4
      READ(5,11) (NOKZZ(I),I=1,KOZZ)
      WRITE(6,190) (NOKZZ(I),I=1,KOZZ)
    4 CONTINUE
      IF(KOXX.EQ.0) GO TO 5
      READ(5,11)(NOKXX(I),I=1,KOXX)
      WRITE(6,190) (NOKXX(I),I=1,KOXX)
   11 FORMAT(14I5)
  190 FORMAT(1H ,5X,13I5)
    5 NT=NODT*3
      DO 100 I=1,NT
      DO 100 J=1,NT
  100 TSM(I,J)=0.
      DO 105 NE=1,NELT
      CALL TRUSM(E,G,NE,SN,CS)
  105 CALL ASMAT(NE)
      DO 50 I=1,NT
      DIS(I)=0.
   50 INDEX(I)=I
      IF(KOY.EQ.0)  GO TO 503
      DO 53 I=1,KOY
      N=3*NOKY(I)-2
   53 INDEX(N)=0
  503 CONTINUE
      IF(KOZZ.EQ.0)  GO TO 504
      DO 55 I=1,KOZZ
      N=3*NOKZZ(I)-1
   55 INDEX(N)=0
  504 CONTINUE
      IF(KOXX.EQ.0) GO TO 505
      DO 60 I=1,KOXX
      N=3*NOKXX(I)
   60 INDEX(N)=0
  505 CONTINUE
      MM=0
      DO 70 I=1,NT
      IF(INDEX(I).EQ.0) GO TO 70
      MM=MM+1
      INDEX(MM)=INDEX(I)
   70 CONTINUE
      DO 75 I=1,MM
      IA=INDEX(I)
      F(I)=F(IA)
      DO 75 J=1,MM
      JA=INDEX(J)
   75 TSM(I,J)=TSM(IA,JA)
      CALL MATI(MM)
      DO 80 I=1,MM
      REAC(I)=0.
      DO 80 K=1,MM
   80 REAC(I)=REAC(I)+TSM(I,K)*F(K)
      DO 85 I=1,MM
      IA=INDEX(I)
   85 DIS(IA)=REAC(I)
      DO 81 I=1,NT
      DO 81 J=1,NT
   81 TSM(I,J)=0.
      DO 90 NE=1,NELT
      CALL TRUSM(E,G,NE,SN,CS)
   90 CALL ASMAT(NE)
      DO 95 I=1,NT
      REAC(I)=0.
      DO 95 K=1,NT
   95 REAC(I)=REAC(I)+TSM(I,K)*DIS(K)
      WRITE(6,300)
  300 FORMAT(1H0,1X,46H********* DISPLACEMENT AND REACTION ********* )
      WRITE(6,305)
  305 FORMAT(1H0,2X,8HNODE NO.,9X,1HV,13X,2HZZ,13X,2HXX,13X,2HRZ
     &,13X,3HRZZ,13X,3HRXX)
      DO 310 I=1,NODT
  310 WRITE(6,315)I,DIS(3*I-2),DIS(3*I-1),DIS(3*I),REAC(3*I-2),
     &REAC(3*I-1),REAC(3*I)
  315 FORMAT(1H0,I5,5X,6E15.4)
      WRITE(6,320)
  320 FORMAT(/)
      WRITE(6,325)
  325 FORMAT(1H0,1X,36H ********** NORMAL STRSS ********** // 3X,
     &8HNELT NO.,9X,2HSI,13X,2HMI,13X,2HTI,13X,2HSJ,13X,2HMJ,13X,
     &2HTJ)
      DO 330 NE=1,NELT
      CALL STRESS(E,G,NE,SN,CS)
      DO 400 I=1,2
      IA=KAKOM(NE,I)
      WD(3*I-2)=DIS(3*IA-2)
      WD(3*I-1)=DIS(3*IA-1)
  400 WD(3*I)=DIS(3*IA)
      DO 328 I=1,6
      STRE(NE,I)=0.0
      DO 328 K=1,6
      STRE(NE,I)=STRE(NE,I)+STR(I,K)*WD(K)
  328 CONTINUE
  330 WRITE(6,335)NE,(STRE(NE,I),I=1,6)
  335 FORMAT(1H0,I5,5X,6E15.4)
      GO TO 1000
2000 STOP
      END
      SUBROUTINE TRUSM(E,G,NE,SN,CS)
      IMPLICIT REAL*8(A-H,O-Z)
      COMMON /BL1/X(100),Z(100),QI(120),QJ(120)
      COMMON /BL2/KAKOM(120,2)/BL3/SM(6,6)
      II=KAKOM(NE,1)
      JJ=KAKOM(NE,2)
      XI=X(II)
      XJ=X(JJ)
      ZI=Z(II)
      ZJ=Z(JJ)
      AL=SQRT((XJ-XI)**2+(ZJ-ZI)**2)
      SN=(ZJ-ZI)/AL
      CS=(XJ-XI)/AL
      C1=12.0*E*QI(NE)/AL**3
      C2=6.0*E*QI(NE)/AL**2
      C3=4.0*E*QI(NE)/AL
      C4=2.0*E*QI(NE)/AL
      C5=G*QJ(NE)/AL
      SM(1,1)=C1
      SM(1,2)=CS*C2
      SM(1,3)=-SN*C2
      SM(1,4)=-C1
      SM(1,5)=CS*C2
      SM(1,6)=-SN*C2
      SM(2,2)=CS*CS*C3+SN*SN*C5
      SM(2,3)=-CS*SN*C3+CS*SN*C5
      SM(2,4)=-CS*C2
      SM(2,5)=CS*CS*C4-SN*SN*C5
      SM(2,6)=-CS*SN*C4-CS*SN*C5
      SM(3,3)=SN*SN*C3+CS*CS*C5
      SM(3,4)=SN*C2
      SM(3,5)=-CS*SN*C4-CS*SN*C5
      SM(3,6)=SN*SN*C4-CS*CS*C5
      SM(4,4)=C1
      SM(4,5)=-CS*C2
      SM(4,6)=SN*C2
      SM(5,5)=CS*CS*C3+SN*SN*C5
      SM(5,6)=-CS*SN*C3+CS*SN*C5
      SM(6,6)=SN*SN*C3+CS*CS*C5
      DO 10 I=2,6
      I1=I-1
      DO 10 J=1,I1
   10 SM(I,J)=SM(J,I)
      RETURN
      END
      SUBROUTINE ASMAT(NE)
      IMPLICIT REAL*8(A-H,O-Z)
      COMMON /BL2/KAKOM(120,2)/BL3/SM(6,6)/BL4/TSM(255,255)
      DO 40 I=1,2
      DO 40 J=1,2
      KI=(KAKOM(NE,I)-1)*3
      KJ=(KAKOM(NE,J)-1)*3
      IS=(I-1)*3
      JS=(J-1)*3
      DO 40 K=1,3
      DO 40 L=1,3
      KIK=KI+K
      KJL=KJ+L
      ISK=IS+K
      JSL=JS+L
   40 TSM(KIK,KJL)=TSM(KIK,KJL)+SM(ISK,JSL)
      RETURN
      END
      SUBROUTINE MATI(NN)
      IMPLICIT REAL*8(A-H,O-Z)
      COMMON /BL4/BI(255,255)
      DIMENSION IND(255)
      DO 102 KO=1,NN
  102 IND(KO)=KO
      DO 103 KO=1,NN
      W=0.0
      DO 104 IO=KO,NN
      IF(ABS(BI(IO,1)).LE.W) GO TO 104
      W=ABS(BI(IO,1))
      IR=IO
  104 CONTINUE
      IF(IR.EQ.KO) GO TO 106
      DO 107 JO=1,NN
      W=BI(KO,JO)
      BI(KO,JO)=BI(IR,JO)
  107 BI(IR,JO)=W
      M=IND(KO)
      IND(KO)=IND(IR)
      IND(IR)=M
  106 W=BI(KO,1)
      NNA=NN-1
      DO 108 JO=1,NNA
  108 BI(KO,JO)=BI(KO,JO+1)/W
      BI(KO,NN)=1./W
      DO 109 IO=1,NN
      IF(IO.EQ.KO) GO TO 109
      W=BI(IO,1)
      DO 110 JO=1,NNA
  110 BI(IO,JO)=BI(IO,JO+1)-W*BI(KO,JO)
      BI(IO,NN)=-W*BI(KO,NN)
  109 CONTINUE
  103 CONTINUE
      DO 111 KO=1,NNA
      IF(KO.EQ.IND(KO)) GO TO 111
      KA=KO+1
      DO 112 IO=KA,NN
      IF(KO.NE.IND(IO)) GO TO 112
      IR=IO
      GO TO 114
  112 CONTINUE
  114 DO 115 JO=1,NN
      W=BI(JO,KO)
      BI(JO,KO)=BI(JO,IR)
  115 BI(JO,IR)=W
      IND(IR)=IND(KO)
      IND(KO)=KO
  111 CONTINUE
      RETURN
      END
      SUBROUTINE STRESS(E,G,NE,SN,CS)
      IMPLICIT REAL*8(A-H,O-Z)
      COMMON /BL1/X(100),Z(100),QI(120),QJ(120)
      COMMON /BL2/KAKOM(120,2)/BL6/STR(6,6)
      II=KAKOM(NE,1)
      JJ=KAKOM(NE,2)
      XI=X(II)
      XJ=X(JJ)
      ZI=Z(II)
      ZJ=Z(JJ)
      AL=SQRT((XJ-XI)**2+(ZJ-ZI)**2)
      SN=(ZJ-ZI)/AL
      CS=(XJ-XI)/AL
      C1=12.0*E*QI(NE)/AL**3
      C2=6.0*E*QI(NE)/AL**2
      C3=4.0*E*QI(NE)/AL
      C4=2.0*E*QI(NE)/AL
      C5=G*QJ(NE)/AL
      STR(1,1)=C1
      STR(1,2)=CS*C2
      STR(1,3)=-SN*C2
      STR(1,4)=-C1
      STR(1,5)=CS*C2
      STR(1,6)=-SN*C2
      STR(2,1)=C2
      STR(2,2)=CS*C3
      STR(2,3)=-SN*C3
      STR(2,4)=-C2
      STR(2,5)=CS*C4
      STR(2,6)=-SN*C4
      STR(3,1)=0.0
      STR(3,2)=SN*C5
      STR(3,3)=CS*C5
      STR(3,4)=0.0
      STR(3,5)=-SN*C5
      STR(3,6)=-CS*C5
      STR(4,1)=-C1
      STR(4,2)=-CS*C2
      STR(4,3)=SN*C2
      STR(4,4)=C1
      STR(4,5)=-CS*C2
      STR(4,6)=SN*C2
      STR(5,1)=C2
      STR(5,2)=CS*C4
      STR(5,3)=-SN*C4
      STR(5,4)=-C2
      STR(5,5)=CS*C3
      STR(5,6)=-SN*C3
      STR(6,1)=0.0
      STR(6,2)=-SN*C5
      STR(6,3)=-CS*C5
      STR(6,4)=0.0
      STR(6,5)=SN*C5
      STR(6,6)=CS*C5
      RETURN
      END