1.如何使用

在3DEC 的帮助文档中,详细介绍了其内置的一些实用函数,这些函数的介绍在 LIBRARY OF FISH FUNCTIONS 中,在下面这个位置可以找到:

先介绍一下一般如何使用这些FISH函数的方法:

1.在命令流中,使用 call 命令进行预处理,call filename.fis

2.设置这些函数中变量的值,set @var1 = value @var2 = value ...

3.调用filename.fis中所定义的函数,@function(var1,var2...)

这些函数可以在3DEC的安装路径找到:

.dat 文件是使用示例(蓝色方框),.fis 文件是源函数(红色方框)。注意:如果按照上面的使用 call 命令进行调用,需要将要使用的.fis 文件函数先复制到当前项目文件夹中,不然会弹出错误。

2.函数介绍

这些函数大部分都要以3DEC中的table进行操作,从下面的命令流中就可以看出来。

2.1 求导函数

原标题:Finding the Derivative of a 3DEC Table

函数文件名:der.fis

table 1进行数据输入,table 2进行数据输出,3DEC实际上是计算table 1中相邻2个点之间的斜率,斜率对应的横坐标取为2个点中点的横坐标,再输出到table 2中。因此如果有n个输入数据,那么只有(n-1)个数据输出。

调用的参数:der_inder_out 。分别指定输入的table ID和输出的table ID,可以看下面对table 1的数据求导的示例:

new
set fish autocreate off
title 'Example of DERIVATIVE FISH function'
define cr_tab
   local val = pi * 6.e-3
   local ii
   loop ii (1,1000)
      local xx = float(ii-1) * val
      xtable(1,ii) = xx
      ytable(1,ii) = cos(xx)
   end_loop
end
@cr_tab
;
call der.fis suppress
@derivative(1,2)
;
plot create plot Derivative
plot add table 1 linestyle color black salias Cosine ...
               2 linestyle color black style dot salias Derivative
ret

cr_tab 创建并储存余弦函数的数据到 table 1,再调用 @derivative(1,2) ,输出数据到table 2。这里的 cr_tab 只是创建table的一个例子,如果你已经有一个table,假设ID为1,就不用创建table这一步了,直接使用:

call der.fis suppress ;suppress写不写都行,不影响,具体可看call命令中的介绍
@derivative(1,2)

2.2 积分函数

原标题:Finding the Integral of a 3DEC Table

函数文件名:int.fis

使用方法和上面的求导函数几乎完全一致,只不过函数名换了而已。使用示例如下:

new
title ’Example of INTEGRATE FISH function’
define cr_tab
local val = pi * 6.e-3
local ii
loop ii (1,1000)
local xx = float(ii-1) * val
xtable(1,ii) = xx
ytable(1,ii) = cos(xx)
end loop
end
@cr_tab
;
call int.fis suppress
;
@integrate(1,2)
plot create plot Integrate
plot add table 1 linestyle color black salias Cosine ...
2 linestyle color black style dot salias Integral
ret

例如在3DEC 地震/冲击等动力加载的模拟中,如果不使用外部软件,地震/冲击加速度波就可以使用这个积分函数进行积分成速度波后再进行使用。当然也可以用作其他的需要使用积分的用途。

2.3加速度反应谱函数

原标题:Finding the Response Spectrum of an Acceleration History in a 3DEC Table

函数文件名:spec.fis

这个函数可以由输入的加速度历史计算位移响应谱、伪速度相应谱、伪加速度响应谱。

位移谱,伪速度谱和伪加速bai度谱可以互相推出来,之所du以分三zhi个,一是因为三个谱代表不同的物理意义,位移dao谱代表峰值位移,伪加速度谱代表等效静力及基底剪力峰值。二是三个谱可以合成一个联合谱,对近似估计设计谱的形状很有用。

——百度知道

调用参数:acc_in 为输入table的ID,sd_out, sv_out, sa_out 为三个输出table的ID,dmp 用来指定阻尼(计算仅为阻尼响应的近似值;dmp越高,响应越不准确) ,pminpmax指定周期的范围,n_point指定输出点的个数。

下面的例子输入一个正弦加速度波,调用这个函数计算。指定周期的范围在0.5到2,输出50个点。

