ANSYS数据导出:节点、单元、振型 - 小众知识

ANSYS数据导出:节点、单元、振型

2014-03-08 17:26:15 苏内容
  标签:
阅读:10466
得到节点坐标和单元内包含的节点的程序如下,可以在ANSYS的帮助中找到每一个命令的详细解释。将下面的程序拷贝到一个文本文件中 filename.txt,保存,去掉后缀名TXT,再拷贝到工作目录下。在命令提示符下输入*use filename,生产一个geomfile.txt文件,打开可以看到里面的数据
 
 
! Get the coordinates of each node
! Get the node list of each element
! By:LiuXiaoqin(liuxqsmile@gmail.com), at nuaa,
*get,nodenum,node,,num,max ! 获得节点的数目
*dim,nodepos,array,nodenum,3 ! nodepos存放节点的坐标
*do,i,1,nodenum,1
*get,nodepos(i,1),node,i,loc,x !获得节点的X坐标
*get,nodepos(i,2),node,i,loc,y
*get,nodepos(i,3),node,i,loc,z
*enddo
 
*get,elemnum,elem,,num,max !得到单元的总数目
*dim,elemlist,array,elemnum,6 !单元包含的节点列表,指定每个单元包含6个节点,根据情况修改
*do,i,1,elemnum,1
*do,ii,1,6,1
*get,elemlist(i,ii),elem,i,node,ii !获得节点编号
*enddo
*enddo
 
*cfopen,geomfile,txt !打开文件,写入数据
*vwrite,0
(F8.0,' Coordinates of each node')
*vwrite,sequ,nodepos(1,1),nodepos(1,2),nodepos(1,3)
(F8.0,3e16.8)
 
*vwrite,0
(F8.0,' Nodes No. of each element')
 
*vwrite,sequ,elemlist(1,1),elemlist(1,2),elemlist(1,3),elemlist(1,4),elemlist(1,5),elemlist(1,6)
(F8.0,6f8.0)
 
 
*vwrite,0
(F8.0)
*cfclos
 
 
获得振型的方法也类似,首先获得模态的个数,然后读取每一阶模态的频率和每个节点的偏移量
 
 
!从ANSYS中导出模态频率及振型数据
!By:LiuXiaoqin(liuxqsmile@gmail.com), at nuaa,
*get,nodenum,node,,num,max
 
*set,tempvar,0
*set,modenum,0
!获得模态的阶数
*do,i,1,100,1
*get,tempvar,mode,i,freq
*if,tempvar,LT,0.0001,THEN
*if,modenum,LT,0.0001,THEN
*set,modenum,(i-1)
*endif
*endif
*enddo
 
 
!*dim,modefqda,array,modenum,2
*dim,modeshp,array,nodenum,3
 
*cfopen,modefile,txt
 
*do,i,1,modenum,1
*get,modefq,mode,i,freq
*get,modeda,mode,i,damp
*vwrite,modefq,modeda
(2e16.8)
set,1,i
!获得每个节点的位移
*do,ii,1,nodenum,1
*get,modeshp(ii,1),node,ii,u,x
*get,modeshp(ii,2),node,ii,u,y
*get,modeshp(ii,3),node,ii,u,z
*enddo
 
*vwrite,sequ,modeshp(1,1),modeshp(1,2),modeshp(1,3)
(F8.0,3e16.8)
*vwrite,0
(F8.0)
*enddo
 
*cfclos
扩展阅读
相关阅读
© CopyRight 2010-2021, PREDREAM.ORG, Inc.All Rights Reserved. 京ICP备13045924号-1