|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
任务:用积分的方法计算指定区域的面积
问题:以下UDF,能够编译,但运行时会出错。
请问Lookup_Thread具体怎么用?
UDF:
#include "udf.h"
#include "sg.h"
DEFINE_EXECUTE_AT_END(Cal_at_end_p)
{
FILE *fid;
Domain *d;
Thread *t;
cell_t c;
real xc[ND_ND];
real sum_area=0.0;
d = Get_Domain(1);
t=Lookup_Thread(d, 3);
begin_c_loop (c,t)
{
sum_area+=C_VOLUME(c,t);
}
end_c_loop (c,t)
Message("Area=%f", sum_area);
} |
|