|
[Sponsors] |
June 23, 2010, 15:34 |
Inversion of large sparse linear systems
|
#1 |
Member
kostas
Join Date: Jun 2010
Posts: 43
Rep Power: 16 |
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).
|
|
June 23, 2010, 17:55 |
|
#2 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 20 |
GSL - GNU Scientific Library
Cblas Clapack and so on ... any Linux distribution should have the above. Do |
|
June 23, 2010, 19:13 |
|
#3 |
Member
Jed Brown
Join Date: Mar 2009
Posts: 56
Rep Power: 19 |
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.
|
|
June 24, 2010, 03:03 |
|
#4 |
Member
kostas
Join Date: Jun 2010
Posts: 43
Rep Power: 16 |
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.
|
|
June 24, 2010, 07:24 |
You never want the inverse
|
#5 |
Member
Jed Brown
Join Date: Mar 2009
Posts: 56
Rep Power: 19 |
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 in 2D or in 3D vs. , 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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
solution diverges when linear upwind interpolation scheme is used | subash | OpenFOAM | 0 | May 29, 2010 02: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 15: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 05:22 |