24小时热门版块排行榜    

Znn3bq.jpeg
查看: 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);
}
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 独臂大侠 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 085600材料与化工调剂 5+3 孜孜不倦2002 2026-04-19 6/300 2026-04-20 21:25 by babero
[考研] 320求调剂 +6 深郊akm 2026-04-17 6/300 2026-04-20 18:57 by fs26jie
[考研] 297,工科调剂?河南农业大学本科 +15 河南农业大学-能 2026-04-14 15/750 2026-04-20 12:39 by Equinoxhua
[考研] 337求调剂 +3 jyz04 2026-04-18 3/150 2026-04-20 12:24 by 研可安
[考博] 申博 +3 Xyyx. 2026-04-18 3/150 2026-04-20 10:44 by YuY66
[考研] 求计算机方向调剂 +3 Toffee2 2026-04-16 6/300 2026-04-19 22:37 by ll叶
[考研] 294求调剂 +8 淡然654321 2026-04-17 9/450 2026-04-19 19:51 by Equinoxhua
[考研] 求调剂 +10 小聂爱学习 2026-04-16 12/600 2026-04-19 16:51 by 中豫男
[考研] 291求调剂 +12 关忆北. 2026-04-14 13/650 2026-04-19 16:50 by 中豫男
[考研] 085404 22408 309分求调剂 +10 lzmk 2026-04-14 11/550 2026-04-19 16:42 by 中豫男
[考研] 求调剂 +6 苦命人。。。 2026-04-18 7/350 2026-04-19 16:27 by 中豫男
[考研] 294求调剂 +15 淡然654321 2026-04-15 15/750 2026-04-19 08:20 by cuisz
[考研] 接受任何调剂 +6 也就是栗子 2026-04-17 7/350 2026-04-18 17:20 by 涵竹刘
[考研] 收到复试调剂但是去不了 +8 小蜗牛* 2026-04-16 8/400 2026-04-18 11:15 by zixin2025
[考研] 一志愿华中农业071010,320求调剂 +17 困困困困坤坤 2026-04-14 19/950 2026-04-17 20:08 by 关一盏灯cd
[有机交流] 二苯甲酮酸类衍生物 50+3 小白爱主人 2026-04-17 6/300 2026-04-17 18:47 by kf2781974
[考研] 295分求调剂 +5 ?要上岸? 2026-04-17 5/250 2026-04-17 16:51 by fenglj492
[考研] 322求调剂 +6 tekuzu 2026-04-17 6/300 2026-04-17 13:48 by Espannnnnol
[考研] 一志愿沪9,生物学326求调剂 +9 刘墨墨 2026-04-15 9/450 2026-04-16 17:14 by 崔崔崔cccc
[考研] 求调剂学校 +14 不会吃肉 2026-04-13 16/800 2026-04-15 21:59 by noqvsozv
信息提示
请填处理意见