||April 19, 2012 01:41
Simple UDF array question [Fluent]
Edit: Solved..array positions start at 0 and not 1 in C ;)
I'm making a simple UDF that is defined by a matrix of values, but am having problems in actually getting the UDF the access the matrix properly. Here's the bones of my code:
real velocity; /*velocity value*/
real matrix; /*1D array storing 2 velocity values*/
int value; /*variable describing the array position eg. column 1,2..*/
velocity=matrix[value]; /* <<<PROBLEM LINE /*
F_PROFILE(f, thread, position) = velocity;
This code does NOT work for me. However, if I replace the problem line with:
then my code works..so how can I access the matrix by an integer variable rather than by an actual integer?
Will post the full code if need be.