Skip to content

Commit

Permalink
add init in Fold continuation based on bordered system
Browse files Browse the repository at this point in the history
  • Loading branch information
rveltz committed Dec 14, 2024
1 parent 25e9eb8 commit 7005046
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/codim2/MinAugFold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,28 @@ function continuation_fold(prob,
ζ★, λ★ = get_adjoint_basis(L★, 0, br.contparams.newton_options.eigsolver; nev = nev, verbose = options_cont.newton_options.verbose)
ζad = real.(ζ★)
rmul!(ζad, 1 / real(dot(ζ, ζ★))) # it can be useful to enforce real(), like for DDE
else
# we use a minimally augmented formulation to set the initial vectors
a = ζ
b = ζad
𝒯 = typeof(p)
L = jacobian(prob, foldpointguess.u, parbif)
newb, _, cv, it = bdlinsolver(L, a, b, zero(𝒯), 0*a, one(𝒯))
~cv && @debug "Bordered linear solver for J did not converge."

@debug "EIGENVECTORS" cv it norm(residual(prob, bifpt.x, parbif), Inf) norm(apply(L, newb), Inf)

L★ = ~has_adjoint(prob) ? transpose(L) : jad(prob, bifpt.x, parbif)
n = length(a)
@debug "" typeof(L★)
newa, _, cv, it = bdlinsolver_adjoint(L★, b, a, zero(𝒯), 0*a, one(𝒯))
~cv && @debug "Bordered linear solver for J' did not converge."

@debug "EIGENVECTORS" cv it norm(residual(prob, bifpt.x, parbif), Inf) norm(apply(L★, newa), Inf)

ζad = newa; rmul!(ζad, 1 / normC(ζad))
ζ = newb; rmul!(ζ, 1 / normC(ζ))
rmul!(ζad, 1 / dot(ζ, ζad))
end

return continuation_fold(prob, alg,
Expand Down

0 comments on commit 7005046

Please sign in to comment.