我编了个UDF,但是计算时发现并没有起作用,不知道什么原因.请各位帮我看看!
#include "udf.h"
#define BETWEEN(x,a,b) (x>=a&&x<=b)
DEFINE_ADJUST (my_adjust,d)
{
Domain *d;
Thread *t;
cell_t c;
int n=N_TIME;
real xx[ND_ND];
real temp = C_T(c,t);
boolean location;
d = Get_Domain(1);
thread_loop_c(t, d)
{
begin_c_loop(c, t)
{
C_CENTROID(xx,c,t)
location = BETWEEN(xx[0],0.07,0.08)&&BETWEEN(xx[1],0,1)&&BETWEEN(xx[2],0.599,0.6);
if(n<=100&&location)
C_R(c,t) = 1500;
}
end_c_loop(c, t)
}
} |