fish语言集锦Word文件下载.docx
《fish语言集锦Word文件下载.docx》由会员分享,可在线阅读,更多相关《fish语言集锦Word文件下载.docx(21页珍藏版)》请在冰豆网上搜索。
p2add0100'
macroPt3'
p3add0010'
macroModel_Size'
size456'
macroBig_Brick'
genzonebrickPt0Pt1Pt2Pt3Model_Size'
Big_Brick
macro'
Pt0'
'
p0151515'
genBig_Brick;
thiswillcauseanerror
grouprangemacro命令
Usingdifferentobjecttypestodothesamejob
usingaRANGEobject...
rangenameBig_Brickx=(-3,3)y=(-2,2)z=(-1,1)
modelnullrangeBig_Brick
usingaGROUPobject...
groupBig_Brickrangex=(-3,3)y=(-2,2)z=(-1,1)
modelnullrangegroupBig_Brick
usingamacroobject...
x=(-3,3)y=(-2,2)z=(-1,1)'
genzonebricksize10,10,10
macroSiltySand'
bulk1.5e8shear0.3e8'
macroClayeyGravel'
bulk1.5e8shear0.6e8fric30coh5e6ten8.66e6'
modelelasrangez510
propSiltySandrangez510
modelmohrrangez05
propClayeyGravelrangez05
视图操作:
xyzm
ctr+r还原
ctr+p保存图片
ctr+z鼠标选择
ctr+g彩图变为灰色图
shift+(xyzm)旋转缩放
edit---copytoclipboard----粘贴到word
inixdis0ydis0zdis0
setgrav00-9.81
setmechforce=50'
最大不平衡力小于50n,停止计算
hist命令
histreset'
清除已有历史信息
sethist_rep1'
每一个时步记录一次
histn=5'
每5个时步记录一次
histwrite13vs2begin150end375filexx.txt
histgpzdisp4,4,8
histid=3gpzdis113'
id为监测变量的编号,默认的是从1开始编号。
建议对监测变量进行编号,以便后处理调用
plothis23vs4'
plotshistories2and3versushistory4;
history4plotsalongtheabscissa.
plhisxla'
string'
ylab'
设置xy轴的名称
plhisxmaximum?
?
xminimum?
设置x轴的最大最小刻度
plhisymaximum?
yminimum?
设置y轴的最大最小刻度
plhisboth'
line+mark
log命令
setlogfilexx.log
setlogon
print……
……
setlogoff
切片
plsetplaneori01.50norm010'
定义剖面位置
plconzdplane'
显示变量
pladdske
pladddisplane
pladdaxe
plconsxxoutlineon;
查看水平应力云图,outlineon表示显示模型的边界,默认为off
****************************************
printgpdisrangeid517anyid533any'
输出2个节点的变形值any表示‘并集’
指定边界条件
fixxrangex-0.10.1anyx5.96.1any'
这个表示在x=0和x=6.0方向上固定x方向的位移。
any的意思是表示"
且"
的意思,也就是说本来要写两行语句的:
fixxrangex-0.10.1,fixxrangex5.96.1,现在用any就可以只写一条语句。
fixyrangey-0.10.1anyy5.96.1any
;
fish主要语句
if…………then
…………
else
endif
command
endcommand
loopn(1,21)
endloop
loopwhile…………
caseof…………
casen1
casen2
endcase
运算
=#>
<
>
=<
=
负数在运算时,要加(),以免和减号-混淆
degrad'
π/180
pi'
π
ngp'
节点总数
nzone'
单元体总数
单元/节点遍历
p_z=zone_head
loopwhilep_z#null
p_z=z_next(p_z)
p_gp=gp_head
loopwhilep_gp#null
p_gp=gp_next(p_gp)
string连接(保存文件)
save_file=string(n)+'
_step.sav'
D3DECFile='
D3dec_Model.dat'
FlacFile='
Flac3D_Model.dat'
file_name='
7-6_add'
+string(n)+'
.sav'
savefile_name
calflacfile
table操作详见ftd128(59/114))
table1nameload_settlement'
创建新表格
xtable(n,s)=……对编号为n的表的第s行、x列进行赋值
ytable(n,s)=……对编号为n的表的第s行、y列进行赋值
plottable1line
plottable1both'
点、线同时显示
常用编辑文本文件的方法进行表的读入与调用
第1行:
表的名称
第2行:
x1y1
第3行:
x2y2
空行'
注:
在表的文本文件最后,需要有一个回车换行符,否则会出现"
errorreadingfilexxx.dat"
的错误,
完成的文件需要读入操作才可以供flac3d调用。
采用tableread命令进行读入:
table1readxxx.dat
读入后,可以使用plottable和printtable命令查看生成的表文件
applyxvel1.0histtable1rangex5.9,6.1y0,6z0,2'
1.0表示表格中的y向数据的因子
TABLEn<
keyword>
x1y1<
x2y2>
x3y3>
...
eraseerasesallentriesintablen.
insert
name'
changesthenameoftablenumbernto'
.ThetableIDnumberisnotchanged.
readfilename'
readsfile,filename(intheformatdescribedbelow),andplacesitintablen.
将FLAC中节点以及节点对应的坐标全部输出到txt文件中?
以及将每个节点的应力输出
printgppos
openclose用法
close当前文件关闭,返回值为0表示成功关闭
open(filename,wr,mode)'
先打开文件,然后可以读,可以往里写内容
===filename可以是带双引号的字符串,也可以是变量名。
===wr必须是个整数:
0-只读打开,文件要求存在;
1-文件为写入打开,已经存在的文件将被覆盖(overwritten)。
2-文件为写入打开,存在的文件被改写(appendedto)
===mode必须为一个整数值,0-读写fish变量,只有整型,浮点型和字符串的数据类型被传输,不传递变量名。
1-读写ASCII数据。
可读入一行数据,行之间用CR/LF分开。
每行最大80字符。
===2-设定为binary读模式,任何文件都以binary的读取模式打开.
===返回值:
0表示文件打开成功;
1-表示文件名不是字符串;
2-文件名是一个空字符串;
3-wr或mode不是整型;
4-mode参数错误(不是0或1);
5-wr参数错误(不是0或1);
6-不能打开所要读取的文件,比如文件不存在;
7-文件已经打开;
8-不是fish模式的文件
read(ar,n)---放入数组。
读取n个记录放入数组ar,每个记录要求是一行ASCII数据,或者是一个FISH变量。
数组至少有n个元素大小。
====返回值0表示无误;
-1:
表示读取错误,比如到了文件的末尾;
n-表示读入n行后,恰好到了文件的末尾。
read(ar,n)将n个记录写到数组ar,详细:
read(ar,n)readsnrecordsintothearrayar.Thearrayarmustbeanarrayofatleastnelements.Thereturnedvalueis:
0requestednumberoflineswereinputwithouterror
-1erroronread(exceptend-of-file)
npositivevalueindicatesthatend-of-filewasencounteredafter
readingnlines
write(ar,n)将数组ar的前n个记录写到文件,详细:
write(ar,n)writesnrecordsfromthefirstnelementsofthearrayar.Thearrayarmustbeanarrayofatleastnelements.Thereturnedvalueis:
0requestednumberoflineswereoutputwithouterror
-1erroronwrite
npositivevalue(inASCIImode)indicatesthatthenthelementwasnotastring
parse(s,i)Thisfunctionscansthestringsanddecodestheithitem
pre_parse(s,i)Thisfunctionscansthestringsandreturnsanintegervalueaccordingtothetypeoftheithitem,asfollows.
0missingitem
1integer
2float
3stringmissing(unabletointerpretasintorfloat)
type(e)数据类型函数,1=整型,2=浮点,3=字符串,4=指针,5=数组
Interface的变量命令参见ftd128.pdf(53/114)
interface1facerange^^^^^^^^^^^^^^^^^^^^^^^^^^
Interface变量
Interfacesmaybeidentifiedwiththefollowingfunctions.
i_find(id)————addressoftheinterfacewithIDid;
returnsnullifnotfound(pointer)
i_id(p_i)————IDoftheinterfaceataddressp_i(integer)
Theinterfacesmayalsobescannedstartingati_headandsteppingthroughthelistusingi_next.
i_head————addressofthefirstinterfaceinthelistofinterfaces(pointer)
i_next(p_i)————addressofthepointertothenextinterfaceinthelist(pointer)
wrap
Forexample,thefollowingcommandwouldfindthetwinnedfacesbetweengroup"
rock"
andgroup"
soil,"
andputinterfaceelementsonthese"
faces.Onlyfaceswithcentroidwithintherangex50.075.0wouldbeconsidered.
interface1wraprocksoilrangex50.075.0
StructuralElements的变量命令参见ftd128.pdf(64/114)
nd_pos(np,p,dof)positionp(p∈{1,2}denotescurrentorreferenceposition,respectively;
dof-component,dof∈{1,2,3}).Thereferencepositionistheconfigurationforwhichstiffnessmatriceshavebeenformedanddoesnotchangeduringasmall-strainanalysis.Thecurrentpositionisupdatedaftereachtimestep.Duringalarge-strainanalysis,thereferencepositionissetequaltothecurrentpositionduringeachlarge-strainupdate.
例子:
xt0=nd_pos(_nd,2,1)
yt0=nd_pos(_nd,2,2)
zt0=nd_pos(_nd,2,3)
nd_id(np)IDnumberofnodenp.EachnodehasauniqueIDnumber.
详细的gpzone命令参见ftd128.pdf(40/114)
p_gp=gp_near(x,y,z)'
addressofgridpointclosestto(x,y,z)
p_z=z_near(x,y,z)'
addressofzoneclosestto(x,y,z)
gp_head
zone_head
gp_next(p_gp)
z_next(p_z)
p_gp=find_gp(id)'
addressofgridpointswithIDnumberid
p_z=find_zone(id)'
addressofzonewithIDnumberid
gp_group(p_gp,ind)?
gp_region(p_gp,ind)?
gp_zdisp(p_gp):
地址为p_gp的节点的z向变形
gp_xpos(p_gp)'
x-coordinateofgridpointpx=gp_xpos(p_zp)gp_xpos(p_zp)=k*px
gp_xvel(p_gp)'
x-velocityatgridpoint
gp_near(x,y,z)'
得到靠近坐标(x,y,z)的节点地址
gp_id(p_gp)'
节点ID号,是整数maxdisp=gp_id(p_gp)
printgpposranid59'
输出59号节点的坐标位置(2.0,2.0,3.0)
注意:
节点指针的循环是从ID号最小的地址开始的。
zone函数
z_sig3(p_z)'
最小主应力z_sig1(p_z)'
最大主应力
z_prop(p_z,'
young'
)'
)=2e6
z_group(p_z)'
zonegroupname是单元所在的组名变量(string)
z_id(p_z)'
zoneIDnumber(integer)
z_model(p_z)'
string类型
z_prop(p_z,string)'
可以赋值,可以取值
z_xcen(p_z)'
zone的质心的x坐标
z_sxx(p_z)'
zone的xx-stress
stid=2131
z_p=find_zone(stid)
xtable(3,m)=z_id(z_p)
ytable(3,m)=-z_szz(z_p)
definstall
pnt=zone_head
loopwhilepnt#null
z_depth=-z_zcen(pnt)
y_mod=y_zero+cc*sqrt(z_depth)
z_prop(pnt,'
shear'
)=y_mod/(2.0*(1.0+P_ratio))
bulk'
)=y_mod/(3.0*(1.0-2.0*P_ratio))
pnt=z_next(pnt)
end_l