1 classdef FVDetailedModelDefault < Greedy.User.IDetailedModel
3 % algorithms
for (time dependent) @ref fv discretizations.
12 % Constructor for this class
16 if ~isfield(descr, 'init_values_algorithm')
17 rbmdmed.descr.init_values_algorithm = @fv_init_values;
19 if ~isfield(descr, 'inner_product_matrix_algorithm')
20 rbmdmed.descr.inner_product_matrix_algorithm = @fv_inner_product_matrix;
25 function UON = orthonormalize(this, model_data, U)
26 % function UON = orthonormalize(model, model_data, U)
31 % This implements an orthonormalization with help of the QR method.
33 % UON = model.orthonormalize(model, model_data, U, eps);
34 UON = model_orthonormalize_qr(this.descr, model_data, U, 1e-10);
37 function U0 = init_values_algorithm(dmodel, model_data)
38 % function UO = init_values_algorithm(model, model_data)
43 % This calls the function pointer defined in the
#descr structure field
44 %
'init_values_algorithm'.
45 U0 = dmodel.
descr.init_values_algorithm(dmodel.descr, model_data);
48 function UV = inner_product(
this, model_data, U, V)
49 %
function UV = inner_product(
this, model_data, U, V)
54 % This uses the
'W'=get_inner_product_matrix() method in order to compute
55 % the inner product `\langle u_h, v_h \rangle = U' W V`
63 function errs = l2_error_sequence_algorithm(U, Uapprox, model_data)
64 % function errs = l2_error_sequence_algorithm(U, Uapprox, model_data)
65 % @copybrief Greedy.User::
IDetailedModell2_error_sequence_algorithm()
67 % @copydetails Greedy.User::
IDetailedModell2_error_sequence_algorithm()
73 function errs = linfty_error_sequence_algorithm(U, Uapprox, model_data)
74 % function errs = linfty_error_sequence_algorithm(U, Uapprox, model_data)
75 % @copybrief Greedy.User::
IDetailedModellinfty_error_sequence_algorithm()
77 % @copydetails Greedy.User::
IDetailedModellinfty_error_sequence_algorithm()
80 errs = fv_linfty_error(U, Uapprox, []);
83 function W = get_inner_product_matrix(model_data)
84 % function W = get_inner_product_matrix(model_data)
87 % @copydetails Greedy.User::
IDetailedModelget_inner_product_matrix()
89 % Required fields of model_data:
90 % W: the inner product matrix
91 % This function returns the inner product matrix stored in 'model_data'