FLAC代码查询

合集下载

flac编码原理

flac编码原理

FLAC编码原理解析1. 引言FLAC(Free Lossless Audio Codec)是一种无损音频编码格式,它可以将音频文件压缩到较小的尺寸,而不会损失音频质量。

本文将详细解释FLAC编码的基本原理,包括压缩算法、预测算法和编码过程。

2. 压缩算法FLAC使用了一种基于线性预测的压缩算法,该算法能够通过对音频信号进行预测来减少冗余信息。

具体而言,FLAC将音频信号分为多个小区块,对每个小区块进行独立的压缩。

2.1 线性预测在每个小区块中,FLAC使用线性预测来估计当前采样点的值。

线性预测通过对之前的采样点进行加权求和来预测当前采样点的值。

加权系数由FLAC编码器根据音频信号的特性进行选择。

2.2 残差编码线性预测只能对音频信号的低频成分进行较好的预测,对于高频成分则预测效果较差。

因此,FLAC使用残差编码来表示预测误差,即当前采样点的真实值与预测值之间的差异。

FLAC使用了一种叫做RICE编码的方法来对残差进行编码。

RICE编码将残差值分为两部分:符号部分和幅度部分。

符号部分表示残差值的正负,幅度部分表示残差值的大小。

在RICE编码中,幅度部分使用了变长编码,即较小的幅度值使用较短的编码表示,较大的幅度值使用较长的编码表示。

这样可以更好地压缩残差信息。

3. 预测算法FLAC使用了一种称为自适应混合预测(Adaptive Hybrid Prediction)的预测算法。

该算法根据音频信号的特性选择合适的预测器进行预测。

3.1 短期预测短期预测器使用之前的采样点来预测当前采样点的值。

FLAC使用了线性预测器和FIR(Finite Impulse Response)预测器来进行短期预测。

线性预测器通过对之前的采样点进行加权求和来预测当前采样点的值。

加权系数由FLAC编码器根据音频信号的特性进行选择。

FIR预测器使用了一个滤波器来对之前的采样点进行加权求和。

滤波器的系数由FLAC编码器根据音频信号的特性进行选择。

flac常用命令(FLACcommoncommands)

flac常用命令(FLACcommoncommands)

flac常用命令(FLAC common commands)FLAC3D common commands1. What are the first commands you need to master? Answer: commands such as gen, ini, app, PLO, solve, such as modeling, initial conditions, boundary conditions, postprocessing, and solving are required.2. How do I output the post-processing diagram of the model? Answer: File/Print, type/Jpg, file, and then select File/Print, save the format as JPE file.3. How do I call a file? Answer: File/call or call command 4, how to exert surface force? Answer: app nstress 5, how to adjust the size and angle of view? Answer: use x, y, Z, m, Shift keys, and use Ctrl+R, Ctrl+Z and other shortcut keys together. 6, how to carry out boundary constraints? Answer: fix x ran (the constraint is speed, in the initial case, the constraint is equivalent to the displacement constraint). 7, how do you know the ID of each unit? Answer: double-click the surface of the cell with the mouse to know the ID and coordinates of the unit. 8, how to slice? Answer: PLO, set, plane, ori (point coordinates), norm (normal vector), PLO, con, SZ, plane (showing the slice of the stress in the direction of the z) 9, how to save the result of calculation? Answer: save + file name 10, how to call saved results? Answer: rest + file name; or File / Restor 11, how to pause the calculation? Answer: Esc 12, how to pause in the program, and can restore the calculation? Answer: add the pause command to the command and proceed with continue. In our step by step solution, we want to get the result of a certain process, not wait until all the requests are finished, and then we can correct the error when the distribution is wrong, not wait for the result to come out. 13, how do you skip a calculation step? Answer: in the calculation, press the space bar to skip thiscalculation, automatically go to the next 14, Fish what is it? Does Fish have to learn? Answer: it's the built-in language of FLAC3D that can be used to parameterize models and perform commands that cannot be performed by themselves. Fish doesn't have to learn. When you need it, check Mannual and get the variables you need. What is the command file format allowed by 15 and FLAC3D? Answer: does not matter, as long as it is a text file, what suffix can be. 16. How do I call some optional modules? Answer: config dyn (fluid, creep, cppudm) 17, how to impose constraints around the cylinder? You can use fix, ran, cylinder, end1, end2, radius, R1, cylinder, end1, end2, radius, R2, not, R219, about DD, dip dip-direction angle, measured in: the global xy-plane clockwise from the positive y-axis from y to X is the shaft clockwise turn angle; dip dip angle, measured in the negative Z-direction from the global xy-plane this is the angle between the XY plane and Z axis; dip the angle between the reference plane and the XY plane symmetry, symmetry plane and XY angle reference plane is a ray projection in the XY plane; DD refers to the positive direction of axis Y clockwise direction steering angle (clockwise) projection to the normal direction is determined in the XY plane, and then determine the dip. Refers to dip XY from the plane to the plane defined by the angle. 20, range command: 1 spherical range, is a center, part of the different radius between the force applied to the sphere, with the constraint, command, command: range annulus center XYZ radius R1 R2 (Center) (two radius), want to express is spherical, r1r2 value difference can be small, such as the radius 2.9 3.1 when the range is a radius of 3 plane. The order of force is applied to the torus of a cylinder, exerting forceor restraint.范围缸end1 XYZ end2 XYZ半径R(端是表示柱体断面的中心点坐标)范围平面以上表示的是Z大于0的上部结构范围面吹表示的是Z小于0的下部结构范围DD DIP B XYZ表示的是走向角度起源,倾向角度B 的面DD表示,当面与xoy面相交时的垂线与Y轴正向的夹角,顺为正,说白话,就是面的指向方向面是朝那个方向的意思。

FLAC学习常用命令指南

FLAC学习常用命令指南

常用命令指南1 命令指南这一节包括FLAC使用的所有命令的详细信息。

命令被描述为两个主要部分:首先,在节1.2中,这里有命令的概要汇总,它是以相关的模型函数来组织的。

准备一个输入DAT文件时建议先看一看这个命令汇总。

其次,在节1.3中,按字母顺序对所有的命令进行详细的描述。

节1.1中描述了一些共同的输入惯例和约定。

在Command and FISH Reference Summary 书中节1中同样提供了按字母顺序排例的命令汇总。

1.1 共同的惯例和约定1.1.1 语法FLAC可以用“交互”的方式进行操作(例如,通过键盘输入命令)或“文件控制”方式(例如,数据保存和读取在一个数据文件中,而这个文件保存在磁盘或硬盘中)。

无论哪种方式,解决一个问题的命令是相同的,数据输入的具体方法要看用户的偏爱。

所有的命令都是单词导向的,它包含一个主命令词,根据需要后面跟着一个或多个关键词和数值。

有些命令(例如PLOT)接受一个“开关”,它后面的关键字可以修改命令的动作。

每一个命令都有如下的格式:COM MAND key word value ... <key word value ... >命令关键词值… <关键词值…>所有的命令在输入行中逐字被输入。

你可以注意到只有少数几个字母是黑体,这表示要这个程序认识这个命令,最少要输入黑体字母。

同样地,小写字母显示的关键词也是逐字输入,只须要输入关键词的黑体字母长度即可。

如果用户需要,可以将命令和关键词写完整。

缺省情况下,单词是对大小写不敏感的--你可以使用大写字母,也可以使用小写字母。

许多关键词后有一系列的数字(值),这是关键词所要求的。

以黑体斜体表示的单词代表数值。

当单词以i,j,m或n开始时,后面应接整型数;否则,后面应接浮点型数(或小数)。

有时浮点型数中的小数点可以被省略,但是小数点不能出现在整型数中。

命令、关键词和数值可以通过任何多个空格分开或者通过下列的分界符分开:() , =你将可以看到在一些输入参数后有一些附加的符号。

flac解码代码

flac解码代码

flac解码代码解码FLAC(Free Lossless Audio Codec)文件通常涉及使用专门的库或工具,因为FLAC是一种特定的音频编码格式。

在这里,我将提供一个使用Python的例子,使用`pydub`库和`flac`库来解码FLAC文件。

首先,确保你已经安装了`pydub`和`flac`库。

你可以使用以下命令来安装它们:```bashpip install pydubpip install pydub[extras]```然后,你可以使用以下代码来解码FLAC文件:```pythonfrom pydub import AudioSegmentfrom pydub.playback import playdef decode_flac(input_file, output_file):# 使用pydub打开FLAC文件audio = AudioSegment.from_file(input_file, format="flac")# 将解码后的音频保存为WAV文件audio.export(output_file, format="wav")print("FLAC文件解码完成")# 示例用法input_flac_file = "input_file.flac"output_wav_file = "output_file.wav"decode_flac(input_flac_file, output_wav_file)# 播放解码后的音频文件play(AudioSegment.from_file(output_wav_file, format="wav"))```请确保替换`input_file.flac`和`output_file.wav`为你实际的输入和输出文件路径。

flac命令及FISH小程序

flac命令及FISH小程序

1head1=nullp_z=zone_headloop while p_z#nullif ...new1=get_mem(2)mem(new1)=head1mem(new1+1)=p_zhead1=new1endifp_z=z_next(p_z)endloopend2这是fish中最常用的循环,即通过在内存中建立一链表,链表第一元素存储地址,第2个(或者更多)存储目标内容。

new = get mem(2),即为在内存中建立一个两个元素的链表mem(new) = headmem(new+1) = p_gp为给这两个元素赋予内容3如果有whilestepping,此fish程序每时步执行一次,如果没有,fish程序只在读取到该程序时运行。

这里牵扯到链式结构和。

我根据我的理解解析一下。

def zs_topad = top_head;ad和top_head都是指针变量,此句将top_head的值;附给ad,以后ad代替top_head,指向get_mem创建的矩阵的第一个元素。

zftot = 0.0;顶点全部的力。

loop while ad # null;gp_pnt = mem(ad+1);读取get_mem创建的矩阵第二个元素zf = gp_zfunbal(gp_pnt);取出单元不平衡力zftot = zftot + zf;不平衡力叠加ad = mem(ad);指针变量ad指向链表的下一个adendloopzs_top = zftot / 0.1414;力除以顶点处面积得顶点应力。

endballnew; p3 p4 是体对角线上的点,且一致。

