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]

Bases: object

The base class for nonlinear equations.

getResidual(r)[source]

Evaluate the residual r = F(u)

getJacobian(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]

Bases: object

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]

This function dynamically sets the relative tolerance of the linear solver associated with the non-linear iteration. Set useEistenstatWalker=True in a simulation’s numerics file to ensure that this function is used.

Parameters

r (vector) – non-linear residual vector

Notes

The size of the relative reduction assigned to the linear solver depends on two factors: (i) how far the non-linear solver is from satifying its residual reductions and (ii) how large the drop in the latest non-linear residual was.

If the non-linear solver is both far from its residual reduction targets and the latest non-linear residual showed a big drop, then expect the algorithm to assign a large relative reduction to the linear solver.

As the non-linear residual reduction targets get closer, or the non-linear solver stagnates, the linear solver will be assigned a smaller relative reduction up to a minimum of 0.001.

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

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.AddedMassNewton(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]

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.MoveMeshMonitorNewton(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]

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.TwoStageNewton(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

Solves a 2 Stage problem via Newton’s solve

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

Solves a 2 Stage problem via Newton’s solve

class proteus.NonlinearSolvers.ExplicitLumpedMassMatrixShallowWaterEquationsSolver(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

This is a fake solver meant to be used with optimized code A simple iterative solver that is Newton’s method if you give it the right Jacobian

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

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.ExplicitConsistentMassMatrixShallowWaterEquationsSolver(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

This is a fake solver meant to be used with optimized code A simple iterative solver that is Newton’s method if you give it the right Jacobian

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

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.ExplicitLumpedMassMatrix(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

This is a fake solver meant to be used with optimized code

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

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

Solves the non-linear system \(F(u) = b\).

Parameters
no_solve(u, r=None, b=None, par_u=None, par_r=None)[source]
class proteus.NonlinearSolvers.ExplicitConsistentMassMatrixWithRedistancing(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

This is a fake solver meant to be used with optimized code

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

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

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.ExplicitConsistentMassMatrixForVOF(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

This is a fake solver meant to be used with optimized code

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

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

Solves the non-linear system \(F(u) = b\).

Parameters
class proteus.NonlinearSolvers.NewtonWithL2ProjectionForMassCorrection(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

This is a fake solver meant to be used with optimized code

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

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.CLSVOFNewton(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

spinUpStep(u, r=None, b=None, par_u=None, par_r=None)[source]
getNormalReconstruction(u, r=None, b=None, par_u=None, par_r=None)[source]
project_disc_ICs(u, r=None, b=None, par_u=None, par_r=None)[source]
redistance_disc_ICs(u, r=None, b=None, par_u=None, par_r=None, max_num_iters=100)[source]
spinup_for_disc_ICs(u, r=None, b=None, par_u=None, par_r=None)[source]
solve(u, r=None, b=None, par_u=None, par_r=None)[source]

Solves the non-linear system \(F(u) = b\).

Parameters
solveOldMethod(u, r=None, b=None, par_u=None, par_r=None)[source]
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

deim_utils = <module 'proteus.deim_utils' from '/home/travis/build/erdc/proteus/proteus/deim_utils.py'>[source]
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

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]

Bases: object

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]

Bases: object

A generic multilevel solver.

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]