Skip to content

Commit 1d827c5

Browse files
authored
Merge pull request #3 from sbryngelson/viz
2 parents 3bacc8a + 5590f82 commit 1d827c5

File tree

4 files changed

+403
-214
lines changed

4 files changed

+403
-214
lines changed

config.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@
150150
config.visualization.plot_tick_x = [-5, 0, 5, 10, 15];
151151
config.visualization.color_axis_range = 1e-0;
152152

153+
% Live visualization (disabled in CI/tests)
154+
config.visualization.live_enable = true; % Show live heatmap during simulation
155+
config.visualization.live_frequency = 10; % Update every N steps
156+
config.visualization.heatmap_nx = 200; % Heatmap grid resolution in x
157+
% ny is inferred from domain aspect ratio to keep pixels square-ish
158+
153159
%% Logging and Debug Parameters
154160
% Master debug switch - set to true to enable all debug features
155161
debug_master = false; % Master switch for all debug features

simulate.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,12 @@
732732
end
733733
end
734734

735+
% Live max-|V| heatmap every N steps (interactive only)
736+
if doPlot && ~isCI && ~isTest && isfield(cfg.visualization, 'live_enable') && cfg.visualization.live_enable && ...
737+
mod(j, cfg.visualization.live_frequency) == 0
738+
visualization('live_heatmap', cfg, xy1, W(:, j + 1), j, x_min, x_max, y_min, y_max);
739+
end
740+
735741
% Advance simulation time (using current dt, which may have been adapted)
736742
current_time = current_time + dt;
737743
end
@@ -840,4 +846,4 @@
840846
fprintf('=====================================\n\n');
841847

842848
%% 11) Visualization of final results
843-
visualize_final(cfg, doPlot, xy1, W0, Nt, x_min, x_max, y_min, y_max, Dx, Dy);
849+
visualization('final', cfg, doPlot, xy1, W0, Nt, x_min, x_max, y_min, y_max, Dx, Dy);

0 commit comments

Comments
 (0)