def parmrad=10.0 ; radius of sphere.rad_size=5 ; radial zones.endparmgen zone pyramid p0 rad 0 0 p1 rad 0 rad p2 rad rad 0 p3 0 0 0 &p4 rad rad rad size rad_size rad_size rad_size group 1gen zone pyramid p0 0 rad 0 p1 rad rad 0 p2 0 rad rad p3 0 0 0 p4 rad rad rad & size rad_size rad_size rad_size group 2gen zone pyramid p0 0 0 rad p1 0 rad rad p2 rad 0 rad p3 0 0 0 p4 rad rad rad & size rad_size rad_size rad_size group 3def make_sphere; Loop over all GPs and remap their coordinates:p_gp=gp_headloop while p_gp#null; Get gp coordinate: P=(px,py,pz)px=gp_xpos(p_gp)py=gp_ypos(p_gp)pz=gp_zpos(p_gp)dist=sqrt(px*px+py*py+pz*pz)if dist>0 thenmaxp=max(px,max(py,pz))k=(maxp/rad)*(rad/dist)gp_xpos(p_gp)=k*pxgp_ypos(p_gp)=k*pygp_zpos(p_gp)=k*pzend_ifp_gp=gp_next(p_gp)end_loopendmake_spheregen zone ref ;z=0 planegen zone ref dip 90 ;y=0 planegen zone ref dip 90 dd 90 ;x=0 planeplot surfpl set back whpl bl grdataoflineforflac3d;; by tg0215@simwe 11/22/2006;; Function:Export gridpoint datas(disp,xdisp,ydisp,zdisp) and zone datas(sig1,sig2,sig3,sxx,syy,szz);; along a line defined by two point's coordinates.;; The exporting form is ten chart.The x-axes of the chart is the distance to the first point and;; the y-axes of the chart is gp data or zone data.;; Used for FLAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Line Define by two points in spacedef Line_Definex1=in('Please input the x-coordinate of the first point:')y1=in('Please input the y-coordinate of the first point:')z1=in('please input the z-coordinate of the first point:')x2=in('Please input the x-coordinate of the second point:')y2=in('Please input the y-coordinate of the second point:')z2=in('Please input the z-coordinate of the second point:')numP=in('Please input the number of point on the line:')endLine_Define;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Initializationdef ini_Paraarray xx(numP)array yy(numP)array zz(numP)endini_Para;;;;;;;;;;;;;;; Calculate the coordinate of points on the linedef Line_CalculateLL=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)loop n(1,numP)if n=1 thenxx(n)=x1yy(n)=y1zz(n)=z1elseif n=nump thenxx(n)=x2yy(n)=y2zz(n)=z2elseif x2=x1 thenxx(n)=x1elsexx(n)=x1+LL*(n-1)/((numP-1)*sqrt(1+((y2-y1)/(x2-x1))^2+((z2-z1)/(x2-x1))^2)) endifif y2=y1 thenyy(n)=y1elseyy(n)=y1+LL*(n-1)/((numP-1)*sqrt(1+((x2-x1)/(y2-y1))^2+((z2-z1)/(y2-y1))^2)) endifif z2=z1 thenzz(n)=z1elsezz(n)=z1+LL*(n-1)/((numP-1)*sqrt(1+((y2-y1)/(z2-z1))^2+((x2-x1)/(z2-z1))^2)) endifendifendifendloopendLine_Calculate;; Calculate displacement magnitudedef get_gp_dispgp_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)end;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Write gp-related data to table,suck as disp,xdisp,ydisp,zdispdef write_gp_infoloop n(1,numP)p_gp=gp_near(xx(n),yy(n),zz(n))if p_gp # null thencaseof info_flagcase 1 ;dispxtable(1,n)=LL*(n-1)/float(nump-1)get_gp_dispytable(1,n)=gp_disp;aa=(xtable(1,n));bb=(ytable(1,n))case 2xtable(2,n)=LL*(n-1)/float(nump-1)ytable(2,n)=gp_xdisp(p_gp)case 3xtable(3,n)=LL*(n-1)/float(nump-1)ytable(3,n)=gp_ydisp(p_gp)case 4xtable(4,n)=LL*(n-1)/float(nump-1)ytable(4,n)=gp_zdisp(p_gp)endcaseendifcommand;print LL,n;print aa,bb;pauseendcommandendloopend;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Write zone-related data to table,such as sxx,syy,szz,sig1,sig2,sig3 def write_zone_infoloop n(1,numP)p_z=z_near(xx(n),yy(n),zz(n))if p_z # null thencaseof info_flagcase 5xtable(5,n)=LL*(n-1)/float(nump-1)ytable(5,n)=z_sig1(p_z)case 6xtable(6,n)=LL*(n-1)/float(nump-1)ytable(6,n)=z_sig2(p_z)case 7xtable(7,n)=LL*(n-1)/float(nump-1) ytable(7,n)=z_sig3(p_z)case 8xtable(8,n)=LL*(n-1)/float(nump-1) ytable(8,n)=z_sxx(p_z)case 9xtable(9,n)=LL*(n-1)/float(nump-1) ytable(9,n)=z_syy(p_z)case 10xtable(10,n)= LL*(n-1)/float(nump-1) ytable(10,n)=z_szz(p_z)endcaseendifendloopend;;;;;;;;;;;;;;;;;;;;;;;;;;;; Main function:draw curve chartdef draw_curveinfo_flag=1write_gp_infoinfo_flag=2write_gp_infoinfo_flag=3write_gp_infoinfo_flag=4write_gp_infoinfo_flag=5write_zone_infoinfo_flag=6write_zone_infoinfo_flag=7write_zone_infoinfo_flag=8write_zone_infoinfo_flag=9write_zone_infoinfo_flag=10write_zone_infocommandtable 1 name 'disp'table 2 name 'xdisp'table 3 name 'ydisp'table 4 name 'zdisp'table 5 name 'sig1'table 6 name 'sig2'table 7 name 'sig3'table 8 name 'sxx'table 9 name 'syy'table 10 name 'szz'set plot jpgpl create v-disppl set back whitepl set title text'Displacement along the line'pl add table 1 mark line xlabel 'distance along the line' ylabel 'displacement' set out v-disp.jpgpl hardcopy v-disppl create v-xdisppl set back whitepl set title text'X-Displacement along the line'pl add table 2 mark line xlabel 'distance along the line' ylabel 'x-displacement' set out v-xdisp.jpgpl hardcopy v-xdisppl create v-ydisppl set back whitepl set title text'Y-Displacement along the line'pl add table 3 mark line xlabel 'distance along the line' ylabel 'y-displacement' set out v-ydisp.jpgpl hardcopy v-ydisppl create v-zdisppl set back whitepl set title text'Z-Displacement along the line'pl add table 4 mark line xlabel 'distance along the line' ylabel 'z-displacement' set out v-zdisp.jpgpl hardcopy v-zdisppl create v-sig1pl set back whitepl set title text'Sig1 along the line'pl add table 5 mark line xlabel 'distance along the line' ylabel 'Sig1' set out v-sig1.jpgpl hardcopy v-sig1pl create v-sig2pl set back whitepl set title text'Sig2 along the line'pl add table 6 mark line xlabel 'distance along the line' ylabel 'Sig2' set out v-sig2.jpgpl hardcopy v-sig2pl create v-sig3pl set back whitepl set title text'Sig3 along the line'pl add table 7 mark line xlabel 'distance along the line' ylabel 'Sig3' set out v-sig3.jpgpl hardcopy v-sig3pl create v-sxxpl set back whitepl set title text'Sxx along the line'pl add table 8 mark line xlabel 'distance along the line' ylabel 'Sxx' set out v-sxx.jpgpl hardcopy v-sxxpl create v-syypl set back whitepl set title text'Syy along the line'pl add table 9 mark line xlabel 'distance along the line' ylabel 'Syy' set out v-syy.jpgpl hardcopy v-syypl create v-szzpl set back whitepl set title text'Szz along the line'pl add table 10 mark line xlabel 'distance along the line' ylabel 'Szz' set out v-szz.jpgpl hardcopy v-szzendcommandenddraw_curveenunew;set mech ratio 1e-6def _geoparmk=1.130 ;安全系数size1=40size2=10filecal0=string(size1)+'_'+string(size2)+'_cal'+'.sav'fosfile0=string(size1)+'_'+string(size2)+'_fos'+'.sav'bf=45 ; 改变此处坡角af=bf*pi/180 ;h1=20;x00=30.0x01=105.0x02=x00x03=x00+h1/tan(af)x04=x01x05=x03x06=105.0x07=x06;y00=0.0y01=y00y02=1.0y03=y00y04=y02y05=y02y06=y00y07=y02;z00=20.0z01=z00z02=z00z03=40.0z04=z00z05=z03z06=z03z07=z03end_geoparmgen zone brick p0 0 0 0 p1 30 0 0 p2 0 1 0 p3 0 0 20 size 12 1 8gen zone brick p0 30 0 0 p1 105 0 0 p2 30 1 0 p3 30 0 20 size size1 1 8gen zone brick p0 x00 y00 z00 p1 x01 y01 z01 p2 x02 y02 z02 p3 x03 y03 z03 &p4 x04 y04 z04 p5 x05 y05 z05 p6 x06 y06 z06 p7 x07 y07 z07 size size1 1 size2def modelMaterial; 弹性模量(Pa)flag=0E1=100e6; 泊松比poi1=0.35;; 粘结力(Pa)coh1=42e3/k;; 容重(N/m3)weight1=25e3; 膨胀角(度)dila1=0.0;; 内摩擦角(度)fri1=(atan((tan(20.0*pi/180))/k))*180/pibeta1=(sin(20.0*pi/180))/(1-2*poi1);afa1=E1*poi1poi1=0.5*(1-(sin(fri1*pi/180))/beta1)E1=afa1/poi1;抗拉强度ten1=0.01e6grav0=-9.80 ; 重力加速度(N/kg)dens1=-weight1/grav0K1=E1/(3*(1-2*poi1))G1=E1/(2*(1+poi1))endmodelMaterialmodel mohr ;采用莫尔库仑模型pro bulk K1 she G1 dens dens1 coh coh1 &friction fri1 dilation 0.fix x range x -0.1 0.1fix x range x 104.9 105.1fix yfix x y z range z -0.1 0.1set grav 0 0 grav0solvesave 1_130.savfish求出偶数和奇数def numberarray even(21),odd(21);even为偶数数组,odd为奇数数组m1=0m2=0loop n(0,41)a=n/2.0b=int(n/2)if a = b thenm2=m2+1even(m2)=nelsem1=m1+1odd(m1)=nendifendloopendnumberdef wriloop k(1,21)hh=out(even(k))endloopcommandpauseendcommandloop k(1,21)hh=out(odd(k))endloopendwrifish作图FISH作图有个方法仅供参考:因为应力都是与zone有关的,所以,可以编程求出该函数在每个zone中的值,然后用flac 重新运行出原网格,可以将你所关注的这个函数量作为flac中已经有的量(如szz)的初始条件来绘出,随便举了个例子set log onset logfile hua.loggen zone brick size 3 4 4;重新运行出的原网格mo elasprop bul=1e10 shear 6e9fix x range x -0.1 0.1fix x range x -2.9 3.1fix x y z range z -0.1 0.1fix y range y -0.1 0.1fix y range y 3.9 4.1;下面两个fish第一个读出原函数的zone值,第二个作为szz赋给zonedef fuzhiarray var(48)p_z=zone_headloop while p_z # nulln=z_id(p_z)var(n)=-10000*n;这var是已经读取的数组,这里随便给一个规律p_z=z_next(p_z)endloopendfuzhidef jialiloop m(1,48)azz=var(m)commandini szz azz range id m;赋值endcommandendloopendjialiini dens 2500set gra 0 0 -10plot contour szz outline onset log offget_plast(塑性区大小显示程序)def get_plastshearnow = 1tensionnow = 2shearpast = 4tensionpast = 8v_shear_now = 0v_tension_now = 0v_shear_past = 0v_tension_past = 0p_z = zone_headloop while p_z # nullif and(z_state(p_z,0),shearnow) = shearnow thenv_shear_now = v_shear_now + z_volume(p_z)endifif and(z_state(p_z,0),tensionnow) = tensionnow then v_tension_now = v_tension_now + z_volume(p_z)endifif and(z_state(p_z,0),shearpast) = shearpast thenv_shear_past = v_shear_past + z_volume(p_z)endifif and(z_state(p_z,0),tensionpast) = tensionpast then v_tension_past = v_tension_past + z_volume(p_z) endifp_z = z_next(p_z)endloopii = out('shear_now : ' + string(v_shear_now))ii = out('tension_now : ' + string(v_tension_now))ii = out('shear_past : ' + string(v_shear_past))ii = out('tension_past : ' + string(v_tension_past))endget_plastgroup遍列节点[1]gen zone brick size 6 8 8model mohrprop bulk = 1e8 shear = 0.3e8 fric = 35prop coh = 1e10 tens = 1e10set grav 0, 0, -9.81ini dens = 1000fix x range x -0.1 0.1fix x range x 5.9 6.1fix y range y -0.1 0.1fix y range y 7.9 8.1fix x y z range z -0.1 0.1group hua range x 2 4 y 3 5 z 3 5def loadgp_gp = gp_headload=0.0loop while p_gp#nullx=gp_xpos(p_gp)y=gp_ypos(p_gp)z=gp_zpos(p_gp)p_z=z_near(x,y,z)if z_group(p_z) = 'hua' thenload=load+gp_zfunbal(p_gp)endifp_gp = gp_next(p_gp)endlooploadg=loadendhist loadgplot his 1solveinrange遍列节点[1]gen zone brick size 6 8 8model mohrprop bulk = 1e8 shear = 0.3e8 fric = 35 prop coh = 1e10 tens = 1e10set grav 0, 0, -9.81ini dens = 1000fix x range x -0.1 0.1fix x range x 5.9 6.1fix y range y -0.1 0.1fix y range y 7.9 8.1fix x y z range z -0.1 0.1range name hua x 2 4 y 3 5 z 3 5def loadgp_gp = gp_headload=0.0loop while p_gp#nullif inrange('hua',p_gp)=1 thenload=load+gp_zfunbal(p_gp)endifp_gp = gp_next(p_gp)endlooploadg=loadendhist loadgplot his 1solvemov11; avi.dat; Create an AVI movie file (steptest.avi) using the step option. ; Snap a picture every 30 steps while solving.gen zone radcylinder size 25 1 25 25gen zone reflect normal -1 0 0gen zone reflect normal 0 0 -1gen merge 1e-5model mohrprop dens=1000 bu=1e8 sh=7e7 fric 25 coh 3.5e4 tens 1e10fix yfix x range x -24.9 -25.1fix x range x 24.9 25.1fix z range z -24.9 -25.1set grav 10ini szz -1e6 grad 0 0 1e6ini sxx -0.5e6 grad 0 0.5e6 0ini syy -0.5e6 grad 0 0.5e6 0plot create testviewplot current testviewplot add contour syy average outline onset movie avi step 1 file glj1.avimovie startsolve ratio 1e-2movie finishthn;================;导入网格数据以生成水面impgrid ww;为建立水面设置“虚拟界面”而分组为水上部分和水下部分group water_below range group 1 any group 2 anygroup water_above range group water_below notgen separate water_belowinterface 1 wrap water_below water_aboveset grav 0 -9.81 0water den 1000;==================================def CnumNum=0;p_i=i_headp_in=i_node_head(p_i)loop while p_in # nullNum=Num+1;p_in=in_next(p_in)endloopendCnum;++++++++++++++++++++++++++++++==def ini_vararray var(Num,3)i=0p_i=i_headp_in=i_node_head(p_i)loop while p_in # nulli=i+1var(i,1)=in_pos(p_in,1)var(i,2)=in_pos(p_in,2)var(i,3)=in_pos(p_in,3)p_in=in_next(p_in)endloopendini_var;删除单元组water_below和组water_above,为导入实际的材料分组做准备model null range group water_belowmodel null range group water_above;删除虚拟界面单元int 1 dele;===========================;建立实际材料分组部分;导入网格数据,重新分组impgrid wwgroup soil range group 2 any group 4 anygroup rock range group soil notattach face;生成水面def ini_ppminx=var(1,1)minz=var(1,3)maxx=var(1,1)maxz=var(1,3)loop t (2,Num)if var(t,1)<minxminx=var(t,1)endifif var(t,3)<minyminz=var(t,3)endifif var(t,1)>maxxmaxx=var(t,1)endifif var(t,3)>maxzmaxz=var(t,3)endifendlooppnt = gp_headloop while pnt # nullgpnum=gp_id(pnt)x=gp_xpos(pnt)y=gp_ypos(pnt)z=gp_zpos(pnt)dist_gp=x^2+z^2dist1=var(1,1)^2+var(1,3)^2if x<=maxx thenif x>=minx thenif z>=minz thenif z<maxz thenmak=0loop n (1,Num)disn=var(n,1)^2+var(n,3)^2if y<var(n,2) thenif disp_gp-disn<dist1 then mak=nendifendifendloopif mak>0 thenif y<var(mak,2) thengp_pp(pnt)=(var(mak,2)-y)*1.e4endifendifendifendifendifendifpnt = gp_next(pnt)end_loopendini_pp;建立真实的“界面”;gen separate rock;interface 2 sma 1.0 wrap rock soil;施加直边约束fix x y z rang y -0.1 0.1fix x z range x 0 600 z 0fix x z range x 0 z 0 700fix x z range x 0 370 z 700fix x z range x 600 z 0 220;施加斜边约束fix x z range plane normal 48 0 23 origin 600 0 220 fix x z range id 685fix x z range id 671fix x z range id 670fix x z range id 669fix x z range id 24fix x z range id 668fix x z range id 679fix x z range id 680fix x z range id 684fix x z range id 682fix x z range id 667fix x z range id 25fix x z range id 666fix x z range id 676fix x z range id 674fix x z range id 659fix x z range id 657fix x z range id 688fix x z range id 237 fix x z range id 235 fix x z range id 233 fix x z range id 3218 fix x z range id 3216 fix x z range id 3214 fix x z range id 3212 fix x z range id 3195 fix x z range id 3194 fix x z range id 3198 fix x z range id 3197 fix x z range id 3200 fix x z range id 3201 fix x z range id 3203 fix x z range id 3204 fix x z range id 3206 fix x z range id 3207 fix x z range id 3208 fix x z range id 2822 fix x z range id 2840 fix x z range id 2812 fix x z range id 2814 fix x z range id 2841 fix x z range id 80 fix x z range id 81 fix x z range id 82 fix x z range id 83 fix x z range id 84 fix x z range id 175 fix x z range id 178 fix x z range id 179 fix x z range id 2808 fix x z range id 2809 fix x z range id 2807 fix x z range id 2806 fix x z range id 2842 fix x z range id 2803 fix x z range id 2804 fix x z range id 2835 fix x z range id 2834 fix x z range id 2833 fix x z range id 2832 fix x z range id 2831fix x z range id 2827fix x z range id 2826fix x z range id 2844fix x z range id 2824fix x z range id 2823fix x z range id 2845fix x z range id 2846plot set cent 300 125.6 350 dist 2061 rotation 130 290 0 ang 22.5 mag 1.25 plo shosave th.savtxnewgen zone brick size 3 3 3 &p0 (0,0,0) p1 (3,0,0) p2 (0,3,0) p3 (0,0,1.5) &p4 (3,3,0) p5 (0,3,1.5) p6 (3,0,4.5) p7 (3,3,4.5)group Base; Create Top - 1 unit high for initial spacinggen zone brick size 3 3 3 &p0 (0,0,2.5) p1 (3,0,5.5) p2 (0,3,2.5) p3 (0,0,7) &p4 (3,3,5.5) p5 (0,3,7) p6 (3,0,7) p7 (3,3,7)group Top range group Base not;; Create interface elements on the top surface of the baseinterface 1 face range plane norm (-1,0,1) origin (1.5,1.5,3) dist 0.1ini z add -1.0 range group Topwater dens 1000set grav 0 0 -10def water_tablep_i=i_headp_ie=i_elem_head(p_i) ;界面1单元指针赋予p_ieloop while p_ie # null;返回界面单元的三个顶点的地址p_gp1=ie_vert(p_ie,1)p_gp2=ie_vert(p_ie,2)p_gp3=ie_vert(p_ie,3);以这三个界面单元顶点为水面的三个顶点,生成水面;========interface的节点和网格节点的地址是分别存放的x1=in_pos(p_gp1,1)y1=in_pos(p_gp1,2)z1=in_pos(p_gp1,3)x2=in_pos(p_gp2,1)y2=in_pos(p_gp2,2)z2=in_pos(p_gp2,3)x3=in_pos(p_gp3,1)y3=in_pos(p_gp3,2)z3=in_pos(p_gp3,3)commandwater table face x1,y1,z1 x2,y2,z2 x3,y3,z3 endcommandp_ie=ie_next(p_ie)endloopendmodel null range group Basemodel null range group Topgen zone brick size 3 3 3 &p0 (0,0,0) p1 (3,0,0) p2 (0,3,0) p3 (0,0,1.5) &p4 (3,3,0) p5 (0,3,1.5) p6 (3,0,4.5) p7 (3,3,4.5) group 1; Create Top - 1 unit high for initial spacinggen zone brick size 3 3 3 &p0 (0,0,2.5) p1 (3,0,5.5) p2 (0,3,2.5) p3 (0,0,7) &p4 (3,3,5.5) p5 (0,3,7) p6 (3,0,7) p7 (3,3,7)group 2 range group 1 not group Base not group Top not ini z add -1.0 range group 2water_tableint 1 delplo water安全度安全度问题1.计算之前 config zextra 12.根据计算结果,计算zone的点安全度f,赋给 zextra 1z_extra(p_z,1) = f3.绘图 pl con zextra 1p_z = zone_headloop while p_z # null计算安全度fz_extra(p_z,1) = fp_z = z_next(p_z)endloop测一下你的计算机的速度newdef raterate = (t1 - t0) / 6250.0enddef timet0 = clock / 100.0enddef time1t1 = clock / 100.0endgen zone brick size 5,5,5model elasprop bulk 1e8 shear 1e7fix y range y -0.1 0.1apply syy -1.0e6 range y 4.9,5.1time0step 50000time1print ratereturn查看各个时段不平衡力的具体数值查看各个时段不平衡力的具体数值采用his来记录你的计算,包括位移应力等命令his unbalhis gp(zone) zdis range (0 0 0) 或者id=?导出数据命令his write n vs m begin 时步 end 时步 file filename.his n表示你纪录的id m表示时步要导出不平衡力的具体数值his unbalstep 100000 or solvehis write 1 vs step begin 1 end 1000 file 123.his使用上述命令就可以查看各个时步下的不平衡力的具体数值得到主应力def getsigp_z=find_zone(3113)|s1=z_sig1(p_z)Ss2=z_sig2(p_z)s3=z_sig3(p_z)endgetsig地面曲面方程newgen zone brick p0 0,167.0072,0 p1 0,0,0 p2 242.6586,167.0072,0 p3 0,167.0072,32.0 size 56,81,11;;定义地面曲面方程DEF eqn537ARRAY c(45),cx(12),cy(12),v(70)c(1)=30.33465961749452c(2)=0.3768529280014758c(3)=-1.411874011262434c(4)=-0.4466983009380354c(5)=0.02498771591159658c(6)=-0.6225933592839830c(7)=-0.5572409253529970c(8)=0.2594590432443336c(9)=-0.2154254299775080c(10)=0.05611608056180144c(11)=-0.3573754488804990c(12)=0.02174566734976303c(13)=0.4051641051840550c(14)=0.1744265369646383c(15)=0.1147014441688443c(16)=-0.2088509864184064c(17)=0.1493365036211442c(18)=0.4311419368791974c(19)=0.008961362272148653c(20)=-0.07774920998867369c(21)=0.1811142002504400c(22)=-0.1519527001982752c(23)=0.07915472779033880c(24)=0.2559732910968667c(25)=0.1026065146630541c(26)=-0.2819625969135452c(27)=-0.09027129904676756c(28)=0.1130183438471391c(29)=-0.02169639756233838c(30)=0.1907291399047935c(31)=0.1297366637584324c(32)=0.08806739336824376c(33)=-0.2260336878126227c(34)=-0.2115733057775976c(35)=0.1148217058529207c(36)=-0.06508949301229160c(37)=-0.04511427839772801c(38)=0.1632228872577737c(39)=0.1931691979495782c(40)=0.08562312402296863c(41)=0.01872590692817278c(42)=-0.04198182565657024c(43)=0.04502760175694480c(44)=0.1160322072269608c(45)=-0.07952377661820480order%=44x=(x-(0.000000000000000))/(77.24063134751799) y=(y-(0.000000000000000))/(53.16004282387357) IF x<0.0 THENx=0.0END_IFIF x>3.14159265358979323846 THENx=3.14159265358979323846END_IFIF y<0.0 THENy=0.0END_IFIF y>3.14159265358979323846 THENy=3.14159265358979323846END_IFnc%=8cx(1)=1.0cy(1)=1.0LOOP j% (1,nc%)cx(j%+1)=COS(j%*x)cy(j%+1)=COS(j%*y)END_LOOPiv%=1LOOP j% (1,nc%+1)m%%=j%+1LOOP m% (1,j%)m%%=m%%-1v(iv%)=cx(m%%)*cy(j%-m%%+1)iv%=iv%+1END_LOOPEND_LOOPz=0.0LOOP j% (1,order%+1)z = z + c(j%)*v(j%)END_LOOPEND;;地面曲面方程定义完毕;;找出节点坐标后只要给出X,Y,然后调用eqn537就可以得到X,Y对应的Z;;定义第1层底面曲面方程DEF eqn566ARRAY c1(36),cx1(12),cy1(12),v1(70)c1(1)=28.62060766890477c1(2)=0.2866834946597056c1(3)=-0.8353575191107516c1(4)=-0.04915431878961194c1(5)=0.4039755560498526c1(6)=-0.3362136646742352c1(7)=-0.2665446036102640c1(8)=0.01228084747342192c1(9)=-0.2228703607987686c1(10)=-0.1056397207500379c1(11)=-0.01267143831082441c1(12)=-0.1996293677009942c1(13)=-0.06064874974162015c1(14)=-0.2080253561904090c1(15)=0.03108780356779321c1(16)=0.05965985858539676c1(17)=0.04285379002151423c1(18)=0.3260634131778066c1(19)=0.03617992023477324c1(20)=0.02800173263537663c1(21)=0.05300528967296362c1(22)=-0.07147038182113627c1(23)=0.09423171997760518c1(24)=-0.008003820958046695c1(25)=0.03654771159807278c1(26)=0.04195809554079616c1(27)=0.01776731215338432c1(28)=0.07995229437423655c1(29)=0.01184899721780239c1(30)=0.1914904626951018c1(31)=-0.03834379592630702c1(32)=-0.04935320463957614c1(33)=-0.04246583589991888c1(34)=-0.07508761240626857c1(35)=0.08511394861034457c1(36)=0.03158468483322942order%=35x=(x-(0.000000000000000))/(77.24063134751799)y=(y-(0.000000000000000))/(53.16004282387357)IF x<0.0 THENx=0.0END_IFIF x>3.14159265358979323846 THENx=3.14159265358979323846END_IFIF y<0.0 THENy=0.0END_IFIF y>3.14159265358979323846 THENy=3.14159265358979323846END_IFnc%=7cx1(1)=1.0cy1(1)=1.0LOOP j% (1,nc%)cx1(j%+1)=COS(j%*x)cy1(j%+1)=COS(j%*y)END_LOOPiv%=1LOOP j% (1,nc%+1)m%%=j%+1LOOP m% (1,j%)m%%=m%%-1v1(iv%)=cx1(m%%)*cy1(j%-m%%+1)iv%=iv%+1END_LOOPEND_LOOPz=0.0LOOP j% (1,order%+1)z = z + c1(j%)*v1(j%)END_LOOPEND;;地面曲面方程定义完毕;;找出节点坐标后只要给出X,Y,然后调用eqn536就可以得到X,Y对应的Z;;定义第2层底面曲面方程DEF eqn607ARRAY c2(45),px(12),py(12),v2(70) c2(1)=26.40374776302957c2(2)=-1.292234879166614c2(3)=-0.9987652673592940c2(4)=0.08847151489382983c2(5)=-6.524125629419486c2(6)=0.4002923561445450c2(7)=0.3031713620939287c2(8)=0.9293011989675050c2(9)=1.028374487465087c2(10)=0.7894526930446397c2(11)=-0.2710341955836033c2(12)=-1.833585849910791c2(13)=-0.6799558584481914c2(14)=1.202068992799922c2(15)=-0.6569131952237344c2(16)=1.079058946133437c2(17)=1.286040305186933c2(18)=0.3587835487607498c2(19)=-0.3055218324008147c2(20)=1.320108378629063c2(21)=1.360836777714370c2(22)=-1.086438562691549c2(23)=2.885522086015947c2(24)=-0.6574447894560952c2(25)=1.428461008364791c2(26)=0.8792263637632590c2(27)=0.3263370530986411c2(28)=-0.8544593089642435c2(29)=0.8177299018417186c2(30)=-0.8210160246224562c2(31)=0.2959394968085911c2(32)=-0.1081689772714739c2(33)=-1.546682781919654c2(34)=-0.8887755964444086c2(35)=-0.1826536331301314c2(36)=0.01080252224961026c2(37)=-0.2510335500991192c2(38)=1.172841958315430c2(39)=0.1775850816862299c2(40)=-2.437087642643127c2(42)=0.3321145625443073c2(43)=0.9669041422660922c2(44)=0.3462785144789184c2(45)=0.7677956032753429order%=44x=(x-(121.3293000000000))/(121.3293000000000)y=(y-(83.50360000000001))/(83.50360000000001)pcnt%=9px(1)=1.0py(1)=1.0px(2)=xpy(2)=yLOOP j% (3,pcnt%)ctr=-1.0+(j%-2)*(2.0/((pcnt%)-1.0))px(j%)=-1.0+2.0/(1.0+EXP(-(x-ctr)/0.12))py(j%)=-1.0+2.0/(1.0+EXP(-(y-ctr)/0.12))END_LOOPiv%=1LOOP j% (1,pcnt%)m%%=j%+1LOOP m% (1,j%)m%%=m%%-1v2(iv%)=px(m%%)*py(j%-m%%+1)iv%=iv%+1END_LOOPEND_LOOPz=0.0LOOP j% (1,order%+1)z = z + c2(j%)*v2(j%)END_LOOPEND;;地面曲面方程定义完毕;;找出节点坐标后只要给出X,Y,然后调用eqn607就可以得到X,Y对应的Z;;定义第3层底面曲面方程DEF eqn609ARRAY c3(66),px1(12),py1(12),v3(70)c3(1)=21.82428275547068c3(2)=2.221561754167763c3(3)=-1.581903359451976c3(4)=-2.316827507113655c3(5)=-2.703947398487063c3(6)=-1.246037280331843c3(8)=-2.339997159259053 c3(9)=-4.751446231799969 c3(10)=2.238112737137326 c3(11)=-2.307007727942070 c3(12)=2.704352656458496 c3(13)=6.218021412068429 c3(14)=6.082322362020687 c3(15)=-1.781025552909750 c3(16)=1.595374835381855 c3(17)=5.083409370236106 c3(18)=-12.05561353031727 c3(19)=-8.149539051933758 c3(20)=0.4629435785333617 c3(21)=3.854808615283558 c3(22)=-3.172213655564220 c3(23)=-7.493360842439101 c3(24)=18.03955724690294 c3(25)=15.92195138603906 c3(26)=5.276624705110507 c3(27)=4.834416374228492 c3(28)=-2.941631600267834 c3(29)=3.061011978625018 c3(30)=6.894707465545384 c3(31)=-19.55553399652331 c3(32)=-25.47011892985832 c3(33)=-8.508414420882716 c3(34)=-4.573107121770635 c3(35)=-2.159206741489122 c3(36)=3.630405781581091 c3(37)=-1.716300833677144 c3(38)=-1.710288020840512 c3(39)=13.39520120547237 c3(40)=26.62167851961098 c3(41)=9.133569050067894 c3(42)=2.465816025684572 c3(43)=5.760745683031747 c3(44)=3.387751985565470 c3(45)=-1.998506978790600 c3(46)=-0.1436671749659344 c3(47)=2.673753603392002 c3(48)=-3.414672834039968 c3(49)=-15.30717986499453 c3(50)=-5.830362201304671。

