大神们,我为什么错了,麻烦帮忙看看 error C2107: illegal index, indirection not allowed
include"udf.h"#include<stdio.h>
#include<math.h>
DEFINE_SOURCE(qxbqx_source,c,t,dS,eqn)
{
#define H 0.1
#define h 0.7
#define k 00
#define w 3.1415
#define g 9.81
#define pi 3.1415
#define rol 1
real dt;
real deltat;
real c1;
real x[ND_ND];
real y;
real source;
C_CENTROID(x,c,t);
y=x[1];
dt=RP_Get_Real("flow-time");
deltat=RP_Get_Real("physical-time-step");
if(x[0]>=5&&x[0]<=10)
{
if(y>=-0.7&&y<=0)
{
c1=sin((x[0]-5)*pi/10);
source=rol*(c1-1)*((H*w*cosh(k*y+k*h)*cos(k*x[0]-w*dt)/(2*sinh(k*h)))-C_U(x,t))/deltat (第121行,提示这行错了)
+rol*(1-c1)*(((-g*y-g*H*cosh(k*y+k*h)*sin(k*x[0]-w*dt)*k)/(2*cosh(k*h)))
+(C_U(c,t)-C_U_M1(c,t))/deltat+C_U(c,t)*C_DUDX(c,t)+C_V(c,t)*C_DUDY(c,t))
-rol*(c1*c1-1)*((H*w*cosh(k*y+k*h)*cos(k*x[0]-w*dt)/(2*sinh(k*h)))*
(-H*w*cosh(k*y+k*h)*sin(k*x[0]-w*dt)*k/(2*sinh(k*h)))+
(H*w*sinh(k*y+k*h)*sin(k*x[0]-w*dt)/(2*sinh(k*h)))*
(H*w*sinh(k*y+k*h)*cos(k*x[0]-w*dt)*k/(2*sinh(k*h))))
-rol*(1-c1)*(1-c1)*(C_U(c,t)*C_DUDX(c,t)+C_V(c,t)*C_DUDY(c,t))
+rol*c1*(c1-1)*((H*w*cosh(k*y+k*h)*cos(k*x[0]-w*dt)*k/(2*sinh(k*h)))*C_DUDX(c,t)+
(H*w*sinh(k*y+k*h)*sin(k*x[0]-w*dt)/(2*sinh(k*h)))*C_DUDY(c,t)+
C_U(c,t)*(-H*w*cosh(k*y+k*h)*sin(k*x[0]-w*dt)*k/(2*sinh(k*h)))+
C_V(c,t)*(H*w*sinh(k*y+k*h)*cos(k*x[0]-w*dt)*k/(2*sinh(k*h))));
dS[eqn]=0;
}
}
return source;
}
..\..\src\zaobo.c(121) : error C2107: illegal index, indirection not allowed
..\..\src\zaobo.c(121) : error C2113: pointer can only be subtracted from another pointer