rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
couple_N_and_M_by_c.m
Go to the documentation of this file.
1 function model = couple_N_and_M_by_c(model, c)
2 % function model = couple_N_and_M_by_c(model, c)
3 % modifies the reduced basis size fields of 'model' by a single variable.
4 %
5 % Parameters:
6 % c: sets the reduced basis sizes to
7 % `(N,M) = c (N_{\mbox{max}}, c_{MbyN} N_{\mbox{max}})`. For time-adaptive
8 % schemes with several collateral reduced basis spaces, the following
9 % formula is applied: `(N,M^k) = c (N_{\mbox{max}}), c_{MbyN}
10 % \frac{M^k_{\mbox{max}}}{\mbox{max}_{k=0,...,K} M^k_{\mbox{max}}}
11 % N_{\mbox{max}}.`
12 %
13 % Required fields of model:
14 % Nmax : maximum number of reduced basis vectors
15 % Mmax : maximum number of collateral reduced basis vectors
16 % M_by_N_ratio : ratio constant `c_{MbyN}` fixing the ratio between
17 % collateral and reduced basis vector numbers
18 %
19  model.N = max(round(c*model.Nmax),1);
20  maxMmax = max(model.Mmax);
21  model.M = arrayfun(@(x) min(x,max(round(c*x/maxMmax*model.M_by_N_ratio*model.Nmax),1)), model.Mmax);
22 end
function model = couple_N_and_M_by_c(model, c)
modifies the reduced basis size fields of model by a single variable.