欢迎阅读水哥原创文章,历年原创文章请点击:
更多水哥原创课程,请点击:
finish
/clear
/prep7
et,1,beam188
mp,ex,1,2.1e5
mp,dens,1,2600e-12
mp,prxy,1,0.3
sectype,1,beam,rect
secdata,100,200
K,1,0
K,2,0,1000
K,3,2000,1000
K,4,2000,0
L,1,2
L,2,3
L,3,4
lesize,all,,,5
lmesh,all
!解绑几何体与有限元模型
MODMSH, DETACH
!获取选择集的单元编号
esel,s,cent,x,0
*get,elenum,elem,0,count
*get,elemin,elem,0,num,min
*dim,ele,array,elenum
ele(1)=elemin
*do,i,2,elenum
ele(i)=elnext(ele(i-1))
*enddo
!根据单元类型确定获取的节点数组
!存储单元节点数组
!例如此处为188,就三个节点
*dim,nodenum,array,3
!修改单元编号
*do,i,1,elenum
!获取原属性
*get,matA,elem,ele(i),attr,mat
*get,secA,elem,ele(i),attr,sect
*get,typeA,elem,ele(i),attr,type
*get,realA,elem,ele(i),attr,real
!获取单元节点
*do,j,1,3
nodenum(j)=NELEM(ele(i),j)
*enddo
!删除原单元
Edele,ele(i)
!重新创建单元
type,typeA
real,realA
secnum,secA
mat,matA
!创建单元
EN,ele(i)+100,nodenum(1),nodenum(2),nodenum(3)
*enddo