声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 8649|回复: 12

[前后处理] [分享]ANSYS中整体、单元刚度和质量矩阵的提取

[复制链接]
发表于 2005-8-23 08:51 | 显示全部楼层 |阅读模式

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

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

x
1、整体刚度和质量矩阵的提取。
该功能需要进行二次开发,由ansys形成
的二进制文件.full提取整体刚度和质量
矩阵。

基于ansys的一个用户开发程序例子编
了一个程序。

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

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

2、单元刚度和质量矩阵的提取。
/DEBUG命令。详细说明可由以下转载文章
获得:
发信人: tomath1 (雨天), 信区: FEA
标 题: Re: ANSYS中命令/DEBUG那儿有
发信站: BBS 水木清华站 (Thu Jun 27 14:28:51 2002)
  1. finish
  2. /clear

  3. PI=3.1415926

  4. w1=3
  5. w2=10
  6. w3=6
  7. w4=1.2
  8. r=.8
  9. t=0.08

  10. /PREP7
  11. !*
  12. ET,1,SHELL63
  13. R,1,t

  14. ET,2,MASS21
  15. R,2,500,500,500,2000,2000,2000,
  16. !*
  17. UIMP,1,EX, , ,2e11
  18. UIMP,1,NUXY, , ,0.3,
  19. UIMP,1,DAMP, , ,0.2,
  20. UIMP,1,DENS, , ,7800,

  21. BLC4,0,0,w2,w1
  22. ESIZE,1.5,0,
  23. AMESH,all

  24. NSEL,S,LOC,X,0.0
  25. D,all, , , , , ,ALL, , , , ,

  26. allsel,all
  27. SFA,all,1,PRES,12
  28. FINISH

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

  31. /SOLU
  32. SOLVE
  33. finish

  34. /OUTPUT, TERM ! 将输出信息送到output windows中
复制代码
! 这时用编辑器打开cp.out文件,可以看到按单元写出的质量、刚度等矩阵

[ 本帖最后由 xinyuxf 于 2007-5-4 10:23 编辑 ]
回复
分享到:

使用道具 举报

发表于 2005-9-12 10:08 | 显示全部楼层
请教一下,这个提取刚度矩阵的程序怎样才能运行,必须装Fortran吗?
发表于 2005-9-12 10:27 | 显示全部楼层
another method:

HBMAT, Fname, Ext, --, Form, Matrx, Rhs
Writes an assembled global matrix in Harwell-Boeing format
发表于 2005-9-12 16:19 | 显示全部楼层

请教

我一下载完上面的压缩程序,在Fortran下运行时出现:
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: matrixout - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating command line "link.exe kernel32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/matrixout.pdb" /debug /machine:I386 /out:"Debug/matrixout.exe" /pdbtype:sept ".\Debug\matrixout.obj" ".\Debug\SELF.OBJ" "
<h3>Output Window</h3>
Linking...
SELF.OBJ : error LNK2001: unresolved external symbol _BINIQR@8
SELF.OBJ : error LNK2001: unresolved external symbol _BININI@4
SELF.OBJ : error LNK2001: unresolved external symbol _BINTFO@24
SELF.OBJ : error LNK2001: unresolved external symbol _BINSET@44
SELF.OBJ : error LNK2001: unresolved external symbol _BINRD@24
SELF.OBJ : error LNK2001: unresolved external symbol _BINCLO@16
Debug/matrixout.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

<h3>Results</h3>
matrixout.exe - 7 error(s), 0 warning(s)
</pre>
</body>
</html>
什么问题,不懂Fortran


谢谢
发表于 2005-9-12 18:34 | 显示全部楼层

回复:(jl_zxw)请教

binlib.lib为ansys提供的库文件,将其
引入项目中(也可直接扔进debug目录)
发表于 2006-5-9 11:45 | 显示全部楼层

回复:(van321)[分享]ANSYS中整体、单元刚度和质量矩...

我用HBMAT方法生成质量矩阵文件(文本文件格式)内容如下,看不懂啊

