From 6ce05ef236f75de238dcd6607e4cda18289861ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesus=20Mart=C3=ADnez?= Date: Thu, 5 Mar 2026 13:48:16 +0100 Subject: [PATCH] =?UTF-8?q?Generalizes=20injectivity=20line=20search=20`?= =?UTF-8?q?=CE=B2`=20parameter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transforms the `β` parameter in the injectivity-preserving line search from a constant `Float64` to a `CellField`. This change allows `β` to potentially vary across the computational domain, enhancing the flexibility of the injectivity preservation criterion. The constructor now ensures `β` is stored as a `CellField`, converting scalar inputs as needed, and `update_cellstate!` adapts its usage accordingly. --- src/Solvers/LineSearches.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Solvers/LineSearches.jl b/src/Solvers/LineSearches.jl index b92f87c..5d36ce5 100644 --- a/src/Solvers/LineSearches.jl +++ b/src/Solvers/LineSearches.jl @@ -62,11 +62,11 @@ struct Injectivity_Preserving_LS{A} <: AbstractLineSearch αmin::Float64 ρ::Float64 c::Float64 - β::Float64 + β::CellField caches::A function Injectivity_Preserving_LS(α::CellState, U, V; maxiter::Int64=50, αmin::Float64=1e-16, ρ::Float64=0.5, c::Float64=0.95, β::Float64=0.95) caches = (U, V) - new{typeof(caches)}(α, maxiter, αmin, ρ, c, β, caches) + new{typeof(caches)}(α, maxiter, αmin, ρ, c, CellField(β, α.points.trian), caches) end @@ -109,6 +109,6 @@ end function update_cellstate!(obj::Injectivity_Preserving_LS, xh, dxh) - update_state!(InjectivityCheck, obj.α, ∇(xh)', ∇(dxh)', x->obj.β) + update_state!(InjectivityCheck, obj.α, ∇(xh)', ∇(dxh)', obj.β) return minimum(minimum((obj.α.values))) end \ No newline at end of file