rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
SCM.m
1 function SCM_data = SCM(model,params,operator,innerproduct_matrix)
2 %function SCM_data = SCM(model,params,operator,innerproduct_matrix)
3 
4 % Offline programm of the successive constraint method (scm) for stability
5 % factors.
6 %
7 % Requires
8 % model : standard model
9 % params: parameters for the scm algorithm (see below)
10 % operator: (function handle or model_data) returning the system matrix
11 % function handle could be (operator =@ (model) model.operators(model,operator);
12 % the funtion operator should depend on model.decomp_mode
13 % innerproduct_matrix: if operator==model_data, the innerpoduct_matrix is optional
14 %
15 %
16 % For simple cases, the call SCM_data=SCM(model,params,model_data) is also
17 % possible.
18 %
19 % Returns SCM_data, which is necessary for scm online computations
20 % via SCMonline (not SCM_online).
21 %
22 % See scm_coercive_demo() or scm_infsup_demo() for demonstrations
23 %
24 %
25 % scm parameters (default values are set in scm_infsup_greedy
26 % or scm_coercive_demo):
27 %
28 % params.type = 'coercive' : Decides which algorithm is used and
29 % = 'infsup' which constant should be computed
30 %
31 % params.Ma = int : number of parameters with an already
32 % computed constant near to mu
33 % params.Mp = int : number of parameters without computed
34 % constant near to mu
35 % params.NumberOfParameters = int : size of the test set used in the SCM
36 % Greedy procedure
37 % params.eps = double : error boundary of the Greedy procedure
38 %
39 % params.max_iterations = int : maximal number of Greedy iterations
40 %
41 % params.dirichlet_gids : Indices to remove the dirichlet boundary
42 % conditions
43 %
44 % params.parallel = 0 non parallel version
45 % = 1 parallel (pool stays active after
46 % computation)
47 % = 2 parallel (closing pool afterwards)
48 %
49 %
50 %
51 % David Kreplin 05.01.2015
52 
53 
54 % Allows the call SCM_data=SCM(model,params,model_data);
55 if ~isa(operator, 'function_handle')
56 
57  if nargin == 3
58  innerproduct_matrix = model.get_inner_product_matrix(operator);
59  end
60  operator =@ (model) model.operators(model,operator);
61 end
62 
63 if ~isfield(params, 'type')
64  params.type = 'infsup';
65  warning('No scm type defined! Setting type = "infsup". For coercive constants type="coercive" will be faster!');
66 end
67 
68 
69 if ~isfield(params, 'dirichlet_gids')
70  params.dirichlet_gids = [];
71 end
72 
73 %coercive case
74 if strcmp(params.type,'coercive');
75  SCM_data = scm_coercive_greedy(model, params, operator, innerproduct_matrix);
76 end
77 
78 %infsup case
79 if strcmp(params.type,'infsup');
80  SCM_data = scm_infsup_greedy(model, params, operator, innerproduct_matrix);
81 end
82 
83 disp('-- SCM: finished!');
84 
85 
86 end
87 
function SCM_data = scm_coercive_greedy(model, params, operator, innerproduct_matrix)
model=scm_greedy(model, model_data)
function scm_infsup_demo()
scm_infsup_demo()
Customizable implementation of an abstract greedy algorithm.
Definition: DuneRBLeafNode.m:1
function scm_coercive_demo()
scm_coercive_demo()
function SCM_data = scm_infsup_greedy(model, params, operator, innerproduct_matrix)
model=scm_greedy(model, model_data)