PETSc Krylov subspace solver.
The solver and preconditioner types are set upon the solver object creation. Tolerances can be overriden when called by passing a conf object.
Notes
Convergence is reached when rnorm < max(eps_r * rnorm_0, eps_a), where, in PETSc, rnorm is by default the norm of preconditioned residual.
Missing items are set to default values.
Example configuration, all items:
solver_120 = {
'name' : 'ls120',
'kind' : 'ls.petsc',
'method' : 'cg', # ksp_type
'precond' : 'icc', # pc_type
'precond_side' : 'left', # ksp_pc_side
'eps_a' : 1e-12, # abstol
'eps_r' : 1e-12, # rtol
'eps_d' : 1e5, # divtol
'i_max' : 1000, # maxits
}
PETSc Krylov subspace solver able to run in parallel by storing the system to disk and running a separate script via mpiexec.
The solver and preconditioner types are set upon the solver object creation. Tolerances can be overriden when called by passing a conf object.
Notes
Convergence is reached when rnorm < max(eps_r * rnorm_0, eps_a), where, in PETSc, rnorm is by default the norm of preconditioned residual.
Missing items are set to default values.
Example configuration, all items:
solver_1 = {
'name' : 'ls',
'kind' : 'ls.petsc_parallel',
'n_proc' : 5, # Number of processes to run.
'method' : 'cg', # ksp_type
'precond' : 'bjacobi', # pc_type
'sub_precond' : 'icc', # sub_pc_type
'eps_a' : 1e-12, # abstol
'eps_r' : 1e-12, # rtol
'eps_d' : 1e5, # divtol
'i_max' : 1000, # maxits
}
Interface to PyAMG solvers.
Notes
Uses relative convergence tolerance, i.e. eps_r is scaled by ||b||.
Schur complement.
Solution of the linear system
is obtained by solving the following equation:
variable(s)
are specified in “eliminate” list, variable(s) are specified in “keep” list,See: http://en.wikipedia.org/wiki/Schur_complement
Generalized Schur complement.
Defines the matrix blocks and calls user defined function.
Setup solver configuration options.
Example configuration:
solvers = {
'ls': ('ls.schur_generalized',
{'blocks':
{'u': ['displacement1', 'displacement2'],
'v': ['velocity1', 'velocity2'],
'w': ['pressure1', 'pressure2'],
},
'function': my_schur,
'needs_problem_instance': True,
})
}
Interface to SciPy iterative solvers.
Notes
The eps_r tolerance is both absolute and relative - the solvers stop when either the relative or the absolute residual is below it.
A preconditioner can be anything that the SciPy solvers accept (sparse matrix, dense matrix, LinearOperator).