32 lines
850 B
Julia
32 lines
850 B
Julia
include("../src/AnimalFurFHN.jl") # this loads the module code
|
|
using .AnimalFurFHN
|
|
# include optional visualizer only if needed:
|
|
include("../src/visualization.jl")
|
|
using .Visualization
|
|
|
|
N = 256
|
|
# tspan = (0.0, 1000.0)
|
|
|
|
# sol = AnimalFurFHN.run_simulation(tspan, N)
|
|
|
|
|
|
# Visualization.step_through_solution(sol, N)
|
|
|
|
using Plots
|
|
|
|
function animate_gray_scott(sol, N; var=:U)
|
|
anim = @animate for t in 1:length(sol.t)
|
|
u = reshape(sol[t][1:N^2], N, N)
|
|
v = reshape(sol[t][N^2+1:end], N, N)
|
|
data = var == :U ? u : v
|
|
Plots.heatmap(data, c=:magma, title="$var at t=$(Int(sol.t[t]))", clims=(0, 1))
|
|
end
|
|
gif(anim, "gif/gray_scott.gif", fps=15)
|
|
end
|
|
|
|
# set time to more than 1000
|
|
sol = AnimalFurFHN.run_simulationG((0.0, 10000.0), 256)
|
|
|
|
Visualization.step_through_solution(sol, N)
|
|
# animate_gray_scott(sol, 256, var=:U)
|