FLAC2D模拟代码解释

FLAC2D模拟代码解释

1 实例newtitle 新建命名grid 6,5 ;定义网格数目gen -15,-16 -15,20 60,20 60,-16 ;四角点坐标gen 0 0 0 10 100 10 100 0 i=1,201 j=1,11 ;把大的范围浓缩到小范围内prop bulk=1e9 s=5e8 d=2500 f=30 c=5e5;定义物质属性prop bulk=1e8 shear=.3e8 fric=35 ;体积模量、剪切模量、内摩擦角prop dens=1000 coh=1e10 ten=1e10 ;密度、粘聚力、抗拉强度interface 1 aside from 1,10 to 20,10 bside from 1,11 to 20,11 ;定义节理,将节理放大,随后跟节理的属性m n j=11 ;interfaces,把j=11断开gen line 50.0 21.5 53.5 21.5 ;画线m ss j 33 35prop bulk=10e9 s=4.6e9 d=1400 f=30 c=5e5 i=12,20 j=33,35 ;赋予这个范围属性prop ftab 1 ctab 2 j 33 35tab 1 0 27 0.01 25 1.0 23tab 2 0 5e5 0.01 3e5 1.0 2e5 ;从m ss开始是一组固定语言,应变软化模型先不学m n region i=10 20 j=10 20 ;开挖m n region 102 34 ;开挖,跟前面的gen line 组合使用,开挖一个块就会挖整个m n region 102 30 ;不定义gen line 会开挖一层ini syy=-13e8 ;初始设置,y方向为压应力fix y=1 ;固定y=1这条边界,不变形set g=9.81 ;定义重力加速度set aspect a ;调整屏幕的高宽比,使输出不变形set large ;大变形,坐标更新set small ;小变形,坐标不更新set log on off ;在当前盘上打开flac.log的文件,记录FLAC的运行进程set timeset step ;设置时间与步数的限制app syy=-12.23e6 j=129 ;使y=129边界(即上边界)受向下的力hist nstep=10 ;每十步记录一次HIS UNBAL ;设置不平衡力HIS syy i=100 j=68 ;记录此点的三向应力变化,默认编号为1HIS sxx i=100 j=68 ;HIS szz i=100 j=68 ;str ;支护,后跟属性或支护材料step ;计算步数solve ;计算solve step ;时步数目,缺省500时步solve time ;运行分钟数,缺省5分钟solve force ;不平衡力,缺省100pause ;暂停continue ;继续save ;保存m m ;model mohr 摩尔模型seg ;分节点node 1 to node ;托盘的节点,分两段就有三个节点pl bou stru beam node red ;即可查看托盘节点号plot grid number ;标注坐标在格子中间plot grid gnum ;标注在点上,查看时用的,简化为pl g num 或gnuplot grid num ;可以查看节点号。

FLAC命令流

FLAC命令流

【常规显示】PLOT con syy ;表示Y方向应力云图PLOT con sxy ;表示XY方向的应力云图PLOT con szz ou on ;ou是outline的缩写,用来显示网格PLOT con szz ef on ;ef是effective的缩写,用来显示z方向有效应力的云图PLOT con szz inter 1e4 ; inter是interval的缩写,以改变云图显示中的增量大小,本例中默认为5.0E3PLOT con szz max -10e3 ;max表示显示的应力数值最大不超过-10e3,本例中默认为0 PLOT con szz min -40e3 ;min表示显示的应力数值最小值为-40e3,本例中默认为-60e3 PLOT bcon prop bu ;显示体积模量bulk的赋值块云图【面荷载作用下的变形】rest 6-1.savini xd 0 yd 0 zd 0 xv 0 yv 0 zv 0 初始应变归零app nstress -100e3 ran z 2.9 3.1 x 1 2 y 1 2 施加面荷载solvesave 6-2.savPLOT con zd 分析面荷载作用下的沉降云图PLOT con zd ou on magf 20 变形后的网格图(20为放大倍数)PLOT con szz ou on magf 20 将变形后的网格与应力云图结合起来plot block state 显示塑性区域plot block state shear ;获得剪切屈服的单元,包括shear-n和shear-pplot block state tension-p ;获得过去拉伸屈服的单元plot block state now ;获得当前处于塑性状态的单元,包括shear-n和tension-nplot block state past ;获得过去处于塑性状态的单元,包括shear-p和tension-p【历史跟踪】rest 6-1.savini xd 0 yd 0 zd 0 xv 0 yv 0 zv 0app nstress -100e3 ran z 2.9 3.1 x 1 2 y 1 2hist id=2 gp zdis 1 1 3 记录此节点的Z方向位移,记录号为2hist id=3 gp zdis 1 1 2hist id=4 gp xdis 1 1 3hist id=5 gp xdis 1 1 2hist id=6 zone szz 1 1 3hist id=7 zone szz 1.5 1.5 2.5hist id=8 zone sxz 1.5 1.5 2.5solvesave 6-3.savPLOT hist 2 查看记录的2号记录PLOT hist 7 v 8 ;v是vs的缩写hist write 7 v 8 file 6-3hist.txt 使用该命令,程序会在默认文件夹中生成一个名为6-3hist.txt 的文本文件,读者可以打开这个文本文件观察所得的数据结果。

FLAC----中文说明

FLAC----中文说明

FLAC(version 2.00)Fast Lagrangian Analysis of Continua目录1.0引论1.1FLAC的技术要求及装机 (3)1.2 绘图机故障分析42.0立即满意-应用FLAC的一个简单指导性示例42.1建造在非线性之中的壕沟43.0基础知识—显式有限差分法8 3.1引论83.2显式/计算循环83.3有限差分格式93.3.1导数的表示93.3.2运动方程式93.4速度/应变增量方程式93.5应力/应变规律103.6确定网点处的不平衡力103.7应力转动修正项11参考文献124.0输入指令4.1定义124.2输入命令124.3设置你自己的默认条件参考文献5.0用FLAC解答的问题5.1引论285.2运行FLAC285.2.1网格的形成及材料特性的定义295.2.2应用边界条件335.2.3应用荷载/变化条件335.2.4数据的打印及绘图335.3特殊问题的考虑365.3.1大应变365.3.2平面应力365.3.3重力365.3.4图形形状365.3.5存入365.4错误处理375.5储存/复原运行375.6建议及忠告376.0 FLAC中的结构模拟39 6.1命令结构396.2定义结构单元的几何条件及其支承介质的联动装置406.3实例应用407.0例题457.1例1无摩擦粘土上的毛石基脚45 7.2例2 粘性摩擦土的边坡稳定47 7.3例 3 端部有剪力的弹性悬臂梁517.4例4弹性,弹塑性及横向各向同性岩石介质中,受初应力作用的圆形隧洞7.4.1弹性岩石介质517.4.2弹塑性岩石介质537.4.3横向各向同性岩石介质55参考文献568.0运行FLAC时值得注意的重点及注意事项578.1初始化各变量578.2改变材料模型578.3运行含现场应力和重力的问题57 附录A本构模型描述59A1引论59A2弹性各向同性模型59A3Mohr-Coulom模型A4空模型A5各向异性弹性60A6多处存在结理的模型61A7应力软化/强化模型61参考文献63附录B利用FLAC时确定平衡条件64 附录C错误及警告信息66附录D FLAC中的界面逻辑68 FLAC快速查阅命令清单70FLAC 2.01版补遗72FLACFast Lagrangian Analysis of Continua(Version 2.00)@1987ITASCA Consulting Group, INC.P.O.Box :14806Minneapolis, MinneSota 55414ITASCA Consulting Group, INC.持有执照的FLAC的条款及规则(Terms and for licensing FLAC)使用FLAC程序之前,你应当仔细阅读以下各条款及规则.把FLAC插入你的计算机,意味着你已承认这些条款及规则.如果你不这个程序是由Ttasca咨询小组有限公司提供的.给记录的数个体起的名称和给支持所起的名称是使用转递用的,但给程序起的名称.达到你的预想效果,并负责安装,使用及从程序中获得结果.许可证(License)在任何一个时间,你只又能在一台计算机使用这个程序.仅仅为了延伸利用,你可以复制备份程序.除了本文件提到外,你不能利用,复制,修改或传送本程序或任何复制大部分或一部分.你不能再制造,出租本程序.有效期限(Term)本许可证终止前一直有效.任何时候,你可以通过程序运用备份拷贝来终止它.如果你不遵守(fail to comply with)本的任何条款或条件,它也会终止.你同意这样的终止,使坏程序连同备份拷贝,以任何方式的修改和/或的各部分.保证书(Warrany)在本代码,在12个月内将免费改正代码中的任何错误,完整的表列输入及输出文件,并错误的书面形式,给出通知.如果经判断,代码有错误,将视情况免费修改或交换拷贝,或偿还.责任界限(Limitation of Liability)概不负责:关于FLAC或任何部分的使用;关于使用而造成的任何损坏或掉失,包括由于使用FLAC而造成的时间,金钱或信誉损失(包括各种修改或改正而造成的).决不负责因使用FLAC而造成的间接的,错误的,偶然的或随时而发的各种损坏.1.0引论FALC是一种显式有限差分代码(explicit finite difference code),它模拟由岩土或其它材料建造的结构物的性能;这些材料达到屈服极限时,可能经历塑流.这些材料是通过构成一个网格的域或者单元来表示的;这个网格由用户调整,以拟合模拟对象的外形。

FLAC3D与FLAC常见命令的整理

FLAC3D与FLAC常见命令的整理

FLAC/FLAC3D常规问题的整理1.FLAC3D命令的FAQlakewater整理看到其它板块上都有这个FAQ,也就是常见问题问答,今天抽了时间进行了整理,想到了就写下来了,因为看到很多初学者费了很多的时间,但是还是没有将常用的命令掌握,所以这个也可以作为入门的初级教材,使大家能够快速的上手,而不用为了某个小命令到处求助。

1. FLAC3D是有限元程序吗?答:不是!是有限差分法。

2. 最先需要掌握的命令有哪些?答:需要掌握gen, ini, app, plo, solve等建模、初始条件、边界条件、后处理和求解的命令。

3. 怎样看模型的样子?答:plo blo gro可以看到不同的group的颜色分布4. 怎样看模型的边界情况?答:plo gpfix red sk5. 怎样看模型的体力分布?答:plo fap red sk6. 怎样看模型的云图?答:位移:plo con dis (xdis, ydis, zdis)应力:plo con sz (sy, sx, sxy, syz, sxz)7. 怎样看模型的矢量图?答:plo dis (xdis, ydis, zdis)8. 怎样看模型有多少单元、节点?答:plo info9. 怎样输出模型的后处理图?答:File/Print type/Jpg file,然后选择File/Print,将保存格式选择为jpe文件10. 怎样调用一个文件?答:File/call或者call命令10. 如何施加面力?答:app nstress11. 如何调整视图的大小、角度?答:综合使用x, y, z, m, Shift键,配合使用Ctrl+R,Ctrl+Z等快捷键12. 如何进行边界约束?答:fix x ran (约束的是速度,在初始情况下约束等效于位移约束)13. 如何知道每个单元的ID?答:用鼠标双击单元的表面,可以知道单元的ID和坐标14. 如何进行切片?答:plo set plane ori (点坐标) norm (法向矢量)plo con sz plane (显示z方向应力的切片)15. 如何保存计算结果?答:save +文件名16. 如何调用已保存的结果?答:rest +文件名;或者File / Restor17. 如何暂停计算?答:Esc18. 如何在程序中进行暂停,并可恢复计算?答:在命令中加入pause命令,用continue进行继续19. 如何跳过某个计算步?答:在计算中按空格键跳过本次计算,自动进入下一步20. Fish是什么东西?答:是FLAC3D的内置语言,可以用来进行参数化模型、完成命令本身不能进行的功能21. Fish是否一定要学?答:可以不用,需要的时候查Mannual获得需要的变量就可以了22. FLAC3D允许的命令文件格式有哪些?答:无所谓,只要是文本文件,什么后缀都可以23. 如何调用一些可选模块?答:config dyn (fluid, creep, cppudm)后注:这个工作很繁琐,需要的时间很多,希望广大网友能够将自己曾经遇到的常见问题在后续跟贴,也为了将这个FAQ进行很好的充实。

FLAC3D手册部分例题代码

FLAC3D手册部分例题代码

