sfepy.solvers.ls module¶
-
class
sfepy.solvers.ls.PETScKrylovSolver(conf, **kwargs)[source]¶ 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.
-
name= 'ls.petsc'¶
-
static
process_conf(conf, kwargs)[source]¶ 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 }
-
-
class
sfepy.solvers.ls.PETScParallelKrylovSolver(conf, **kwargs)[source]¶ 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.
-
name= 'ls.petsc_parallel'¶
-
static
process_conf(conf, kwargs)[source]¶ 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 }
-
-
class
sfepy.solvers.ls.PyAMGSolver(conf, **kwargs)[source]¶ Interface to PyAMG solvers.
Notes
Uses relative convergence tolerance, i.e. eps_r is scaled by ||b||.
-
name= 'ls.pyamg'¶
-
-
class
sfepy.solvers.ls.SchurComplement(conf, **kwargs)[source]¶ 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
-
name= 'ls.schur_complement'¶
-
-
class
sfepy.solvers.ls.SchurGeneralized(conf, **kwargs)[source]¶ Generalized Schur complement.
Defines the matrix blocks and calls user defined function.
-
name= 'ls.schur_generalized'¶
-
static
process_conf(conf, kwargs)[source]¶ 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, }) }
-
-
class
sfepy.solvers.ls.ScipyIterative(conf, **kwargs)[source]¶ 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).
-
name= 'ls.scipy_iterative'¶
-

