前文已经完成遍历单元来统计塑性区体积,现在需要对统计的单元先进行一个位置的筛选。
zone.pos
Syntax
Vector Access
v = zone.pos(p<,i>)
Get the zone centroid position.
| Returns: | v - zone position vector or component |
|---|---|
| Arguments: | p - zone pointer i - optional vector component |
Component Access
f = zone.pos.x(p)
Get the x-component of the zone centroid position.
| Returns: | f - x-component of the zone position vector |
|---|---|
| Arguments: | p - zone pointer |
f = zone.pos.y(p)
Get the y-component of the zone centroid position.
| Returns: | f - y-component of the zone position vector |
|---|---|
| Arguments: | p - zone pointer |
f = zone.pos.z(p)
Get the z-component of the zone centroid position.
| Returns: | f - z-component of the zone position vector |
|---|---|
| Arguments: | p - zone pointer |
代码的更改:
;#筛选
f = zone.pos.z(p_z);通过Z坐标来筛选需要遍历的单元
if f<-800 then
if math.and(zone.state(p_z,true),shearnow) = shearnow then
v_shear_now = v_shear_now + zone.vol(p_z)
else if math.and(zone.state(p_z,true),tensionnow) = tensionnow then
v_tension_now = v_tension_now + zone.vol(p_z)
else if math.and(zone.state(p_z,true),shearpast) = shearpast then
v_shear_past = v_shear_past + zone.vol(p_z)
else if math.and(zone.state(p_z,true),tensionpast) = tensionpast then
v_tension_past = v_tension_past + zone.vol(p_z)
endif
endif
同理可以用X坐标或者Y坐标,或者三维坐标的结合来控制筛选单元。
2019

被折叠的 条评论
为什么被折叠?



