rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
DetailedModel.m
1 classdef DetailedModel < Greedy.User.FVDetailedModelDefault
2  % Detailed model for a linear evolution problem with a @ref fv discretization
3  %
4  % This is a detailed model for a problem of the type
5  % @f{align}
6  % \partial_t u(x;t,\mu) - {\cal L}(t,\mu)[u(x,t;\mu)] &= 0 \qquad &\text{in }& \Omega \times [0, T], \\\\
7  % u(x;0,\mu) &= u_0(x;\mu) \qquad &\text{in }& \Omega \times \{0\}
8  % @f}
9  % with suitable boundary conditions and linear operators
10  % `{\cal L}(t,\mu) : {\cal W} \to {\cal W}` parametrized over the
11  % time-parameter domain `[0,T] \times {\cal M}`.
12  %
13  % The numerical scheme for the numerical solution of this problem is assumed
14  % to be of the following type:
15  % @f{align*}
16  % u_h(\cdot;t^0,\mu) &= {\cal M}_h[u_0] \\\\
17  % \left(\text{Id} - \Delta t^k {\cal L}_{h, I}(t^{k+1},\mu)\right)[u_h(\cdot;t^{k+1},\mu)]
18  % &=
19  % \left(\text{Id} + \Delta t^k {\cal L}_{h, E}(t^{k},\mu)\right)[u_h(\cdot;t^{k},\mu)]
20  % @f}
21  % with the following ingredients:
22  % - a time discretization `0 = t^0 \leq t^1 = t^0 + \Delta t^0 \leq \ldots
23  % \leq t^{K+1} = t^{K} + \Delta t^{K} = T`,
24  % - solution snapshots `u_h(\cdot;t,\mu) \in { cal W }_h ` for all
25  % parameters and time instances `(t,\mu) \in [0,T] \times { \cal M }`
26  % - separable operators for the discretization `{\cal L}_{h, I}(t,\mu):{\cal
27  % W}_h \to {\cal W}_h`, `{\cal L}_{h, E}(t,\mu):{\cal W}_h \to {\cal W}_h`
28  % and separable initial data `u_0` in the parameter argument. That is these
29  % must be decomposable like
30  % @f{align*}
31  % {\cal L}_{h, *}(t,\mu) &= \sum_{q=1}^{q_*} \sigma_*^q(\mu) {\cal L}^q_{h, *}(t) \\\\
32  % u_0(x;\mu) &= \sum_{q=1}^{u_0} \sigma_{u_0}^q(\mu) u_0(x)
33  % @f} and
34  % - a projection operator `{\cal M}_h : {\cal W} \to {\cal W}_h`
35 
36 
37  properties(Constant)
38  % This constant is used for a consistency check of the model descr with
39  % help of Greedy.Remove.IDetailedModelBase.struct_check()
40  ddescr_checks = struct(...
41  'mass_matrix', {{@(x) isequal(class(x), 'function_handle')}}...
42  );
43  end
44  methods
45  function dm = DetailedModel(descr)
46  % function dm = DetailedModel(descr)
47  % constructor based on problem description
48  %
49  % Parameters:
50  % descr: structure describing the problem and the descretization
51  dm = dm@Greedy.User.FVDetailedModelDefault(descr);
52  if ~IDetailedModel.struct_check(descr, ...
54  error('Consistency check for LinEvol.DetailedModel failed.');
55  end
56  end
57 
58  sim_data = detailed_simulation(this, model_data);
59 
60  model_data = gen_model_data(model);
61 
62  p = plot_sim_data(dmodel, model_data, sim_data, plot_params);
63  end
64 
65  methods (Static)
66 
67  function U = get_dofs_from_sim_data(sim_data)
68 
69  U = sim_data.U;
70  end
71  function snapshot = get_dofs_at_time(U, time_index)
72 
73  snapshot = U(:, time_index);
74  end
75  end
76 
77 end
static function ok = struct_check(descr, checks)
executes checks on the fields of a structure object
Definition: IModel.m:210
Reduced basis implementation for linear evolution equations.
Interface classes to be implemented by the Greedy.Algorithm user.
static const ddescr_checks
This constant is used for a consistency check of the model descr with help of Greedy.Remove.IDetailedModelBase.struct_check()
Definition: DetailedModel.m:63
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.
Definition: plot_sim_data.m:17
Customizable implementation of an abstract greedy algorithm.
Definition: DuneRBLeafNode.m:1
Detailed model for a linear evolution problem with a Finite volume discretization.
Definition: DetailedModel.m:18