| 查看: 370 | 回复: 0 | |||
[求助]
求助求助
|
|
我现在在做仿真的后处理,分析结果(网格节点坐标,节点的应力应变)我有,现在我想把这些结果输入到ug中进行后处理显示,我在ugopen函数手册中找了两个函数UF_SF_create_disp_mesh,UF_SF_display_mesh,可是在ug中调用这两个函数生成的dll文件时总是提示外部库错误,是我找错函数了还是什么问题,哪位大神能帮帮我,感激不尽!!附上代码 #include "stdafx.h" #include "test1.h" #include <stdio.h> #include <uf.h> #include <uf_modl.h> #include <uf_curve.h> #include <uf_part.h> #include <uf_obj.h> #include <uf_csys.h> #include <uf_sf.h> #include <uf_ui.h> #define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X))) static int report( char *file, int line, char *call, int irc) { if(irc) { char err[133],messg[300]; UF_get_fail_message(irc, err); sprintf(messg, "\n%s\nerror %d at linePt %d in %s\n%s", err, irc, line, file, call); printf("%s\n", messg); strcpy(&messg[129], "..." ;uc1601(messg, TRUE); /* Internal only - remove for external */ } return(irc); } static void do_ugopen_api(void) { UF_SF_disp_mesh_t disp_mesh; tag_t mesh_tag; disp_mesh.node_coords=new double[9][3]; disp_mesh.node_ids=new int[9]; disp_mesh.elem_ids=new int[4]; disp_mesh.elem_node_ids = new int *[4]; for (int i = 0; i < 4; i++) { disp_mesh.elem_node_ids = new int[4]; } disp_mesh.elem_dimension=UF_SF_DIMENSION_2D; disp_mesh.num_elements=4; disp_mesh.num_nodes=9; disp_mesh.num_elem_nodes=4; disp_mesh.node_coords[0][0]=0.0; disp_mesh.node_coords[0][1]=0.0; disp_mesh.node_coords[0][2]=0.0; disp_mesh.node_coords[1][0]=1.0; disp_mesh.node_coords[1][1]=0.0; disp_mesh.node_coords[1][2]=0.0; disp_mesh.node_coords[2][0]=2.0; disp_mesh.node_coords[2][1]=0.0; disp_mesh.node_coords[2][2]=0.0; disp_mesh.node_coords[3][0]=2.0; disp_mesh.node_coords[3][1]=1.0; disp_mesh.node_coords[3][2]=0.0; disp_mesh.node_coords[4][0]=2.0; disp_mesh.node_coords[4][1]=2.0; disp_mesh.node_coords[4][2]=0.0; disp_mesh.node_coords[5][0]=1.0; disp_mesh.node_coords[5][1]=2.0; disp_mesh.node_coords[5][2]=0.0; disp_mesh.node_coords[6][0]=0.0; disp_mesh.node_coords[6][1]=2.0; disp_mesh.node_coords[6][2]=0.0; disp_mesh.node_coords[7][0]=0.0; disp_mesh.node_coords[7][1]=1.0; disp_mesh.node_coords[7][2]=0.0; disp_mesh.node_coords[8][0]=1.0; disp_mesh.node_coords[8][1]=1.0; disp_mesh.node_coords[8][2]=0.0; disp_mesh.node_ids[0]=0; disp_mesh.node_ids[1]=1; disp_mesh.node_ids[2]=2; disp_mesh.node_ids[3]=3; disp_mesh.node_ids[4]=4; disp_mesh.node_ids[5]=5; disp_mesh.node_ids[6]=6; disp_mesh.node_ids[7]=7; disp_mesh.node_ids[8]=8; disp_mesh.elem_ids[0]=0; disp_mesh.elem_ids[1]=1; disp_mesh.elem_ids[2]=2; disp_mesh.elem_ids[3]=3; disp_mesh.elem_node_ids[0][0]=0; disp_mesh.elem_node_ids[0][1]=1; disp_mesh.elem_node_ids[0][2]=8; disp_mesh.elem_node_ids[0][3]=7; disp_mesh.elem_node_ids[1][0]=1; disp_mesh.elem_node_ids[1][1]=2; disp_mesh.elem_node_ids[1][2]=3; disp_mesh.elem_node_ids[1][3]=8; disp_mesh.elem_node_ids[2][0]=8; disp_mesh.elem_node_ids[2][1]=3; disp_mesh.elem_node_ids[2][2]=4; disp_mesh.elem_node_ids[2][3]=5; disp_mesh.elem_node_ids[3][0]=7; disp_mesh.elem_node_ids[3][1]=8; disp_mesh.elem_node_ids[3][2]=5; disp_mesh.elem_node_ids[3][3]=6; UF_initialize(); UF_CALL(UF_SF_create_disp_mesh(&disp_mesh,&mesh_tag)); UF_CALL(UF_SF_display_mesh (mesh_tag)); } void ufusr(char *param, int *retcode, int param_len) { if (!UF_CALL(UF_initialize())) { do_ugopen_api(); UF_CALL(UF_terminate()); } } int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); } |
» 猜你喜欢
JMPT期刊有字数限制吗
已经有0人回复
一志愿哈工大机械专硕,英一数一400分
已经有2人回复
工程热物理与能源利用论文润色/翻译怎么收费?
已经有285人回复
沈阳高校招收机械、控制类等相关专业研究生(调剂)
已经有0人回复
山东交通学院航运学院硕士研究生还有大量名额,欢迎工科学院报考
已经有0人回复
使用高温共聚焦显微镜原位观察熔渣在钢表面的铺展情况
已经有0人回复
本科机器人工程,总分296,共产党员,希望调剂B区大学,考研科目085500
已经有0人回复
西安工业大学 功能材料与防护研究所 2026硕士研究生调剂招收公告
已经有0人回复
一志愿重庆大学机械学硕080200 313分,求二轮调剂
已经有7人回复
沈阳高校招收机械、控制类等相关专业研究生(调剂)
已经有0人回复
【博士招生】英国拉夫堡大学博士招生 (LU-CSC scholarship, 暂免ATAS)
已经有0人回复













;
回复此楼
5