1 classdef DetailedModel < Greedy.User.FVDetailedModelDefault
2 % a test model doing nothing
4 % In
this detailed model only the name of the called member
function is
5 % printed. Such it enables to
set-up Greedy algorithms and check wether the
6 % functions are called in the correct order.
9 function dmei = DetailedModel(descr)
10 % function dm = DetailedModel(descr)
11 % constructor based on problem description
14 % descr: structure of type ModelDescr describing the problem and the
16 dmei = dmei@Greedy.User.FVDetailedModelDefault(descr);
21 function model_data = gen_model_data(
this)
22 disp('calling model_data');
25 if isfield(this.descr, 'gsize')
26 gsize = this.descr.gsize;
30 gp.xnumintervals = gsize(1);
31 gp.ynumintervals = gsize(2);
33 model_data.W = fv_mass_matrix([], model_data.grid, []);
36 function sim_data = detailed_simulation(this, model_data)
37 % function sim_data = detailed_simulation(this, model_data)
41 disp('calling detailed_simulation');
45 xvals = g.CX(g.CY==miny);
46 if isfield(this.descr, 'xfun')
47 xdata = this.descr.xfun(this.descr, xvals);
50 xdata = ones(length(xvals), 1);
53 yvals = g.CY(g.CX==minx);
54 if isfield(this.descr, 'yfun')
55 ydata = this.descr.yfun(this.descr, yvals);
58 ydata = ones(length(yvals), 1);
62 sim_data.U = kron(ydata, xdata);
64 sim_data.U = sum(get_mu(this)) * ones(model_data.grid.nelements,this.descr.nt);
68 function p =
plot_sim_data(this, model_data, sim_data, plot_params)
69 % function sim_data = detailed_simulation(this, model_data[, plot_params])
77 p =
fv_plot(model_data.grid, this.get_dofs_from_sim_data(sim_data), plot_params);
82 function U = get_dofs_from_sim_data(sim_data)
83 disp('calling get_dofs_from_sim_data');
87 function snapshot = get_dofs_at_time(sim_data, time_index)
88 snapshot = sim_data(:,time_index);