Mass matrix from ANSYS FULL file dumped into Harwell-Boeing format
49 9 16 16 8
RSA 8 8 16 0
(I14) (I14) (d25.15) (d25.15)
F 1 8
1
3
6
8
11
14
15
16
17
3
1
4
5
2
6
3
7
8
4
7
8
5
6
7
8
0.166666666666667D+00
0.333333333333333D+00
-0.690476190476191D-01
-0.404761904761905D-01
0.142857142857143D+00
0.166666666666667D+00
0.666666666666667D+00
-0.107142857142857D+01
0.690476190476191D-01
0.314285714285714D+01
-0.690476190476191D-01
-0.404761904761905D-01
0.285714285714286D+00
0.666666666666667D+00
0.314285714285714D+01
0.285714285714286D+00
0.000000000000000D+00
0.000000000000000D+00
0.000000000000000D+00
0.000000000000000D+00
0.000000000000000D+00
0.000000000000000D+00
0.000000000000000D+00
0.000000000000000D+00
谁能帮我解释一下这里面的数字对应质量矩阵中的哪行哪列啊?
感谢万分!!
发表于 2006-5-9 14:59 | 显示全部楼层
The Harwell-Boeing format is the most popular mechanism for text-file exchange of sparse matrix data. The following information, taken from [ftp://ftp.cerfacs.fr/pub/harwell_boeing/userguide.ps.Z User's Guide for the Harwell-Boeing Sparse Matrix Collection] provides a specification for this format. Matrix data is held in an 80-column, fixed-length format for portability. Each matrix begins with a multiple line header block, which is followed by two, three, or four data blocks. The header block contains summary information on the storage formats and space requirements. From the header block alone, the user can determine how much space will be required to store the matrix. Information on the size of the representation in lines is given for ease in skipping past unwanted data.

If there are no right-hand-side vectors, the matrix has a four-line header block followed by two or three data blocks containing, in order, the column (or element) start pointers, the row (or variable) indices, and the numerical values. If right-hand sides are present, there is a fifth line in the header block and a fourth data block containing the right-hand side(s). The blocks containing the numerical values and right-hand side(s) are optional. The right-hand side(s) can be present only when the numerical values are present. If right-hand sides are present, then vectors for starting guesses and the solution can also be present; if so, they appear as separate full arrays in the right-hand side block following the right-hand side vector(s).

The first line contains the 72-character title and the 8-character identifier by which the matrix is referenced in our documentation. The second line contains the number of lines for each of the following data blocks as well as the total number of lines, excluding the header block. The third line contains a three character string denoting the matrix type as well as the number of rows, columns (or elements), entries, and, in the case of unassembled matrices, the total number of entries in elemental matrices. The fourth line contains the variable Fortran formats for the following data blocks. The fifth line is present only if there are right-hand sides. It contains a one character string denoting the storage format for the right-hand sides as well as the number of right-hand sides, and the number of row index entries (for the assembled case). The exact format is given by the following, where the names of the Fortran variables in the subsequent programs are given in parenthesis:



Line1 (A72,A8)

Col. 1 - 72 Title (TITLE)

Col. 73 - 80 Key (KEY)


Line 2 (5I14)

Col. 1 - 14 Total number of lines excluding header (TOTCRD)

Col. 15 - 28 Number of lines for pointers (PTRCRD)

Col. 29 - 42 Number of lines for row (or variable) indices (INDCRD)

Col. 43 - 56 Number of lines for numerical values (VALCRD)

Col. 57 - 70 Number of lines for right-hand sides (RHSCRD) (including starting guesses and solution vectors if present) (zero indicates no right-hand side data is present)

Line 3 (A3, 11X, 4I14)

Col. 1 - 3 Matrix type (see below) (MXTYPE)

Col. 15 - 28 Number of rows (or variables) (NROW)

Col. 29 - 42 Number of columns (or elements) (NCOL)

Col. 43 - 56 Number of row (or variable) indices (NNZERO) (equal to number of entries for assembled matrices)

Col. 57 - 70 Number of elemental matrix entries (NELTVL) (zero in the case of assembled matrices)

Line 4 (2A16, 2A20)

Col. 1 - 16 Format for pointers (PTRFMT)

Col. 17 - 32 Format for row (or variable) indices (INDFMT)

Col. 33 - 52 Format for numerical values of coefficient matrix (VALFMT)

Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT)

Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present

Col. 1 Right-hand side type: F for full storage or M for same format as matrix

Col. 2 G if a starting vector(s) (Guess) is supplied. (RHSTYP)

Col. 3 X if an exact solution vector(s) is supplied.

Col. 15 - 28 Number of right-hand sides (NRHS)

Col. 29 - 42 Number of row indices (NRHSIX) (ignored in case of unassembled matrices)
Note: For matrices in elemental form, the leading two dimensions in the header give the number of variables in the finite element application and the number of elements. It is common that not all of the variables in the application appear in the linear algebra subproblem; hence the matrix represented can be of lower order than the first parameter, described as the "number of variables (NROW)". The finite element variables are numbered from 1 to NROW, but only the subset of variables that actually appear in the list of variables for the elements define the rows and columns of the matrix. The actual order of the square matrix cannot be determined until all of the indices are read.


The three character type field on line 3 describes the matrix type. The following table lists the permitted values for each of the three characters. As an example of the type field, RSA denotes that the matrix is real, symmetric, and assembled.



First Character:

R Real matrix

C Complex matrix

P Pattern only (no numerical values supplied)

Second Character:

S Symmetric

U Unsymmetric

H Hermitian

Z Skew symmetric

R Rectangular

Third Character:

A Assembled

E Elemental matrices (unassembled)
把这个文献看懂,就能搞定什么意思了
发表于 2006-5-9 17:52 | 显示全部楼层

这都能办到啊!

我真是没想到还能把这个也导出.
楼主英明啊!
发表于 2006-5-11 14:13 | 显示全部楼层
感谢qq6764770!
研究研究先。
发表于 2009-2-12 11:16 | 显示全部楼层

得到matrixout.exe文件后,运行该文件出错

提取整体刚度矩阵中,成功build 程序self.for和matrixout.f90后得到matrixout.exe,但是运行matrixout.exe出现错误:程序未能找到binlib.dll,因此未能成功启动。
请问这是什么原因呢?急啊!
发表于 2009-2-12 14:26 | 显示全部楼层

得到matrixout.exe文件后,运行该文件无错误但不见了

提取整体刚度矩阵中,成功build 程序self.for和matrixout.f90后得到matrixout.exe,运行matrixout.exe,之后就不见了。结果在哪里啊?
发表于 2009-5-27 16:09 | 显示全部楼层
附件没有了?:@(
发表于 2016-9-18 15:02 | 显示全部楼层
请问楼主还有附件吗?真是不懂呀
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-11-25 00:49 , Processed in 0.057326 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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