Merge branch 'feat/diff_model' into feat/diff_Jaguar
commit
5b1a6f92b0
|
|
@ -108,8 +108,9 @@ function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
|
|||
|
||||
run_label = Observable("Run")
|
||||
stepsize = Observable(30)
|
||||
spoint = select_point(ax.scene)
|
||||
|
||||
# Controls
|
||||
# # Controls
|
||||
fig[2, 1] = buttongrid = GridLayout(ax.scene, tellwidth=false)
|
||||
btn_step = Button(buttongrid[1, 1], width=60, label="Step")
|
||||
btn_start = Button(buttongrid[1, 2], width=60, label=run_label)
|
||||
|
|
@ -164,7 +165,8 @@ function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
|
|||
|
||||
if !running[]
|
||||
running[] = true
|
||||
U .= 1.0; V .= 0.0
|
||||
U .= 1.0
|
||||
V .= 0.0
|
||||
@async while running[]
|
||||
multi_step!((U, V), stepsize[], heat_obs, params_obs)
|
||||
sleep(0.0015)
|
||||
|
|
@ -179,7 +181,27 @@ function build_ui(U, V, Du, Dv, F, k, params_obs, heat_obs)
|
|||
running[] = false
|
||||
reset!(U, V, heat_obs)
|
||||
end
|
||||
on(spoint) do pt
|
||||
r = 5
|
||||
if pt === nothing
|
||||
return
|
||||
end
|
||||
x, y = pt
|
||||
println("params_obs[].N, ", params_obs[].N)
|
||||
i, j = coord_to_index(x, y, params_obs[].N)
|
||||
|
||||
# get corners of square that will get filled with concentration
|
||||
imin = max(i - r, 1)
|
||||
imax = min(i + r, params_obs[].N)
|
||||
jmin = max(j - r, 1)
|
||||
jmax = min(j + r, params_obs[].N)
|
||||
|
||||
# set disbalanced concentration of U and V
|
||||
U[imin:imax, jmin:jmax] .= 0.5
|
||||
V[imin:imax, jmin:jmax] .= 0.25
|
||||
|
||||
heat_obs[] = copy(U)
|
||||
end
|
||||
return fig
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue