CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

How can I find the inverse of a sparse matrix

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

Like Tree2Likes
  • 2 Post By chegdan

Reply
 
LinkBack Thread Tools Display Modes
Old   January 18, 2014, 18:10
Default How can I find the inverse of a sparse matrix
  #1
Senior Member
 
Join Date: Jun 2011
Posts: 151
Rep Power: 7
mechy is on a distinguished road
I have a matrix n*n and I want to find its inverse.
the matrix is not a 3 diagonal matrix (lower-upper- diagonal)and therefor I can not use the lduMatrix
any help will be appreciated
mechy is offline   Reply With Quote

Old   January 19, 2014, 11:47
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi mechy,

I'm just dropping by to help future readers on where you found part of the solution to your problem and a link to another thread that is on a related topic:
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 19, 2014, 22:29
Default
  #3
Senior Member
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 579
Rep Power: 20
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
the matrix is not a 3 diagonal matrix (lower-upper- diagonal)and therefor I can not use the lduMatrix
This is an incorrect assumption. lduMatrix can be used to represent a sparse matrix with any pattern**, not just 3 diagonals like you are assuming. The whole idea of the lduSolvers (preconditioned conjugate gradient, preconditioned bi-conjugate gradient, etc.) is to find the inverse of a sparse matrix, and also one of the key components of implicit finite volume methods. Your choice of algorithms depends on the system characteristics (mainly symmetric or asymmetric A, as in Ax=b ). The following threads may get you started at least with the storage format

If you want to look into the actual methods, i would look at the book "iterative methods for sparse linear systems" and the paper "An introduction to the conjugate gradient method without the agonizing pain". Good luck.

**much like CSR, CSC, ELL, and others...but some are better suited for certain sparse patterns
wyldckat and mechy like this.
__________________
Dan

Find me on twitter @dancombest and LinkedIn

Last edited by chegdan; January 20, 2014 at 11:15. Reason: added some links
chegdan 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
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 18:45
C++ solver for Large sparse matrix! sina_mech Main CFD Forum 7 November 20, 2009 14:52
Inverse of a matrix Sathe Main CFD Forum 5 May 15, 2002 16:01
sparse matrix solvers ahmed mobarki Main CFD Forum 3 August 30, 2000 22:06
solver for linear system with large sparse matrix Yangang Bao Main CFD Forum 1 October 25, 1999 04:22


All times are GMT -4. The time now is 17:33.