From 380d9aa228f7eb32d5bc54db84bf479fb072c209 Mon Sep 17 00:00:00 2001 From: 2211567 Date: Tue, 17 Jun 2025 16:04:03 +0200 Subject: [PATCH] implemented basic wave pattern instead of animal pattern --- src/utils/templates.jl | 20 ++++++++++---------- src/visualization.jl | 19 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/utils/templates.jl b/src/utils/templates.jl index e328085..bd7ce48 100644 --- a/src/utils/templates.jl +++ b/src/utils/templates.jl @@ -18,7 +18,7 @@ function blocks_ic(N) safe_block!(u, p, p) - return vec(u), vec(v) + return u, v end function column_ic(N) @@ -80,7 +80,7 @@ function two_rows_edge_distance_ic(N) # Apply the second column u[:, col2_start:col2_end] .= -0.01 - return vec(u), vec(v) + return u, v end function center_band_ic(N) @@ -94,7 +94,7 @@ function center_band_ic(N) u[row_start:row_end, :] .= 0.1 .+ 0.01 .* randn(band_width + 1, N) v[row_start:row_end, :] .= 0.1 .+ 0.01 .* randn(band_width + 1, N) - return vec(u), vec(v) + return u, v end function circle_ic(N) @@ -109,7 +109,7 @@ function circle_ic(N) end end - return vec(u), vec(v) + return u, v end function three_circles_random_ic(N) @@ -165,21 +165,21 @@ function squiggle_ic(N, Lx=400.0, Ly=400.0) # Apply squiggle u[Z.>0.8] .= uminus - return vec(u), vec(v) + return u, v end function coral_ic(N) - u = fill(0.534522, N, N) - v = fill(0.381802, N, N) + u = ones(N, N) + v = zeros(N, N) - for _ in 1:20 # place 15 noisy seeds - i, j = rand(10:N-10), rand(10:N-10) + for _ in 1:150 # place 15 noisy seeds + i, j = rand(5:N-5), rand(5:N-5) u[i-2:i+2, j-2:j+2] .= -0.534522 .+ 0.2 * rand(5, 5) end return u, v end -export blocks_ic, column_ic, squiggle_ic, three_circles_random_ic, circle_ic, center_band_ic, two_rows_edge_distance_ic, coral_ic +export blocks_ic, column_ic, squiggle_ic, three_circles_random_ic, circle_ic, center_band_ic, two_rows_edge_distance_ic, coral_ic, stripe_ic end \ No newline at end of file diff --git a/src/visualization.jl b/src/visualization.jl index ad12daa..be67517 100644 --- a/src/visualization.jl +++ b/src/visualization.jl @@ -101,10 +101,9 @@ function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs) gh[1, 2] = templategrid = GridLayout(ax.scene, tellwidth=false) templategrid[1, 1] = Label(fig, "Templates:") - btn_zebra = Button(templategrid[1, 2], width=100, label="Zebra Stripes") + btn_waves = Button(templategrid[1, 2], width=100, label="Wave Pattern") btn_cow = Button(templategrid[1, 3], width=100, label="Cow Spots") btn_cheetah = Button(templategrid[1, 4], width=100, label="Cheetah Spots") - #btn_coral = Button(templategrid[1, 4], width=100, label="Coral Pattern") # place all the parameter boxes gh[2, 2] = textboxgrid = GridLayout(ax.scene, tellwidth=false) @@ -171,18 +170,18 @@ function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs) end # Template Control - on(btn_zebra.clicks) do _ + on(btn_waves.clicks) do _ # add column to center of matrix - U, V = Templates.column_ic(params_obs[].N) + U, V = Templates.blocks_ic(params_obs[].N) - hm.colormap[] = :grayC + hm.colormap[] = :viridis # change params - param_obs_map.Du[] = 1.0 - param_obs_map.Dv[] = 2.0 - param_obs_map.ϵ[] = 0.3 - param_obs_map.a[] = 0.0 - param_obs_map.b[] = 1.4 + param_obs_map.Du[] = 0.0008 + param_obs_map.Dv[] = 0.1 + param_obs_map.ϵ[] = 0.01 + param_obs_map.a[] = 0.5 + param_obs_map.b[] = 0.15 heat_obs[] = copy(U) end