-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupAMGCL.m
62 lines (49 loc) · 1.9 KB
/
setupAMGCL.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
%%%Copyright 2018 SINTEF AS
function lsolve = setupAMGCL(model)
ncomp = model.water + model.oil + model.gas;
lsolve = AMGCL_CPRSolverAD('block_size', 2, 'maxIterations', 150, 'tolerance', 1e-2);
lsolve.amgcl_setup.use_drs = true;
% Optimal?
lsolve.setCoarsening('aggregation')
% lsolve.setCoarsening('smoothed_aggregation')
% lsolve.setCoarsening('ruge_stuben')
% lsolve.setRelaxation('spai0');
lsolve.setRelaxation('ilu0');
lsolve.setSRelaxation('ilu0');
% lsolve.setSRelaxation('spai0');
lsolve.amgcl_setup.verbose = false;
% lsolve.setSRelaxation('ilu0');
lsolve.amgcl_setup.npre = 1;
lsolve.amgcl_setup.npost = 1;
lsolve.amgcl_setup.ncycle = 1;
% lsolve.amgcl_setup.max_levels = 4;
% lsolve.amgcl_setup.pre_cycles = 2;
lsolve.amgcl_setup.direct_coarse = false;
% lsolve.amgcl_setup.coarse_enough = 5000;
% lsolve.setRelaxation('damped_jacobi');
% Experimental
% lsolve.setSolver('idrs');
%lsolve.setSolver('bicgstabl');
%lsolve.amgcl_setup.bicgstabl_l = 10;
% lsolve.amgcl_setup.bicgstabl_delta = 0;
% lsolve.amgcl_setup.bicgstabl_convex = false;
% lsolve.setSolver('fgmres');
% lsolve.amgcl_setup.idrs_omega = 0;
% lsolve.amgcl_setup.idrs_s = 4;
% lsolve.setRelaxation('ilu0');
% lsolve.setCoarsening('smoothed_aggregation');
% lsolve.amgcl_setup.npre = 1;
lsolve.amgcl_setup.drs_eps_dd = 0.3;
lsolve.amgcl_setup.drs_eps_ps = 0.1*lsolve.amgcl_setup.drs_eps_dd;
% lsolve.applyRightDiagonalScaling = true;
lsolve.doApplyScalingCPR = true;
lsolve.trueIMPES = false;
lsolve.amgcl_setup.use_drs = false;
if isa(model.AutoDiffBackend, 'DiagonalAutoDiffBackend')
%lsolve.reduceToCell = true;
lsolve.keepNumber = model.G.cells.num*ncomp;
lsolve.amgcl_setup.active_rows = model.G.cells.num*ncomp;
end
lsolve.verbose = true;
lsolve.amgcl_setup.verbose = false;
end