fipy.solvers package

Subpackages

Submodules

fipy.solvers.pysparseMatrixSolver module

fipy.solvers.solver module

The iterative solvers may output warnings if the solution is considered unsatisfactory. If you are not interested in these warnings, you can invoke python with a warning filter such as:

$ python -Wignore::fipy.SolverConvergenceWarning myscript.py

If you are extremely concerned about your preconditioner for some reason, you can abort whenever it has problems with:

$ python -Werror::fipy.PreconditionerWarning myscript.py
exception fipy.solvers.solver.IllConditionedPreconditionerWarning(solver, iter, relres)

Bases: fipy.solvers.solver.PreconditionerWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.solver.MatrixIllConditionedWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.solver.MaximumIterationWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.solver.PreconditionerNotPositiveDefiniteWarning(solver, iter, relres)

Bases: fipy.solvers.solver.PreconditionerWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.solver.PreconditionerWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
exception fipy.solvers.solver.ScalarQuantityOutOfRangeWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

class fipy.solvers.solver.Solver(tolerance=1e-10, iterations=1000, precon=None)

Bases: object

The base LinearXSolver class.

Attention

This class is abstract. Always create one of its subclasses.

Create a Solver object.

Parameters
  • tolerance (float) – Required error tolerance.

  • iterations (int) – Maximum number of iterative steps to perform.

  • precon – Preconditioner to use. Not all solver suites support preconditioners.

__annotations__ = {}
__dict__ = mappingproxy({'__module__': 'fipy.solvers.solver', '__doc__': '\n The base `LinearXSolver` class.\n\n .. attention:: This class is abstract. Always create one of its subclasses.\n ', '__init__': <function Solver.__init__>, '_storeMatrix': <function Solver._storeMatrix>, '_solve': <function Solver._solve>, '_solve_': <function Solver._solve_>, '_applyUnderRelaxation': <function Solver._applyUnderRelaxation>, '_calcResidualVector': <function Solver._calcResidualVector>, '_calcResidual': <function Solver._calcResidual>, '_calcRHSNorm': <function Solver._calcRHSNorm>, '_warningList': (<class 'fipy.solvers.solver.ScalarQuantityOutOfRangeWarning'>, <class 'fipy.solvers.solver.StagnatedSolverWarning'>, <class 'fipy.solvers.solver.MatrixIllConditionedWarning'>, <class 'fipy.solvers.solver.PreconditionerNotPositiveDefiniteWarning'>, <class 'fipy.solvers.solver.IllConditionedPreconditionerWarning'>, <class 'fipy.solvers.solver.MaximumIterationWarning'>), '_raiseWarning': <function Solver._raiseWarning>, '__repr__': <function Solver.__repr__>, '_canSolveAsymmetric': <function Solver._canSolveAsymmetric>, '__enter__': <function Solver.__enter__>, '__exit__': <function Solver.__exit__>, '__dict__': <attribute '__dict__' of 'Solver' objects>, '__weakref__': <attribute '__weakref__' of 'Solver' objects>, '__annotations__': {}})
__enter__()
__exit__(exc_type, exc_value, traceback)
__init__(tolerance=1e-10, iterations=1000, precon=None)

Create a Solver object.

Parameters
  • tolerance (float) – Required error tolerance.

  • iterations (int) – Maximum number of iterative steps to perform.

  • precon – Preconditioner to use. Not all solver suites support preconditioners.

__module__ = 'fipy.solvers.solver'
__repr__()

Return repr(self).

__weakref__

list of weak references to the object (if defined)

exception fipy.solvers.solver.SolverConvergenceWarning(solver, iter, relres)

Bases: Warning

__annotations__ = {}
__init__(solver, iter, relres)

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

__weakref__

list of weak references to the object (if defined)

exception fipy.solvers.solver.StagnatedSolverWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

fipy.solvers.test module

Module contents

fipy.solvers.DefaultAsymmetricSolver

alias of fipy.solvers.petsc.linearGMRESSolver.LinearGMRESSolver

fipy.solvers.DefaultSolver

alias of fipy.solvers.petsc.linearGMRESSolver.LinearGMRESSolver

class fipy.solvers.DummySolver(*args, **kwargs)

Bases: fipy.solvers.petsc.petscSolver.PETScSolver

Solver that doesn’t do anything.

PETSc is intolerant of having zeros on the diagonal

Create a Solver object.

Parameters
  • tolerance (float) – Required error tolerance.

  • iterations (int) – Maximum number of iterative steps to perform.

  • precon – Preconditioner to use. Not all solver suites support preconditioners.

__annotations__ = {}
__module__ = 'fipy.solvers.petsc.dummySolver'
fipy.solvers.GeneralSolver

alias of fipy.solvers.petsc.linearGMRESSolver.LinearGMRESSolver

exception fipy.solvers.IllConditionedPreconditionerWarning(solver, iter, relres)

Bases: fipy.solvers.solver.PreconditionerWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

class fipy.solvers.LinearBicgSolver(tolerance=1e-10, iterations=1000, precon=None)

Bases: fipy.solvers.petsc.petscKrylovSolver.PETScKrylovSolver

The LinearBicgSolver is an interface to the biconjugate gradient solver in PETSc, using no preconditioner by default.

Parameters
  • tolerance: The required error tolerance.

  • iterations: The maximum number of iterative steps to perform.

  • precon: Preconditioner to use (string).

__annotations__ = {}
__module__ = 'fipy.solvers.petsc.linearBicgSolver'
solver = 'bicg'
class fipy.solvers.LinearCGSSolver(tolerance=1e-10, iterations=1000, precon=None)

Bases: fipy.solvers.petsc.petscKrylovSolver.PETScKrylovSolver

