报错信息:
F:\PARA_mesh\_code\mesh_ansys_2d\mesh_ansys_2d.cpp, line 97: UF_SF_create_2d_ansys_mesh(&mesh_params,element_type,num_objects,object_id,&mesh_tag)
returned error 1541707: An invalid type element was specified for this operation.
number of nodes is : = 0作者: xskun 时间: 2004-3-18 21:59
为了节省您的时间,我先解释一下do_ugopen_api()中用到的三个函数。
1---UF_UI_select_with_class_dialog()函数是出现类选择对话框。
其原型如下:
extern int UF_UI_select_with_class_dialog (
char * message,
char * title,
int scope,
UF_UI_sel_init_fn_t sel_init_proc,
void * user_data,
int * response,
int * count,
tag_p_t * object );
UF_SF_AMM_mesh_parameters_t * mesh_params Input Mesh-parameters of 2d mesh
char * element_type Input element type. Has to be one of the following four: Quad8, Quad4, Tri6, Tri3 ////就是该参数出错!!!
int num_objects Input number of objects to mesh
tag_t * object_id Input Tag of the object to be meshed
tag_t * mesh_tag Output Tag of the created mesh
其中结构类型UF_SF_AMM_mesh_parameters_s定义如下:
typedef struct UF_SF_AMM_mesh_parameters_s
{ /* Mesh attributes related to model geometry */
tag_t element_descritor_tag; /* Type of Element to create */
UF_SF_mesh_dimension_t
mesh_dimension; /* 2D(shell) or 3D(solid) */
int ansys_area_element_shape; /* The area element shape tri/quad */
int midnode_needed; /* 0 = OFF , 1 = ON */
int smart_edge_seeding; /* smart edge seeding 0 = OFF, 1 = ON */
double overall_elem_size; /* Overall Element Size */
double area_transition_factor; /* Maximum Area Transition Factor */
double area_transition_lower_limit;
double area_transition_upper_limit;
double area_expansion_factor; /* Area Expansion Factor */
double area_expansion_lower_limit;
double area_expansion_upper_limit;
double volume_expansion_factor; /* Volume Expansion Factor */
double volume_expansion_lower_limit;
double volume_expansion_upper_limit;
double edge_matching_tol; /* UG edge matching tolerance */
double jacobian_ratio; /* for midnode snapping - threshold*/
double warp; /* for quad splitting - threshold */
int do_not_format_mesh; /* 0 = OFF , 1 = ON */
int split_quad_toggle; /* 0 = OFF , 1 = ON */
int midnode_snapping; /* 0 = OFF , 1 = ON */
int smart_sizing; /* 0 = OFF , 1 = ON */
int quad_splitting; /* 0 = OFF , 1 = ON */
int smoothing; /* 0 = OFF , 1 = ON */
int cleanup; /* 0 = OFF , 1 = ON */
int debugging; /* 0 = OFF , 1 = ON */
int journaling; /* 0 = OFF , 1 = ON */
int mapped_mesh; /* 0 = OFF , 1 = ON */
} UF_SF_AMM_mesh_parameters_t;
3------UF_SF_count_nodes()统计节点函数 //此处该函数的目的只是为了看看是否分网成功!
其原型如下:
extern int UF_SF_count_nodes (
tag_t mesh,
int * number_of_nodes );
tag_t mesh Input The tag of mesh. If passed NULL_TAG
then all meshes in the current part will be
traversed
int * number_of_nodes Output Number of nodes found.
谢谢啦!作者: xskun 时间: 2004-3-18 22:02
恳请各位帮忙!作者: xskun 时间: 2004-3-19 11:44
请大侠帮我看看,代码在附件的do_ugopen_api()函数中,不是很长,课题因此而停止,做不下去了。多谢了!作者: xskun 时间: 2004-3-20 11:17
请版主大侠们帮我看看,为什么该程序运行时说单元类型错误( invalid type element ),我使用了各种形式的单元类型(Has to be one of the following four: Quad8, Quad4, Tri6, Tri3 ),为什么还是不行?
函数UF_SF_create_2d_ansys_mesh()的第二个参数为:
char * element_type; //Input element type. Has to be one of the following four: Quad8, Quad4, Tri6, Tri3我试了这里的四个都不行。
都是出现如下的错误:error 1541707: An invalid type element was specified for this operation