Mercurial > repos > public > sbplib
diff +sbp/+implementations/d4_variable_6.m @ 316:203afa156f59 feature/beams
Collected boundary operators.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 23 Sep 2016 23:10:44 +0200 |
parents | 9230c056a574 |
children | c7ac7e12de8a |
line wrap: on
line diff
--- a/+sbp/+implementations/d4_variable_6.m Fri Sep 23 22:58:45 2016 +0200 +++ b/+sbp/+implementations/d4_variable_6.m Fri Sep 23 23:10:44 2016 +0200 @@ -16,15 +16,6 @@ %%% DI=D4*B*H*D4 %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - %m=10; %problemstorlek - %h=1/(m-1); - - % Variable koefficicients are stored in vector: c, size m, - % with the unknown stored as c(1), c(2), ..., c_m - % x=1:h:m*h;x=x'; - % c=x.^0; - BP = 8; if(m<2*BP) error(['Operator requires at least ' num2str(2*BP) ' grid points']); @@ -76,7 +67,24 @@ S_m(m-4:m)=fliplr(-S_U); S_1 = S_1'; S_m = S_m'; - + e_1 = sparse(e_1); + e_m = sparse(e_m); + S_1 = sparse(S_1); + S_m = sparse(S_m); + S2_U=[0.35e2/0.12e2 -0.26e2/0.3e1 0.19e2/0.2e1 -0.14e2/0.3e1 0.11e2/0.12e2;]/h^2; + S2_1=sparse(1,m); + S2_1(1:5)=S2_U; + S2_m=sparse(1,m); + S2_m(m-4:m)=fliplr(S2_U); + S2_1 = S2_1'; + S2_m = S2_m'; + S3_U = [-5/2 9 -12 7 -3/2]/h^3; + S3_1 = sparse(1,m); + S3_1(1:5)=S3_U; + S3_m = sparse(1,m); + S3_m(m-4:m) = fliplr(-S3_U); + S3_1 = S3_1'; + S3_m = S3_m'; %DS=sparse(m,m); @@ -90,10 +98,6 @@ M=sparse(m,m); - e_1 = sparse(e_1); - e_m = sparse(e_m); - S_1 = sparse(S_1); - S_m = sparse(S_m); scheme_width = 7; scheme_radius = (scheme_width-1)/2; @@ -145,13 +149,7 @@ end D2 = @D2_fun; - S2_U=[0.35e2/0.12e2 -0.26e2/0.3e1 0.19e2/0.2e1 -0.14e2/0.3e1 0.11e2/0.12e2;]/h^2; - S2_1=sparse(1,m); - S2_1(1:5)=S2_U; - S2_m=sparse(1,m); - S2_m(m-4:m)=fliplr(S2_U); - S2_1 = S2_1'; - S2_m = S2_m'; + @@ -189,13 +187,7 @@ M4(m-7:m,m-7:m) = rot90( M4_U ,2 ); M4 = M4/h^3; - S3_U = [-5/2 9 -12 7 -3/2]/h^3; - S3_1 = sparse(1,m); - S3_1(1:5)=S3_U; - S3_m = sparse(1,m); - S3_m(m-4:m) = fliplr(-S3_U); - S3_1 = S3_1'; - S3_m = S3_m'; + D4=HI*(M4-e_1*S3_1'+e_m*S3_m' + S_1*S2_1'-S_m*S2_m');