GridapSolvers.NonlinearSolvers

GridapSolvers.NonlinearSolvers.ContinuationFEOperatorType
struct ContinuationFEOperator <: FESpaces.FEOperator
  op1    :: FEOperator
  op2    :: FEOperator
  switch :: ContinuationSwitch
  reuse_caches :: Bool
end

FEOperator implementing the continuation method for nonlinear solvers. It switches between its two operators when the switch is triggered.

Continuation between more that two operators can be achieved by daisy-chaining two or more ContinuationFEOperators.

If reuse_caches is true, the Jacobian of the first operator is reused for the second operator. This is only possible if the sparsity pattern of the Jacobian does not change.

source
GridapSolvers.NonlinearSolvers.ContinuationSwitchType
mutable struct ContinuationSwitch{A}
  callback :: Function
  caches   :: A
  switched :: Bool
end

ContinuationSwitch(callback::Function, caches)

Switch that implements the switching logic for a ContinuationFEOperator.

The callback function must provide the following signatures:

  • Reset: callback(u::FEFunction,::Nothing,cache) -> (switch::Bool, new_cache)
  • Update: callback(u::FEFunction,b::AbstractVector,cache) -> (switch::Bool, new_cache)

where u is the current solution (as a FEFunction) and b is the current residual. The first signature is called by allocate_residual and is typically used to reset the switch for a new nonlinear solve. The second signature is called by residual! and is used to update the switch based on the current residual.

The cache is (potentially) mutated between each call, and can hold any extra information needed for the continuation logic.

source
GridapSolvers.NonlinearSolvers.NLsolveNonlinearSolverType
NLsolveNonlinearSolver <: NonlinearSolver

NLsolveNonlinearSolver(ls::LinearSolver;kwargs...)
NLsolveNonlinearSolver(;kwargs...)

Wrapper for NLsolve.jl nonlinear solvers. It is equivalent to the wrappers in Gridap, but with support for nonlinear preconditioners. Same kwargs as in nlsolve. Due to NLSolve.jl not using LinearAlgebra's API, these solvers are not compatible with PartitionedArrays.jl. For parallel computations, use NewtonSolver instead.

source
GridapSolvers.NonlinearSolvers.NewtonSolverType
struct NewtonSolver <: Algebra.NonlinearSolver

Newton-Raphson solver. Same as NewtonRaphsonSolver in Gridap, but with a couple addons:

  • Better logging and verbosity control.
  • Better convergence criteria.
  • Works with geometric LinearSolvers/Preconditioners.
source