|
[Sponsors] |
Parse error-on line containing Domain *domain |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 4, 2013, 06:12 |
Parse error-on line containing Domain *domain
|
#1 |
Senior Member
|
Hi,
I would love to have your suggestions to eliminate the "parse error" on line 4 of the below program. I have no clue what this error means. I just need to run this code once to get the cell informations. If someone can suggest a way to correct this or if there are other ways to collect the cell information, i would be really thankful.. I am using fluent 13 on windows 7. #include "udf.h" DEFINE_ON_DEMAND(fonction_retour) Domain *domain; { FILE *fp; cell_t c; Thread *tc; domain=Get_Domain(ID); real xc[ND_ND],x,y,z,tempe,mass_w_i; int i; fp=fopen("cell_info.txt","w"); thread_loop_c(tc, domain) { begin_c_loop(c, tc) { C_CENTROID(xc,c,tc); x=xc[0]; y=xc[1]; z=xc[2]; tempe= C_T(c,tc); mass_w_i = C_YI(c,tc,i); fprintf(fp,"%r %r %r %d\n",x,y,z,i); } end_c_loop(c, tc) } fclose(fp); } |
|
May 4, 2013, 06:56 |
|
#3 |
Senior Member
|
Hi,
thanks, I did that and the parse error got shifted as below line 10: parse error. line 11: parse error. line 17: xc: undeclared variable |
|
May 4, 2013, 07:22 |
|
#4 |
Senior Member
|
Try this one.
#include "udf.h" #define ID 1 DEFINE_ON_DEMAND(fonction_retour) { FILE *fp; Domain *domain; cell_t c; Thread *tc; real xc[ND_ND],x,y,z,tempe,mass_w_i; int i; domain=Get_Domain(ID); if(! Data_Valid_P()) return; fp=fopen("cell_info.txt","w"); thread_loop_c(tc, domain) { begin_c_loop(c, tc) { C_CENTROID(xc,c,tc); x=xc[0]; y=xc[1]; z=xc[2]; tempe= C_T(c,tc); mass_w_i = C_YI(c,tc,i); fprintf(fp,"%r %r %r %d\n",x,y,z,i); } end_c_loop(c, tc) } fclose(fp); } Last edited by blackmask; May 4, 2013 at 09:49. Reason: Add one line of code |
|
May 4, 2013, 07:29 |
|
#5 |
Senior Member
|
Hey,
thanks a lot..it got compiled.. But when when i execute it using "execute on demand" , it gives the following error FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Any clue, Thanks a lot!! |
|
May 4, 2013, 10:10 |
|
#7 |
Senior Member
|
Thanks,
It still says the same error.. But i found this out regarding this error http://cape-forum.com/index.php?topic=1108.0 Apart from this i have another doubt? How do you decide the domain id to be 1? I think even that may be the problem as it may search for the data in a domain where its not present |
|
May 4, 2013, 10:22 |
|
#8 |
Senior Member
|
I want to help you eliminate the syntax error only and nothing else. That is why I never asked what is the UDF supposed to do. The ID is assigned to be 1 because it is always valid but may be not you wanted.
|
|
May 4, 2013, 10:31 |
|
#9 |
Senior Member
|
Okie..It has worked perfectly. The syntax error is not occuring anymore.
I think now i just have to find the correct domain id where my information is present.. Thanks a lot for your help!! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
[blockMesh] BlockMeshmergePatchPairs polyTopoChanger | benru | OpenFOAM Meshing & Mesh Conversion | 3 | June 29, 2008 22:24 |
errors | Fahad | Main CFD Forum | 0 | March 23, 2004 14:20 |
Problems of Duns Codes! | Martin J | Main CFD Forum | 8 | August 15, 2003 00:19 |