声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 19694|回复: 35

[结构分析] ansys中怎样提取质量,刚度,阻尼矩阵?

  [复制链接]
发表于 2006-12-5 11:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
哪位高手知道?请赐教,不胜感激!
回复
分享到:

使用道具 举报

发表于 2006-12-5 18:40 | 显示全部楼层
[转帖] ANSYS中整体、单元刚度和质量矩阵的提取
1、整体刚度和质量矩阵的提取。
该功能需要进行二次开发,由ansys形成 的二进制文件.full提取整体刚度和质量
矩阵。

基于ansys的一个用户开发程序例子编 了一个程序(附件中)。

开发环境:compaq fortran 6.5 运行环境:win2000。
一个主文件:self.for,另一个文件matrixout.f90用于矩阵输出
binlib.lib为ansys提供的库文件,将其引入项目中(也可直接扔进debug目录)

.full文件由子空间迭代模态分析获得。运行编译后的可执行文件.exe

2、单元刚度和质量矩阵的提取。
/DEBUG命令。详细说明

finish
/clear

PI=3.1415926

w1=3
w2=10
w3=6
w4=1.2
r=.8
t=0.08

/PREP7
!*
ET,1,SHELL63
R,1,t

ET,2,MASS21
R,2,500,500,500,2000,2000,2000,
!*
UIMP,1,EX, , ,2e11
UIMP,1,NUXY, , ,0.3,
UIMP,1,DAMP, , ,0.2,
UIMP,1,DENS, , ,7800,

BLC4,0,0,w2,w1
ESIZE,1.5,0,
AMESH,all

NSEL,S,LOC,X,0.0
D,all, , , , , ,ALL, , , , ,

allsel,all
SFA,all,1,PRES,12
FINISH

/OUTPUT,cp,out,, ! 将输出信息送到cp.out文件
/debug,-1,,,1 ! 指定输出单元矩阵

/SOLU
SOLVE
finish

/OUTPUT, TERM ! 将输出信息送到output windows中

! 这时用编辑器打开cp.out文件,可以看到按单元写出的质量、刚度等矩阵
发表于 2006-12-5 18:42 | 显示全部楼层

第二种方法

[转贴]发表时间: 2004年06月13日 10:26    贴子标题: 从ANSYS生成文件中提取结构质量、刚度矩阵的方法

--------------------------------------------------------------------------------

进行研究工作中有时需要利用结构的质量、刚度矩阵,在此基础上编程序加
入自己的算法以实现研究目的。
下面的程序(在abaya提供的程序上有小的修改)用compaq visual fortran编
译,可方便的实现从ANSYS生成文件*.full中提取结构质量、刚度矩阵。
注意:
1、必须需要ANSYS产生的 .full文件,并放置在程序所在的目录下;
2、修改mname、kname以使产生的质量刚度矩阵在相应的目录下;
3、必须利用modal ANTYPE,2,subspace ,MODOPT,SUBSP,nmode,0,0, ,ON
(nmode可以是任何数值);
4、如果想要得到刚体模态,模型必须没有约束;
5、经过检验,有超单元(beam188)、索单元(有预应力)、耦合自由度情况下,
ANSYS计算的模态分析结果与自编程序结果(质量、刚度矩阵利用提取的数据)
完全一致,振型的数值两者之比为一固定数。




论坛上好像太大的文件传不上去,我把源程序分成两部分分别上传,如下:

! !!!!!!!!!!!!!!!!!!(1)

program Extract

Use dflib
! USE NUMERICAL_LIBRARIES
USE MATRIXOUT_
USE MODE_SSPACE_
USE CONSTRAINTS_

external ihsort
external binset, binini, binrd, binclo, biniqr, bintfo
integer binset, biniqr
integer IOLENG, ROWLENG, WAVEFRONT, MAXNODE
parameter (IOLENG=16384, ROWLENG=1000, WAVEFRONT=10000,
x MAXNODE=100000)

