FLAC3D学习(SIMWE论坛君之枫整理) ' 按下回车键给计算器 SendKeys \'SendKeys \'SendKeys \'SendKeys \'SendKeys \'SendKeys \'调用命令流
SendKeys \SendKeys \End Sub test.dat: restore tcav3.sav call stable.dat stable.dat: ;;显示支撑轴力得变化 plot hist 7
;;excavate the fourth layer model null ran group pcav4 ;;支撑稳定性判断程序
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;读出数据,将其输到文件c:\\panda\\t1.txt中 ;;read the force from flac def stable
loop t(1,200) ;每500步判断一次 ;;计算200步 command step 200 endcommand command ;;删除旧有文件
Sys del F:\\VB\\work\\t1.txt
;;打开文件开关,并将支撑轴力录入到c:\\panda\\t1.txt中。 set log on
set logfile F:\\VB\\work\\t1.txt print sel beam force set log off ;;调用vb程序
46
FLAC3D学习(SIMWE论坛君之枫整理) Sys start /wait F:\\VB\\work\\inputdata.exe endcommand
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;读入数据之前的定义 a_size = 1 IO_READ = 0 IO_WRITE = 1 IO_FISH = 0
IO_ASCII =1 ;当需要读入,需使用ASCII模式
filename = 'output.txt' ; 注意:如果要进行文件操作,必须先定义,不能直接使用。 ;;读入数据 ;;define the array array var(1) ;;3.输入数据
status=open(filename,IO_READ,IO_ASCII) status=read(var,a_size) status=close ;;将在z_d初始化为零 z_d=0
;;对数据类型进行转化 z_d=int(var(1))
;;判断是否失稳,如果输入数据为0,则继续循环,如果输入数据为1,则判断失稳并跳出循环将所有杆刚度设为0 if z_d=1 then command
;;将所有杆设置刚度设为很小
sel beam id=1 prop density 1.9 emod=1.0e8 nu=0.0003 & xcarea=0.00968 xciy=0.844e-3 xciz=0.844e-3 xcj=0 endcommand exit endif endloop end stable
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; solve
save pcav4.sav
inputdata.exe的源代码:
47
FLAC3D学习(SIMWE论坛君之枫整理) '工程文件路径
Public strInputPath As String Public strOutputPath As String Private Sub Form_Load() '隐藏窗口 Me.Hide '定义极限荷载 Dim Plim As Single '定义杆件失稳标记
'如果杆件失稳则输出1,如果没有失稳则输出0 Dim nFlag As Integer
Plim = 10.44 * 100000# '根据0.85的折减系数而得 '定义单元编号 Dim nEleID As Integer '定义节点编号
Dim nNodeID As Integer '定义杆件节点的轴力的分量 Dim F(1 To 3) As Single '定义字符串变量 Dim str As String '定义读入数据前忽略的行数 Dim nLine As Integer nLine = 21
'定义欲读入单元的个数 Dim nElement As Integer nElement = 10 '定义每个单元的节点数 Dim nNode As Integer nNode = 2
'定义可供Open语句使用的文件号 Dim nInputFile As Integer Dim nOutputFile As Integer
'FreeFile函数返回一个Integer,代表下一个可供Open语句使用的文件号 nInputFile = FreeFile nOutputFile = nInputFile + 1 '打开文本文件
strInputPath = \strOutputPath = \
48
FLAC3D学习(SIMWE论坛君之枫整理) 你可以参考一下。
def get_gp_maxdisp
gp0_disp = gp_xdisp(gp_head)*gp_xdisp(gp_head)
gp0_disp = gp0_disp + gp_ydisp(gp_head)*gp_ydisp(gp_head) gp0_disp = gp0_disp + gp_zdisp(gp_head)*gp_zdisp(gp_head) gp0_disp = sqrt(gp0_disp) p_gp=gp_head ;找最大值
loop while p_gp # null
gp_disp = gp_xdisp(p_gp)*gp_xdisp(p_gp)
gp_disp = gp_disp + gp_ydisp(p_gp)*gp_ydisp(p_gp) gp_disp = gp_disp + gp_zdisp(p_gp)*gp_zdisp(p_gp) gp_disp = sqrt(gp_disp) if gp_disp>gp0_disp gp0_disp=gp_disp endif
p_gp = gp_next(p_gp) endloop ;找最大值的坐标 p_gp=gp_head ss=0
loop while p_gp # null
gp_disp = gp_xdisp(p_gp)*gp_xdisp(p_gp)
gp_disp = gp_disp + gp_ydisp(p_gp)*gp_ydisp(p_gp) gp_disp = gp_disp + gp_zdisp(p_gp)*gp_zdisp(p_gp) gp_disp = sqrt(gp_disp) if gp_disp=gp0_disp ss=ss+1
xtable(1,ss)=gp_xpos(p_gp) ytable(1,ss)=gp_ypos(p_gp) endif
p_gp = gp_next(p_gp) endloop end
get_gp_maxdisp
33. 如何显示计算后模型的变形状态?
50