|
[Sponsors] |
March 30, 2004, 03:22 |
Parse error in udf
|
#1 |
Guest
Posts: n/a
|
Hello all
I am repeatedly getting Line 1: Parse error when I try to execute my udf in interpreted mode. Is anybody having any idea about it? How can I get rid off? Regards Karthick |
|
March 30, 2004, 04:41 |
Re: Parse error in udf
|
#2 |
Guest
Posts: n/a
|
post your udf !
|
|
March 30, 2004, 05:41 |
Re: Parse error in udf
|
#3 |
Guest
Posts: n/a
|
This is my udf. I am trying to add the velocity values of each cell with values given in the datafilenew.dat file
#include "udf.h" DEFINE_ADJUST(my_adjust,d) { Thread *t; cell_t c; FILE *fp=NULL; real uturb=0.; float arr[500]; int i=0; fp=fopen("datafilenew.dat","r"); while (!feof(fp)) { fscanf(fp,"%f",&arr[i]); i++; } fclose(fp); i=0; thread_loop_c(t,d) { begin_c_loop(c,t) { C_U(c,t)=C_U(c,t)+arr[i]; i++; } end_c_loop(c,t) } } Regards Karthick |
|
March 30, 2004, 07:00 |
Re: Parse error in udf
|
#4 |
Guest
Posts: n/a
|
I am not an very experinced in these funcitons, but I almost always find a Parse error is due to a forgotten ; somewhere, although I coudn't see any in your UDF. Is there a problem with this line?
while (!feof(fp)) What is it's funcitons. Should a while not contain a conditioal statement, like < or ==? Sorry I coudn't be more help. |
|
March 30, 2004, 07:02 |
Re: Parse error in udf
|
#5 |
Guest
Posts: n/a
|
Another thought? do you need this header file at the top of your UDF to access the file functions?
#include "fstream.h" |
|
March 30, 2004, 07:42 |
Re: Parse error in udf
|
#6 |
Guest
Posts: n/a
|
Hello
I've tried the udf after including fstream.h file. But again the error is coming. Also while(!feof(fp)) is correct i.e., the loop will go into the file till the eof is reached(end of file). The thing is I am having a dat file which contains some numbers. I have to take each number and store it in a array till eof is reached. Is anyothe way of doing it? Regards Karthick |
|
March 30, 2004, 12:35 |
Re: Parse error in udf
|
#7 |
Guest
Posts: n/a
|
Sure the path of your udf file is right. I suggest you use full path.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Problem of Fluent Interpreted UDF: parse error | knight | Fluent UDF and Scheme Programming | 25 | August 16, 2018 11:26 |
parse error while interpreting udf | Kristin | Fluent UDF and Scheme Programming | 3 | March 15, 2012 07:43 |
parse error in transient udf | spring | FLUENT | 1 | July 6, 2010 07:26 |
UDF parse error at profile function line | Wiggy | Fluent UDF and Scheme Programming | 1 | July 27, 2009 16:59 |
UDF parse error on line 1 ..... (Unusual) | Amit Maha | FLUENT | 4 | June 30, 2006 13:15 |