proteus.LinearSolvers module

A hierarchy of classes for linear algebraic system solvers.

Inheritance diagram of proteus.LinearSolvers

class proteus.LinearSolvers.LinearSolver(L, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=False)[source]

The base class for linear solvers.

setResTol(rtol, atol)[source]
prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None)[source]
calculateEigenvalues()[source]
computeResidual(u, r, b, initialGuessIsZero=False)[source]
solveInitialize(u, r, b, initialGuessIsZero=True)[source]
computeConvergenceRates()[source]
converged(r)[source]
failed()[source]
computeAverages()[source]
info()[source]
printPerformance()[source]
setUp(pc)[source]
apply(pc, x, y)[source]
class proteus.LinearSolvers.LU(L, computeEigenvalues=False, computeEigenvectors=None)[source]

Bases: proteus.LinearSolvers.LinearSolver

A wrapper for pysparse’s wrapper for superlu.

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
calculateEigenvalues()[source]
class proteus.LinearSolvers.PETSc(L, par_L, prefix=None)[source]

Bases: proteus.LinearSolvers.LinearSolver

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
useTrueResidualTest(par_u)[source]
printPerformance()[source]
class proteus.LinearSolvers.KSP_petsc4py(L, par_L, rtol_r=0.0001, atol_r=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=False, prefix=None, Preconditioner=None, connectionList=None, linearSolverLocalBlockSize=1)[source]

Bases: proteus.LinearSolvers.LinearSolver

setResTol(rtol, atol)[source]
prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=True)[source]
converged(r)[source]

decide on convention to match norms, convergence criteria

failed()[source]
info()[source]
class proteus.LinearSolvers.NavierStokes3D(L, prefix=None)[source]
setUp()[source]
proteus.LinearSolvers.SimpleNavierStokes3D[source]

alias of NavierStokes3D

class proteus.LinearSolvers.NavierStokes2D(L, prefix=None)[source]
setUp()[source]
proteus.LinearSolvers.SimpleNavierStokes2D[source]

alias of NavierStokes2D

class proteus.LinearSolvers.NavierStokesPressureCorrection(L, prefix=None)[source]
setUp()[source]
class proteus.LinearSolvers.SimpleDarcyFC(L)[source]
setUp()[source]
class proteus.LinearSolvers.Jacobi(L, weight=1.0, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=True)[source]

Bases: proteus.LinearSolvers.LinearSolver

Damped Jacobi iteration.

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
csmoothers = <module 'proteus.csmoothers' from '/home/cekees/proteus/proteus/csmoothers.so'>[source]
class proteus.LinearSolvers.GaussSeidel(connectionList, L, weight=0.33, sym=False, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=True)[source]

Bases: proteus.LinearSolvers.LinearSolver

Damped Gauss-Seidel.

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
csmoothers = <module 'proteus.csmoothers' from '/home/cekees/proteus/proteus/csmoothers.so'>[source]
class proteus.LinearSolvers.StarILU(connectionList, L, weight=1.0, sym=False, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=True)[source]

Bases: proteus.LinearSolvers.LinearSolver

Alternating Schwarz Method on node stars.

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
csmoothers = <module 'proteus.csmoothers' from '/home/cekees/proteus/proteus/csmoothers.so'>[source]
class proteus.LinearSolvers.StarBILU(connectionList, L, bs=1, weight=1.0, sym=False, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=True)[source]

Bases: proteus.LinearSolvers.LinearSolver

Alternating Schwarz Method on ‘blocks’ consisting of consectutive rows in system for things like dg ...

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
csmoothers = <module 'proteus.csmoothers' from '/home/cekees/proteus/proteus/csmoothers.so'>[source]
class proteus.LinearSolvers.TwoLevel(prolong, restrict, coarseL, preSmoother, postSmoother, coarseSolver, L, prepareCoarse=False, rtol_r=0.0001, atol_r=1e-16, rtol_du=0.0001, atol_du=1e-16, maxIts=100, norm=<function l2Norm>, convergenceTest='r', computeRates=True, printInfo=True)[source]

Bases: proteus.LinearSolvers.LinearSolver

A generic two-level multiplicative Schwarz solver.

prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
class proteus.LinearSolvers.MultilevelLinearSolver(levelLinearSolverList, computeRates=False, printInfo=False)[source]

A generic multilevel solver.

info()[source]
class proteus.LinearSolvers.MGM(prolongList, restrictList, LList, preSmootherList, postSmootherList, coarseSolver, mgItsList=[], printInfo=False, computeRates=False)[source]

Bases: proteus.LinearSolvers.MultilevelLinearSolver

A generic multigrid W cycle.

prepare(b=None)[source]
solve(u, r=None, b=None, initialGuessIsZero=False)[source]
class proteus.LinearSolvers.NI(solverList, prolongList, restrictList, maxIts=None, tolList=None, atol=None, computeRates=True, printInfo=False)[source]

Bases: proteus.LinearSolvers.MultilevelLinearSolver

A generic nested iteration solver.

setResTol(rtol, atol)[source]
prepare(b=None)[source]
solve(u, r=None, b=None, par_u=None, par_b=None, initialGuessIsZero=False)[source]
solveMultilevel(bList, uList, par_bList=None, par_uList=None, initialGuessIsZero=False)[source]
switchToResidualConvergence(solver, rtol)[source]
revertToFixedIteration(solver)[source]
info()[source]
proteus.LinearSolvers.multilevelLinearSolverChooser(linearOperatorList, par_linearOperatorList, multilevelLinearSolverType=<class proteus.LinearSolvers.NI>, relativeToleranceList=None, absoluteTolerance=1e-08, solverConvergenceTest='r', solverMaxIts=500, printSolverInfo=False, computeSolverRates=False, levelLinearSolverType=<class proteus.LinearSolvers.MGM>, printLevelSolverInfo=False, computeLevelSolverRates=False, smootherType=<class proteus.LinearSolvers.Jacobi>, prolongList=None, restrictList=None, connectivityListList=None, cycles=3, preSmooths=3, postSmooths=3, printSmootherInfo=False, computeSmootherRates=False, smootherConvergenceTest='its', relaxationFactor=None, computeEigenvalues=False, parallelUsesFullOverlap=True, par_duList=None, solver_options_prefix=None, linearSolverLocalBlockSize=1)[source]