CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Error in Simple UDF! (http://www.cfd-online.com/Forums/fluent-udf/114625-error-simple-udf.html)

Abhya March 14, 2013 09:21

Error in Simple UDF!
 
Hi everyone!
There's a very simple on demand udf I'm writing ... using DEFINE_ON_DEMAND .. and I dont get the error its on the line where DEFINE_ON_DEMAND is defined .. theCode and error are:
Code:

The udf code is :
#include "udf.h"
   
FILE *fout;
   
void get_req_cells_coords(Domain *domain, int id)
{
    real CC[2];
    cell_t c;
    Thread *t = Lookup_Thread(domain, id);
    fprintf(fout,"thread id %d\n", id);
    begin_c_loop(c,t)
    {
        C_CENTROID(CC,c,t);
        fprintf(fout, "f%d %g %g %g\n", c, CC[0], CC[1], CC[2]);
    }
    end_f_loop(c,t)
    fprintf(fout, "\n");
}
DEFINE_ON_DEMAND(get_req_cells_coords)
{
    Domain *domain;
    domain = Get_Domain(1);
    fout = fopen("req_cells.out", "w");
    get_req_cells_coords(domain, 3);
    get_req_cells_coords(domain, 4);
    fclose(fout);
}

The error is:

# Generating ud_io1.h
get_req_cells_coords.c
..\..\src\get_req_cells_coords.c(19) : error C2143: syntax error : missing ';' before 'type'

can anyone help me ? :confused::confused:
Im using Microsoft Visual Studio 2010 with FLUENT v14.5

Abhya March 14, 2013 09:36

Another thing I'd like to mention is that I've been able to compile some other udfs using DEFINE_SOURCE without errors ...
but y this doesn't work ???


All times are GMT -4. The time now is 00:42.