程序结构力学大作业

上传人:壹****1 文档编号:504965287 上传时间:2023-01-21 格式:DOCX 页数:20 大小:19.78KB
返回 下载 相关 举报
程序结构力学大作业_第1页
第1页 / 共20页
程序结构力学大作业_第2页
第2页 / 共20页
程序结构力学大作业_第3页
第3页 / 共20页
程序结构力学大作业_第4页
第4页 / 共20页
程序结构力学大作业_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《程序结构力学大作业》由会员分享,可在线阅读,更多相关《程序结构力学大作业(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 SolveDisp(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),

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 教学/培训

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号