CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Sparse matrix

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 21, 2005, 03:38
Default Hi, Is there support for spa
  #1
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 8
hemph is on a distinguished road
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
hemph is offline   Reply With Quote

Old   September 21, 2005, 04:01
Default Sorry to be rude but, well, ob
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   September 21, 2005, 04:11
Default http://www.cfd-online.com/Open
  #3
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 8
hemph is on a distinguished road

Thanks! I was looking at the wrong place.
hemph is offline   Reply With Quote

Old   September 27, 2005, 14:14
Default After looking at the lduMatrix
  #4
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 8
hemph is on a distinguished road
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
hemph is offline   Reply With Quote

Old   September 27, 2005, 16:21
Default Aha. There's several related
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   September 27, 2005, 16:57
Default Maps you say! I started buil
  #6
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 8
hemph is on a distinguished road
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
hemph is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem about direct solver for sparse matrix ztdep Main CFD Forum 0 August 11, 2006 12:16
Aztec - sparse matrix paralell solver Astrid Main CFD Forum 7 August 3, 2001 12:41
complex sparse matrix Stephane Gasser Main CFD Forum 1 May 14, 2001 13:15
Sparse matrix Takuya TSUJI Main CFD Forum 4 May 9, 2001 18:07
sparse matrix solvers ahmed mobarki Main CFD Forum 3 August 30, 2000 22:06


All times are GMT -4. The time now is 21:20.