|
[Sponsors] |
September 21, 2005, 04:38 |
Hi,
Is there support for spa
|
#1 |
Senior Member
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17 |
Hi,
Is there support for sparse matrices in OpenFOAM? From what I can tell, Matrix.C constructs only a full matrix, which would require too much of memory in this case. Best Rasmus H |
|
September 21, 2005, 05:01 |
Sorry to be rude but, well, ob
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Sorry to be rude but, well, obviously! If all the matrices were full you could not solve more that several thousand cells. :-)
The class you want is lduMatrix: OpenFOAM-1.2/src/OpenFOAM/matrices/lduMatrix/lduMatrix.H Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
September 21, 2005, 05:11 |
http://www.cfd-online.com/Open
|
#3 |
Senior Member
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17 |
Thanks! I was looking at the wrong place. |
|
September 27, 2005, 15:14 |
After looking at the lduMatrix
|
#4 |
Senior Member
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17 |
After looking at the lduMatrix class I am afraid I have some further questions about sparse matrices!
What I want/need to to is to use a sparse matrix format for storage of information, not for solving equations. What I thus would need is the possibility to, in pseudocode, do sparseMatrix<bool>(large number,large number) A A(500,5022) = 1; and, for instance A(500,5022) = 0; to delete the element; and to hopefully do the same for other objects, i.e. sparseMatrix<vector> etc. Does these type of structures exist in OpenFOAM, or is this something I need to look into creating? Thanks for your time! Rasmus |
|
September 27, 2005, 17:21 |
Aha. There's several related
|
#5 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Aha. There's several related issues, (e.g. what do you meand by "delete an element") etc. but, the short answer is no: there isn't a ready-to-use container class of this sort for you.
However, it is easy to make one yourself: make a Map of Maps and re-do the access operators. A Map will allow you to do myEntry<bool>(large number) A; A(5022) = true; (equivalent in Map syntax) without excessive memory, and a 2-D equivalent should do what you need. If you're not hapy with a hashed version of Map in FOAM, you could have a go at using the STL version. This is implemented as a balanced binary tree and you still need to do the 2-D wrapping yourself. Good luck, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
September 27, 2005, 17:57 |
Maps you say!
I started buil
|
#6 |
Senior Member
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17 |
Maps you say!
I started building my own sparse class using linked lists, but I am concerned about the cost involved in searching the, possible very large, unordered indexing vectors. I will look into Maps as soon as possible. Thanks for all help! rasmus |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem about direct solver for sparse matrix | ztdep | Main CFD Forum | 0 | August 11, 2006 13:16 |
Aztec - sparse matrix paralell solver | Astrid | Main CFD Forum | 7 | August 3, 2001 13:41 |
complex sparse matrix | Stephane Gasser | Main CFD Forum | 1 | May 14, 2001 14:15 |
Sparse matrix | Takuya TSUJI | Main CFD Forum | 4 | May 9, 2001 19:07 |
sparse matrix solvers | ahmed mobarki | Main CFD Forum | 3 | August 30, 2000 23:06 |