# Initialising a 2-Dimensional Array in a UDF

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

 April 14, 2009, 11:55 Initialising a 2-Dimensional Array in a UDF #1 New Member   Malachy O'Rourke Join Date: Apr 2009 Posts: 6 Rep Power: 10 Sponsored Links Hi All, Does anyone have any insight as to what might be wrong with the following coding extracted from my inlet boundary condition. #include"udf.h" 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: #include"udf.h" 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++) { printf(" a1[%d][%d] = %12.8f", j, i, a1[j][i]); } printf("\n"); } } 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.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Qureshi FLUENT 7 March 23, 2017 08:37 Kamal FLUENT 1 November 7, 2013 02:15 kim FLUENT 3 October 26, 2011 21:38 blueberry Fluent UDF and Scheme Programming 2 April 14, 2009 12:00 Malachy FLUENT 0 February 10, 2009 11:41