CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Inversion of large sparse linear systems

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 23, 2010, 14:34
Default Inversion of large sparse linear systems
  #1
Member
 
kostas
Join Date: Jun 2010
Posts: 34
Rep Power: 7
pankos is on a distinguished road
Can anyone tell me some libraries for C languange which inverts large sparse linear systems? It would be better if its install is for linux systems (gcc compiler).
pankos is offline   Reply With Quote

Old   June 23, 2010, 16:55
Default
  #2
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 10
DoHander is on a distinguished road
GSL - GNU Scientific Library
Cblas
Clapack

and so on ... any Linux distribution should have the above.

Do
DoHander is offline   Reply With Quote

Old   June 23, 2010, 18:13
Default
  #3
jed
Member
 
Jed Brown
Join Date: Mar 2009
Posts: 56
Rep Power: 10
jed is on a distinguished road
These suggestions are worthless for sparse systems. I recommend PETSc (http://mcs.anl.gov/petsc), it runs everywhere (Linux, Mac, Windows, exotic Unix, and even iPhone ;-)), scales to very large problems (5*10^11 unknowns, ~300k processors), and perhaps most importantly, is easy to extend with custom (physics-specific) solver components, or by composing existing components (including many third-party libraries) at runtime.
jed is offline   Reply With Quote

Old   June 24, 2010, 02:03
Default
  #4
Member
 
kostas
Join Date: Jun 2010
Posts: 34
Rep Power: 7
pankos is on a distinguished road
OK. Thanks. I have installed PETCs library but i havent concerned it still. Yesterday, i try to use SuperLU library but cant invert matrices (only solve systems). In my problem use the same right large matrix more times. Therefore its not efficient to solve a system at each time. Of course, if i use iterative procedure maybe is ok.
pankos is offline   Reply With Quote

Old   June 24, 2010, 06:24
Default You never want the inverse
  #5
jed
Member
 
Jed Brown
Join Date: Mar 2009
Posts: 56
Rep Power: 10
jed is on a distinguished road
Maybe you misunderstand the process of "solving". You don't want the inverse because it's dense and numerically unstable. Instead, you factor the matrix, and then solve with sparse triangular factors. This requires far fewer operations than actually creating the inverse, and the triangular solves are also much faster than multiplying by the inverse (roughly O(n \log n) in 2D or O(n^{4/3}) in 3D vs. O(n^2), time and space). If you use PETSc, you just call KSPSolve() repeatedly (without updating the matrices), this will reuse the factorization that was computed on the first solve. A standard direct solver would be obtained with
Code:
-ksp_type preonly -pc_type lu -pc_factor_mat_solver_package superlu
(or mumps or umfpack, which are likely faster). Note that larger problems, especially in 3D, may be better suited to iterative methods (domain decomposition or multigrid), even if you need to solve many times.
jed 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
solution diverges when linear upwind interpolation scheme is used subash OpenFOAM 0 May 29, 2010 01:23
C++ solver for Large sparse matrix! sina_mech Main CFD Forum 7 November 20, 2009 14:52
free C code for large sparse matrix linear solver ztdep Main CFD Forum 7 May 24, 2007 14:14
Sparse linear systems in finite volume method Lionel S. Main CFD Forum 6 January 19, 2007 11:04
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 05:20.