找回密码
 注册
Simdroid-非首页
查看: 410|回复: 8

[前后处理] 用单元号提取单元应力

[复制链接]
发表于 2008-10-11 21:20:04 | 显示全部楼层 |阅读模式 来自 江苏徐州
;第一步提取单元号
;例如提取218<y<220,1.3<z<1.8范围内的单元号
def find_xond
     array f(1)
     status=open('x方向单元号.txt',1,1)
     f(1)='id'+' '+'x'+' '+'y'+' '+'z'
     status=write(f,1)
     pnt=zone_head
     loop while pnt # null
          zby=z_ycen(pnt)
          zbz=z_zcen(pnt)
          if zby>218 then
              if zby<220 then
                  if zbz> 1.3 then
                      if zbz<1.8 tehn
                          f(1)=string(z_id(pnt))
                          f(1)=f(1)+' '+string(z_xcen(pnt))
                          f(1)=f(1)+' '+string(z_ycen(pnt))
                          f(1)=f(1)+' '+string(z_zcen(pnt))
                          status=write(f,1)
                       end_if
                   end_if
              end_if
          end_if
          pnt=z_next(pnt)
    end_loop
    status=close
end
find_xond
;第二步,利用提取的单元号提取该单元应力
def datetake
    array d(1)
    status=open(filename.txt',1,1)
    d(1)='id'+' '+'xdis'+' '+'ydis'+' '+'zdis'+' '+'x'+' '+'y'+' '+'z'
    status=write(d,1)
    loop k(1,n);n,单元数目
        g=n_yllb(1,k);n_yllb(1,k),单元数目数组
        p_z=find_zone(g)
            d(1)=string(g)
            d(1)=d(1)+' '+string(z_sxx(p_z))
            d(1)=d(1)+' '+string(z_syy(p_z))
            d(1)=d(1)+' '+string(z_szz(p_z))
            d(1)=d(1)+' '+string(z_sxy(p_z))
            d(1)=d(1)+' '+string(z_sxz(p_z))
            d(1)=d(1)+' '+string(z_syz(p_z))
            d(1)=d(1)+' '+string(z_xcen(p_z))
            d(1)=d(1)+' '+string(z_ycen(p_z))
            d(1)=d(1)+' '+string(z_zcen(p_z))
           status=write(d,1)
    end_loop
    status=close
end
lb;定义的单元数组
datetake
 楼主| 发表于 2008-10-11 21:31:45 | 显示全部楼层 来自 江苏徐州

用节点号提取节点位移

Simdroid开发平台
;第一步,提取想要范围你的节点号
;例如,219<y<221,1.8<z<2.3范围内的节点号
def find_xgid
     array c(1)
     status=open('filename.txt',1,1)
     c(1)='id'+' '+'x'+' '+'y'+' '+'z'
     status=write(c,1)
     pnt=gp_head
     loop while pnt # null
          zby=gp_ypos(pnt)
          zbz=gp_zpos(pnt)
          if zby>219 then
              if zby<221 then
                  if zbz> 1.8 then
                      if zbz<2.3 tehn
                          c(1)=string(gp_id(pnt))
                          c(1)=c(1)+' '+string(gp_xpos(pnt))
                          c(1)=c(1)+' '+string(gp_ypos(pnt))
                          c(1)=c(1)+' '+string(gp_zpos(pnt))
                          status=write(c,1)
                       end_if
                   end_if
              end_if
          end_if
          pnt=gp_next(pnt)
    end_loop
    status=close
end
find_xgid
;提取节点的位移
def getdate
    array c(1)
    status=open('600-5m煤柱dd220-2.txt',1,1)
    c(1)='id'+' '+'xdis'+' '+'ydis'+' '+'zdis'+' '+'x'+' '+'y'+' '+'z'
    status=write(c,1)
    loop m(1,k);k,节点数目
         a=n_wydd(1,m);n_wydd(1,m),节点数组
         p_gp=find_gp(a)     
                  c(1)=string(a)
                  c(1)=c(1)+' '+string(gp_xdisp(p_gp))
                  c(1)=c(1)+' '+string(gp_ydisp(p_gp))
                  c(1)=c(1)+' '+string(gp_zdisp(p_gp))
                  c(1)=c(1)+' '+string(gp_xpos(p_gp))
                  c(1)=c(1)+' '+string(gp_ypos(p_gp))
                  c(1)=c(1)+' '+string(gp_zpos(p_gp))
                  status=write(c,1)
    end_loop
     status=close
end
dd;dd,节点数组名
getdate
回复 1 不支持 0

使用道具 举报

发表于 2009-7-28 22:38:13 | 显示全部楼层 来自 江苏苏州
              
回复 不支持

使用道具 举报

发表于 2010-4-22 15:56:25 | 显示全部楼层 来自 重庆沙坪坝区
单元应力是变的,怎么能提取出来呢?
回复 不支持

使用道具 举报

发表于 2010-4-27 09:56:45 | 显示全部楼层 来自 陕西西安
收藏学习下
回复 不支持

使用道具 举报

发表于 2012-12-17 14:21:10 | 显示全部楼层 来自 四川乐山
楼主强大
回复 不支持

使用道具 举报

发表于 2015-4-21 17:13:35 | 显示全部楼层 来自 四川绵阳
收藏 好强大
回复 不支持

使用道具 举报

发表于 2015-5-11 16:08:00 | 显示全部楼层 来自 江西
谢谢LZ分享。。
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-23 20:25 , Processed in 0.062741 second(s), 15 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表