求教如何用pcl程序提取单元应力
本帖最后由 r010510429 于 2010-10-18 17:24 编辑我想问一下大虾们,patran里面有没有pcl函数可以提取单元应力?我见有提到res_utl_extract_elem_results()这个函数的但是没有说怎么用。
实在不行,有没有那个函数能从f06文件读特定的某行某列的值?
下面是我部分的fo6文件内容
*** USER WARNING MESSAGE 4124 (IFS3P)
THE SPCADD OR MPCADD UNION CONSISTS OF A SINGLE SET.
M O D E L S U M M A R Y
NUMBER OF GRID POINTS = 1029
NUMBER OF CQUAD4 ELEMENTS = 960
S T R E S S E S I N Q U A D R I L A T E R A L E L E M E N T S ( Q U A D 4 ) OPTION = BILIN
S T R E S S E S I N Q U A D R I L A T E R A L E L E M E N T S ( Q U A D 4 ) OPTION = BILIN
ELEMENT FIBER STRESSES IN ELEMENT COORD SYSTEM PRINCIPAL STRESSES (ZERO SHEAR)
ID GRID-ID DISTANCE NORMAL-X NORMAL-Y SHEAR-XY ANGLE MAJOR MINOR VON MISES
0 1 CEN/4-4.500000E+00-2.963839E+01 -4.281418E+00 -5.902997E+00 -77.5169-2.974577E+00 -3.094523E+012.957037E+01
4.500000E+00-2.963839E+01 -4.281418E+00 -5.902997E+00 -77.5169-2.974577E+00 -3.094523E+012.957037E+01
1-4.500000E+00-3.727917E+01 -7.409598E+00 -5.902997E+00 -79.2168-6.285330E+00 -3.840344E+013.567844E+01
4.500000E+00-3.727917E+01 -7.409598E+00 -5.902997E+00 -79.2168-6.285330E+00 -3.840344E+013.567844E+01
2-4.500000E+00-3.727917E+01 -1.153238E+00 -5.902997E+00 -80.9513-2.131488E-01 -3.821926E+013.811313E+01
4.500000E+00-3.727917E+01 -1.153238E+00 -5.902997E+00 -80.9513-2.131488E-01 -3.821926E+013.811313E+01
23-4.500000E+00-2.199761E+01 -1.153238E+00 -5.902997E+00 -75.2367 4.023605E-01 -2.355321E+012.375695E+01
4.500000E+00-2.199761E+01 -1.153238E+00 -5.902997E+00 -75.2367 4.023605E-01 -2.355321E+012.375695E+01
22-4.500000E+00-2.199761E+01 -7.409598E+00 -5.902997E+00 -70.5085-5.320221E+00 -2.408699E+012.191666E+01
4.500000E+00-2.199761E+01 -7.409598E+00 -5.902997E+00 -70.5085-5.320221E+00 -2.408699E+012.191666E+01
0 2 CEN/4-4.500000E+00-2.324241E+01 -3.351163E-01 -2.590058E+00 -83.6289-4.591740E-02 -2.353161E+012.350869E+01
4.500000E+00-2.324241E+01 -3.351163E-01 -2.590058E+00 -83.6289-4.591740E-02 -2.353161E+012.350869E+01
2-4.500000E+00-2.459261E+014.457566E-01 -2.590058E+00 -84.1556 7.108743E-01 -2.485772E+012.522068E+01
4.500000E+00-2.459261E+014.457566E-01 -2.590058E+00 -84.1556 7.108743E-01 -2.485772E+012.522068E+01
3-4.500000E+00-2.459261E+01 -1.115989E+00 -2.590058E+00 -83.7785-8.336368E-01 -2.487496E+012.446879E+01
4.500000E+00-2.459261E+01 -1.115989E+00 -2.590058E+00 -83.7785-8.336368E-01 -2.487496E+012.446879E+01
24-4.500000E+00-2.189222E+01 -1.115989E+00 -2.590058E+00 -83.0000-7.979689E-01 -2.221024E+012.182220E+01
4.500000E+00-2.189222E+01 -1.115989E+00 -2.590058E+00 -83.0000-7.979689E-01 -2.221024E+012.182220E+01
23-4.500000E+00-2.189222E+014.457566E-01 -2.590058E+00 -83.4720 7.421379E-01 -2.218860E+012.256882E+01
4.500000E+00-2.189222E+014.457566E-01 -2.590058E+00 -83.4720 7.421379E-01 -2.218860E+012.256882E+01
0 3 CEN/4-4.500000E+00-1.917063E+01 -3.162608E-01 -1.751087E+00 -84.7387-1.550088E-01 -1.933188E+011.925484E+01
4.500000E+00-1.917063E+01 -3.162608E-01 -1.751087E+00 -84.7387-1.550088E-01 -1.933188E+011.925484E+01
3-4.500000E+00-1.971321E+01 -9.804292E-02 -1.751087E+00 -84.9384 5.705400E-02 -1.986830E+011.989689E+01
4.500000E+00-1.971321E+01 -9.804292E-02 -1.751087E+00 -84.9384 5.705400E-02 -1.986830E+011.989689E+01
4-4.500000E+00-1.971321E+01 -5.344786E-01 -1.751087E+00 -84.8257-3.759091E-01 -1.987177E+011.968651E+01
4.500000E+00-1.971321E+01 -5.344786E-01 -1.751087E+00 -84.8257-3.759091E-01 -1.987177E+011.968651E+01
25-4.500000E+00-1.862805E+01 -5.344786E-01 -1.751087E+00 -84.5227-3.665675E-01 -1.879596E+011.861539E+01
4.500000E+00-1.862805E+01 -5.344786E-01 -1.751087E+00 -84.5227-3.665675E-01 -1.879596E+011.861539E+01
24-4.500000E+00-1.862805E+01 -9.804292E-02 -1.751087E+00 -84.6487 6.598300E-02 -1.879208E+011.882516E+01
4.500000E+00-1.862805E+01 -9.804292E-02 -1.751087E+00 -84.6487 6.598300E-02 -1.879208E+011.882516E+01
1 MD NASTRAN JOB CREATED ON 10-OCT-10 AT 10:37:07 OCTOBER10, 2010 MD NASTRAN5/22/08 PAGE 39
DEFAULT
0 SUBCASE 1
S T R E S S E S I N Q U A D R I L A T E R A L E L E M E N T S ( Q U A D 4 ) OPTION = BILIN
ELEMENT FIBER STRESSES IN ELEMENT COORD SYSTEM PRINCIPAL STRESSES (ZERO SHEAR)
ID GRID-ID DISTANCE NORMAL-X NORMAL-Y SHEAR-XY ANGLE MAJOR MINOR VON MISES
0 4 CEN/4-4.500000E+00-1.615352E+01 -1.102852E-01 -1.361838E+00 -85.1824 4.493972E-03 -1.626830E+011.627055E+01
4.500000E+00-1.615352E+01 -1.102852E-01 -1.361838E+00 -85.1824 4.493972E-03 -1.626830E+011.627055E+01
4-4.500000E+00-1.640902E+012.197989E-01 -1.361838E+00 -85.3490 3.305902E-01 -1.651981E+011.668756E+01
4.500000E+00-1.640902E+012.197989E-01 -1.361838E+00 -85.3490 3.305902E-01 -1.651981E+011.668756E+01
5-4.500000E+00-1.640902E+01 -4.403693E-01 -1.361838E+00 -85.1603-3.250616E-01 -1.652432E+011.636422E+01
4.500000E+00-1.640902E+01 -4.403693E-01 -1.361838E+00 -85.1603-3.250616E-01 -1.652432E+011.636422E+01
26-4.500000E+00-1.589802E+01 -4.403693E-01 -1.361838E+00 -85.0035-3.213068E-01 -1.601708E+011.585887E+01
4.500000E+00-1.589802E+01 -4.403693E-01 -1.361838E+00 -85.0035-3.213068E-01 -1.601708E+011.585887E+01
25-4.500000E+00-1.589802E+012.197989E-01 -1.361838E+00 -85.2042 3.340544E-01 -1.601228E+011.618189E+01
4.500000E+00-1.589802E+012.197989E-01 -1.361838E+00 -85.2042 3.340544E-01 -1.601228E+011.618189E+01
0 5 CEN/4-4.500000E+00-1.370545E+01 -8.465023E-02 -1.142304E+00 -85.2392 1.048420E-02 -1.380059E+011.380583E+01
4.500000E+00-1.370545E+01 -8.465023E-02 -1.142304E+00 -85.2392 1.048420E-02 -1.380059E+011.380583E+01
5-4.500000E+00-1.379303E+011.716467E-01 -1.142304E+00 -85.3544 2.644696E-01 -1.388585E+011.401995E+01
4.500000E+00-1.379303E+011.716467E-01 -1.142304E+00 -85.3544 2.644696E-01 -1.388585E+011.401995E+01
6-4.500000E+00-1.379303E+01 -3.409471E-01 -1.142304E+00 -85.1806-2.446362E-01 -1.388934E+011.376865E+01
4.500000E+00-1.379303E+01 -3.409471E-01 -1.142304E+00 -85.1806-2.446362E-01 -1.388934E+011.376865E+01
27-4.500000E+00-1.361788E+01 -3.409471E-01 -1.142304E+00 -85.1183-2.433840E-01 -1.371545E+011.359539E+01
4.500000E+00-1.361788E+01 -3.409471E-01 -1.142304E+00 -85.1183-2.433840E-01 -1.371545E+011.359539E+01
26-4.500000E+00-1.361788E+011.716467E-01 -1.142304E+00 -85.2964 2.656328E-01 -1.371187E+011.384660E+01
4.500000E+00-1.361788E+011.716467E-01 -1.142304E+00 -85.2964 2.656328E-01 -1.371187E+011.384660E+01
1 MD NASTRAN JOB CREATED ON 10-OCT-10 AT 10:37:07 OCTOBER10, 2010 MD NASTRAN5/22/08 PAGE 40
DEFAULT
0
SUBCASE 1
我想提取红字部分的内容,即总单元数,各个单元的VON MISES 应力。求高手解答。
红字是每行的最后一列即VON MISES 那一列,格式有点乱我改不过来
(楼下有帖子提到结果提取的问题但是没我还有好多问题要问,回复里面有字数限制,很难说清楚,因此又发新帖求助,忘斑竹见谅)
回复 r010510429 的帖子
怎么没人回答啊,在线求解答谢谢 本帖最后由 晚睡早起 于 2010-10-29 11:27 编辑
其它网站看到这个问题的回复,转帖过来大家分享
FUNCTION ResultsExtraction()
INTEGER nlayers, result_ids(VIRTUAL), layer_ids(VIRTUAL)
STRING lctitle, subtitle, primary_label, secondary_label, layer_labels(VIRTUAL)
STRING elem_list, derivation, location, cid
INTEGER datatype, resloc, nres, return_value
INTEGER ids(VIRTUAL), nresults(VIRTUAL), minloc(12), maxloc(12)
REAL results(VIRTUAL)
sys_allocate_array (result_ids, 1, 4)
lctitle = "Default" /* 输入load case名称 */
subtitle = "A1:Static Subcase" /* 输入subcase名称 */
primary_label = "Stress Tensor" /* 输入primary result名称 */
secondary_label = "" /* 输入secondary result名称
elem_list = "Elem 1:5" /* 输入单元列表名称 */
derivation = "VONM" /* 输入结果类型为von Mises */
location = "C" /* 输入所要提取的结果位置为Centroid, 若要提取节点(Nodal)的结果, 则输入“N” */
cid = "" /* 输入结果的参考坐标系名称, 若留空则代表为默认坐标系(As is) */
db_get_load_case_id (lctitle, result_ids(1)) /* 获取load case ID */
db_get_sub_case_id (result_ids(1), subtitle, result_ids(2)) /* 获取subcase ID */
db_get_primary_res_id (primary_label, result_ids(3))/* 获取primary result ID */
db_get_secondary_res_id (result_ids(3), secondary_label, result_ids(4)) /* 获取secondary result ID */
res_utl_get_result_layers (result_ids, nlayers, layer_ids, layer_labels) /* 获取 layer position ID */
sys_reallocate_array (result_ids, 1, 5)
result_ids(5) = layer_ids(1)
return_value = res_utl_extract_elem_results( result_ids, elem_list, derivation,location, cid, @
datatype, resloc, nres, ids, nresults, results, minloc, maxloc )
dump results /* 输出结果 */
END FUNCTION
result_ids数组中各元素的意义,第一个元素代表load case id,第二个元素代表subcase id,第三个元素代表primary result id,第四个元素代表secondary result id,第五个元素代表layer position id
如果你已经知道了subcase id的话,就无需用db_get_sub_case_id函数了,直接给result_ids(2)赋值就行了。
比如你要提取subcase207的结果,就可以在程序中直接写上result_ids(2)=207,然后再用res_utl_extract_elem_results函数提取结果就可以了。 回复 4 # 晚睡早起 的帖子
谢谢,呵呵估计你这个答案还是从我三维论坛那里问的问题里面复制过来的,呵呵我在三维论坛上的一个好友帮我耐心的解答了,不过还是谢谢你。
页:
[1]