The LinearCGSSolver is an interface to the conjugate gradient squared solver in PETSc, using no preconditioner by default.

Parameters
  • tolerance: The required error tolerance.

  • iterations: The maximum number of iterative steps to perform.

  • precon: Preconditioner to use (string).

__annotations__ = {}
__module__ = 'fipy.solvers.petsc.linearCGSSolver'
solver = 'cgs'
class fipy.solvers.LinearGMRESSolver(tolerance=1e-10, iterations=1000, precon=None)

Bases: fipy.solvers.petsc.petscKrylovSolver.PETScKrylovSolver

The LinearGMRESSolver is an interface to the GMRES solver in PETSc, using no preconditioner by default.

Parameters
  • tolerance: The required error tolerance.

  • iterations: The maximum number of iterative steps to perform.

  • precon: Preconditioner to use (string).

__annotations__ = {}
__module__ = 'fipy.solvers.petsc.linearGMRESSolver'
solver = 'gmres'
class fipy.solvers.LinearLUSolver(tolerance=1e-10, iterations=10, precon='lu')

Bases: fipy.solvers.petsc.petscSolver.PETScSolver

The LinearLUSolver is an interface to the LU preconditioner in PETSc. A direct solve is performed.

Parameters
  • tolerance: The required error tolerance.

  • iterations: The maximum number of iterative steps to perform.

  • precon: Ignored.

__annotations__ = {}
__init__(tolerance=1e-10, iterations=10, precon='lu')
Parameters
  • tolerance: The required error tolerance.

  • iterations: The maximum number of iterative steps to perform.

  • precon: Ignored.

__module__ = 'fipy.solvers.petsc.linearLUSolver'
class fipy.solvers.LinearPCGSolver(tolerance=1e-10, iterations=1000, precon=None)

Bases: fipy.solvers.petsc.petscKrylovSolver.PETScKrylovSolver

The LinearPCGSolver is an interface to the cg solver in PETSc, using no preconditioner by default.

Parameters
  • tolerance: The required error tolerance.

  • iterations: The maximum number of iterative steps to perform.

  • precon: Preconditioner to use (string).

__annotations__ = {}
__module__ = 'fipy.solvers.petsc.linearPCGSolver'
solver = 'cg'
exception fipy.solvers.MatrixIllConditionedWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.MaximumIterationWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.PreconditionerNotPositiveDefiniteWarning(solver, iter, relres)

Bases: fipy.solvers.solver.PreconditionerWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

exception fipy.solvers.PreconditionerWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
exception fipy.solvers.ScalarQuantityOutOfRangeWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

class fipy.solvers.Solver(tolerance=1e-10, iterations=1000, precon=None)

Bases: object

The base LinearXSolver class.

Attention

This class is abstract. Always create one of its subclasses.

Create a Solver object.

Parameters
  • tolerance (float) – Required error tolerance.

  • iterations (int) – Maximum number of iterative steps to perform.

  • precon – Preconditioner to use. Not all solver suites support preconditioners.

__annotations__ = {}
__dict__ = mappingproxy({'__module__': 'fipy.solvers.solver', '__doc__': '\n The base `LinearXSolver` class.\n\n .. attention:: This class is abstract. Always create one of its subclasses.\n ', '__init__': <function Solver.__init__>, '_storeMatrix': <function Solver._storeMatrix>, '_solve': <function Solver._solve>, '_solve_': <function Solver._solve_>, '_applyUnderRelaxation': <function Solver._applyUnderRelaxation>, '_calcResidualVector': <function Solver._calcResidualVector>, '_calcResidual': <function Solver._calcResidual>, '_calcRHSNorm': <function Solver._calcRHSNorm>, '_warningList': (<class 'fipy.solvers.solver.ScalarQuantityOutOfRangeWarning'>, <class 'fipy.solvers.solver.StagnatedSolverWarning'>, <class 'fipy.solvers.solver.MatrixIllConditionedWarning'>, <class 'fipy.solvers.solver.PreconditionerNotPositiveDefiniteWarning'>, <class 'fipy.solvers.solver.IllConditionedPreconditionerWarning'>, <class 'fipy.solvers.solver.MaximumIterationWarning'>), '_raiseWarning': <function Solver._raiseWarning>, '__repr__': <function Solver.__repr__>, '_canSolveAsymmetric': <function Solver._canSolveAsymmetric>, '__enter__': <function Solver.__enter__>, '__exit__': <function Solver.__exit__>, '__dict__': <attribute '__dict__' of 'Solver' objects>, '__weakref__': <attribute '__weakref__' of 'Solver' objects>, '__annotations__': {}})
__enter__()
__exit__(exc_type, exc_value, traceback)
__init__(tolerance=1e-10, iterations=1000, precon=None)

Create a Solver object.

Parameters
  • tolerance (float) – Required error tolerance.

  • iterations (int) – Maximum number of iterative steps to perform.

  • precon – Preconditioner to use. Not all solver suites support preconditioners.

__module__ = 'fipy.solvers.solver'
__repr__()

Return repr(self).

__weakref__

list of weak references to the object (if defined)

exception fipy.solvers.SolverConvergenceWarning(solver, iter, relres)

Bases: Warning

__annotations__ = {}
__init__(solver, iter, relres)

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

__weakref__

list of weak references to the object (if defined)

exception fipy.solvers.StagnatedSolverWarning(solver, iter, relres)

Bases: fipy.solvers.solver.SolverConvergenceWarning

__annotations__ = {}
__module__ = 'fipy.solvers.solver'
__str__()

Return str(self).

Last updated on Jan 14, 2021. Created using Sphinx 3.4.3.