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
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);
function p = fv_plot(gridbase grid, dofs, params)
routine plotting a single fv function of fv_functions.
A cartesian rectangular grid in two dimensions with axis parallel elements.
Struct with control fields for the analytical PDE functions, the discretization and the parametrizati...
Interface classes to be implemented by the Greedy.Algorithm user.
Interface specialization of an IDetailedModel ready to use with Greedy algorithms for (time dependent...
This is the interface for a detailed model providing methods to compute high dimensional simulation s...
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.
Customizable implementation of an abstract greedy algorithm.