1 function p =
plot_sim_data(dmodel, model_data, sim_data, plot_params)
2 %
function plot_sim_data(descr, model_data, sim_data, plot_params)
3 % plots the simulation data as returned by detailed_simulation()
6 % sim_data: simulation data structure as returned by detailed_simulation()
7 % plot_params: structure which controls the plot output
9 % Optional fields of plot_params:
10 % plot:
function pointer to a
function plotting a single snapshot
11 %
for a specific time instant. (
default =
'descr.plot')
14 % p : Matlab GUI handle to figure window
16 %
function plotting simulation results
18 if isfield(plot_params,
'plot')
19 pplot = plot_params.plot;
21 if isfield(dmodel.descr,
'plot')
22 pplot = dmodel.descr.plot;
28 UP_data.P = sim_data.P;
29 UP_data.U = sim_data.U;
30 UP_data.gEI = model_data.gEI;
32 data = { sim_data.S, sim_data.S, sim_data.P, UP_data };
33 plot_params.index = { 1, 2, 3, 4 };
34 plot_params.plot_type = {
'contour',
'patch',
'patch',
'contour' };
35 plot_params.plot = { pplot, pplot, pplot, @pu_plot };
41 function p = pu_plot(grid, sim_data, plot_params)
43 plot_params.plot_type = 'contour';
44 p =
fv_plot(grid, sim_data.P(:, sim_data.t), plot_params);
46 NBI_pos_dir = grid.NBI > repmat((1:grid.nelements)', 1, 4) | grid.NBI < 0;
47 UU = sim_data.U(:, sim_data.t);
48 UU = UU(sim_data.gEI(NBI_pos_dir));
49 ECX = grid.ECX(NBI_pos_dir);
50 ECY = grid.ECY(NBI_pos_dir);
51 NX = grid.NX (NBI_pos_dir);
52 NY = grid.NY (NBI_pos_dir);
53 quiver(ECX(:), ECY(:), UU.*NX(:), UU.*NY(:));
function p = fv_plot(gridbase grid, dofs, params)
routine plotting a single fv function of fv_functions.
function p = plot_subplot_sequence(varargin)
plotting a sequence of data slices on polygonal 2d grid (constructed from params if empty) and provid...
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.