rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
DetailedModel.m
1 classdef DetailedModel < LinStat.DetailedModel
2  % Detailed model for the Thermalblock problem.
3  %
4  % This is a specialization of a linear stationary problem with simplified
5  % methods for parameter handling, and a modified output method.
6 
7 
8  methods
9  function dm = DetailedModel(descr)
10  % function dm = DetailedModel(descr)
11  % constructor based on problem description
12  %
13  % Parameters:
14  % descr: structure of type ModelDescr describing the problem and the
15  % discretization
16  dm = dm@LinStat.DetailedModel(descr);
17  end
18 
19  function this=set_mu(this, mu)
20  if length(mu)~=this.descr.number_of_blocks
21  error('length of mu does not fit to number of blocks!');
22  end;
23  this.descr.mus = mu(:);
24  end
25 
26  function mu = get_mu(this)
27  mu = this.descr.mus(:);
28  end
29 
30  function p = plot_sim_data(this, model_data, sim_data, plot_params)
31  % function p = plot_sim_data(dmodel, model_data, sim_data, plot_params)
32  % plots the simulation data as returned by detailed_simulation()
33  %
34  % This method actually calls femdiscfuncplot().
35  %
36  % Parameters:
37  % sim_data: simulation data structure as returned by detailed_simulation()
38  % plot_params: structure which controls the plot output
39  %
40  % Required fields of sim_data:
41  % uh: discrete @ref fem function (c.f. ::femdiscfunc)
42  %
43  % Optional fields of plot_params:
44  % subsampling_level: number of sampling steps for interpolation of discrete
45  % @ref fem functions. (default = 10)
46  % title: title of the plot (default = none)
47  % no_lines: boolean flag indicating whether lines between the
48  % grid cell shall be skipped drawing (default = 1)
49  % plot_blocks: boolean flag indicating whether the thermal blocks
50  % shall be drawn. (default = 1)
51  %
52  % Return values:
53  % p: GUI handle to the created MATLAB figure
54  descr = this.descr;
55  if nargin<4
56  plot_params = [];
57  end;
58  if ~isfield(plot_params,'no_lines')
59  plot_params.no_lines = 1;
60  end;
61  p = plot_sim_data@LinStat.DetailedModel(this, model_data,sim_data,plot_params);
62  % plot coarse mesh
63  if ~isfield(plot_params,'plot_blocks')
64  plot_params.plot_blocks = 1;
65  end;
66  if plot_params.plot_blocks
67  X = [0:1/descr.B1:1];
68  Y = [0:1/descr.B2:1];
69  l1 = line([X;X],...
70  [zeros(1,descr.B1+1);...
71  ones(1,descr.B1+1)]);
72  set(l1,'color',[0,0,0],'linestyle','-.');
73  %keyboard;
74  l2 = line([zeros(1,descr.B2+1);...
75  ones(1,descr.B2+1)],...
76  [Y;Y]);
77  set(l2,'color',[0,0,0],'linestyle','-.');
78  p = [p(:);l1(:);l2(:)];
79  end;
80  end
81  end
82 end
class representing a continous piecewise polynomial function of arbitrary dimension. DOFS correspond to the values of Lagrange-nodes.
Definition: femdiscfunc.m:17
Detailed model for the Thermalblock problem.
Definition: DetailedModel.m:18
Reduced basis implementation for linear stationary PDEs.
Struct with control fields for the analytical PDE functions, the discretization and the parametrizati...
Definition: dummyclasses.c:15
Detailed model for a linear stationary problem with a Finite element discretization.
Definition: DetailedModel.m:18
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.
Definition: plot_sim_data.m:17