|
[Sponsors] |
October 1, 2012, 07:34 |
Reading input matrix in a solver
|
#1 |
New Member
Simon Tornros
Join Date: Aug 2012
Posts: 2
Rep Power: 0 |
Hi! I would like to get input from a case file (we could call this file someProperties located in constant dir). The information to be read should be scalars in a 10x19 matrix. How could this be performed in OF (1.6-ext and simpleFoam, if it matters).
Should the matrix be declared as: int myMatrix[10][19]; and if so, how do I read the someProperties file to get the values into "myMatrix"? Best regards, tsimon. |
|
October 1, 2012, 09:33 |
|
#2 |
Member
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 14 |
Hi,
you can define matrices this way: Matrix<scalar,scalar> matrix(19,10); With matrix[i][j] you can grab the elements. Now you have to find a nice way to read your elements from files. This depends on your data. regards treima |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem when converting mesh (made by ICEM) using fluentMeshToFoam | Forrest_Lei | OpenFOAM | 11 | October 16, 2009 07:28 |
Matrix solver | Yang | Main CFD Forum | 5 | May 13, 2006 23:20 |
solver input file | ioana | CFX | 1 | March 2, 2004 20:01 |
compressible two phase flow in CFX4.4 | youngan | CFX | 0 | July 2, 2003 00:32 |
solver for linear system with large sparse matrix | Yangang Bao | Main CFD Forum | 1 | October 25, 1999 05:22 |