proteus.NonlinearSolvers module
A hierarchy of classes for nonlinear algebraic system solvers.
- class proteus.NonlinearSolvers.NonlinearEquation(dim=0, dim_proc=None)[source]
Bases:
object
The base class for nonlinear equations.
- 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.
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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
- 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
- solve(u, r=None, b=None, par_u=None, par_r=None)[source]
Solves the non-linear system \(F(u) = b\).
- Parameters
u (
numpy.ndarray
) – Solution vector.r (
numpy.ndarray
) – Residual vector, \(r = b - F(u)\)b (
numpy.ndarray
(ARB - not sure this is always true)) – Right hand side vectorpar_u (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel solution vector.par_r (
proteus.LinearAlgebraTools.ParVec_petsc4py
) – Parallel residual vector, \(r = b - F(u)\)
- 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]
- 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
- 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
- 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
- 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
- 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]
- 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.
- 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.
- 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.
- 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).
- 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).
- class proteus.NonlinearSolvers.MultilevelNonlinearSolver(fList, levelNonlinearSolverList, computeRates=False, printInfo=False)[source]
Bases:
object
A generic multilevel solver.
- 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.
- 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]