|
;//////////////////////show_allkind_plasticzone.txt///////////////////////////////
;/目的:按单元体不同破坏种类显示在不同窗口中并计算破坏体积和数目
/
;/方法:先rest *.sav然后call本文档,之后选择菜单栏 Window->Tile
/
;/条件:适用于FLAC3D3.0
/
;/作者:zhubinglong
2016.04.27
;/////////////////////////////////////////////////////////////////////////////////
def get_plast
;定义函数get_plast
shearnow = 1
;shearnow、tensionnow
tensionnow = 2
;shearpast、tensionpast
shearpast = 4
;的state value分别为1、2、4、8
tensionpast = 8
;具体内容参见fish reference
2.5.3.3
v_shear_now = 0
;需求的shearnow、tensionnow
v_tension_now = 0
;shearpast、tensionpast的体积,初始值为0
v_shear_past = 0
v_tension_past = 0
;flac默认的值
v_yield = 0
_sum_znum_shearnow=0
;用来记录处于shearnow的单元体个数
_sum_znum_tensionnow=0
_sum_znum_shearpast=0
_sum_znum_tensionpast=0
_sum_znum_yield=0
;xx=z_state(find_zone(11779),0)
;通过本步可验证
p_z = zone_head
;单元指针
loop while p_z
# null
;开始循环,如果单元指针不为空,执行以下操作
if
and(z_state(p_z,0),shearnow)
= shearnow then
;判断语句,判断单元如果是shearnow状态
v_shear_now = v_shear_now +
z_volume(p_z)
;则把该单元的体积加进v_shear_now
z_group(p_z)='my_shearnow_';
_sum_znum_shearnow=_sum_znum_shearnow+1;
endif
if
and(z_state(p_z,0),tensionnow)
= tensionnow then
;同上判断语句,判断单元是否为tensionnow状态
v_tension_now = v_tension_now +
z_volume(p_z)
z_group(p_z)='my_tensionnow_';
_sum_znum_tensionnow=_sum_znum_tensionnow+1
endif
if
and(z_state(p_z,0),shearpast)
= shearpast then
;同上,判断单元是否shearpast
v_shear_past
= v_shear_past + z_volume(p_z)
z_group(p_z)='my_shearpast_';
_sum_znum_shearpast=_sum_znum_shearpast+1
endif
if
and(z_state(p_z,0),tensionpast)
= tensionpast then
v_tension_past = v_tension_past +
z_volume(p_z)
z_group(p_z)='my_tensionpast_';
_sum_znum_tensionpast=_sum_znum_tensionpast+1
endif
if
and(z_state(p_z,0),shearnow)
# shearnow then
if
and(z_state(p_z,0),tensionnow)
# tensionnow then
if
and(z_state(p_z,0),shearpast)
# shearpast then
if
and(z_state(p_z,0),tensionpast)
# tensionpast then
z_group(p_z)='other';
endif
endif
endif
endif
p_z = z_next(p_z)
;单元指针指向下一个单元
endloop
if _sum_znum_shearnow#0
command
;title
;显示模型中当前剪切破坏单元体
plot creat my_shearnow
plot add surf red
range group my_shearnow_
plot add sk range
group other
plot show my_shearnow
endcommand
endif
if _sum_znum_tensionnow#0
command
;title
;显示模型中当前拉帐破坏单元体
plot creat my_tensionnow
plot add surf red
range group my_tensionnow_
plot add sk range
group other
plot show my_tensionnow
endcommand
endif
if _sum_znum_shearpast#0
command
;title
;显示模型中过去剪切破坏单元体
plot creat my_shearpast
plot add surf red
range group my_shearpast_
plot add sk range
group other
plot show my_shearpast
endcommand
endif
if _sum_znum_tensionpast#0
command
;title
;显示模型中过去拉张破坏单元体
plot creat my_tensionpast
plot add surf red
range group my_tensionpast_
plot add sk range
group other
plot show my_tensionpast
endcommand
endif
end
get_plast
;执行函数
;;;运行fish后,执行pri
fish就可以显示shearnow(当前剪切破坏),tensionnow(当前拉帐破坏)
;;;shearpast(过去剪切破坏),tensionpast(过去拉帐破坏)的体积值
def plasticrange
p_z=zone_head
loop while
p_z # null
if z_state(p_z,0)
# 0
;z_group(p_z)='my_yield_';
v_yield=v_yield+z_volume(p_z)
_sum_znum_yield=_sum_znum_yield+1
else
;z_group(p_z)='other'
endif
p_z=z_next(p_z)
endloop
if
_sum_znum_yield#0
command
;title
;显示模型中屈服破坏单元体
plot creat
my_yield
plot add
surf red range group
my_yield_
plot add
sk range group other
plot show
my_yield
endcommand
endif
ii = out('破坏类型
体积
单元体个数')
;输出题头
ii = out('shear_now
: ' +
string(v_shear_now)+' '+
string(_sum_znum_shearnow))
;输出shear_now的体积值
ii = out('tension_now
: ' +
string(v_tension_now)+'
'+string(_sum_znum_tensionnow));输出tension_now的体积值
ii = out('shear_past
: ' +
string(v_shear_past)+'
'+string(_sum_znum_shearpast))
;输出shear_past的体积值
ii = out('tension_past
:'+string(v_tension_past)+'
'+string(_sum_znum_tensionpast));输出tension_past的体积值
ii = out('yield :
' + string(v_yield)+'
'+string(_sum_znum_yield))
;
ii = out('选择菜单栏
Window->Tile,会有惊喜哦!!')
;
end
;plasticrange
|