| 查看: 1156 | 回复: 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 |
» 猜你喜欢
E0414, 我的本子有没有希望?
已经有9人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有3人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有3人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有3人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有4人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有3人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有3人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有4人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有5人回复
售T0P一区SCI文章,我:8O5.51.O.54,科目齐全,可+急
已经有6人回复
» 抢金币啦!回帖就可以得到:
郑州大学急招1名2026级博士生
+1/471
征一人,此生平安欢喜度日常
+1/97
MOCVD 外延GaN和AlN以及LED服务
+1/87
温州医科大学李校堃院士团队宋林涛/黄志锋课题组诚聘博士后
+1/77
Cu2O纳米线
+5/70
哈工大深圳-材料学院-招收申请审核制2027年春季/秋季入学博士生(2026年9月报名)
+1/35
西交利物浦大学招收27年1月入学奖学金博士生1名【人机协作交互与数字孪生】
+1/28
博士毕业之后申请发明专利
+1/27
上海大学微电子学院杨军教授团队招聘带编专任教师
+1/10
东北师范大学荒漠与草地生态学方向诚聘博士后青年才俊
+1/9
哈工大马樱教授招收2027级计算机类、集成电路类博士生
+1/7
密苏里大学生物材料合成生物学博士后招聘
+1/6
密苏里大学生物材料合成生物学博士后招聘
+1/5
近红外二区荧光杂峰
+1/4
上海大学微电子学院杨军教授团队招聘带编专任教师
+1/2
计算化学博士后研究员招聘
+1/2
中山大学深圳校区陈健副教授课题组招收博士/研究助理
+1/1
中山大学深圳校区陈健副教授课题组招收博士/研究助理
+1/1
2026年黄河科技学院纳米功能材料研究所招聘
+1/1
招科研助理,提前招27年博士生
+1/1
简单回复
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客户端











回复此楼