4 % a minimal-example of size = size(input) with the following matrices:
5 % A =(1 0 0 ... 1 b = (0 K = (1 0 ... 0
6 % 1 1 0 ... 0 0 0 1 0 ... 0
7 % 0 1 1 0 ... 0 ... 0 0 1 0 ... 0
9 % 0 ... 0 1) 0 .... 0 1)
11 % with A^1 = K and A^2 holding the rest of A so that A = (1-mu)*A^1 + mu*A^2
12 % This is coercive for mu = 0 (with alpha = beta = 1) and inf-sup stable
13 % (but not coercive) for mu = 1.
14 % This minimal model is used in the
scm_demo to proof, that the 'lin_stat'
15 % inf-sup code is actually working.
17 % Dominik Garmatter 20.09 2012
22 if ceil(size/2) == size/2
25 error('size has to be an even positiv number')
29 model.rb_problem_type = 'lin_stat';
31 model.set_mu = @set_mu_default;
32 model.get_mu = @get_mu_default;
33 model.gen_model_data = @scm_minimal_model_gen_model_data;
34 model.get_inner_product_matrix = @(model_data) model_data.inner_product_matrix;
35 model.mu_names = {
'mu'};
37 model.mu_ranges = {[1e-10 1]};
38 model.decomp_mode = 0;
39 model.operators = @scm_minimal_model_operators;
42 model.scm_M_alpha = 70;
43 model.scm_M_plus = 200;
44 model.scm_eps_tol = eps;
45 model.scm_size_C = 50;
47 function model_data = scm_minimal_model_gen_model_data(model)
50 model_data.inner_product_matrix = speye(model.size);
53 function [A,b] = scm_minimal_model_operators(model, model_data)
56 if ~isfield(model, 'decomp_mode')
57 model.decomp_mode = 0;
63 decomp_mode = model.decomp_mode;
66 A = (1-model.mu)*speye(H) + model.mu*(sparse(diag(ones(H-1,1),-1)) + sparse(1,H,1,H,H,1));
67 elseif decomp_mode == 1
69 A = {speye(H); sparse(diag(ones(H-1,1),-1)) + sparse(1,H,1,H,H,1)};
70 else % decomp_mode = 2
72 A = [1-model.mu; model.mu];
function r = verbose(level, message, messageId)
This function displays messages depending on a message-id and/or a level. Aditionally you can set/res...
function scm_demo()
scm_demo.m a simple demo script which produces scm_offline_data for the inf-sup constant of the scm_m...
function scm_offline_data = scm_offline(model, detailed_data, M_train, D_train)
scm_offline_data = scm_offline(model, detailed_data, M_train, D_train)
function model = scm_minimal_model(size)
model = scm_minimal_model(size)