[Getdp] Matrix Printing: Conversion Program
Bernhard Kubicek
bernhard.kubicek at arsenal.ac.at
Tue Nov 6 13:09:50 CET 2007
Dear All,
I just created a small code that converts the sparse matrix/right hand
side from GetDP/sparsekit's fortran.* files to a format that can be read
from e.g. Mathematica.
Sourcecode is attached.
I did't test for functionality in windows.
Things work best if one looks at 1-d systems with very little nodes, and
uses a manual Transformation matrix t.m.t' to renumber the nodes to sane
positioning.
Very nice greetings,
Bernhard
Mathematica example, prints submatrix of matrix rows/columns 8,9,...,12
in a reordered way:
---------
m = Import["/home/bkubicek/getdp/line/matrix.txt", "Table"];
rhs = Import["/home/bkubicek/getdp/line/rhs.txt", "Table"];
which = {8, 9, 1, 10, 11, 12};
{
m[[which, All]][[All, which]] // MatrixForm,
Transpose[rhs][[which, 1]] // MatrixForm
}
---------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: matrixconvert.cpp
Type: text/x-c++src
Size: 3211 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/getdp/attachments/20071106/dc924739/attachment.cpp>