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

[建模专区] 请看看我的代码(为什么一运行就卡)

[复制链接]
发表于 2013-11-1 16:25:41 | 显示全部楼层 |阅读模式 来自 江苏南京
想把块体是否接触用关系矩阵表达出来,块体已经生成del ball range color 0         
def re_head      ;重新定义表头
bp=ball_head
loop while bp # null
   bnext=b_next(bp) then
     if b_id(bp)=bid then
     ii=b_delete(bp)
     end_if
  bp=bnext
end_loop
end
re_head


def afill
cp=contact_head
array var1(3223,3223)
     loop while cp # null
       bp1=c_ball1(cp)
       bp2=c_ball2(cp)
       clp1=b_clump(bp1)
       clp2=b_clump(bp2)
       m=cl_id(clp1)
       n=cl_id(clp2)
       if c_nstrength(cp)=5.6e3
         var1(m,n)=1
       end_if
     end_loop
     if var1(m,n) # 1
        var1(m,n)=0
     end_if
end
def ashow
loop m (1,3223)
  hed=' '
  msg=' '+string(m)
  loop n (1,3223)
    hed=hed+'       '+string(n)
    msg=msg+' '+string(var1(m,n))
  end_loop
  if m=1
    dum=out(hed)
  end_if
  dum=out(msg)
end_loop
end
afill
set log on
ashow
set log off



 楼主| 发表于 2013-11-2 00:18:27 | 显示全部楼层 来自 江苏南京
Simdroid开发平台
已经解决了
回复 不支持

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-26 11:36 , Processed in 0.026235 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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