pymor.bindings package

Submodules

fenics module

pyamg module


pymor.bindings.pyamg.apply_inverse(op, V, options=None, least_squares=False, check_finite=True, default_solver='pyamg_solve')[source]

Solve linear equation system.

Applies the inverse of op to the vectors in rhs using PyAMG.

Parameters

op
The linear, non-parametric Operator to invert.
rhs
VectorArray of right-hand sides for the equation system.
options
The solver_options to use (see solver_options).
check_finite
Test if solution only containes finite values.
default_solver
Default solver to use (pyamg_solve, pyamg_rs, pyamg_sa).

Returns

VectorArray of the solution vectors.

Defaults

check_finite, default_solver (see pymor.core.defaults)


pymor.bindings.pyamg.solver_options(tol=1e-05, maxiter=400, verb=False, rs_strength=('classical', {'theta': 0.25}), rs_CF='RS', rs_presmoother=('gauss_seidel', {'sweep': 'symmetric'}), rs_postsmoother=('gauss_seidel', {'sweep': 'symmetric'}), rs_max_levels=10, rs_max_coarse=500, rs_coarse_solver='pinv2', rs_cycle='V', rs_accel=None, rs_tol=1e-05, rs_maxiter=100, sa_symmetry='hermitian', sa_strength='symmetric', sa_aggregate='standard', sa_smooth=('jacobi', {'omega': 1.3333333333333333}), sa_presmoother=('block_gauss_seidel', {'sweep': 'symmetric'}), sa_postsmoother=('block_gauss_seidel', {'sweep': 'symmetric'}), sa_improve_candidates=(('block_gauss_seidel', {'iterations': 4, 'sweep': 'symmetric'}), None), sa_max_levels=10, sa_max_coarse=500, sa_diagonal_dominance=False, sa_coarse_solver='pinv2', sa_cycle='V', sa_accel=None, sa_tol=1e-05, sa_maxiter=100)[source]

Returns available solvers with default solver_options for the PyAMG backend.

Parameters

tol
Tolerance for PyAMG blackbox solver.
maxiter
Maximum iterations for PyAMG blackbox solver.
verb
Verbosity flag for PyAMG blackbox solver.
rs_strength
Parameter for PyAMG Ruge-Stuben solver.
rs_CF
Parameter for PyAMG Ruge-Stuben solver.
rs_presmoother
Parameter for PyAMG Ruge-Stuben solver.
rs_postsmoother
Parameter for PyAMG Ruge-Stuben solver.
rs_max_levels
Parameter for PyAMG Ruge-Stuben solver.
rs_max_coarse
Parameter for PyAMG Ruge-Stuben solver.
rs_coarse_solver
Parameter for PyAMG Ruge-Stuben solver.
rs_cycle
Parameter for PyAMG Ruge-Stuben solver.
rs_accel
Parameter for PyAMG Ruge-Stuben solver.
rs_tol
Parameter for PyAMG Ruge-Stuben solver.
rs_maxiter
Parameter for PyAMG Ruge-Stuben solver.
sa_symmetry
Parameter for PyAMG Smoothed-Aggregation solver.
sa_strength
Parameter for PyAMG Smoothed-Aggregation solver.
sa_aggregate
Parameter for PyAMG Smoothed-Aggregation solver.
sa_smooth
Parameter for PyAMG Smoothed-Aggregation solver.
sa_presmoother
Parameter for PyAMG Smoothed-Aggregation solver.
sa_postsmoother
Parameter for PyAMG Smoothed-Aggregation solver.
sa_improve_candidates
Parameter for PyAMG Smoothed-Aggregation solver.
sa_max_levels
Parameter for PyAMG Smoothed-Aggregation solver.
sa_max_coarse
Parameter for PyAMG Smoothed-Aggregation solver.
sa_diagonal_dominance
Parameter for PyAMG Smoothed-Aggregation solver.
sa_coarse_solver
Parameter for PyAMG Smoothed-Aggregation solver.
sa_cycle
Parameter for PyAMG Smoothed-Aggregation solver.
sa_accel
Parameter for PyAMG Smoothed-Aggregation solver.
sa_tol
Parameter for PyAMG Smoothed-Aggregation solver.
sa_maxiter
Parameter for PyAMG Smoothed-Aggregation solver.

Returns

A dict of available solvers with default solver_options.

Defaults

tol, maxiter, verb, rs_strength, rs_CF, rs_postsmoother, rs_max_levels, rs_max_coarse, rs_coarse_solver, rs_cycle, rs_accel, rs_tol, rs_maxiter, sa_symmetry, sa_strength, sa_aggregate, sa_smooth, sa_presmoother, sa_postsmoother, sa_improve_candidates, sa_max_levels, sa_max_coarse, sa_diagonal_dominance, sa_coarse_solver, sa_cycle, sa_accel, sa_tol, sa_maxiter (see pymor.core.defaults)

