DEFINE_ON_DEMAND 的循环
-
我想使用
DEFINE_ON_DEMAND(Phi1)
函数计算场协同数
然后我的代码DEFINE_ON_DEMAND(Phi1) { Thread *t; face_t f; Domain *d; real T_diff,T_diff2,Phi,m,n; real i = 0.0; real T_sum = 0.0; real T_sum2 = 0.0; cell_t c; m = 169; /*m,n 分别表示平面网格个数*/ n = 119; /*目前节点数为 170x120 */ d = Get_Domain(1); { thread_loop_c(t,d) { begin_c_loop(c,t) { T_diff = C_UDSI(c,t,1)-C_UDSI(c,t,0); T_diff2 = pow(C_UDSI(c,t,1)-C_UDSI(c,t,0),2); T_sum += T_diff; T_sum2 += T_diff2; Message("T_diff is: %d..\n", T_diff); Message("T_diff2 is: %d..\n", T_diff2); i += 1; Message("i is: %d..\n", i); } end_c_loop(c,t) } Phi = T_sum/pow(m*n*T_sum2,0.5); Message("count is: %d..\n", i); Message("T_sum is: %d..\n", T_sum); Message("T_sum2 is: %d..\n", T_sum2); Message("Field Synergy Phi is: %d..\n", Phi); } }
C_UDSI(c,t,1)
,C_UDSI(c,t,0)
分别表示固体和气体温度,不知道哪里有问题?