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

How can I find the inverse of a sparse matrix

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By chegdan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2014, 17:10
Default How can I find the inverse of a sparse matrix
  #1
Senior Member
 
Join Date: Jun 2011
Posts: 163
Rep Power: 14
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, 10:47
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 21:29
Default
  #3
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
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.

Last edited by chegdan; January 20, 2014 at 10:15. Reason: added some links
chegdan is offline   Reply With Quote

Reply


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 Off
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 13: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 21:45.