Skip to content

Commit 10635fa

Browse files
authored
Merge pull request #125 from MultiSimOLab/curvature_tolerance
Configures Newton-Raphson curvature tolerance
2 parents 063dbe9 + 4634b78 commit 10635fa

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ src="https://github.com/MultiSimOLab/HyperFEM/blob/main/docs/imgs/sims_.png?raw=
154154

155155
In order to give credit to the HyperFEM contributors, we ask that you please reference the paper:
156156

157-
C. Perez‐Garcia, R. Ortigosa, J. Martínez‐Frutos, and D. Garcia‐Gonzalez, **Topology and material optimization in ultra-soft magnetoactive structures: making advantage of residual anisotropies.** Adv. Mater. (2025): e18489. https://https://doi.org/10.1002/adma.202518489
157+
C. Perez‐Garcia, R. Ortigosa, J. Martínez‐Frutos, and D. Garcia‐Gonzalez, **Topology and material optimization in ultra-soft magnetoactive structures: making advantage of residual anisotropies.** Adv. Mater. (2025): e18489. https://doi.org/10.1002/adma.202518489
158158

159159

160160
along with the required citations for [Gridap](https://github.com/gridap/Gridap.jl).

src/Solvers/NonlinearSolvers.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ struct Newton_RaphsonSolver <: Algebra.NonlinearSolver
1111
ls::Algebra.LinearSolver
1212
log::ConvergenceLog{Float64}
1313
linesearch::AbstractLineSearch
14+
ctol::Float64
1415
end
1516

16-
function Newton_RaphsonSolver(ls; maxiter=100, atol=1e-12, rtol=1.e-6,verbose=0, name="Newton-Raphson", linesearch::AbstractLineSearch=LineSearch())
17+
function Newton_RaphsonSolver(ls; maxiter=100, atol=1e-12, rtol=1.e-6, ctol=1.e-5, verbose=0, name="Newton-Raphson", linesearch::AbstractLineSearch=LineSearch())
1718
tols = SolverTolerances{Float64}(; maxiter=maxiter, atol=atol, rtol=rtol)
1819
log = ConvergenceLog(name, tols; verbose=verbose)
19-
return Newton_RaphsonSolver(ls, log, linesearch)
20+
return Newton_RaphsonSolver(ls, log, linesearch,ctol)
2021
end
2122

2223
AbstractTrees.children(s::Newton_RaphsonSolver) = [s.ls]
@@ -64,7 +65,7 @@ function _solve_nr!(x, A, b, dx, ns, nls, op)
6465
solve!(dx, ns, b)
6566

6667
# curvature stopping criterion
67-
if abs(b' * dx) < 1e-5
68+
if abs(b' * dx) < nls.ctol
6869
res = 2.22e-22
6970
done = update!(log, res)
7071
break

0 commit comments

Comments
 (0)