integer ivect(100), npage, keyrw, units, code,
x nbuf,i, j, nunit, jloc, kbf, kext, n, lbuf, nmatrx,
x lll(ROWLENG), indx(ROWLENG),lenbac, nontp, numdof, irow,
x l(WAVEFRONT), nrow, mr, nterms, kunit, munit, kdof,
x baclst(MAXNODE), node, idof, sortlist(2,MAXNODE),
x nmass, nstif, nmax, lumpm ,inforunit

integer buffer(IOLENG)
double precision krow(ROWLENG), mrow(ROWLENG)

character*80 title(2)
character*106 pname,mname,kname,InforFileName
character*106 zmname,zkname !zhao xin
character*32 jobnam

integer iout,intpdp,lenfnm,reclng

c ***** arrays for reading file data *****
integer iarray(ROWLENG)
double precision darray(ROWLENG)
equivalence (darray(1),iarray(1))

INTEGER tonumdof, status, rnum, dofnum, nodnum, maxdof
INTEGER, ALLOCATABLE :: con(:,:), cacon(:), gcon(:), ccon(:)
REAL(8),ALLOCATABLE :: SMATRIX(:,:),MMATRIX(:,:),CMATRIX(:,:),
* F(:,:), RK(:,:), RF(:,:), RM(:,:)
TYPE (qwinfo) winfo
LOGICAL(4) result
LOGICAL FlagOutputBinaryForCompacted, FlagSubSpaceCal,
* FlagOutputForFullMatrix

c 程序控制部分
FlagOutputBinaryForCompacted=.TRUE.
FlagOutputForFullMatrix=.false.
FlagSubSpaceCal=.TRUE. ! 若FlagOutputForFullMatrix为false,
c FlagSubSpaceCal相当于也是false。

NROOT=18 !求解模态的个数

