Mercurial > repos > public > sbplib
diff +sbp/+implementations/d2_variable_2.m @ 890:c70131daaa6e feature/d1_staggered
Merge with feature/poroelastic.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Wed, 21 Nov 2018 18:29:29 -0800 |
parents | b758d1cf4c8e |
children | e54c2f54dbfe |
line wrap: on
line diff
--- a/+sbp/+implementations/d2_variable_2.m Sun Nov 04 12:36:30 2018 -0800 +++ b/+sbp/+implementations/d2_variable_2.m Wed Nov 21 18:29:29 2018 -0800 @@ -27,7 +27,7 @@ diags = -1:1; stencil = [-1/2 0 1/2]; D1 = stripeMatrix(stencil, diags, m); - + D1(1,1)=-1;D1(1,2)=1;D1(m,m-1)=-1;D1(m,m)=1; D1(m,m-1)=-1;D1(m,m)=1; D1=D1/h; @@ -40,7 +40,7 @@ scheme_radius = (scheme_width-1)/2; r = (1+scheme_radius):(m-scheme_radius); - function D2 = D2_fun(c) + function [D2, B] = D2_fun(c) Mm1 = -c(r-1)/2 - c(r)/2; M0 = c(r-1)/2 + c(r) + c(r+1)/2; @@ -54,6 +54,8 @@ M=M/h; D2=HI*(-M-c(1)*e_l*d1_l'+c(m)*e_r*d1_r'); + B = HI*M; end D2 = @D2_fun; + end \ No newline at end of file