CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   execute on demand --> (segmentation fault) (https://www.cfd-online.com/Forums/fluent-udf/136657-execute-demand-segmentation-fault.html)

fasc6813 June 2, 2014 05:31

execute on demand --> (segmentation fault)
 
Hi,
for my Master-Thesis I have to couple Maxwell with Fluent. Therefore I got a UDF from an earlier work.
My Problem is when I interprete the UDF and click then execute on demand comes: recieved a fatal signal (Segmentation fault)
the file is koordinaten.c:

#include "udf.h"

/************************************************** ****************************/

FILE *logfile;

DEFINE_INIT(my_init_function,domain)
{
cell_t c;
Thread *t;
real x[ND_ND];
real i = 0;
real j = 0;
FILE *ff;
ff=fopen("Koordinaten.log","at");
fprintf(ff,"\nDEFINE_INIT\n");

printf("\nDEFINE_INIT\n");
printf("Wert von Zelle: %d\n", c);
printf("Wert von thread: %d\n", t);
printf("Wert von ND_ND: %d\n", ND_ND);

/* loop over all cell threads in the domain */
thread_loop_c (t,domain)
{

/* loop over all cells */
begin_c_loop_all (c,t)
{

C_CENTROID(x,c,t);

fprintf(ff,"Zelle-%d-Koordinaten x %le y %le z %le\n", c,x[0],x[1],x[2]);

}
end_c_loop_all (c,t)

}
fclose(ff);

}

DEFINE_ADJUST(djust,domain)
{
FILE *ff;
ff=fopen("libudf.log","at");
fprintf(ff,"\nDEFINE_ADJUST\n");
fclose(ff);

printf("\nDEFINE_ADJUST\n");
}


DEFINE_ON_DEMAND(demand)
{
FILE *ff;
ff=fopen("libudf.log","at");
fprintf(ff,"\nDEFINE_ON_DEMAND\n");
fclose(ff);

printf("\nDEFINE_ON_DEMAND\n");
}


Has anybody an idea?

pakk June 6, 2014 02:27

Could it be that the file libudf.log is already opened in a different program?


All times are GMT -4. The time now is 07:40.