Mercurial > repos > public > sbplib
annotate +anim/setup_surf_plot.m @ 1012:1e437c9e5132 feature/advectionRV
Create residual viscosity package +rv and generalize the ResidualViscosity class
- Generalize residual viscosity, by passing user-defined flux and calculating the time derivative outside of the update.
- Create separate RungekuttaRV specifically using interior RV updates
- Separate the artifical dissipation operator from the scheme AdvectionRV1D so that the same scheme can be reused for creating the diff op used by the ResidualViscosity class
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 05 Dec 2018 13:44:10 +0100 |
parents | f87003695677 |
children |
rev | line source |
---|---|
0 | 1 function [update_data,figure_handle] = setup_2d_plot(x,y,z_lim,zfun) |
2 default_arg('zfun',@(z)z); | |
3 | |
4 Z = zeros(length(y),length(x)); | |
5 figure_handle = figure; | |
6 plot_handle = surf(x,y,Z); | |
7 plot_handle.LineStyle = 'none'; | |
8 axis_handle = gca; | |
9 | |
10 xlabel('x') | |
11 ylabel('y') | |
12 xlim([x(1) x(end)]); | |
13 ylim([y(1) y(end)]); | |
14 zlim(z_lim); | |
15 caxis(z_lim); | |
16 % axis vis3d | |
17 % colormap(parula(256)) | |
18 % colorbar | |
19 | |
20 function update(t,z) | |
21 Z = zfun(z); | |
22 % Z = reshape(zfun(z),length(x),length(y)); | |
23 if ishandle(plot_handle) && ishandle(axis_handle) | |
24 set(plot_handle,'ZData',Z) | |
25 title(axis_handle,sprintf('T=%.3f',t)); | |
26 end | |
27 end | |
28 update_data = @update; | |
29 end |