|
[Sponsors] |
April 14, 2009, 12:55 |
Initialising a 2-Dimensional Array in a UDF
|
#1 |
New Member
Malachy O'Rourke
Join Date: Apr 2009
Posts: 6
Rep Power: 17 |
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 13:56. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
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 22:38 |
can we initialize an array in UDF? | blueberry | Fluent UDF and Scheme Programming | 2 | April 14, 2009 13:00 |
UDF array problem | Malachy | FLUENT | 0 | February 10, 2009 11:41 |