1. 引言
(1) 涂色几何节点:通过 geometry paint-extra 命令,可以将模型的单元字段数据 (如应力、位移等)涂色到活跃几何集的节点上。例如,如果要将zz涂色,可以使用以下命令:
geometry select 'development'
geometry paint-extra 1 stress quantity zz
这将计算模型中所有节点的zz,并将这些值存储在几何集的额外变量索引1中。
(2) 选择可视化类型:在geometry绘图中,设置“Type”属性为“Contour”,并将“Contour By”设置为“Node Extra”,以便从几何节点的额外变量中获取数据进行渲染。
model new
;
; Create zones
zone create brick point 0 29000 27000 3000 ...
point 1 34000 27000 3000 ...
point 2 29000 30000 3000 ...
point 3 29000 27000 5000 ...
size 25 15 10
;
; Import geometry
geometry import 'development.dxf'
zone densify gradient-limit repeat 4 range ...
geometry-distance 'development' gap 0. extent
;
; Assign constitutive model
zone cmodel assign elastic
;
; Initial vertical stress: density = 5, gravity = 32, depth = 5000
zone initialize stress-zz -8e5 gradient 0 0 160
;
; Paint szz onto geometry (extra variable 1)
geometry select 'development'
geometry paint-extra 1 stress quantity zz
;
fish define get_szz(loc)
zone.field.name = 'stress-zz'
global result = zone.field.get(loc)
local status = io.out('szz at '+string(loc)+' is: '+string(result))
end
@get_szz((31000,28500,4000))
;
; Save model state
model save 'paint'