Module linsolve

linsolve_gmres(M, b, restart=None, *args)

Synopsis: X = linsolve_gmres(SpMat M, vec b[, int restart][, Mrecond P][,’noisy’][,’res’, r][,’maxiter’, n])

Solve M.X = b with the generalized minimum residuals method.

Optionally using P as preconditioner. The default value of the restart parameter is 50.

linsolve_cg(M, b, P=None, *args)

Synopsis: X = linsolve_cg(SpMat M, vec b [, Mrecond P][,’noisy’][,’res’, r][,’maxiter’, n])

Solve M.X = b with the conjugated gradient method.

Optionally using P as preconditioner.

linsolve_bicgstab(M, b, P=None, *args)

Synopsis: X = linsolve_bicgstab(SpMat M, vec b [, Mrecond P][,’noisy’][,’res’, r][,’maxiter’, n])

Solve M.X = b with the bi-conjugated gradient stabilized method.

Optionally using P as a preconditioner.

linsolve_lu(M, b)

Alias for gf_linsolve(‘superlu’,…)

linsolve_superlu(M, b)

Solve M.U = b apply the SuperLU solver (sparse LU factorization).

The condition number estimate cond is returned with the solution U.

linsolve_mumps(M, b, *args)

Synopsis: (U, cond) = linsolve_mumps(SpMat M, vec b, … [‘sym’])

Solve M.U = b using the MUMPS solver.

The right hand side b can optionally by a matrix with several columns in order to solve multiple right hand sides at once.

If the option sym is provided, the symmetric version of the MUMPS solver will be used.

linsolve_eigsh(K, M=None, *args)

Synopsis: (lambda, PHI) = linsolve_eigsh(SpMat K[, SpMat M][, int nev[, scalar sigma]])

The nev eigenvalues (6 by default) nearest to sigma (0 by default) of K.phi = lambda M.phi, and their modes, by ARPACK-ng.

K should be symmetric and M symmetric positive semi-definite (M omitted: the identity). The eigenvalues lambda are ascending, the modes are the rows of PHI (nev x n), M-orthonormal. The implicitly restarted Lanczos method of ARPACK in shift-invert mode, K - sigma M factorized by MUMPS or SuperLU (the same method and defaults as scipy.sparse.linalg.eigsh). Needs nev < n. Available when GetFEM is built with ARPACK-ng.