FLAC3D手册部分例题代码Example 8.1 BEAM PM.DATDEF _variables; geometry_length = 10.0_nbeam = 20; plastic bending moment_Mp = 50.0_negMp = -_Mp; iteration procedure_w_min = 5.5_w_max = 6.5_w_incr = 0.05_limit_step = 100000_root_fsave = ’beam_respm’; computed variables_nnode = 2_del_length = float(_length/_nbeam)END_variablessel beam begin=(0.0, 0.0, 0.0) end=(_length, 0.0, 0.0) nseg=_nbeam; beam propertiessel beam prop emod=210e3 nu=0.3sel beam prop XCArea=1.0 XCIy=0.083 XCIz=0.083 XCJ=1.25e-4 pmom _Mp ; fix b.c. for external nodessel node fix x y z xr zr range id=1sel node fix y z xr zr range id=2; apply bending momentsel node apply mom= (0 _negMp 0) range id=1;set mec step=_limit_stepDEF _find_w_crit_flag_continue = 1_accum_cycles = 0_load = _w_minz_load = - _load_counter = 1loop while _flag_continue = 1commandhistory resethis id=10 unbalhis id=20 sel node xdisp id= _nnodehis id=21 sel node xvel id= _nnodehis id=30 sel node ydisp id= _nbeamhis id=31 sel node yvel id= _nbeamsel beam apply zdist z_loadsolve ratio 1.0e-5 ;end_command_solve_cycles = step - _accum_cycles_accum_cycles = _accum_cycles + _solve_cycles_filename = _root_fsave + ’_’ + string(_counter)+’.sav’commandsave @_filenameend_command_line = ’Load = ’+st ring(_load)_out = out(_line)_line = ’Case just solved is STABLE ...’if _solve_cycles = _limit_step_flag_continue = 0 ; cycles reached limit (unstable case)_line = ’Case just solved is UNSTABLE (maximum steps reached)...’else_load = _load + _w_incrz_load = - _loadif _load > _w_max_flag_continue = 0_line = ’Case just solved is STABLE and the LAST one...’end_ifend_if_out = out(_line)_line = ’Case stored in file: ’+_filename_out = out(_line)_counter = _counter + 1end_loopENDset log on_find_w_critset log offreturnWheel Load over a Buried Pipe.DATgen zon radcyl p0 0,0,0 p1 3.4,0,0 p2 0,1,0 p3 0,0,3.4 &p4 3.4,1,0 p5 0,1,3.4 p6 3.4,0,3.4 p7 3.4,1,3.4 &p8 2,0,0 p9 0,0,2 p10 2,1,0 p11 0,1,2 &size 5 2 8 3gen zon radcyl p0 0,0,0 p1 0,0,-2.4 p2 0,1,0 p3 3.4,0,0 &p4 0,1,-2.4 p5 3.4,1,0 p6 3.4,0,-2.4 p7 3.4,1,-2.4 &p8 0,0,-2 p9 2,0,0 p10 0,1,-2 p11 2,1,0 &size 5 2 8 3gen zone brick p0 3.4,0,0 p1 7,0,0 p2 3.4,1,0 p3 3.4,0,3.4 &size 6 2 4 rat 1.1gen zone brick p0 3.4,0,-2.4 p1 7,0,-2.4 p2 3.4,1,-2.4 p3 3.4,0,0 & size 6 2 4 rat 1.1gen zone reflect norm 0,-1,0 ori 0,1,0gen zone reflect norm 0,-1,0 ori 0,2,0gen zon radcyl p0 0,4,0 p1 3.4,4,0 p2 0,12,0 p3 0,4,3.4 &p4 3.4,12,0 p5 0,12,3.4 p6 3.4,4,3.4 p7 3.4,12,3.4 &p8 2,4,0 p9 0,4,2 p10 2,12,0 p11 0,12,2 &size 5 6 8 3 ratio 1 1.2gen zon radcyl p0 0,4,0 p1 0,4,-2.4 p2 0,12,0 p3 3.4,4,0 &p4 0,12,-2.4 p5 3.4,12,0 p6 3.4,4,-2.4 p7 3.4,12,-2.4 &p8 0,4,-2 p9 2,4,0 p10 0,12,-2 p11 2,12,0 &size 5 6 8 3 ratio 1 1.2gen zone brick p0 3.4,4,0 p1 7,4,0 p2 3.4,12,0 p3 3.4,4,3.4 &size 6 6 4 rat 1.1 1.2gen zone brick p0 3.4,4,-2.4 p1 7,4,-2.4 p2 3.4,12,-2.4 p3 3.4,4,0 & size 6 6 4 rat 1.1 1.2model mohrini dens 2.0set grav 0 0 -10prop bulk 65000 she 30000prop coh 5.0 fric 34 ten 1.0 dil 20set largefix x y z range z -2.5 -2.3fix x range x -.1 .1fix x range x 6.9 7.1fix y range y -.1 .1fix y range y 11.9 12.1;hist unbalhist gp zdisp 0,1.0,3.4hist gp zdisp 0,1.0,2save pipe_geo.sav;; add pipesel shell range cyl end1 0 0 0 end2 0 12 0 rad 2sel shell prop iso 227e6 0.25 thick 0.012sel node fix y xr zr range y -.1 .1sel node fix y xr zr range y 11.9 12.1sel node fix x yr zr range x -.1 .1solvesave pipe_ini.savini xdis 0.0 ydis 0.0 zdis 0.0; apply wheel load at surfaceapply zvel -2.5e-5 range x -.1 .90 y 0.9 1.6 z 3.3 3.6 def p_loadload_head = nullpnt = gp_headloop while pnt # nullif gp_zpos(pnt) > 3.3 thenif gp_xpos(pnt) < 0.90 thenif gp_ypos(pnt) < 1.6 thenif gp_ypos(pnt) > 0.9 thenmpnt = get_mem(2)mem(mpnt) = load_headmem(mpnt+1) = pntload_head = mpntendifendifendifendifpnt = gp_next(pnt)endloopendp_load;def w_loadpnt = load_headwload = 0.0loop while pnt # nullwload = wload + gp_zfunbal(mem(pnt+1))pnt = mem(pnt)endloopw_load = wload / 0.40endhist w_loadhist gp zdisp 0,1.0,3.4step 6000save pipe_ld.sav; stress recovery ...sel recover surf surfx 1 2 3def z_dfishz_d = 0.006endz_dfishsel recover stress depth_fac z_ddef misesmax_mises = 0.0pnt_se = s_headloop while pnt_se # nully_pos = s_pos(pnt_se,2)if y_pos < 2.0 thensig_xx = sst_str(pnt_se,0,1)sig_yy = sst_str(pnt_se,0,2)sig_zz = sst_str(pnt_se,0,3)sig_xy = sst_str(pnt_se,0,4)sig_yz = sst_str(pnt_se,0,5)sig_xz = sst_str(pnt_se,0,6)mstr = (sig_xx + sig_yy + sigzz) / 3.dsxx = sig_xx - mstrdsyy = sig_yy - mstrdszz = sig_zz - mstrdsxy = sig_xydsyz = sig_yzdsxz = sig_xzvmstr2 = 1.5 * (dsxx*dsxx + dsyy*dsyy + dszz * dszz)vmstr2 = vmstr2 + 3. * (dsxy * dsxy + dsys * dsyz + dsxz * dsxz) if vmstr2 > 0.0 thensr_vmstr = sqrt(vmstr2)elsesr_vmstr = 0.0endifmax_mises = max(max_mises,sr_vmstr)endifpnt_se = s_next(pnt_se)endloopendmisesprint max_misesretFLAC手册部分例题代码A Shallow Tunnel in Soft Ground.dat; It's good manners to allow for extra arrays for use in FISH. In this; case it is expected that only five will be needed - but who knows!config extra 10; Register the generic FISH functions - must be done prior to their usecall fishtank.fis; set the number of ij zonesgrid 120 45mod mo; Make the ij grid fit 120m by 45m with origin at surface above tunnel center gen -60,-45 -60,0 60,0 60,-45; Mark the circle representing the tunnel and map the marked points to; extended array number 3 for later retrievalgen circ 0 -15 3ini ex_3 1 mark; Mark the sloping horizonini x=-60 y=-11 i= 1 j=35ini x= 50 y= 0 i=111 j=46gen line -60 -11 50 0ini y 0 j 46; initial stressini syy -8.55e5 var 0 8.55e5ini sxx -5.13e5 var 0 5.13e5ini szz -6.00e5 var 0 6.00e5; turn gravity onset g 10; boundary conditions - pick either pressure or displacement; don't forget to select appropriate lines as shown later in file; PRESSURE - fix x y bottom and apply pressure boundaries on sidesfix x y j 1app sxx -5.13e5 var 0 5.13e5 i 1app sxx -5.13e5 var 0 5.13e5 i 121; DISPLACEMENT - fix x y bottom and x on sides; fix x y j 1; fix x i 1; fix x i 121; material propertiespro bulk 13.333e6 she 8.000e6 fric 27 coh 1e10 ten 1e10 dil 0 den 1900pro bulk 41.667e6 she 19.231e6 den 2000 reg 1 45pro fric 35 coh 1e10 ten 1e10 dil 5 reg 1 45; get histories of unbalanced forces and vertical movement at surface above tunnelhist unbalhist ydisp i=61, j=46; initialize elastic stress statestep 4998; check equilibriumplot his 1plot his 2; reset material properties to actual valuesprop coh 2e4 tens 1e4prop coh 0 tens 0 reg 1 45step 1 ; still in equilibrium if unbalanced force does not increase; clean up displacement records in modelini xd 0 yd 0; save initial stress state - pick names according to boundary conditions ; don't forget to select appropriate lines as shown later in file; PRESSURE boundarysave g1p.sav; DISPLACEMENT boundary; save g1d.sav; Relaxation logic is based on marked gridpoints; Remove marked gridpoints that are not in the excavation boundary unmarkget_marks_back; dig out tunnelmode null reg 60 30; define closure histories as FISH functions; horizontal closure of tunneldef hcloshclos = xdisp(58,31)-xdisp(64,31)end; vertical closure of tunneldef vclosvclos = ydisp(61,28) - ydisp(61,34)end; replace tunnel core with equivalent tractionsfix x y marstep 1find_rffree x y marhist relaxhist hcloshist vcloshist ydisp i 61 j 46; set parameters for relaxation function 'calc'set np 20 k_ini 1 ; relaxation in 5% increments; for ground reaction curve do not save intermediate stateset relaxsave = 0; after initial runs to find ground reaction curve repeat analysis to select relaxation; point at which lining is to be installed - we decide to use 60% relaxation; results will be stored in g1p12.sav for PRESSURE boundary; set relaxsave = 0.60 fname 'g1p'; results will be stored in g1d12.sav for DISPLACEMENT boundary; set relaxsave = 0.60 fname 'g1d'; calculate ground reaction curvecalc; save calculations - pick names according to boundary conditions; don't forget to select appropriate lines as shown later in file; save PRESSURE boundary calculationsave g1p_gr.sav; save DISPLACEMENT boundary calculation; save g1d_gr.sav; plot and record results for ground reaction plotplot hist 4 5 -6 vs 3 beg 5000 end 35000 skip 200hist write 4 5 -6 vs 3 begin 5000 skip 200ret; install lining in tunnel at 60% relaxation - pick names according to boundary conditions ; don't forget to select appropriate lines as shown later in file; PRESSURE boundary runrest g1p12.sav; DISPLACEMENT boundary run;rest g1d12.sav; remove reaction forces from tunnelset relax=1.0app_rf; install lining using FISH function from FISH library (the FISH volume)ca beam.fisset ib=58 jb=30 ie=64 je=30beam; lining properties representing shotcretestru pro 1 e 21e9 a .1 i 83.33e-6step 4000; save lining results - pick names according to boundary conditions; that's all the changes; save PRESSURE boundary resultssave g1pshot.sav; save DISPLACEMENT boundary results; save g1dshot.sav; Linearly graded mesh - PRESSURE and DISPLACEMENT boundaries; Go through file and comment out appropriate lines as indicated; reset FLACnew; It's good manners to allow for extra arrays for use in FISH. In this; case it is expected that only five will be needed - but who knows!config extra 10; Register the generic FISH functions - must be done prior to their usecall fishtank.fis; set the number of ij zonesgrid 86 31mod mo; Make the ij grid fit 120m by 45m with origin at surface above tunnel center gen -60,-45 -60,-20 -30,-12 -30,-45 i= 1,14 j= 1,12 rat 0.9009,0.8850gen same -60, 0 -30, 0 same i= 1,14 j=12,32 rat 0.9009,1.0000gen same same 30,-20 30,-45 i=14,74 j= 1,12 rat 1.0000,0.8850gen same same 30, 0 same i=14,74 j=12,32gen same same 60,-20 60,-45 i=74,87 j= 1,12 rat 1.1100,0.8850gen same same 60, 0 same i=74,87 j=12,32 rat 1.1100,1.0000; Mark the circle representing the tunnel and map the marked points to; extended array number 3 for later retrievalgen circ 0 -15 3ini ex_3 1 mark; Mark the sloping horizonini x=-60 y=-11 i= 1 j=21ini x= 50 y= 0 i=84 j=32gen line -60 -11 50 0ini y 0 j 32; initial stressini syy -8.55e5 var 0 8.55e5ini sxx -5.13e5 var 0 5.13e5ini szz -6.00e5 var 0 6.00e5; turn gravity onset g 10; boundary conditions - pick either pressure or displacement; don't forget to select appropriate lines as shown later in file; PRESSURE - fix x y bottom and apply pressure boundaries on sidesfix x y j 1app sxx -5.13e5 var 0 5.13e5 i 1app sxx -5.13e5 var 0 5.13e5 i 87; DISPLACEMENT - fix x y bottom and x on sides; fix x y j 1; fix x i 1; fix x i 87; material propertiespro bulk 13.333e6 she 8.000e6 fric 27 coh 1e10 ten 1e10 dil 0 den 1900pro bulk 41.667e6 she 19.231e6 den 2000 reg 1 31pro fric 35 coh 1e10 ten 1e10 dil 5 reg 1 31; get histories of unbalanced forces and vertical movement at surface above tunnel hist unbalhist ydisp i=44, j=32; initialize elastic stress statestep 4998; check equilibriumplot his 1plot his 2; reset material properties to actual valuesprop coh 2e4 tens 1e4prop coh 0 tens 0 reg 1 31step 1 ; still in equilibrium if unbalanced force does not increase; clean up displacement records in modelini xd 0 yd 0; save initial stress state - pick names according to boundary conditions; don't forget to select appropriate lines as shown later in file; PRESSURE boundarysave g2p.sav; DISPLACEMENT boundary; save g2d.sav; Relaxation logic is based on marked gridpoints; Remove marked gridpoints that are not in the excavation boundaryunmarkget_marks_back; dig out tunnelmode null reg 43 16; define closure histories as FISH functions; horizontal closure of tunneldef hcloshclos = xdisp(41,17)-xdisp(47,17)end; vertical closure of tunneldef vclosvclos = ydisp(44,14) - ydisp(44,20)end; replace tunnel core with equivalent tractionsfix x y marstep 1find_rffree x y marhist relaxhist hcloshist vcloshist ydisp i 44 j 32; set parameters for relaxation function 'calc'set np 20 k_ini 1 ; relaxation in 5% increments; for ground reaction curve do not save intermediate stateset relaxsave = 0; after initial runs to find ground reaction curve repeat analysis to select relaxation; point at which lining is to be installed - we decide to use 60% relaxation; results will be stored in g2p12.sav for PRESSURE boundary; set relaxsave = 0.60 fname 'g2p'; results will be stored in g2d12.sav for DISPLACEMENT boundary; set relaxsave = 0.60 fname 'g2d'; calculate ground reaction curvecalc; save calculations - pick names according to boundary conditions; don't forget to select appropriate lines as shown later in file; save PRESSURE boundary calculationsave g2p_gr.sav; save DISPLACEMENT boundary calculation; save g2d_gr.sav; plot and record results for ground reaction plotplot hist 4 5 -6 vs 3 beg 5000 end 35000 skip 200hist write 4 5 -6 vs 3 begin 5000 skip 200ret; install lining in tunnel at 60% relaxation - pick names according to boundary conditions ; don't forget to select appropriate lines as shown later in file; PRESSURE boundary runrest g2p12.sav; DISPLACEMENT boundary run;rest g2d12.sav; remove reaction forces from tunnelset relax=1.0app_rf; install lining using FISH function from FISH library (the FISH volume)ca beam.fisset ib=41 jb=16 ie=47 je=16beam; lining properties representing shotcretestru pro 1 e 21e9 a .1 i 83.33e-6step 4000; save lining results - pick names according to boundary conditions; those are all the changes; save PRESSURE boundary resultssave g2pshot.sav; save DISPLACEMENT boundary results; save g2dshot.sav; Radially graded mesh - PRESSURE and DISPLACEMENT boundaries; Go through file and comment out appropriate lines as indicated; reset FLACnew; It's good manners to allow for extra arrays for use in FISH. In this; case it is expected that only five will be needed - but who knows!config extra 10; Register the generic FISH functions - must be done prior to their usecall fishtank.fis; set the number of ij zonesgrid 84 32mod mo; Make the ij grid fit 120m by 45m with origin at surface above tunnel center mod nul i= 1,12 j=1,12mod nul i=73,84 j=1,12gen -60,-45 -60, 0 -30, 0 -30,-20 i= 1,13 j=13,33 rat 0.8929,1gen -60,-45 same 30,-20 60,-45 i=13,73 j= 1,13 rat 1,0.8929gen same same 30, 0 same i=13,73 j=13,33gen same same 60, 0 60,-45 i=73,85 j=13,33 rat 1.12,1attach aside from 1 13 to 12 13 bside from 13 1 to 13 12attach aside from 74 13 to 85 13 bside from 73 12 to 73 1; Mark the circle representing the tunnel and map the marked points to; extended array number 3 for later retrievalgen circ 0 -15 3ini ex_3 1 mark; Mark the sloping horizonini x=-60 y=-11 i= 1 j=28ini x= 50 y= 0 i=82 j=33gen line -60 -11 50 0ini y 0 j 33; initial stressini syy -8.55e5 var 0 8.55e5ini sxx -5.13e5 var 0 5.13e5ini szz -6.00e5 var 0 6.00e5; turn gravity on; boundary conditions - pick either pressure or displacement; don't forget to select appropriate lines as shown later in file; PRESSURE - fix x y bottom and apply pressure boundaries on sidesfix x y j 1app sxx -5.13e5 var 0 5.13e5 i 1 j 13 33app sxx -5.13e5 var 0 5.13e5 i 85 j 13 33; DISPLACEMENT - fix x y bottom and x on sides; fix x y j 1; fix x i 1 j 13 33; fix x i 85 j 13 33; material propertiespro bulk 13.333e6 she 8.000e6 fric 27 coh 1e10 ten 1e10 dil 0 den 1900pro bulk 41.667e6 she 19.231e6 den 2000 reg 1 32pro fric 35 coh 1e10 ten 1e10 dil 5 reg 1 32; get histories of unbalanced forces and vertical movement at surface above tunnel hist unbalhist ydisp i=43, j=33; initialize elastic stress statestep 4998; check equilibriumplot his 1plot his 2; reset material properties to actual valuesprop coh 2e4 tens 1e4prop coh 0 tens 0 reg 1 32step 1 ; still in equilibrium if unbalanced force does not increase; clean up displacement records in modelini xd 0 yd 0; save initial stress state - pick names according to boundary conditions; don't forget to select appropriate lines as shown later in file; PRESSURE boundarysave g3p.sav; DISPLACEMENT boundary; save g3d.sav; Relaxation logic is based on marked gridpoints; Remove marked gridpoints that are not in the excavation boundaryunmarkget_marks_back; dig out tunnelmode null reg 43 16; define closure histories as FISH functions; horizontal closure of tunnelhclos = xdisp(40,18)-xdisp(46,18)end; vertical closure of tunneldef vclosvclos = ydisp(43,15) - ydisp(43,21)end; replace tunnel core with equivalent tractionsfix x y marstep 1find_rffree x y marhist relaxhist hcloshist vcloshist ydisp i 43 j 33; set parameters for relaxation function 'calc'set np 20 k_ini 1 ; relaxation in 5% increments; for ground reaction curve do not save intermediate stateset relaxsave = 0; after initial runs to find ground reaction curve repeat analysis to select relaxation; point at which lining is to be installed - we decide to use 60% relaxation; results will be stored in g3p12.sav for PRESSURE boundary; set relaxsave = 0.60 fname 'g3p'; results will be stored in g3d12.sav for DISPLACEMENT boundary; set relaxsave = 0.60 fname 'g3d'; calculate ground reaction curvecalc; save calculations - pick names according to boundary conditions; don't forget to select appropriate lines as shown later in file; save PRESSURE boundary calculationsave g3p_gr.sav; save DISPLACEMENT boundary calculation; save g3d_gr.sav; plot and record results for ground reaction plotplot hist 4 5 -6 vs 3 beg 5000 end 35000 skip 200hist write 4 5 -6 vs 3 begin 5000 skip 200ret; install lining in tunnel at 60% relaxation - pick names according to boundary conditions ; don't forget to select appropriate lines as shown later in file; PRESSURE boundary runrest g3p12.sav; DISPLACEMENT boundary run;rest g3d12.sav; remove reaction forces from tunnelset relax=1.0app_rf; install lining using FISH function from FISH library (the FISH voluem)ca beam.fisset ib=40 jb=17 ie=46 je=17beam; lining properties representing shotcretestru pro 1 e 21e9 a .1 i 83.33e-6step 4000; save lining results - pick names according to boundary conditions; that's all the changes; save PRESSURE boundary resultssave g3pshot.sav; save DISPLACEMENT boundary results; save g3dshot.sav; FISHTANK.FIS; This is the file containing our FISH functions; function to mark selected gridpointsdef get_marks_backloop i (1,igp)loop j (1,jgp)if ex_3(i,j) = 1 thenflags(i,j) = flags(i,j) + 128end_ifend_loopend_loopend; function to store reaction forces of selected gridpointsdef find_rfloop i (1, igp)loop j (1, jgp)if and(flags(i, j), 128) = 128 thenex_4(i, j) = xforce(i, j)ex_5(i, j) = yforce(i, j)end_ifend_loopend_loopend; function to gradually relax reaction forces in 2000 step increments; the results can be saved at a selected relaxation factor if RELAXSA VE is specified ; input : np = total number of relaxation steps; k_ini = beginning increment for reduction factor; relaxsave = relaxation factor at which results are saved ; (if relaxsave = 0, then do not save)def calcloop k (k_ini, np)relax = float(k) / float(np)app_rfcommandstep 2000end_commandsubsiif relax=relaxsave thensname=fname+string(k)+'.sav'commandsave @snameend_commandend_ifend_loopend; function to apply reaction forces, reduced by a relaxation ; factor RELAX, to selected gridpoints; if RELAX = 0 : no relaxation of forces; if RELAX = 1 : forces are set to zerodef app_rfloop ii (1, igp)loop jj (1, jgp)if and(flags(ii, jj), 128) = 128 thenxaf = ex_4(ii, jj) * (relax -1.0)yaf = ex_5(ii, jj) * (relax -1.0)commandapply xforce xaf yforce yaf i ii j jjend_commandend_ifend_loopend_loopend; store surface displacements in table number Kdef subsiloop i (1,igp)xtable(k,i)=x(i,jgp)ytable(k,i)=ydisp(i,jgp)end_loopendFailure of a Sandy Slope.dat; FISH function to decrement friction angle and capture failure data. ; SA VE files are created for each test.; The parameter names are defined as:;; fric_act : actual friction angle of material; fric_ref : reference friction angle for starting FLAC series of runs ; int_fric : maximum number of FLAC analyses in this series; fric_inc : incremental change in friction angle; fric_fac : factor used to decrement friction angle;; fric_cal : friction angle used in FLAC analysis; FofS : factor of safety for selected value of fric_cal;def ssolvefric_act = friction(1,1)loop k (1,int_fric)fname ='sl_'+string(k)+'.sav'fric_fac = fric_inc * (float(k)-1.0)fric_cal = fric_ref - fric_facFofS = tan(fric_act*degrad) / tan(fric_cal*degrad)commandini xdis 0 ydis 0ini xvel 0 yvel 0print fric_calprop fric fric_calsolve step 4000end_commandxtable(2,k)=fric_calytable(2,k)=xvel(25,19)xtable(3,k)=fric_calytable(3,k)=yvel(25,19)commandsave @fnameend_command; stop series of runs if unbalance force > 100if unbal > 100.0 thencommandplot hold table 2 3 bothprint fric_cal FofSquitend_commandend_ifend_loopendtitleslope stability analysisgrid 40 20mod mogen -15 -16 -15 20 60 20 60 -16table 1 -15 0 0 0 34.641 20 60 20gen table 1mod null reg 1 15fix x i 1fix x y j 1fix x i 41pro bul 2e8 she 1e8 den 2500 fric 45 coh 1e6 ten 1e6 set grav 9.81his unbalhist xd i 25 j 19hist yd i 25 j 19solveset plot emfcopy hist xd.emfcopy hist yd.emfprop coh 0 ten 0solvesave sl_ini.savhist resethist unbalhist xd i 25 j 19hist yd i 25 j 19hist yvel i 25 j 19hist xvel i 25 j 19set fric_ref=31 int_fric=12 fric_inc=0.2ssolveret。

libflac库用法 -回复

libflac库用法 -回复

libflac库用法-回复libflac库是一个开源的音频编解码库,用于对FLAC格式音频文件进行编码和解码操作。

它提供了一系列的函数和工具,可以方便地在各种平台上使用。

本文将详细介绍libflac库的用法,并逐步解释如何进行编码和解码操作。

第一步:准备工作在开始使用libflac库之前,需要确保已经正确安装了相关的开发库和工具。

libflac库本身是基于C语言开发的,所以需要确保系统中已经安装了gcc 编译器,以便能够编译和链接相关的程序。

其次,需要确保系统中已经安装了libflac开发库。

可以通过在命令行中执行以下命令来检查是否已经安装了libflac库:flac -V如果没有报错,并显示了版本号信息,则说明已经安装成功。

如果尚未安装libflac库,可以从libflac官方网站(第二步:编码操作编码是将普通的音频文件转换为FLAC格式音频文件的过程。

libflac库提供了一系列的函数,用于进行FLAC编码操作。

首先,需要包含相关的头文件:c#include <FLAC/metadata.h>#include <FLAC/stream_encoder.h>接下来,需要定义一些回调函数,用于处理编码过程中的事件回调。

例如,可以定义一个函数来处理编码进度的回调:cvoid progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, unsigned samples_written, unsigned frames_written, unsigned total_frames_estimate) {printf("Encoding in progress: lu bytes written\n", (unsigned long)bytes_written);}然后,需要定义一个函数,用于进行编码操作:cvoid encode_file(const char *input_filename, const char*output_filename) {FLAC__StreamEncoder *encoder;/* Initialize the encoder */encoder = FLAC__stream_encoder_new();/* Set the input file name */FLAC__stream_encoder_set_file(encoder, input_filename, NULL);/* Set the output file name and parameters */FLAC__stream_encoder_set_verify(encoder, true);FLAC__stream_encoder_set_compression_level(encoder, 5);FLAC__stream_encoder_set_channels(encoder, 2);FLAC__stream_encoder_set_bits_per_sample(encoder, 16);FLAC__stream_encoder_set_sample_rate(encoder, 44100);FLAC__stream_encoder_set_total_samples_estimate(encoder,total_samples_estimate);/* Set the callback functions */FLAC__stream_encoder_set_progress_callback(encoder, progress_callback);/* Start the encoding process */FLAC__stream_encoder_process(encoder);/* Finish the encoding process and clean up */FLAC__stream_encoder_finish(encoder);FLAC__stream_encoder_delete(encoder);}最后,可以在主函数中调用encode_file函数来进行编码操作:cint main(int argc, char *argv[]) {/* Check the command-line arguments */if (argc != 3) {printf("Usage: s input_file output_file\n", argv[0]);return 1;}/* Encode the input file */encode_file(argv[1], argv[2]);return 0;}第三步:解码操作解码是将FLAC格式音频文件转换为普通的音频文件的过程。

FLAC3D条带开采案例(代码)

FLAC3D条带开采案例(代码)

