program f90_EGV_BFRM !************************************************************* !2D Frame Buckling Analysis !************************************************************* implicit none integer::i,j,k,l,m,kk,ne,n,ia,ja character::strcom*50 !Comment integer::NODT !Number of nodes integer::NELT !Number of elements integer::MATEL !Number of material sets integer::KOX !Number of fixed nodes in x-direction integer::KOY !Number of fixed nodes in y-direction integer::KOZ !Number of fixed nodes in rotation integer::NF !Number of loaded nodes integer,allocatable::kakom(:,:) !Element connectivity integer,allocatable::matno(:) !Material set number real(8),allocatable::wm(:,:) !work for material properties real(8),allocatable::Em(:) !Elastic modulus of element real(8),allocatable::AA(:) !Section area of element real(8),allocatable::AI(:) !Moment of inertia of element real(8),allocatable::x(:) !x-coordinate real(8),allocatable::y(:) !y-coordinate integer,allocatable::nokx(:) !Fixed node number in x-direction integer,allocatable::noky(:) !Fixed node number in y-direction integer,allocatable::nokz(:) !Fixed node number in rotation real(8),allocatable::f(:) !External force vector integer,allocatable::mindex(:) !Index for treatment of fixed nodes real(8),allocatable::ftvec(:) !Total load vector real(8),allocatable::tsm(:,:) !Total stiffness matrix real(8),allocatable::dis(:) !Displacement real(8),allocatable::reac(:) !work array real(8),allocatable::sresul(:,:) !Stress resultants real(8),allocatable::sm(:,:) !Element stiffnes matrix real(8),allocatable::hen(:,:) !Transform matrix real(8),allocatable::fevec(:) !Element load vector integer::nt !Number of degrees of freedom of all nodes (NODT x nhen) integer::nod=2 !Number of nodes per element integer::nhen=3 !Number of degrees of freedom per node integer::mm !Number of degree of freedom of reduced FE equation integer::ib !Band width of reduced FE equation real(8)::fact0=1.0D-30 !0 judgement character::fnameR*50,fnameW*50 !Input file name, output file name real(8),allocatable::smg(:,:) !Element geometric stiffness matrix real(8),allocatable::tsg(:,:) !Total geometric stiffness matrix real(8),allocatable::ev(:) !Eigenvalue real(8),allocatable::vec(:,:) !Eigenvector real(8),allocatable::work(:) !work for eigenvector integer::negv !Number of outputted eigenvalues integer::kst !Index for positive eigenvalue character :: linebuf*1000,dummy*100 character :: fmt1*200,fmt2*200,fmt3*200,fmt4*200 real(4) :: t1,t2 fmt1="(i5,2(',',e15.7),3(',',e15.7),3(',',i2))" !Node fmt2="(i5,2(',',i5),3(',',e15.7),',',i5)" !Element fmt3="(i5,2(',',e15.7),3(',',e15.7),3(',',e15.7),3(',',e15.7))" !Displacement & reaction fmt4="(i5,3(',',e15.7),3(',',e15.7))" !Stress resultant call getarg(1,dummy) !Number of outputted eigenvalues call getarg(2,fnameR) !Input file name call getarg(3,fnameW) !Output file name read(dummy,*) negv !To convert character 'dummy' to integer 'negv' !To start the measurement of calculation time t1=DIFT() !*************************** !data input !*************************** open(11,file=fnameR,status='old') !/*--------------------------------------------------------------------------------------*/ !/*Comment*/ !/*--------------------------------------------------------------------------------------*/ read(11,'(a)') strcom !------------------------------------------------------------------------------------------ !Basic values for analysis !------------------------------------------------------------------------------------------ read(11,*) NODT,NELT,MATEL,KOX,KOY,KOZ,NF !------------------------------------------------------------------------------------------ !To declare array size !------------------------------------------------------------------------------------------ nt=NODT*nhen allocate(kakom(1:NELT,1:nod)) allocate(matno(1:NELT)) allocate(wm(1:NELT,1:3)) allocate(Em(1:NELT)) allocate(AA(1:NELT)) allocate(AI(1:NELT)) allocate(x(1:NODT)) allocate(y(1:NODT)) if(1<=KOX)allocate(nokx(1:KOX)) if(1<=KOY)allocate(noky(1:KOY)) if(1<=KOZ)allocate(nokz(1:KOZ)) allocate(f(1:nt)) allocate(mindex(1:nt)) allocate(ftvec(1:nt)) allocate(tsm(1:nt,1:nt)) allocate(dis(1:nt)) allocate(reac(1:nt)) allocate(sresul(1:NELT,1:nod*nhen)) allocate(sm(1:nod*nhen,1:nod*nhen)) allocate(hen(1:nod*nhen,1:nod*nhen)) allocate(fevec(1:nod*nhen)) allocate(smg(1:nod*nhen,1:nod*nhen)) allocate(tsg(1:nt,1:nt)) allocate(ev(1:nt)) allocate(vec(1:nt,1:nt)) allocate(work(1:nt)) !------------------------------------------------------------------------------------------ !Material properties (Em,AA,AI) !------------------------------------------------------------------------------------------ do i=1,MATEL read(11,*) wm(i,1),wm(i,2),wm(i,3) end do !------------------------------------------------------------------------------------------ !Element-nodes relationship, material set number (node-1,node-2,matno) !------------------------------------------------------------------------------------------ do ne=1,NELT read(11,*) kakom(ne,1),kakom(ne,2),matno(ne) do i=1,MATEL if(i==matno(ne))then Em(ne) =wm(i,1) AA(ne) =wm(i,2) AI(ne) =wm(i,3) end if end do end do deallocate(wm) !------------------------------------------------------------------------------------------ !(x,y) coordinates of node !------------------------------------------------------------------------------------------ do i=1,NODT read(11,*) x(i),y(i) end do !------------------------------------------------------------------------------------------ !Fixed node number !------------------------------------------------------------------------------------------ if(00)then mm=mm+1 mindex(mm)=i end if end do do i=1,mm ia=mindex(i) reac(i)=reac(ia) do j=1,mm ja=mindex(j) tsm(i,j)=tsm(ia,ja) end do end do !----------------------------------------------------- !To memory band matrix !----------------------------------------------------- ib=IBAND(mm,tsm,fact0,nt) call BAND(mm,ib,tsm,nt) !----------------------------------------------------- !To verify diagonal element & to stop if necessary !----------------------------------------------------- do i=1,mm if(abs(tsm(i,1))0)then mm=mm+1 mindex(mm)=i end if end do do i=1,mm ia=mindex(i) do j=1,mm ja=mindex(j) tsm(i,j)=tsm(ia,ja) tsg(i,j)=tsg(ia,ja) end do end do !----------------------------------------------------- !Eigenvalue analysis !----------------------------------------------------- call GJACOBI(mm,tsm,tsg,ev,vec,nt) do k=1,mm do i=1,nt work(i)=0.0D0 end do do i=1,mm ia=mindex(i) work(ia)=vec(i,k) end do do i=1,nt vec(i,k)=work(i) end do end do !***************************************************** !To print the results of eigenvalue analysis !***************************************************** open(12, file=fnameW, access='append') write(12,'(a)') '*eigen value & eigen vector' !Degree number kst=0 do i=1,mm write(6,*) i,ev(i) if(0.0D0m1)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,intent(in)::n1,m1,nt real(8),intent(in)::array(1:nt,1:nt) real(8),intent(out)::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,intent(in)::mm,nt real(8),intent(in)::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(mmfmk)fmk=abs(a(i,j)) if(abs(b(i,j))>fmg)fmg=abs(b(i,j)) end do end do epsk=fmk*fact epsg=fmg*fact do i=1,nf do j=1,nf vec(i,j)=0.0 end do vec(i,i)=1.0 end do kmax=5*nf*nf do k=1,kmax ip=1 iq=2 amax=a(1,2)**2.0D0/(a(1,1)**2.0D0+a(2,2)**2.0D0) do i=1,nf-1 do j=i+1,nf dam=a(i,j)**2.0D0/(a(i,i)**2.0D0+a(j,j)**2.0D0) if(amax