4 % This is a detailed model
for a problem of
this type
9 % This constant is used
for a consistency check of the model descr with
10 % help of DetailedModelBaseIf.struct_check()
12 % This check is only executed
if we use a Newton scheme
13 newton_checks =
struct(...
14 'newton_steps', {{@isscalar}},...
15 'newton_epsilon', {{@isscalar}}...
19 properties (Dependent)
20 % current time instance
28 %
boolean flag indicating whether conditions of system matrices shall be computed.
29 compute_conditions =
false;
37 % This checks and stores the model description structure
39 % Required fields of descr:
40 % newton_solver:
boolean flag indicating whether we are
using a Newton
41 % scheme
for the discretization.
44 error(
'Consistency check of description for Newton solver problems failed!');
48 sim_data = detailed_simulation(model, model_data);
50 sim_data = detailed_simulation_galerkin(model, detailed_data);
52 sim_data = detailed_simulation_impes(model, model_data);
54 model_data = gen_model_data(model);
58 function plot_error_sequence(dmodel, errs)
59 if length(errs.S) == dmodel.descr.nt+1
60 times = 0:dmodel.descr.dt:dmodel.descr.T;
62 times = 1:length(errs.S);
64 plot(times, errs.S, 'k-', times, errs.U, 'b:', times, errs.P, 'r-.');
65 legend('S', 'U', 'P');
71 function U = get_dofs_from_sim_data(sim_data)
73 if isfield(sim_data, 'Stemp');
74 U.S = [sim_data.S, sim_data.Stemp];
75 U.P = [sim_data.P, sim_data.Ptemp];
76 U.U = [sim_data.U, sim_data.Utemp];
84 function snapshot = get_dofs_at_time(sim_data, time_index)
86 snapshot.S = sim_data.S(:,time_index);
87 snapshot.U = sim_data.U(:,time_index);
88 snapshot.P = sim_data.P(:,time_index);
94 function t = get.t(this)
98 function set.t(this, t)
102 function tstep = get.tstep(this)
103 tstep = this.descr.tstep;
106 function set.tstep(this, tstep)
107 this.descr.tstep = tstep;
112 function errs = l2_error_sequence_algorithm(U, Uapprox, model_data)
113 if size(U, 1) == model_data.grid.nelements
116 A = model_data.diamondWinv;
121 function errs = l2_error_sequence_complete(U, Uapprox, model_data)
122 errs.S =
fv_l2_error(U.S, Uapprox.S, model_data.W);
123 errs.U =
fv_l2_error(U.U, Uapprox.U, model_data.diamondWinv);
124 errs.P =
fv_l2_error(U.P, Uapprox.P, model_data.W);
127 function errs = linfty_error_sequence_complete(U, Uapprox, model_data)
static const newton_checks
This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.st...
static function ok = struct_check(descr, checks)
executes checks on the fields of a structure object
function linfty_error = fv_linfty_error(U1, U2, W)
compute the infinity-norm error between two Dof vectors.
Interface classes to be implemented by the Greedy.Algorithm user.
Interface specialization of an IDetailedModel ready to use with Greedy algorithms for (time dependent...
IDetailedModel implementation for a two phase flow system.
This is the interface for a detailed model providing methods to compute high dimensional simulation s...
function l2_error = fv_l2_error(U1, U2, W)
function computing the l2-error between the two fv-functions or function sequences in U1...
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.