proteus.NonlinearSolvers module

A hierarchy of classes for nonlinear algebraic system solvers.

Inheritance diagram of proteus.NonlinearSolvers

class proteus.NonlinearSolvers.NonlinearEquation(dim=0, dim_proc=None)[source]

The base class for nonlinear equations.

getResidual(u, r)[source]

Evaluate the residual r = F(u)

getJacobian(jacobian, usePicard=False)[source]
resetNonlinearFunctionStatistics()[source]
class proteus.NonlinearSolvers.NonlinearSolver(F, J=None, du=None, 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, unorm=None, tol_du=0.33)[source]

The base class for nonlinear solvers.

norm(u)[source]
unorm(u)[source]
fullNewtonOff()[source]
fullNewtonOn()[source]
fullResidualOff()[source]
fullResidualOn()[source]
computeResidual(u, r, b)[source]
solveInitialize(u, r, b)[source]
computeConvergenceRates()[source]
converged(r)[source]
failed()[source]
computeAverages()[source]
info()[source]
class proteus.NonlinearSolvers.Newton(linearSolver, F, J=None, du=None, par_du=None, 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, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100)[source]

Bases: proteus.NonlinearSolvers.NonlinearSolver

A simple iterative solver that is Newton’s method if you give it the right Jacobian

setLinearSolverTolerance(r)[source]
solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

class proteus.NonlinearSolvers.POD_Newton(linearSolver, F, J=None, du=None, par_du=None, 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, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100, use_deim=False)[source]

Bases: proteus.NonlinearSolvers.Newton

Newton’s method on the reduced order system based on POD

computeResidual(u, r, b)[source]

Use DEIM algorithm to compute residual if use_deim is turned on

Right now splits the evaluation into two ‘temporal’ (mass) and spatial piece

As first step for DEIM still does full evaluation

norm(u)[source]
solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

deim_utils = <module 'proteus.deim_utils' from '/home/cekees/proteus/proteus/deim_utils.pyc'>[source]
class proteus.NonlinearSolvers.POD_DEIM_Newton(linearSolver, F, J=None, du=None, par_du=None, 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, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100, use_deim=True)[source]

Bases: proteus.NonlinearSolvers.Newton

Newton’s method on the reduced order system based on POD

norm(u)[source]
computeDEIMresiduals(u, rs, rt)[source]

wrapper for computing residuals separately for DEIM

solveInitialize(u, r, b)[source]

if using deim modifies base initialization by splitting up residual evaluation into separate pieces interpolated by deim (right now just does ‘mass’ and ‘space’)

NOT FINISHED

solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