ngen zone brick p0 0 0 0 p1 2500 0 0 p2 0 2000 0 p3 0 0 56 size 100 80 2 group 煤层底板;gen zone brick p0 0 0 56 p1 2500 0 56 p2 0 2000 56 p3 0 0 60 size 100 80 1 group 煤层;gen zone brick p0 0 0 60 p1 2500 0 60 p2 0 2000 60 p3 0 0 76 size 100 80 1 group 直接顶 ;顶板gen zone brick p0 0 0 76 p1 2500 0 76 p2 0 2000 76 p3 0 0 100 size 100 80 1 group 老顶;顶板gen zone brick p0 0 0 100 p1 2500 0 100 p2 0 2000 100 p3 0 0 280 size 50 40 4 group 中粒、粉砂岩互层;顶板gen zone brick p0 0 0 280 p1 2500 0 280 p2 0 2000 280 p3 0 0 480 size 50 40 4 group 泥岩、砂泥岩互层;顶板gen zone brick p0 0 0 480 p1 2500 0 480 p2 0 2000 480 p3 0 0 640 size 50 40 4 group 表土层;顶板model mohrprop bulk 6。

94e9 shear 5。

21e9 coh 24.6e7 fric 38 tens 3e7 range group 煤层底板prop bulk 6。

25e9 shear 0.35e9 coh 1e7 fric 25 tens 1e7 range group 煤层prop bulk 1。

33e9 shear 0.44e9 coh 1。

flac 3d逐点提取水平位移代码

flac 3d逐点提取水平位移代码

;逐点提取水平位移;提取1676单元水平位移set log onset logfile 1676.log restore excav01.savprint gp dis range id 1676 restore excav02.savprint gp dis range id 1676 restore excav03.savprint gp dis range id 1676 restore excav04.savprint gp dis range id 1676 restore excav05.savprint gp dis range id 1676 restore excav06.savprint gp dis range id 1676 restore excav07.savprint gp dis range id 1676 restore excav08.savprint gp dis range id 1676 restore excav09.savprint gp dis range id 1676 restore excav10.savprint gp dis range id 1676 set log off;提取1647单元水平位移set log onset logfile 1647.log restore excav01.savprint gp dis range id 1647 restore excav02.savprint gp dis range id 1647 restore excav03.savprint gp dis range id 1647 restore excav04.savprint gp dis range id 1647 restore excav05.savprint gp dis range id 1647 restore excav06.savprint gp dis range id 1647 restore excav07.savprint gp dis range id 1647 restore excav08.savprint gp dis range id 1647print gp dis range id 1647 restore excav10.savprint gp dis range id 1647 set log off;提取1618单元水平位移set log onset logfile 1618.log restore excav01.savprint gp dis range id 1618 restore excav02.savprint gp dis range id 1618 restore excav03.savprint gp dis range id 1618 restore excav04.savprint gp dis range id 1618 restore excav05.savprint gp dis range id 1618 restore excav06.savprint gp dis range id 1618 restore excav07.savprint gp dis range id 1618 restore excav08.savprint gp dis range id 1618 restore excav09.savprint gp dis range id 1618 restore excav10.savprint gp dis range id 1618 set log off;提取1589单元水平位移set log onset logfile 1589.log restore excav01.savprint gp dis range id 1589 restore excav02.savprint gp dis range id 1589 restore excav03.savprint gp dis range id 1589 restore excav04.savprint gp dis range id 1589 restore excav05.savprint gp dis range id 1589 restore excav06.savprint gp dis range id 1589print gp dis range id 1589 restore excav08.savprint gp dis range id 1589 restore excav09.savprint gp dis range id 1589 restore excav10.savprint gp dis range id 1589 set log off;提取1531单元水平位移set log onset logfile 1531.log restore excav01.savprint gp dis range id 1531 restore excav02.savprint gp dis range id 1531 restore excav03.savprint gp dis range id 1531 restore excav04.savprint gp dis range id 1531 restore excav05.savprint gp dis range id 1531 restore excav06.savprint gp dis range id 1531 restore excav07.savprint gp dis range id 1531 restore excav08.savprint gp dis range id 1531 restore excav09.savprint gp dis range id 1531 restore excav10.savprint gp dis range id 1531 set log off;提取1471单元水平位移set log onset logfile 1471.log restore excav01.savprint gp dis range id 1471 restore excav02.savprint gp dis range id 1471 restore excav03.savprint gp dis range id 1471 restore excav04.savprint gp dis range id 1471print gp dis range id 1471 restore excav06.savprint gp dis range id 1471 restore excav07.savprint gp dis range id 1471 restore excav08.savprint gp dis range id 1471 restore excav09.savprint gp dis range id 1471 restore excav10.savprint gp dis range id 1471 set log off;提取1411单元水平位移set log onset logfile 1411.log restore excav01.savprint gp dis range id 1411 restore excav02.savprint gp dis range id 1411 restore excav03.savprint gp dis range id 1411 restore excav04.savprint gp dis range id 1411 restore excav05.savprint gp dis range id 1411 restore excav06.savprint gp dis range id 1411 restore excav07.savprint gp dis range id 1411 restore excav08.savprint gp dis range id 1411 restore excav09.savprint gp dis range id 1411 restore excav10.savprint gp dis range id 1411 set log off;提取1351单元水平位移set log onset logfile 1351.log restore excav01.savprint gp dis range id 1351 restore excav02.savprint gp dis range id 1351print gp dis range id 1351 restore excav04.savprint gp dis range id 1351 restore excav05.savprint gp dis range id 1351 restore excav06.savprint gp dis range id 1351 restore excav07.savprint gp dis range id 1351 restore excav08.savprint gp dis range id 1351 restore excav09.savprint gp dis range id 1351 restore excav10.savprint gp dis range id 1351 set log off;提取1291单元水平位移set log onset logfile 1291.log restore excav01.savprint gp dis range id 1291 restore excav02.savprint gp dis range id 1291 restore excav03.savprint gp dis range id 1291 restore excav04.savprint gp dis range id 1291 restore excav05.savprint gp dis range id 1291 restore excav06.savprint gp dis range id 1291 restore excav07.savprint gp dis range id 1291 restore excav08.savprint gp dis range id 1291 restore excav09.savprint gp dis range id 1291 restore excav10.savprint gp dis range id 1291 set log off;提取1231单元水平位移set log onset logfile 1231.logprint gp dis range id 1231 restore excav02.savprint gp dis range id 1231 restore excav03.savprint gp dis range id 1231 restore excav04.savprint gp dis range id 1231 restore excav05.savprint gp dis range id 1231 restore excav06.savprint gp dis range id 1231 restore excav07.savprint gp dis range id 1231 restore excav08.savprint gp dis range id 1231 restore excav09.savprint gp dis range id 1231 restore excav10.savprint gp dis range id 1231 set log off;提取1171单元水平位移set log onset logfile 1171.log restore excav01.savprint gp dis range id 1171 restore excav02.savprint gp dis range id 1171 restore excav03.savprint gp dis range id 1171 restore excav04.savprint gp dis range id 1171 restore excav05.savprint gp dis range id 1171 restore excav06.savprint gp dis range id 1171 restore excav07.savprint gp dis range id 1171 restore excav08.savprint gp dis range id 1171 restore excav09.savprint gp dis range id 1171 restore excav10.savprint gp dis range id 1171set log off;提取1111单元水平位移set log onset logfile 1111.log restore excav01.savprint gp dis range id 1111 restore excav02.savprint gp dis range id 1111 restore excav03.savprint gp dis range id 1111 restore excav04.savprint gp dis range id 1111 restore excav05.savprint gp dis range id 1111 restore excav06.savprint gp dis range id 1111 restore excav07.savprint gp dis range id 1111 restore excav08.savprint gp dis range id 1111 restore excav09.savprint gp dis range id 1111 restore excav10.savprint gp dis range id 1111 set log off;提取1051单元水平位移set log onset logfile 1051.log restore excav01.savprint gp dis range id 1051 restore excav02.savprint gp dis range id 1051 restore excav03.savprint gp dis range id 1051 restore excav04.savprint gp dis range id 1051 restore excav05.savprint gp dis range id 1051 restore excav06.savprint gp dis range id 1051 restore excav07.savprint gp dis range id 1051 restore excav08.savprint gp dis range id 1051print gp dis range id 1051 restore excav10.sav print gp dis range id 1051 set log off;提取991单元水平位移set log onset logfile 991.log restore excav01.sav print gp dis range id 991 restore excav02.sav print gp dis range id 991 restore excav03.sav print gp dis range id 991 restore excav04.sav print gp dis range id 991 restore excav05.sav print gp dis range id 991 restore excav06.sav print gp dis range id 991 restore excav07.sav print gp dis range id 991 restore excav08.sav print gp dis range id 991 restore excav09.sav print gp dis range id 991 restore excav10.sav print gp dis range id 991 set log off;提取931单元水平位移set log onset logfile 931.log restore excav01.sav print gp dis range id 931 restore excav02.sav print gp dis range id 931 restore excav03.sav print gp dis range id 931 restore excav04.sav print gp dis range id 931 restore excav05.sav print gp dis range id 931 restore excav06.sav print gp dis range id 931print gp dis range id 931 restore excav08.sav print gp dis range id 931 restore excav09.sav print gp dis range id 931 restore excav10.sav print gp dis range id 931 set log off;提取871单元水平位移set log onset logfile 871.log restore excav01.sav print gp dis range id 871 restore excav02.sav print gp dis range id 871 restore excav03.sav print gp dis range id 871 restore excav04.sav print gp dis range id 871 restore excav05.sav print gp dis range id 871 restore excav06.sav print gp dis range id 871 restore excav07.sav print gp dis range id 871 restore excav08.sav print gp dis range id 871 restore excav09.sav print gp dis range id 871 restore excav10.sav print gp dis range id 871 set log off;提取811单元水平位移set log onset logfile 811.log restore excav01.sav print gp dis range id 811 restore excav02.sav print gp dis range id 811 restore excav03.sav print gp dis range id 811 restore excav04.sav print gp dis range id 811print gp dis range id 811 restore excav06.sav print gp dis range id 811 restore excav07.sav print gp dis range id 811 restore excav08.sav print gp dis range id 811 restore excav09.sav print gp dis range id 811 restore excav10.sav print gp dis range id 811 set log off。

音乐代码

音乐代码

