建立一个6*6*6的立方体作为本次讲解的模型。
model
model new
zone create brick size 6 6 6
图1 计算模型
阅读本文后续内容前,请务必熟悉遍历相关知识,如不熟悉,可阅读下文:
FLAC3D6.0遍历详解
呱太Gekota,公 众号:FLAC3D小技巧FLAC3D 6.0新手向——遍历详解
2. 各类指针获取
pointer
fish def _getZonePointer
zone.find(单元ID) =
z1 = zone.find(1)
zone.near(x,y,z) 自动获取距该坐标处最近的单元指针 =
z2 = zone.near(3,3,3)
;遍历单元
loop foreach z3 zone.list
zID = zone.id(z3)
endloop
end
@_getZonePointer
pointer
fish def _getGridpointPointer
gp1 = gp.find(1)
gp2 = gp.near(3,3,3)
loop foreach gp3 gp.list
GpID = gp.id(gp3)
endloop
end
@_getGridpointPointer
zone face skin
zone interface 'interface1' create by-face range group 'west'
zone interface 'interface2' create by-face range group 'east'
fish def _getInterfacePointer
;遍历模型中的接触面,有几个接触面就循环几次,count起计数作用
count = 0
loop foreach int1 interface.list
count += 1
endloop
;获取接触面“interface2”的指针
int2 = interface.find('interface2')
end
@_getInterfacePointer
fish def _getInterfaceElementPointer
count = 0
;获取接触面'interface2'(该接触面指针已由上文代码获取)的接触面单元指针
loop foreach intE interface.elem.list(int2)
count += 1
endloop
end
@_getInterfaceElementPointer
fish def _getInterfaceNodePoint
intN1 = interface.node.find(int2,1)
intN2
count = 0
loop foreach intN2 interface.node.list(int2)
count += 1
endloop
end
@_getInterfaceNodePoint
structure beam create by-line (0,3,3) (6,3,3) seg 6 id 1 group 'b'
structure cable create by-line (0,3,0) (6,3,0) seg 6 id 2 group 'c'
structure shell create by-face id 3 group 's' range group 'top'
fish def _getStrucNodePointer
;已知节点ID
n1 = struct.node.find(1)
;已知节点位置,软件自动搜寻距该位置最近的节点并获取指针
n2 = struct.node.near(3,3,6)
;遍历获取模型中的所有结构单元节点指针
loop foreach n3 struct.node.list
NodeID = struct.node.id(n3)
endloop
end
@_getStrucNodePointer
fish def _getStructElemPointer
;已知结构单元ID号
SE1 = struct.find(1)
;已知结构单元位置
SE2 = struct.near(3,3,6)
;遍历获取,可以用一个if语句来获取特定类型的结构单元指针
;还可以再嵌套一个if语句,通过筛选结构单元分组等特征获取特定类型、特定分组的结构单元指针
count = 0
loop foreach SE3 struct.list
if struct.type(SE3) = 'shell'
count += 1
endif
endloop
end
@_getStructElemPointer
;建立一个名为“table1”的table
table 'table1' label 'test'
fish def _getTablePointer
;已知table名
t1 = table.find('table1')
;采用table。create()函数自动获取
t2 = table.create('table2')
t3 = table.create(3)
end
@_getTablePointer
fish def _getArrayPointer
a1 = array.create(10)
end
@_getArrayPointer
图4 指针类型监控
图5 fish symbols显示设置