程序结构力学大作业(共20页).docx
《程序结构力学大作业(共20页).docx》由会员分享,可在线阅读,更多相关《程序结构力学大作业(共20页).docx(20页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上程序结构力学大作业结81 孙玉进该程序可计算任意平面结构任意阶频率(包括重频),以及任意阶振型(包括重频对应正交振型)。计算时,振型不包括不包括单元固端型振型。!*module NumKind!*implicit noneinteger (kind(1),parameter : ikind = kind(1), rkind = kind(0.D0)real (rkind),parameter : Zero = 0._rkind, One = 1._rkind, Two = 2._rkind, &Three= 3._rkind, Four = 4._rkind, Fiv
2、e = 5._rkind, &Six = 6._rkind, Seven= 7._rkind, Eight = 8._rkind, &Nine = 9._rkind, Ten =10._rkind, Twelve=12._rkindend module NumKind!*module TypeDef!*use NumKindimplicit nonetype : typ_Jointreal (rkind) : x,yinteger (ikind) : GDOF(3)end type typ_Jointtype : typ_Elementinteger (ikind) : JointNo(2),
3、GlbDOF(6)real (rkind) : Length,CosA,SinA,EI,EA,massend type typ_Elementtype : typ_JointLoadinteger (ikind) : JointNo,LodDOFreal (rkind) : LodValend type typ_JointLoadtype : typ_ElemLoadinteger (ikind) :ElemNo,Indxreal (rkind) : Pos,LodValend type typ_ElemLoadcontains!=subroutine SetElemProp (Elem, J
4、oint)!=type (typ_Element),intent(in out) : Elem(:)type (typ_Joint),intent(in) : Joint(:)integer(ikind):ie,NElemreal(rkind):x1,x2,y1,y2NElem=size(Elem,dim=1)do ie=1,NElemx1=Joint(Elem(ie)%JointNo(1)%xy1=Joint(Elem(ie)%JointNo(1)%yx2=Joint(Elem(ie)%JointNo(2)%xy2=Joint(Elem(ie)%JointNo(2)%yElem(ie)%Le
5、ngth=sqrt(x1-x2)*2+(y1-y2)*2)Elem(ie)%CosA=(x2-x1)/Elem(ie)%LengthElem(ie)%SinA=(y2-y1)/Elem(ie)%LengthElem(ie)%GlbDOF(1:3)=Joint(Elem(ie)%JointNo(1)%GDOF(:)Elem(ie)%GlbDOF(4:6)=Joint(Elem(ie)%JointNo(2)%GDOF(:)end doreturnend subroutine SetElemProp!=subroutine TransMatrix (ET, CosA,SinA)!=real(rkin
6、d),intent(out) : ET(:,:)real(rkind),intent(in) : CosA,SinA! ET could be 2x2, 3x3 or 6x6 depending size(ET)ET = ZeroET(1,1:2) = (/ CosA, SinA /)ET(2,1:2) = (/-SinA, CosA /)if (size(ET,1) 2) ET(3,3) = Oneif (size(ET,1) 3) ET(4:6,4:6) = ET(1:3,1:3)returnend subroutine TransMatrixend module TypeDef!*mod
7、ule BandMat!*use NumKinduse TypeDef,only : typ_Element ! 仅用该模块中的typ_Elementimplicit noneprivate ! 默认所有的数据和过程为私有,增强封装性public : SetMatBand, DelMatBand, VarBandSolvtype,public : typ_Kcolreal (rkind),pointer : row(:)end type typ_Kcolcontains!=subroutine SetMatBand (Kcol, Elem)!=! .6-4-2type (typ_KCol),i
8、ntent(in out) : Kcol(:)type (typ_Element),intent(in) : Elem(:)integer (ikind) : minDOF,ELocVec(6)integer (ikind) : ie,j,NGlbDOF,NEleminteger (ikind) : row1(size(Kcol,dim=1)! row1是自动数组,子程序结束后将自动释放内存空间NGlbDOF = size(Kcol,1)NElem = size(Elem,1)row1 = NGlbDOF ! 先设始行码为大数! 确定各列始行码,放在数组row1(:)中do ie=1,NEle
9、mELocVec = Elem(ie)%GlbDOFminDOF = minval (ELocVec,mask = ELocVec 0)where (ELocVec 0)row1(ELocVec) = min(row1(ELocVec), minDOF)end whereend do! 为各列的半带宽分配空间并初始化do j=1,NGlbDOFallocate ( Kcol(j)%row(row1(j):j) )Kcol(j)%row = Zero ! 清零end doreturnend subroutine SetMatBand!=subroutine DelMatBand (Kcol)!=
10、!.6-5-5type (typ_KCol), intent(in out) : Kcol(:)integer (ikind) : j,NGlbDOFNGlbDOF = size(Kcol,1)do j=1,NGlbDOFdeallocate ( Kcol(j)%row )end doreturnend subroutine DelMatBand!=subroutine VarBandSolv (Disp, Kcol,GLoad)!=type (typ_KCol), intent(in out) : Kcol(:)real (rkind), intent(out) : Disp(:)real
11、(rkind), intent(in) : GLoad(:)integer (ikind) : i,j,k,row1j,row_1,NColreal(rkind) : Diag(size(Kcol,dim=1)real(rkind) :s!.6-5-2NCol=size(Kcol,1)Diag(1:NCol)=(/(Kcol(j)%row(j),j=1,NCol)/)do j=2,NColrow1j=lbound(Kcol(j)%row,1)do i=row1j,j-1row_1=max(row1j,lbound(Kcol(i)%row,1)k=i-1s= sum(Diag(row_1:k)*
12、Kcol(i)%row(row_1:k)*Kcol(j)%row(row_1:k)Kcol(j)%row(i)=(Kcol(j)%row(i)-s)/Diag(i)end dos=sum(Diag(row1j:j-1)*Kcol(j)%row(row1j:j-1)*2)Diag(j)=Diag(j)-send doDisp(:) = GLoad(:)!. 6-5-3节的代码:其中GP换为Disp do j=2,NColrow1j=lbound(Kcol(j)%row,1)Disp(j)=Disp(j)-sum(Kcol(j)%row(row1j:j-1)*Disp(row1j:j-1)end
13、do!. 6-5-4节的代码:其中GP换为Disp Disp(:)=Disp(:)/Diag(:)do j=NCol,1,-1row1j=lbound(Kcol(j)%row,1)Disp(row1j:j-1)=Disp(row1j:j-1)-Disp(j)*Kcol(j)%row(row1j:j-1)end doreturnend subroutine VarBandSolvend module BandMat!*module DispMethod!*use NumKinduse TypeDefuse BandMatimplicit nonecontains!=subroutine Solv
14、eDisp(Disp,Elem,Joint,JLoad,ELoad)!=real(rkind),intent(out) : Disp(:)type(typ_Element),intent(in) : Elem(:)type(typ_Joint) ,intent(in) : Joint(:)type(typ_JointLoad),intent(in) : JLoad(:)type(typ_Elemload),intent(in) : ELoad(:)type(typ_Kcol),allocatable : Kcol(:) real(rkind),allocatable : GLoad(:) in
15、teger(ikind) : NGlbDOFNGlbDOF=size(Disp,dim=1)allocate(GLoad(NGlbDOF)allocate(Kcol(NGlbDOF)call SetMatBand(Kcol,Elem)call GLoadVec(GLoad,Elem,JLoad,ELoad,Joint)call GStifMat(Kcol,Elem)call VarBandSolv(Disp,Kcol,GLoad)call DelMatBand(Kcol)deallocate(GLoad) returnend subroutine SolveDisp!=subroutine G
16、StifMat(Kcol,Elem)!=type(typ_Kcol),intent(in out) : Kcol(:)type(typ_Element),intent(in) : Elem(:)! .6-4-3integer (ikind) : ie,j,JGDOF,NElemreal (rkind) : EK(6,6),ET(6,6)integer (ikind) : ELocVec(6)NElem=size(Elem,1)do ie=1,NElemcall EStifMat (EK,Elem(ie)%Length,Elem(ie)%EI,Elem(ie)%EA)call TransMatr
17、ix(ET,Elem(ie)%CosA,Elem(ie)%SinA)EK=matmul(transpose(ET),matmul(EK,ET)ELocVec=Elem(ie)%GlbDOFdo j=1,6JGDOF=ELocVec(j)if(JGDOF=0) cyclewhere (ELocVec0)Kcol(JGDOF)%row(ELocVec)=Kcol(JGDOF)%row(ELocVec)+EK(:,j)end whereend doend doreturnend subroutine GStifMat!=subroutine GLoadVec(GLoad,Elem,JLoad,ELo
18、ad,Joint)!=real (rkind),intent(out) : GLoad(:)type (typ_Element), intent(in) : Elem(:)type (typ_Joint), intent(in) : Joint(:)type (typ_JointLoad), intent(in) :JLoad(:)type (typ_ElemLoad), intent(in) :ELoad(:)integer (ikind) : ie,NJLoad,NELoadreal (rkind) : F0(6),ET(6,6)NJLoad=size(JLoad,dim=1)NELoad
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 程序结构 力学 作业 20
限制150内