-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
297 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "BifurcationKit" | ||
uuid = "0f109fa4-8a5d-4b75-95aa-f515264e7665" | ||
authors = ["Romain Veltz <[email protected]>"] | ||
version = "0.3.6" | ||
version = "0.3.7" | ||
|
||
[deps] | ||
ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d" | ||
|
@@ -22,7 +22,6 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" | |
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
Requires = "ae029012-a4dd-5104-9daa-d747884805df" | ||
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" | ||
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" | ||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | ||
|
@@ -42,14 +41,23 @@ LinearMaps = "2.7, ^3.0" | |
OrdinaryDiffEq = "^6.33" | ||
Parameters = "0.12.3" | ||
PreallocationTools = "0.4.1" | ||
RecipesBase = "1.0, 1.1" | ||
RecipesBase = "1.0, 1.1, 1.3" | ||
RecursiveArrayTools = "^2.3, ^2.4, ^2.8, ^2.9, ^3" | ||
Reexport = "1.2.2" | ||
Requires = "1.1.2" | ||
SciMLBase = "^1, ^2" | ||
Setfield = "0.5.0, 0.7.0, 0.8.0, ^1.1" | ||
StructArrays = "0.4, ^0.6" | ||
julia = "1.5" | ||
julia = "1.9" | ||
|
||
[weakdeps] | ||
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" | ||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | ||
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" | ||
|
||
[extensions] | ||
JLD2Ext = "JLD2" | ||
PlotsExt = "Plots" | ||
GLMakieExt = "GLMakie" | ||
|
||
[extras] | ||
AbstractDifferentiation = "c29ec348-61ec-40c8-8164-b8c60e9d9f3d" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module GLMakieExt | ||
using GLMakie, BifurcationKit | ||
import BifurcationKit: plot, | ||
plot!, | ||
hasbranch, | ||
plot_branch_cont, | ||
plot_periodic_potrap, | ||
plot_periodic_shooting!, | ||
plot_periodic_shooting, | ||
plot_eigenvals, | ||
compute_eigenelements, | ||
get_lens_symbol, | ||
_getfirstusertype, | ||
ContResult, | ||
DCResult, | ||
AbstractBranchResult, | ||
get_plot_vars, | ||
get_axis_labels, | ||
_hasstability, | ||
filter_bifurcations, | ||
get_color, | ||
colorbif, | ||
get_plot_backend, | ||
BK_Makie | ||
|
||
# TODO block precompilation | ||
get_plot_backend() = BK_Makie() | ||
include("plot.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module JLD2Ext | ||
using JLD2, BifurcationKit | ||
import BifurcationKit: save_to_file, AbstractContinuationIterable, ContResult | ||
include("save.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" | ||
Save solution / data in JLD2 file | ||
- `filename` is for example "example.jld2" | ||
- `sol` is the solution | ||
- `p` is the parameter | ||
- `i` is the index of the solution to be saved | ||
""" | ||
function save_to_file(iter::AbstractContinuationIterable, sol, p, i::Int64, br::ContResult) | ||
if iter.contparams.save_to_file == false; return nothing; end | ||
filename = iter.filename | ||
# this allows to save two branches forward/backward in case | ||
# bothside = true is passed to continuation | ||
fd = iter.contparams.ds >=0 ? "fw" : "bw" | ||
|
||
# create a group in the JLD format | ||
jldopen(filename*".jld2", "a+") do file | ||
if haskey(file, "sol-$fd-$i") | ||
delete!(file, "sol-$fd-$i") | ||
end | ||
mygroup = JLD2.Group(file, "sol-$fd-$i") | ||
mygroup["sol"] = sol | ||
mygroup["param"] = p | ||
end | ||
|
||
jldopen(filename*"-branch.jld2", "a+") do file | ||
if haskey(file, "branch"*fd) | ||
delete!(file, "branch"*fd) | ||
end | ||
file["branch"*fd] = br | ||
end | ||
end | ||
|
||
# final save of branch, in case bothsided = true is used | ||
function save_to_file(iter::AbstractContinuationIterable, br::ContResult) | ||
if iter.contparams.save_to_file == false; return nothing; end | ||
filename = iter.filename | ||
|
||
jldopen(filename*"-branch.jld2", "a+") do file | ||
if haskey(file, "branchfw") | ||
delete!(file, "branchfw") | ||
end | ||
if haskey(file, "branchbw") | ||
delete!(file, "branchbw") | ||
end | ||
if haskey(file, "branch") | ||
delete!(file, "branch") | ||
end | ||
file["branch"] = br | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module PlotsExt | ||
using Plots, BifurcationKit | ||
import BifurcationKit: plot_branch_cont, | ||
plot_periodic_potrap, | ||
plot_periodic_shooting!, | ||
plot_periodic_shooting, | ||
plot_eigenvals, | ||
compute_eigenelements, | ||
get_lens_symbol, | ||
_getfirstusertype, | ||
ContResult, | ||
DCResult, | ||
AbstractBranchResult, | ||
get_plot_vars, | ||
get_axis_labels, | ||
_hasstability, | ||
filter_bifurcations, | ||
get_color, | ||
AbstractResult | ||
|
||
include("plot.jl") | ||
end |
Oops, something went wrong.