WRITE(*,'("矩阵提取程序")')
WRITE(*,'("用户请提供 .full文件,.full文件应当用ANSYS的
!subspace方法进行模态分析获得。")')
WRITE(*,'("模型的整体矩阵按两种格式输出:"/"
!FlagOutputBinaryForCompacted为true(false)时,生成MMatrix.dat、
!"/"KMatrix.dat的二进制文件(ASCII文件)存储质量、刚度压缩矩阵;
!"/"FlagOutputForFullMatrix为true(false)时,(不)生成MMatrixFull
!"/".txt、KMatrixFull.txt文本文件存储质量、刚度矩阵的完整形式。")')
WRITE(*,'("建议用户用写字板而不是notepad打开结果文件,
!",/,"不过最好是用TextPad打开,其次也可以用UltraEdit。")')

c ********** define the unit numbers **********
iout = 6
kunit = 2
munit = 3
inforunit=3
c ********** define the number of integers per double precision
intpdp = biniqr (0,2)
c ********** define the number of characters in the file name
lenfnm = biniqr (0,3)
c ********** define the i/0 buffer page length (integer*4 words)
reclng = biniqr (0,1)
c
c ********** define the file names **********

c zhao xin
! result = DISPLAYCURSOR ($GCURSORON)
winfo%TYPE = QWIN$MAX
result=SETWSIZEQQ(iout, winfo)

write(*,'("Pls input .full file (exclude extension)")')
write(*,'("请输入full文件名称(不含扩展名):"\)')
read(*,'(A106)') pname
zmname='MMatrixFull'
zkname='KMatrixFull'

CALL CLEARSCREEN ($GWINDOW)

mname = 'F:\xyz\Study\Fem\CalForStructure\PSD\CalPSD\MMatrix.dat'
kname = 'F:\xyz\Study\Fem\CalForStructure\PSD\CalPSD\KMatrix.dat'
InforFileName = 'F:\xyz\Study\Fem\CalForStructure\PSD\CalPSD\
xStructureInfor.inf'
c mname = 'MMatrix.dat'
c kname = 'KMatrix.dat'

pname=trim(pname)//'.full'
c
c ********** initialize the bin routines **********
call binini (iout)
c
c ********** initialize the header common **********
title(1) = 'New title as given by ROM'
title(2) = 'New subtitle as given by ROM'
jobnam = 'file '
units = 0
c --- the value for code below should be changed to appropriate 3rd party code
code = 200
call bintfo (title,jobnam,units,code)

c
c ********** open the file **********
c
c ***** set the i/o unit number
nunit =7
c ***** define buffer number *****
nbuf = 1
c ***** start address in the buffer *****
lbuf = 1
c ***** number of pages for nbuf *****
npage = 1
c ***** read key *****
keyrw = 1
c ***** length of each page *****
j = reclng
c ***** read external file format *****
kext = 1
c
i = binset (nbuf,nunit,keyrw,lbuf,j,npage,pname,lenfnm,kext,
x buffer(1))
c
c ***** check for error *****
if (i .ne. 0) then
write (iout,2004) trim(pname)
2004 format (/' *** ERROR ***'/' DATA FILE ',a,' DOES NOT EXIST ')
stop
go to 999
end if

c ********** open the ASCII files **********
if (FlagOutputBinaryForCompacted) then
open (unit=kunit,file=kname,status='unknown',form='binary')
open (unit=munit,file=mname,status='unknown',form='binary')
else
open (unit=kunit,file=kname,status='unknown')
open (unit=munit,file=mname,status='unknown')
end if
rewind kunit
rewind munit

write (iout,2000) trim(pname), trim(mname), trim(kname)
2000 format (/' ***** WRITE OUT ANSYS MATRICES FROM ',A15,
x ' *****'//' MASS MATRIX ON FILE = ',A60/
x ' STIFFNESS MATRIX ON FILE = ',A60//
x ' Only the symmetric part of the matrices is written')

c ***** file header *****
n = 100
jloc = 0
call binrd (nbuf,jloc,n,ivect(1),kbf,buffer(1))

n = 20
call binrd (nbuf,jloc,n,ivect(1),kbf,buffer(1))

numdof = ivect(8) !每个节点的自由度数目
lenbac = ivect(7) !节点个数
nontp = ivect(2) !
nmatrx = ivect(4) !
lumpm = ivect(11) !是否输出一致质量矩阵(0:一致质量矩阵;1:集中
!质量矩阵)

C ZHAO XIN

! ALLOCATE (SMATRIX(nontp,nontp),MMATRIX(nontp,nontp),
! * CMATRIX(nontp,nontp))
tonumdof=numdof*lenbac !最大自由度编号
if (FlagOutputForFullMatrix) then
ALLOCATE (SMATRIX(tonumdof,tonumdof),MMATRIX(tonumdof,tonumdof),
* CMATRIX(tonumdof,tonumdof))
SMATRIX=0
MMATRIX=0
CMATRIX=0
end if
C ZHAO XIN

write (iout,2001) numdof,lenbac,lumpm
2001 format(/' Number of DOF per node=',i6/
x ' Number of nodes =',i6/
x ' Lumped mass flag =',i6)

n = numdof
call binrd (nbuf,jloc,n,ivect(1),kbf,buffer(1))

n = lenbac
call binrd (nbuf,jloc,n,baclst(1),kbf,buffer(1))

c ********** compress nodes into grid point order *********
nmax = 0
do i = 1,lenbac
sortlist(1,i) = baclst(i)
sortlist(2,i) = i
if (baclst(i) .gt. nmax) nmax = baclst(i)
enddo
write (iout,2002) nmax
2002 format (' Maximum node number =',i6)
call ihsort (2,lenbac,sortlist(1,1),1)
do i = 1,lenbac
sortlist(1,i) = i
enddo
call ihsort (2,lenbac,sortlist(1,1),2)
do i = 1,lenbac
baclst(i) = sortlist(1,i)
enddo

c ***** put headers on the files *****
c write (kunit,2010) kname, pname
2010 format ('# ',A30/'#'/'# FROM ANSYS FILE: ',A30/'#')
c write (munit,2011) mname, pname
2011 format ('# ',A30/'#'/'# FROM ANSYS FILE: ',A30/'#')

nmass = 0
nstif = 0
nrow = 0
do irow = 1,nontp

n = 10
call binrd (nbuf,jloc,n,lll(1),kbf,buffer(1))
mr = lll(1)
kdof = abs(lll(2))
node = (kdof-1)/numdof
idof = kdof - node*numdof
node = baclst(node+1)
kdof = (node-1)*numdof + idof
do i = 3,n
nrow = nrow + 1
l(nrow) = lll(i)
enddo

  原贴位置:
   http://www.wind-eng.org/bbs/posting.php?mode=topicreview&t=73
 楼主| 发表于 2006-12-5 21:45 | 显示全部楼层
--------------------------------------------------------------------------------

进行研究工作中有时 ... [/quote]
发现你给的程序不完整,不过谢谢你提供的线索。我找到了完整的版本。现在附在下面,希望对有同样需要的人有帮助。

program Extract

Use dflib
! USE NUMERICAL_LIBRARIES
USE MATRIXOUT_
USE MODE_SSPACE_
USE CONSTRAINTS_

external ihsort
external binset, binini, binrd, binclo, biniqr, bintfo
integer binset, biniqr
integer IOLENG, ROWLENG, WAVEFRONT, MAXNODE
parameter (IOLENG=16384, ROWLENG=1000, WAVEFRONT=10000,
x MAXNODE=100000)

integer ivect(100), npage, keyrw, units, code,
x nbuf,i, j, nunit, jloc, kbf, kext, n, lbuf, nmatrx,
x lll(ROWLENG), indx(ROWLENG),lenbac, nontp, numdof, irow,
x l(WAVEFRONT), nrow, mr, nterms, kunit, munit, kdof,
x baclst(MAXNODE), node, idof, sortlist(2,MAXNODE),
x nmass, nstif, nmax, lumpm ,inforunit

integer buffer(IOLENG)
double precision krow(ROWLENG), mrow(ROWLENG)

character*80 title(2)
character*106 pname,mname,kname,InforFileName
character*106 zmname,zkname !zhao xin
character*32 jobnam

integer iout,intpdp,lenfnm,reclng

c ***** arrays for reading file data *****
integer iarray(ROWLENG)
double precision darray(ROWLENG)
equivalence (darray(1),iarray(1))

INTEGER tonumdof, status, rnum, dofnum, nodnum, maxdof
INTEGER, ALLOCATABLE :: con(:,:), cacon(:), gcon(:), ccon(:)
REAL(8),ALLOCATABLE :: SMATRIX(:,:),MMATRIX(:,:),CMATRIX(:,:),
* F(:,:), RK(:,:), RF(:,:), RM(:,:)
TYPE (qwinfo) winfo
LOGICAL(4) result
LOGICAL FlagOutputBinaryForCompacted, FlagSubSpaceCal,
* FlagOutputForFullMatrix

c 程序控制部分
FlagOutputBinaryForCompacted=.TRUE.
FlagOutputForFullMatrix=.false.
FlagSubSpaceCal=.TRUE. ! 若FlagOutputForFullMatrix为false,
c FlagSubSpaceCal相当于也是false。

NROOT=18 !求解模态的个数

WRITE(*,'("矩阵提取程序")')
WRITE(*,'("用户请提供 .full文件,.full文件应当用ANSYS的
!subspace方法进行模态分析获得。")')
WRITE(*,'("模型的整体矩阵按两种格式输出:"/"
!FlagOutputBinaryForCompacted为true(false)时,生成MMatrix.dat、
!"/"KMatrix.dat的二进制文件(ASCII文件)存储质量、刚度压缩矩阵;
!"/"FlagOutputForFullMatrix为true(false)时,(不)生成MMatrixFull
!"/".txt、KMatrixFull.txt文本文件存储质量、刚度矩阵的完整形式。")')
WRITE(*,'("建议用户用写字板而不是notepad打开结果文件,
!",/,"不过最好是用TextPad打开,其次也可以用UltraEdit。")')

c ********** define the unit numbers **********
iout = 6
kunit = 2
munit = 3
inforunit=3
c ********** define the number of integers per double precision
intpdp = biniqr (0,2)
c ********** define the number of characters in the file name
lenfnm = biniqr (0,3)
c ********** define the i/0 buffer page length (integer*4 words)
reclng = biniqr (0,1)
c
c ********** define the file names **********

c zhao xin
! result = DISPLAYCURSOR ($GCURSORON)
winfo%TYPE = QWIN$MAX
result=SETWSIZEQQ(iout, winfo)

write(*,'("Pls input .full file (exclude extension)")')
write(*,'("请输入full文件名称(不含扩展名):"\)')
read(*,'(A106)') pname
zmname='MMatrixFull'
zkname='KMatrixFull'

CALL CLEARSCREEN ($GWINDOW)

mname = 'F:\xyz\Study\Fem\CalForStructure\PSD\CalPSD\MMatrix.dat'
kname = 'F:\xyz\Study\Fem\CalForStructure\PSD\CalPSD\KMatrix.dat'
InforFileName = 'F:\xyz\Study\Fem\CalForStructure\PSD\CalPSD\
xStructureInfor.inf'
c mname = 'MMatrix.dat'
c kname = 'KMatrix.dat'

pname=trim(pname)//'.full'
c
c ********** initialize the bin routines **********
call binini (iout)
c
c ********** initialize the header common **********
title(1) = 'New title as given by ROM'
title(2) = 'New subtitle as given by ROM'
jobnam = 'file '
units = 0
c --- the value for code below should be changed to appropriate 3rd party code
code = 200
call bintfo (title,jobnam,units,code)

c
c ********** open the file **********
c
c ***** set the i/o unit number
nunit =7
c ***** define buffer number *****
nbuf = 1
c ***** start address in the buffer *****
lbuf = 1
c ***** number of pages for nbuf *****
npage = 1
c ***** read key *****
keyrw = 1
c ***** length of each page *****
j = reclng
c ***** read external file format *****
kext = 1
c
i = binset (nbuf,nunit,keyrw,lbuf,j,npage,pname,lenfnm,kext,
x buffer(1))
c
c ***** check for error *****
if (i .ne. 0) then
write (iout,2004) trim(pname)
2004 format (/' *** ERROR ***'/' DATA FILE ',a,' DOES NOT EXIST ')
stop
go to 999
end if

c ********** open the ASCII files **********
if (FlagOutputBinaryForCompacted) then
open (unit=kunit,file=kname,status='unknown',form='binary')
open (unit=munit,file=mname,status='unknown',form='binary')
else
open (unit=kunit,file=kname,status='unknown')
open (unit=munit,file=mname,status='unknown')
end if
rewind kunit
rewind munit

write (iout,2000) trim(pname), trim(mname), trim(kname)
2000 format (/' ***** WRITE OUT ANSYS MATRICES FROM ',A15,
x ' *****'//' MASS MATRIX ON FILE = ',A60/
x ' STIFFNESS MATRIX ON FILE = ',A60//
x ' Only the symmetric part of the matrices is written')

c ***** file header *****
n = 100
jloc = 0
call binrd (nbuf,jloc,n,ivect(1),kbf,buffer(1))

n = 20
call binrd (nbuf,jloc,n,ivect(1),kbf,buffer(1))

numdof = ivect(8) !每个节点的自由度数目
lenbac = ivect(7) !节点个数
nontp = ivect(2) !
nmatrx = ivect(4) !
lumpm = ivect(11) !是否输出一致质量矩阵(0:一致质量矩阵;1:集中
!质量矩阵)

C ZHAO XIN

! ALLOCATE (SMATRIX(nontp,nontp),MMATRIX(nontp,nontp),
! * CMATRIX(nontp,nontp))
tonumdof=numdof*lenbac !最大自由度编号
if (FlagOutputForFullMatrix) then
ALLOCATE (SMATRIX(tonumdof,tonumdof),MMATRIX(tonumdof,tonumdof),
* CMATRIX(tonumdof,tonumdof))
SMATRIX=0
MMATRIX=0
CMATRIX=0
end if
C ZHAO XIN

write (iout,2001) numdof,lenbac,lumpm
2001 format(/' Number of DOF per node=',i6/
x ' Number of nodes =',i6/
x ' Lumped mass flag =',i6)

n = numdof
call binrd (nbuf,jloc,n,ivect(1),kbf,buffer(1))

n = lenbac
call binrd (nbuf,jloc,n,baclst(1),kbf,buffer(1))

c ********** compress nodes into grid point order *********
nmax = 0
do i = 1,lenbac
sortlist(1,i) = baclst(i)
sortlist(2,i) = i
if (baclst(i) .gt. nmax) nmax = baclst(i)
enddo
write (iout,2002) nmax
2002 format (' Maximum node number =',i6)
call ihsort (2,lenbac,sortlist(1,1),1)
do i = 1,lenbac
sortlist(1,i) = i
enddo
call ihsort (2,lenbac,sortlist(1,1),2)
do i = 1,lenbac
baclst(i) = sortlist(1,i)
enddo

c ***** put headers on the files *****
c write (kunit,2010) kname, pname
2010 format ('# ',A30/'#'/'# FROM ANSYS FILE: ',A30/'#')
c write (munit,2011) mname, pname
2011 format ('# ',A30/'#'/'# FROM ANSYS FILE: ',A30/'#')

nmass = 0
nstif = 0
nrow = 0
do irow = 1,nontp

n = 10
call binrd (nbuf,jloc,n,lll(1),kbf,buffer(1))
mr = lll(1)
kdof = abs(lll(2))
node = (kdof-1)/numdof
idof = kdof - node*numdof
node = baclst(node+1)
kdof = (node-1)*numdof + idof
do i = 3,n
nrow = nrow + 1
l(nrow) = lll(i)
enddo

nterms = 10
call binrd (nbuf,jloc,nterms,indx(1),kbf,buffer(1))
do i = 1,nterms
idof = l(indx(i))
node = (idof-1)/numdof
idof = idof - node*numdof
node = baclst(node+1)
lll(i) = (node-1)*numdof + idof
enddo
n = 10
call binrd (nbuf,jloc,n,krow(1),kbf,buffer(1))
i = 1
if (lumpm .ge. 1) i = 2
n = n/intpdp-i

do i = 1,n
if (krow(i) .ne. 0.0d0) then
nstif = nstif + 1
if (kdof .lt. lll(i)) then

if (FlagOutputBinaryForCompacted) then
write (kunit) kdof,lll(i),krow(i)
else
write (kunit,2005) kdof,lll(i),krow(i)
end if

c ZHAOXIN 构造完整的出刚度矩阵
if (FlagOutputForFullMatrix) then
SMATRIX(kdof,lll(i))=krow(i)
SMATRIX(lll(i),kdof)=krow(i)
end if
c END OF ZHAOXIN

else

if (FlagOutputBinaryForCompacted) then
write (kunit) lll(i),kdof,krow(i)
else
write (kunit,2005) lll(i),kdof,krow(i)
end if
c ZHAOXIN 构造完整的出刚度矩阵
if (FlagOutputForFullMatrix) then
SMATRIX(kdof,lll(i))=krow(i)
SMATRIX(lll(i),kdof)=krow(i)
end if
c END OF ZHAOXIN

endif
endif
enddo

if (nmatrx.gt.1 .and. lumpm.eq.0) then
n = 10
call binrd (nbuf,jloc,n,mrow(1),kbf,buffer(1))
n = n/intpdp
do i = 1,n
if (mrow(i) .ne. 0.0d0) then
nmass = nmass + 1
if (kdof .lt. lll(i)) then
if (FlagOutputBinaryForCompacted) then
write (munit) kdof,lll(i),mrow(i)
else
write (munit,2005) kdof,lll(i),mrow(i)
end if
c ZHAOXIN 构造完整的一致质量矩阵
if (FlagOutputForFullMatrix) then
MMATRIX(kdof,lll(i))=mrow(i)
MMATRIX(lll(i),kdof)=mrow(i)
end if
c END OF ZHAOXIN

2005 format (2i8,1pe20.12)
else
if (FlagOutputBinaryForCompacted) then
write (munit) lll(i),kdof,mrow(i)
else
write (munit,2005) lll(i),kdof,mrow(i)
end if
c ZHAOXIN
if (FlagOutputForFullMatrix) then
MMATRIX(kdof,lll(i))=mrow(i)
MMATRIX(lll(i),kdof)=mrow(i)
end if
c END OF ZHAOXIN

endif
endif
enddo
else
mrow(1) = krow(n+2)
if (mrow(1) .ne. 0.0d0) then
nmass = nmass + 1
if (FlagOutputBinaryForCompacted) then
write (munit) kdof,kdof,mrow(1)
else
write (munit,2005) kdof,kdof,mrow(1)
end if

c ZHAOXIN 构造完整的集中质量矩阵
if (FlagOutputForFullMatrix) then
MMATRIX(kdof,kdof)=mrow(1)
end if
c END OF ZHAOXIN

endif
endif

l(mr) = l(nrow)
l(nrow) = 0
nrow = nrow - 1

enddo

close (unit=kunit,status='keep')
close (unit=munit,status='keep')

write (iout,2008) nmass, nstif
2008 format (/' Number of mass matrix terms =',i8/
x ' Number of stiffness matrix terms=',i8)
999 call binclo (nbuf,'KEEP',buffer(1))

c zhao xin 输出到文件

zmname=trim(zmname); zkname=trim(zkname)
write (iout,2100) zmname, zkname
2100 format (/' ***** 由ANSYS的FULL文件读取整体矩阵',
x ' *****'//' 质量矩阵写入文件:',A30/
x ' 刚度矩阵写入文件:',A30)

write (iout,2101) numdof,lenbac,lumpm,nmax,tonumdof
2101 format(/' 每个节点的自由度数目 =',i6/
x ' 节点个数 =',i6/
x ' 是否是集中质量矩阵 =',i6,'(0:一致质量矩阵;
x1:集中质量矩阵)'/
x ' 最大节点编号 =',i6/
x ' 最大自由度编号 =',i6/)

! CALL SCROLLTEXTWINDOW( INT2(5 ))
if (FlagOutputForFullMatrix) then
CALL MATRIXOUT (SMATRIX,zkname)
CALL MATRIXOUT (MMATRIX,zmname)
end if

c 输出结构信息文件
open (unit=inforunit,file=InforFileName,status='unknown')
rewind inforunit
write (inforunit,2102) numdof,lenbac
2102 format(/' 每个节点的自由度数目',/i6
x / ' 节点个数'/,i6)

close (unit=inforunit,status='keep')


! 约束信息(包括真正的位移0约束和未使用到的活动自由度)
if (FlagOutputForFullMatrix) then

dofnum=tonumdof
nodnum=lenbac
fin=20
OPEN(UNIT=fin,FILE='CONSTRAINT.TXT',STATUS='OLD')

maxdof=numdof
ALLOCATE(con(maxdof,nodnum))
con=0
DO i=1,nodnum
READ(fin,'(6I5)',advance='YES',eor=14) (con(j,i),j=1,maxdof)
14 END DO

! 约束信息合并为向量
ALLOCATE(cacon(dofnum))
cacon=0
DO i=1,nodnum
cacon(maxdof*(i-1)+1:maxdof*i)=con(:,i)
END DO

nt=1
! 施加边界约束(对整体矩阵进行缩减)
! Reducing model matrix using constraint information

rnum=REDUCEDNUMBER(cacon)
ALLOCATE (RK(rnum,rnum),RF(rnum,nt),RM(rnum,rnum),
* ccon(rnum), gcon(dofnum),F(dofnum,nt))
RK=0.; RM=0.; RC=0.; RF=0.;
CALL REDUCTION(cacon,SMATRIX,F,RK,RF,rnum,ccon)
CALL REDUCTION(cacon,MMATRIX,F,RM,RF,rnum,ccon)

CALL MATRIXOUT (RK,'RK')
CALL MATRIXOUT (RM,'RM')


! 确定整体矩阵中的各自由度在缩减后矩阵中的位置
gcon=0
DO i=1,rnum
gcon(ccon(i))=i
END DO

if (FlagSubSpaceCal) then
CALL MODE_SSPACE (RM, RK, lumpm, NROOT)
end if
close (unit=fin,status='keep')
end if !if (FlagOutputForFullMatrix) then

c zhao xin 输出到文件
! MESSAGE=MESSAGEBOXQQ('SOLUTION IS DONE!', 'TRANSIENT ANALYSIS',
! * MB$ICONQUESTION.OR.MB$YESNO.OR.MB$DEFBUTTON1)
! DO WHILE (.TRUE.)
! END DO

end

subroutine ihsort (nper,n,table,iloc)
c *** primary function: quick heap sort of an integer table

c input arguments:
c nper (int,sc,in) - number of terms
c n (int,sc,in) - number of items in the table
c table (int,ar(nper,n),inout) - the table to be sorted
c iloc (int,sc,in) - location in table for sort

c output arguments:
c table (int,ar(nper,n),inout) - the sorted table


integer nper, n, table(nper,n), iloc, i,j,k,l,m, hold, ip

m = n
10 m = m/2
if (m .eq. 0) go to 50
k = n - m
j = 1
20 i = j
30 l = i + m
if (table(iloc,i) .le. table(iloc,l)) go to 40
do ip = 1,nper
hold = table(ip,i)
table(ip,i) = table(ip,l)
table(ip,l) = hold
enddo
i = i - m
if (i .ge. 1) go to 30
40 j = j + 1
if (j .gt. k) go to 10
go to 20

50 return
end
enddo
发表于 2006-12-6 10:03 | 显示全部楼层
谢谢 junstin了。
      我忘记后半部分了。
发表于 2006-12-9 00:26 | 显示全部楼层
其实可以在ansys环境下,list二进制文件,不过list出来的格式不好看
发表于 2007-1-9 08:39 | 显示全部楼层
其实在adina下提取这两个矩阵很容易,
直接生成他的一维变带宽存储格式。
发表于 2008-7-11 12:02 | 显示全部楼层
還收藏慢慢看,暈,等你學會看完,人家用adina都算了好幾年了。除非你是搞開發的。哈哈
发表于 2008-10-23 19:12 | 显示全部楼层

真的太厉害了

可是我不知道怎么用?
把程序下来了也老出问题,怎么回事呢?
发表于 2008-10-27 15:04 | 显示全部楼层
很深奥啊!对于没有写过程序的人来讲比较困难啊!
发表于 2010-6-1 10:52 | 显示全部楼层
程序中涉及很多的子程序调用,但是后面只有一个子程序的声明,是不是漏掉了,本人刚从事二次开发,希望和同道中人交流
发表于 2010-6-2 10:58 | 显示全部楼层

回复 9楼 portis 的帖子

你好朋友 请问什么是andian? 可不可以介绍一下啊! 谢谢你
发表于 2010-6-2 11:00 | 显示全部楼层

回复 7楼 linqus 的帖子

元老你好 呵呵 我想请问一下 你说的这个软件是不是可以和ansys兼容? 或者说 我就只用这个来进行提取刚度矩阵之类的? 这个软件你们一般都用来干什么啊?主要是目前我们发表论或者做一些项目都需要用ansys !
发表于 2010-6-3 22:33 | 显示全部楼层
发表于 2010-6-7 21:46 | 显示全部楼层

USE MODE_SSPACE_ USE CONSTRAINTS_ 没有啊?

我在编译的时候提示没有modesspace和constrain的module啊,本人初学 泣血求高手指点,这两个模块在哪里找啊?
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-23 11:20 , Processed in 0.106020 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表