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/)
-   -   pushback function for vectors in Fluent UDFs (http://www.cfd-online.com/Forums/fluent-udf/84479-pushback-function-vectors-fluent-udfs.html)

ScottN January 31, 2011 10:20

pushback function for vectors in Fluent UDFs
 
Hi,

I'm writing a UDF that involves storing values for cells in a vector where the number of cells is indefinite, therefore I cannot specify the number of elements in my vector when I declare it, instead I initialize it beginning with one element, for example: real myvector[1];

As my program loops through different cells, if a certain criteria is met by that cell, the parameter of interest is added to the end of the vector. Normally with c programming you would just use the pushback function, ex: myvector.push_back(newvalue);

That should increase the vector size by one and put the value of newvalue into the new element. However, push_back doesn't work with fluent UDF's since fluent has created their own vector.h header file which is included when you include the udf.h header file, and push_back isn't included in this new vector.h header. Does anyone know how to do this operation in a fluent UDF?

Thanks,

Scott


All times are GMT -4. The time now is 13:41.