program f90_FEM4nodTS !2次元四角形要素応力解析 implicit none real(8),parameter::pi=3.14159265358979323846D0 integer::i,j,k,l,kk,ne,n,ia,ja character::strcom*50 !書出用コメント integer::NSTRES !応力状態(0:平面歪み,1:平面応力) integer::NODT !節点総数 integer::NELT !要素総数 integer::MATEL !材料種類数 integer::KOX !x方向変位既知節点数 integer::KOY !y方向変位既知節点数 integer::NF !載荷節点数 integer,allocatable::kakom(:,:) !要素構成接点番号 integer,allocatable::matno(:) !材料種別No real(8),allocatable::wm(:,:) !材料物性作業用 real(8),allocatable::Em(:) !要素弾性係数 real(8),allocatable::po(:) !要素ポアソン比 real(8),allocatable::t(:) !要素板厚 real(8),allocatable::gamma(:) !要素単位体積重量(質量ではない) real(8),allocatable::gkh(:) !要素の水平方向物体力係数(重力加速度に対する比率) real(8),allocatable::gkv(:) !要素の鉛直方向物体力係数(重力加速度に対する比率) real(8),allocatable::alpha(:) !要素線膨張係数 real(8),allocatable::ts(:) !要素引張強度 real(8),allocatable::x(:) !節点x座標 real(8),allocatable::y(:) !節点y座標 real(8),allocatable::deltaT(:) !節点温度変化量(+:温度上昇) integer,allocatable::nokx(:) !x方向変位既知節点番号 integer,allocatable::noky(:) !y方向変位既知節点番号 real(8),allocatable::f(:) !全体外力ベクトル integer,allocatable::index(:) !既知節点変位処理のためのインデックス real(8),allocatable::ftvec(:) !全体荷重ベクトル real(8),allocatable::fmass(:) !全体物体力ベクトル real(8),allocatable::rdis(:) !既知節点変位変 real(8),allocatable::tsm(:,:) !全体剛性マトリックス real(8),allocatable::dis(:) !全体節点変位増分 real(8),allocatable::wdis(:) !全体節点変位作業用 real(8),allocatable::dist(:) !全体節点変位 real(8),allocatable::reac(:) !内力ベクトル real(8),allocatable::strsave(:,:,:) !応力記憶用 integer,allocatable::noten(:,:) !応力状態記憶用 real(8),allocatable::sm(:,:) !要素剛性マトリックス real(8),allocatable::fevec(:) !要素荷重ベクトル integer::nt !全自由度(総節点数×2(1節点自由度)) integer::nod=4 !1要素節点数 integer::nhen=2 !1節点自由度 integer::mm !既知節点変位処理後自由度(逆行列の寸法) integer::ib !バンド幅 real(8)::elarea1 !要素半面積 real(8)::elarea2 !要素半面積 real(8)::fact0=1.0D-30 !0判定 real(8):: sigx,sigy,tauxy,ps1,ps2,ang integer:: nnn integer:: maxita=2000 integer:: ntsum integer:: icount real(8):: dtest,ftest integer:: IPR character :: linebuf*1000 character :: fmt1*200,fmt2*200,fmt3*200,fmt4*200 real(4) :: t1,t2 integer :: iv(1:8) character date*8,time1*10,time2*10,zone*5 fmt1="(i5,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',i2,',',i2,',',e15.7,',',e15.7,',',e15.7)" !節点入力値 fmt2="(i5,',',i5,',',i5,',',i5,',',i5,',',e15.7,',',e15.7,',',e15.7,',',e15.7,& ',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',i5)" !要素特性 fmt3="(i5,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',e15.7)" !節点変位・反力出力 fmt4="(i5,',',i5,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',e15.7,',',i5,',',i5)" !応力出力 !時間計測開始 call DATE_AND_TIME(date,time1,zone,iv) read(time1,*) t1 !*************************** !data input !*************************** open(11,file='fnameR.csv',status='old') !!-------------------------------------------------------------------------------------- !!書出用コメント入力 !!-------------------------------------------------------------------------------------- read(11,'(a)') strcom !------------------------------------------------------------------------------------------ !応力状態(0:平面ひずみ),節点数,要素数,材料種類数,X方向変位既知節点数,Y方向変位既知節点数,載荷点数 !------------------------------------------------------------------------------------------ read(11,*) NSTRES,NODT,NELT,MATEL,KOX,KOY,NF,IPR !------------------------------------------------------------------------------------------ !配列寸法宣言 !------------------------------------------------------------------------------------------ nt=NODT*nhen allocate(kakom(1:NELT,1:nod)) allocate(matno(1:NELT)) allocate(wm(1:NELT,1:8)) allocate(Em(1:NELT)) allocate(po(1:NELT)) allocate(t(1:NELT)) allocate(gamma(1:NELT)) allocate(gkh(1:NELT)) allocate(gkv(1:NELT)) allocate(alpha(1:NELT)) allocate(ts(1:NELT)) allocate(x(1:NODT)) allocate(y(1:NODT)) allocate(deltaT(1:NODT)) allocate(nokx(1:KOX)) allocate(noky(1:KOY)) allocate(f(1:nt)) allocate(index(1:nt)) allocate(ftvec(1:nt)) allocate(fmass(1:nt)) allocate(rdis(1:nt)) allocate(tsm(1:nt,1:nt)) allocate(dis(1:nt)) allocate(wdis(1:nt)) allocate(dist(1:nt)) allocate(reac(1:nt)) allocate(strsave(1:NELT,1:4,1:3)) allocate(noten(1:NELT,1:4)) allocate(sm(1:nod*nhen,1:nod*nhen)) allocate(fevec(1:nod*nhen)) !------------------------------------------------------------------------------------------ !材料特性(t,Em,po,gamma,gkh,gkv,alpha,ts) !------------------------------------------------------------------------------------------ do i=1,MATEL read(11,*) wm(i,1),wm(i,2),wm(i,3),wm(i,4),wm(i,5),wm(i,6),wm(i,7),wm(i,8) end do !------------------------------------------------------------------------------------------ !要素構成節点と材料種別(node-1,node-2,node-3,node-4,matno) !------------------------------------------------------------------------------------------ do ne=1,NELT read(11,*) kakom(ne,1),kakom(ne,2),kakom(ne,3),kakom(ne,4),matno(ne) do i=1,MATEL if(i==matno(ne))then t(ne) =wm(i,1) Em(ne) =wm(i,2) po(ne) =wm(i,3) gamma(ne)=wm(i,4) gkh(ne) =wm(i,5) gkv(ne) =wm(i,6) alpha(ne)=wm(i,7) ts(ne) =wm(i,8) end if end do end do deallocate(wm) !------------------------------------------------------------------------------------------ !節点座標(x,y),温度変化量 !------------------------------------------------------------------------------------------ do i=1,NODT read(11,*) x(i),y(i),deltaT(i) end do !------------------------------------------------------------------------------------------ !変位既知節点番号,既知節点変位量 !------------------------------------------------------------------------------------------ do i=1,nt rdis(i)=0.0D0 end do if(00)then mm=mm+1 index(mm)=i end if end do do i=1,mm ia=index(i) ftvec(i)=ftvec(ia) do j=1,mm ja=index(j) tsm(i,j)=tsm(ia,ja) end do end do !----------------------------------------------------- !バンド幅計算とフルマトリックスのバンド化記憶 !----------------------------------------------------- ib=IBAND(mm,tsm,fact0,nt) call BAND(mm,ib,tsm,nt) !----------------------------------------------------- !対角項確認と異常終了通知 !----------------------------------------------------- do i=1,mm if(abs(tsm(i,1))0.0D0)ang=45.0D0 if(tauxy<0.0D0)ang=135.0D0 if(tauxy==0.0D0)ang=0.0D0 else ang=0.5D0*atan(2.0D0*tauxy/(sigx-sigy)) ang=180.0D0/pi*ang if(sigx>sigy.and.tauxy>=0.0D0)ang=ang if(sigx>sigy.and.tauxy<0.0D0)ang=ang+180.0D0 if(sigxm1)then mm=m1 else mm=n1-i+1 end if do j=1,mm z=array(i,j) if(j/=m1)then if(m1-j+11)then array(i,j)=z/array(i,1) else array(i,1)=sqrt(z) end if else array(i,j)=z/array(i,1) end if end do end do end subroutine CHBAND10 subroutine CHBAND11(n1,m1,array,vector,nt) integer :: n1,m1,nt real(8) :: array(1:nt,1:nt),vector(nt) integer :: i,j,mm real(8) :: z vector(1)=vector(1)/array(1,1) do i=2,n1 z=vector(i) if(i>m1)then mm=m1 else mm=i end if do j=2,mm z=z-array(i-j+1,j)*vector(i-j+1) end do vector(i)=z/array(i,1) end do vector(n1)=vector(n1)/array(n1,1) do i=n1-1,1,-1 z=vector(i) do j=2,m1 if(i+j-1>n1)exit z=z-array(i,j)*vector(i+j-1) end do vector(i)=z/array(i,1) end do end subroutine CHBAND11 integer function IBAND(mm,array,fact0,nt) integer :: mm,nt real(8) :: array(1:nt,1:nt),fact0 integer :: i,j !----------------------------------------------------- !バンド幅計算 !----------------------------------------------------- IBAND=1 do i=1,mm-1 do j=mm,i+1,-1 if(fact0<=abs(array(i,j)))exit end do if(IBAND<=j-i+1)IBAND=j-i+1 end do if(mm