new
define cr_tab(num point,end time,perl)
local i = 0
local p2 = 2.*pi
loop while i <= num point
local xx = end time*float(i)/float(num point)
i = i+1
local yy = sin(xx*p2/perl)
table(1,xx) = yy
end loop
end
@cr_tab(250,3.0,1.0)
call spec.fis suppress
@spectra(0.0,0.5,2.0,1,2,3,4,50)
;
table 1 name ’Input Acceleration’
table 2 name ’Displacement Response’
table 3 name ’Velocity Response’
table 4 name ’Acceleration Response’
plot create plot Input
plot table 1 linestyle color black
plot create plot Displacement
plot table 2 linestyle color black
plot create plot Velocity
plot table 3 linestyle color black
plot create plot Acceleration
plot table 4 linestyle color black
ret

输入的加速度波:

位移响应谱:

伪速度响应谱:

伪加速度响应谱:

2.4判断单元失效状态函数

原标题:Determining Failure States of Zones

函数文件名:states.3dfis

3DEC存储的状态变量具有16bit,可用于表示最多15个不同的状态。 3DEC中的内置和可选本构模型使用的某些状态由下表中给出:

这些模型使用表中的状态名来更新四面体单元的状态

1.Mohr-Coulomb

2.Bilinear, Strain-Hardening/Softening Ubiquitous-Joint

3.Drucker-Prager

4.Strain-Hardening/Softening

5.Ubiquitous-Joint

6.Double-Yield

7.Cam-Clay

8.WIPP-Creep Viscoplastic

下面的例子就是用来判断单元失效状态的示例:

new
poly brick 0 1 0 1 0 1
gen edge 1
;
change cons 2
prop mat 1 bulk 2e6 shea 2e3 bcoh 2e4 bten 2e3 dens 2000
prop jmat = 1 jkn 1e3 jks 1e3
gravity 0,0,-10
;
bound zvel 0 range z -0.1,0.1
bound stress -3e2,0,0 0,0,0 range x -0.1,0.1
;
step 400
;
call states.3dfis ; failure states defined as fish variables
DEF querystate
;
iab = block_head
loop while iab # 0
iaz = b_zone(iab)
loop while iaz # 0
i_mess = ’zone ’+string(iaz)
curr_state = z_state(iaz)  ;判断当前该单元的状态
if and(curr_state, shearnow) # 0 then ;and为逻辑运算
i_mess = i_mess+’ shear’
else
if and(curr_state, shearpast) # 0 then
i_mess = i_mess+’ shear_past’
endif
endif
if and(curr_state, tensionnow) # 0 then
i_mess = i_mess+’ tension’
else
if and(curr_state, tensionpast) # 0 then
i_mess = i_mess+’ tension_past’
endif
endif
if and(curr_state, jointshearnow) # 0 then
i_mess = i_mess+’ joint_shear’
else
if and(curr_state, jointshearpast) # 0 then
i_mess = i_mess+’ joint_shear_past’
endif
endif
if and(curr_state, jointtensionnow) # 0 then
i_mess = i_mess+’ joint_tension’
else
if and(curr_state, jointtensionpast) # 0 then
i_mess = i_mess+’ joint_tension_past’
endif
endif
if and(curr_state, volumenow) # 0 then
i_mess = i_mess+’ volume’
else
if and(curr_state, volumepast) # 0 then
i_mess = i_mess+’ volume_past’
endif
endif
ii = out(i_mess)
iaz = z_next(iaz)
endloop
iab = b_next(iab)
endloop
END
@querystate
return

2.5其他函数

限于篇幅,这里的函数就不一个一个介绍了,需要用到时去查就行了,下面仅罗列出剩下的函数:

1.Error Function and Complementary Error Function (误差函数与互补误差函数)

2.Exponential Integral Function (指数积分函数)

3.Finding the Fast Fourier Transform Power Spectrum of a 3DEC Table (快速傅里叶变换功率谱)

4.Matrix Inversion via LU-Decomposition (基于LU分解的矩阵求逆)

5.Printing a Floating-Point Number with User-Specified Precision (以用户指定的精度打印浮点数)

6.Generation of a Rectangular-Shaped Ramp Excavation (布吉岛是啥玩意儿)

7.Generation of a Vertical Circular Shaft (生成垂直圆轴)


长风破浪会有时,直挂云帆济沧海。