| 查看: 1207 | 回复: 5 | |||
[交流]
Fortran平面桁架有限元程序
|
|||
|
program truss_2D use prep use solve implicit none integer :: i,j,m,n,nel,nne,nn,nodof,edof,gdof integer :: e2s(4) real :: L,FN real :: kl(4,4),kg(4,4),T(4,4) integer,allocatable :: elemNodes (:,:) ,nf(:,:) real ,allocatable :: Coords (:,:),prop(:,:), & KK(:,:),loads(:,:) real ,allocatable :: nodedisp(:,:),F(:) ,edg(:), & fg(:),fl(:),delta(:) open ( 10,file = 'data.txt' ) open ( 11,file = 'out.txt' ) read (10,*) nel ! Number of elements read (10,*) nne ! Number of nodes per element allocate ( elemNodes(nel,nne),prop(nel,nne) ) read (10,*) nn ! Number of nodes read (10,*) nodof ! Number of degrees of freedom per node edof = nodof * nne allocate ( Coords(nn,nodof),nf(nn,nodof), & loads(nn,nodof),nodedisp(nn,nodof),edg(edof), & fg(edof),fl(edof) ) read (10,*) ( (elemNodes(i,j), j=1,nne), i=1,nel ) read (10,*) ( (prop(i,j), j=1,nne), i=1,nel ) read (10,*) ( (Coords(i,j), j=1,nodof), i=1,nn ) read (10,*) ( (nf(i,j), j=1,nodof), i=1,nn ) read (10,*) ( (loads(i,j), j=1,nodof), i=1,nn ) gdof = 0 do i = 1,nn do j = 1,nodof if ( nf(i,j)/=0 ) then gdof = gdof + 1 nf(i,j) = gdof end if end do end do allocate ( KK(gdof, gdof), F(gdof),delta(gdof) ) F = 0. call truss_F( m,n,nn,nodof,nf,gdof,loads,F) e2s = 0 KK = 0. do i = 1,nel call truss_T(i,nel,nne,nn,nodof,elemNodes,Coords,L,T) call truss_kl (i,nel,nne,L,prop,kl) call truss_kg (T,kl,kg) call truss_e2s(i,j,nn,nel,nne,nodof,nf,elemNodes,e2s) call form_KK (m,n,edof,gdof,kg,e2s,KK) end do call fem_Solver(KK,F,gdof,delta) ! 求解 nodedisp = 0. forall ( i = 1:nn,j = 1:nodof,nf(i,j)/=0 ) nodedisp(i,j) = delta( nf(i,j) ) end forall do i = 1,nel call truss_T(i,nel,nne,nn,nodof,elemNodes,Coords,L,T) call truss_kl (i,nel,nne,L,prop,kl) call truss_kg (T,kl,kg) call truss_e2s(i,j,nn,nel,nne,nodof,nf,elemNodes,e2s) edg = 0. do j = 1,edof if ( e2s(j) /= 0 ) then edg(j) = delta( e2s(j) ) end if end do fg = matmul( kg,edg ) fl = matmul( T,fg ) FN = fl(3) write (11,100) i write (11,200) FN end do 100 format (/,T10,'单元',I2 ) 200 format (T10,'轴力=',F18.4) end program truss_2D |
» 猜你喜欢
申博
已经有7人回复
征友后感触
已经有9人回复
食品与机械 编辑C处理稿子时间
已经有4人回复
27年药学 考博申请
已经有6人回复
注意啦!用基金购买打印纸、硒鼓、优盘、移动硬盘、个人计算机属于违规了
已经有4人回复
为了不被淘汰,必须要开始第三次奋斗了
已经有12人回复
IVD领域内综述投稿推荐
已经有5人回复
» 抢金币啦!回帖就可以得到:
中山大学(深圳)陈友课题组招收2027年学术型博士
+1/177
广州征女友
+2/128
吉林大学-招收2027级-能源电池-博士研究生
+1/77
求助 国军标一篇 GJB3206B-2022 技术状态管理
+1/41
华东师大先进材料课题组招收考核制博士生1名——能源、材料等方向
+1/30
华东师大先进材料课题组招收考核制博士生1名——能源、材料等方向
+1/26
双一流大学湘潭大学“化工过程模拟与强化”国家地方联合工程研究中心招收博士生
+1/22
吉大-苏大联合培养,2027年考核制博士
+1/21
武汉双一流高校干细胞与肿瘤生物学团队招聘2027级申请考核制博士生
+1/12
寻求负极焦气流磨代加工
+1/12
地学的资源里显示“指定的主题已经归档,禁止浏览”是怎么回事?
+1/10
天津理工大学国家杰青鲁统部团队
+1/9
南京工业大学柔性电子(未来技术)学院招2027申请考核制博士生(钙钛矿太阳能方向)
+1/8
云南大学有机化学专业有机合成 生物探针等方向均可 招聘博士生一名
+1/7
美国Clemson大学 Liu Sheng课题组 biophysics 招收2027级博士生
+1/5
【试剂分享】告别微流控:预制 Mal-LN29-tLNP 抗体偶联试剂盒,脾脏 CD8+ 转染 97.2%
+1/4
2026 Virtual Cell Challenge揭晓:胜出的为何是“实测迁移+统计校准+细胞生成”
+1/3
加巴喷丁有关物质研究难点浅析,杂质对照品可提供全套表征
+2/2
北京工商大学中国轻工业聚合物发泡材料加工与应用重点实验室2026年博士研究生招生
+1/2
北京工商大学中国轻工业聚合物发泡材料加工与应用重点实验室2026年博士研究生招生
+1/2
简单回复
dsctg2楼
2017-02-24 11:48
回复
springer_(金币+1): 谢谢参与
2017-02-24 14:30
回复
springer_(金币+1): 谢谢参与
是 发自小木虫IOS客户端
2017-11-10 23:54
回复
2018-01-11 19:19
回复
springer_(金币+1): 谢谢参与
是 发自小木虫Android客户端
2018-01-27 19:42
回复
springer_(金币+1): 谢谢参与
顶 发自小木虫IOS客户端










回复此楼