CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

Initialising a 2-Dimensional Array in a UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 14, 2009, 11:55
Default Initialising a 2-Dimensional Array in a UDF
New Member
Malachy O'Rourke
Join Date: Apr 2009
Posts: 6
Rep Power: 8
morourke is on a distinguished road
Hi All,

Does anyone have any insight as to what might be wrong with the following coding extracted from my inlet boundary condition.

DEFINE_PROFILE(x_velocity, thread, index)
float a1[2][2] = { { 0.00000000f, 1.00000000f } ,
{ 1.00000000f, 0.00000000f } }

I get an error as follows when i interpret the routine.
line 5: invalid type conversion: float -> array 2 of float.

Any help appreciated!

Even more worrying is the following:

DEFINE_PROFILE(x_velocity, thread, index)
int i, j;
float a1[2][2];

a1[0][0] = 1.0;
a1[0][1] = 2.0;
a1[1][0] = 3.0;
a1[1][1] = 4.0;
for (j=0; j<2; j++)
for (i=0; i<2; i++)
" a1[%d][%d] = %12.8f", j, i, a1[j][i]);

which return in the text interface
a1[0][0] = 1.00000000 a1[0][1] = 2.00000000
a1[1][0] = 0.00000000 a1[1][1] = 0.00000000

Last edited by morourke; April 14, 2009 at 12:56.
morourke is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
array in UDF Kamal FLUENT 1 November 7, 2013 02:15
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
can we initialize an array in UDF? blueberry Fluent UDF and Scheme Programming 2 April 14, 2009 12:00
UDF array problem Malachy FLUENT 0 February 10, 2009 11:41

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