Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ U = MultiFieldFESpace([Uu, Uφ])
km=Kinematics(Mechano,Solid)
ke=Kinematics(Electro,Solid)

F,_,_ = get_Kinematics(kM)
F,_,_ = get_Kinematics(km)
E = get_Kinematics(ke)

# residual and jacobian function of load factor
Expand Down
13 changes: 6 additions & 7 deletions src/Solvers/NonlinearSolvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ struct Newton_RaphsonSolver <: Algebra.NonlinearSolver
linesearch::AbstractLineSearch
end

function Newton_RaphsonSolver(ls; maxiter=100, atol=1e-12, rtol=1.e-6, verbose=0, name="Newton-Raphson", linesearch::AbstractLineSearch=LineSearch())
tols = SolverTolerances{Float64}(; maxiter=maxiter, atol=atol, rtol=rtol)
function Newton_RaphsonSolver(ls; maxiter=100, atol=1e-12, rtol=1.e-6, cuvtol=1.e-5,verbose=0, name="Newton-Raphson", linesearch::AbstractLineSearch=LineSearch())
tols = SolverTolerances{Float64}(; maxiter=maxiter, atol=atol, rtol=rtol, cuvtol=cuvtol)
log = ConvergenceLog(name, tols; verbose=verbose)
return Newton_RaphsonSolver(ls, log, linesearch)
end
Expand Down Expand Up @@ -63,11 +63,10 @@ function _solve_nr!(x, A, b, dx, ns, nls, op)
rmul!(b, -1)
solve!(dx, ns, b)

#linesearch x and b changed
# if abs(b' * dx) < 1e-6
# break
# end
# x .+= dx
# curvature stopping criterion
if abs(b' * dx) < log.tols.cuvtol
break
end

α = linesearch(x, dx, b, op)
x .+= α * dx
Expand Down
Loading