gf_linsolve

Synopsis

X = gf_linsolve('gmres', spmat M, vec b[, int restart][, precond P][,'noisy'][,'res', r][,'maxiter', n])
X = gf_linsolve('cg', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])
X = gf_linsolve('bicgstab', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])
{U, cond} = gf_linsolve('lu', spmat M, vec b)
{U, cond} = gf_linsolve('superlu', spmat M, vec b)
{U, cond} = gf_linsolve('mumps', spmat M, vec b, ... ['sym'])
{lambda, PHI} = gf_linsolve('eigsh', spmat K[, spmat M][, int nev[, scalar sigma]])

Description :

Various linear system solvers.

Command list :

X = gf_linsolve('gmres', spmat M, vec b[, int restart][, precond P][,'noisy'][,'res', r][,'maxiter', n])

Solve <literal>M.X = b</literal> with the generalized minimum residuals method.

Optionally using <literal>P</literal> as preconditioner. The default value of the restart parameter is 50.

X = gf_linsolve('cg', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])

Solve <literal>M.X = b</literal> with the conjugated gradient method.

Optionally using <literal>P</literal> as preconditioner.

X = gf_linsolve('bicgstab', spmat M, vec b [, precond P][,'noisy'][,'res', r][,'maxiter', n])

Solve <literal>M.X = b</literal> with the bi-conjugated gradient stabilized method.

Optionally using <literal>P</literal> as a preconditioner.

{U, cond} = gf_linsolve('lu', spmat M, vec b)

Alias for gf_linsolve(‘superlu’,…)

{U, cond} = gf_linsolve('superlu', spmat M, vec b)

Solve <literal>M.U = b</literal> apply the SuperLU solver (sparse LU factorization).

The condition number estimate <literal>cond</literal> is returned with the solution <literal>U</literal>.

{U, cond} = gf_linsolve('mumps', spmat M, vec b, ... ['sym'])

Solve <literal>M.U = b</literal> using the MUMPS solver.

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

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

{lambda, PHI} = gf_linsolve('eigsh', spmat K[, spmat M][, int nev[, scalar sigma]])

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

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