HelpMatrix Too Large
Hello,
My problem is that the finite element code I am using generates a very large matrix. I don't have the computer memory to store it. The matrix is, however, very sparse. I want to store only the nonzero elements, but I can't identify a specific form. Can anyone suggest a way to identify, then store the nonzero elements and ulimately invert this matrix? Any suggestions would be appreciated... Thank you. Paul Safier 
Re: HelpMatrix Too Large
You can use Conjecate Gradient methods

Re: HelpMatrix Too Large
If the matrix has a certain pattern, I think you can save your memory.
For example, if it is tridiagonal such as three elements in a row. Use three onedimensional arrays, or nx3 matrix for which you can find a relation between the old and new indeces easily. 
Re: HelpMatrix Too Large
If the mesh in not structured there will be no pattern. For such a case you will have to construct the following structures
1) a Vector ( or a vector of vectors) where the nonzero entries of the matrix will be store (type real) 2) a Vector ( or a vector of vectors) where the "pointers" (integer) will be store. These pointers will indicate what are the correspondance for your sparce matrix. 3) a Vector which contains the number of entries for each elements As an exemple: nb=[2,4,3,2] A=[[4., 7.],[5.,8.,8.,9.],[1.,4.,6.],[3.,6]] LI=[[1,4],[1,2,3,4],[1,2,3],[3,4]] This will take far less storage. But, in the other hand, you will have to construct a routine to perform the matrix*vector product. There is no easy way. But this is fearly easy in C++ or C. 
Re: HelpMatrix Too Large
There are many ways to store a large sparse matrix. The easiest is perhaps the triad format.
You can find details on this at netlib.org. This is a link to a source code that uses sparse Gaussian elimination for solving a linear system. www.netlib.org/toms/533 The storage of the large sparse matrix is explained here. Once you put your matrix in this format, in addition to the Gaussian elimination, you can try various methods like CG, CGS, GMRES etc. with relative ease since source codes for these methods are available in the netlib repository. More efficient ways of storing would require either pointers and/or structured meshes with standard discretization stencils. 
All times are GMT 4. The time now is 03:47. 