atulsingh92
Subscriber
yes, it doesn't make much difference!nAnd could I request Fluent team to correct example 3.8.3 of Fluent manual on Get_Report_Definition_Values. Using this udf as it is, gives the following error.nPlease note, the udf has been used as it is given exactly in 3.8.3, Steady state example, as my requirement was the same.nc(9) is at int rv = Get....nc(10) is at the very next if condition.n..\..\src\get_report.c(9): error C2099: initializer is not a constant n..\..\src\get_report.c(10): error C2059: syntax error: 'if'n..\..\src\get_report.c(29): error C2059: syntax error: 'else'nnhere is the code.n#include udf.hnint nrOfvalues=0;nreal *values;nint *ids;nint index;nint counter;nint rv ;n nrv = Get_Report_Definition_Values(area-avg-tot-pressure, 0, &nrOfvalues, NULL, NULL,NULL);  / 0 if successful, 1 if fails!nnMessage(Report definition evaluated at iteration has %d values, rv);nnif (rv==0 && nrOfvalues)n{nn    Message(Report definition evaluated at iteration has %d values, nrOfvalues);n    /*Memory is allocated for values and ids.*/n    values = (real*) malloc(sizeof(real)* nrOfvalues);n    ids = (int*) malloc(sizeof(int)* nrOfvalues);n    /* Second call to get data. The number of values is null, but the lastn    * three are not.*/n    rv = Get_Report_Definition_Values(area-avg-tot-pressure, 0, NULL, values, ids, &index);n    Message(Values correspond to iteration index:%d, index);n    for ( counter = 0; counter < nrOfvalues; counter++ )n        {n            Message(report definition values: %d, %f, ids[counter], values[counter]);n        }n        /*Memory is freed.*/n    free(values);n    free(ids);nnelsen{n    /*The command can be unsuccessful if the report definition does not existn    or if it has not been evaluated yet.*/n    if (rv == 1)n    {n    Message(report definition: %s does not exist, area-avg-tot-pressure);n    }n    else if ( nrOfvalues == 0 )n    {n    Message(report definition: %s not evaluated at iteration level, area-avg-tot-pressure);n    }nn