|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
请教论坛里各位大神输出三维模型所有单元格的中心点坐标的udf该如何编写呀,急求,自己改的一个程序如下,编译过程总是出错,请帮忙看看问题出在哪里!!!最好给一个例子或者给段程序!谢谢。。。
#include "udf.h"
DEFINE_INIT(my_init_func,d)
{
cell_t c;
Thread *t;
real xc[ND_ND];
char filename[]="center.txt";
FILE *fp; /*destination file pointer*/
printf("\n FILENAME:%s\n",filename);
fp = fopen(filename, "w");
/* loop over all cell threads in the domain */
thread_loop_c(t,d)
{
/* loop over all cells */
begin_c_loop_all(c,t)
{
C_CENTROID(xc,c,t);
printf("Writing UDF data to data file...\n");
fprintf(fp, "%.6f %+.6f %+.6f\n", xc[0], xc[1], xc[2]); /* write out xc to data file */
}
end_c_loop_all(c,t)
}
fclose(fp);
}
|
|