scipy module


pymor.bindings.scipy.apply_inverse(op, V, options=None, least_squares=False, check_finite=True, default_solver='scipy_spsolve', default_least_squares_solver='scipy_least_squares_lsmr')[source]

Solve linear equation system.

Applies the inverse of op to the vectors in rhs using PyAMG.

Parameters

op
The linear, non-parametric Operator to invert.
rhs
VectorArray of right-hand sides for the equation system.
options
The solver_options to use (see solver_options).
check_finite
Test if solution only containes finite values.
default_solver
Default solver to use (scipy_spsolve, scipy_bicgstab, scipy_bicgstab_spilu, scipy_lgmres, scipy_least_squares_lsmr, scipy_least_squares_lsqr).
default_least_squares_solver
Default solver to use for least squares problems (scipy_least_squares_lsmr, scipy_least_squares_lsqr).

Returns

VectorArray of the solution vectors.

Defaults

check_finite, default_solver, default_least_squares_solver (see pymor.core.defaults)


pymor.bindings.scipy.matrix_astype_nocopy(matrix, dtype)[source]

pymor.bindings.scipy.solver_options(bicgstab_tol=1e-15, bicgstab_maxiter=None, spilu_drop_tol=0.0001, spilu_fill_factor=10, spilu_drop_rule='basic, area', spilu_permc_spec='COLAMD', spsolve_permc_spec='COLAMD', spsolve_keep_factorization=True, lgmres_tol=1e-05, lgmres_maxiter=1000, lgmres_inner_m=39, lgmres_outer_k=3, least_squares_lsmr_damp=0.0, least_squares_lsmr_atol=1e-06, least_squares_lsmr_btol=1e-06, least_squares_lsmr_conlim=100000000.0, least_squares_lsmr_maxiter=None, least_squares_lsmr_show=False, least_squares_lsqr_damp=0.0, least_squares_lsqr_atol=1e-06, least_squares_lsqr_btol=1e-06, least_squares_lsqr_conlim=100000000.0, least_squares_lsqr_iter_lim=None, least_squares_lsqr_show=False)[source]

Returns available solvers with default solver_options for the SciPy backend.

Parameters

bicgstab_tol
See scipy.sparse.linalg.bicgstab.
bicgstab_maxiter
See scipy.sparse.linalg.bicgstab.
spilu_drop_tol
See scipy.sparse.linalg.spilu.
spilu_fill_factor
See scipy.sparse.linalg.spilu.
spilu_drop_rule
See scipy.sparse.linalg.spilu.
spilu_permc_spec
See scipy.sparse.linalg.spilu.
spsolve_permc_spec
See scipy.sparse.linalg.spsolve.
spsolve_keep_factorization
See scipy.sparse.linalg.spsolve.
lgmres_tol
See scipy.sparse.linalg.lgmres.
lgmres_maxiter
See scipy.sparse.linalg.lgmres.
lgmres_inner_m
See scipy.sparse.linalg.lgmres.
lgmres_outer_k
See scipy.sparse.linalg.lgmres.
least_squares_lsmr_damp
See scipy.sparse.linalg.lsmr.
least_squares_lsmr_atol
See scipy.sparse.linalg.lsmr.
least_squares_lsmr_btol
See scipy.sparse.linalg.lsmr.
least_squares_lsmr_conlim
See scipy.sparse.linalg.lsmr.
least_squares_lsmr_maxiter
See scipy.sparse.linalg.lsmr.
least_squares_lsmr_show
See scipy.sparse.linalg.lsmr.
least_squares_lsqr_damp
See scipy.sparse.linalg.lsqr.
least_squares_lsqr_atol
See scipy.sparse.linalg.lsqr.
least_squares_lsqr_btol
See scipy.sparse.linalg.lsqr.
least_squares_lsqr_conlim
See scipy.sparse.linalg.lsqr.
least_squares_lsqr_iter_lim
See scipy.sparse.linalg.lsqr.
least_squares_lsqr_show
See scipy.sparse.linalg.lsqr.

Returns

A dict of available solvers with default solver_options.

Defaults

bicgstab_tol, bicgstab_maxiter, spilu_drop_tol, spilu_fill_factor, spilu_drop_rule, spilu_permc_spec, spsolve_permc_spec, spsolve_keep_factorization, lgmres_tol, lgmres_maxiter, lgmres_inner_m, lgmres_outer_k, least_squares_lsmr_damp, least_squares_lsmr_atol, least_squares_lsmr_btol, least_squares_lsmr_conlim, least_squares_lsmr_maxiter, least_squares_lsmr_show, least_squares_lsqr_atol, least_squares_lsqr_btol, least_squares_lsqr_conlim, least_squares_lsqr_iter_lim, least_squares_lsqr_show (see pymor.core.defaults)