 |
|
|
感谢王老师的大公无私,向你致敬,正好有一个问题问一下你,ANSYS中提取刚度矩阵后转为满矩阵存储的问题,听说你书上有,有一个好心兄弟贴了出来让我研究一下,我把命令写了一遍,但是运行不了,所以我就订了一本你的书,但是书还没有邮到,能不能帮我看看是哪里出了问题呢?我觉得里面的icol没有定义,但不知对不对?命令如下:
finish
/clear
/filname,hbfile
/prep7
et,1,beam3
mp,ex,1,2e5
r,1,1e-2,32e-5,0.5
n,1
n,2,0,4
n,3,4,4
n,4,4,0
en,1,2,3
en,2,1,2
en,3,4,3
f,2,fx,5
sfbeam,1,1,pres,10,,,,2,-1
sfbeam,2,1,pres,3
d,1,all
d,4,all
/solu
solve
finish
/aux2
file,hbfile,full
hbmat,hbfile,txt,ascii,stiff,yes
finish
*dim,contline,,5
*vread,contline(1),hbfile,txt,,,5,,,1
ptrcrd=contline(2)
indcrd=contline(3)
valcrd=contline(4)
rhscrd=contline(5)
*vread,contline(1),hbfile,txt,,,4,,,2
nrow=contline(2)
ncol=contline(3)
strline=
contline=
*if,rhscrd,eq,0,then
ls0=4
*else
ls0=5
*endif
*dim,pointr,,ptrcrd
*dim,rowind,,indcrd
*dim,values,,valcrd
*dim,rhsval,,rhscrd
*vread,pointr(1),hbfile,txt,,,ptrcrd,,,ls0
*vread,rowind(1),hbfile,txt,,,indcrd,,,ls0+ptrcrd
*vread,values(1),hbfile,txt,,,valcrd,,,ls0+ptrcrd+indcrd
*vread,rhsval(1),hbfile,txt,,,rhscrd,,,ls0+ptrcrd+indcrd+valcrd
*dim,smatr,,nrow,ncol
*do,icol,1,ncol
stacol=pointr(icol)
endcol=pointr(icol+1)
*do,irow,stacol,endcol-1
truerow=rowind(irow)
smatr(truerow,icol)=values(irow)
*enddo
*enddo
*do,irow,1,nrow
*do,icol,1,ncol
smatr(irow,icol)=smatr(icol,irow)
*enddo
*enddo
|