Mercurial > repos > public > sbplib
annotate +sbp/+implementations/d4_variable_hollow_6.m @ 1305:b5907140c069 feature/poroelastic
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Mon, 13 Jul 2020 14:21:41 -0700 |
parents | 49e3870335ef |
children |
rev | line source |
---|---|
1303
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
1 function [H, HI, D1, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = d4_variable_hollow_6(m,h) |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
3 %%% 6:te ordn. SBP Finita differens %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
4 %%% operatorer med diagonal norm %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
5 %%% Extension to variable koeff %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
6 %%% %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
7 %%% H (Normen) %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
8 %%% D1=H^(-1)Q (approx f?rsta derivatan) %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
9 %%% D2 (approx andra derivatan) %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
10 %%% D2=HI*(R+C*D*S %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
11 %%% %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
12 %%% R=-D1'*H*C*D1-RR %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
13 %%% %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
14 %%% RR ?r dissipation) %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
15 %%% Dissipationen uppbyggd av D4: %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
16 %%% DI=D4*B*H*D4 %%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
18 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
19 BP = 9; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
20 if(m<2*BP) |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
21 error(['Operator requires at least ' num2str(2*BP) ' grid points']); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
22 end |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
23 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
24 % Norm |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
25 Hv = ones(m,1); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
26 Hv(1:6) = [13649/43200,12013/8640,2711/4320,5359/4320,7877/8640, 43801/43200]; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
27 Hv(m-5:m) = rot90(Hv(1:6),2); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
28 Hv = h*Hv; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
29 H = spdiag(Hv, 0); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
30 HI = spdiag(1./Hv, 0); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
31 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
32 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
33 % Boundary operators |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
34 e_l = sparse(m,1); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
35 e_l(1) = 1; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
36 e_r = rot90(e_l, 2); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
37 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
38 d1_l = sparse(m,1); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
39 d1_l(1:5) = [-25/12, 4, -3, 4/3, -1/4]/h; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
40 d1_r = -rot90(d1_l, 2); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
41 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
42 d2_l = sparse(m,1); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
43 d2_l(1:5) = [0.35e2/0.12e2 -0.26e2/0.3e1 0.19e2/0.2e1 -0.14e2/0.3e1 0.11e2/0.12e2;]/h^2; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
44 d2_r = rot90(d2_l, 2); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
45 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
46 d3_l = sparse(m,1); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
47 d3_l(1:5) = [-5/2 9 -12 7 -3/2]/h^3; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
48 d3_r = -rot90(d3_l, 2); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
49 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
50 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
51 % First derivtive |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
52 x1=0.70127127127127; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
53 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
54 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
55 D1=(1/60*diag(ones(m-3,1),3)-9/60*diag(ones(m-2,1),2)+45/60*diag(ones(m-1,1),1)-45/60*diag(ones(m-1,1),-1)+9/60*diag(ones(m-2,1),-2)-1/60*diag(ones(m-3,1),-3)); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
56 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
57 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
58 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
59 D1(1:6,1:9)=[-21600/13649, 43200/13649*x1-7624/40947, -172800/13649*x1+ ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
60 715489/81894, 259200/13649*x1-187917/13649, -172800/13649* ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
61 x1+735635/81894, 43200/13649*x1-89387/40947, 0, 0, 0; ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
62 -8640/12013*x1+7624/180195, 0, 86400/12013*x1-57139/12013, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
63 -172800/12013*x1+745733/72078, 129600/12013*x1-91715/12013, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
64 -34560/12013*x1+240569/120130, 0, 0, 0; ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
65 17280/2711*x1-715489/162660, -43200/2711*x1+57139/5422, 0, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
66 86400/2711*x1-176839/8133, -86400/2711*x1+242111/10844, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
67 25920/2711*x1-182261/27110, 0, 0, 0; ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
68 -25920/5359*x1+187917/53590, 86400/5359*x1-745733/64308, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
69 -86400/5359*x1+176839/16077, 0, 43200/5359*x1-165041/32154, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
70 -17280/5359*x1+710473/321540, 72/5359, 0, 0; ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
71 34560/7877*x1-147127/47262, -129600/7877*x1+91715/7877, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
72 172800/7877*x1-242111/15754, -86400/7877*x1+165041/23631, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
73 0, 8640/7877*x1, -1296/7877, 144/7877, 0; ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
74 -43200/43801*x1+89387/131403, 172800/43801*x1-240569/87602,... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
75 -259200/43801*x1+182261/43801, 172800/43801*x1-710473/262806, ... |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
76 -43200/43801*x1, 0, 32400/43801, -6480/43801, 720/43801]; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
77 D1(m-5:m,m-8:m)=rot90( -D1(1:6,1:9),2); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
78 D1=D1/h; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
79 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
80 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
81 % Second derivative |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
82 nBP = 9; |
1305
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
83 M = sparse(m,m); |
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
84 coeffs = load('sbplib/+sbp/+implementations/coeffs_d2_variable_6.mat'); |
1303
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
85 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
86 function D2 = D2_fun(c) |
1305
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
87 M_l = zeros(nBP, coeffs.nBPC); |
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
88 M_r = zeros(nBP, coeffs.nBPC); |
1303
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
89 |
1305
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
90 for i=1:coeffs.nBPC |
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
91 M_l = M_l + coeffs.C_l{i}*c(i); |
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
92 M_r = M_r + coeffs.C_r{i}*c(m-coeffs.nBPC+i); |
1303
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
93 end |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
94 |
1305
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
95 M(1:nBP, 1:coeffs.nBPC) = M_l; |
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
96 M(m-nBP+1:m, m-coeffs.nBPC+1:m) = M_r; |
1303
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
97 |
1305
b5907140c069
Clean up hollow D2 generation by using precomputed coefficients stored in mat files
Martin Almquist <malmquist@stanford.edu>
parents:
1303
diff
changeset
|
98 D2 = M/h^2; |
1303
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
99 end |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
100 D2 = @D2_fun; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
101 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
102 % Fourth derivative, 1th order accurate at first 8 boundary points (still |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
103 % yield 5th order convergence if stable: for example u_tt=-u_xxxx |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
104 stencil = [7/240, -2/5, 169/60, -122/15, 91/8, -122/15, 169/60, -2/5, 7/240]; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
105 diags = -4:4; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
106 M4 = stripeMatrix(stencil, diags, m); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
107 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
108 M4_U = [ |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
109 0.1394226315049e13/0.367201486080e12 -0.1137054563243e13/0.114750464400e12 0.16614189027367e14/0.1836007430400e13 -0.1104821700277e13/0.306001238400e12 0.1355771086763e13/0.1836007430400e13 -0.27818686453e11/0.459001857600e12 -0.40671054239e11/0.1836007430400e13 0.5442887371e10/0.306001238400e12; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
110 -0.1137054563243e13/0.114750464400e12 0.70616795535409e14/0.2570410402560e13 -0.173266854731041e15/0.6426026006400e13 0.28938615291031e14/0.2570410402560e13 -0.146167361863e12/0.71400288960e11 0.2793470836571e13/0.12852052012800e14 0.6219558097e10/0.428401733760e12 -0.7313844559e10/0.166909766400e12; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
111 0.16614189027367e14/0.1836007430400e13 -0.173266854731041e15/0.6426026006400e13 0.378613061504779e15/0.12852052012800e14 -0.9117069604217e13/0.642602600640e12 0.632177582849e12/0.233673672960e12 -0.1057776382577e13/0.6426026006400e13 0.443019868399e12/0.4284017337600e13 -0.3707981e7/0.2318191200e10; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
112 -0.1104821700277e13/0.306001238400e12 0.28938615291031e14/0.2570410402560e13 -0.9117069604217e13/0.642602600640e12 0.5029150721885e13/0.514082080512e12 -0.5209119714341e13/0.1285205201280e13 0.12235427457469e14/0.12852052012800e14 -0.13731270505e11/0.64260260064e11 0.2933596129e10/0.40800165120e11; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
113 0.1355771086763e13/0.1836007430400e13 -0.146167361863e12/0.71400288960e11 0.632177582849e12/0.233673672960e12 -0.5209119714341e13/0.1285205201280e13 0.14871726798559e14/0.2570410402560e13 -0.7504337615347e13/0.1606506501600e13 0.310830296467e12/0.171360693504e12 -0.55284274391e11/0.183600743040e12; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
114 -0.27818686453e11/0.459001857600e12 0.2793470836571e13/0.12852052012800e14 -0.1057776382577e13/0.6426026006400e13 0.12235427457469e14/0.12852052012800e14 -0.7504337615347e13/0.1606506501600e13 0.106318657014853e15/0.12852052012800e14 -0.14432772918527e14/0.2142008668800e13 0.58102695589e11/0.22666758400e11; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
115 -0.40671054239e11/0.1836007430400e13 0.6219558097e10/0.428401733760e12 0.443019868399e12/0.4284017337600e13 -0.13731270505e11/0.64260260064e11 0.310830296467e12/0.171360693504e12 -0.14432772918527e14/0.2142008668800e13 0.27102479467823e14/0.2570410402560e13 -0.1216032192203e13/0.153000619200e12; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
116 0.5442887371e10/0.306001238400e12 -0.7313844559e10/0.166909766400e12 -0.3707981e7/0.2318191200e10 0.2933596129e10/0.40800165120e11 -0.55284274391e11/0.183600743040e12 0.58102695589e11/0.22666758400e11 -0.1216032192203e13/0.153000619200e12 0.20799922829107e14/0.1836007430400e13; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
117 ]; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
118 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
119 M4(1:8,1:8) = M4_U; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
120 M4(m-7:m,m-7:m) = rot90( M4_U ,2 ); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
121 M4 = M4/h^3; |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
122 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
123 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
124 |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
125 D4=HI*(M4 - e_l*d3_l'+e_r*d3_r' + d1_l*d2_l'-d1_r*d2_r'); |
49e3870335ef
Make the hollow scheme generation more efficient by introducing the D2VariableHollow opSet
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
126 end |