GridapSolvers.SolverInterfaces
SolverTolerances
GridapSolvers.SolverInterfaces.SolverTolerances
— Typemutable struct SolverTolerances{T}
...
end
SolverTolerances{T}(
maxiter :: Int = 1000,
atol :: T = eps(T),
rtol :: T = 1.e-5,
dtol :: T = Inf
)
Structure to check convergence conditions for iterative linear solvers.
Methods:
GridapSolvers.SolverInterfaces.SolverConvergenceFlag
— Type@enum SolverConvergenceFlag begin
SOLVER_CONVERGED_ATOL = 0
SOLVER_CONVERGED_RTOL = 1
SOLVER_DIVERGED_MAXITER = 2
SOLVER_DIVERGED_BREAKDOWN = 3
end
Convergence flags for iterative linear solvers.
GridapSolvers.SolverInterfaces.get_solver_tolerances
— Functionget_solver_tolerances(s::LinearSolver)
Returns the solver tolerances of the linear solver s
.
GridapSolvers.SolverInterfaces.set_solver_tolerances!
— Functionset_solver_tolerances!(s::LinearSolver;
maxiter = 1000,
atol = eps(T),
rtol = T(1.e-5),
dtol = T(Inf)
)
Modifies tolerances of the linear solver s
.
GridapSolvers.SolverInterfaces.finished
— Functionfinished(tols::SolverTolerances,niter,e_a,e_r) :: Bool
Returns true
if the solver has finished, false
otherwise.
GridapSolvers.SolverInterfaces.converged
— Functionconverged(tols::SolverTolerances,niter,e_a,e_r) :: Bool
Returns true
if the solver has converged, false
otherwise.
GridapSolvers.SolverInterfaces.finished_flag
— Functionfinished_flag(tols::SolverTolerances,niter,e_a,e_r) :: SolverConvergenceFlag
Computes the solver exit condition given
- the number of iterations
niter
- the absolute error
e_a
- and the relative error
e_r
.
Returns the corresponding SolverConvergenceFlag
.
ConvergenceLogs
GridapSolvers.SolverInterfaces.ConvergenceLog
— Typemutable struct ConvergenceLog{T}
...
end
ConvergenceLog(
name :: String,
tols :: SolverTolerances{T};
verbose = SOLVER_VERBOSE_NONE,
depth = 0
)
Standarized logging system for iterative linear solvers.
Methods:
GridapSolvers.SolverInterfaces.SolverVerboseLevel
— Type@enum SolverVerboseLevel begin
SOLVER_VERBOSE_NONE = 0
SOLVER_VERBOSE_LOW = 1
SOLVER_VERBOSE_HIGH = 2
end
SolverVerboseLevel(true) = SOLVER_VERBOSE_HIGH
SolverVerboseLevel(false) = SOLVER_VERBOSE_NONE
GridapSolvers.SolverInterfaces.reset!
— Functionreset!(log::ConvergenceLog{T})
Resets the convergence log log
to its initial state.
GridapSolvers.SolverInterfaces.init!
— Functioninit!(log::ConvergenceLog{T},r0::T)
Initializes the convergence log log
with the initial residual r0
.
GridapSolvers.SolverInterfaces.update!
— Functionupdate!(log::ConvergenceLog{T},r::T)
Updates the convergence log log
with the residual r
at the current iteration.
GridapSolvers.SolverInterfaces.finalize!
— Functionfinalize!(log::ConvergenceLog{T},r::T)
Finalizes the convergence log log
with the final residual r
.
GridapSolvers.SolverInterfaces.set_depth!
— Functionset_depth!(log::ConvergenceLog,depth::Int)
set_depth!(log::NonlinearSolver,depth::Int)
Sets the tabulation depth of the convergence log log
to depth
.
GridapSolvers.SolverInterfaces.print_message
— Functionprint_message(log::ConvergenceLog{T},msg::String)
Prints the message msg
to the output stream of the convergence log log
.