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

[命令/FISH] head=new

[复制链接]
发表于 2013-2-18 19:27:59 | 显示全部楼层 |阅读模式 来自 山东菏泽
gen zone brick size 10 5 5
mod el
prop shear 1e8 bulk 2e8
fix x y z ran x 0 y 0 5 z 0 5
fix x y z ran x 0 10 y 0 5 z 0
fix x y z ran x 10 y 0 5 z 0 5
table 1
def find_add
head = null
pnt =  gp_head
loop while pnt # null
x_pos = gp_xpos(pnt)
if x_pos = width then
new = get_mem(2)
mem(new) = head
mem(new+1) = pnt
head = new
endif
pnt = gp_next(pnt)
endloop
end
set width = 10.0
find_add
def app_vel
while_stepping
ad = head
loop while ad # null
pnt = mem(ad+1)
gp_xvel(pnt) = vel_max * gp_zpos(pnt) / height
gp_zvel(pnt) = -vel_max * (gp_xpos(pnt) - width) / height
ad = mem(ad)
endloop
end
set large vel_max = 1e-2 height = 5.0
step 100
plot grid black vel red
上面的head=new 是什么意思那?起到什么作用那?
 楼主| 发表于 2013-3-3 17:48:15 | 显示全部楼层 来自 山东菏泽
Simdroid开发平台
哪位 帮忙解答一下?
回复 不支持

使用道具 举报

发表于 2013-4-14 19:23:00 | 显示全部楼层 来自 山东青岛
你说的是head = null吧
def find_add  ;定义fish函数find_add
head = null   ;给head赋值
p_gp = gp_head  ;第一个网格结点的指针赋给p_gp
loop_while p_gp # null  ;当p_gp值不为null时作循环
x_pos = gp_xpos(p_gp)  ;将指针为p_gp的结点的x坐标值赋给x_pos
回复 不支持

使用道具 举报

发表于 2013-4-15 07:20:02 | 显示全部楼层 来自 黑龙江哈尔滨
猪猪侠88 发表于 2013-4-14 19:23
你说的是head = null吧
def find_add  ;定义fish函数find_add
head = null   ;给head赋值

不是,是上面mem函数中的 head=new
回复 不支持

使用道具 举报

发表于 2013-4-15 10:09:36 | 显示全部楼层 来自 山东青岛
new = get_mem(2)  ;从主内存空间里得到2个fish变量对象并返回第一个对象的开始地址
mem(new) = head  ;将head类型和数值置于地址为new的fish变量
head = new  ;将new值赋给head
你看看这样
回复 不支持

使用道具 举报

发表于 2013-4-15 10:20:09 | 显示全部楼层 来自 山东青岛
def app_vel
while_stepping% J* T& U2 }; h0 |" }
ad = head7 |6 \7 E" }4 e4 q' Z3 A
loop while ad # null
def app_vel
while_stepping
ad = head
pnt = mem(ad+1)
gp_xvel(pnt) = vel_max * gp_zpos(pnt) / height,
gp_zvel(pnt) = -vel_max * (gp_xpos(pnt) - width) / height
ad = mem(ad)
endloop
end请问这个fish语句是什么意思?
回复 不支持

使用道具 举报

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

本版积分规则

Simapps系列直播

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

GMT+8, 2024-9-24 06:28 , Processed in 0.030378 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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