Skip to content

Commit

Permalink
no halo points on output
Browse files Browse the repository at this point in the history
  • Loading branch information
johnryantaylor committed Jan 31, 2025
1 parent 1bd3af6 commit e05e1d9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion Project1/gravitycurrent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ simulation.output_writers[:xz_slices] =
filename = filename * ".jld2",
indices = (:, 1, :),
schedule = TimeInterval(0.2),
overwrite_existing = true)
overwrite_existing = true,
with_halos = false)

# If you are running in 3D, you could save an xy slice like this:
#simulation.output_writers[:xy_slices] =
Expand Down
14 changes: 7 additions & 7 deletions Project1/plot_gravitycurrent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ anim = @animate for (i, iter) in enumerate(iterations)

@info "Drawing frame $i from iteration $iter..."

u_xz = file_xz["timeseries/u/$iter"][1:Nx+1, 1, 1:Nz];
v_xz = file_xz["timeseries/v/$iter"][1:Nx, 1, 1:Nz];
w_xz = file_xz["timeseries/w/$iter"][1:Nx, 1, 1:Nz+1];
b_xz = file_xz["timeseries/b/$iter"][1:Nx, 1, 1:Nz];
c_xz = file_xz["timeseries/c/$iter"][1:Nx, 1, 1:Nz];
u_xz = file_xz["timeseries/u/$iter"][:, 1, :];
v_xz = file_xz["timeseries/v/$iter"][:, 1, :];
w_xz = file_xz["timeseries/w/$iter"][:, 1, :];
b_xz = file_xz["timeseries/b/$iter"][:, 1, :];
c_xz = file_xz["timeseries/c/$iter"][:, 1, :];

# If you want an x-y slice, you can get it this way:
# b_xy = file_xy["timeseries/b/$iter"][:, :, 1];

t = file_xz["timeseries/t/$iter"];

# Save some variables to plot at the end
b_bottom[:,i] = b_xz[:, 3, 1]; # This is the buouyancy along the bottom wall
b_bottom[:,i] = b_xz[:, 1, 1]; # This is the buouyancy along the bottom wall
t_save[i] = t # save the time

u_xz_plot = heatmap(xu, zu, u_xz'; color = :balance, xlabel = "x", ylabel = "z", aspect_ratio = :equal);
Expand All @@ -66,7 +66,7 @@ anim = @animate for (i, iter) in enumerate(iterations)
c_title = @sprintf("c (dye), t = %s", round(t));

# Combine the sub-plots into a single figure
plot(b_xz_plot, c_xz_plot, layout = (2, 1), size = (1600, 400),
plot(b_xz_plot, u_xz_plot, layout = (2, 1), size = (1600, 400),
title = [b_title c_title])

iter == iterations[end] && close(file_xz)
Expand Down
5 changes: 3 additions & 2 deletions Project2/KH.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ simulation.output_writers[:xz_slices] =
JLD2OutputWriter(model, (; u, v, w, b, ω, χ, ϵ),
filename = filename * ".jld2",
indices = (:, 1, :),
schedule = TimeInterval(0.2),
overwrite_existing = true)
schedule = TimeInterval(0.2),
with_halos = false,
overwrite_existing = true)

nothing # hide

Expand Down
14 changes: 7 additions & 7 deletions Project2/plot_KH.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ anim = @animate for (i, iter) in enumerate(iterations)

@info "Drawing frame $i from iteration $iter..."

u_xz = file_xz["timeseries/u/$iter"][1:Nx+1, 1, 1:Nz];
v_xz = file_xz["timeseries/v/$iter"][1:Nx, 1, 1:Nz];
w_xz = file_xz["timeseries/w/$iter"][1:Nx, 1, 1:Nz+1];
b_xz = file_xz["timeseries/b/$iter"][1:Nx, 1, 1:Nz];
ω_xz = file_xz["timeseries/ω/$iter"][1:Nx, 1, 1:Nz+1];
χ_xz = file_xz["timeseries/χ/$iter"][1:Nx, 1, 1:Nz];
ϵ_xz = file_xz["timeseries/ϵ/$iter"][1:Nx, 1, 1:Nz];
u_xz = file_xz["timeseries/u/$iter"][:, 1, :];
v_xz = file_xz["timeseries/v/$iter"][:, 1, :];
w_xz = file_xz["timeseries/w/$iter"][:, 1, :];
b_xz = file_xz["timeseries/b/$iter"][:, 1, :];
ω_xz = file_xz["timeseries/ω/$iter"][:, 1, :];
χ_xz = file_xz["timeseries/χ/$iter"][:, 1, :];
ϵ_xz = file_xz["timeseries/ϵ/$iter"][:, 1, :];

t = file_xz["timeseries/t/$iter"];

Expand Down

0 comments on commit e05e1d9

Please sign in to comment.