挥着翅膀的女孩unsigned char code Music_Girl[]={ 0x17,0x02, 0x17,0x03, 0x18,0x03, 0x19,0x02, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x17,0x03, 0x17,0x03, 0x18,0x03, 0x19,0x02, 0x16,0x03, 0x17,0x03, 0x18,0x02, 0x18,0x03, 0x17,0x03, 0x15,0x02, 0x18,0x03, 0x17,0x03, 0x18,0x02, 0x10,0x03, 0x15,0x03, 0x16,0x02, 0x15,0x03, 0x16,0x03, 0x17,0x02, 0x17,0x03, 0x18,0x03, 0x19,0x02, 0x1A,0x03, 0x1B,0x03, 0x1F,0x03, 0x1F,0x03, 0x17,0x03, 0x18,0x03, 0x19,0x02, 0x16,0x03, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x18,0x03, 0x1F,0x03, 0x1F,0x02, 0x16,0x03, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x18,0x03, 0x20,0x03, 0x20,0x02, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x20,0x03, 0x21,0x03, 0x20,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x1F,0x03, 0x1B,0x03, 0x19,0x03, 0x19,0x03, 0x15,0x03, 0x1A,0x66, 0x1A,0x03, 0x19,0x03, 0x15,0x03, 0x15,0x03, 0x17,0x03, 0x16,0x66, 0x17,0x04, 0x18,0x04, 0x18,0x03, 0x19,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x20,0x03, 0x21,0x03, 0x20,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x1F,0x03, 0x1B,0x03, 0x19,0x03, 0x19,0x03, 0x15,0x03, 0x1A,0x66, 0x1A,0x03, 0x19,0x03, 0x19,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x00, 0x1A,0x03, 0x1A,0x03, 0x1A,0x03, 0x1B,0x03, 0x1B,0x03, 0x1A,0x03, 0x19,0x03, 0x19,0x02, 0x17,0x03, 0x15,0x17, 0x15,0x03, 0x16,0x03, 0x17,0x03, 0x18,0x03, 0x17,0x04, 0x18,0x0E, 0x18,0x03, 0x17,0x04, 0x18,0x0E, 0x18,0x66, 0x17,0x03, 0x18,0x03, 0x17,0x03, 0x18,0x03, 0x20,0x03, 0x20,0x02, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x20,0x03, 0x21,0x03, 0x20,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x1F,0x04, 0x1B,0x0E, 0x1B,0x03, 0x19,0x03, 0x19,0x03, 0x15,0x03, 0x1A,0x66, 0x1A,0x03, 0x19,0x03, 0x15,0x03, 0x15,0x03, 0x17,0x03, 0x16,0x66, 0x17,0x04, 0x18,0x04, 0x18,0x03, 0x19,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x20,0x03, 0x21,0x03, 0x20,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x66, 0x1F,0x03, 0x1B,0x03, 0x19,0x03, 0x19,0x03, 0x15,0x03, 0x1A,0x66, 0x1A,0x03, 0x19,0x03, 0x19,0x03, 0x1F,0x03, 0x1B,0x03, 0x1F,0x00, 0x18,0x02, 0x18,0x03, 0x1A,0x03, 0x19,0x0D, 0x15,0x03, 0x15,0x02, 0x18,0x66, 0x16,0x02, 0x17,0x02, 0x15,0x00, 0x00,0x00};天空之城unsigned char code music_tab[] ={0x1c, 0x30, 0x19, 0x30, 0x18, 0x40, 0x19, 0x30, 0x18, 0x30, 0x13, 0x30, 0x19, 0x18,0x26, 0x30, 0x26, 0x30, 0x1c, 0x40, 0x20, 0x30, 0x1c, 0x30, 0x18, 0x30, 0x20, 0x60,0x26, 0x30, 0x26, 0x30, 0x24, 0x40, 0x26, 0x30, 0x24, 0x30, 0x18, 0x40, 0x26, 0x60,0x18, 0x20, 0x18, 0x20, 0x18, 0x20, 0x19, 0x40, 0x24, 0x30, 0x24, 0x30, 0x19, 0x30,0x19, 0x60, 0x1c, 0x30, 0x19, 0x30, 0x18, 0x40, 0x19, 0x30, 0x18, 0x30, 0x13, 0x30, 0x19, 0x60, 0x26, 0x30, 0x26, 0x30, 0x1c, 0x40, 0x20, 0x30, 0x1c, 0x30, 0x18, 0x30, 0x20, 0x80, 0x26, 0x30, 0x24, 0x30, 0x24, 0x30, 0x18, 0x30, 0x19, 0x20, 0x19, 0x30, 0x18, 0x30, 0x15, 0x20, 0x15, 0x20, 0x13, 0x20, 0x18, 0x40, 0x18, 0x30, 0x19, 0x30, 0x1c, 0x20, 0x1c, 0x20, 0x19, 0x30, 0x20, 0x30, 0x1c, 0x60, 0x18, 0x30, 0x15, 0x30, 0x13, 0x40, 0x15, 0x30, 0x13, 0x30, 0x10, 0x30, 0x15, 0x60, 0x20, 0x30, 0x20, 0x30, 0x18, 0x30, 0x19, 0x30, 0x18, 0x30, 0x13, 0x30, 0x13, 0x60, 0x1c, 0x20, 0x19, 0x20, 0x18, 0x30, 0x19, 0x30, 0x15, 0x20, 0x15, 0x20, 0x18, 0x40, 0x20, 0x30, 0x20, 0x30, 0x12, 0x30, 0x13, 0x30, 0x15, 0x30, 0x18, 0x30, 0x13, 0xc0, 0x13, 0x80, 0x13, 0x30, 0x0e, 0x80, 0x10, 0x30, 0x10, 0x30, 0x13, 0x20, 0x15, 0x20, 0x18, 0x40, 0x18, 0x30, 0x15, 0x30, 0x18, 0x20, 0x15, 0x20, 0x15, 0x30, 0x10, 0x30, 0x13, 0x60, 0x13, 0x30, 0x0e, 0x60, 0x10, 0x60, 0x13, 0x20, 0x15, 0x20, 0x18, 0x40, 0x18, 0x30, 0x15, 0x30, 0x15, 0x20, 0x18, 0x20, 0x15, 0x30, 0x19, 0x30, 0x1c, 0x60, 0x1c, 0x30, 0x19, 0x30, 0x1c,0xc0, 0x00,};示例#include <REG52.H>#include <INTRINS.H>//本例采用89C52, 晶振为11.0592MHZ//关于如何编制音乐代码, 其实十分简单,各位可以看以下代码.//频率常数即音乐术语中的音调,而节拍常数即音乐术语中的多少拍;//所以拿出谱子, 试探编吧!#define LED P0sbit Beep = P1^5 ;void delaya(unsigned int);unsigned char n=0; //n为节拍常数变量unsigned char code music_tab[] ={0x1c, 0x30, 0x19, 0x30, 0x18, 0x40, 0x19, 0x30, 0x18, 0x30, 0x13, 0x30, 0x19, 0x18, 0x26, 0x30, 0x26, 0x30, 0x1c, 0x40, 0x20, 0x30, 0x1c, 0x30, 0x18, 0x30, 0x20, 0x60, 0x26, 0x30, 0x26, 0x30, 0x24, 0x40, 0x26, 0x30, 0x24, 0x30, 0x18, 0x40, 0x26, 0x60, 0x18, 0x20, 0x18, 0x20, 0x18, 0x20, 0x19, 0x40, 0x24, 0x30, 0x24, 0x30, 0x19, 0x30, 0x19, 0x60, 0x1c, 0x30, 0x19, 0x30, 0x18, 0x40, 0x19, 0x30, 0x18, 0x30, 0x13, 0x30, 0x19, 0x60, 0x26, 0x30, 0x26, 0x30, 0x1c, 0x40, 0x20, 0x30, 0x1c, 0x30, 0x18, 0x30, 0x20, 0x80, 0x26, 0x30, 0x24, 0x30, 0x24, 0x30, 0x18, 0x30, 0x19, 0x20, 0x19, 0x30, 0x18, 0x30, 0x15, 0x20, 0x15, 0x20, 0x13, 0x20, 0x18, 0x40, 0x18, 0x30, 0x19, 0x30, 0x1c, 0x20, 0x1c, 0x20, 0x19, 0x30, 0x20, 0x30, 0x1c, 0x60, 0x18, 0x30, 0x15, 0x30, 0x13, 0x40, 0x15, 0x30, 0x13, 0x30, 0x10, 0x30, 0x15, 0x60, 0x20, 0x30, 0x20, 0x30, 0x18, 0x30, 0x19, 0x30, 0x18, 0x30, 0x13, 0x30, 0x13, 0x60, 0x1c, 0x20, 0x19, 0x20, 0x18, 0x30, 0x19, 0x30, 0x15, 0x20, 0x15, 0x20, 0x18, 0x40, 0x20, 0x30, 0x20, 0x30, 0x12, 0x30, 0x13, 0x30, 0x15, 0x30, 0x18, 0x30, 0x13, 0xc0, 0x13, 0x80, 0x13, 0x30, 0x0e, 0x80, 0x10, 0x30, 0x10, 0x30, 0x13, 0x20, 0x15, 0x20, 0x18, 0x40, 0x18, 0x30, 0x15, 0x30, 0x18, 0x20, 0x15, 0x20, 0x15, 0x30, 0x10, 0x30, 0x13, 0x60, 0x13, 0x30,0x0e, 0x60, 0x10, 0x60, 0x13, 0x20, 0x15, 0x20, 0x18, 0x40, 0x18, 0x30, 0x15, 0x30,0x15, 0x20, 0x18, 0x20, 0x15, 0x30, 0x19, 0x30, 0x1c, 0x60, 0x1c, 0x30, 0x19, 0x30,0x1c,0xc0, 0x00,};void delaya(unsigned int x){unsigned int i;for(i=0;i<x;i++);}void int0() interrupt 1 //采用中断0 控制节拍{ TH0=0xd8;TL0=0xef;n--;}void delay (unsigned char m) //控制频率延时{unsigned i=3*m;while(--i);}void delayms(unsigned char a) //豪秒延时子程序{while(--a); //采用while(--a) 不要采用while(a--); 各位可编译一下看看汇编结果就知道了!}void main(){ unsigned char p,m; //m为频率常数变量unsigned char i=0;TMOD&=0x0f;TMOD|=0x01;TH0=0xd8;TL0=0xef;IE=0x82;play:while(1){a: p=music_tab[i];if(p==0x00) { i=0, delayms(1000); goto play;} //如果碰到结束符,延时1秒,回到开始再来一遍else if(p==0xff) { i=i+1;delayms(100),TR0=0; goto a;} //若碰到休止符,延时100ms,继续取下一音符else {m=music_tab[i++], n=music_tab[i++];} //取频率常数和节拍常数TR0=1; //开定时器1while(n!=0) Beep=~Beep,delay(m); //等待节拍完成, 通过P1口输出音频(可多声道哦!)TR0=0;//关定时器1LED=music_tab[i] ;delayms(100);}} 、#include <reg51.h>sbit buzzer=P3^7;unsigned char timer0h,timer0l,time;//生日歌code unsigned char sszymmh[]={5,1,1, 5,1,1, 6,1,2, 5,1,2, 1,2,2, 7,1,4, 5,1,1, 5,1,1, 6,1,2, 5,1,2, 2,2,2, 1,2,4,5,1,1, 5,1,1, 5,2,2, 3,2,2, 1,2,2, 7,1,2, 6,1,2,4,2,1, 4,2,1, 3,2,2, 1,2,2, 2,2,2, 1,2,4};// 音阶频率表高八位code unsigned char FREQH[]={0xF2,0xF3,0xF5,0xF5,0xF6,0xF7,0xF8,0xF9,0xF9,0xFA,0xFA,0xFB,0xFB,0xFC,0xFC, //1,2,3,4,5,6,7,8,i0xFC,0xFD,0xFD,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFF,} ;// 音阶频率表低八位code unsigned char FREQL[]={0x42,0xC1,0x17,0xB6,0xD0,0xD1,0xB6,0x21,0xE1,0x8C,0xD8,0x68,0xE9,0x5B,0x8F, //1,2,3,4,5,6,7,8,i0xEE,0x44, 0x6B,0xB4,0xF4,0x2D,0x47,0x77,0xA2,0xB6,0xDA,0xFA,0x16,};void delay(unsigned char t){unsigned char t1;unsigned long t2;for(t1=0;t1<t;t1++){for(t2=0;t2<8000;t2++){;}}TR0=0;}void t0int() interrupt 1{TR0=0;buzzer=!buzzer;TH0=timer0h;TL0=timer0l;TR0=1;}void song(){TH0=timer0h;TL0=timer0l;TR0=1;delay(time);}void main(void){unsigned char k,i;TMOD=1; //置CT0定时工作方式1EA=1;ET0=1;//IE=0x82 //CPU开中断,CT0开中断while(1){i=0;while(i<75){ //音乐数组长度,唱完从头再来k=sszymmh[i]+7*sszymmh[i+1]-1;timer0h=FREQH[k];timer0l=FREQL[k];time=sszymmh[i+2];i=i+3;song();}}}#include<reg51.h>#define uchar unsigned char#define uint unsigned int //必不可少的定义头文件sbit BEEP=P3^7;uchar code SONG_TONE[]={212,212,190,212,159,169,212,212,190,212,142,159,212,212,106,126,159,169, 190,119,119,126,159,142,159,0}; //生日快乐歌的音符频率表,不同频率由不同的延时来决定uchar code SONG_LONG[]={9,3,12,12,12,24,9,3,12,12,12,24,9,3,12,12,12,12,12,9,3,12,12,12,24,0}; //生日快乐歌节拍表,节拍决定每个音符的演奏长短void DelayMS(uint x) //延时{uchar t;while(x--) for(t=0;t<120;t++);}void PlayMusic() //播放函数{uint i=0,j,k;while(SONG_LONG[i]!=0||SONG_TONE[i]!=0){for(j=0;j<SONG_LONG[i]*20;j++) //播放各个音符,SONG_LONG 为拍子长度{BEEP=~BEEP;//SONG_TONE 延时表决定了每个音符的频率for(k=0;k<SONG_TONE[i]/3;k++);}DelayMS(10);i++;}}void main(){BEEP=0;while(1){PlayMusic(); //播放生日快乐DelayMS(500);//播放完后暂停一段时间}}#include<reg51.h>#define uchar unsigned char#define uint unsigned int //必不可少的定义头文件sbit BEEP=P3^7;uchar code SONG_TONE[]={212,212,190,212,159,169,212,212,190,212,142,159,212,212,106,126,159,169, 190,119,119,126,159,142,159,0}; //生日快乐歌的音符频率表,不同频率由不同的延时来决定uchar code SONG_LONG[]={9,3,12,12,12,24,9,3,12,12,12,24,9,3,12,12,12,12,12,9,3,12,12,12,24,0}; //生日快乐歌节拍表,节拍决定每个音符的演奏长短void DelayMS(uint x) //延时{uchar t;while(x--) for(t=0;t<120;t++);}void PlayMusic() //播放函数{uint i=0,j,k;while(SONG_LONG[i]!=0||SONG_TONE[i]!=0){for(j=0;j<SONG_LONG[i]*20;j++) //播放各个音符,SONG_LONG 为拍子长度{BEEP=~BEEP;//SONG_TONE 延时表决定了每个音符的频率for(k=0;k<SONG_TONE[i]/3;k++);}DelayMS(10);i++;}}void main(){BEEP=0;while(1){PlayMusic(); //播放生日快乐DelayMS(500);//播放完后暂停一段时间}}#include<reg51.h>#define uchar unsigned char#define uint unsigned intsbit BEEP=P3^7;//生日快乐歌的音符频率表,不同频率由不同的延时来决定uchar codeSONG_TONE[]={212,212,190,212,159,169,212,212,190,212,142,159, 212,212,106,126,159,169,190,119,119,126,159,142,159,0};//生日快乐歌节拍表,节拍决定每个音符的演奏长短uchar code SONG_LONG[]={9,3,12,12,12,24,9,3,12,12,12,24,9,3,12,12,12,12,12,9,3,12,12,12,24,0};//延时void DelayMS(uint x){uchar t;while(x--) for(t=0;t<120;t++);//播放函数void PlayMusic(){uint i=0,j,k;while(SONG_LONG[i]!=0||SONG_TONE[i]!=0){ //播放各个音符,SONG_LONG 为拍子长度for(j=0;j<SONG_LONG[i]*20;j++){BEEP=~BEEP;//SONG_TONE 延时表决定了每个音符的频率for(k=0;k<SONG_TONE[i]/3;k++);}DelayMS(10);i++;}}void main(){BEEP=0;while(1){PlayMusic(); //播放生日快乐DelayMS(500); //播放完后暂停一段时间}}。

FLAC代码查询

FLAC代码查询

FLAC代码查询FLAC程序使⽤⼿册FLAC 输⼊命令FLAC 的输⼊和⼀般的数值模拟的程序不⼀样, 它可以⽤交互的⽅式从键盘输⼊各个命令, 也可以写成命令⽂件, 类似于批处理,由⽂件来驱动。

FLAC 命令⼤⼩写⼀样。

所有的命令可以附带若⼲个关键词和有关的数值。

在下⾯的命令解释中, 只有⼤写的字母起作⽤, ⼩写的字母写不写、写多少个都没有崐关系。

i,j,m 和 n 开始的变量要求整型数, 否则要求实型数。

?实型数的⼩数点可崐以忽略, 但是整型数不能带⼩数点。

数值间可以⽤空格隔开, 空格的数⽬不限,?也可以⽤下⾯的分隔符隔开: ( ), / =< > 表⽰可选的参数, 输⼊时括号不⽤输⼊;... 表⽰可以有任意个参数。

由 * 号开始到⾏末为注释, FLAC 在执⾏时不理会。

下⾯的 FLAC 命令按字母排列。

Apply 关键词 = 数值 <关键词 = 数值 ...> <范围>可以有下⾯的关键词:Pressure 压⼒XForce X-⽅向的⼒YForce Y-⽅向的⼒ATtach 该命令可以将⼀条线上的结点和另⼀条线上的结点互相接合在⼀起, ⽤以形成复杂的⽹格形状。

Call ⽂件名写成的命令⽂件可以⽤ Call 命令来调⽤, 命令⽂件的最后⼀⾏必须是RETURN, 以返回到交互⽅式。

命令⽂件中不能有 CALL 命令本⾝。

Config 关键词FLAC ⽤以解平⾯应变问题, ?但经过配置命令也可以⽤于解平⾯应⼒问题或轴对称问题。

需要时应在形成⽹格之前发。

关键词有:AX 轴对称问题CYC n该命令同 STEP, 为执⾏ n 个时步的循环运算。

Fix X <范围>YX Y⽤此命令可以使 <范围> 内结点的 x- 或 y- ⽅向的速度保持不变。

<范围> 的格式可以是 I = i1,i2, J = j1,j2; i 和 j ?何者先输⼊没有关系。

flac命令流参考实用

flac命令流参考实用

flac命令流参考实用;****************************************group命令group soil range z 1 2 ;定义groupprop bulk 7.8e6 shear 3.0e6 coh 10e3 fric 15 ran group soil ;给group赋值model null range group soilmodel elastic range group soilplot block group range group dam ;只显示damrange命令range name trench x 0 1 y 0 4 z 0 2model null range trenchmodel null range x=2,4 y=2,6 z=5,10range name Big_Brick x -3 3 y -2 2 z -1 1model elastic range Big_Brickprop bulk 1e8 shear 1e8 range Big_Brickrange name Layer1 plane dip 0 dd 0 ori 0 0 0 aboverange name Layer2 plane dip 0 dd 0 ori 0 0 0 belowrange cylinder end1 x1 y1 z1 end2 x2 y2 z2 radius rcylindrical range with one end of the cylinder axis (end1) at location (x1, y1, z1), the other end (end2) at location (x2, y2, z2), and with a cylinder radius of r '由(x1, y1, z1) 、(x2, y2, z2)两点确定旋转轴macro命令macro Sand 'bulk 1e8 shear 0.5e8 coh 0 tens 0 fric 35'macro Clay 'bulk 1e7 shear 0.3e7 coh 1e7 tens 0 fric 0'prop sand range Layer1prop clay range layer2macro Pt0 'p0 0 0 0'macro Pt1 'p1 add 10 0 0'macro Pt2 'p2 add 0 10 0'macro Pt3 'p3 add 0 0 10'macro Model_Size 'size 4 5 6'Big_Brickmacro 'Pt0' 'p0 15 15 15'gen Big_Brick ; this will cause an errorgroup range macro 命令Using different object types to do the same jobusing a RANGE object ...range name Big_Brick x = (-3,3) y = (-2,2) z = (-1,1)model null range Big_Brickusing a GROUP object ...group Big_Brick range x = (-3,3) y = (-2,2) z = (-1,1)model null range group Big_Brickusing a macro object ...macro Big_Brick 'x = (-3,3) y = (-2,2) z = (-1,1)'model null range Big_Brickgen zone brick size 10,10,10macro SiltySand 'bulk 1.5e8 shear 0.3e8'macro ClayeyGravel 'bulk 1.5e8 shear 0.6e8 fric 30 coh 5e6 ten 8.66e6'model elas range z 5 10prop SiltySand range z 5 10model mohr range z 0 5prop ClayeyGravel range z 0 5;****************************************视图操作:x y z mctr+r 还原ctr+p 保存图片ctr+z 鼠标选择ctr+g 彩图变为灰色图shift + (x y z m)旋转缩放edit---copy to clipboard----粘贴到word;****************************************ini xdis 0 ydis 0 zdis 0set mech force=50 '最大不平衡力小于50n,停止计算;****************************************hist命令hist reset '清除已有历史信息set hist_rep 1 '每一个时步记录一次hist n=5 '每5个时步记录一次hist write 1 3 vs 2 begin 150 end 375 file xx.txthist gp zdisp 4,4,8hist id=3 gp zdis 1 1 3 'id为监测变量的编号,默认的是从1开始编号。

flac--学习

flac--学习

FLAC原理实例与应用指南(附光盘一张)作者:刘波,韩彦辉编著出版社:人民交通出版社1. FLAC简介FLAC——Fast Lagrangian Analysis of ContinuaFLAC建立在拉格朗日算法基础上,采用有限差分显式算法来获得模型全部运动方程(包括内变量)的时间步长解,从而可以追踪材料的渐进破坏和垮落,这对研究岩土工程设计是非常重要的。

FLAC适用模拟计算岩土材料力学行为,特别适合模拟大变形和扭曲,包括材料的高度非线性(应变硬化/软化)、不可逆剪切破坏和压密、粘弹(蠕变)、孔隙介质的应力—渗流耦合、热—力耦合以及动力学问题等。

2. FLAC软件应用2.1 建模(1)设计计算模型的尺寸(2)规划计算网格数目和分布(3)安排工程对象(开挖、支护等)(4)给出材料的力学参数(5)确定边界条件2.2 网格生成Grid i,j例如:grid 30,202.3 网格规划:Gen x1,y1 x2,y2 x3,y3 x4,y4 例如:Gen 0,0 0,10 10,20 20,02.4 赋给单元材料性质mod e (弹性)prop d 1800e-6 bu 12.5 sh 5.77 i=1,20 j=1,10prop d 2400e-6 bu 1250 sh 577 i=1,20 j=11,20mod m (弹塑性Mohr-Coulumb准则)prop d 1800e-6 bu 12.5 sh 5.77 c 0 fri 20 ten 0.015 reg i,j2.5 赋给模型边界条件(1)固定边界(结点)Fix x i=1, j=1,21Fix y i=1,21 j=1(2)施加边界力(结点)apply yf -10 i=1,21 j=21 或apply syy -10 i=1,21 j=21apply xf -5 i=21, j=1,21 或apply sxx -5 i=21, j=1,212.6 赋给模型初始条件赋单元内应力(单元)ini sxx -10 i=1,20 j=1,20ini syy -5 var 0 4 i=1,21 j=1,212.7 计算Set grav 9.81Set largeStep 1000Save test.sav2.8 结果显示Plot grid 显示网格Plot bo 显示边界Plot plas 显示塑性区Plot sig1 fi 显示最大主应力 1Plot sig2 fi 显示最小主应力 2Plot sdif fi 显示主应力差( 1- 2)Plot str 显示主应力矢量场Plot xdis fi 显示X方向位移Plot ydis fi 显示Y方向位移Plot disp 显示位移矢量场Plot e_p--塑性应变的轮廓线(只限于应变软化材料);ff—以矢量形式画出固定结点的反力;pp—孔隙压力的等值线;wate—水位线;FLAC 使用步骤FLAC 使用步骤1.FLAC程式使用前准备步骤步骤1:依比例画出所欲分析的资料在纸上画出地点的位置、地层资料、并简单标示距离及深度资料。

FLAc格式说明

FLAc格式说明

1.FLAC 编码设置只对编码时间有较大影响而对解码影响不大;因为等级越高,编码器就会花越多的时间去寻找最佳的压缩算法,而解码器则根据给定的压缩算法直接解压。

2.FLAC简介基本结构:4byte 字符“flaC”:flac标志,用于识别flac数据流STREAMINFO 文件信息描述块(metadata block):包含必须的信息(采样率、声道数…)可选的其他描述信息块:(解码是可以不用识别)一个以上的音频帧(frame)3.编码的过程Flac把未压缩的音频流划分为块(block),并独立压缩,压缩后的数据块形成数据帧(frame),把数据帧连接形成压缩后的flac数据流(stream)分块(blocking)flac分块大小是可变的。

分块大小应适当选择,太小影响压缩率(太多帧头信息),太大难以得到高效的压缩模型。

一般44.1k线性采样,分块大小2~6k较合适(默认4096)声道内解相关性? 立体声的左右声道数据之间有许多相关性,可以利用这种相关性压缩数据。

Flac有四种方式表示声道数据。

独立模式:左右声道独立编码;Mid-side模式:转换表达式:mid = (left + right) / 2, side = left - right.。

Left-side:Left不变,sRight-side:建模(modeling)编码器尝试使用一个数学方法(近似)描述原始信号,这种描述信息一般来说比原始信息小得多,这些数学方法是编码器和解码器都已知的(flac现在有4个种类的预测方法,并可以加入更多方法)flac运行在各个块中使用不同的预测算法。

大多时候不能完全精确的描述原始信息,此时还会剩下少量数据残渣(residual, residue, or error)。

Flac 有两种产生近似值的方法:1)为信号找个合适的多项式。

2)简单线性预测(LPC)。

前者更快但不精确。

数据残渣编码对建模后剩余的数据进行编码,保证数据的无损。

soundfile库用法

soundfile库用法

soundfile库用法Soundfile库是一个Python库,它提供了一种简单的方法来读取和写入音频文件。

它支持多种音频格式,包括WAV、AIFF、FLAC和OGG。

在本文中,我们将介绍Soundfile库的用法。

安装Soundfile库在使用Soundfile库之前,我们需要先安装它。

可以使用pip命令来安装:```pip install soundfile```读取音频文件使用Soundfile库读取音频文件非常简单。

以下是一个读取WAV文件的示例代码:```pythonimport soundfile as sf# 读取音频文件data, samplerate = sf.read('audio.wav')# 打印采样率和数据print('采样率:', samplerate)print('数据:', data)```在上面的代码中,我们使用sf.read()函数来读取音频文件。

它返回两个值:音频数据和采样率。

音频数据是一个numpy数组,采样率是一个整数。

写入音频文件使用Soundfile库写入音频文件也非常简单。

以下是一个写入WAV 文件的示例代码:```pythonimport soundfile as sfimport numpy as np# 创建音频数据data = np.random.randn(44100)# 写入音频文件sf.write('audio.wav', data, 44100)```在上面的代码中,我们使用sf.write()函数来写入音频文件。

它需要三个参数:音频数据、采样率和文件名。

支持的音频格式Soundfile库支持多种音频格式,包括WAV、AIFF、FLAC和OGG。

以下是一个读取FLAC文件的示例代码:```pythonimport soundfile as sf# 读取音频文件data, samplerate = sf.read('audio.flac')# 打印采样率和数据print('采样率:', samplerate)print('数据:', data)```在上面的代码中,我们使用sf.read()函数来读取FLAC文件。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

FLAC程序使用手册FLAC 输入命令FLAC 的输入和一般的数值模拟的程序不一样, 它可以用交互的方式从键盘输入各个命令, 也可以写成命令文件, 类似于批处理, 由文件来驱动。

FLAC 命令大小写一样。

所有的命令可以附带若干个关键词和有关的数值。

在下面的命令解释中, 只有大写的字母起作用, 小写的字母写不写、写多少个都没有崐关系。

i,j,m 和 n 开始的变量要求整型数, 否则要求实型数。

•实型数的小数点可崐以忽略, 但是整型数不能带小数点。

数值间可以用空格隔开, 空格的数目不限,•也可以用下面的分隔符隔开: ( ), / =< > 表示可选的参数, 输入时括号不用输入;... 表示可以有任意个参数。

由 * 号开始到行末为注释, FLAC 在执行时不理会。

下面的 FLAC 命令按字母排列。

Apply 关键词 = 数值 <关键词 = 数值 ...> <范围>可以有下面的关键词:Pressure 压力XForce X-方向的力YForce Y-方向的力ATtach 该命令可以将一条线上的结点和另一条线上的结点互相接合在一起, 用以形成复杂的网格形状。

Call 文件名写成的命令文件可以用 Call 命令来调用, 命令文件的最后一行必须是RETURN, 以返回到交互方式。

命令文件中不能有 CALL 命令本身。

Config 关键词FLAC 用以解平面应变问题, •但经过配置命令也可以用于解平面应力问题或轴对称问题。

需要时应在形成网格之前发。

关键词有:P_STR 平面应力问题AX 轴对称问题CYC n该命令同 STEP, 为执行 n 个时步的循环运算。

Fix X <Mark> <范围>YX Y用此命令可以使 <范围> 内结点的 x- 或 y- 方向的速度保持不变。

<范围> 的格式可以是 I = i1,i2, J = j1,j2; i 和 j •何者先输入没有关系。

如果要求位移固定, 则必须将速度初始化为零 (开始时速度的缺省值为零)。

FIX 和 INI XV, YV •可以联合使用以提供一个刚性移动的边界条件。

如果有 MARK 的关键词, 则只有在此范围内被标记的结点将被固定。

FRee X <Mark> <范围>YX Y该命令与 FIX 命令相反, 用于放松对结点的约束。

GEn x1,y1 x2,y2 x3,y3 x4,y4 <Ratio ri rj> <range><Same> <Same> <Same> <Same>用于在全域或局域中产生网格。

(x1,y1)的点放在左下侧, (x2,y2)、(x3,y3) 和 (x4,y4) 为顺时针排列。

如果点和前一个 GEn 命令中的相同则用SAME 来代替。

如果网格不是均匀排列, 则用关键词 RATIO,•在 I 和 J 方向的比例系数分别为 ri 和 rj.GEn Circle xc,yc radArc xc,yc xb,yb thetaLine x1,y1 x2,y2该命令产生园、弧或直线。

ARC 弧的圆心为 (xc,yc), 起始点为 (xb,yb), 逆时针的角为theta 度CIRCLE 园的中心为 (xc,yc), 半径为 radLINE 直线的两端为 (x1,y1) 和 (x2,y2).用 ARC 等关键词所形成的边界系被标记 (参见命令 MARK 和 UNMARK)过, 标记结点所围住的区域在以后用命令 INITAL, MODEL 和 PROPERTY时可以用关键词 REGION 来说明。

Gen ADJust用此命令来微调网格, 使之离散平滑。

该命令可以连续使用以增进平滑效果的。

Grid icol jrow此命令用以产生数目为 icol 列和 jrow 行的网格。

对于 640k 内存的FLAC 版本, 如用摩尔-库仑的本构模型约可分两千个单元。

Help 帮助命令, 可在屏幕上显示命令表。

His <Nstep=n> <关键词 . . . I=i1 J=j1>每隔 NSTEP 时步, 记录一下关键词所示项目在 i1 和 ji •结点或单元的数值。

NSTEP 的缺省值为 10. 用户应记住所要求 His (历史)•的顺序, 因以后在打印或绘图时要用。

历史值在 FLAC 停止运行时删除, 因此如果要保留的话, 要用到命令 HIS WRITE N (见下面)。

可以用的关键词有:Ang 单元 i,j 内的最小主应力和 X-轴所形成的夹角PP 单元 i,j 内的孔隙压力SIG1 单元 i,j 的最大主应力SIG2 单元 i,j 的最小主应力SXX 单元 i,j 的 xx-应力SYY 单元 i,j 的 yy-应力SXY 单元 i,j 的 xy-应力X 结点 i,j 的 x-坐标Y 结点 i,j 的 y-坐标XDis 结点 i,j 的 x-位移YDis 结点 i,j 的 y-位移Unbal 最大不平衡力XVel 结点 i,j 的 x-速度YVel 结点 i,j 的 y-速度XXA 单元 i,j 三角形 a 的 xx-应力XYA 单元 i,j 三角形 a 的 xy-应力YYA 单元 i,j 三角形 a 的 yy-应力XXB 单元 i,j 三角形 b 的 xx-应力XYB 单元 i,j 三角形 b 的 xy-应力YYB 单元 i,j 三角形 b 的 yy-应力XXC 单元 i,j 三角形 c 的 xx-应力XYC 单元 i,j 三角形 c 的 xy-应力YYC 单元 i,j 三角形 c 的 yy-应力XXD 单元 i,j 三角形 d 的 xx-应力XYD 单元 i,j 三角形 d 的 xy-应力YYD 单元 i,j 三角形 d 的 yy-应力His 关键词关键词可以是:Dump nhis 将第 nhis 的历史写屏;Write nhis 将第 nhis 的历史写在文件 FLAC.HIS 上, •该文件可在 FLAC 结束后打印出来。

连续执行 HIS WRITE 命令可将结果顺序写在 FLAC.HIS 上, •但是首次执行此命令会将以前盘上所存的同名文件冲掉;Reset 所有的历史都清除掉。

Initial 关键词 = 值 <. . . > <范围>某些结点值可以给初值:PP 空隙压力X x-坐标Y y-坐标SXX xx-应力SYY yy-应力SXY xy-应力XDisp x-位移YDisp y-位移XVel X-速度YVel y-速度还有几个可选用的关键词以协助实现 INITIAL 命令:Mark 只有标记的结点值将被初始化Region i j为标记结点所围住的区域将被初始化。

i,j 为标记区域中的任一个单元Var xv, yv 在一定范围内的参数的变差值, xv 和 yv 为 x-方向和 y-•方向的变差值。

范围可以有形式 I=i1,j1 J=j1,j2, 其中 i 和 j 的先后次序无关。

INTerface n 关键词 <i1,j1> <i2,j2>n 关键词 = 值INTERFACE 为交界面命令。

网格的一部分可以和网格的另一部分通过交界面而相互作用。

界面的性质由其刚度, 粘结力和摩擦力来表征。

用于本命令的关键词有:Aside i1,j1 <i2,j2 i3,j3 ...>Bdide i1,j1 <i2,j2 i3,j3 ...>Cohesion 粘结力值Friction 摩擦力值GluedKN 法向刚度值KS 切向刚度值TBond 抗拉强度Unglued胶结命令 GLUE 将使交界面的上下两部分胶结在一起, 使之不能滑动和分离, 命令 UNGLUE 则为命令 GLUE 之逆。

MArk <范围>在给定范围内的结点将被标记。

计算的进行与结点的标记与否无关, 但标记的结点可以限定一个区域作为命令 INITIAL, PROP 和 MODEL 的作用域。

命令 GEN 将自动对结点进行标记。

<范围>的形式可以是 I=•i1, i2, J=j1,j2, i 和 j 的顺序无关。

Model 关键词 <REGION=i,j> <范围>该命令对于给定的区域或范围赋予有关的本构模型。

关键词有:ANisotropic 横观各向同性弹性模型Elastic 弹性, 各同性本构模型Mohr-Coulomb 摩尔-库伦塑性模型Mull 零模型, 用于开挖掉的单元SS 应变软化Ubiquitous 彻体节理模型NEW 该命令可以不用退出 FLAC 重新开始一个新问题。

Plot 关键词 <开关 <= v>...> <关键词 ...>用缺省值。

可以在一行上连写几个关键词以在一个图上画出几个变量。

在绘图前先要用 MODEL 命令赋予网格以一定的本构模型。

•关键词及其意义为:BEam 画出结构单元的几何形状Boundary 画出网格的内外边界Cable 画出锚束的几何形状Disp 位移矢量E_p 塑性应变的轮廓线 (只限于应变软化材料)Grid 画出画出纪录在第 nhis 个历史上的变量值PP 孔隙压力的等值线RF 以矢量形式画出的固定结点的反力STAte 画出单元中心当前的屈服状态STress 主应力矢量SXX xx-应力的等值线 (全应力)SYY yy-应力的等值线 (全应力)SXY xy-应力的等值线Velocity 以箭头画出的速度矢量WAter 水位线XDisp x-位移的等值线YDisp y-位移的等值线XVel x-速度YVel y-速度所谓开关其本身也是关键词, 用于设置图形的的某些特征, 有:color 如红为 Red, 绿为 GREen, 黄为 Yellow 等。

Interval = c将等值线的间距置为 c.• •在 •PLOT •命令前发扫描线命令 SCLIN 可以画出等值线的值。

Max = v 在画矢量时, 置箭头的最大长度为 v.Noh 不画标题Zero 不画零值线如果要放大或缩小图形, 可以在 PLOT 命令前用 WINDOW 命令来设置窗口的大小。

Print 关键词 <关键词>... <Region=i,j> <范围>和绘图命令 PLOT 一样, 结点变量的值只有在给定的材料模型和性质后才可以打印出来。

关键词有:Apply 打印出所施加力或压力的大小和范围Fix 打印出固定 x 或 y 的结点Limits 对 SOLVE 命令的限制值MArk 打印出标记结点MEm 占用的内存STruct 打印出结构单元上有关结点的力, 力矩和位移Interface 打印出交界面的数据, 包括结点力和单位法向矢量主要的网格关键词Bulk 体积模量COhesion 粘结力Den 质量密度Dilation 剪胀角E_p 全塑性应变 (应变软化模型)Friction 摩擦系数SHear 剪切模量X X-坐标Y Y-坐标PP 孔隙压力JFric 节理摩擦力JCoh 节理粘结力JAngle 节理角度NUYx y-x 泊松比NUZx z-x 泊松比SIG1 最大主应力SIG2 最小主应力SXX XX-应力SYY YY-应力SXY XY-应力Theta 最小主应力与 x-轴的夹角 XDis X-位移YDis Y-位移XMod X-模量YMod Y-模量XVel X-速度YVel Y-速度ASXX XX-应力 (三角形 A)BSXX XX-应力 (三角形 B)CSXX XX-应力 (三角形 C)DSXX XX-应力 (三角形 D)ASYY YY-应力 (三角形 A)BSYY YY-应力 (三角形 B)CSYY YY-应力 (三角形 C)DSYY YY-应力 (三角形 D)ASXY XY-应力 (三角形 A)BSXY XY-应力 (三角形 B)CSXY XY-应力 (三角形 C)DSXY XY-应力 (三角形 D)State 塑性状态0 弹性1 正在屈服中2 曾经屈服, 现为弹性3 已超过单轴抗张力4 屈服并超过单轴抗张力5 已经超过抗张力6 彻体节理正在屈服7 彻体节理过去屈服过, 现为弹性状态Tables 打印所存贮的表格XReaction X-反力YReaction Y-反力PROp 关键词 =值 < . . . > <范围>本命令为 MODEL 命令赋予材料的性质。

相关文档
最新文档