|
[Sponsors] |
July 22, 2016, 06:28 |
Error UDF
|
#1 |
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
Hello
I write some UDfs. I have some errors when I compile it and I don't know to resolve the last ones. My code where I have this errors is: Code:
#include "udf.h" #include "math.h" DEFINE_SDOF_PROPERTIES(valve2, prop, dt, time, dtime) { #if !RP_HOST prop[SDOF_MASS] = 0.016624115; prop[SDOF_IYY] = 0.000010947; prop[SDOF_ZERO_TRANS_X] = TRUE; prop[SDOF_ZERO_TRANS_Y] = TRUE; prop[SDOF_ZERO_TRANS_Z] = TRUE; prop[SDOF_ZERO_ROT_X] = TRUE; prop[SDOF_ZERO_ROT_Y] = FALSE; prop[SDOF_ZERO_ROT_Z] = TRUE; prop[SDOF_LOAD_M_Y] = -9.81*0.045*sin(DT_THETA (dt[1])*0.045); printf("\n 3d : Update 6DOF properties DT_THETA_Z:%e, Mz:%e, Mass:%e\n", DT_THETA (dt)[1],prop[SDOF_LOAD_M_Z], prop[SDOF_MASS]); #endif; } Code:
valve2.c: In function valve2: valve2.c:15: error: invalid type argument of -> (have Dynamic_Thread) valve2.c:17:7: warning: extra tokens at end of #endif directive |
|
July 23, 2016, 01:42 |
|
#2 |
Member
Davoud Malekian
Join Date: Jan 2016
Posts: 53
Rep Power: 10 |
Hi,
your problem actually apeared in this line: prop[SDOF_LOAD_M_Y] = -9.81*0.045*sin(DT_THETA (dt[1])*0.045); try to use prantesis for dt , cause the way you have used dt[1] seems to be that you have used it as an array!!(and thats wrong!) so type like this: prop[SDOF_LOAD_M_Y] = -9.81*0.045*sin(DT_THETA (dt)[1]*(0.045)); and enother problem is that u shouldnt use semicolon after #endif regards. |
|
|
|