Skip to content

Commit

Permalink
correct Incorrect calls to EventSpecialPoint
Browse files Browse the repository at this point in the history
refactor continuation.jl
  • Loading branch information
rveltz committed Nov 18, 2023
1 parent 82569c4 commit 096772d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The current focus is on large scale nonlinear problems and multiple hardwares. H

## Support and citation
If you use this package for your work, we ask that you cite the following paper. Open source development as part of academic research strongly depends on this. Please also consider starring this repository if you like our work, this will help us to secure funding in the future. It is referenced on HAL-Inria as follows:
If you use `BifurcationKit.jl` in your work, we ask that you cite the following paper. Open source development as part of academic research strongly depends on this. Please also consider starring this repository if you like our work, this will help us to secure funding in the future. It is referenced on HAL-Inria as follows:

```
@misc{veltz:hal-02902346,
Expand Down
6 changes: 3 additions & 3 deletions src/Continuation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ function continuation!(it::ContIterable, state::ContState, contRes::ContResult)
if contparams.detect_event > 1
status, intervalevent = locate_event!(it.event, it, state, it.verbosity > 2)
end
success, bifpt = get_event_type(it.event, it, state, it.verbosity, status, intervalevent)
success, event_pt = get_event_type(it.event, it, state, it.verbosity, status, intervalevent)
state.stopcontinuation |= ~success
if bifpt.type != :none; push!(contRes.specialpoint, bifpt); end
if event_pt.type != :none; push!(contRes.specialpoint, event_pt); end
# detect loop in the branch
contparams.detect_loop && (state.stopcontinuation |= detect_loop(contRes, bifpt))
contparams.detect_loop && (state.stopcontinuation |= detect_loop(contRes, event_pt))
end
end

Expand Down
10 changes: 5 additions & 5 deletions src/events/EventDetection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ EventSpecialPoint(it::ContIterable, state::ContState, Utype::Symbol, status::Sym
# function to tell the event type based on the coordinates of the zero
function get_event_type(event::AbstractEvent, iter::AbstractContinuationIterable, state, verbosity, status::Symbol, interval::Tuple{T, T}, ind = :) where T
# record information about the event point
userpoint = EventSpecialPoint(state, :user, status, record_from_solution(iter), iter.normC, interval)
userpoint = EventSpecialPoint(iter, state, :user, status, interval)
(verbosity > 0) && printstyled(color=:red, "!! User point at p ≈ $(getp(state)) \n")
return true, userpoint
end
Expand Down Expand Up @@ -280,7 +280,7 @@ function get_event_type(event::AbstractContinuousEvent,
@error "Error, no event was characterized whereas one was detected. Please open an issue at https://github.com/rveltz/BifurcationKit.jl/issues. \n The events are eventValue = $(state.eventValue)"
# we halt continuation as it will mess up the detection of events
state.stopcontinuation = true
return false, EventSpecialPoint(state, Symbol(typeE), status, record_from_solution(iter), iter.normC, interval)
return false, EventSpecialPoint(iter, state, Symbol(typeE), status, interval)
end

if has_custom_labels(event)
Expand Down Expand Up @@ -317,7 +317,7 @@ function get_event_type(event::AbstractDiscreteEvent,
@error "Error, no event was characterized whereas one was detected. Please open an issue at https://github.com/rveltz/BifurcationKit.jl/issues. \n The events are eventValue = $(state.eventValue)"
# we halt continuation as it will mess up the detection of events
state.stopcontinuation = true
return false, EventSpecialPoint(state, Symbol(typeE), status, record_from_solution(iter), iter.normC, interval)
return false, EventSpecialPoint(iter, state, Symbol(typeE), status, interval)
end
if has_custom_labels(event)
typeE = labels(event, event_index_D)
Expand Down Expand Up @@ -352,7 +352,7 @@ function get_event_type(event::PairOfEvents,
@error "Error, no event was characterized whereas one was detected. Please open an issue at https://github.com/rveltz/BifurcationKit.jl/issues. \n The events are eventValue = $(state.eventValue)"
# we halt continuation as it will mess up the detection of events
state.stopcontinuation = true
return false, EventSpecialPoint(state, :PairOfEvents, status, record_from_solution(iter), iter.normC, interval)
return false, EventSpecialPoint(iter, state, :PairOfEvents, status, interval)
end
end

Expand Down Expand Up @@ -391,6 +391,6 @@ function get_event_type(event::SetOfEvents,
@error "Error, no event was characterized whereas one was detected. Please open an issue at https://github.com/rveltz/BifurcationKit.jl/issues. \n The events are eventValue = $(state.eventValue)"
# we halt continuation as it will mess up the detection of events
state.stopcontinuation = true
return false, EventSpecialPoint(state, :SetOfEvents, status, record_from_solution(iter), iter.normC, interval)
return false, EventSpecialPoint(iter, state, :SetOfEvents, status, interval)
end
end
2 changes: 1 addition & 1 deletion src/periodicorbit/Floquet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function (fl::FloquetQaD)(J, nev; kwargs...)
end
####################################################################################################
# ShootingProblem
# Matrix free monodromy operator
# Matrix free monodromy operators
function MonodromyQaD(JacSH::FloquetWrapper{Tpb, Tjacpb, Torbitguess, Tp}, du::AbstractVector) where {Tpb <: ShootingProblem, Tjacpb, Torbitguess, Tp}
sh = JacSH.pb
x = JacSH.x
Expand Down
6 changes: 3 additions & 3 deletions test/stuartLandauTrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ BK.amplitude(rand(101), 4, 25)
BK.maximumPOTrap(rand(101), 4, 25)
####################################################################################################
# tests for constructor of Floquet routines
BK.checkFloquetOptions(EigArpack())
BK.checkFloquetOptions(EigArnoldiMethod())
BK.checkFloquetOptions(EigKrylovKit())
BK.check_floquet_options(EigArpack())
BK.check_floquet_options(EigArnoldiMethod())
BK.check_floquet_options(EigKrylovKit())
FloquetQaD(EigKrylovKit()) |> FloquetQaD
2 changes: 1 addition & 1 deletion test/test_SS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ poguess = VectorOfArray([rand(N) for ii=1:M])
dpoguess = VectorOfArray([rand(N) for ii=1:M])
dpo = BorderedArray(dpoguess, 2.)

# use of AbstractArray structure
# use of AbstractVector structure
pov = vcat(vec(po.u), po.p)
dpov = vcat(vec(dpo.u), dpo.p)
resv = probSh(pov, par)
Expand Down

0 comments on commit 096772d

Please sign in to comment.