solveDEIM(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

using DEIM Start with brute force just testing things

class proteus.NonlinearSolvers.NewtonNS(linearSolver, F, J=None, du=None, par_du=None, 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, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100)[source]

Bases: proteus.NonlinearSolvers.NonlinearSolver

A simple iterative solver that is Newton’s method if you give it the right Jacobian

setLinearSolverTolerance(r)[source]
converged(r)[source]
solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

class proteus.NonlinearSolvers.SSPRKNewton(linearSolver, F, J=None, du=None, par_du=None, 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, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100)[source]

Bases: proteus.NonlinearSolvers.Newton

Version of Newton for SSPRK so doesn’t refactor unnecessarily

solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

resetFactorization(needToRefactor=True)[source]
class proteus.NonlinearSolvers.PicardNewton(linearSolver, F, J=None, du=None, par_du=None, 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, fullNewton=True, directSolver=False, EWtol=True, maxLSits=100)[source]

Bases: proteus.NonlinearSolvers.Newton

solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solve F(u) = b

b – right hand side u – solution r – F(u) - b

class proteus.NonlinearSolvers.NLJacobi(F, J, du, weight=0.8, 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, fullNewton=True)[source]

Bases: proteus.NonlinearSolvers.NonlinearSolver

Nonlinear Jacobi iteration.

solve(u, r=None, b=None, par_u=None, par_r=None)[source]
class proteus.NonlinearSolvers.NLGaussSeidel(connectionList, F, J, du, 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, fullNewton=True)[source]

Bases: proteus.NonlinearSolvers.NonlinearSolver

Nonlinear Gauss-Seidel.

solve(u, r=None, b=None, par_u=None, par_r=None)[source]
class proteus.NonlinearSolvers.NLStarILU(connectionList, F, J, du, 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, fullNewton=True)[source]

Bases: proteus.NonlinearSolvers.NonlinearSolver

Nonlinear alternating Schwarz on node stars.

prepareSubdomains()[source]
solve(u, r=None, b=None, par_u=None, par_r=None)[source]
class proteus.NonlinearSolvers.FasTwoLevel(prolong, restrict, restrictSum, coarseF, preSmoother, postSmoother, coarseSolver, F, J=None, du=None, 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.NonlinearSolvers.NonlinearSolver

A generic nonlinear two-level solver based on the full approximation scheme. (FAS).

fullNewtonOff()[source]
fullNewtonOn()[source]
fullResidualOff()[source]
fullResidualOn()[source]
solve(u, r=None, b=None, par_u=None, par_r=None)[source]
class proteus.NonlinearSolvers.FAS(prolongList, restrictList, restrictSumList, FList, preSmootherList, postSmootherList, coarseSolver, mgItsList=[], printInfo=True)[source]

A generic nonlinear multigrid W cycle using the Full Approximation Scheme (FAS).

solve(u, r=None, b=None, par_u=None, par_r=None)[source]
class proteus.NonlinearSolvers.MultilevelNonlinearSolver(fList, levelNonlinearSolverList, computeRates=False, printInfo=False)[source]

A generic multilevel solver.

solveMultilevel(uList, rList, bList=None, par_uList=None, par_rList=None)[source]
updateJacobian()[source]
info()[source]
class proteus.NonlinearSolvers.EikonalSolver(levelSolverType, F, relativeTolerance=0.0, absoluteTolerance=1e-08, maxSolverIts=100, frontTolerance=0.0001, frontInitType='magnitudeOnly', bandTolerance=-0.01, eikonalVariable=0, localReconstruction=None, printInfo=False)[source]

Simple wrapper for special purpose Eikonal equation solvers on a single level. Current types allowed:

FMMEikonalSolver
FSWEikonalSolver
solve(u, r, b=None)[source]
info()[source]
convertToC0P1Rep(dofin, dofout, interpType='min')[source]

allow input FEM space to be something besides C0P1 and then convert to expected representation here

convertFromC0P1Rep(dofin, dofout)[source]

allow output FEM space to be something besides C0P1 and convert from C0P1 to expected representation here

class proteus.NonlinearSolvers.MultilevelEikonalSolver(levelSolverList, printInfo=False)[source]

Attempt a wrapper for multilevel Eikonal equation solves with restricted interface

solveMultilevel(uList, rList, bList=None, par_uList=None, par_rList=None)[source]
updateJacobian()[source]
info()[source]
class proteus.NonlinearSolvers.NLNI(fList=[], solverList=[], prolongList=[], restrictList=[], restrictSumList=[], maxIts=None, tolList=None, atol=None, computeRates=True, printInfo=True)[source]

Bases: proteus.NonlinearSolvers.MultilevelNonlinearSolver

Nonlinear nested iteration.

solve(u, r=None, b=None, par_u=None, par_r=None)[source]
solveMultilevel(uList, rList, bList=None, par_uList=None, par_rList=None)[source]
info()[source]
switchToResidualConvergence(solver, rtol)[source]
revertToFixedIteration(solver)[source]
proteus.NonlinearSolvers.multilevelNonlinearSolverChooser(nonlinearOperatorList, jacobianList, par_jacobianList, duList=None, par_duList=None, relativeToleranceList=None, absoluteTolerance=1e-08, multilevelNonlinearSolverType=<class proteus.NonlinearSolvers.NLNI>, computeSolverRates=False, printSolverInfo=False, linearSolverList=None, linearDirectSolverFlag=False, solverFullNewtonFlag=True, maxSolverIts=500, solverConvergenceTest='r', levelNonlinearSolverType=<class proteus.NonlinearSolvers.Newton>, levelSolverFullNewtonFlag=True, levelSolverConvergenceTest='r', computeLevelSolverRates=False, printLevelSolverInfo=False, relaxationFactor=None, connectionListList=None, smootherType='Jacobi', prolong_bcList=None, restrict_bcList=None, restrict_bcSumList=None, prolongList=None, restrictList=None, restrictionRowSumList=None, preSmooths=3, postSmooths=3, cycles=3, smootherConvergenceTest='its', computeSmootherRates=False, printSmootherInfo=False, smootherFullNewtonFlag=True, computeCoarseSolverRates=False, printCoarseSolverInfo=False, EWtol=True, maxLSits=100, parallelUsesFullOverlap=True, nonlinearSolverNorm=<function l2Norm>)[source]